query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d0769254b6a842bac8be6d5d89a42098
Extract the scheme of a URL.
[ { "docid": "7915c407134fbc9565c935eacb762729", "score": "0.83154285", "text": "function getUrlScheme(url){var match=_split(url);return match&&match[_ComponentIndex.Scheme]||'';}// The code below is adapted from Traceur:", "title": "" } ]
[ { "docid": "d6f0bc206488a3571fd96eb520375279", "score": "0.8400189", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || \"\";\n }", "title": "" }, { "docid": "6b41961dc72fb7198fea19e3d7d233a5", "score": "0.8352593", "text": "function getUrlScheme(url){const match=_split(url);return match&&match[_ComponentIndex.Scheme]||'';}// The code below is adapted from Traceur:", "title": "" }, { "docid": "bafe7752e8454185815a5f262334657c", "score": "0.83205897", "text": "function getUrlScheme(url) {\n const match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "bafe7752e8454185815a5f262334657c", "score": "0.83205897", "text": "function getUrlScheme(url) {\n const match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "bafe7752e8454185815a5f262334657c", "score": "0.83205897", "text": "function getUrlScheme(url) {\n const match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "bafe7752e8454185815a5f262334657c", "score": "0.83205897", "text": "function getUrlScheme(url) {\n const match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "3c4c45671b8e6bfcb83bb67eb39170ca", "score": "0.8310414", "text": "function getUrlScheme(url) {\n\t var match = _split(url);\n\t return (match && match[_ComponentIndex.Scheme]) || '';\n\t}", "title": "" }, { "docid": "3de4b0846cab26472b28e5af62c1f1a0", "score": "0.8283954", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "3de4b0846cab26472b28e5af62c1f1a0", "score": "0.8283954", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "3de4b0846cab26472b28e5af62c1f1a0", "score": "0.8283954", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "3de4b0846cab26472b28e5af62c1f1a0", "score": "0.8283954", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "3de4b0846cab26472b28e5af62c1f1a0", "score": "0.8283954", "text": "function getUrlScheme(url) {\n var match = _split(url);\n return (match && match[_ComponentIndex.Scheme]) || '';\n}", "title": "" }, { "docid": "97450df8b765e042eac7d06ec3095b26", "score": "0.8214953", "text": "function getProtocolScheme(url) {\n var e = new RegExp('^([a-z]+):'),\n matches = e.exec(url);\n\n return matches ? matches[1] : null;\n }", "title": "" }, { "docid": "2ca0b2461727985a7c90b332a0ab6b2c", "score": "0.70129997", "text": "function getProtocol(url){\r\n\treturn url.substring(0,url.indexOf(\":\"));\r\n}", "title": "" }, { "docid": "2785e365e38bedacc233339b9e160803", "score": "0.6976105", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n }", "title": "" }, { "docid": "40d62362293b7efdab3bc4611f3090bd", "score": "0.68398184", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(`The url string provided does not contain a scheme. ` +\n `Supported schemes are: ` +\n `${ModelStoreManagerRegistry.getSchemes().join(',')}`);\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "5c8549931b7183d591cf079dc3c4a140", "score": "0.67287695", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\"The url string provided does not contain a scheme. \" +\n \"Supported schemes are: \" +\n (\"\" + ModelStoreManagerRegistry.getSchemes().join(',')));\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "5c8549931b7183d591cf079dc3c4a140", "score": "0.67287695", "text": "function parseURL(url) {\n if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {\n throw new Error(\"The url string provided does not contain a scheme. \" +\n \"Supported schemes are: \" +\n (\"\" + ModelStoreManagerRegistry.getSchemes().join(',')));\n }\n return {\n scheme: url.split(URL_SCHEME_SUFFIX)[0],\n path: url.split(URL_SCHEME_SUFFIX)[1],\n };\n}", "title": "" }, { "docid": "e363bc15f90a455e5553eb8ffff0ec14", "score": "0.65633446", "text": "function getHostName(url) {\n // scheme : // [username [: password] @] hostame [: port] [/ [path] [? query] [# fragment]]\n var e = new RegExp('^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)'),\n matches = e.exec(url);\n\n return matches ? matches[1] : url;\n }", "title": "" }, { "docid": "4ec69f38dac3c5df8eda345676bff4d9", "score": "0.6440439", "text": "function getHostFromURL(href) {\n var parsedUrl = href.match(/^(https?\\:)\\/\\/(([^:\\/?#]*)(?:\\:([0-9]+))?)(\\/[^?#]*)(\\?[^#]*|)(#.*|)$/);\n var protocol = parsedUrl[1];\n var hostWithPort = parsedUrl[2];\n return protocol + \"//\" + hostWithPort;\n }", "title": "" }, { "docid": "51904321a81eea713d66a9487d0a7b75", "score": "0.643221", "text": "function getHost(url) {\n return url.replace(/^(\\w+:\\/\\/[^/]*)\\/?.*$/, '$1');\n }", "title": "" }, { "docid": "9011fc62230dbcffc019700dc637c36d", "score": "0.63802093", "text": "function extractHostFromURL(/**String*/ url)\n{\n if (url && extractHostFromURL._lastURL == url)\n return extractHostFromURL._lastDomain;\n\n var host = \"\";\n try\n {\n host = new URI(url).host;\n }\n catch (e)\n {\n // Keep the empty string for invalid URIs.\n }\n\n extractHostFromURL._lastURL = url;\n extractHostFromURL._lastDomain = host;\n return host;\n}", "title": "" }, { "docid": "f0734d31839e8276ceb17c3e4024c007", "score": "0.6373885", "text": "function cleanURL(url) {\n // First, check that there is a URL scheme in the url\n if (regexMatchURLScheme.exec(url)) {\n // If there is, replace the matched group with nothing\n return url.replace(regexMatchURLScheme, '');\n } else{\n // Otherwise, there is no URL scheme so just return the url\n return url;\n }\n}", "title": "" }, { "docid": "294da48976f0d34813da5767fb9994fe", "score": "0.6319685", "text": "function extractHostname(url) {\n var hostname; //find & remove protocol (http, ftp, etc.) and get hostname\n\n if (url.indexOf(\"//\") > -1) {\n hostname = url.split('/')[2];\n } else {\n hostname = url.split('/')[0];\n } //find & remove port number\n\n\n hostname = hostname.split(':')[0]; //find & remove \"?\"\n\n hostname = hostname.split('?')[0];\n return hostname;\n}", "title": "" }, { "docid": "e22d29bdc0c3725ed5ba27f21223fd55", "score": "0.63056546", "text": "protocolForURL(s) {\n return s;\n }", "title": "" }, { "docid": "0eae4b8ffc876881f85eef071630dceb", "score": "0.62833065", "text": "function extractHostname(url) {\n var hostname;\n if (url.indexOf(\"://\") > -1) {\n hostname = url.split('/')[2];\n }\n else {\n hostname = url.split('/')[0];\n }\n hostname = hostname.split(':')[0];\n hostname = hostname.split('?')[0];\n return hostname;\n}", "title": "" }, { "docid": "a4872918ec0366234cd3b07788ccdc05", "score": "0.6282603", "text": "extractHostname(url) {\n var hostname;\n //find & remove protocol (http, ftp, etc.) and get hostname\n\n if (url.indexOf(\"//\") > -1) {\n hostname = url.split('/')[2];\n }\n else {\n hostname = url.split('/')[0];\n }\n\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove \"?\"\n hostname = hostname.split('?')[0];\n\n return hostname;\n }", "title": "" }, { "docid": "4c92170d8bbee0a331253abf80a5f06d", "score": "0.62697744", "text": "protocolForURL(s) {\n return s;\n }", "title": "" }, { "docid": "4c92170d8bbee0a331253abf80a5f06d", "score": "0.62697744", "text": "protocolForURL(s) {\n return s;\n }", "title": "" }, { "docid": "2d59ffda2f3c179d9f8939f5d81e23dc", "score": "0.6264759", "text": "get scheme()\n\t{\n\t\tif (this.debug) this.logInfo(\"get scheme\");\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "8263b85e4c9cad771b6b862123a72045", "score": "0.6248119", "text": "function extractHostname(url) {\n let hostname;\n if (url.indexOf('://') > -1) {\n hostname = url.split('/')[2];\n } else {\n hostname = url.split('/')[0];\n }\n\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove '?'\n return hostname.split('?')[0];\n}", "title": "" }, { "docid": "9eb9d123550c153829da73091213f4b5", "score": "0.62422067", "text": "function getDomainFromUrl(url) {\r\n\treturn url.match(/:\\/\\/(.[^/]+)\\:/)[1];\r\n}", "title": "" }, { "docid": "0d4929e5e800f686a8ab9324ddaf104f", "score": "0.6203181", "text": "function extractHostname(url) {\n var hostname;\n //find & remove protocol (http, ftp, etc.) and get hostname\n\n if (url.indexOf(\"://\") > -1) {\n hostname = url.split('/')[2];\n }\n else {\n hostname = url.split('/')[0];\n }\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove \"?\"\n hostname = hostname.split('?')[0];\n\n return hostname;\n }", "title": "" }, { "docid": "1b3bfc325efd19f20be40e206d5f6c59", "score": "0.6173275", "text": "function get_hostname(url) {\n if (url.includes(\"://\")) {\n var match = url.match(/:\\/\\/(www[0-9]?\\.)?(.[^/:]+)/i);\n if (match != null && match.length > 2 && typeof match[2] === \"string\" && match[2].length > 0) {\n return match[2];\n } else {\n return null;\n }\n } else {\n // If the protocol is not specified in the URL\n return url.split(\"/\")[0];\n }\n}", "title": "" }, { "docid": "8483fe0e0493a7e739d08cd47980bd79", "score": "0.6144623", "text": "function getHost(url){\r\n\tvar hostPattern = /\\w+:\\/\\/([^\\/]+)(\\/)?/i;\r\n\tvar domain = url.match(hostPattern);\r\n\t//console.log(domain[1]);\r\n\treturn domain[1];\r\n}", "title": "" }, { "docid": "d9f09321fe519e48cb2488cd6c656ed0", "score": "0.6134246", "text": "getHostName(url) {\n //TODO: URL method here\n return url.split(\"//\")[1].split(\"/\")[0]; \n }", "title": "" }, { "docid": "832f65e3d0ad6ac0848e28ddf48270b7", "score": "0.6104561", "text": "function extractDomain(url) {\n\t\tvar domain;\n\t\tif (url.indexOf(\"://\") > -1) {\n\t\t\tdomain = url.split('/')[2];\n\t\t\tdomain = domain.split(':')[0];\n\t\t\tdomain = url.split('/')[0]+\"//\"+domain;\n\t\t}\n\t\telse {\n\t\t\tdomain = url.split('/')[0];\n\t\t\tdomain = domain.split(':')[0];\n\t\t}\n\t\treturn domain\n}", "title": "" }, { "docid": "5c37e7daac0371a30c1de34be8b08ceb", "score": "0.60463107", "text": "function extractOrigin(url) {\n if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n if (m) return m[1];\n return url;\n }", "title": "" }, { "docid": "f00f22d3314bcfe71ef1dc898eed9074", "score": "0.60065913", "text": "function getDomainFromUrl(url) \n {\n var arr = url.split(\"/\");\n return arr[0] + \"//\" + arr[2];\n }", "title": "" }, { "docid": "7935b41efffdf09f5c8040e56c75b71c", "score": "0.5994335", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[-_a-zA-Z.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t}", "title": "" }, { "docid": "7935b41efffdf09f5c8040e56c75b71c", "score": "0.5994335", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[-_a-zA-Z.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t}", "title": "" }, { "docid": "4b74e17c9558918671d4d188e3821b34", "score": "0.5986797", "text": "function parseUri(url) {\n var match = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n return (match ? { href: match[0] || '', protocol: match[1] || '', authority: match[2] || '', host: match[3] || '', hostname: match[4] || '',\n port: match[5] || '', pathname: match[6] || '', search: match[7] || '', hash: match[8] || '' } : null);\n }", "title": "" }, { "docid": "80145d008d529842f73f349cd0aac2a6", "score": "0.59815186", "text": "function extractDomain(url)\n {\n var re = /:\\/\\/(www\\.)?(.+?)\\//;\n return url.match(re)[2];\n }", "title": "" }, { "docid": "128f3c5788ba54d47eea007a4e4710b7", "score": "0.5973076", "text": "function domainFromURL(url) {\n var domain;\n if (url.indexOf('://') == -1) {\n domain = url.split('/')[0];\n } else {\n domain = url.split('/')[2];\n }\n \n return domain;\n}", "title": "" }, { "docid": "4ef84e22172b014cc7c31da7d4d8b761", "score": "0.5958058", "text": "function parseUri(url) {\n\t\tvar match = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t\treturn (match ? { href: match[0] || '', protocol: match[1] || '', authority: match[2] || '', host: match[3] || '', hostname: match[4] || '',\n\t\t port: match[5] || '', pathname: match[6] || '', search: match[7] || '', hash: match[8] || '' } : null);\n\t}", "title": "" }, { "docid": "0fa3f3ee98addf511f01f6462c6c4482", "score": "0.595445", "text": "function parseUri(url) {\n var match = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n return (match ? { href: match[0] || '', protocol: match[1] || '', authority: match[2] || '', host: match[3] || '', hostname: match[4] || '',\n port: match[5] || '', pathname: match[6] || '', search: match[7] || '', hash: match[8] || '' } : null);\n }", "title": "" }, { "docid": "6e9962883493cc46e7b352f303289a4c", "score": "0.59274244", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "title": "" }, { "docid": "6e9962883493cc46e7b352f303289a4c", "score": "0.59274244", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "title": "" }, { "docid": "6e9962883493cc46e7b352f303289a4c", "score": "0.59274244", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "title": "" }, { "docid": "6e9962883493cc46e7b352f303289a4c", "score": "0.59274244", "text": "function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }", "title": "" }, { "docid": "2309e64c998e0126ed1bacb31a786520", "score": "0.5922738", "text": "function extractDomain(url) {\n var domain;\n //find & remove protocol (http, ftp, etc.) and get domain\n if (url.indexOf(\"://\") > -1) {\n domain = url.split('/')[2];\n }\n else {\n domain = url.split('/')[0];\n }\n \n //find & remove www\n if (domain.indexOf(\"www.\") > -1) { \n domain = domain.split('www.')[1];\n }\n \n domain = domain.split(':')[0]; //find & remove port number\n domain = domain.split('?')[0]; //find & remove url params\n \n return domain;\n }", "title": "" }, { "docid": "8c856742fe700734ebd6f6771c5cf562", "score": "0.59190786", "text": "function stripProtocolFromUrl(loc) {\n if (loc === undefined) {\n return false;\n }\n\n var prot = loc.substring(0, 5);\n if (prot === 'http:') {\n return loc.substring(7);\n }\n\n if (prot === 'https') {\n return loc.substring(8);\n }\n\n // No http or https, no lookup\n return false;\n}", "title": "" }, { "docid": "b5b21fdf4b07d1dcc2a3ed9998290b92", "score": "0.5918196", "text": "function extractHostname(url) {\n var hostname;\n //find & remove protocol (http, ftp, etc.) and get hostname\n if (url.indexOf(\"//\") > -1) {\n hostname = url.split('/')[2];\n } else {\n hostname = url.split('/')[0];\n }\n if (hostname.indexOf(\"www.\") > -1) {\n hostname = hostname.split('www.')[1];\n }\n //find & remove port number\n hostname = hostname.split(':')[0];\n //find & remove \"?\"\n hostname = hostname.split('?')[0];\n //find & remove top level domain\n hostname = hostname.split('.')[0];\n return hostname;\n}", "title": "" }, { "docid": "40b950eb74c383838a2dfbf3d98528fd", "score": "0.59087497", "text": "function extractUrl(url) {\n if (typeof url === 'string') {\n return url;\n }\n var protocol = url.protocol || '';\n var hostname = url.hostname || url.host || '';\n // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n var port = !url.port || url.port === 80 || url.port === 443 ? '' : \":\" + url.port;\n var path = url.path ? url.path : '/';\n // internal routes end up with too many slashes\n return (protocol + \"//\" + hostname + port + path).replace('///', '/');\n}", "title": "" }, { "docid": "2cbe6b6c031f2beda53b5f04f59f590f", "score": "0.59012026", "text": "function getDomainFromUrl(url) { \n\tvar arr = url.split(\"/\"); \n\treturn arr[0] + \"//\" + arr[2]; \n\t}", "title": "" }, { "docid": "856bfe3c919c6ecfa3db17de10ea67a0", "score": "0.5893519", "text": "function urlToHostname(url) {\n var lowerUrl = (url || '').toLowerCase();\n // If we don't have a protocol, we can't assume that what we have is a hostname instead of a path.\n if (!/^[a-z]+:\\/\\//.test(lowerUrl)) {\n return 'invalid';\n }\n var withoutProtocol = lowerUrl.replace(/^(.*):\\/\\//, '');\n // Remove port, fragment, path, query string\n return withoutProtocol.replace(/[:\\/?#](.*)$/, '');\n}", "title": "" }, { "docid": "c0aea62840a44ce4753534a32d51b1e2", "score": "0.58884925", "text": "function parseURL(url, strict) {\n if (typeof url == 'string') url = ONLY_URL_RE.exec(url);\n if (! url || ! urlIsValid(url, strict)) return null;\n return (url[7]) ? {\n scheme: url[7].replace(':', ''),\n delim: ':',\n userinfo: '',\n host: '',\n port: '',\n authority: '',\n rest: url[8],\n full: url[1]\n } : {\n scheme: url[2].replace('://', ''),\n delim: '://',\n userinfo: url[3] || '',\n host: url[4],\n port: url[5] || '',\n authority: (url[3] || '') + url[4] + (url[5] || ''),\n rest: url[6] || '',\n full: url[1]\n };\n }", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "74e3cfa8b02a656263ce9589d4dc1ac9", "score": "0.5865902", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined\n }\n\n var searchIndex = url.indexOf('?')\n var pathLength = searchIndex !== -1\n ? searchIndex\n : url.length\n var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n return fqdnIndex !== -1\n ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n : undefined\n}", "title": "" }, { "docid": "5b555b5ffa8a017459757e5da04d6510", "score": "0.58644783", "text": "function parseHostname(url) {\n\tvar extractionRegex = new RegExp(['^', // start at the beginning of the string\n\t'((\\\\w+:)?//)?', // match a possible protocol, like http://, ftp://, or // for a relative url\n\t'(\\\\w[\\\\w\\\\.\\\\-]+)?', // match a possible domain\n\t'(:\\\\d+)?', // match a possible port\n\t'(\\\\/[^\\\\?#]+)?', // match a possible path\n\t'(\\\\?[^#]+)?', // match possible GET parameters\n\t'(#.*)?' // match the rest of the URL as the hash\n\t].join(''), 'i');\n\n\tvar match = url.toString().match(extractionRegex);\n\treturn match[3];\n}", "title": "" }, { "docid": "49a88223e565b98aa804d6780e633de3", "score": "0.58407944", "text": "function parseUrl(url) {\n // [scheme:[//][[user[:password]@]host[:port]]/][path][?query][#fragment]\n // scheme = [a-z][a-z0-9\\+\\.\\-]* (insensitive case)\n\n /*\n var tmp = (/^(data:|mailto:|file:)/i).exec(url);\n if (tmp === null) { return parseHttpUrl(url); }\n if (tmp[0] === \"data\") { return parseDataUrl(url); }\n if (tmp[0] === \"mailto\") { return parseMailtoUrl(url); }\n if (tmp[0] === \"file\") { return parseFileUrl(url); }\n return parseHttpUrl(url); // ftp: irc[s6]?:\n */\n\n var tmp = parseUrl._parser.exec(url);\n if (tmp === null) { return null; } // should not happen\n return {\n input: url,\n match: tmp[0],\n scheme: tmp[1],\n doubleSlash: tmp[2],\n user: tmp[3],\n password: tmp[4],\n host: tmp[5] || tmp[6],\n port: tmp[7],\n path: tmp[8],\n query: tmp[9],\n fragment: tmp[10]\n };\n //return parseUrl._parser.exec(url); // should never return null\n }", "title": "" }, { "docid": "b98dfdec2785843280aab1f4f66f2eb2", "score": "0.58238184", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined;\n }\n\n var searchIndex = url.indexOf('?');\n var pathLength = searchIndex !== -1 ? searchIndex : url.length;\n var fqdnIndex = url.substr(0, pathLength).indexOf('://');\n\n return fqdnIndex !== -1 ? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) : undefined;\n}", "title": "" }, { "docid": "b98dfdec2785843280aab1f4f66f2eb2", "score": "0.58238184", "text": "function getProtohost(url) {\n if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n return undefined;\n }\n\n var searchIndex = url.indexOf('?');\n var pathLength = searchIndex !== -1 ? searchIndex : url.length;\n var fqdnIndex = url.substr(0, pathLength).indexOf('://');\n\n return fqdnIndex !== -1 ? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) : undefined;\n}", "title": "" }, { "docid": "416e033c7ddc7b80ead869634521e991", "score": "0.5809725", "text": "get scheme() {\n if (this._scheme)\n return this._scheme;\n // if no scheme but have authority or path, we're working with a file\n if (this.path)\n return 'file';\n return '';\n }", "title": "" }, { "docid": "0072a204bb048fd0fce2129504b2a635", "score": "0.5802865", "text": "function getHost(pathInfo)\n{\n if( pathInfo == null )\n {\n return null;\n }\n var index1 = -1;\n var index2 = -1;\n if( startsWith(pathInfo, \"https://\") )\n {\n var index = pathInfo.indexOf(\"/\", 8)\n if( index != -1 )\n {\n return pathInfo.substring(0, index);\n }\n }\n else if( startsWith(pathInfo, \"http://\") )\n {\n var index = pathInfo.indexOf(\"/\", 7);\n if( index != -1 )\n {\n return pathInfo.substring(0, index);\n }\n }\n return null;\n}", "title": "" }, { "docid": "7e8190084af2eec7ce6ba8ccf1c72344", "score": "0.5788077", "text": "function getProtohost(url) {\n\t if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n\t return undefined\n\t }\n\n\t var searchIndex = url.indexOf('?')\n\t var pathLength = searchIndex !== -1\n\t ? searchIndex\n\t : url.length\n\t var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n\t return fqdnIndex !== -1\n\t ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n\t : undefined\n\t}", "title": "" }, { "docid": "7e8190084af2eec7ce6ba8ccf1c72344", "score": "0.5788077", "text": "function getProtohost(url) {\n\t if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {\n\t return undefined\n\t }\n\n\t var searchIndex = url.indexOf('?')\n\t var pathLength = searchIndex !== -1\n\t ? searchIndex\n\t : url.length\n\t var fqdnIndex = url.substr(0, pathLength).indexOf('://')\n\n\t return fqdnIndex !== -1\n\t ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))\n\t : undefined\n\t}", "title": "" }, { "docid": "3227893cc3bd65689bdbaa4e93e7920d", "score": "0.578417", "text": "function getPathFromUrl(url) {\n return url.split(/[?#]/)[0];\n}", "title": "" }, { "docid": "24c30bdd29c1480c45fa0a2d5f39b012", "score": "0.5782386", "text": "function getDomain(url) {\n\tvar domain = _.isObject(url) ? url.host : urlib.parse(url).host;\n\treturn domain || url;\n}", "title": "" }, { "docid": "1b62371332b1800bb0d25e54a8046a92", "score": "0.5769359", "text": "function parseUrlOrigin(url){// url could be domain-relative\n// url could give a domain\n// cross origin means:\n// same domain\n// same port\n// some protocol\n// so, same everything up to the first (single) slash \n// if such is given\n//\n// can ignore everything after that \nvar URL_HOST_PATTERN=/(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,// if no match, use an empty array so that\n// subexpressions 1,2,3 are all undefined\n// and will ultimately return all empty\n// strings as the parse result:\nurlHostMatch=URL_HOST_PATTERN.exec(url)||[];return{protocol:urlHostMatch[1]||'',host:urlHostMatch[2]||'',port:urlHostMatch[3]||''};}", "title": "" }, { "docid": "b6835ea2df68f4e3bae5499669696ca1", "score": "0.57677424", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n }", "title": "" }, { "docid": "e13a7cc1c1c00c6f0b83b7e47b411d5f", "score": "0.57419664", "text": "function parseURI(url) {\n\t\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\t\treturn (m ? {\n\t\t\thref : m[0] || '',\n\t\t\tprotocol : m[1] || '',\n\t\t\tauthority: m[2] || '',\n\t\t\thost : m[3] || '',\n\t\t\thostname : m[4] || '',\n\t\t\tport : m[5] || '',\n\t\t\tpathname : m[6] || '',\n\t\t\tsearch : m[7] || '',\n\t\t\thash : m[8] || ''\n\t\t} : null);\n\t}", "title": "" }, { "docid": "180d9ffb7340f04fab05c42e8cd12c13", "score": "0.57192194", "text": "function extractDomain(url) {\n var domain;\n //find & remove protocol (http, ftp, etc.) and get domain\n if (url.indexOf('://') > -1) {\n domain = url.split('/')[2];\n }\n else {\n domain = url.split('/')[0];\n }\n\n //find & remove port number\n domain = domain.split(':')[0];\n\n // also remove 'www.' -@techieshark\n if (domain.indexOf('www.') > -1) {\n domain = domain.split('www.')[1];\n }\n\n return domain;\n }", "title": "" }, { "docid": "970e429582ce9e2f96c79880781ce6ad", "score": "0.56819427", "text": "function getPath(url)\n{\n return url.replace(/https?:\\/\\/[^\\/]*/, '');\n}", "title": "" }, { "docid": "e11f29a42148f08356304ade150c4775", "score": "0.56806993", "text": "function domainName2(url){\n if (url.indexOf(\"://\") != -1) { \n url = url.split(\"://\")[1]; \n }\n if (url.indexOf(\"www.\") != -1) {\n url = url.split(\"www.\")[1]; \n }\n return url.split(\".\")[0];\n}", "title": "" }, { "docid": "21c77936785c472d56d18bb4b9c4346a", "score": "0.567193", "text": "get_pathname_url(url) {\n if(!url || !url.includes('linkedin') || !url.includes('/in/')) {\n log.error(\"action.get_pathname_url incorrect url format:\", url)\n return url\n }\n\n var pathname = new URL(url).pathname\n pathname = pathname.split( '/' )[2]\n\n log.debug(\"action.get_pathname_url:\", pathname)\n return pathname\n }", "title": "" }, { "docid": "dbf2b0cafeaa750b5d853757249a9838", "score": "0.56586075", "text": "function get_base_url(url) {\n const pathArray = url.trim().split( '/' );\n const protocol = pathArray[0];\n const host = pathArray[2];\n const base_url = protocol + '//' + host;\n return base_url;\n}", "title": "" }, { "docid": "7975175253b6a1faba0c55fd31903c97", "score": "0.5647697", "text": "function getDomain(url) {\n let u = new URL(url);\n return u.hostname;\n}", "title": "" }, { "docid": "a3ff260000626f13d92d0cf852d062b8", "score": "0.5646143", "text": "function parseURI(url) {\n const m = String(url).match(/^([^:/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n // authority = '//' + user + ':' + pass '@' + hostname + ':' port\n return (m ? {\n href : m[0] || '',\n protocol : m[1] || '',\n authority: m[2] || '',\n host : m[3] || '',\n hostname : m[4] || '',\n port : m[5] || '',\n pathname : m[6] || '',\n search : m[7] || '',\n hash : m[8] || ''\n } : null);\n}", "title": "" }, { "docid": "3b4feac469d6d4226030251944625608", "score": "0.56431794", "text": "function _extractUrl(importRule) {\r\n var match = lang_1.RegExpWrapper.firstMatch(_urlRe, importRule);\r\n if (lang_1.isBlank(match))\r\n return null;\r\n return lang_1.isPresent(match[1]) ? match[1] : match[2];\r\n}", "title": "" }, { "docid": "5abb0e0f065fd71a7fd1606f7272ffba", "score": "0.5624621", "text": "function parseUrlOrigin (url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash\n // if such is given\n //\n // can ignore everything after that\n\n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n var urlHostMatch = URL_HOST_PATTERN.exec(url) || []\n\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n }\n}", "title": "" }, { "docid": "11c2842778a747ea7b686e078c5a4e58", "score": "0.5620179", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash\n // if such is given\n //\n // can ignore everything after that\n\n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n }", "title": "" }, { "docid": "29907a9d4b5002ba618c717e300704f6", "score": "0.56149095", "text": "get_pathname(url) {\n if(!url || !url.includes('linkedin')) {\n log.error(\"action.get_pathname incorrect url format:\", url)\n return url\n }\n\n var pathname = new URL(url).pathname\n\n log.debug(\"action.get_pathname:\", pathname)\n return pathname\n }", "title": "" }, { "docid": "e489e679299f0a0a67323f7bc5b29f12", "score": "0.5603681", "text": "function parseUrl(input) {\n let scheme, address, search, frame, rest;\n // sanitize\n rest = input.replace(\"\\\\\", '/').trim();\n\n splitToTwoParts(rest, '://', false, (head, tail) => {\n scheme = head;\n rest = tail;\n });\n\n splitToTwoParts(rest, '?', false, (head, tail) => {\n address = head;\n rest = tail;\n });\n\n splitToTwoParts(rest, '#', true, (head, tail) => {\n frame = tail;\n if (address) {\n search = head;\n } else {\n address = head;\n }\n rest = null;\n });\n\n if (rest) {\n if (address) {\n search = rest;\n } else {\n address = rest;\n }\n }\n\n return {scheme, address, search, frame};\n}", "title": "" }, { "docid": "da27834629a9dbae5f94051c4d3d6ded", "score": "0.5582995", "text": "function getDomain( url ) {\n\t//console.log(\"url: \" + url);\n\tre = new RegExp(\"^http://(.*)[/](\\\\1)\");\n\tcurrentDomain = url.replace(re, \"$1\");\n\tportPos = currentDomain.indexOf(\"/\", 8);\n\tif (portPos > 0) \n\t\tcurrentDomain = currentDomain.substr(0, portPos);\n\t\n\treturn currentDomain;\n}", "title": "" }, { "docid": "3e8985cc0f8a2508a897d1fdeab236a8", "score": "0.5572397", "text": "function domainName(url){\n let arr;\n if (/www/.test(url)) {\n arr = url.split('.');\n return arr[1];\n } else if (/http/.test(url)) {\n arr = url.split('//');\n arr = arr[1].split('.');\n return arr[0];\n } else {\n arr = url.split('.');\n return arr[0];\n }\n}", "title": "" }, { "docid": "f13c48feca8218033290dccdd7012377", "score": "0.5572063", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "title": "" }, { "docid": "f13c48feca8218033290dccdd7012377", "score": "0.5572063", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "title": "" }, { "docid": "f13c48feca8218033290dccdd7012377", "score": "0.5572063", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "title": "" }, { "docid": "f13c48feca8218033290dccdd7012377", "score": "0.5572063", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}", "title": "" }, { "docid": "b04706116ebbe47e8e4e24ab68558e96", "score": "0.55719817", "text": "function parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n\n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n\n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n }", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.55673426", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.55673426", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.55673426", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.55673426", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" }, { "docid": "88ed5e866db27da780277119e4801cf7", "score": "0.55673426", "text": "function parseURI(url) {\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, '').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\n\t// authority = '//' + user + ':' + pass '@' + hostname + ':' port\n\treturn (m ? {\n\t\thref : m[0] || '',\n\t\tprotocol : m[1] || '',\n\t\tauthority: m[2] || '',\n\t\thost : m[3] || '',\n\t\thostname : m[4] || '',\n\t\tport : m[5] || '',\n\t\tpathname : m[6] || '',\n\t\tsearch : m[7] || '',\n\t\thash : m[8] || ''\n\t} : null);\n}", "title": "" } ]
2fe96323a2ded521cd3855171b4c6732
render method returns any whenever we update the state the render method is called again such as onClincking a button we are changing thr state everything inside render is jsx and here we are just micking an HTML code
[ { "docid": "f6a9f539b564a8f2e1f329682c02dc6c", "score": "0.0", "text": "render (){\n return (<div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n {this.state.name}\n </p>\n <button onClick = {() => this.setState({ name : 'hello Jatin Rana'})}>Change text</button>\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 </div>)\n \n }", "title": "" } ]
[ { "docid": "a7450e9b251fdce92c4e22da9ac9db93", "score": "0.7188551", "text": "render() {\n return(\n <div>\n //some elements\n </div>\n )\n }", "title": "" }, { "docid": "7b7144f40e4dca06c8fb3386379c06e4", "score": "0.7164247", "text": "render() {\n return (\n <div>\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "fe5ce3cabc6142be6c292f101535ab87", "score": "0.7142768", "text": "render() {\n return (\n <div>\n {this.renderContent()}\n </div> \n )\n }", "title": "" }, { "docid": "43c8ed9e1bd7ccb134e118a478c0e19d", "score": "0.7094393", "text": "render(){\n return React.createElement(\"div\", {\n dangerouslySetInnerHTML:{__html: this.transform(this.state)}\n })\n }", "title": "" }, { "docid": "6da60f632dc8bc40c0137fa79b869335", "score": "0.7056405", "text": "render() {\n\t\t//anything in this function will be displayed\n\t\treturn(\n\t\t\t//this is a JSX component, not real HTML\n\t\t\t<App/>\n\t\t)\n\t}", "title": "" }, { "docid": "632231f7a774e4ed3b5d0aa721074b4d", "score": "0.69898915", "text": "render() {\r\n\t\t// function that we return jsx in it\r\n\t\t//An element describes what you want to see on the screen:\r\n\t\treturn <div className=\"border color\">{this.renderContent()}</div>;\r\n\t}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.68714976", "text": "render () {}", "title": "" }, { "docid": "767341d297459cc7a23e98d75a74cc77", "score": "0.6868312", "text": "render() {\n return this.state.editing ? this.renderForm() : this.renderUI();\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.68600166", "text": "render() {\n }", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.68563944", "text": "render(){}", "title": "" }, { "docid": "8952d6432e5bc24fe3b56256a1adc7d8", "score": "0.684997", "text": "render() {\n //you do not need to ype the word function in here -above is really function render ()\n return <div>\n\n <button type=\"button\">{this.props.label}</button>\n <Bullet />\n <input style={styles} />\n </div>\n //can only return 1 node. If you want more you have to put them in a div AND nest it in ()\n }", "title": "" }, { "docid": "679f1ab2ca1d47f9e4325b02973d85a0", "score": "0.68497455", "text": "render(){\n\t\t\treturn <div className=\"border red\">{this.renderContent()}</div>;\n\t}", "title": "" }, { "docid": "5d9375525561bd222c8e1a65e8bb9f80", "score": "0.6849555", "text": "render() {\n\n return (\n <div>\n </div>\n )\n }", "title": "" }, { "docid": "0732a719f4445bcfdec513bcc7d45857", "score": "0.684214", "text": "render() {\n //render() menthod returns HTML\n return (\n //return has same functionality like in JS, C++, Python i.e. to return the value from a function\n <div className=\"App\">\n <h1>Hello, World!</h1>\n </div>\n )\n }", "title": "" }, { "docid": "2b7f6ded4f864b5ddd25b0f0a3407f51", "score": "0.6801681", "text": "render() {\n\n \n\n return (\n this.renderDisplay()\n )\n }", "title": "" }, { "docid": "b786d487854cbb54896cba25cb18a10d", "score": "0.67961395", "text": "render() {\n // 如果要在所有內容都能在顯示時有紅色邊框,可以把內容都提取出來,一起加然後再呼叫,就不用一個一個單獨處理 (p.s. className =\"border red\" 只是示範,沒有該 css 設定)\n\n return <div className='border red'>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "8f9e06d2a798cafa011d629c02d825cd", "score": "0.67510796", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6746453", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6746453", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.6746453", "text": "render() {}", "title": "" }, { "docid": "4e282ba5ff48ab7df9212146bf036b97", "score": "0.6745966", "text": "render() {https://edhrec.com/\n if (this.state.loaded == true){\n return (\n <div>\n <Jumbotron fluid className=\"jumbo\">\n <h1>Admin Panel</h1>\n <Link to=\"/AdminPanel/SearchStudent\"><Button className=\"btn dash-btn\">Search Students' Forms</Button></Link>\n <Link to=\"/AdminPanel/CurrentSettings\"><Button className=\"btn dash-btn\">Current Safety Limits</Button></Link>\n <Link to=\"/AdminPanel/SetLimits\"><Button className=\"btn dash-btn\">Set Safety Limits</Button></Link>\n </Jumbotron>\n <Row className=\"section\">\n <Row>\n <Button className=\"btn dash-btn\" onClick={this.switchCurrent.bind(this, \"ifr\")}>IFR Safety Limits</Button>\n <Button className=\"btn dash-btn\" onClick={this.switchCurrent.bind(this, \"vfr\")}>VFR Safety Limits</Button>\n </Row>\n {this.display()}\n </Row>\n </div>\n )\n }\n else {\n return(<div>The page is loading...</div>)\n }\n }", "title": "" }, { "docid": "6fa4794bd405aba38b254defebc117a6", "score": "0.67421037", "text": "render() {\n return <div / >\n }", "title": "" }, { "docid": "4efc2b9265691dcc6449d5f2d442333e", "score": "0.67374575", "text": "render() {\n //its goal is to build and return html\n return (\n <div className ={this.state.clicked ? 'clicked' : null}\n onClick={this.handleClick}>\n Hello {this.props.name} </div>\n )\n }", "title": "" }, { "docid": "43e7237ffd897df614e077ef28cba545", "score": "0.6737316", "text": "render(){\n return(\n <div></div>\n )\n }", "title": "" }, { "docid": "43e7237ffd897df614e077ef28cba545", "score": "0.6737316", "text": "render(){\n return(\n <div></div>\n )\n }", "title": "" }, { "docid": "25c872f81fca4f6601c27065f1dc2adf", "score": "0.6720358", "text": "render () {\n return (\n /*Aqui hago el llamado al metodo this state que tiene 'hola mundo' */\n <h1>{this.state.hello}</h1>\n )\n }", "title": "" }, { "docid": "17c84a1c8471763f92eff4402f5564bb", "score": "0.6718486", "text": "render() {\n return <div className=\"border red\">\n {this.renderContent()}\n </div>\n }", "title": "" }, { "docid": "c4c17a0a44f4a6f8468b4c31dbc634db", "score": "0.6703596", "text": "render () {\n console.log('rendering...');\n return(\n <div className=\"test-name\">\n <h3>{ this.state.text }</h3>\n \t\t<h1>{ this.props.value }</h1>\n \t\t<button onClick={ this.handleIncriment }>+</button>\n \t\t<button onClick={ this.handleDecrement }>-</button>\n \t\t<button onClick={ this.handleChangeStateButton }>change state</button>\n <button onClick={ this.handleBothButton }>change state and props</button>\n \t</div>\n )\n }", "title": "" }, { "docid": "fdd8a58f6e4fb532907248d87f6fa8c2", "score": "0.6701429", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>\n }", "title": "" }, { "docid": "ca9a9af2fb0433b8807d06dae71098d2", "score": "0.66991043", "text": "render(){\n\t\t// render MUST return a single DOM element.\n\t\treturn(\n\t\t\t<div className='coin-flip'>\n\t\t\t\t<h1>{this.title}</h1>\n\t\t\t\t<div>\n\t\t\t\t\t<button onClick={this.flipCoin}>Click to Flip the Coin</button>\n\t\t\t\t\t<img src={this.state.image} />\n\t\t\t\t</div>\n\t\t\t</div>\n\n\n\t\t)\n\t}", "title": "" }, { "docid": "e2b69a3a3dea801da4d3ba04fd1ee933", "score": "0.66932046", "text": "render(){\n // it is my job to return a single DOM element\n // whether you like it or not, render will run after the constructor\n // React events are camelCase and attached to the element\n // you don't evoke them, you just pass them\n return(\n <div className=\"coin-flip\">\n <button onClick={this.flipCoin}>BUTTON!</button>\n <img src={this.state.image} />\n </div>\n )\n }", "title": "" }, { "docid": "eac3c37b0e6537a826ac2483eb191156", "score": "0.6686143", "text": "render(){\n return(\n <div></div>\n );\n }", "title": "" }, { "docid": "ef82960f87b5b99c89f71a850aa38810", "score": "0.6680054", "text": "render() {\n const title = this.props.object.title.value;\n const cho = this.props.object.cho.value;\n const pic = this.props.object.pic.value;\n const date = this.props.object.date.value;\n const answerButtonDisabled = this.props.answerButtonDisabled;\n const visibleClassName = this.state.visibleClassName;\n const invisibleClassName = this.state.invisibleClassName;\n let currentVisibilityClass = \"\";\n\n // This code checks wether the year of creation and link for more info should be visible or not\n // It adds the appropriate className to the currentVisiblityClass, which is the className on the elements that require hiding/showing\n if (answerButtonDisabled === true){\n currentVisibilityClass = visibleClassName;\n }\n\n if (answerButtonDisabled === false){\n currentVisibilityClass = invisibleClassName;\n }\n\n // This is the actual output which is meant for the DOM\n return (\n <div className=\"singleObject\">\n <p>{ title }</p>\n <img className=\"singleObjectPic\" src={ pic } alt={ title }></img>\n <p className={ currentVisibilityClass }>{ date }</p>\n <button disabled={answerButtonDisabled} onClick={() => this.props.compare(this.props.object)} >Dit object is ouder!</button>\n <a className={ currentVisibilityClass } href={ cho } target=\"_blank\" rel=\"noopener noreferrer\">Meer info over dit object</a>\n </div>\n )\n }", "title": "" }, { "docid": "e3b8514508a53fbe6d4a51ca1b63cda5", "score": "0.6677079", "text": "render() {\n return html``;\n }", "title": "" }, { "docid": "e46527f3229e45a050ade5e24c9f11ac", "score": "0.6667946", "text": "render() {\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<form>\n\t\t\t\t <fieldset>\n\t\t\t\t <div className=\"form-group\">\n\t\t\t\t <label>Input</label>\n\t\t\t\t <input style={inputStyle} name=\"stateInput\" onChange={(e) => this.changeHandler(e)} type=\"text\" className=\"form-control\" placeholder=\"insert the state\" />\t\t\t\t\t \n\t\t\t\t </div>\t\t\t\t\t \t\t\t \n\t\t\t\t </fieldset>\t\t\t \n\t\t\t\t</form>\t\n\t\t\t\t<button onClick={(e) => this.updateState(e)} type=\"button\" className=\"btn btn-primary\"> Submit </button>\n\t\t </div> \t\t\t\n\t\t)\t\n\t}", "title": "" }, { "docid": "823502c3b40af9a589c16a637956be67", "score": "0.666689", "text": "render() {\n\t\treturn (\n\t\t\t<View></View>\n\t\t)\n\t}", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.6652955", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "b632f8466e475a129f4a9b10e8381a16", "score": "0.66389674", "text": "render(){\n //return the HTML of this component in \"render()\"\n return(\n //USe \"className\" instead of \"class\" for styling\n <div className=\"App\"> \n </div>\n );\n }", "title": "" }, { "docid": "4f6d4006be0d4d6422c18add60e77b4c", "score": "0.66364914", "text": "render() {\n return(\n <div className='border red'>\n {this.renderContent()}\n </div>\n )\n \n }", "title": "" }, { "docid": "390ceed79f63e751166c213eb873f477", "score": "0.66331947", "text": "render() {\n\t\treturn (\n\t\t\t<div className=\"border red\">\n\t\t\t\t{this.renderContent()}\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "5b9957487759fb5812db06ab79235b9d", "score": "0.6633162", "text": "render(){\n // it is my job to return a single dom element\n // whether you like it or not, render will run after the constructor.\n // react events are camelCase and attached to the element\n // you dont invoke them, you just pass them\n return (\n <div className=\"coin-Flip\">\n <button onClick={this.flipCoin}>Flippity Flip</button>\n <img src={this.state.image}/>\n </div>\n )\n }", "title": "" }, { "docid": "926fe3d7a2f18d6ab9efa26b74ac8192", "score": "0.6630084", "text": "render() {\n console.log(\"[App.js] render...\");\n const style ={\n backgroundColor : 'red',\n color : 'white',\n border : '1px solid blue',\n margin : '1%',\n \n padding : '2px',\n cursor : 'pointer'\n }\n\n // This is more elegant way to handle dynamic content \n //When state changes, react would execute render() which would exdcute return funtion to update the view. \n // Since react executes render(), We can even build some logic inside render() that would dynalically update the view content. \n let persons = null;\n let classes = ['Person', 'Green'];\n \n if(this.state.persons.length ===2)\n classes = ['Person', 'Orange'];\n else if(this.state.persons.length ===1)\n classes = ['Person', 'Red', 'Bold'];\n\n\n if(this.state.showPerson) {\n persons = \n <div> \n <Persons \n persons={this.state.persons}\n updateName={this.updateNameHandler}\n updateCompany={this.updateCompanyHandler}\n delete={this.deleteUserHandler}\n classes={classes}\n />\n </div> \n style.backgroundColor = 'green';\n }\n\n return (\n <div className={styles.App}>\n {persons}\n <Cockpit\n toggleName={this.toggleName}\n nameChangeHandler={this.nameChangeHandler}\n customNameChangeHandler={this.customNameChangeHandler}\n />\n\n <Emp \n name = {this.state.employee[0].name}\n changed = {this.updateEmployee}\n />\n </div>\n );\n }", "title": "" }, { "docid": "e73ed4bb7cbb9b8b0cdc73509b6c1633", "score": "0.6626675", "text": "render() {\n let contents = this.state.loading\n ? <p><em>Loading...</em></p>\n : this.renderCustomerTable(this.state.customerListData);//this renderCustomerTable method will return the HTML table. This table will display all the record.\n return <div>\n <h1>Customer Record</h1>\n <p>\n <a href=\"addCustomer\"><button className=\"ui blue button\"><i className=\"plus icon\"></i>Create New</button></a>\n </p>\n {contents}\n </div>;\n }", "title": "" }, { "docid": "dd223462fb744710b3cc0017410dc201", "score": "0.6601608", "text": "render() { \n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "a2180eb2a81dc0b65a5f3a3fc013b592", "score": "0.6598198", "text": "render() {\n console.log(\"this.state.isLoaded ****************\"+this.state.isLoaded);\n if (this.state.isLoaded == true) {\n console.log(\"************ App.render() method has been called ****************\");\n console.log(\"----------- Rendering product---------\"+ this.state.product.product_Id);\n var imgBasUrl = \"https://s3.amazonaws.com/instadelibucket/\";\n var that = this;\n let productV = this.state.product;\n \n var count = 0;\n return (<div id=\"container\">\n <ProductDetails productV={this.state.product} isOnLoad={this.state.isOnLoad} \n onClick={this.handleClick }/>\n </div>\n );\n console.log(\"************ App.render() method has been Completed ****************\");\n }else{\n console.log(\"************ App.render() method not started ****************\");\n return null;\n }\n \n }", "title": "" }, { "docid": "24d8d85db0f06e300d41b846f466011b", "score": "0.65959233", "text": "render (self) { return html``; }", "title": "" }, { "docid": "83256f4435218cc29e2354c9e078df40", "score": "0.6595824", "text": "render(){\n\n //return \"Hello from React\"\n return (<div>\n Hello from react in a div\n </div>)\n\n }", "title": "" }, { "docid": "fccfcd29c0fa71869fa03ce7cbfbaac0", "score": "0.65871066", "text": "render() {\n return (\n <li>blah blah</li>\n );\n }", "title": "" }, { "docid": "fcfdddd223a2d0813abcb2c34f7e96ab", "score": "0.65839666", "text": "render() {\n return <div />;\n }", "title": "" }, { "docid": "fcfdddd223a2d0813abcb2c34f7e96ab", "score": "0.65839666", "text": "render() {\n return <div />;\n }", "title": "" }, { "docid": "fa98c6938b5c52395c9457a62af82db5", "score": "0.65758085", "text": "render () {\n return (\n <div>\n <h1>Visibility Toggle</h1>\n <button onClick={this.handleToggleVisibility}>{this.state.btnText}</button>\n <p>{this.state.bodyText}</p>\n </div>\n );\n }", "title": "" }, { "docid": "84c496a82c8b0d28ee0c74dd5b2545ce", "score": "0.6560036", "text": "render() {\n return (\n <div>\n \n </div>\n )\n }", "title": "" }, { "docid": "a452e878aa52b3040bd72081035922a2", "score": "0.6559746", "text": "render() {\n if (null === this.content) {\n ID.elementVoid(this.tag, this.key, this.props);\n return;\n }\n\n ID.elementOpen(this.tag, this.key, this.props);\n\n this.content.forEach((c) => c.render());\n\n ID.elementClose(this.tag);\n }", "title": "" }, { "docid": "c1eeb7f03e4e30366a96b29088909e41", "score": "0.655548", "text": "render () { \n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n )\n }", "title": "" }, { "docid": "bda845a6e78e4d157846866f3223f757", "score": "0.6554938", "text": "render() {\n return (\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n );\n }", "title": "" }, { "docid": "e3ebc86ccd86bcea59a5f03eaaa49270", "score": "0.65524167", "text": "render() {\n\n return(\n <div>\n <button onClick={this.jsPdfGenerator}>Générer pdf</button> \n {this.props.state} \n </div>\n )\n }", "title": "" }, { "docid": "77fc7bd411c300ad5a2908e6beea16a0", "score": "0.65491927", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "77fc7bd411c300ad5a2908e6beea16a0", "score": "0.65491927", "text": "render() {\n return <div className=\"border red\">{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "c91566f43a861944b5a2f2b6a459a903", "score": "0.65487", "text": "render(){\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<ul>\n\t\t\t\t\t{this.renderBits()}\n\n\t\t\t\t</ul>\n\n\t\t\t\t<div>\n\t\t\t\t\t<Total total={this.state.total}/>\n\t\t\t\t</div>\n\n\t\t\t</div>);\n\t}", "title": "" }, { "docid": "93f4d9418384d772dfb7cbe31d139f7d", "score": "0.6545898", "text": "render() {\n if(this.state.not_found) return <h3 style = {{color: \"red\"}}> Error 418 I'm a teapot </h3>\n return (\n this.state.rt ? this.renderInfo() : this.renderProgressIndicator()\n )\n }", "title": "" }, { "docid": "0099c70d1f612f692b6229f2de914058", "score": "0.65446013", "text": "render() {\n if (!this.preRenderCheck()) {\n return ``;\n }\n this.beforeRender();\n const tpl = this.template() || this.html``;\n this.renderTemplate(tpl, this.root);\n this.buildStylesheets();\n if (this.styles) {\n if (!this.selector('style')) {\n this.root.appendChild(this.styles);\n }\n }\n setTimeout(() => {\n if (!this.rendered) {\n this.onFirstRender();\n this.rendered = true;\n }\n this.onRender();\n this.dispatch('rendered');\n }, 200); // allow for 100ms in store update\n }", "title": "" }, { "docid": "5fe9fd46911c2eaa150b8aad45748815", "score": "0.6542052", "text": "render() {\n\t\treturn (\n\t\t\t//in return only 1 element can be returned..nested elements are allowed\n\t\t\t<div className=\"container\">\n\t\t\t\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-xs-10 col-xs-offset-1\"> \n\t\t\t\t\t\t<Header newLink={this.state.newLink} linkName={this.state.linkName}/> \n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-xs-10 col-xs-offset-1\">\n\t\t\t\t\t\t<Home initialAge={27} \n\t\t\t\t\t\t\t name={\"Max\"} \n\t\t\t greet={this.onGreet} \n\t\t\t\t\t\t\t changeLink={this.onChangeLink.bind(this)}\n\t\t\t\t\t\t\t changeName={this.onChangeLinkName.bind(this)} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "e2a6839e37da5d66c24a90631db424fc", "score": "0.65407777", "text": "render() {\n\t\tconsole.log(\"Third Phase: Render Functions\");\n\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<input type=\"text\" onKeyUp={this.handleKeyUp}></input>\n\t\t\t\t<button onClick={this.handleClick}>Click Me</button>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "a7739b058992c39e5da5f3dff166b703", "score": "0.6534469", "text": "render(){\n return(\n <div></div>\n )\n }", "title": "" }, { "docid": "203aa4da1c76836a3fc0f4b3356e5056", "score": "0.65330905", "text": "render() {\n return (\n <div className=\"App\">\n <div className=''>\n <h1>{this.state.users}</h1> \n {this.renderLoginButton()}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "37afdb25ff342e41567dc4879de4e70d", "score": "0.6523557", "text": "render() {\n //criando método para erro e acerto com três possbilidades de exibição na tela\n return (\n <div className=\"border-red\">\n {this.renderContent()}\n </div>\n );\n \n }", "title": "" }, { "docid": "c26f2765b50b314a5c5c00fb08c0a4c2", "score": "0.64981836", "text": "render() {\n return (\n <div className=\"wrapper\">\n {this.state.editMode ? this.renderEditMode() : this.renderPreviewMode()}\n </div>\n );\n }", "title": "" }, { "docid": "e7739047457d51b84fbae9b5285ddfe1", "score": "0.6475903", "text": "render(){\n\t\t//this is what will be rendered\n\t\treturn (\n <Header/>\n\n\t\t);\n\t}", "title": "" }, { "docid": "63949a6ed5cfbcdf7c4ec61761e83b76", "score": "0.6475716", "text": "render() {\n\t}", "title": "" }, { "docid": "90b313d0bdb2a0ad8df716be45cb55c3", "score": "0.6472649", "text": "render() {\n\t\treturn <div>{this.renderAuthButton()}</div>;\n\t}", "title": "" }, { "docid": "fdc3049fb38f362a4cca2e3c38c7c7db", "score": "0.6472311", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "fdc3049fb38f362a4cca2e3c38c7c7db", "score": "0.6472311", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "36bc69a449a6b149c1477df7daf1e2e3", "score": "0.64677674", "text": "render() {\n return (\n <body>\n <div className=\"container\">\n <header className=\"jumbotron\">\n <h3>Dashboard</h3>\n <p>You can view all your committees here</p>\n <p>number of committees: {this.state.comCount} </p>\n <p>{(this.state.comCount > 0) ? \"\" : this.state.comData }</p>\n </header>\n </div>\n <div style={{alignItems: 'right', display: 'flex', justifyContent:'right'}}>\n <Button href=\"/createc\">Create Committee</Button>\n </div>\n\n {(this.state.comCount===this.state.comCheck || this.state.comCount === 0) ? <this.displayCommittees committees={this.state.comData}/> : \"Please try refreshing\" }\n\n </body>\n \n );\n }", "title": "" }, { "docid": "51144925fe97e4f6472a90c0099e061c", "score": "0.6465136", "text": "render() {\n document.title = \"Blawsome Admin UI\";\n console.log(\"Rendering\");\n //<input type=\"submit\" class='button' value=\"I do nothing\" onClick={this.handleClick}/>\n return (\n\n <div className=\"form\">\n <form>\n <Title />\n <input type=\"text\" onChange={this.invokeEdge} name=\"POS\" value={this.state.tpid}/> <br/>\n\n\n <br/><br/>\n <b>Result: </b>\n <input type=\"text\" name=\"Result\" value={this.state.result} className=\"testresult\"/>\n </form>\n </div>\n );\n }", "title": "" }, { "docid": "086979d5239e615df036e5d85f412e77", "score": "0.64616406", "text": "render() { \n \n \n // If the data is still loading, do not attempt to render any information \n if (this.state.loading)\n return(<> </>)\n const {classes} = this.props\n return ( \n <main className={classes.content}>\n <div className={classes.toolbar} />\n <Container classname = {classes.wrapper}>\n <Grid container>\n <Grid item xs={2} className = {classes.col}>\n \n <div className=\"sidebar-header text-left\">\n <h3 style={{color : \"black\"}}>Settings</h3>\n </div>\n <ul >\n <li>\n <button className = {classes.settingsOptionsButton} id = \"settings-account-btn\" style = {{background: \"lightgray\"}} onClick={this.changeView}>Account</button> \n </li>\n <li>\n <button className = {classes.settingsOptionsButton} id = \"settings-privacy-btn\" onClick={this.changeView}>Privacy</button>\n \n </li>\n <li>\n <button className = {classes.settingsOptionsButton} id = \"settings-advanced-btn\" onClick={this.changeView}>Advanced Settings</button>\n \n </li>\n </ul>\n \n </Grid>\n <Grid item xs className ={classes.settingsContent}>\n {this.state.showAccount ? <AccountSetting user = {this.state.user} onUsernameChange ={this.onUsernameChange} history = {this.props.history} />: null}\n {this.state.showPrivacy ? <PrivacySetting user ={this.state.user} onPrivacyChange = {this.onPrivacyChange}/> : null}\n {this.state.showAdvanced ? <AdvancedSetting user={this.state.user}/> : null}\n </Grid>\n </Grid>\n </Container> \n </main>\n );\n }", "title": "" }, { "docid": "ff0a82f1f9f4faacc9bea2a43007d7af", "score": "0.6453876", "text": "render() {\n return(\n <div className=\"border red\">\n {this.renderContent()}\n </div>\n )\n }", "title": "" }, { "docid": "1ce5d3919d6c284d0d8292557c592145", "score": "0.6453075", "text": "render() {\n\t\treturn <div>Recruitment SIG page here {this.state.sigName}</div>;\n\t}", "title": "" }, { "docid": "c5705e8d0319aedf367909ee63619488", "score": "0.64500934", "text": "render() {\n\t\t// need space between return and ()\n\t\t// from render method, can only return one element including comments (no siblings) without react.fragment tag (or import react, {fragment} to use fragment w out the react.)\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{/* comment */}\n\t\t\t\t<form className=\"store-selector\" onSubmit={this.goToStore}>\n\t\t\t\t\t<h2>please enter a store</h2>\n\t\t\t\t{/*no parentheses bc we don't want it on page load*/}\n\t\t\t\t{/*<button onClick={this.handleClick}>Click me!</button>*/}\n\t\t\t\t\t\n\t\t\t\t\t<input type=\"text\" ref={this.myInput} required placeholder=\"Store Name\" defaultValue={getFunName()}/>\n\t\t\t\t\t<button type=\"submit\">Visit Store >></button>\n\t\t\t\t</form>\n\t\t\t</React.Fragment>\n\t\t);\n\t}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6437187", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.6437187", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "30e0eeaa83ed44eb4753e6a46c4ee15c", "score": "0.64303327", "text": "render() {\n return (\n <div>\n <h1>{this.state.message}</h1>\n <button onClick = {this.changeMessage}>Subscribe!</button>\n </div> \n )\n }", "title": "" }, { "docid": "6add447cd3a14fdd73211d142011f49f", "score": "0.6425711", "text": "render() {\n // this is javascript\n // const s = 'Hello, World!';\n\n // below this line,within the RETURN is JSX\n return (\n <div className=\"App\">\n <h2>{this.state.name}</h2>\n {/* Ay yo bish, this is a JSX Comment */}\n {this.state.books.map(book =>\n <div key={book.id}>\n <span>\n <a href={book.url} target= \"_blank\">{book.title}</a> -\n </span>\n <span>{book.author}</span>\n </div>\n )}\n </div>\n ); // this is javascript again\n }", "title": "" }, { "docid": "35b0448de7cf2e0e8d00a691b1192eed", "score": "0.6421655", "text": "_render(props, state) {\n }", "title": "" }, { "docid": "c295e96a13c674d87511166559aea330", "score": "0.6414855", "text": "render(props, state) {\n return this.template(props, state)(state);\n }", "title": "" }, { "docid": "e20ef107ffd0ede4a5d4c1ed4fa6924b", "score": "0.64147556", "text": "render() {\n let contents = this.state.loading\n ? <p><em>Loading...</em></p>\n : this.renderCreateForm();\n return <div>\n <h1>{this.state.title}</h1>\n <h3>Store</h3>\n <hr />\n {contents}\n </div>;\n }", "title": "" }, { "docid": "fb566274d81d9a01857cb27033e0fda1", "score": "0.64141315", "text": "ord_render () {\n return (\n this.renderMain()\n )\n }", "title": "" }, { "docid": "743c105a2096f6b33cc7e2f89d96355f", "score": "0.640845", "text": "render() {\n\t\tif(this.state.status === 0){\n \treturn (\n\t\t\t<div class=\"flex items-center justify-center h-full w-full\">\n \t\t\t<div class=\"container-xl rounded pt-24 font-fancy justify-center font-bold\">\n\t\t\t\t\t<h1 class=\"w-full text-5xl font-fancy font-bold block text-white text-center justify-center mb-6\"> About </h1>\n\t\t\t\t\t <div class=\"mt-8 flex justify-center col-md-6 items-center\" >\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 mr-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"alethia\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>What is Alethia?</button>\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 ml-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"team\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>Team</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\t\n\t}\n\t\telse if (this.state.status === 1){\n\t\t\treturn(\n\t\t\t<div class=\"flex items-center h-full justify-center w-full\">\n\t\t\t<div class=\"container-xl rounded pt-24 font-fancy justify-center \">\n\t\t\t\t<h1 class=\"w-full text-5xl font-fancy font-bold block text-white text-center justify-center mb-6\"> About - Alethia </h1>\n\t\t\t\t<div class=\"mt-8 flex justify-center items-flex col-md-6\" >\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"container-sm bg-white h-1/3 w-full ml-8 mr-8 text-xl font-fancy rounded p-10 \">\n\t\t\t\t\t\t<div class=\"text-center font-bold mb-4\">Alethia</div>\n\t\t\t\t\t\t<div class=\"mb-4\">\n\t\t\t\t\t\t\t{this.state.aboutText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"mb-4\"> \n\t\t\t\t\t\t\t{this.state.paragraph2}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<img alt=\"Placeholder\" class=\"w-2/3 rounded h-auto mr-4 \" src={alethia}/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"mt-8 flex justify-center col-md-6 items-center\" >\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 mr-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"about\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>Return</button>\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 mr-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"team\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>Team</button>\n\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>);\n\t}\n\t\telse{\n\t\t\t\treturn(\n\t\t\t\t\t<div class=\"flex items-center justify-center h-full w-full\">\n\t\t\t\t\t<div class=\"container-xl rounded pt-24 font-fancy justify-center font-bold\">\n\t\t\t\t\t\t<h1 class=\"w-full text-5xl font-fancy font-bold block text-white text-center justify-center mb-6\"> Team</h1>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"container my-12 mx-auto px-4 md:px-12\">\n\t\t\t\t\t\t<div class=\"flex flex-wrap -mx-1 lg:-mx-4\">\n\t\t\t\t\t\t{this.renderTeam()}\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"mt-8 flex justify-center col-md-6 items-center\" >\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 mr-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"about\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>Return</button>\n\t\t\t\t\t<button class=\"inline-block h-16 w-48 border-b-2 border-t-2 border-l-2 border-r-2 px-4 py-2 mr-2 font-fancy font-bold text-lg leading-none border rounded bg-transparent text-white border-white hover:border-grey hover:text-grey mt-4 mb-4 lg:mt-0\" value=\"alethia\" style={{cursor:'pointer'}} onClick={e => this.goTo(e)}>What is Alethia?</button>\n\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "fa7e74fab05076a324a26a60cb149bdc", "score": "0.64048105", "text": "needRender() {\n this.state.forceRender = true;\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6396458", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6396458", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6396458", "text": "render() {\n\n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.6395633", "text": "function render() {\n\n}", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.63945675", "text": "render() {\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.63945675", "text": "render() {\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.63945675", "text": "render() {\n }", "title": "" }, { "docid": "e6c7981568889b0e4e631d71e2131ba3", "score": "0.63881874", "text": "render() {\n\t\t// check if temperature data is fetched, if so add the sign styling to the page\n\t\tconst tempStyles = this.state.temp ? `${style.temperature} ${style.filled}` : style.temperature;\n\t\t\n\t\t//Month names for tab component\n\t\tconst monthNames = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n\t\t\t\t\n\t\t//Makes sure weather data has been retrieved before rendering anything\n\t\tif (this.state.retrieved)\n\t\t{\t\n\t\t\t//Renders main page with weather data, day selection tabs, fun fact, character and page change button\n\t\t\tif(this.state.activePage == \"main\"){\n\t\t\t\treturn (\n\t\t\t\t\t<Container condition = {this.state.cond}>\n\t\t\t\t\t\t<div className = {style_tabs.tabList}>\n\t\t\t\t\t\t\t<Tab day = {0} activeDay = {this.state.activeDay} clickFunction = {() => this.changeDay(0)}> \n\t\t\t\t\t\t\t\tToday\n\t\t\t\t\t\t\t</Tab>\n\t\t\t\t\t\t\t<Tab day = {1} activeDay = {this.state.activeDay} clickFunction = {() => this.changeDay(1)}> \n\t\t\t\t\t\t\t\tTomorrow\n\t\t\t\t\t\t\t</Tab>\n\t\t\t\t\t\t\t<Tab day = {2} activeDay = {this.state.activeDay} clickFunction = {() => this.changeDay(2)}> \n\t\t\t\t\t\t\t\t{monthNames[new Date().getMonth()]} {new Date().getDate()+2}\n\t\t\t\t\t\t\t</Tab>\n\t\t\t\t\t\t\t<Tab day = {3} activeDay = {this.state.activeDay} clickFunction = {() => this.changeDay(3)}> \n\t\t\t\t\t\t\t\t{monthNames[new Date().getMonth()]} {new Date().getDate()+3}\n\t\t\t\t\t\t\t</Tab> \n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className = {style.weatherData}>\n\t\t\t\t\t\t\t<div className={ style.city }>{ this.state.locate }</div>\n\t\t\t\t\t\t\t<div className={ style.conditions }>{ this.state.desc }</div>\n\t\t\t\t\t\t\t<div className={ tempStyles }>{ this.state.temp}</div>\n\t\t\t\t\t\t\t<span className={ style.temperature }></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className = {style.textBox}>\n\t\t\t\t\t\t\t<Fact condition = {this.state.cond}></Fact>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Character condition = {this.state.cond}></Character>\n\t\t\t\t\t\t<Button side = \"right\" clickFunction={ () => this.changePage(\"quiz\") }>?</Button>\n\t\t\t\t\t</Container>\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Renders quiz page with question, answer, response, points and page change button\n\t\t\telse if (this.state.activePage == \"quiz\")\n\t\t\t{\n\t\t\t\treturn (\n\t\t\t\t\t<Container condition = {this.state.cond}>\n\t\t\t\t\t\t<Quiz condition = {this.state.cond}> </Quiz>\n\t\t\t\t\t\t<Button side = \"left\" clickFunction={ () => this.changePage(\"main\") }>&lt;</Button>\n\t\t\t\t\t</Container>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "70bcde93139fa53848099cb95dc93ccf", "score": "0.6386311", "text": "componentMarkup() {\r\n return (window.__CTRender(\"div\", { className: \"container\" },\r\n window.__CTRender(\"div\", { className: \"content-header\" },\r\n window.__CTRender(\"h4\", { className: \"form-page-header\" }, \"Submit Gas Inspection Certificate\")),\r\n window.__CTRender(\"div\", { className: \"form-notification\" },\r\n window.__CTRender(__WEBPACK_IMPORTED_MODULE_1_components_button_button__[\"a\" /* Button */], { iconHeight: \"60px\", iconWidth: \"60px\", icon: __WEBPACK_IMPORTED_MODULE_3_models_icons__[\"a\" /* Icons */].FontAwesome.Edit, iconColor: \"#0984ce\" }),\r\n window.__CTRender(\"hr\", null)),\r\n window.__CTRender(\"div\", { className: \"content\" },\r\n window.__CTRender(\"p\", null,\r\n \"Once submitted, you \",\r\n window.__CTRender(\"span\", { className: \"form-span\" }, \"WILL NOT\"),\r\n \" be able to make any amendements or changes to the Gas Inspection information.\")),\r\n window.__CTRender(\"div\", { className: \"form-navigation-bar\" },\r\n window.__CTRender(\"div\", { className: \"form-navigation-button\" },\r\n window.__CTRender(__WEBPACK_IMPORTED_MODULE_1_components_button_button__[\"a\" /* Button */], { className: \"navigation-button\", action: this._pageBack }, \"Previous\")),\r\n window.__CTRender(\"div\", { className: \"form-navigation-button\" },\r\n window.__CTRender(__WEBPACK_IMPORTED_MODULE_1_components_button_button__[\"a\" /* Button */], { className: \"submit-button\", action: this._submitGasInspection }, \"Submit\")))));\r\n }", "title": "" }, { "docid": "53e27261e5276e4700433c160928ad3f", "score": "0.6385598", "text": "render(){\n return (\n <div>\n <div className=\"jobs-saved-applied-btn\"> \n <button className = {this.state.jobApplicationView === \"savedJobs\" ? \"jobs-view-button-toggled\" : null} onClick={this.showSaved}>Jobs Saved</button>\n <button className = {this.state.jobApplicationView !== \"savedJobs\" ? \"jobs-view-button-toggled\" : null} onClick={this.showApplied}>Jobs Applied</button>\n </div>\n {/* ternerary operator to toggle between jobsSaved and jobsApplied */}\n {this.state.jobApplicationView === \"appliedJobs\" ?\n this.renderJobsAppliedFor()\n :\n this.renderJobsSaved()\n }\n </div>\n );\n }", "title": "" }, { "docid": "15e7f6322e4ce0822eca1e18636afdc7", "score": "0.638529", "text": "render() {\n if (this.state.visibility) {\n return (\n <div>\n <button onClick={this.toggleVisibility}>Click Me</button>\n <h1>Now you see me!</h1>\n </div>\n );\n } else {\n return (\n <div>\n <button onClick={this.toggleVisibility}>Click Me</button>\n </div>\n );\n }\n }", "title": "" }, { "docid": "4698dc8088412d70e7116cafc56f036f", "score": "0.6383824", "text": "function render(){\n \n let info = store.store\n if (info.error !== null){\n functionAlert(info.error)\n store.clearError\n\n } else {\n if (info.adding === false){\n let items = [...store.store.bookmarks] \n if(info.expanded !== null) {\n const htmlString = store.store.bookmarks.map( function (val){\n if (val.id === store.store.expanded){\n if(info.editing === false){\n return addHtmlExpanded(val)\n } else {\n return editValues(val)\n }\n \n } else {\n \n return addHtml(val)\n }\n })\n $('ul').html( htmlString );\n \n } else {\n const addBookmarks = generateBookmarkString(items)\n $('ul').html(addBookmarks)\n }\n \n } else {\n \n let entryForm = addLinkHtml()\n $('div.home').html(entryForm)\n let items = [...store.store.bookmarks] \n const addBookmarks = generateBookmarkString(items);\n $('ul').html(addBookmarks)\n }\n \n }\n \n\n \n}", "title": "" }, { "docid": "964b8ee6dd6bff9116b3a78674625e33", "score": "0.63831246", "text": "render() {\r\n return(BodyJSX.call(this));\r\n }", "title": "" } ]
4b23e9862462b53dbf195601e9d68115
Turns an object's keys into an array
[ { "docid": "ec2ad94489d19cf8c299a3806fdc966c", "score": "0.6936501", "text": "function objectKeys(obj)\n\t\t{\n\t\t\tif (typeof obj !== 'object')\n\t\t\t\treturn [];\n\t\t\tvar keys = [];\n\t\t\tfor (var key in obj)\n\t\t\t\tkeys.push(key);\n\t\t\treturn keys;\n\t\t}", "title": "" } ]
[ { "docid": "20a4b40d246a1730e6db3f2a6a23e19c", "score": "0.8007315", "text": "function keysFor(obj){\n a = []\n for(i in obj)\n a.push(i)\n return a\n }", "title": "" }, { "docid": "a319cd0775e1c25d6ef49583af6c2b51", "score": "0.7889608", "text": "function keys (obj) {\n let newArr = [];\n for (let key in obj) {\n newArr.push(key);\n }\n return newArr;\n }", "title": "" }, { "docid": "b9304453f6838bc444dab57f530088d2", "score": "0.7795179", "text": "function objectKeys(object) {\n var arr = [];\n each(obj, function(values, keys) {\n arr.push(keys);\n })\n return arr;\n}", "title": "" }, { "docid": "7b4478968b38373555d213390d00918b", "score": "0.7726767", "text": "function getKeys(object) {\n var newArr = [];\n for (var key in object) {\n newArr.push(key);\n }\n return newArr;\n}", "title": "" }, { "docid": "843c496d5c07817f795bf4c0f963c327", "score": "0.76431215", "text": "function keys(obj)\n{\n var result = [];\n for (var key in obj) {\n result.push(key);\n }\n return result;\n} // keys", "title": "" }, { "docid": "b2f4c65378363c2cad1f1001ff47e9a8", "score": "0.7603301", "text": "_toArray(obj){if(null==obj){return[]}return Object.keys(obj).map(function(key){return obj[key]})}", "title": "" }, { "docid": "b2f4c65378363c2cad1f1001ff47e9a8", "score": "0.7603301", "text": "_toArray(obj){if(null==obj){return[]}return Object.keys(obj).map(function(key){return obj[key]})}", "title": "" }, { "docid": "b2f4c65378363c2cad1f1001ff47e9a8", "score": "0.7603301", "text": "_toArray(obj){if(null==obj){return[]}return Object.keys(obj).map(function(key){return obj[key]})}", "title": "" }, { "docid": "844188fb31e1c9351b77152674fd551f", "score": "0.7586268", "text": "function getAllKeys(obj) {\n var arr = [];\n for(var key in obj) {\n arr.push(key)\n }\n return arr;\n}", "title": "" }, { "docid": "e74fbf4761be59c0aeaa4b126682fb04", "score": "0.7573377", "text": "function convertToArray(obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n}", "title": "" }, { "docid": "d78b239fec553095d4acbbb32f3608f8", "score": "0.7553212", "text": "function _keys(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (hasOwnProperty.call(obj, key)) keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "ceec1c2c7c70a6f875f7b2d4ea4ed5e0", "score": "0.75439703", "text": "function intoArray(o) {\n return map(function (k) {\n return [k, o[k]]\n }, Object.keys(o))\n }", "title": "" }, { "docid": "a18b9b4011f0ae13e5f1f0d55f8ab088", "score": "0.7443049", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "036e4270274fee667b0bc44777b489d8", "score": "0.74418044", "text": "function get_keys(obj){\n var keys = [];\n for(var key in obj){\n keys.push(key);\n }\n return keys;\n}", "title": "" }, { "docid": "bcdce2315695d073b36bfc867504b4b4", "score": "0.74254143", "text": "function keys(obj) {\n var keys, key;\n \n keys = [];\n \n for (var key in obj) if (obj.hasOwnProperty(key)) {\n keys.push(key);\n }\n \n return keys;\n }", "title": "" }, { "docid": "bcdce2315695d073b36bfc867504b4b4", "score": "0.74254143", "text": "function keys(obj) {\n var keys, key;\n \n keys = [];\n \n for (var key in obj) if (obj.hasOwnProperty(key)) {\n keys.push(key);\n }\n \n return keys;\n }", "title": "" }, { "docid": "52a3f311e63d5bd3c6f51fb03d4b2284", "score": "0.74248016", "text": "function keys(obj) {\n //return Object.keys(obj);\n var output = [];\n each(obj, function(elem, key) {\n output.push(key);\n });\n return output;\n}", "title": "" }, { "docid": "91efdbd1cb4be18e074e16233e00a5df", "score": "0.73905766", "text": "function getObjectKeys(object) {\n //return array of key from object\n return Object.keys(object);\n}", "title": "" }, { "docid": "6f1aed91b53a3dcd323913e200540181", "score": "0.73660684", "text": "function keys(object)\r\n{\r\n var keys = [];\r\n for (var k in object) {\r\n keys.push(k);\r\n }\r\n return keys;\r\n}", "title": "" }, { "docid": "611673af3b761d1ccbf4ff436d393dab", "score": "0.735229", "text": "function keys(obj) {\n return _.reduce(obj, function(mem, val, key) {\n return mem.concat(_.isPlainObject(val) ? keys(val) : key);\n }, []);\n}", "title": "" }, { "docid": "483296b1a0a4d4e4faeb65eb8fe511b0", "score": "0.73471254", "text": "function getKeys(obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}", "title": "" }, { "docid": "483296b1a0a4d4e4faeb65eb8fe511b0", "score": "0.73471254", "text": "function getKeys(obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}", "title": "" }, { "docid": "a5db7796590a4e37e93b17540d22521b", "score": "0.7326685", "text": "function getObjectKeys(object) {\n // YOUR CODE BELOW HERE //\n let myArray = [];\n for(let keys in object){\n myArray.push(keys)\n }\n \n return myArray;\n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "8813db3da4019b10756f0f44e9bbdfc3", "score": "0.7304366", "text": "function toArray(objectData){return Object.keys(objectData).map(function(key){return objectData[key];});}", "title": "" }, { "docid": "8a748ce761d0bfcd6aa12c8fa08b96cb", "score": "0.7283231", "text": "function get_keys(obj)\n {\n\tvar keys = [];\n\tfor(var key in obj)\n\t keys.push(key);\n\treturn keys;\n }", "title": "" }, { "docid": "3dc249fd898a5aa4c2a8bc353291247e", "score": "0.7254565", "text": "function objectToArray(obj) {\n\treturn Object.entries(obj);\n}", "title": "" }, { "docid": "3dc249fd898a5aa4c2a8bc353291247e", "score": "0.7254565", "text": "function objectToArray(obj) {\n\treturn Object.entries(obj);\n}", "title": "" }, { "docid": "07e3a9af7029a32280e54211d7d7ece3", "score": "0.7248087", "text": "function getKeys(object) {\n var keys = [];\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n return keys;\n }", "title": "" }, { "docid": "c354f0abc24a553013e9b52de2879291", "score": "0.72412276", "text": "function convert(obj) {\n let arr = [];\n for (let key in obj) {\n let temp = [];\n temp.push(key);\n temp.push(obj[key]);\n arr.push(temp);\n }\n return arr;\n}", "title": "" }, { "docid": "cd1394325f20deacae7b9dd3e0c89948", "score": "0.7240697", "text": "function obj2arr(obj) {\n var arr = [];\n\n for (var key in obj)\n arr.push([key, obj[key]]);\n\n return arr;\n}", "title": "" }, { "docid": "5d91c8561ca9fbf9e3b7feabbf116267", "score": "0.7237578", "text": "function objectKeys(object) { Object.keys(object) }", "title": "" }, { "docid": "1b0833b186f6aad5bbf8895634d4ec78", "score": "0.72260624", "text": "function keys(object) {\n var output = [];\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n return output;\n}", "title": "" }, { "docid": "1b0833b186f6aad5bbf8895634d4ec78", "score": "0.72260624", "text": "function keys(object) {\n var output = [];\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n return output;\n}", "title": "" }, { "docid": "1b0833b186f6aad5bbf8895634d4ec78", "score": "0.72260624", "text": "function keys(object) {\n var output = [];\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n return output;\n}", "title": "" }, { "docid": "1b0833b186f6aad5bbf8895634d4ec78", "score": "0.72260624", "text": "function keys(object) {\n var output = [];\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n return output;\n}", "title": "" }, { "docid": "07c517e62b9bfb62bc745ac66761a6f3", "score": "0.72179055", "text": "function convertObjectToArrayAndRetainKeys(convertableObject) {\n\tvar convertedArray = [];\n\t\n\tfor (var key in convertableObject) {\n\t\tconvertedArray.push(Object.assign(convertableObject[key], {name: key}));\n\t}\n\t\n\treturn convertedArray;\n}", "title": "" }, { "docid": "0bfa4ba14b768b986019667be833abd8", "score": "0.72041905", "text": "function changeKeysToArray (simpleObject) {\n var keylessArray = [];\n\n _.forOwn(simpleObject, function (value) {\n keylessArray.push(value);\n });\n\n return keylessArray;\n }", "title": "" }, { "docid": "c6503c324124186c9670246cdd3e92e8", "score": "0.7197906", "text": "function keys(object) {\n var output = [];\n\n for (var key in object) {\n if (hasKey(object, key)) {\n output.push(key);\n }\n }\n\n return output;\n }", "title": "" }, { "docid": "2c5694cfa1b2a1061ee29ad4fcc9d4f4", "score": "0.7197261", "text": "function getObjectKeys(object) {\n // YOUR CODE BELOW HERE //\n \n var myArr = []; //create an array literal\n for (var key in object) { //iterate through the keys in a given object\n myArr.push(key); //push eack key into the array\n }\n \n return myArr //return the array\n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "4d21b8e746c8f8b2c5886814b4e57818", "score": "0.718645", "text": "function getKeiesByObj(obj){\n\tvar arrayKey = [];\n\tvar i = 0;\n\tfor(var key in obj){\n\t\tarrayKey[i] = key;\n\t\ti++;\n\t}\n\treturn arrayKey;\n}", "title": "" }, { "docid": "4fe5c2a67df9ef02b0ab1e10036fd269", "score": "0.71816444", "text": "function allKeys(obj) {\r\n if (!types.isObject(obj)) return [];\r\n var keys = [];\r\n for (var key in obj) keys.push(key);\r\n return keys;\r\n }", "title": "" }, { "docid": "fb1f50666ad54682c260e2060d94c849", "score": "0.7179466", "text": "function objectKeysPolyfill(obj) {\n var keys = [];\n for (var k in obj) {\n if (Object.hasOwnProperty(k)) {\n keys.push(k);\n }\n }\n return keys;\n }", "title": "" }, { "docid": "6a19b01f60883467cf523d0ead617868", "score": "0.7169324", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "6a19b01f60883467cf523d0ead617868", "score": "0.7169324", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "d86a6136a5a9b03028f5091d3d28e2cb", "score": "0.71672964", "text": "function getKeys(object) {\r\n if (Object && Object.keys) {\r\n return Object.keys(object);\r\n }\r\n var keys = [];\r\n for (var key in object) {\r\n keys.push(key);\r\n }\r\n return keys;\r\n }", "title": "" }, { "docid": "3477da114b7b78da980961e703a5fd89", "score": "0.7146971", "text": "function keys(obj) {\r\n if (!types.isObject(obj)) return []; \r\n var keys = [];\r\n for (var key in obj) if (has(obj, key)) keys.push(key);\r\n return keys;\r\n }", "title": "" }, { "docid": "41f06ede8b87b271d495898bec96855f", "score": "0.71412253", "text": "function getObjectKeys(_object)\n{\n\tvar keys = [];\n\t\n\tfor(var k in _object)\n\t\tkeys.push(k);\n\n\treturn(keys);\n}", "title": "" }, { "docid": "8750bbec10e49c9c38b36c29d8dfddbc", "score": "0.7133945", "text": "function toArray(obj) {\n\tconst a = [];\n\tfor (let [key, value] of Object.entries(obj)) {\n a.push([key, value]);\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "f0568560469753ab8e4147dd2a9d2a5f", "score": "0.7117458", "text": "function keys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"]) return Object(_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"])(obj);\n var keys = [];\n for (var key in obj) if (Object(_has_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "f0568560469753ab8e4147dd2a9d2a5f", "score": "0.7117458", "text": "function keys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"]) return Object(_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"])(obj);\n var keys = [];\n for (var key in obj) if (Object(_has_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "f0568560469753ab8e4147dd2a9d2a5f", "score": "0.7117458", "text": "function keys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"]) return Object(_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeKeys\"])(obj);\n var keys = [];\n for (var key in obj) if (Object(_has_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "b93132e3a33bb8c8f8bbf2fb5976aa35", "score": "0.71002674", "text": "function keys(obj) {\n return Object.keys(obj);\n}", "title": "" }, { "docid": "7deadfa475448711639655f3f4d5c043", "score": "0.7081841", "text": "function objectKeys(obj) {\n if (typeof obj !== 'object')\n return [];\n var keys = [];\n for (var key in obj)\n keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "ff2ffd96ff646e14725c14fdc6f59474", "score": "0.70798874", "text": "function objectKeys(obj)\n{\n var attr;\n var arraykeys=[];\n for (attr in obj)\n {\n arraykeys[arraykeys.length]= attr;\n }\n return arraykeys;\n}", "title": "" }, { "docid": "2773a29550254ef14ddad34015f16e59", "score": "0.7074845", "text": "function getObjectKeys(object) {\n // YOUR CODE BELOW HERE //\n //following line works, but made for-in loop for practice\n //return Object.keys(object);\n var newArray = [];\n for(var key in object){\n newArray.push(object[key]);\n }\n return newArray;\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "f8721dadbb165b5aa6f3bc2d81f5b172", "score": "0.7058884", "text": "function keys_keys(obj) {\n if (!isObject(obj)) return [];\n if (_setup[\"m\" /* nativeKeys */]) return Object(_setup[\"m\" /* nativeKeys */])(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup[\"h\" /* hasEnumBug */]) collectNonEnumProps(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "f8721dadbb165b5aa6f3bc2d81f5b172", "score": "0.7058884", "text": "function keys_keys(obj) {\n if (!isObject(obj)) return [];\n if (_setup[\"m\" /* nativeKeys */]) return Object(_setup[\"m\" /* nativeKeys */])(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup[\"h\" /* hasEnumBug */]) collectNonEnumProps(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "261a60c022a4e769c53e2528a771754a", "score": "0.7055899", "text": "function keys(obj) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__.default)(obj)) return [];\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys) return (0,_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys)(obj);\n var keys = [];\n for (var key in obj) if ((0,_has_js__WEBPACK_IMPORTED_MODULE_2__.default)(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__.default)(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "5711ae726fa65d7033a7a30559c17546", "score": "0.7046298", "text": "function toArray (obj) {\n var arr = [];\n for ( var key in obj ) {\n arr.push(obj[key]);\n }\n return arr;\n}", "title": "" }, { "docid": "b519141359704da0a6a129c9d4dfbd05", "score": "0.7036029", "text": "function keys(obj) {\n if (isObject(obj)) return [];\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "b519141359704da0a6a129c9d4dfbd05", "score": "0.7036029", "text": "function keys(obj) {\n if (isObject(obj)) return [];\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n return keys;\n }", "title": "" }, { "docid": "d512cefb309b0564e94685bec7ab7738", "score": "0.70309263", "text": "function keys(obj) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys) return (0,_setup_js__WEBPACK_IMPORTED_MODULE_1__.nativeKeys)(obj);\n var keys = [];\n for (var key in obj) if ((0,_has_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "692c97abc79935bc955b6ad052916a1e", "score": "0.70290124", "text": "function getAllKeys(obj) {\r\n for (let key in obj) {\r\n if (typeof obj[key] === \"object\") {\r\n keyArr.push(key);\r\n getAllKeys(obj[key]);\r\n } else {\r\n keyArr.push(key);\r\n }\r\n }\r\n return keyArr;\r\n}", "title": "" }, { "docid": "dc4567552459c1cc3c90e0aaed27be3c", "score": "0.7017948", "text": "function toArray(obj) {\n\t\n\tlet arr = []\n\tfor(let [key, value] of Object.entries(obj)){\n\tarr.push([key,value])\n}\n\treturn arr\n}", "title": "" }, { "docid": "fe7542a5fe7c9626a8643ebe20815311", "score": "0.7009948", "text": "function getObjectKeys(object) {\n // YOUR CODE BELOW HERE //\nvar keyArray = object;\n\nreturn Object.keys(keyArray);\n}", "title": "" }, { "docid": "176128ce4e8b95edbaa0c2e7624f7e34", "score": "0.7009502", "text": "function keys2objs(obj, keys) {\n\tvar arr = []\n\tfor (var i in keys)\n\t\tarr.push(obj[keys[i]])\n\treturn arr\n}", "title": "" }, { "docid": "53120713743e99011163c55fef563f56", "score": "0.7007363", "text": "function getAllKeys(obj){\n return Object.keys(obj)\n}", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "1dc728238be070a7c07bdcc3c978b64d", "score": "0.6961349", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n }", "title": "" }, { "docid": "e4ba18c638a0a45f2f6178fca19110af", "score": "0.69609576", "text": "function allKeys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "e4ba18c638a0a45f2f6178fca19110af", "score": "0.69609576", "text": "function allKeys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "e4ba18c638a0a45f2f6178fca19110af", "score": "0.69609576", "text": "function allKeys(obj) {\n if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__[\"hasEnumBug\"]) Object(_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "3ded3fbc64c42a505c2ebed77cfa1750", "score": "0.6960008", "text": "function allKeys(obj) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__.default)(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__.default)(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "433f8dcbaa9a8dda3b7e13788e524652", "score": "0.69566303", "text": "function getEntries (obj) {\n return Object.keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n}", "title": "" }, { "docid": "8832d77d40088e0cd0098b4a964672f0", "score": "0.6956444", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "8832d77d40088e0cd0098b4a964672f0", "score": "0.6956444", "text": "function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "a9b23f99eeeb4d59774db57e941b08e7", "score": "0.6952311", "text": "function getArrayOfObject(object) {\n return Object.keys(object).map(key => object[key]);\n}", "title": "" }, { "docid": "f7ced25eedbe6ca2570f7f012b521927", "score": "0.6950559", "text": "function keys(obj) {\n var names;\n if (Object.keys) {\n names = Object.keys(obj);\n }\n else {\n names = [];\n Utils.foreach(obj, function (val, key) {\n names.push(key);\n });\n }\n return names;\n }", "title": "" }, { "docid": "000d8b9ebfdcabbf1d2900aa9d85548d", "score": "0.69487476", "text": "function toArray(objectData){\r\n return Object.keys(objectData).map(function(key) {\r\n return objectData[key];\r\n });\r\n }", "title": "" }, { "docid": "000d8b9ebfdcabbf1d2900aa9d85548d", "score": "0.69487476", "text": "function toArray(objectData){\r\n return Object.keys(objectData).map(function(key) {\r\n return objectData[key];\r\n });\r\n }", "title": "" }, { "docid": "0caee8699249e3997f2972605b640732", "score": "0.69427395", "text": "function keys(o) {\n if (typeof o !== \"object\") throw TypeError(); // Object argument required\n var result = []; // The array we will return\n for(var prop in o) { // For all enumerable properties\n if (o.hasOwnProperty(prop)) // If it is an own property\n result.push(prop); // add it to the array.\n }\n return result; // Return the array.\n }", "title": "" }, { "docid": "09ebd14f2767a39bfa8956d5886b5bcb", "score": "0.6941713", "text": "function toArray(obj) {\n return Object.keys(obj).map((key) => ({\n key,\n val: obj[key],\n }));\n}", "title": "" }, { "docid": "8a430afcaaaa4a9e28b7e2d7429e613f", "score": "0.6929", "text": "function obj2arr(obj) {\n\tvar arr = []\n\tfor (var k in obj)\n\t\tarr.push(obj[k])\n\treturn arr\n}", "title": "" }, { "docid": "47743834f3116b7f5c6e469de46b8f15", "score": "0.69271266", "text": "function keysAndValues(obj) {\n\treturn [Object.keys(obj), Object.values(obj)];\n}", "title": "" }, { "docid": "1e30ddaa3d4782a3e1e708ce8d76f02a", "score": "0.69087404", "text": "function _keys (obj) {\n\t\tif (!_isObject(obj)) { return []; }\n\t\tif (nativeKeys) { return nativeKeys(obj); }\n\t\tvar keys = [];\n\t\tfor (var key in obj)\n\t\t\t{ if (_has(obj, key)) { keys.push(key); } }\n\t\t\t// Ahem, IE < 9.\n\t\tif (hasEnumBug) { collectNonEnumProps(obj, keys); }\n\t\treturn keys;\n\t}", "title": "" }, { "docid": "5d8fcd726b0b9d76226a4abfa79d831b", "score": "0.69043714", "text": "function allKeys(obj) {\n if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (_setup_js__WEBPACK_IMPORTED_MODULE_1__.hasEnumBug) (0,_collectNonEnumProps_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(obj, keys);\n return keys;\n}", "title": "" }, { "docid": "1a4b16c8eb67d7ad080e33a7319e42ed", "score": "0.6879051", "text": "function values(obj) {\n return Object.keys(obj).reduce(function (arr, key) {\n arr.push(obj[key]);\n return arr;\n }, []);\n}", "title": "" }, { "docid": "1a4b16c8eb67d7ad080e33a7319e42ed", "score": "0.6879051", "text": "function values(obj) {\n return Object.keys(obj).reduce(function (arr, key) {\n arr.push(obj[key]);\n return arr;\n }, []);\n}", "title": "" }, { "docid": "1a4b16c8eb67d7ad080e33a7319e42ed", "score": "0.6879051", "text": "function values(obj) {\n return Object.keys(obj).reduce(function (arr, key) {\n arr.push(obj[key]);\n return arr;\n }, []);\n}", "title": "" } ]
7aaf4cfa063ecd111728a898e9ba1c26
Contracts Active other goverement entities parameter create
[ { "docid": "5a31df36b1088ecd4a950b723a9f624d", "score": "0.0", "text": "function contractOtherActiveRegisteredPayLoad() {\n var yearArray = [\"2014\", \"2015\", \"2016\", \"2017\", \"2018\", \"2019\", \"2020\", \"2021\", \"2022\", \"2023\", \"2024\", \"2025\", \"2026\", \"2027\", \"2028\", \"2029\", \"2030\"];\n var vendorCodeArray = [\"manpowergroup public sector, inc\", \"manpowergroup us inc\", \"experis us inc\", \"comsys information technology services, llc\"]; for (var i = 0; i < yearArray.length; i++) {\n for (var j = 0; j < vendorCodeArray.length; j++) {\n if (yearArray[i] == vendorCodeArray[j]) {\n console.log('error!');\n } else {\n var yearRange = parseInt(yearArray[i]);\n var vendorCode = vendorCodeArray[j];\n contractOtherActiveRegisteredPayLoadRequest = `<request>\n <type_of_data>Contracts_OGE</type_of_data>\n <records_from>1</records_from>\n <max_records>1000</max_records>\n <search_criteria>\n <criteria>\n <name>status</name>\n <type>value</type>\n <value>active</value>\n </criteria>\n <criteria>\n <name>category</name>\n <type>value</type>\n <value>expense</value>\n </criteria>\n <criteria>\n <name>prime_vendor</name>\n <type>value</type>\n <value>${vendorCode}</value>\n </criteria>\n <criteria>\n <name>calendar_year</name>\n <type>value</type>\n <value>${yearRange}</value>\n </criteria>\n </search_criteria>\n <response_columns>\n <column>contract_id</column>\n <column>purpose</column>\n <column>version</column>\n <column>parent_contract_id</column>\n <column>original_amount</column>\n <column>current_amount</column>\n <column>spent_to_date</column>\n <column>document_code</column> \n <column>year</column>\n <column>entity_contract_number</column>\n <column>prime_vendor</column>\n <column>other_government_entities</column>\n <column>contract_type</column>\n <column>award_method</column>\n <column>expense_category</column>\n <column>start_date</column>\n <column>end_date</column>\n <column>contract_industry</column> \n <column>budget_name</column> \n <column>commodity_line</column> \n </response_columns>\n</request>`;\n contractOtherActiveRegisteredMode(contractOtherActiveRegisteredPayLoadRequest);\n }\n\n }\n }\n }", "title": "" } ]
[ { "docid": "b50ccf1e3e263a3d8f2515189f7c929f", "score": "0.59996104", "text": "function onEntityCreate() {}", "title": "" }, { "docid": "1ba9139d0ab55b478567aa346a45e6de", "score": "0.5831085", "text": "function companyCreate() {\n}", "title": "" }, { "docid": "92879aa17e60c5c4a8f4e79783617100", "score": "0.55341053", "text": "function organization_create(){\n\tthis.level = 1;\n\tthis.balance = 0;\n\n\tutils.http_post('callbacks/organizations_create.php', {\n\n\t\t'tsid'\t\t: this.tsid,\n\t\t'created'\t: this.created,\n\t\t'creator'\t: this.creator,\n\t\t'name'\t\t: this.label\n\n\t}, this.tsid);\n}", "title": "" }, { "docid": "9f5c84fbaed32e45a0bc2134df0b6fcc", "score": "0.55249447", "text": "async function createContract() {\n const create_ix = await create(\n connection,\n vesting_program_id,\n seed, //used to derive vestingAccountKey\n payer.publicKey,\n payer.publicKey,\n null, //this gets derived automatically\n bob_pk,\n minter_pk,\n schedules,\n )\n // console.log(create_ix)\n\n const tx = new Transaction().add(create_ix[0], create_ix[1], create_ix[2]);\n let tx_hash = await sendAndConfirmTransaction(connection, tx, [payer])\n console.log(tx_hash)\n}", "title": "" }, { "docid": "ffc58693bc94630273faa44b0d0ae795", "score": "0.5478699", "text": "function _actionAddNewGuaranteed() {\n var oGuaranteed = addGuaranteedServices.formatsGuaranteed($scope.rawMyGuaranteed);\n\n $scope.isGuaranteedValid = true;\n $scope.addNewGuaranteed(oGuaranteed);\n $scope.compareGuaranteed();\n }", "title": "" }, { "docid": "6b56582f7d2b755199add77d15e428e2", "score": "0.5362808", "text": "static createAccount(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: params.programId.toBuffer()\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: true,\n isWritable: true\n }],\n programId: this.programId,\n data\n });\n }", "title": "" }, { "docid": "ec5a5f568f409593a681ab48b43439b5", "score": "0.5356066", "text": "constructor() { \n \n ComAdobeCqSocialEnablementResourceEndpointsImplEnablementResourceModelOperationServiceInfo.initialize(this);\n }", "title": "" }, { "docid": "40364a0118ab948c302952f2de05f72c", "score": "0.5354372", "text": "function change_pending_bargain_create(context, event) {\n\tpartner = $(event.currentTarget).val()\n\tbargain_partner = ko.utils.arrayFirst(context.bargains_partners(), function(b) { return b.id() == partner });\n\n\tif(partner != '')\n\t\thttp_actions.pendingBargainCreate(bargain_partner)\n}", "title": "" }, { "docid": "20b3e744dac24624139a02afc8257d66", "score": "0.5350606", "text": "static createAccount(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: true,\n isWritable: true\n }],\n programId: this.programId,\n data\n });\n }", "title": "" }, { "docid": "b7b71272348d4be8d108fa926b2ea234", "score": "0.5327", "text": "static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }", "title": "" }, { "docid": "b7b71272348d4be8d108fa926b2ea234", "score": "0.5327", "text": "static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }", "title": "" }, { "docid": "ea502dc3a2c3665a5270ca239e5d5485", "score": "0.5325659", "text": "function createBuilding( obj , onFinish )\n{\n //create a new object\n var protoObj = defaultObj();\n\n //assign each of the properties to the one in obj parameter\n for ( var prop in protoObj )\n {\n protoObj[ prop ] = obj[ prop ];\n }\n\n //assign the id field of the new object to the obj parameter id\n if ( obj[ ID_KEY ] )\n {\n protoObj[ ID_KEY ] = obj[ ID_KEY ];\n }\n\n buildingDAO.createBuilding( protoObj , onFinish );\n}", "title": "" }, { "docid": "34fedec2413247ff9b986029337ae928", "score": "0.53107077", "text": "static createInPublishedParameterUnderDataEntity(container) {\n return internal.instancehelpers.createElement(container, DataEntity, \"dataEntity\", false);\n }", "title": "" }, { "docid": "a1754d7b11c023888091690976e0e7d9", "score": "0.5296913", "text": "function createEncuesta(folioCliente, respuesta1, respuesta2, respuesta3_justi, respuesta4){\n const encuesta = new EncuestaAcreditado({\n folioCliente, respuesta1, respuesta2, respuesta3_justi, respuesta4\n }) \n\n return encuesta.save()\n}", "title": "" }, { "docid": "81bb44a2faff67005ce2c98933c990d7", "score": "0.5292099", "text": "addCar(newOwner, make, model, carID) {\r\n this.addTransactionsToPendingTransactions(new Transaction({ 'oldOwner': \"addToSystem\", 'newOwner': newOwner, 'make': make, 'model': model, 'carID': carID }));\r\n}", "title": "" }, { "docid": "e9198212c3f9d1d0f7ceca6726450780", "score": "0.5291116", "text": "function createBillCycleChange() {\n var isBlackListed = false;\n var isDateValidated = true;\n var contactId = parent.Xrm.Page.data.entity.getId().replace(\"{\", \"\").replace(\"}\", \"\");\n var entityName = \"amx_bibillcyclechanges\";\n\n //validateBlackListStatus(contactId, function (response) {\n // isBlackListed = response;\n //});\n dateValidation(function (response) {\n isDateValidated = response;\n });\n if (parent.Xrm.Page.ui.getFormType() == 2) { //&& isDateValidated && !isBlackListed) {\n var billingAccount = {};\n if (parent.Xrm.Page.getAttribute(\"etel_blackliststatuscode\").getValue() != null)\n billingAccount[\"amx_blackliststatus\"] = parent.Xrm.Page.getAttribute(\"etel_blackliststatuscode\").getValue();\n\n if (parent.Xrm.Page.getAttribute(\"fullname\").getValue() != null)\n billingAccount[\"amx_name\"] = \"Bill Cycle Change by \" + parent.Xrm.Page.getAttribute(\"fullname\").getValue();\n\n if (parent.Xrm.Page.getAttribute(\"etel_externalid\").getValue() != null)\n billingAccount[\"amx_customerid\"] = parent.Xrm.Page.getAttribute(\"etel_externalid\").getValue();\n\n billingAccount[\"[email protected]\"] = \"/contacts(\" + contactId + \")\";\n\n AMX.COMMON.CreateEntiyWebApi(entityName, billingAccount, function (ID) {\n var options = { openInNewWindow: true };\n parent.Xrm.Utility.openEntityForm(\"amx_bibillcyclechange\", ID, null, options);\n },\n function (error) {\n parent.Xrm.Utility.alertDialog(error);\n }, false);\n }\n}", "title": "" }, { "docid": "ddc9bb91d789751f2e3769984cfb8b8e", "score": "0.52703625", "text": "Create() {}", "title": "" }, { "docid": "db3e87bcf2de94ede73dba85c293e713", "score": "0.52627665", "text": "create(entity){\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t\n\t\t\tthis.can('create').then((permission) => {\n\t\t\t\t\n\t\t\t\tif(permission != true){ \n\t\t\t\t\n\t\t\t\t\treturn resolve(null);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\tif(!_.has(entity,'id')){\n\t\t\t\n\t\t\t\t\t\tentity.id = uuidV4();\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!_.has(entity, 'account') && _.has(global, 'account')){\n\t\t\t\t\n\t\t\t\t\t\tif(!_.contains(this.nonaccounts, this.descriptive_name)){\n\t\t\t\t\n\t\t\t\t\t\t\tentity.account = global.account;\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tlet query_parameters = {\n\t\t\t\t\t\tcondition_expression: 'id = :idv',\n\t\t\t\t\t\texpression_attribute_values: {':idv': entity.id}\n\t\t\t\t\t};\n\t\t\t\n\t\t\t\t\tif(_.has(global, 'account')){\n\t\t\t\t\n\t\t\t\t\t\tif(global.account == '*'){\n\t\t\t\t\t\n\t\t\t\t\t\t\t//for now, do nothing\n\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\t\t\tquery_parameters.filter_expression = 'account = :accountv';\n\t\t\t\t\t\t\tquery_parameters.expression_attribute_values[':accountv'] = global.account;\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tdynamoutilities.queryRecords(this.table_name, query_parameters, null, (error, data) => {\n\t\t\t\t\n\t\t\t\t\t\tif(_.isError(error)){ \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(_.isObject(data) && _.isArray(data) && data.length > 0){\n\n\t\t\t\t\t\t\treturn reject(new Error('A '+this.descriptive_name+' already exists with ID: \"'+entity.id+'\"'));\n\t\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t\tdynamoutilities.saveRecord(this.table_name, entity, (error, data) => {\t\t\n\n\t\t\t\t\t\t\tif(_.isError(error)){ reject(error);}\n\n\t\t\t\t\t\t\tthis.addToSearchIndex(entity, this.descriptive_name).then((indexed) => {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn resolve(entity);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}).catch((error) => {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn reject(error);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\t\t});\n\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\n\t\t\t}).catch((error) => {\n\t\t\t\treturn reject(error);\n\t\t\t});\n\t\t\t\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "2017a9bb2a91e69cd1107676d8b8523a", "score": "0.5254424", "text": "create (entityName, body) {\n this._prepareRequest('create', entityName, this._wrapBody(body))\n return this\n }", "title": "" }, { "docid": "f1bcb08aa02834d161d011fe40f357ec", "score": "0.52433693", "text": "async create(req,res) {\n\t\tconst key_user = res.locals.user;\n\t\tvar orgTemp = Object.assign({},req.body);\n\t\torgTemp.alias = req.body.alias && (typeof req.body.alias === 'string') ? JSON.parse(req.body.alias) : undefined;\n\t\torgTemp.type = req.body.type || 'customer';\n\t\torgTemp.address = req.body.address || {};\n\t\torgTemp.social = req.body.social || {};\n\t\torgTemp.mod = [{\n\t\t\tby: `${key_user.person.name} ${key_user.person.fatherName}`,\n\t\t\twhen: new Date(),\n\t\t\twhat: 'Creación '\n\t\t}];\n\t\tvar org = new Org(orgTemp);\n\t\ttry {\n\t\t\tawait org.save();\n\t\t\tres.status(StatusCodes.OK).json({\n\t\t\t\t'message': `${org.name} creada correctamente`,\n\t\t\t\t'id': org._id\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tErr.sendError(res,e,'orgsController', 'create -- Creating Org--');\n\t\t}\n\t}", "title": "" }, { "docid": "22d3ff8e1f7d413738068dbf4fa30a07", "score": "0.5234908", "text": "invest(){\n let investment = {\n investor: this.user._id,\n property: this.state.property._id,\n sharesNumber: this.state.shares,\n amount: this.state.total\n }\n create( 'investment',investment )\n .then( success => {\n if(success) {\n alert('Gracias por tu participación, nuestros asesores se pondrán en contacto para dar seguimiento.')\n this.close()\n }\n } )\n }", "title": "" }, { "docid": "8e5ca50855e4d19fc3c73d7a276e6786", "score": "0.52212465", "text": "function createPrams() {\n var singledovParams = {};\n singledovParams.intake_document_id = parseInt(self.singleDoc.doc_id);\n singledovParams.doc_name = self.docModel.documentname;\n singledovParams.memo = self.docModel.memo;\n singledovParams.date_filed_date = utils.isNotEmptyVal(self.docModel.date_filed_date) ? moment.utc(moment(angular.copy(self.docModel.date_filed_date)).startOf('day')).unix() : '';\n singledovParams.doc_category = { \"doc_category_id\": utils.isNotEmptyVal(self.docModel.category) ? parseInt(self.docModel.category.doc_category_id) : \"\" };\n singledovParams.associated_party = { \"associated_party_id\": utils.isNotEmptyVal(self.docModel.associated_party_id) ? parseInt(self.docModel.associated_party_id) : 0, \"associated_party_role\": utils.isNotEmptyVal(self.docModel.party_role) ? parseInt(self.docModel.party_role) : 0 };\n // singledovParams.party_role = self.docModel.party_role;\n singledovParams.uploadtype = 'version';\n singledovParams.needs_review = self.docModel.needs_review ? 1 : 0;\n singledovParams.review_user = utils.isNotEmptyVal(self.docModel.reviewUser) ? self.docModel.reviewUser.toString() : ''; //self.docModel.reviewUser.toString(); // assign reviewer\n singledovParams.intake = { \"intake_id\": parseInt(self.singleDoc.intake.intake_id) },\n singledovParams.tags_String = _.pluck(self.docAddTags, 'name').toString();\n return singledovParams;\n }", "title": "" }, { "docid": "64ec72ccd5011fc65a0ef6cace3765c1", "score": "0.52056766", "text": "async create(request,response) {\n \n //definir os dados na entrada garante que não seja guardado nenhum dado indevido\n const { title, description, value, } = request.body;\n\n //obter atraves do cabeçalho da requisição o id da ong autenticada\n const ong_id = request.headers.authorization;\n\n /**\n * O retorno é um array contendo o id inserido\n * pode-se fazer essa atribuição com a notação entre colchetes \n * [valor] = array[0], o valor assim recebe a primeira posição do array\n * */\n const [id] = await connection('incidents').insert({\n title,\n description,\n value,\n ong_id\n });\n\n //retornar o id para para a ong\n return response.json({id});\n }", "title": "" }, { "docid": "5b7082200e857c26a75e098a7a2f9abb", "score": "0.5204622", "text": "async create(amount, overrideParameters) {\n const entities = this.make(amount, overrideParameters);\n await this.em.persistAndFlush(entities);\n return entities;\n }", "title": "" }, { "docid": "01ae051527bc868632125b63a73b609d", "score": "0.5185877", "text": "build() {\n let accepts = [];\n if (this.ctx.type === \"relation\" || this.ctx.type === \"nested\")\n accepts.push({ arg: 'id', type: 'string', required: true, description: this.ctx.Model.definition.name + ' ID' });\n if (this.ctx.type === \"relation\" && !this.ctx.relation)\n accepts.push({ arg: 'relation', type: 'string', required: true, description: 'Relationship name' });\n if (this.ctx.type === \"nested\")\n accepts.push({ arg: 'nested', type: 'string', required: true, description: 'Nested array property name' });\n accepts.push({ arg: 'range', type: 'string', required: true, description: 'hourly, daily, weekly, monthly, yearly, custom' });\n accepts.push({ arg: 'custom', type: 'object', required: false, description: '{\"start\": date, \"end\": date }' });\n accepts.push({ arg: 'where', type: 'object', description: 'where filter ' + (this.ctx.relation || this.ctx.nested || '') });\n accepts.push({ arg: 'groupBy', type: 'string', description: 'group by filter ' });\n return accepts;\n }", "title": "" }, { "docid": "94dbd313a70923aedff85a9919cc6add", "score": "0.515732", "text": "constructor(entity){\n super(entity);\n }", "title": "" }, { "docid": "1ade2767d35f1fa7740ddcc8cf3d9755", "score": "0.51545733", "text": "create(entity, data) {\n check(entity, String)\n check(data, Match.OneOf(Object, [Object]))\n return this._invokeSobjectMethod('create', false, ...arguments)\n }", "title": "" }, { "docid": "27f10358b8566aaabc1bb5d743bb906f", "score": "0.51506054", "text": "makeOne(overrideParameters) {\n const entity = this.em.create(this.model, Object.assign({}, this.definition(faker_1.default), overrideParameters));\n if (this.eachFunction) {\n this.eachFunction(entity);\n }\n return entity;\n }", "title": "" }, { "docid": "78707f7c4645cc8068701611ad2cad1b", "score": "0.5150219", "text": "function createNullo(entityName, values) {\n var initialValues = values || { name: ' [Select a ' + entityName + ']' };\n return manager.createEntity(entityName, initialValues, unchanged);\n }", "title": "" }, { "docid": "4f045bd78d7938deefb9d842aa395086", "score": "0.51417196", "text": "async createComp(competence){\n return await this.DAO.createCompetence(competence);\n }", "title": "" }, { "docid": "701b7776112d9249f21bd346021e91e9", "score": "0.5136057", "text": "create(params, options) {\n options = Object.assign({}, this.options, this.getOptions(options));\n\n return this.beforeCreate(params, options)\n .then(newParams => this.Model.create(newParams, options))\n .then(object => this.afterCreate(object, options))\n .catch(err => {\n console.error(`${this.constructor.name}.create: Error`, err);\n throw err;\n });\n }", "title": "" }, { "docid": "d392ddb10508c2ee8278a4ad12ef9c9b", "score": "0.5127391", "text": "create(req, res) {\n return Associations\n .create({\n user_id: req.body.user_id,\n project_id: req.body.project_id,\n is_admin: req.body.is_admin,\n status: req.body.status,\n })\n .then(association => res.status(200).send(association))\n .catch((error) => res.status(400).send(error));\n }", "title": "" }, { "docid": "590f2f3c6bc34b5135fa98980c843feb", "score": "0.511213", "text": "createEntity(pGenome) {\n let entity;\n\n function increaseEntityAge() {\n entity.age += 1;\n }\n\n entity = {\n genome: pGenome,\n age: 0,\n increaseAge: increaseEntityAge,\n };\n\n return entity;\n }", "title": "" }, { "docid": "977bb24a9725f9fe452d8aaf90f7aa89", "score": "0.51118773", "text": "handleCreateContract(selling, assetIdx, amount, price, settleTime, peerIdx) {\n // Fetch R-point\n\n let promise = this.fetchOracleKeysForAsset(this.state.Assets[assetIdx], settleTime);\n if(promise === null) throw new Error(\"Cannot determine R-Point\");\n\n var dlcFwdOffer = {};\n promise.then(res => {\n dlcFwdOffer.OracleA = res[0];\n dlcFwdOffer.OracleR = res[1];\n dlcFwdOffer.SettlementTime = settleTime;\n dlcFwdOffer.ImBuyer = !selling;\n dlcFwdOffer.AssetQuantity = amount;\n dlcFwdOffer.FundAmt = amount * price;\n dlcFwdOffer.PeerIdx = peerIdx;\n dlcFwdOffer.CoinType = 257;\n\n this.state.lc.send('LitRPC.NewForwardOffer', { Offer : dlcFwdOffer })\n });\n }", "title": "" }, { "docid": "0f364f59ebd54a5745771ab573b8f817", "score": "0.51116264", "text": "createOrg(orgName, orgType) {\n var orgData = {};\n orgData[\"orgName\"] = orgName;\n orgData[\"orgType\"] = orgType;\n logger.info (\"creating org\", orgData);\n return this.modelService.create(orgData);\n }", "title": "" }, { "docid": "b301b3d1c4f18e94be27667da650c00f", "score": "0.51102203", "text": "_newSubject() {\n let authenticationClient = this.context.authenticationClient\n let user = authenticationClient.getUser()\n let resourceClient = this.context.resourceClient\n let items = this.state.items\n let entityData = {\n name: 'New subject',\n synonyms: [],\n description: '',\n entityType: 'subject',\n userId: user.userId,\n updatedBy: user.userId,\n data: {\n name: 'New subject',\n workname: '',\n parent: 'root',\n position: Object.keys(items.getRoots()).length,\n description: ''\n }\n }\n resourceClient.createEntity(entityData, (err, entity) => {\n if (err) {\n this.setState({\n error: new Err('EntitiesPage.CreateError', {\n message: 'Entity could not be created.',\n cause: err\n })\n })\n console.error('ERROR', err)\n return\n }\n\n items.create({\n id: entity.entityId,\n type: 'subject',\n name: entity.data.name,\n workname: entity.data.workname,\n position: entity.data.position,\n count: 0,\n description: entity.data.description,\n parent: 'root'\n })\n\n this.extendProps({\n items: items\n })\n })\n }", "title": "" }, { "docid": "615702c0568e43b0170aff0d0c770be1", "score": "0.5104176", "text": "function newModeOutOfContext(){\n if(!$scope.relatedEntitiesSet){\n $scope.relatedEntitiesSet = true;\n mmRest.accounts.getList({accountType: 'CampaignManager',from: '0', max: '2', permissionNames: entityMetaData['campaign'].permissions.entity.createEdit}).then(function(data) {\n if(data.length > 1 || data.length == 0){\n setRelatedEntity('accounts', data);\n $scope.originalCopy = mmRest.EC2Restangular.copy($scope.editObject);\n $scope.pageReady = true;\n }else if(data.length == 1) {\n $scope.isMultipleAccounts = false;\n $scope.accountId = data[0].id;\n newModeAccountContext();\n }\n }, function (error) {\n processError(error);\n });\n }\n }", "title": "" }, { "docid": "d84a2c7df188b670ae29d91af7a24017", "score": "0.5103051", "text": "function create(o) { }", "title": "" }, { "docid": "f8e416428f075ba0f6b65b391b2a12a4", "score": "0.5093365", "text": "async function createRequest(obj, args, context, info) {\n\n let userId = store.getUserId()\n\n if(!userId) {\n return {\n err_code: 4000,\n err_msg: 'User token does not exist'\n }\n\n }\n\n let toEmail = args.toEmail\n let toIs = args.toIs // 'client', 'vendor'\n\n if (!toEmail || !toIs) {\n return {\n err_code: 4003,\n err_msg: 'toEmail or toIs is empty'\n }\n\n }\n\n // from company is always user's company\n\n // 1. find fromCompany\n let myCompany = await Company.findUserCompany(userId) // return lean json object, not document\n if (!myCompany) {\n return {\n err_code: 4004,\n err_msg: 'User company does not exist'\n }\n\n }\n // 2. find toCompany\n // find user id by email first\n let toUser = await User.findActiveUserByEmail(toEmail)\n if (!toUser) {\n\n return {\n err_code: 4001, \n err_msg: 'No user found by this email'\n }\n }\n\n let toUserId = toUser._id\n let toCompany = await Company.findUserCompany(toUserId)\n\n if (!toCompany) {\n return {\n err_code: 4008,\n err_msg: 'To company is not found by toEmail'\n }\n\n }\n\n if (toCompany._id.toString() === myCompany._id.toString()) {\n return {\n err_code: 4005,\n err_msg: 'Can not send request to your own company'\n }\n }\n\n // check if already established relationship\n\n if (toIs.toLowerCase() === 'client') {\n // check clients\n let clientDetail = await Company.getMyClientDetail(userId, toCompany._id)\n if (clientDetail) {\n return {\n err_code: 4006,\n err_msg: 'To Company is already your client'\n }\n\n } \n } else {\n // check vendors\n let vendorDetail = await Company.getMyVendorDetail(userId, toCompany._id)\n if (vendorDetail) {\n return {\n err_code: 4007,\n err_msg: 'To Company is already your vendor'\n }\n\n }\n }\n\n // 3. set clientCid\n // 4. set vendorCid\n let clientCid\n let vendorCid\n if (toIs.toLowerCase() === 'client') {\n clientCid = toCompany._id\n vendorCid = myCompany._id\n } else {\n // vendor\n clientCid = myCompany._id\n vendorCid = toCompany._id\n }\n \n // 5. find userfullname\n\n let userFullname = store.getUserFullname()\n\n return Request.createRequest(myCompany, toCompany, clientCid, vendorCid, userFullname)\n}", "title": "" }, { "docid": "9ab392bfbcaaa6998d79dae49d0b1670", "score": "0.50885534", "text": "function insert_initial_Cout_maitrise_construction(cout_maitrise_construction,suppression,id_convention_entete)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n }; \n \n var datas = $.param({\n supprimer: suppression,\n id: 0,\n id_type_cout_maitrise: cout_maitrise_construction.type_cout_maitrise.id,\n cout: cout_maitrise_construction.type_cout_maitrise.cout_maitrise,\n id_convention_entete: id_convention_entete\n\n });\n console.log(cout_maitrise_construction);\n console.log(datas);\n //factory\n apiFactory.add(\"cout_maitrise_construction/index\",datas, config).success(function (data)\n {\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée initial cout maitrise d\\'oeuvre');});\n\n\n }", "title": "" }, { "docid": "79b9b5f1c5de5a0634b368d20ab4d17e", "score": "0.50871354", "text": "function insert_initial_Cout_sousprojet_construction(cout_sousprojet_construction,suppression,id_convention_entete)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n }; \n \n var datas = $.param({\n supprimer: suppression,\n id: 0,\n id_type_cout_sousprojet: cout_sousprojet_construction.type_cout_sousprojet.id,\n cout: cout_sousprojet_construction.type_cout_sousprojet.cout_sousprojet,\n id_convention_entete: id_convention_entete\n\n });\n console.log(cout_sousprojet_construction);\n console.log(datas);\n //factory\n apiFactory.add(\"cout_sousprojet_construction/index\",datas, config).success(function (data)\n {\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée initial cout sous projet');});\n\n\n }", "title": "" }, { "docid": "d1051fce3571327a38be2008b82b6aff", "score": "0.5077539", "text": "static create(req, res) {\n const schema = Joi.object().keys({\n entity: Joi.string().min(1).invalid('entity').required(),\n fields: Joi.array().items(\n Joi.object().keys({\n name : Joi.string().min(1).required(),\n required: Joi.boolean().default(false).required(),\n type : Joi.any().default('string').valid(['int', 'boolean', 'string', 'float', 'date', 'array']).required()\n })\n ).min(1).required()\n });\n\n Joi.validate(req.body, schema, (err, value) => {\n if (err) {\n res.status(422).json(err.details);\n } else {\n const model = new EntityModel(value);\n model.save()\n .then(doc => res.status(201).json(doc))\n .catch(err => res.status(500).json({error: err.code === 11000 ? `Entity ${req.body.entity} already exists` : err.errmsg}))\n ;\n }\n });\n }", "title": "" }, { "docid": "531655249381db58cffbb6ba4b0b7e42", "score": "0.5060779", "text": "getTransactionParams() {\n return new sp.SuggestedParams(this.c);\n }", "title": "" }, { "docid": "b469046944e30850b27bf0c5562b9ab9", "score": "0.50546587", "text": "function add(personState,personType,personId) {\n console.log('Starting creating new invitationCommunication.');\n $scope.CrmInvitationCommunicationVoForCreate = {};\n $scope.CrmInvitationCommunicationVoForCreate.personState = personState;\n $scope.CrmInvitationCommunicationVoForCreate.personType = personType;\n $scope.CrmInvitationCommunicationVoForCreate.personId = personId;\n showModal();\n }", "title": "" }, { "docid": "b50f34b3c6e4dd4aaee0e89388930b85", "score": "0.5052151", "text": "function dataCreate( ctx ) {\n ctx.create().then( dto => {\n ctx.setValue( 'country', dto.country );\n ctx.setValue( 'state', dto.state );\n ctx.setValue( 'city', dto.city );\n ctx.setValue( 'line1', dto.line1 );\n ctx.setValue( 'line2', dto.line2 );\n ctx.setValue( 'postalCode', dto.postalCode );\n ctx.fulfill( null );\n } );\n}", "title": "" }, { "docid": "b50f34b3c6e4dd4aaee0e89388930b85", "score": "0.5052151", "text": "function dataCreate( ctx ) {\n ctx.create().then( dto => {\n ctx.setValue( 'country', dto.country );\n ctx.setValue( 'state', dto.state );\n ctx.setValue( 'city', dto.city );\n ctx.setValue( 'line1', dto.line1 );\n ctx.setValue( 'line2', dto.line2 );\n ctx.setValue( 'postalCode', dto.postalCode );\n ctx.fulfill( null );\n } );\n}", "title": "" }, { "docid": "3e25ee38374258bc4a0e04676e3a0575", "score": "0.5048611", "text": "static get creators() {\n return {\n /**\n * @param {String} path\n * @param {String} fqn\n */\n entityOriginFQN: (path, fqn) => ({\n type: this.types.ENTITY_ORIGIN_FQN,\n payload: { path, fqn }\n }),\n\n /**\n * @param {String} path\n * @param {String} id\n */\n entityOriginID: (path, id) => ({\n type: this.types.ENTITY_ORIGIN_ID,\n payload: { path, id }\n }),\n };\n }", "title": "" }, { "docid": "f4c53abb64006ebbdcfc132e3c88ffad", "score": "0.5041564", "text": "async createShipment(ctx,buyerCRN,drugName,listOfAsset,transporterCRN){\n try{\n\n // Create a composite key for the PO to get registered in ledger\n const poID = ctx.stub.createCompositeKey('org.pharma-network.po',[buyerCRN,drugName]);\n\n // fetch the corresponding po object from the ledger\n let poBuf = await ctx.stub\n .getState(poID)\n .catch(err => console.log(err));\n\n // Convert the received po buffer to a JSON object\n const po = JSON.parse(poBuf.toString());\n\n // convert the passed assets into array\n const listOfAssets = listOfAsset.split(\",\");\n\n // check if the given assets length is matching the quantity of created purchase order\n if(listOfAssets.length == po.quantity){\n\n // create start key\n const startKey = ctx.stub.createCompositeKey('org.pharma-network.drug',[drugName,listOfAssets[0]]);\n\n // create end key\n const endKey = ctx.stub.createCompositeKey('org.pharma-network.drug',[drugName,(Number(listOfAssets[listOfAssets.length-1])+1).toString()]);\n\n // catch the iterator returned by the API\n let res1Iterator = await ctx.stub.getStateByRange(startKey,endKey).catch(err => console.log(err));\n var results = await this.getAllResults(res1Iterator);\n\n // check if all the given assetIDs are valid, if not valid say that invalid assetIDs\n if(results.length == 0){\n console.log(\" ******************** Inavlid ID's of the assets \");\n }\n\n // else if the assetIDs are valid\n else {\n\n // Create a composite key for the company to get registered in ledger\n const shipID = ctx.stub.createCompositeKey('org.pharma-network.shipment',[buyerCRN,drugName]);\n\n // catch the iterator returned by the API\n let resIterator = await ctx.stub.getStateByPartialCompositeKey('org.pharma-network.company',[transporterCRN]).catch(err => console.log(err));\n let results1 = await this.getAllResults(resIterator);\n let transporter = JSON.parse(results1[0]);\n\n // store all the assets(i.e drugs) in this array\n var assets = [];\n\n // store the all the id's of the drug in this array\n var assetIDs = [];\n\n // iterate through all the fetched drugs and push into the created arrays\n results.forEach(drug => {\n // push the drug into the array\n assets.push(JSON.parse(drug));\n\n // push the drug id into the array\n assetIDs.push(JSON.parse(drug).productID);\n });\n\n // create the shipment object to be stored in the ledger\n let shipment = {\n shipmentID: shipID,\n creator: po.seller,\n assets: assetIDs,\n transporter: transporter.companyID,\n status: 'in-transit',\n };\n\n // Convert the JSON object to a buffer and send it to blockchain for storage\n await ctx.stub.putState(shipID,Buffer.from(JSON.stringify(shipment)));\n\n\n // change the owner of all the drugs to the transporter's key\n for(let i=0;i<assets.length;i++){\n // change the owner of the drug to tranporter\n assets[i].owner = transporter.companyID;\n\n // pu the drug back into the ledger\n await ctx.stub.putState(assets[i].productID,Buffer.from(JSON.stringify(assets[i])));\n }\n console.log(\" ********* created shipment \");\n\n // return the shipment object to the user\n return shipment;\n }\n }\n // else if the given quantity of the drugs is not matching\n else{\n console.log(\" ******* Quantity is mis-matching\");\n }\n }\n catch(err){\n console.log(\" \");\n console.log(\" ****** Error is ***** \",err);\n }\n }", "title": "" }, { "docid": "a845c947cc83916b4156ee221df82d8f", "score": "0.50379384", "text": "function create() {}", "title": "" }, { "docid": "a43d6a3476991d3a0aad1217c6875cf0", "score": "0.50360113", "text": "transferCar(newOwner, transaction) {\r\n if (this.checkOwner() == true) {\r\n this.addTransactionsToPendingTransactions(new Transaction({\r\n 'oldOwner': transaction.data.newOwner, 'newOwner': newOwner, 'make': transaction.data.make,\r\n 'model': transaction.data.model, 'carID': transaction.data.carID\r\n }));\r\n }\r\n}", "title": "" }, { "docid": "29088fcc6b4d424d6092ec34ccb215b6", "score": "0.5035614", "text": "async create({body}, res) {\n let {name, price, feedbackLimit, userLimit, advancedSupport} = body;\n\n const persistedPlan = await new Plan({\n name: name,\n price: price,\n feedbackLimit: feedbackLimit,\n userLimit: userLimit,\n advancedSupport: advancedSupport\n }).save();\n\n res.status(200).send(persistedPlan);\n }", "title": "" }, { "docid": "6adf7c2b9af3b14373dcf4baf8226f85", "score": "0.5032439", "text": "static createAccount(params: CreateStakeAccountParams): Transaction {\n let transaction = SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n });\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }", "title": "" }, { "docid": "04ed0a158c5f1321c6b1828c0980164a", "score": "0.50230986", "text": "function addCustomer(em, name) {\n var cust = em.createEntity('Customer', {\n CustomerID: testFns.newGuidComb(),\n CompanyName: name || 'a-new-company'\n });\n return cust;\n }", "title": "" }, { "docid": "d5d3dfc12fdd07290aea6c98b2fd41e4", "score": "0.50160706", "text": "function createResource(params) {\n var resource = new Resource();\n resource.name = params.name;\n resource.description = params.description;\n resource.image = 'null';\n resource.avialable = params.avialable;\n resource.features = params.features;\n resource.reference = params.reference;\n resource.category = params.category._id;\n return resource;\n}", "title": "" }, { "docid": "400dfd06ad08926a04f088a598b1836b", "score": "0.50028384", "text": "function createObj2(nome, sexo, idade, anoEstudo, raca){\n objeto = {\n nome: nome,\n sexo: sexo,\n idade: idade,\n anoEstudo: anoEstudo,\n raca: raca\n };\n return objeto\n}", "title": "" }, { "docid": "2cc0626060f1a867ad35b95c2d5c5de4", "score": "0.49967083", "text": "constructor (owner, balance){\n this.owner = owner;\n this.balance = balance;\n }", "title": "" }, { "docid": "cf7122e34b6f5ef1e8e9736aabccaab5", "score": "0.49946225", "text": "create(){\n\t}", "title": "" }, { "docid": "51fd250a08e65eef307266b156e3c219", "score": "0.4991518", "text": "buildCreateTableRequest()\n {\n let tablename = this.name\n var query = `create table ${tablename}\\n(\\n`;\n //embedded function ti create part of query\n\n //write fields\n let nbFields = Object.keys(this.fields).length;\n let index=0\n for( var fieldname in this.fields)\n {\n index++\n query+=buildFieldQuery(fieldname,this.fields[fieldname]);\n if(index<nbFields)\n {\n query+=',\\n'\n }\n //write foreign key\n }\n index=0\n for(var ref in this.foreignkeys)\n {\n query+='\\t'+buildForeignKey(this.name,ref,this.foreignkeys[ref])\n }\n query+='\\n)'\n\n //constraint fk_truc foreign key (nomChamps) references tablename(id)\n return query\n }", "title": "" }, { "docid": "5ff461feff772706dd60ab45702e6705", "score": "0.4991494", "text": "async create(params) {\n try {\n const newCore_account = `INSERT INTO core_accounts (id, ca ,ua ,exchange ,apiKey ,secretKey ,params ) \n VALUES (UUID(),'${params.date}', '${params.date}', '${params.exchange}', '${params.apiKey}', '${params.secretKey}','${params.params}')IF NOT EXISTS`;\n return await this._core.DBManager.engine.execute(newCore_account);\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "58dcda36fab1f8188f30d86c93ab107d", "score": "0.49881124", "text": "constructor() {\n\n /**\n * DIM Genesis date is: Wed, 07 Jun 2017 12:30:05 GMT\n * \n * @see [Transaction Log](http://hugealice.nem.ninja:7890/transaction/get?hash=dbe07d06b126196ee87d5bd7a10871caf3fd268d4db78eddac4ee309cae8b797)\n * @var {Integer}\n */\n this.dimStartDate = 69251020000 + (1427587585000); // DIM genesis (NEM genesis)\n\n /**\n * DIM Genesis date expressed as a NEM Timestamp.\n *\n * This is expressed *in seconds* since the NEM genesis.\n *\n * @var {Integer}\n */\n this.dimNEMDate = 69251020;\n\n /**\n * The dim:coin genesis block height.\n *\n * @see [Transaction Log](http://hugealice.nem.ninja:7890/transaction/get?hash=dbe07d06b126196ee87d5bd7a10871caf3fd268d4db78eddac4ee309cae8b797)\n * @var {Integer}\n */\n this.dimGenesisHeight = 1143525;\n\n /**\n * The dim:coin genesis transaction id.\n *\n * @see [Transaction Log](http://hugealice.nem.ninja:7890/transaction/get?hash=dbe07d06b126196ee87d5bd7a10871caf3fd268d4db78eddac4ee309cae8b797)\n * @var {Integer}\n */\n this.dimGenesisTransactionId = 810176;\n\n /**\n * The DIM Network ID.\n *\n * @var {Integer}\n */\n this.dimNetworkId = 104; // NEM Mainnet\n\n /**\n * Minimum MICRO TOKEN value to own in order to be accepted\n * in the 30 % Fee Payout.\n */\n this.minTokenHolderShare = 50 * Math.pow(10, 6);\n\n /**\n * This constitutes the base parameters of the said\n * mosaics of the DIM Ecosystem.\n */\n this.mosaicParameters = {\n \"dim:coin\": {\n \"creator\": \"a1df5306355766bd2f9a64efdc089eb294be265987b3359093ae474c051d7d5a\",\n \"divisibility\": 6,\n \"totalSupply\": 9000000000, // total of 9 billion dim:coin\n \"levy\": {\n \"type\": 2, // 1 = Absolute, 2 = \"Percentile\"\n \"fee\": 10, // for 1000 dim:coin, levy = 0.000001 dim:coin,\n \"recipient\": \"NCGGLVO2G3CUACVI5GNX2KRBJSQCN4RDL2ZWJ4DP\",\n \"mosaicId\": {\"namespaceId\": \"dim\", \"name\": \"coin\" }\n }\n },\n \"dim:token\": {\n \"creator\": \"a1df5306355766bd2f9a64efdc089eb294be265987b3359093ae474c051d7d5a\",\n \"divisibility\": 6, \n \"totalSupply\": 10000000, // total of 10 million dim:token\n \"levy\": null\n },\n \"dim:eur\": {\n \"creator\": \"a1df5306355766bd2f9a64efdc089eb294be265987b3359093ae474c051d7d5a\",\n \"divisibility\": 6, \n \"totalSupply\": 10000000, // total of 10 million dim:token\n \"levy\": null\n }\n };\n }", "title": "" }, { "docid": "99b6d4580be3c3edc2fd20618448a198", "score": "0.4985408", "text": "static Create(req, res) {\n let body = req.body;\n new mssql.ConnectionPool(config.config).connect().then((pool) => {\n return pool.request().query(`EXEC sp_create_payment ${body.id_payment_requirements},${body.id_type_payments},${body.id_user_payments}`)\n }).then((fields) => {\n mssql.close()\n res.json(\"CREATED SUCCESSFULLY\");\n }).catch(err => {\n mssql.close()\n res.json(err)\n })\n }", "title": "" }, { "docid": "ab6503c8852f8d2af5975b65abbb04a0", "score": "0.4982821", "text": "function validateActiviyCreate(p) {\n\treturn ((p.idActivityBPM && p.title && p.description ));\n}", "title": "" }, { "docid": "802fe50828fd947f18eecc430bec7032", "score": "0.49815938", "text": "async create(request, response){\n const { title, description, value } = request.body;\n const ong_id = request.headers.authorization;\n\n const [id] = await connection('incidents').insert({\n title,\n description,\n value,\n ong_id,\n });\n\n return response.json({ id })\n }", "title": "" }, { "docid": "5633886cb802ded972eac604ea659b87", "score": "0.4976559", "text": "function createServiceAreaParameters() {\n return () => new ServiceAreaParameters();\n }", "title": "" }, { "docid": "735ce6b410caccea1dd4a13993d1d9f1", "score": "0.4972972", "text": "function contract_create(req, res, next) {\n console.log('Contract create');\n\n Contracts.create(req.body)\n .then(contract => {\n res.send(contract);\n })\n .catch(error => next(error));\n}", "title": "" }, { "docid": "a7346479d74e5a841acb84746942e2ed", "score": "0.49654895", "text": "async createAvailability(person_id, from_date, to_date){\n return await this.DAO.createAvailability\n (person_id, from_date, to_date);\n }", "title": "" }, { "docid": "7e2efa97fc633d477c17713aed4be6ae", "score": "0.4963292", "text": "function Entity(){\n\n}", "title": "" }, { "docid": "233d5cbcafab707a08358a512a8a3d0d", "score": "0.49623337", "text": "create() {\n let invoice = {};\n let equipmentItems = [];\n let cameraman = {};\n const bankSegment = document.querySelector('#bank-account-segment');\n const clientSegment = document.querySelector('#client-segment');\n const jobSegment = document.querySelector('#job-segment');\n const cameramanSegment = document.querySelector('#cameraman-segment');\n const equipmentItemSegments = document.querySelectorAll('.equipment-item');\n\n const bankInputs = bankSegment.querySelectorAll('input');\n for (const input of bankInputs) {\n invoice[input.name] = input.value;\n }\n\n const clientInputs = clientSegment.querySelectorAll('input');\n for (const input of clientInputs) {\n invoice[input.name] = input.value;\n }\n\n const jobInputs = jobSegment.querySelectorAll('input');\n for (const input of jobInputs) {\n invoice[input.name] = input.value;\n }\n\n const cameraInputs = cameramanSegment.querySelectorAll('input');\n for (const input of cameraInputs) {\n cameraman[input.name] = input.value;\n }\n\n for (const item of equipmentItemSegments) {\n let equipmentItem = {}\n const inputFields = item.querySelectorAll('input');\n for (const input of inputFields) {\n equipmentItem[input.name] = input.value;\n }\n equipmentItems.push(equipmentItem);\n }\n\n if (Object.keys(cameraman).length !== 0) {\n invoice['cameraman'] = cameraman;\n }\n\n if (Object.keys(equipmentItems).length !== 0) {\n invoice['equipmentItems'] = equipmentItems;\n }\n\n return invoice;\n }", "title": "" }, { "docid": "90ee1d71f940ebc32b61905ceeefcdd6", "score": "0.496163", "text": "function createNullos(manager) {\n var unchanged = breeze.EntityState.Unchanged;\n\n //createNullo(entityNames.typeOfType);\n // Just need to create nullo for the entity type that is not included in lookup lists\n // Add more Nullos here\n\n function createNullo(entityName, values) {\n var initialValues = values || { name: ' [Select a ' + entityName + ']' };\n return manager.createEntity(entityName, initialValues, unchanged);\n }\n }", "title": "" }, { "docid": "40d5b9bfeba08d750334bbb3ab7882bf", "score": "0.49545276", "text": "function CreateSaleServiceRequest(Order){\r\n\t\r\n\t// declare variables\t\r\n\tvar billingForm = session.forms.billing;\r\n\t//declare common helper variable to call its required methods\r\n\tvar CommonHelper = require('~/cartridge/scripts/helper/CommonHelper');\t\r\n\tvar selectedPaymentMethod =session.forms.billing.paymentMethod.value;\r\n\tvar billTo, purchaseObject, paymentType;\r\n\tvar URLUtils = require('dw/web/URLUtils');\r\n\tvar cancelURL = URLUtils.https('COPlaceOrder-Submit','provider','cancelfail','order_id', Order.orderNo,'order_token', Order.orderToken,'cfk',false).toString();\r\n\tvar successURL = URLUtils.https('COPlaceOrder-Submit','provider','banktransfer','order_id', Order.orderNo,'order_token', Order.orderToken).toString();\r\n\tvar failureURL = URLUtils.https('COPlaceOrder-Submit','provider','cancelfail','order_id', Order.orderNo,'order_token', Order.orderToken,'cfk',false).toString();\r\n\t//setting the value of payment type after getting from payment method\r\n\tpaymentType = session.forms.billing.paymentMethod.value;\t\r\n\t// create billto, shipto, item and purchase total object\r\n\tvar result = CommonHelper.CreateCyberSourceBillToObject(Order,true);\r\n\tbillTo = result.billTo;\r\n\tresult = CommonHelper.CreateCybersourcePurchaseTotalsObject(Order);\r\n\tpurchaseObject = result.purchaseTotals;\r\n\tresult = CommonHelper.CreateCybersourceItemObject(Order);\r\n\tvar items = result.items;\t\r\n\tvar merchantDescriptorValue;\r\n\t// get bank contact custom preference from SFCC\r\n\tvar customPref = GetCustomPreferencesForBT();\r\n\tif(paymentType == 'IDL' || paymentType == 'IDL') {\r\n\t\tmerchantDescriptorValue = customPref.merchantDescriptor.substring(0,35);\r\n\t} else {\r\n\t\tmerchantDescriptorValue = customPref.merchantDescriptor.substring(0,27);\r\n\t}\r\n\r\n\t//declare an object to collate the input to service call\r\n\tvar saleObject = {};\r\n\tsaleObject.billTo = billTo;\r\n\tsaleObject.purchaseObject = purchaseObject;\r\n\tsaleObject.items = items;\r\n\tsaleObject.paymentType = paymentType;\r\n\tsaleObject.cancelURL = cancelURL;\r\n\tsaleObject.successURL = successURL;\r\n\tsaleObject.failureURL = failureURL;\r\n\tsaleObject.merchantDescriptor = merchantDescriptorValue;\r\n\tsaleObject.merchantDescriptorContact = customPref.merchantDescriptorContact;\r\n\tsaleObject.merchantDescriptorStreet = customPref.merchantDescriptorStreet;\r\n\tsaleObject.merchantDescriptorCity = customPref.merchantDescriptorCity;\r\n\tsaleObject.merchantDescriptorState = customPref.merchantDescriptorState;\r\n\tsaleObject.merchantDescriptorPostalCode = customPref.merchantDescriptorPostalCode;\r\n\tsaleObject.merchantDescriptorCountry = customPref.merchantDescriptorCountry;\r\n\tsaleObject.orderNo = Order.orderNo;\r\n\tif(paymentType == 'IDL') {\r\n\t\tif(bankTransferHelper.isBankListRequired(session.forms.billing.paymentMethod.value)){\r\n\t\t\t saleObject.paymentOptionID = session.forms.billing.bankListSelection.value;\r\n\t\t}\r\n\t}\r\n\t//set the swiftcode (bank swift code), if available\r\n\tif(bankTransferHelper.isBicRequired(session.forms.billing.paymentMethod.value)) {\r\n\t\tif(paymentType == 'EPS') {\r\n\t\t\tsaleObject.bicNumber = session.forms.billing.epsBic.value;\r\n\t\t} else if(paymentType == 'GPY'){\r\n\t\t\tsaleObject.bicNumber = session.forms.billing.giropayBic.value;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//call session method of libCybersourceHelper to create session request\r\n\tvar saleResponse = bankTransferFacade.BankTransferSaleService(saleObject);\r\n\t\r\n\tAuthorizeBankTransferOrderUpdate(Order,saleResponse,paymentType);\r\n\t/*return the response as per decision and reason code, redirect the user to\r\n\t merchant site for payment completion*/\r\n\tif (saleResponse.decision === 'ACCEPT' && saleResponse.reasonCode.get() === 100) {\r\n\t\tsession.privacy.order_id = Order.orderNo;\r\n\t\tswitch(saleResponse.apSaleReply.paymentStatus)\r\n\t\t{\t\t\t\t\r\n\t\t\tcase 'pending':\r\n\t\t\t\treturn {redirection : true, redirectionURL : saleResponse.apSaleReply.merchantURL};\r\n\t\t\tcase 'failed':\r\n\t\t\t\treturn {error : true};\r\n\t\t\tdefault:\r\n\t\t\t\treturn {error : true};\r\n\t\t}\r\n\t} else if(saleResponse.decision === 'REJECT'){\r\n\t\t\treturn {declined: true};\r\n\t} else if(saleResponse.decision === 'REVIEW'){\r\n\t\t\treturn {pending: true};\r\n\t} else {\r\n\t\treturn {error: true};\r\n\t}\r\n}", "title": "" }, { "docid": "12a153fd9deb8c752c397af2474dd5fc", "score": "0.49543568", "text": "create(){\n\t\t// Nothing to do\n\t}", "title": "" }, { "docid": "d760a75dbd595e7aee4af9fd80a59cdf", "score": "0.49503592", "text": "function CreateConsignment() {\n CreateConsignCtrl.ePage.Masters.modalInstance.close('close');\n CreateNewConsignment();\n }", "title": "" }, { "docid": "ec2ffc62eed784f70af0f02b6923576d", "score": "0.49472913", "text": "async createOne(overrideParameters) {\n const entity = this.makeOne(overrideParameters);\n await this.em.persistAndFlush(entity);\n return entity;\n }", "title": "" }, { "docid": "f2fe9c7d7297dfa09c4f0cea9db9987a", "score": "0.4946814", "text": "async function Create_New_Service_Order(diag,info) {\n var d=new Date;\n let number = await Create_NewOrder_Number(); //Get Number of the new Services Order\n //Subscribe The GENERAL diagnosis \n \n const newGeneralItem={ //Configure the new Item \n number:number\n ,IDCatEquip:diag[0].IDCatEquip\n ,date:d.toISOString().slice(0,10)\n ,mtto_mill:(info.Mileage+\"\").length>1?info.Mileage:\".00\"\n ,explanation:Build_Text(diag,\"explanation\")\n ,status:0\n ,diagnosis : Build_Text(diag,\"description\")\n ,scheduledmaint:info.IsMaintenance===true?1:0\n ,isOdometerBroken:info.IsOdometerBroken===true?1:0\n }\n \n return await Create_NewOrder(newGeneralItem); //Create the new Item in SQL\n \n }", "title": "" }, { "docid": "c73f45681405f7a6cc1609bd6c611701", "score": "0.4944377", "text": "async registerCompany(ctx,companyCRN,companyName,location,organisationRole){\n\n var roles = [\"Manufacturer\",\"Distributor\",\"Retailer\"];\n\n // check whether the role entered is valid or not\n if(roles.indexOf(organisationRole) >= 0){\n // Create a composite key for the company to get registered in ledger\n const companyID = ctx.stub.createCompositeKey('org.pharma-network.company',[companyCRN,companyName]);\n\n // Create a company object to be stored in blockchain\n let company = {\n companyID: companyID,\n name: companyName,\n location: location,\n organisationRole: organisationRole,\n hierarchyKey: null,\n };\n\n company.hierarchyKey = roles.indexOf(organisationRole)+1;\n\n // Convert the JSON object to a buffer and send it to blockchain for storage\n await ctx.stub.putState(companyID,Buffer.from(JSON.stringify(company)));\n\n // return the company object to the user\n return company;\n }\n else{\n console.log(\"Enter the valid role\\n\");\n }\n\n }", "title": "" }, { "docid": "4f1f88059fae75c74257e954d8a017de", "score": "0.4932978", "text": "function createTransaction(itemInput) {\n const { description, value, type } = itemInput;\n //create new ID\n let ID;\n if (data.allItems[type].length > 0) {\n ID = data.allItems[type][data.allItems[type].length - 1].id + 1;\n } else {\n ID = 0;\n }\n let newTransaction;\n switch (type) {\n case 'inc':\n newTransaction = new Income(ID, description, value);\n break;\n case 'exp':\n newTransaction = new Expense(ID, description, value);\n break;\n }\n newTransaction.createDisplayValue(value);\n return newTransaction;\n }", "title": "" }, { "docid": "2c01b2ea11962b2225bf639a3e2813dd", "score": "0.49207842", "text": "static createCreateRequest(input) {\r\n const recoveryKey = input.recoveryKey;\r\n const updateKey = input.updateKey;\r\n const didDocumentKeys = input.document.publicKeys;\r\n const services = input.document.services;\r\n // Validate recovery and update public keys.\r\n InputValidator_1.default.validateEs256kOperationKey(recoveryKey, OperationKeyType_1.default.Public);\r\n InputValidator_1.default.validateEs256kOperationKey(updateKey, OperationKeyType_1.default.Public);\r\n // Validate all given DID Document keys.\r\n IonRequest.validateDidDocumentKeys(didDocumentKeys);\r\n // Validate all given service.\r\n IonRequest.validateServices(services);\r\n const hashAlgorithmInMultihashCode = IonSdkConfig_1.default.hashAlgorithmInMultihashCode;\r\n const patches = [{\r\n action: PatchAction_1.default.Replace,\r\n document: input.document\r\n }];\r\n const delta = {\r\n updateCommitment: Multihash_1.default.canonicalizeThenDoubleHashThenEncode(updateKey, hashAlgorithmInMultihashCode),\r\n patches\r\n };\r\n IonRequest.validateDeltaSize(delta);\r\n const deltaHash = Multihash_1.default.canonicalizeThenHashThenEncode(delta, hashAlgorithmInMultihashCode);\r\n const suffixData = {\r\n deltaHash,\r\n recoveryCommitment: Multihash_1.default.canonicalizeThenDoubleHashThenEncode(recoveryKey, hashAlgorithmInMultihashCode)\r\n };\r\n const operationRequest = {\r\n type: OperationType_1.default.Create,\r\n suffixData: suffixData,\r\n delta: delta\r\n };\r\n return operationRequest;\r\n }", "title": "" }, { "docid": "9e3714343965f6786e736af9f3f8ae97", "score": "0.49172682", "text": "static createAccountWithSeed(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;\n const data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n let keys = [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: false,\n isWritable: true\n }];\n\n if (params.basePubkey != params.fromPubkey) {\n keys.push({\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n });\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }", "title": "" }, { "docid": "05c91877a5a4b5dc7b8172530eaa4058", "score": "0.49151865", "text": "createEntityGame() {\n this.ecs.createEntity(\"game\");\n }", "title": "" }, { "docid": "aed73434442bd7c3bc50a67bb8c86d2d", "score": "0.49148807", "text": "function createPerson({ name, age, place: residence }) {\n return { name, age, residence };\n}", "title": "" }, { "docid": "35a851739adeb417b93d341f1c3801d2", "score": "0.49095345", "text": "function ACTIVE_MODEL(){}", "title": "" }, { "docid": "21b8b6056a40f9753c00cf02d487856b", "score": "0.4907758", "text": "async create(params) {\n try {\n const newCore_expertList = `INSERT INTO core_expertList (id, ca ,ua ,expName ,expType ,expParams ,expUser ,expStatus ) \n VALUES (UUID(),'${params.date}', '${params.date}', '${params.expName}', '${params.expType}', '${params.expParams}', ${params.expUser}, ${params.expStatus}) IF NOT EXISTS`;\n return await this._core.DBManager.engine.execute(newCore_expertList);\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "3fa9ce8494bc4459c1de9751399c12e8", "score": "0.49040315", "text": "function createNewRequest() {\n $scope.uploading = true;\n var docs = [];\n\n docs.push(Requests.createRequestDocData(fetchId));\n performCreation(docs);\n }", "title": "" }, { "docid": "7898db989ae5e62cee61e86a503dea0f", "score": "0.48997617", "text": "async function makeContracts ({ plan }, log) {\n const feeds = plan.feeds\n for (var i = 0; i < feeds.length; i++) {\n const feedObj = feeds[i]\n // split ranges to sets (size = setSize)\n const sets = makeSets({ ranges: feedObj.ranges, setSize })\n return sets.map(set => {\n // const contractID = DB.contracts.length\n const contract = {\n // id: contractID,\n plan: plan.id,\n feed: feedObj.id,\n ranges: set,\n amendments: [],\n activeHosters: [],\n status: {}\n }\n // DB.contracts.push(contract) // @NOTE: set id\n const contractID = await addItem(contract)\n return contractID\n log({ type: 'chain', body: [`New Contract: ${JSON.stringify(contract)}`] })\n })\n }\n}", "title": "" }, { "docid": "63a3b5fb1f79a7111101ddba3b2f0088", "score": "0.48903006", "text": "create(resource){ return false }", "title": "" }, { "docid": "5c75c5c6b7974e4a3243ae913d521aeb", "score": "0.48851222", "text": "function createNewCrossTreeConstraintFromDialog(arguments) {\n\t\tvar variables = [];\n\t\tfor( featureId in featureModelData ) {\n\t\t\tif ( !featureModelData[featureId][6].deleted && !isFeatureGroup(featureId) ) { \n\t\t\t\tif ( dojo.byId(\"checkbox_\" + featureId).checked ) {\n\t\t\t\t\tvariables.push(featureId);\n\t\t\t\t}\n\t\t\t} \n\t\t}\t\t\n\t\tcreateNewCrossTreeConstraint(variables, null);\n\t\tonUserAction('create','constraint');\n\t}", "title": "" }, { "docid": "822c8dec8df7473784060b14c2d7b2c0", "score": "0.48832935", "text": "function add(obj) {\n if (!obj.crmStudentId) {\n SweetAlert.swal({\n title: \"请选择学生!\",\n type: \"warning\",\n showCancelButton: false,\n confirmButtonText: '确定',\n closeOnConfirm: true\n })\n return false;\n }\n var deferred = $q.defer();\n var param = angular.copy(obj)\n // if(param.contractEndDate.indexOf('-')&&param.contractEndDate.length===10){\n // param.contractEndDate = new Date(param.contractEndDate+' 00:00:00')\n // param.contractStartDate = new Date(param.contractStartDate+' 00:00:00')\n // }\n $http.post(config.endpoints.sos.order, param)\n .success(function (response, status, headers, config) {\n //console.log(\"Created order : \" + JSON.stringify(response));\n deferred.resolve(response.data);\n })\n .error(function (response, status, headers, config) {\n //console.log('Failed to create order : ' + JSON.stringify(response));\n deferred.reject(response.error);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "735f59f497045e605b9e654ffda29e77", "score": "0.4879261", "text": "create (request, response) {\n console.log('create');// TODO: remove on production\n const app_id = request.params.app_id;\n\n // destructuring with default value\n const { data } = request.body;\n\n // destructuring with default values\n let { entity_type, entity_id, user_id, change, created } = data;\n const audit_id = new Types.ObjectId();\n const auditData = { _id: audit_id, app_id, entity_type, entity_id, user_id, change, created };\n const service = this;\n try {\n AuditModel.create(auditData, (err, audit) => service.onCreate(err, audit, request, response));\n } catch (err) {\n service.onCreate(err, null, request, response);\n }\n }", "title": "" }, { "docid": "c3b8c7adf8509b72d2dad51a974173b1", "score": "0.48750475", "text": "constructor(comp_id, comp_fecha){\n //Contruccion del id y fecha\n this.comp_id = comp_id;\n this.comp_fecha = comp_fecha;\n }", "title": "" }, { "docid": "bfd4e9496b269b283a95d10ca65d1df2", "score": "0.48716047", "text": "create(options) {\n return this.client.sendOperationRequest({ options }, createOperationSpec$2);\n }", "title": "" }, { "docid": "1def3f50d9580f7327de5a5c05c46a10", "score": "0.487126", "text": "static createIn(container) {\n return internal.instancehelpers.createElement(container, PublishedParameter, \"parameters\", true);\n }", "title": "" }, { "docid": "b250ff5e8fc0fdfb565e07184633c5b5", "score": "0.48629677", "text": "function createBp(){\r\nconst client = config.client ;\r\n\r\nclient.subscribe('create-bp', async function ({ task, taskService }) {\r\n const idcontrat = task.variables.get('idcontrat');\r\n const idagence = task.variables.get('idagence');\r\n\r\n console.log(`IdContrat: ${idcontrat} valider`);\r\n \r\n // creation d'un BP a travers la bd php\r\n axios.post('http://localhost/back-mcs/web/bp', { idagence: idagence ,lignedepreparation: '45', idcontrat: idcontrat})\r\n .then(res => {\r\n console.log(res.data)\r\n })\r\n .catch(error => {\r\n console.error(error)\r\n })\r\n\r\n await taskService.complete(task);\r\n });\r\n}", "title": "" }, { "docid": "49fff17cdfd2bc318a4ff3a8fdd77010", "score": "0.4862059", "text": "function insert_in_baseBatiment_construction(batiment_construction,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemBatiment_construction ==false)\n {\n getId = vm.selectedItemBatiment_construction.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n id_type_batiment: batiment_construction.id_type_batiment,\n cout_unitaire: batiment_construction.cout_unitaire,\n id_convention_entete: vm.selectedItemTete.id\n\n });\n console.log(datas);\n //factory\n apiFactory.add(\"batiment_construction/index\",datas, config).success(function (data)\n {\n\n var typ_bat = vm.alltype_batiment.filter(function(obj)\n {\n return obj.id == batiment_construction.id_type_batiment;\n });\n\n if (NouvelItemBatiment_construction == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n vm.selectedItemBatiment_construction.type_batiment = typ_bat[0];\n vm.selectedItemBatiment_construction.$selected = false;\n vm.selectedItemBatiment_construction.$edit = false;\n vm.selectedItemBatiment_construction ={};\n var cout_ancien_bat= parseInt(currentItemBatiment_construction.cout_unitaire);\n var cout_nouveau_bat= parseInt(typ_bat[0].cout_batiment);\n var cout_tot = parseInt(vm.selectedItemTete.montant_total)- cout_ancien_bat + cout_nouveau_bat ;\n\n vm.selectedItemTete.montant_total= cout_tot;\n vm.showbuttonNouvBatiment=false;\n // miseajourDetail(vm.selectedItemDetail,0,cout_tot);\n }\n else \n { \n vm.allbatiment_construction = vm.allbatiment_construction.filter(function(obj)\n {\n return obj.id !== vm.selectedItemBatiment_construction.id;\n });\n vm.showbuttonNouvBatiment=true;\n /*var prix_latrine=0;\n var prix_mobilier=0;\n\n if(vm.alllatrine_construction.length!=0)\n { \n vm.alllatrine_construction.forEach(function(item)\n {\n prix_latrine = prix_latrine + (item.nbr_latrine*item.cout_unitaire)\n });\n }\n if(vm.allmobilier_construction.length!=0)\n { \n vm.allmobilier_construction.forEach(function(item)\n {\n prix_mobilier = prix_mobilier + (item.nbr_mobilier*item.cout_unitaire)\n });\n }*/\n var cout_ancien_bat= parseInt(currentItemBatiment_construction.cout_unitaire);\n var cout_tot = parseInt(vm.selectedItemTete.montant_total) - cout_ancien_bat;\n vm.selectedItemTete.montant_total = cout_tot;\n //miseajourDetail(vm.selectedItemDetail,0,cout_tot);\n }\n }\n else\n {\n \n batiment_construction.type_batiment= typ_bat[0];\n /*batiment_construction.nbr_batiment = batiment_construction.nbr_batiment;\n batiment_construction.cout_unitaire = batiment_construction.cout_unitaire;*/\n batiment_construction.id = String(data.response); \n NouvelItemBatiment_construction = false;\n \n vm.selectedItemTete.montant_total = parseInt(vm.selectedItemTete.montant_total)+ \n parseInt(batiment_construction.cout_unitaire);\n vm.showbuttonNouvBatiment=false;\n //miseajourDetail(vm.selectedItemDetail,0,cout_tot);\n }\n batiment_construction.$selected = false;\n batiment_construction.$edit = false;\n vm.selectedItemBatiment_construction = {};\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n\n }", "title": "" }, { "docid": "0f7bac17fe854bb942ff75999f7548ba", "score": "0.48592576", "text": "function generateContract(startDate, endDate, price, room, tenant) {\n var period = endDate.getMonth() - startDate.getMonth() + ((endDate.getYear() - startDate.getYear()) * 12);\n\n var dayPrice = price / 30;\n var contract = {\n startDate: startDate,\n endDate: endDate,\n deposit: price,\n mensuality: price,\n dailyRate: dayPrice,\n room: room,\n debts: []\n };\n\n var stoppedPaying = false;\n for(var i = 0; i < period; ++i) {\n var fulfilled = false;\n if(!stoppedPaying) {\n if(generators.getRandomNumber(0, 100) > 98){\n stoppedPaying = true;\n } else {\n fulfilled = true;\n }\n }\n if(fulfilled) {\n fulfilled = \"true\";\n } else {\n fulfilled = \"false\";\n }\n var dateMonth = startDate.getMonth() + i;\n var dateYear = startDate.getYear();\n if(dateMonth > 12) {\n dateMonth %= 12;\n dateYear = endDate.getYear();\n }\n generateDebt(price, new Date(dateMonth + \"-01-\" + dateYear), fulfilled, contract);\n }\n\n tenant.contracts.push(contract);\n}", "title": "" }, { "docid": "1a1e9aa6ab920c366cbc48c044786a66", "score": "0.4859244", "text": "function WorkFlow_Action_Invoice(obj_type)\r\n{\r\n\tthis.g_antObject = new CAntObject(obj_type);\r\n}", "title": "" }, { "docid": "a8701444998f8c699bdca6ff724bb271", "score": "0.48577234", "text": "async create (data, params) {\n debug(`billing service called for create action=${data.action}`)\n switch (data.action) {\n case 'customer': {\n const customer = await this.createCustomer(params.billingObject, data)\n return customer\n }\n case 'subscription': {\n const subscription = await this.createSubscription(params.billingObject, data)\n return subscription\n }\n }\n }", "title": "" }, { "docid": "24f583b0b1f5f3849089d4043d3c8ae9", "score": "0.48528582", "text": "function createAllocJournalEntry(recBill,IS_INTERCO,stTrigFrom)\r\n{\r\n nlapiLogExecution('DEBUG','createAllocJournalEntry','BEGIN - Create Allocation Journal Entry');\r\n \r\n var stBillsSubs = recBill.getFieldValue('subsidiary'); \r\n var intItemCount = recBill.getLineItemCount('item');\r\n var intExpCount = recBill.getLineItemCount('expense'); \r\n var stJEId = null;\r\n \r\n //search the newly created distribution details\r\n var arrBDD = getBillDistributionDetails(recBill.getId());\r\n \r\n if(!arrBDD)\r\n {\r\n return;\r\n }\r\n \r\n if(IS_INTERCO!='T')\r\n {\r\n //create the record\r\n var recJE = nlapiCreateRecord('journalentry');\r\n \r\n //set the journal header\r\n recJE.setFieldValue('subsidiary',stBillsSubs);\r\n recJE.setFieldValue('custbody_svb_vend_bill_link',recBill.getId());\r\n recJE.setFieldValue('approved','T');\r\n \r\n //set the credit based from item and expense tab\r\n recJE = setStandardJournalCreditLines(recBill,recJE);\r\n \r\n //set the debit based from distribution details\r\n recJE = setStandardJournalDebitLines(recBill,recJE,arrBDD); \r\n \r\n try\r\n {\r\n //save the transaction\r\n stJEId = nlapiSubmitRecord(recJE,true,true);\r\n nlapiLogExecution('DEBUG','createJournalEntry','stJEId=' + stJEId);\r\n }\r\n catch(e)\r\n {\r\n var stErrDetails = 'Error in creating allocation journal entry. Details: ' + e.toString();\r\n nlapiSubmitField('vendorbill',recBill.getId(),'custbody_svb_error_logs',stErrDetails);\r\n throw nlapiCreateError('Error',stErrDetails,true);\r\n }\r\n \r\n if(stTrigFrom!='suitelet')\r\n {\r\n if(stJEId)\r\n {\r\n nlapiSubmitField('vendorbill',recBill.getId(),['custbody_svb_allocation_journal','custbody_svb_error_logs'],[[stJEId],'']);\r\n }\r\n }\r\n else\r\n {\r\n recBill.setFieldValues('custbody_svb_allocation_journal',[stJEId]);\r\n recBill.setFieldValue('custbody_svb_error_logs','');\r\n }\r\n nlapiLogExecution('DEBUG','Create Standard Journal Entry','stJEId=' + stJEId);\r\n }\r\n else\r\n {\r\n var stFrmSubs = recBill.getFieldValue('subsidiary');\r\n var stPeriod = recBill.getFieldValue('postingperiod');\r\n var stDate = recBill.getFieldValue('trandate');\r\n var arrSort = sortDistributionDetails(arrBDD,stBillsSubs);\r\n var arrUniqToSubs = arrSort[0];\r\n var arrSortedBDD = arrSort[1];\r\n var arrJEIDs = [];\r\n nlapiLogExecution('DEBUG','Create IC Journal Entry','arrUniqToSubs=' + JSON.stringify(arrUniqToSubs)); \r\n \r\n //[ [arrParentSub,[arrToSub1,stToSubs1,obj1],[arrToSub1,stToSub2,obj2] ] , --> 2-2\r\n // [arrParentSub,[arrToSub1,stToSubs1,obj1],[arrToSub1,stToSub2,obj2] ] --> 3-2\r\n //]\r\n for(var i=0; i<arrUniqToSubs.length; i++)\r\n {\r\n var recICJE = nlapiCreateRecord('intercompanyjournalentry');\r\n var stCurrToSubs = arrUniqToSubs[i];\r\n \r\n //set the ic journal header\r\n recICJE.setFieldValue('subsidiary',stFrmSubs);\r\n recICJE.setFieldValue('tosubsidiary',stCurrToSubs);\r\n recICJE.setFieldValue('custbody_svb_vend_bill_link',recBill.getId());\r\n recICJE.setFieldValue('approved','T');\r\n \r\n //set date and posting period on IC JE based on vendor bill values\r\n recICJE.setFieldValue('trandate',stDate);\r\n recICJE.setFieldValue('postingperiod',stPeriod);\r\n \r\n for(line in arrSortedBDD)\r\n {\r\n var arrLines = arrSortedBDD[line]; \r\n var arrParentLine = arrLines[0];\r\n \r\n for(var x=1; x<arrLines.length; x++)\r\n { \r\n var arrToSubsidiaries = arrSortedBDD[line][x];\r\n var arrToSub = arrToSubsidiaries[0];\r\n var stToSub = arrToSubsidiaries[1];\r\n var objToDetails = arrToSubsidiaries[2]; \r\n \r\n if(stCurrToSubs!=stToSub)\r\n {\r\n continue;\r\n }\r\n \r\n recICJE = setICJEParentLines(recBill,recICJE,arrParentLine,stFrmSubs,objToDetails); \r\n recICJE = setICJEToSubsidiaryLines(recBill,recICJE,arrToSub,stCurrToSubs,objToDetails); \r\n }\r\n }\r\n \r\n try\r\n {\r\n //save the je\r\n stJEId = nlapiSubmitRecord(recICJE,true,true);\r\n }\r\n catch(e)\r\n {\r\n //reverse all the ICJE that is recently created\r\n if(arrJEIDs.length>0)\r\n {\r\n for(var i=0; i<arrJEIDs.length; i++)\r\n {\r\n var stAllocJrnlId = arrJEIDs[i];\r\n nlapiSubmitField('journalentry',stAllocJrnlId,'reversaldate',nlapiDateToString(new Date()));\r\n }\r\n }\r\n \r\n var stErrDetails = 'Error in creating allocation journal entry. Details: ' + e.toString();\r\n nlapiSubmitField('vendorbill',recBill.getId(),'custbody_svb_error_logs',stErrDetails);\r\n throw nlapiCreateError('Error',stErrDetails,true);\r\n }\r\n \r\n //push the jeid to array\r\n arrJEIDs.push(stJEId);\r\n \r\n nlapiLogExecution('DEBUG','Create IC Journal Entry','To Subsidiary:' + stCurrToSubs + '-> stJEId=' + stJEId);\r\n }\r\n \r\n if(stTrigFrom!='suitelet')\r\n {\r\n if(arrJEIDs.length>0)\r\n {\r\n nlapiSubmitField('vendorbill',recBill.getId(),['custbody_svb_allocation_journal','custbody_svb_error_logs'],[arrJEIDs,'']);\r\n }\r\n }\r\n else\r\n {\r\n recBill.setFieldValues('custbody_svb_allocation_journal',arrJEIDs);\r\n recBill.setFieldValue('custbody_svb_error_logs','');\r\n }\r\n }\r\n nlapiLogExecution('DEBUG','createAllocJournalEntry','END - Create Allocation Journal Entry');\r\n \r\n return recBill;\r\n}", "title": "" }, { "docid": "6c9acbb7f9964f9e80ab4fb2d5266db4", "score": "0.4848541", "text": "function createTransaction(req, res, next) {\n console.log('creating platfrom')\n var params = req.body;\n // console.log(params)\n var transaction = new Transaction({\n transactionType: params.transactionType,\n transactionMethod: params.transactionMethod,\n userId: params.userId,\n gameId: params.gameId,\n tournamentId: params.tournamentId,\n amount: params.amount,\n agent: params.agent,\n createdAt: Date.now(),\n \n });\n console.log(transaction)\n // req params validation for required fields\n req.checkBody('transactionType', 'transactionType must be defined').notEmpty();\n // req.checkBody('transactionMethod', 'transactionMethod must be defined').notEmpty();\n req.checkBody('userId', 'userId must be defined').notEmpty();\n req.checkBody('amount', 'amount must be defined').notEmpty();\n \n // validate user input\n var errors = req.validationErrors();\n if (errors) {\n console.log('error in creating transaction')\n utils.sendJSONresponse(res, 400, errors);\n \n return;\n }\n\n transaction.save((err, newTransaction) => {\n console.log('saving transaction', newTransaction)\n if (err) return next({ err: err, status: 400 });\n if (!newTransaction) return next({ message: 'Transaction not created.', status: 400 });\n \n utils.sendJSONresponse(res, 201, newTransaction);\n });\n }", "title": "" }, { "docid": "730bc08b222cab64ebe693294c4b764f", "score": "0.4845043", "text": "constructor(contract1, contract2) {\n this.contract = contract2;\n this.contract_L1 = contract1;\n this.address = STAKING_ADDRESS;\n }", "title": "" }, { "docid": "247ad00403ad5ab7618f3b436518753c", "score": "0.4842434", "text": "beforeCreate() { }", "title": "" }, { "docid": "419622c1167362652731b4704753a8fc", "score": "0.48362795", "text": "createCreditTransfer(accountID, amount) {\n //pass\n }", "title": "" } ]
04c7b1df9593493c5f8f21e06bb49aaa
hidden field to store nodes selected also handles sort
[ { "docid": "2577e1447d25f87149156de421c9492b", "score": "0.6250124", "text": "function StorePickedNodes(hiddenField, rightCol, nodeId) {\n if (!hiddenField || !rightCol)\n return;\n var val = \"\";\n rightCol.find(\"li\").each(function () {\n if ($(this).attr(\"rel\") != nodeId) {\n val += $(this).attr(\"rel\") + \",\";\n }\n else {\n if (nodeId != null) {\n $(this).remove();\n }\n }\n });\n hiddenField.val(val);\n }", "title": "" } ]
[ { "docid": "76e72fa33f69f537dd65da50e9349171", "score": "0.5843588", "text": "get nodes() {\n return selectedNodes;\n }", "title": "" }, { "docid": "83f091792733ae62700edfdcb579c2f8", "score": "0.5824624", "text": "function sort(node){\n\t\t$('span', node).removeClass('sr-icon-asc sr-icon-desc')\n\t\t .addClass('hidden');\n\t\tif($(node).hasClass('sorted-asc')){\n\t\t\t$('span', node).addClass('sr-icon-asc')\n\t\t\t .removeClass('hidden');\n\t\t}\n\t\tif($(node).hasClass('sorted-desc')){\n\t\t\t$('span', node).addClass('sr-icon-desc')\n\t\t\t .removeClass('hidden');\n\t\t}\n\t}", "title": "" }, { "docid": "d569c15cdcc481666fea0f457da44332", "score": "0.57493246", "text": "function selectObjectSortName() {\r\n\t\t$(\"#allItemIds\").empty().append(allItemsOptions(allItemsArr));\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "6a948842512e69adf688e53ef4964f51", "score": "0.5742223", "text": "function select_nodes_of_tree(p_radio_obj, p_checkbox_obj) {\n //Xac dinh Radio dang chon\n var v_count;\n return_value = \"\";\n f = document.all;\n try {\n v_count = p_radio_obj.length;\n if (v_count) {\n for (i = 0; i < v_count; i++) {\n if (p_radio_obj[i].checked) {\n return_value = f.str_obj[i].item_id + _LIST_DELIMITOR + f.str_obj[i].item_code + _LIST_DELIMITOR + f.str_obj[i].item_title;\n break;\n }\n }\n } else {\n if (p_radio_obj.checked) {\n return_value = f.str_obj.item_id + _LIST_DELIMITOR + f.str_obj.item_code + _LIST_DELIMITOR + f.str_obj.item_title;\n }\n }\n } catch (e) {\n ;\n }\n if (return_value != \"\") {\n window.returnValue = return_value;\n window.close();\n return;\n }\n //Xac dinh check-box dang chon\n var v_count;\n return_value = \"\";\n f = document.all;\n try {\n v_count = p_checkbox_obj.length;\n if (v_count) {\n for (i = 0; i < v_count; i++) {\n if (p_checkbox_obj[i].checked) {\n return_value = f.str_obj[i].item_id + _LIST_DELIMITOR + f.str_obj[i].item_code + _LIST_DELIMITOR + f.str_obj[i].item_title;\n break;\n }\n }\n } else {\n if (p_checkbox_obj.checked) {\n return_value = f.str_obj.item_id + _LIST_DELIMITOR + f.str_obj.item_code + _LIST_DELIMITOR + f.str_obj.item_title;\n }\n }\n } catch (e) {\n ;\n }\n if (return_value != \"\") {\n window.returnValue = return_value;\n window.close();\n return;\n }\n}", "title": "" }, { "docid": "a9880b0deca966fe92343557d7198515", "score": "0.57387674", "text": "function getSortingParameter() {\n\treturn $('input[name=\"custom_view[ordered_display_fields][sorts]\"]');\n}", "title": "" }, { "docid": "4d4fc0745f8a00adfb7db0e2f6d3a9fa", "score": "0.5716882", "text": "order_nodes() {\n this.nodes.sort((a, b) => a.num - b.num);\n }", "title": "" }, { "docid": "4a8899f53e879e9a3fc602fcc085fba7", "score": "0.5714062", "text": "function OnSortingDone() {\r\n var indexes = [];\r\n\r\n $(\"#SortableStates\").children().each(function (i) {\r\n indexes[i] = $(this).find(\".HiddenID\").val();\r\n });\r\n\r\n //alert(indexes);\r\n\r\n PageMethods.SetOrderIndex(indexes,\r\n function () { /*TODO: show success?*/ },\r\n function () { /*TODO: show errors?*/ }\r\n );\r\n}", "title": "" }, { "docid": "84f185a5942a5afc1ed0b9e0b1a91e4e", "score": "0.5687772", "text": "function KTableSorting( order, dir, task ) \n{\n\tvar form = document.adminForm;\n\n\tform.filter_order.value \t= order;\n\tform.filter_direction.value\t= dir;\n\tsubmitform( task );\n}", "title": "" }, { "docid": "c3cad2ad0349b23569f668d6a7fbe97a", "score": "0.565538", "text": "function updateNodeListField(id = \"dashw\") {\n var list = \"\";\n for (var i = 0; i < selectedNodes.length; i++) {\n var node = selectedNodes[i];\n if (i != 0) {\n list += \", \"\n }\n for (; i + 1 < selectedNodes.length && selectedNodes[i+1] === selectedNodes[i] + 1; i++);\n if (selectedNodes[i] != node) {\n list += node + \"-\" + selectedNodes[i];\n continue;\n }\n list += node;\n }\n $(\"#\" + id).val(list);\n}", "title": "" }, { "docid": "bf9345788c02a20990ae9b9439678f01", "score": "0.56487113", "text": "function sorting(){\n\t$(this).closest('.sortingType').children('input');\n\tif( $(this).is(\":checked\") ){\n\t\tswitch( $(this).val() ){\n\t\t\tcase 'pizza':\n\t\t\t\t$('.menuList .menuItem[categorie=pizza]').removeClass('hidden');\n\t\t\t\tbreak;\n\t\t\tcase 'specials':\n\t\t\t\t$('.menuList .menuItem[categorie=specials]').removeClass('hidden');\n\t\t\t\tbreak;\n\t\t\tcase 'dranken':\n\t\t\t\t$('.menuList .menuItem[categorie=dranken]').removeClass('hidden');\n\t\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tswitch( $(this).val() ){\n\t\t\tcase 'pizza':\n\t\t\t\t$('.menuList .menuItem[categorie=pizza]').addClass('hidden');\n\t\t\t\tbreak;\n\t\t\tcase 'specials':\n\t\t\t\t$('.menuList .menuItem[categorie=specials]').addClass('hidden');\n\t\t\t\tbreak;\n\t\t\tcase 'dranken':\n\t\t\t\t$('.menuList .menuItem[categorie=dranken]').addClass('hidden');\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e3173f5a18d669c6a6ae8bf579e2f194", "score": "0.55597365", "text": "selectedNodes () { return Array.from(this.selected) }", "title": "" }, { "docid": "79ccc3a91584389ccc7d6f2b5a4ae2bf", "score": "0.5558363", "text": "function setSelectedNodes(node) {\n if (selected.first == null) {\n selected.first = node;\n return;\n } else if (selected.first != null) {\n selected.second = selected.first;\n selected.first = node;\n return;\n }\n }", "title": "" }, { "docid": "7df974c841067199a40623d1dafa813d", "score": "0.55246186", "text": "function updateSelectedGenes(evt)\r\n{\r\n\t// this flag is set to prevent updateGenesTab function to update the tab\r\n\t// when _vis.select function is called.\r\n\t_selectFromTab = true;\r\n\t\r\n\tvar nodeIds = new Array();\r\n\t\r\n\t// deselect all nodes\r\n\t_vis.deselect(\"nodes\");\r\n\t\r\n\t// collect id's of selected node's on the tab\r\n\t$(\"#gene_list_area select option\").each(\r\n\t\tfunction(index)\r\n\t\t{\r\n\t\t\tif ($(this).is(\":selected\"))\r\n\t\t\t{\r\n\t\t\t\tnodeId = $(this).val();\r\n\t\t\t\tnodeIds.push(nodeId);\r\n\t\t\t}\r\n\t\t});\r\n\t\r\n\t// select all checked nodes\r\n\t_vis.select(\"nodes\", nodeIds);\r\n\t\r\n\t// reset flag\r\n\t_selectFromTab = false;\r\n}", "title": "" }, { "docid": "28189670680e2b846727aea59161db7d", "score": "0.5472462", "text": "static sortButton() {\n Tree.all.sort((a, b) => a.name.localeCompare(b.name))\n renderDiv.innerHTML = \"\"\n div.innerHTML = \"\"\n Tree.render()\n getTreeInfo()\n }", "title": "" }, { "docid": "94bb8bf05f0fd7a398d5ce6b56a7ec2d", "score": "0.54560053", "text": "function clustertree_set_tree_state(instanceid, uniqueid, usingdropdown) {\n\tvar cluster_param_tree = clustertree_get_container_element_by_id('php_report_body_' + instanceid, 'cluster_param_tree_' + instanceid + '_' + uniqueid);\n\n\tif (!usingdropdown) {\n\t\tcluster_param_tree.style.display = '';\n\t} else {\n\t cluster_param_tree.style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "7554f3c802d5f41f582d9aae9fcb3dd9", "score": "0.543879", "text": "function filterNonSelected()\r\n{\r\n\t// update selected elements map\r\n\t_selectedElements = _selectedElementsMap(\"nodes\");\r\n\r\n\t// filter out non-selected elements\r\n _vis.filter('nodes', geneVisibility);\r\n \r\n // also, filter disconnected nodes if necessary\r\n _filterDisconnected();\r\n \r\n // refresh Genes tab\r\n _refreshGenesTab();\r\n updateGenesTab();\r\n \r\n // visualization changed, perform layout if necessary\r\n\t_visChanged();\r\n}", "title": "" }, { "docid": "ace9831d355c0ac2cd27b3aa859b9035", "score": "0.5382636", "text": "function sortChoice() {\n var state = d3.selectAll(\"option\");\n var sort = d3.selectAll(\".checkbox\");\n if (sort[0][0].checked && state[0][0].selected) {\n var out = function (a, b) {\n return b.dr_change - a.dr_change;\n }\n return out;\n } else if (sort[0][0].checked && state[0][1].selected) {\n var out = function (a, b) {\n return b.bus_change - a.bus_change;\n }\n return out;\n } else {\n var out = function (a, b) {\n return d3.ascending(a.movie_title, b.movie_title);\n }\n return out;\n }\n }", "title": "" }, { "docid": "2c95f5f741936edf8209d004c3d4471b", "score": "0.5381181", "text": "set sortingOrder(value) {}", "title": "" }, { "docid": "4bc36d26e7016a19ac739b8788d61e0b", "score": "0.53796273", "text": "function change_sorting(selectObject) {\n var value = selectObject.value; \n //console.log(value);\n if(current_sorting_order != value)\n {\n current_sorting_order = value;\n sorting_by_property();\n }\n\n \n}", "title": "" }, { "docid": "0d603102024284f8d6ce56f47444728c", "score": "0.53766054", "text": "function resultSortInitialize()\n{\n\tdocument.getElementById('sortCat1').checked = true;\n\tdocument.getElementById('sortType2').checked = true;\n}", "title": "" }, { "docid": "e0fe237b2b3ee2b215f970fc04a09e03", "score": "0.5369551", "text": "function selected_nodes_tree(tree_selector, tree_nodes){\r\n\t//初始参数\r\n\tthis.tree_selector = typeof tree_selector !== 'undefined' ? tree_selector : \"\";\r\n\tif(this.tree_selector){\r\n\t\tthis.tree = $(tree_selector)\r\n\t}\r\n\tthis.tree_nodes = typeof tree_nodes !== 'undefined' ? tree_nodes : \"\";\r\n\t// if(!this.tree || !this.tree_nodes){\r\n\t// \treturn false;\r\n\t// }\r\n\r\n\tthis.setting = {\r\n\t\tview: {\r\n\t\t\t// addHoverDom: null,\r\n\t\t\t// removeHoverDom: null,\r\n\t\t\tshowLine: true,\r\n\t\t\tselectedMulti: false\r\n\t\t},\r\n\t\tcheck: {\r\n\t\t\tenable: false\r\n\t\t},\r\n\t\tdata: {\r\n\t\t\tkey: {\r\n\t\t\t\tchildren: null,\r\n\t\t\t},\r\n\t\t\tsimpleData: {\r\n\t\t\t\tenable: true,\r\n\t\t\t\tidKey: \"rid\",\r\n\t\t\t\tpIdKey: \"pid\", //pid父节点唯一标识符属性名称\r\n\t\t\t\trootPId: null\r\n\t\t\t}\r\n\t\t},\r\n\t\tcallback: {\r\n\t\t},\r\n\t\tedit: {\r\n\t\t\tenable: false\r\n\t\t}\r\n\t};\r\n\r\n\tthis.construct_tree = function(){\r\n\t\t$.fn.zTree.init(this.tree, this.setting, this.tree_nodes);\r\n\t};\r\n\r\n\tthis.ztree_obj = function(){\r\n\t\tvar tree_id = tree_selector.split(\"#\")[1];\r\n\t\treturn $.fn.zTree.getZTreeObj(tree_id);\r\n\t};\r\n\r\n this.get_checked_nodes = function(){\r\n \tvar result = [];\r\n\t\tvar tree_obj = this.ztree_obj();\r\n\t\tif(tree_obj){\r\n\t\t\tvar nodes_arr = tree_obj.getCheckedNodes();\r\n\t\t\tfor(var i in nodes_arr){\t\r\n\t\t\t\tvar node = nodes_arr[i];\r\n\t\t\t\tresult.push({\r\n\t\t\t\t\tname: node.name,\r\n\t\t\t\t\trid: node.rid,\r\n\t\t\t\t\tpid: node.pid,\r\n\t\t\t\t\tuid: node.uid\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n };\r\n\r\n\tthis.get_last_nodes = function(){\r\n\t\tvar result = [];\r\n\t\tvar tree_obj = this.ztree_obj();\r\n\t\tif(tree_obj){\r\n\t\t\tvar nodes_arr = tree_obj.getCheckedNodes();\r\n\t\t\tvar pids = [];\r\n\t\t\tfor(var i in nodes_arr){\r\n\t\t\t\tpids.push(nodes_arr[i].pid);\r\n\t\t\t}\r\n\t\t\tfor(var i in nodes_arr){\t\r\n\t\t\t\tvar node = nodes_arr[i];\r\n\t\t\t\tif(pids.indexOf(node.rid) > -1){\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}else{\r\n\t\t\t\t\tresult.push({\r\n\t\t\t\t\t\tname: node.name,\r\n\t\t\t\t\t\trid: node.rid,\r\n\t\t\t\t\t\tpid: node.pid,\r\n\t\t\t\t\t\tuid: node.uid\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\treturn result;\r\n\t};\r\n\r\n\tthis.init = function(){\r\n\t\tthis.construct_tree();\r\n\t}\r\n}", "title": "" }, { "docid": "cea18ccc35d21fc7f5a819b637f5df40", "score": "0.5362396", "text": "function set_hidden_search(obj, hdn_obj, value) {\n //hdn_obj.value =\"\";\n hdn_obj.value = value;\n $('td').parent().removeClass('selected');\n $(obj).parent().addClass('selected');\n}", "title": "" }, { "docid": "20ab50726c6f0e79c27ea079162d1e5e", "score": "0.535412", "text": "function segment_list_order_by(critere){\n\tdocument.getElementById('table_order').value\t= critere;\n\t\n\t//Go back to the first page (Flag)\n\tdocument.getElementById('fps').value = 1;\n\t\n\t//Refrech\n\tsegments_load_list_show();\n}", "title": "" }, { "docid": "b17ed04643b6b0c92807299336cedf2a", "score": "0.53528947", "text": "function resetSortByDropdown() {\n $('#sort').val('default');\n}", "title": "" }, { "docid": "b4c0d531feb5463a4c65135702f5c48b", "score": "0.53526014", "text": "function changeSort(e) {\n console.log(\"value changed\");\n createPage();\n}", "title": "" }, { "docid": "48a573f5204a93377546b2d533a7835f", "score": "0.53439695", "text": "static get sortableFields () { return [] }", "title": "" }, { "docid": "59bf465191b43bba918823cb3d1ec402", "score": "0.53435326", "text": "function add_node_of_treeview(p_radio_obj, p_hdn_item_id_obj, p_fuseaction) {\n //Xac dinh Radio dang chon\n var v_count;\n var v_current_radio_id = \"\"\n try {\n v_count = p_radio_obj.length;\n if (v_count) {\n for (i = 0; i < v_count; i++) {\n if (p_radio_obj[i].checked) {\n v_current_radio_id = p_radio_obj[i].value;\n break;\n }\n }\n } else {\n if (p_radio_obj.checked) {\n v_current_radio_id = p_radio_obj.value;\n }\n }\n } catch (e) {\n ;\n }\n p_hdn_item_id_obj.value = v_current_radio_id;\n document.forms[0].fuseaction.value = p_fuseaction;\n document.forms[0].submit();\n}", "title": "" }, { "docid": "d7584060ab2756ce5638cecde4b5ca43", "score": "0.5339825", "text": "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) :\n options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "d7584060ab2756ce5638cecde4b5ca43", "score": "0.5339825", "text": "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) :\n options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "d7584060ab2756ce5638cecde4b5ca43", "score": "0.5339825", "text": "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) :\n options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "1a27b84ea8c24f7f811b9a00593edcbc", "score": "0.5335979", "text": "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator\n ? this.sortComparator(a, b, options)\n : options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "4812696ce9f0d3ea3be02bbb097d9f5c", "score": "0.53341", "text": "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) : options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "20270933a4c632b0ae42ff07a98f395e", "score": "0.5328211", "text": "_tableSortHidden(hideSort,hideFilter){return hideSort&&hideFilter}", "title": "" }, { "docid": "49935bdcf9aecaf2a1216be317191282", "score": "0.5319126", "text": "_onPathChanged() {\n // Reset the selection.\n this._selection = Object.create(null);\n // Update the sorted items.\n this.sort(this.sortState);\n }", "title": "" }, { "docid": "e5f96ac288ae825074ceed38e60d1829", "score": "0.53144807", "text": "function NodesSortableLock(locked) {\n\tNodesSortable.option(\"disabled\", locked);\n}", "title": "" }, { "docid": "ff80dd354b28194eb35595f224cb81be", "score": "0.529286", "text": "function nodeSorter(a, b) { \n return b.value - a.value; \n }", "title": "" }, { "docid": "6e8dec5fffc4f635a4b5b9674da30cd9", "score": "0.5292441", "text": "function ascOrderFunction(){\n\t$(\"#toSelectBox\").sortOptions();\n}//function close", "title": "" }, { "docid": "f8b406d80f5dfb12849b289bb2a265d9", "score": "0.52885485", "text": "function relatedUserSortingClick(field_title, sort_field_name, sort_direction) {\n var current_sort_field_name= $(\"#sort_field_name\").val()\n var current_sort_direction= $(\"#sort_direction\").val()\n\n if ( current_sort_field_name == sort_field_name ) {\n if ( current_sort_direction == 'asc' ) {\n sort_direction = 'desc'\n }\n if ( current_sort_direction == 'desc' ) {\n sort_direction = 'asc'\n }\n }\n\n $(\"#sort_field_name\").val(sort_field_name)\n if ( typeof sort_direction == \"undefined\" ) {\n sort_direction = 'asc'\n }\n\n $(\"#sort_direction\").val(sort_direction)\n load_related_users(1)\n}", "title": "" }, { "docid": "45e3f2b710d1d26d573bbc3f9a7a0512", "score": "0.5284561", "text": "function styleSelectedNodes() {\n //reset styling to default\n node\n .style(\"opacity\", 0)\n .style(\"outline\", \"none\");\n\n link\n .style(\"opacity\", 0)\n .style(\"stroke-width\", 2);\n\n //only style selected node if it is set\n if (selected.first != null) {\n styleNode(selected.first);\n }\n if (selected.second != null) {\n styleNode(selected.second);\n }\n\n //incorporate filter usage\n if (selected.first == null && selected.second == null) {\n node\n .style(\"opacity\", o => {\n if(o.show){\n return 1;\n }else {\n return 0;\n }\n })\n .style(\"outline\", \"none\");\n }\n\n }", "title": "" }, { "docid": "e46f9eec6dc012ce9a9e416203d85cfc", "score": "0.5282", "text": "function SetNodeHandlers() {\n\tNodesSortable = new Sortable($(\"#graph\").get(0), {\n\t\tgroup: \"NODES\",\n\t\tsort: true,\n\t\tanimation: 200,\n\t\tdraggable: \".sortable\",\n\t\tfilter: \".data\",\n\t\tonUpdate: function(evt) {\n\t\t\tReorder();\n\t\t}\n\t})\n}", "title": "" }, { "docid": "39a6731a49afb865785efd64e984014e", "score": "0.5280968", "text": "function change_sorting(selectObject) {\n var value = selectObject.value;\n //console.log(value);\n if (current_sorting_order != value) {\n current_sorting_order = value;\n sorting_by_property();\n }\n}", "title": "" }, { "docid": "9435738a91f73a9487e25afd4cbfca75", "score": "0.52745163", "text": "function mainjs_pagination_sort() {\n $(\"#sort li\").click(function() {\n // phat hien su kien click li\n var span = $(\"span\", this);\n // sort_key la ten cua field trong db\n sort_key = span.attr('id');\n // sort_type la desc hay asc\n sort_type = span.attr('class');\n\n // kiem tra no la desc hay asc de gan class tuong ung\n if ($.trim(sort_type) == 'desc') {\n span.attr('class', 'asc');\n mainjs_pagination_ajax_sort(sort_key, sort_type);\n }\n if ($.trim(sort_type) == 'asc') {\n span.attr('class', 'desc');\n mainjs_pagination_ajax_sort(sort_key, sort_type);\n }\n // reset tat ca cac class khac ve desc , ngoai tru class dang chon\n $('#sort span').each(function() {\n id_reset_class = $(this).attr('id');\n if (id_reset_class !== sort_key) {\n $(this).attr('class', 'desc');\n }\n });\n });\n}", "title": "" }, { "docid": "200962facd49b977394b7d47905a2c8f", "score": "0.5267109", "text": "sort() {\n this.connect()\n let nodes = sort(this._nodes)\n return nodes.map(n => n._ref)\n }", "title": "" }, { "docid": "30d55c82b938d8469e638473759580eb", "score": "0.52652794", "text": "function _hideSelected()\r\n{\r\n\t// update selected elements map\r\n\t_selectedElements = _selectedElementsMap(\"all\");\r\n\t\r\n\t// filter out selected elements\r\n _vis.filter('all', selectionVisibility);\r\n \r\n // also, filter disconnected nodes if necessary\r\n _filterDisconnected();\r\n \r\n // refresh genes tab\r\n _refreshGenesTab();\r\n \r\n // visualization changed, perform layout if necessary\r\n\t_visChanged();\r\n}", "title": "" }, { "docid": "d487ec23cabb4a57b79c65a56120617a", "score": "0.5256007", "text": "function tableOrdering( order, dir, task ) {\n\tvar form = document.adminForm;\n\n\tform.filter_order.value \t= order;\n\tform.filter_order_Dir.value\t= dir;\n\tsubmitform( task );\n}", "title": "" }, { "docid": "bcd097c668c2437b60aaaa80e617328a", "score": "0.52470434", "text": "function resetTreeExpand(original_Data) {\n document.getElementById(\"search_input\").value = \"\";\n $('.js-select2').val(null).trigger(\"change\");\n last_selected = null;\n filtering_active = false;\n tree_clicked_bool = false;\n tree_root = tree(hierarchy(original_Data)); //passed by function\n current_Data = JSON.parse(JSON.stringify(original_Data));\n tree_root.each(function (d) {\n d.name_to_print = d.id; //transferring name to a name variable\n d.id = tree_i; //Assigning numerical Ids\n tree_i++;\n });\n tree_root.x0 = tree_root.x;\n tree_root.y0 = tree_root.y;\n tree_expand(tree_root);\n tree_update(tree_root);\n window.scrollTo(0,0);\n}", "title": "" }, { "docid": "29e8611f8a594488e71e3de0590e5d2d", "score": "0.52435076", "text": "function changeAlgo()\n{\n\twhichAlgo = document.getElementById(\"select_sort\").selectedIndex + 1;\n\tcreateArray(0);\n}", "title": "" }, { "docid": "9fc9614d3d9f0db1910b2c3a550e6ddd", "score": "0.5240675", "text": "collapseNodeRecursive(){this._selectedField.collapseRecursive()}", "title": "" }, { "docid": "16101f191fe2b133d874551ce469369c", "score": "0.52186114", "text": "function updateGenesTab(evt)\r\n{\r\n\tvar selected = _vis.selected(\"nodes\");\r\n\t\r\n\t// do not perform any action on the gene list,\r\n\t// if the selection is due to the genes tab\r\n\tif(!_selectFromTab)\r\n\t{\t\r\n\t\tif (_isIE())\r\n\t\t{\r\n\t\t\t_setComponentVis($(\"#gene_list_area select\"), false);\r\n\t\t}\r\n\t\t\r\n\t\t// deselect all options\r\n\t\t$(\"#gene_list_area select option\").each(\r\n\t\t\tfunction(index)\r\n\t\t\t{\r\n\t\t\t\t$(this).removeAttr(\"selected\");\r\n\t\t\t});\r\n\t\t\r\n\t\t// select options for selected nodes\r\n\t\tfor (var i=0; i < selected.length; i++)\r\n\t\t{\r\n\t\t\t$(\"#\" + _safeProperty(selected[i].data.id)).attr(\r\n\t\t\t\t\"selected\", \"selected\");\r\n\t\t}\r\n\t\t\r\n\t\tif (_isIE())\r\n\t\t{\r\n\t\t\t_setComponentVis($(\"#gene_list_area select\"), true);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// also update Re-submit button\r\n\tif (selected.length > 0)\r\n\t{\r\n\t\t// enable the button\r\n\t\t$(\"#re-submit_query\").button(\"enable\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// disable the button\r\n\t\t$(\"#re-submit_query\").button(\"disable\");\r\n\t}\r\n}", "title": "" }, { "docid": "591f0286ff5a892e758265906562ca16", "score": "0.52133465", "text": "selected(node) {\n this.checked = !this.checked;\n this.updateSelection(node.mo);\n }", "title": "" }, { "docid": "a8b0eca00c214501909b03eeaca53266", "score": "0.52094316", "text": "function getSelectValue(e) {\n sortValue = +sortSelectElem.value;\n showedArr.sort(compare);\n buildGallery();\n setStorageSortValue(sortValue);\n }", "title": "" }, { "docid": "5600cba56d93f8bdbcdcaa3d0a8f905a", "score": "0.52044195", "text": "function desOrderFunction(){\n\t$(\"#toSelectBox\").sortOptions(false);\n}//function close", "title": "" }, { "docid": "00fb98636027298a1574287baf6e1c95", "score": "0.52032167", "text": "function dataAsc(){\n\n descName = \"added\";\n orderName = \"asc\";\n\n resetPag();\n}", "title": "" }, { "docid": "b10983e7b7807098ec4e43e52727ff70", "score": "0.52000713", "text": "_applySortableFields(fields){if(fields&&fields.length){let sortableCols=fields.replace(/ /g,\"\").split(\",\");sortableCols.forEach(f=>{let column=this.cols.filter(obj=>{return obj.id===f});if(column.length){column[0].sortable=!0}})}}", "title": "" }, { "docid": "1a9304c63776403b3297a356853b0b2e", "score": "0.51956874", "text": "function saveOrder() {\n var nr = 10;\n var inMain = false;\n $(\"#content article,#content h4\").each(function(){\n var block = $(this);\n var id = block.attr(\"id\");\n if (id) {\n block.find(\".intro\").val( (inMain) ? 'N' : 'Y' );\n block.find(\".sortorder\").val(nr);\n nr = nr + 10;\n } else if (block.hasClass(\"main\")) { \n inMain = true; \n }\n });\n}", "title": "" }, { "docid": "f19c7f0114b79e47c597a4bcb0ffebde", "score": "0.5194008", "text": "function HotReorder(result) {\n$.cookie(\"RNItemsAdded\", \"YES\");\n addfield(\"3\", \"pageid\", document.forms[0].pageid);\n addfield(result, \"final_string\", document.forms[0].final_string);\n addfield(\"N\", \"searchflag\", document.forms[0].searchflag);\n document.forms[0].submit();\n}", "title": "" }, { "docid": "cdb1bb85f2622edbe2370f8564c7feb6", "score": "0.5192273", "text": "function populateSortOptionsFromSelectedDisplayFields() {\n\t$(\"#selected_display_fields option\").clone().appendTo(\"#sort_by_1, #sort_by_2, #sort_by_3\");\n}", "title": "" }, { "docid": "be1465e35db7b52ff9be30f91ecbf916", "score": "0.5187222", "text": "function sort(selectedItems){\t\t\t\n\t\t\tgroupListConfig.ajax.data.sort = angular.toJson(selectedItems);\n\t\t}", "title": "" }, { "docid": "89e7682d7a5a9ba1abb3f16a03570db1", "score": "0.5179784", "text": "function markAsSelected(n_id,sel) {\n if(!isUndef(n_id.id)) nodeSel=n_id;\n else nodeSel = partialGraph._core.graph.nodesIndex[n_id];\n \n if(sel) {\n nodeSel.color = nodeSel.attr['true_color'];\n nodeSel.attr['grey'] = 0;\n \n if(categoriesIndex.length==1) {\n if( !isUndef(nodes1[nodeSel.id]) &&\n !isUndef(nodes1[nodeSel.id].neighbours)\n ){\n neigh=nodes1[nodeSel.id].neighbours;/**/\n for(var i in neigh){\n\n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n if(vec) {\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n }\n }\n } // two categories network:\n else {\n if(swclickActual==\"social\") {\n if(nodeSel.type==catSoc){\n if( !isUndef(nodes1[nodeSel.id]) &&\n !isUndef(nodes1[nodeSel.id].neighbours)\n ){\n neigh=nodes1[nodeSel.id].neighbours;/**/\n for(var i in neigh) {\n\n\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {\n\n nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]];\n // vec.color = vec.attr['true_color'];\n // vec.attr['grey'] = 0;\n // pr(\"nodeselected: \"+nodeSel.id+\"\\t\"+nodeSel.label+\"\\t\\t||\\t\\tvecino: \"+vec.id+\"\\t\"+vec.label)\n\n possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+\";\"+nodeSel.id]\n possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+nodeVec.id]\n\n an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2;\n if(!isUndef(an_edge) && !an_edge.hidden) {\n\n //highlight node\n // nodeVec.hidden = false;\n nodeVec.color = nodeVec.attr['true_color'];\n nodeVec.attr['grey'] = 0;\n\n //highlight edge\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0; \n }\n\n // if ( (NOW==\"a\" || NOW==\"b\") && nodeVec.color==grey)\n // pr(nodeVec)\n // nodeVec.hidden = true\n\n // an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n // if(!isUndef(an_edge) && !an_edge.hidden){\n // an_edge.color = an_edge.attr['true_color'];\n // an_edge.attr['grey'] = 0;\n // }\n // an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n // if(!isUndef(an_edge) && !an_edge.hidden){\n // an_edge.color = an_edge.attr['true_color'];\n // an_edge.attr['grey'] = 0;\n // }\n }\n }\n }\n } else { \n\n if( !isUndef(bipartiteN2D[nodeSel.id]) &&\n !isUndef(bipartiteN2D[nodeSel.id].neighbours)\n ){\n neigh=bipartiteN2D[nodeSel.id].neighbours;/**/\n for(var i in neigh){\n\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ){ \n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n }\n }\n }\n }\n if(swclickActual==\"semantic\") {\n if(nodeSel.type==catSoc){ \n if( !isUndef(bipartiteD2N[nodeSel.id]) &&\n !isUndef(bipartiteD2N[nodeSel.id].neighbours)\n ){\n neigh=bipartiteD2N[nodeSel.id].neighbours;/**/\n for(var i in neigh) {\n\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {\n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n\n }\n }\n }\n else {\n if( !isUndef(nodes2[nodeSel.id]) &&\n !isUndef(nodes2[nodeSel.id].neighbours)\n ){\n neigh=nodes2[nodeSel.id].neighbours;/**/\n for(var i in neigh){\n\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {\n nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]];\n // vec.color = vec.attr['true_color'];\n // vec.attr['grey'] = 0;\n // pr(\"nodeselected: \"+nodeSel.id+\"\\t\"+nodeSel.label+\"\\t\\t||\\t\\tvecino: \"+vec.id+\"\\t\"+vec.label)\n\n possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+\";\"+nodeSel.id]\n possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+nodeVec.id]\n\n an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2;\n if(!isUndef(an_edge) && !an_edge.hidden) {\n\n \t//highlight node\n \t// nodeVec.hidden = false;\n \t nodeVec.color = nodeVec.attr['true_color'];\n \t nodeVec.attr['grey'] = 0;\n\n \t//highlight edge\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0; \t\n }\n\n // if ( (NOW==\"a\" || NOW==\"b\") && nodeVec.color==grey)\n // \tpr(nodeVec)\n \t// nodeVec.hidden = true\n\n\n // vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n // vec.color = vec.attr['true_color'];\n // vec.attr['grey'] = 0;\n // an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n // if(!isUndef(an_edge) && !an_edge.hidden){\n // an_edge.color = an_edge.attr['true_color'];\n // an_edge.attr['grey'] = 0;\n // }\n // an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n // if(!isUndef(an_edge) && !an_edge.hidden){\n // an_edge.color = an_edge.attr['true_color'];\n // an_edge.attr['grey'] = 0;\n // }\n }\n }\n }\n }\n }\n if(swclickActual==\"sociosemantic\") {\n if(nodeSel.type==catSoc){ \n\n if( !isUndef(nodes1[nodeSel.id]) &&\n !isUndef(nodes1[nodeSel.id].neighbours)\n ){\n neigh=nodes1[nodeSel.id].neighbours;/**/\n for(var i in neigh){\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {\n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n } \n }\n\n if( !isUndef(bipartiteD2N[nodeSel.id]) &&\n !isUndef(bipartiteD2N[nodeSel.id].neighbours)\n ){\n neigh=bipartiteD2N[nodeSel.id].neighbours;/**/\n for(var i in neigh) {\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) { \n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n }\n }\n }\n else { \n if( !isUndef(nodes2[nodeSel.id]) &&\n !isUndef(nodes2[nodeSel.id].neighbours)\n ){\n neigh=nodes2[nodeSel.id].neighbours;/**/\n for(var i in neigh) {\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {\n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n }\n }\n\n if( !isUndef(bipartiteN2D[nodeSel.id]) &&\n !isUndef(bipartiteN2D[nodeSel.id].neighbours)\n ){\n neigh=bipartiteN2D[nodeSel.id].neighbours;/**/\n for(var i in neigh){\n if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) { \n vec = partialGraph._core.graph.nodesIndex[neigh[i]];\n vec.color = vec.attr['true_color'];\n vec.attr['grey'] = 0;\n an_edge=partialGraph._core.graph.edgesIndex[vec.id+\";\"+nodeSel.id];\n if(!isUndef(an_edge) && !an_edge.hidden){\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+\";\"+vec.id];\n if(!isUndef(an_edge) && !an_edge.hidden) {\n an_edge.color = an_edge.attr['true_color'];\n an_edge.attr['grey'] = 0;\n }\n }\n }\n }\n }\n }\n \t}\n }\n}", "title": "" }, { "docid": "31a23d29fa25e5e72df22756527914a0", "score": "0.5175857", "text": "function filterByTag(){\n\t\n\tvar selectedTag=($('#tagSelectBox').val());\n\t\n\tcloseAttributePane();\n\t\n\tif(selectedTag != null){\n\t\tnodeArray=[];\n\t\tvar edgeArray=[];\n\t\tnodeId_Array=[];\n\n\t\tif(tagFilterActive == false){\n\t\t\ttemp_nodesDataset=nodesDataset;\n\t\t\ttemp_edgesDataset=edgesDataset;\n\t\t}else{\n\t\t\tnodesDataset = temp_nodesDataset;\n\t\t\tedgesDataset = temp_edgesDataset;\n\t\t\tvar layout_state=layout_hierarchical_active;\n\t\t\tredrawAll();\n\n\t\t\tif(layout_state == true){\n\t\t\t\tlayout_hierarchical();\n\t\t\t}\n\t\t\ttagFilterActive = false;\n\t\t}\n\n\t\ttagFilterActive=true;\n\n\t\tfor(var currentTag in selectedTag){\n\t\t\tfor(var nodeId in allNodes){\n\t\t\t\tif(allNodes[nodeId].tags.includes(selectedTag[currentTag]) == true && nodeArray.includes(allNodes[nodeId])==false){\n\t\t\t\t\tnodeArray.push(allNodes[nodeId]);\n\t\t\t\t\tnodeId_Array.push(parseInt(nodeId));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar influenced_nodes=[];\n\t\tfor(var edgeId in allEdges){\n\t\t\tif(nodeId_Array.includes(allEdges[edgeId].from) == true){\n\t\t\t\tedgeArray.push(allEdges[edgeId]);\n\t\t\t\tif(nodeId_Array.includes(allEdges[edgeId].to) == false && influenced_nodes.includes(allEdges[edgeId].to) == false ){\n\n\t\t\t\t\tvar id_to_push=allEdges[edgeId].to;\n\n\t\t\t\t\tinfluenced_nodes.push(id_to_push);\n\n\t\t\t\t\tnodeArray.push(allNodes[id_to_push]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(var id_node in nodeArray){\n\t\t\tif(nodeArray[id_node].id>id_to_replace){\n\t\t\tvar id_to_replace=nodeArray[id_node].id;\n\t\t\t//console.log(\"old id \" + id_to_replace);\n\t\t\tnodeArray[id_node].id=parseInt(id_node);\n\t\t\t//console.log(\"new id \" + id_node);\n\n\t\t\tfor(var id_edge in edgeArray){\n\n\t\t\t\tif(edgeArray[id_edge].to == id_to_replace){\n\t\t\t\t\t//console.log(\"to \" + edgeArray[id_edge].to);\n\t\t\t\t\tedgeArray[id_edge].to=parseInt(id_node);\n\t\t\t\t\t//console.log(\"to \" + edgeArray[id_edge].to);\n\t\t\t\t}else if(edgeArray[id_edge].from == id_to_replace){\n\t\t\t\t\t//console.log(\"from \" + edgeArray[id_edge].from);\n\t\t\t\t\tedgeArray[id_edge].from=parseInt(id_node);\n\t\t\t\t\t//console.log(\"from \" + edgeArray[id_edge].from);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t\tfor(var id_edge in edgeArray){\n\t\t\tedgeArray[id_edge].id=parseInt(id_edge);\n\t\t}\n\n\t\tnodesDataset = new vis.DataSet(nodeArray);\n\t\tedgesDataset = new vis.DataSet(edgeArray);\n\n\t\tupdateLeftPane();\n\t\t\n\t\t\tvar layout_state=layout_hierarchical_active;\n\n\t\tredrawAll();\n\t\t\tif(layout_state == true){\n\t\t\t\tlayout_hierarchical();\n\t\t\t}\n\n\t}else{\n\n\t\tif(tagFilterActive == true){\n\t\t\tnodesDataset = temp_nodesDataset;\n\t\t\tedgesDataset = temp_edgesDataset;\n\n\t\t\tvar layout_state=layout_hierarchical_active;\n\n\t\t\tredrawAll();\n\t\t\tif(layout_state == true){\n\t\t\t\tlayout_hierarchical();\n\t\t\t}\n\t\t\ttagFilterActive = false;\n\t\t}\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "f9b01319d6253a518f31b02a5c13e0d9", "score": "0.5174003", "text": "function binding_filterSelected(node) {\n table.option_filterSelected = node.checked;\n table.gridOptions.api.onFilterChanged();\n}", "title": "" }, { "docid": "c2504ee976b6aa0d3a6e2046fb109037", "score": "0.51730657", "text": "renderSelected() {\n if (this.isEmpty)\n this.clear();\n\n let fragment = document.createDocumentFragment();\n\n for (let item of Object.values(this.selected))\n fragment.appendChild(item);\n\n // appends empty li to end for aspect ratio fix\n !this.isEmpty && fragment.appendChild(this._createItem(true));\n\n this.selectedRootNode.textContent = \"\"; // clears grid content\n this.selectedRootNode.appendChild(fragment);\n }", "title": "" }, { "docid": "abf873c034ab8df8d35c24209842bc4a", "score": "0.5161036", "text": "set hidden(value) {\n this._hidden = value;\n this.children.forEach(child => child.hidden = value);\n if (this.grid && this.grid.columns && this.grid.columns.length > 0) {\n // reset indexes in case columns are hidden/shown runtime\n const columns = this.grid && this.grid.pinnedColumns && this.grid.unpinnedColumns ?\n this.grid.pinnedColumns.concat(this.grid.unpinnedColumns) : [];\n if (!this._hidden && !columns.find(c => c.field === this.field)) {\n this.grid.resetColumnCollections();\n }\n this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());\n }\n }", "title": "" }, { "docid": "c09673338c7aebbe90f08bc0d6969ec1", "score": "0.5149904", "text": "getSelectedNodes() {\n return this.nodeSelection.size ? Array.from(this.nodeSelection) : [];\n }", "title": "" }, { "docid": "f329a850138188fde23ccb4e2f565c74", "score": "0.5145055", "text": "expandNodeRecursive(){this._selectedField.expandRecursive()}", "title": "" }, { "docid": "a4de94785a8fedbb96769bdb02f33d19", "score": "0.5142798", "text": "function generateSelectedDisplayFieldsParameter() {\n\n\t// select boxes normally only post selected values; this workaround ensures\n\t// all values in the right box get posted\n\tvar selectedDisplayFields = $(\"#selected_display_fields option\").map(function(){ return this.value }).get();\n\t$('input[name=\"custom_view[ordered_display_fields][selected]\"]').val(selectedDisplayFields);\n}", "title": "" }, { "docid": "562bd2f19f79251927c74acf100b861c", "score": "0.51339924", "text": "function onClickTreeNode(){\n View.controllers.get('defRMTypeCat').curTreeNode = View.panels.get(\"cate_tree\").lastNodeClicked;\n}", "title": "" }, { "docid": "32941618705ef8a51c0c860949bc7747", "score": "0.5124322", "text": "calculateVal () {\n var filtered = get(this, 'options').filterBy('isSelected');\n set(this, 'val', A(filtered).sortBy('order'));\n }", "title": "" }, { "docid": "ca1951c18d4a8d782713776318ea0ee5", "score": "0.51180893", "text": "function _generateSelect(node) {\n if (node.nodes && _.isArray(node.nodes)) {\n var fieldsObj = {};\n node.select = fieldsObj;\n\n _.each(node.nodes, function(childNode) {\n _generateSelect(childNode);\n\n fieldsObj[childNode.memberName] = childNode.exclude === true ? 0 : 1;\n });\n }\n}", "title": "" }, { "docid": "73d31604c5414f27c9ec4ae284551f35", "score": "0.51160073", "text": "function storeSort(x) {\r\n\tvar storeSortData = x\r\n\t\r\n\t$('.storeItem').css('display', 'none');\r\n\t$('.' + storeSortData).css('display', 'block');\r\n\t\r\n\t//console.log(\"Sorted to \" + storeSortData);\r\n}", "title": "" }, { "docid": "b2539a5cbe70204a07e72377d049072f", "score": "0.511526", "text": "function handleSelection(e){\n let index = parseInt(e.target.getAttribute('data-value'));\n\n //if I previously ordered by 'most recent' then I sort the next order by ASC\n if(queryData.orderBy === \"date_created\"){\n queryData.sort = \"ASC\";\n }\n queryData.orderBy=orderByOptions[index].value;\n\n //update url\n let queryString = createQueryStringFromObject(queryData);\n history.push(queryString);\n }", "title": "" }, { "docid": "21c8e559a32b72a8f406dbd071031dd8", "score": "0.5111555", "text": "function newTreeViewOrder() {\n\t\t\tvar newTreeViewOrder = [];\n\t\t\t$('#tree-view-contents [data-item-id]').each(function() {\n\t\t\t\tnewTreeViewOrder.push( $(this).data('item-id') );\n\t\t\t});\n\t\t\treturn newTreeViewOrder;\n\t\t}", "title": "" }, { "docid": "4aa27f109046cbff7e19b4158838c496", "score": "0.5106013", "text": "function onClickTreeNode(){\n View.controllers.get('defineCostPerBlFl').curTreeNode = View.panels.get(\"bl_tree\").lastNodeClicked;\n}", "title": "" }, { "docid": "09d3b3e0a7f78e33e8d08e4d6e51f95d", "score": "0.5105226", "text": "nodesInList () {\n return this.accessibleFrom (this.dummy);\n }", "title": "" }, { "docid": "b7505b718ccf7c4c190a942ed25b0148", "score": "0.50908136", "text": "function getOrder()\n{\n //Get new order\n var order = [];\n var serialized_order = $('#sortable').sortable('serialize');\n\n //Parse order and create an Array with the elements\n var raworder = serialized_order.split(\"&\");\n var len = raworder.length;\n for (i=0;i<len;i++)\n {\n order.push(raworder[i].split(\"=\")[1]);\n }\n\n return order;\n}", "title": "" }, { "docid": "cce28614860b3470be02148e23c353d4", "score": "0.50902706", "text": "function displaySelection(pathArray) {\n\n var links = d3.selectAll(\".link\");\n var nodes = d3.selectAll(\".node\");\n\n hideLinks(links);\n nodes.style(\"opacity\", 0.2);\n\n if (!pathArray.length) {\n nodes.filter(function(d, i) {\n return (d.ueid === currentSelection[0].ueid || d.ueid === currentSelection[1].ueid);\n }).style(\"opacity\", \"1\");\n }\n\n pathArray.forEach(function(path) {\n for (var k = 0; k < path.length; k++) {\n if (k != path.length - 1) {\n displayLinks(links.filter(function(d, i) {\n return (d.source === path[k] && d.target === path[k + 1] && currentFilters.includes(d.linktype));\n }).style(\"opacity\", \"1\"));\n }\n\n nodes.filter(function(d, i) {\n return (d.ueid === path[k].ueid && checkNodeDisplay(d, currentFilters));\n }).style(\"opacity\", \"1\");\n }\n })\n}", "title": "" }, { "docid": "6efbfc4ef54e2d9e3e331c257adbae84", "score": "0.5089592", "text": "function updateOrderSelectors() {\n\tvar row_count = $('table.graphics tbody tr').length;\n\t$('table.graphics select').each(function () {\n\t\tvar select = $(this);\n\t\tvar selected = select.val();\n\t\tselect.empty();\n\t\tfor (var n = 1; n <= row_count; n++) {\n\t\t\tvar option = $('<option value=\"\"></option>');\n\t\t\toption.html(n);\n\t\t\toption.val(n - 1);\n\t\t\tif (selected == n - 1) {\n\t\t\t\toption.attr('selected', 'selected');\n\t\t\t}\n\t\t\tselect.append(option);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d855b525be055c4cad15113646d61ad8", "score": "0.5087036", "text": "static selected_nodes(){\n let sel_nodes = HCA.lgraphcanvas.selected_nodes //but this is not an array, rather an obj with keys of the node id, and values of the node objects\n let keys = Object.keys(sel_nodes)\n let result = []\n for(let key of keys){\n result.push(sel_nodes[key])\n }\n return result\n }", "title": "" }, { "docid": "5fabee5047c476f497d257c96e252882", "score": "0.5086705", "text": "function getFieldSortableOptions() {\n return {\n cursor: \"move\",\n connectWith: \".formulate-cell\",\n tolerance: \"pointer\",\n items: \".formulate-cell-field\",\n opacity: 0.5\n };\n}", "title": "" }, { "docid": "234da9c0d02dcaa614317c37ca43e84b", "score": "0.50844", "text": "function sortSettingForCurrentSettings() {\n if ($scope.form.sort == $scope.sortOptions[0].id) {\n // The select has been set to the default value.\n return undefined;\n } else {\n return $scope.form.sort;\n }\n }", "title": "" }, { "docid": "234da9c0d02dcaa614317c37ca43e84b", "score": "0.50844", "text": "function sortSettingForCurrentSettings() {\n if ($scope.form.sort == $scope.sortOptions[0].id) {\n // The select has been set to the default value.\n return undefined;\n } else {\n return $scope.form.sort;\n }\n }", "title": "" }, { "docid": "de42715c1e166e628b00376aa461154c", "score": "0.50827235", "text": "function frontEnd() {\n $('tbody')\n .sortable({\n// cancel : 'tr:not(.selected)', //Quais itens não podem ser selecionados\n items : 'tr', //Quais os itens que podem ser selecionados\n appendTo : \".up-container\", //Por onde os itens selecionados podem percorrer\n connectWith : 'tbody', //Onde poderá ser soltado os itens selecionados\n cursor : 'move', //Cursor enquanto arrasta itens\n tolerance : 'pointer', //Em que ponto poderá ser soltados os itens\n delay : 150, //Tempo em milisegundos que demora para começar a arrastar os itens\n distance : 5, \n revert : true, //Ativa o efeito ao soltar suavisado\n cursorAt : { left: 5 }, //Posição do cursor em relação ao item que está sendo arrastado\n //Item flutuante\n helper: function(e, item){\n if(!item.hasClass('selected')){\n item.addClass('selected').siblings().removeClass('selected');\n }\n\n var elements = item.parent().children('.selected').clone();\n item.data('multidrag', elements).siblings('.selected').remove();\n \n TaloesOrigem(elements);\n\n var helper = $('<tr/>');\n return helper.append(elements);\n },\n beforeStop: function(e, ui){\n $('tbody')\n .each(function(){\n var tr = $(this).find('tr.ui-sortable-handle');\n var empty = $(this).find('.dataTables_empty');\n \n if( tr.length >= 1 && empty.length == 1 ) {\n empty.remove();\n }\n \n if ( tr.length < 1 && empty.length == 0 ) {\n $(this).append('<tr><td colspan=\"10\" class=\"dataTables_empty\">Não há registros para listar</td></tr>');\n }\n })\n ; \n },\n //Ação ao soltar itens\n stop: function(e, ui){\n\n var elements = ui.item.data('multidrag');\n ui.item.after(elements).remove();\n \n addConfirme(\n '<h4>Reprogramar Talões</h4>',\n ' Confirma a reprogramação dos itens selecionados?<br />',\n [obtn_sim,obtn_nao],\n [\n {ret:1,func:function(){\n TaloesDestino();\n }},\n {ret:2,func:function(){\n $('.form-filtrar').submit(); \n }}\n ] \n );\n },\n //Abertura onde será soltado os itens\n placeholder: {\n element: function(currentItem) {\n return $('<tr><td colspan=\"10\" class=\"reprogramar-aqui\">Reprogramar aqui</td></tr>')[0];\n },\n update: function(container, p) {\n return;\n }\n }\n })\n ;\n }", "title": "" }, { "docid": "c3064fa8da45ce152315ef5ceeebc9c7", "score": "0.5082329", "text": "static sortedEdges(edges, selectedNode, isNodeDisabled){\n return edges.slice(0).sort((a,b)=>{\n var isASelected = Edge.isSelected(a, selectedNode, isNodeDisabled);\n var isBSelected = Edge.isSelected(b, selectedNode, isNodeDisabled);\n\n if (isASelected && !isBSelected){\n return 1;\n } else if (!isASelected && isBSelected){\n return -1;\n } else {\n return 0;\n }\n }).sort((a,b)=>{\n var isADisabled = Edge.isDisabled(a, isNodeDisabled);\n var isBDisabled = Edge.isDisabled(b, isNodeDisabled);\n\n if (isADisabled && !isBDisabled){\n return -1;\n } else if (!isADisabled && isBDisabled) {\n return 1;\n } else {\n return 0;\n }\n });\n }", "title": "" }, { "docid": "f01196b4d2466779ef1c6308dda3d59f", "score": "0.50794184", "text": "function changeAgentListView()\n{\n\tvar cbboxAgents = document.getElementById('objects');\n\tif(cbboxAgents != null){\n\t\tvar o = new Array();\n\t\t\toptText = \"\";\n\t\t\t\t\t\t\t\n\t\tfor(var i = 0; i < cbboxAgents.options.length; i++){\t\t\t\n\t\t\to.push(cbboxAgents.options[i]);\n\t\t}\t\t\t\n\t\t\n\t\t//Now sort according to the showAgentsById value\n\t\tif(document.getElementById('ckboxAgentByID').checked){\t\t\t\t\t\t\n\t\t\to.sort(sortOptionsByValue);//sort by agent id\n\t\t\tfor(var i = 0; i < o.length; i++){\t\t\t\t\n\t\t\t\toptText = o[i].value + ' [' + o[i].text.substring(0, o[i].text.indexOf('[') - 1) + ']' ;//James Bond [001] => 001 [James Bond]\t\t\t\t\n\t\t\t\tcbboxAgents.options[i] = new Option(optText, o[i].value, o[i].defaultSelected, o[i].selected)\n\t\t\t}//end of for(var i = 0; i< o.length; i++)\n\t\t\t\n\t\t}//end of if(document.getElementById('ckboxAgentByID').checked)\n\t\telse{//sort by agents' name\n\t\t\to.sort(sortOptionsByText);//sort by agents' name\n\t\t\tfor(var i = 0; i< o.length; i++){\t\t\t\t\t\t\t\t\n\t\t\t\toptText = o[i].text.substring(o[i].text.indexOf('[') + 1, o[i].text.indexOf(']')) + ' [' + o[i].value + ']';//001 [James Bond] => James Bond [001]\n\t\t\t\tcbboxAgents.options[i] = new Option(optText, o[i].value, o[i].defaultSelected, o[i].selected)\n\t\t\t}//end of for(var i = 0; i< o.length; i++)\t\t\n\t\t}//end of else\t\t\t\t\t\n\t\t\t\t\n\t}//end of if(cbboxAgents != null)\n}", "title": "" }, { "docid": "6ee5c82e84d990f0a88286c02fdba20d", "score": "0.5073071", "text": "function sort_by(e){\n var form = document.getElementById('search-form');\n var data = new FormData(form);\n var value = this.textContent;\n if(!data.get(value.toLowerCase())){\n return;\n }\n var siblings = document.querySelectorAll('#restaurant-table > thead > tr > th');\n for(var i=0; i<siblings.length; i++){\n if(siblings[i] != this){\n siblings[i].classList.remove('sort-asc')\n siblings[i].classList.remove('sort-desc')\n }\n }\n form.querySelector('#sort_order').value = value;\n if(!this.classList.contains('sort-asc')){\n this.classList.remove('sort-desc');\n this.classList.add('sort-asc');\n form.querySelector('#reverse').value = false;\n }else{\n this.classList.remove('sort-asc');\n this.classList.add('sort-desc');\n form.querySelector('#reverse').value = true;\n }\n get_restaurants();\n}", "title": "" }, { "docid": "04bd545368d8cb1a1d5b92f35bc94d01", "score": "0.5068541", "text": "function addremove_addItem(field, sort) {\n\n\tvar sourceList = document.getElementById(field + \"_unselected\");\n\tvar targetList = document.getElementById(field + \"_selected\");\n\t\n\tvar idx = sourceList.selectedIndex;\n\n\tif(_addremove_moveItem(sourceList, idx, targetList, sort)) {\n\t\t_addremove_updateSubmitField(field);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "title": "" }, { "docid": "15974aa406a170525b084d795853d8e2", "score": "0.5067871", "text": "function nodeClick() {\n flipNodeSelection($(this).attr(\"id\"));\n}", "title": "" }, { "docid": "4623f2f7ba6f078984b9212f9f857249", "score": "0.50652945", "text": "function clustertree_add_selected_unexpanded(instanceid, node, uniqueid) {\n\tclustertree_append_to_list(instanceid, uniqueid + '_unexpanded', node.contentElId);\n\n\tclustertree_remove_from_list(instanceid, uniqueid + '_clrunexpanded', node.contentElId);\n}", "title": "" }, { "docid": "5c852cde3da69e097357db090b083743", "score": "0.5064536", "text": "function test(){\r\n \r\n //alert($.jstree._focused().get_selected());\r\n }", "title": "" }, { "docid": "3330a58c2a42fe5c4649f95d999eb6ba", "score": "0.50625384", "text": "function onFormSubmit(e) {\n NinerNetSort();\n}", "title": "" }, { "docid": "bd99bec7ea0372cf38af9779e79de090", "score": "0.50575083", "text": "deleteSelectedNodes() {\n let sel = [...this.selectedNodes].sort((b, a) => poscmp(a.from, b.from));\n this.selectedNodes.clear();\n this.focusPath = sel[sel.length-1].path; // point to the first node\n this.commitChange(() => sel.forEach(n => this.cm.replaceRange('', n.from, n.to)),\n \"deleted \"+sel.length+\" item\"+(sel.length==1? \"\" : \"s\"));\n }", "title": "" }, { "docid": "b8acc33657fd3922625ef97cc06ec2a6", "score": "0.505669", "text": "function _writeValues() {\n\t\tif (isMulti) {\n\t\t\t$(\"[name='\" + fieldName + \"']\", _form).remove();\n\t\t\tvar htm = [];\n\t\t\tnodeList.each(function(index, node) {\n\t\t\t\t$(\"<input type='hidden' name='\" + fieldName + \"' value='\" + node.value + \"' />\").appendTo(_form);\n\t\t\t\thtm.push(\"<li>\" + $(node).data(\"text\") + \"</li>\");\n\t\t\t});\n\t\t\t$(\"#\" + fieldName + \"tbl\").html(htm.join(\"\"));\n\t\t} else {\n\t\t\tvar fieldNode = $(\"[name='\" + fieldName + \"']\", _form);\n\t\t\tif (fieldNode.length === 0) {\n\t\t\t\tfieldNode = $(\"<input type='hidden' name='\" + fieldName + \"' />\");\n\t\t\t\t$(_form).append(fieldNode[0]);\n\t\t\t}\n\n\t\t\tfieldNode.val(nodeList[0].value);\n\t\t\t// $(\"[data-refers-to-field='\" + fieldName +\n\t\t\t// \"']\").html($(nodeList[0]).text());\n\t\t\t$(\"#\" + fieldName + \"tbl\").html(\"<li>\" + nodeList.attr(\"data-text\") + \"</li>\");\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "3ed110f46ceb7bb87844e3f0ab941034", "score": "0.5052441", "text": "function toggleNodeType(checkbox){\n nodesFilterValues[checkbox.value] = checkbox.checked;\n nodesView.refresh();\n}", "title": "" }, { "docid": "c530b192e5fcfa2322d7f3cf910a730e", "score": "0.50452393", "text": "treeSelect (val, label, extra) {\n\t\tconsole.log('treeSelect', val);\n\t\tconsole.log('treeSelect', label);\n\t\tconsole.log('treeSelect', extra);\n\n\t\tlet value = this.state.value,\n\t\t\tsub_cat = this.state.sub_category_selected_display;\n\t\t\tconsole.log('treeSelect_val_0', this.state.value);\n\t\tif (extra.triggerValue.split('-').length == 2) {\n\t\t\tvalue = [];\n\t\t\tvalue.push(extra.triggerValue);\n\t\t\tlet category_id = extra.triggerValue.split('-')[1];\n\t\t\t/*this.props.history.push('');\n\t\t\tif (this.state.search_station != '') {\n\t\t\t\tthis.props.history.push(this.props.location.search);\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\tstation_id: ''\n\t\t\t});*/\n\t\t\tthis.setCategory(parseInt(category_id));\n\t\t} else if (extra.triggerValue.split('-').length == 3) {\n\t\t\tlet status = false;\n\t\t\tlet category_id = extra.triggerValue.split('-')[1];\n\t\t\tlet sub_category_id = extra.triggerValue.split('-')[2];\n\t\t\tif (sub_cat && sub_cat.length) {\n\t\t\t\tif (sub_cat.indexOf(parseInt(sub_category_id)) == -1) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstatus = true;\n\t\t\t}\n\t\t\tvalue = [];\n\t\t\tif (val.length) {\n\t\t\t\tval.map((v) => {\n\t\t\t\t\tif (v.split('-').length == 3) {\n\t\t\t\t\t\tif (v.split('-')[1] == extra.triggerValue.split('-')[1]) {\n\t\t\t\t\t\t\tvalue.push(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (v.split('-').length == 2) {\n\t\t\t\t\t\tif (v.split('-')[1] == extra.triggerValue.split('-')[1]) {\n\t\t\t\t\t\t\tvalue.push(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}/* else {\n\t\t\t\tvalue = val;\n\t\t\t}*/\n\t\t\t/*this.props.history.push('');\n\t\t\tif (this.state.search_station != '') {\n\t\t\t\tthis.props.history.push(this.props.location.search);\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\tstation_id: ''\n\t\t\t});*/\n\t\t\tthis.setSubCategory(status, parseInt(category_id), parseInt(sub_category_id));\n\t\t}\n\t\tthis.setState({\n\t\t\tvalue: value,\n\t\t\tlabel: label\n\t\t\t// station_id: ''\n\t\t},() => {\n\t\t\t/*this.props.history.push('');\n\t\t\tif (this.state.search_station != '') {\n\t\t\t\tthis.props.history.push(this.props.location.search);\n\t\t\t}*/\n\t\t\tconsole.log('treeSelect_val_1', this.state.value);\n\t\t\tthis.showList(true);\n\t\t});\n\t}", "title": "" }, { "docid": "f7a6618fca62465884a00e90f73a845a", "score": "0.50429165", "text": "function changeAgentListView()\n{\n\tvar cbboxAgents = document.getElementById('objects');\n\tif(cbboxAgents != null){\n\t\tvar o = new Array();\n\t\t\toptText = \"\";\n\t\t\t\t\t\t\t\n\t\tfor(var i = 0; i < cbboxAgents.options.length; i++){\t\t\t\n\t\t\to.push(cbboxAgents.options[i]);\n\t\t}\t\t\t\n\t\t\n\t\t//Now sort according to the showAgentsById value\n\t\tif(document.getElementById('ckboxAgentByID').checked){\t\t\t\t\t\t\n\t\t\to.sort(sortOptionsByValue);//sort by agent id\n\t\t\tfor(var i = 0; i < o.length; i++){\t\t\t\t\n\t\t\t\toptText = '[' + o[i].value + '] ' + o[i].text;//[001]James Bond\t\t\t\t\n\t\t\t\tcbboxAgents.options[i] = new Option(optText, o[i].value, o[i].defaultSelected, o[i].selected)\n\t\t\t}//end of for(var i = 0; i< o.length; i++)\n\t\t\t\n\t\t}//end of if(document.getElementById('ckboxAgentByID').checked)\n\t\telse{//sort by agents' name\n\t\t\to.sort(sortOptionsByText);//sort by agents' name\n\t\t\tfor(var i = 0; i< o.length; i++){\n\t\t\t\t//[001] James Bond => James Bond\t\t\t\t\n\t\t\t\toptText = o[i].text.slice(o[i].text.indexOf(']') + 2);//Remove the [ and the space\n\t\t\t\tcbboxAgents.options[i] = new Option(optText, o[i].value, o[i].defaultSelected, o[i].selected)\n\t\t\t}//end of for(var i = 0; i< o.length; i++)\t\t\n\t\t}//end of else\t\t\t\t\t\n\t\t\t\t\n\t}//end of if(cbboxAgents != null)\n}", "title": "" }, { "docid": "f07d21ccb01e380df50b8de6d4771589", "score": "0.50361365", "text": "function manage_elem(typ1, main_elm, hidden_elm){\n \n // this object\n\t\tvar prc = this;\n \n // sorting type\n var sort_typ;\n\t\t\n // array that holds sorting arrangement\n var srt_arr = new Array();\n \n // array that holds associative sorting \n var srt_arr_assoc = new Array();\n\n /* ================================================================\n * start sorting here\n * ================================================================*/ \n prc.start_sorting = function(typ2){\n \n sort_typ = prc.calculate_sortyp(typ1, typ2.val());\n\t\t\t\n if(sort_typ != ''){\n\t\t\t\tprc.hide_elem(main_elm, prc.transfer_objects);\n\t\t\t}\n\t\t\t\n\t }\n\n /* ================================================================\n * updates sorting options \n * ================================================================*/ \n prc.update_option_fields = function(setting, opt_sort, cl_back){\n \n opt_sort.html(\"\");\n\n var options;\n\n if(setting == 1) {\n options = {\n 1 : 'Youngest to Oldest',\n 2 : 'Oldest to Youngest'\n };\n } else if(setting == 2 ){\n options = {\n 1 : 'A - Z',\n 2 : 'Z - A'\n };\n } else if(setting == 3 ){\n options = {\n 1 : 'Ascending',\n 2 : 'Descending'\n };\n } else {\n options = {\n '' : 'Sort Options'\n }\n } \n\n jQuery.each(options, function(val, text) {\n var sel = 0;\n if (sel == 0){\n opt_sort.append(\n jQuery('<option \"selected\"></option>').val(val).html(text)\n );\n } else {\n opt_sort.append(\n jQuery('<option></option>').val(val).html(text)\n );\n }\n sel = sel + 1;\n });\n \n cl_back(arguments[1]);\n \n } \n\n /* ================================================================\n * calculate sorting type\n * ================================================================*/ \n prc.calculate_sortyp = function (t1, t2){\n \n // 1 young to old\n if(t1 == '1' && t2 == '1'){\n return '1';\n }\n \n // 2 name a-z\n if(t1 == '2' && t2 == '1'){\n return '2';\n }\n \n // 3 date joined descending\n if(t1 == '3' && t2 == '2'){\n return '3';\n }\n \n // 4 date joined ascending\n if(t1 == '3' && t2 == '1'){\n return '4';\n }\n \n // 5 old to young \n if(t1 == '1' && t2 == '2'){\n return '5';\n }\n \n // 6 name z - a\n if(t1 == '2' && t2 == '2'){\n return '6';\n }\n \n return \"\";\n \t\t\n\t }\n\n /* ================================================================\n * hide elements on main site \n * ================================================================*/ \n\t\tprc.hide_elem = function(main, call){\n\n\t\t\tmain.animate({opacity:0},1000, function(){\n\t\t\t\t call(main_elm, hidden_elm, prc.create_array_elm);\n\t\t\t});\n\n\t\t}\n\t\t\n /* ================================================================\n * transfer elements only when div is hidden \n * ================================================================*/ \n\t\tprc.transfer_objects = function(from_elm, to_elm, call){\n \n var htm = from_elm.html();\t\t\n from_elm.html('');\n to_elm.html(htm);\t\n call(htm, prc.clone_object_elements);\t\n\n }\n\n /* ================================================================\n * provides value to arrangement array\n * ================================================================*/ \n prc.create_array_elm = function(hd_elm, clone){\n\t\t\t\n\t\t\tsrt_arr = [];\n srt_arr_assoc = [];\n main_elm.html('');\n \n // age sorting youngest to oldest \n\t\t\tif(sort_typ == '1') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_birth\").each(function(){\n\t\t\t\t\tsrt_arr.push(jQuery(this).val());\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n srt_arr.reverse();\n\t\t\t\n // name sorting ascending \t\n\t\t\t} else if (sort_typ == '2') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_name\").each(function(){\n\t\t\t\t\tsrt_arr.push(jQuery(this).val());\t\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n \n // member registered sorting descending \n\t\t\t} else if (sort_typ == '3') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_created\").each(function(){\n\t\t\t\t\tsrt_arr.push(jQuery(this).val());\t\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n srt_arr.reverse();\n \n // member registered sorting ascending \n\t\t\t} else if (sort_typ == '4') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_created\").each(function(){\n \t\t\tsrt_arr.push(jQuery(this).val());\t\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n \n // age sorting oldest to youngest \n\t\t\t} else if (sort_typ == '5') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_birth\").each(function(){\n \t\t\tsrt_arr.push(jQuery(this).val());\t\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n \n \n\t\t \t// member registered sorting descending \n\t\t } else if (sort_typ == '6') {\n\t\t\t\tjQuery(\"#hidden_div\").find(\".p_name\").each(function(){\n\t\t\t\t\tsrt_arr.push(jQuery(this).val());\t\n srt_arr_assoc[jQuery(this).attr('id')] = jQuery(this).val();\n\t\t\t\t});\n\t\t\t\tsrt_arr.sort();\n srt_arr.reverse();\n \n } \n \n clone();\n\t\t\n\t\t}\n\n /* ================================================================\n * reaarrange back elements to main container\n * ================================================================*/ \n\t\tprc.clone_object_elements = function(){\n \n var counted = new Array();\n counted = [];\n \n jQuery.each(srt_arr, function(index, value) {\n\n if(sort_typ == '1' || sort_typ == '5'){\n \n if(prc.check_instance_in_array(value)){\n var cloned = jQuery(\"#hidden_div\").find(\".p_birth[value='\"+value+\"']\").parent();\n prc.clone_em(cloned);\n } else {\n if(prc.not_in_array(counted,value)){\n prc.clone_em_all(value,\"p_birth\");\n counted.push(value);\n }\n }\n \n } else if(sort_typ == '2' || sort_typ == '6') {\n if(prc.check_instance_in_array(value)){\n var cloned = jQuery(\"#hidden_div\").find(\".p_name[value='\"+value+\"']\").parent();\n prc.clone_em(cloned);\n } else {\n if(prc.not_in_array(counted,value)){\n prc.clone_em_all(value,\"p_name\");\n counted.push(value);\n }\n }\n\n\n } else if(sort_typ == '3' || sort_typ == '4') {\n if(prc.check_instance_in_array(value)){\n var cloned = jQuery(\"#hidden_div\").find(\".p_created[value='\"+value+\"']\").parent();\n prc.clone_em(cloned);\n } else {\n if(prc.not_in_array(counted,value)){\n prc.clone_em_all(value,\"p_created\");\n counted.push(value);\n }\n }\n\n\n }\t\t\t\t\t \t\t\t\t\t\n\n });\n \n main_elm.animate({opacity:1},1000,function(){hidden_elm.html('');});\n \n \t }\n\n /* ================================================================\n * check instance count\n * ================================================================*/ \n prc.check_instance_in_array = function(vl){\n \n var count = 0;\n for (var key in srt_arr_assoc) {\n if (srt_arr_assoc.hasOwnProperty(key)) {\n if (srt_arr_assoc[key] == vl){\n count = count + 1;\n } \n }\n }\n if(count == 1){\n return true;\n } else if (count > 1){\n return false;\n }\n \n return false;\n }\n \n /* ================================================================\n * check array instance\n * ================================================================*/ \n prc.not_in_array = function(counted,vl){\n \n var ctr = 0;\n \n jQuery.each(counted, function(index, value) {\n if(value == vl){\n ctr = ctr + 1;\n }\n });\n \n if(ctr > 0){\n return false;\n } else {\n return true;\n }\n \n \n } \n\n /* ================================================================\n * clone object one by one\n * ================================================================*/ \n prc.clone_em = function(clon){\n \n var $cloned = clon.clone();\n main_elm.append($cloned);\n \n }\n\n /* ================================================================\n * clone object all\n * ================================================================*/ \n prc.clone_em_all = function(vl,cls){\n \n jQuery(\"#hidden_div\").find(\".\"+cls+\"[value='\"+vl+\"']\").each(function(){\n var $cloned = jQuery(this).parent().clone();\n main_elm.append($cloned);\n });\n \n }\n\n}", "title": "" }, { "docid": "b13989fe8d050196d356030a5a89aa3d", "score": "0.50310993", "text": "getSelectedNodes() {\r\n return this.nodeContainer.nodes;\r\n }", "title": "" }, { "docid": "994acf0f81a4486db22affad31e72618", "score": "0.5029431", "text": "function addremove_addNewItem(field, sort) {\n\n \tvar inputBox = document.getElementById(field + \"_new\");\n \tvar targetList = document.getElementById(field + \"_selected\");\n \n \tif(_addremove_addToList(targetList, inputBox.value, inputBox.value, sort)) {\n \t\t_addremove_updateSubmitField(field);\n\t\tinputBox.value = \"\";\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "0dd282763400fe7a60898fcc20c49323", "score": "0.50187653", "text": "DFSPreorder(){\n let data = [];\n\n function traverse(node){\n data.push(node.value);\n if(node.left) traverse(node.left);\n if(node.right) traverse(node.right);\n }\n\n traverse(this.root);\n return data;\n }", "title": "" }, { "docid": "861bcee8a42c47ea3467acde005368ba", "score": "0.50146997", "text": "function resetTreeFirstLevel(original_Data) {\n document.getElementById(\"search_input\").value = \"\";\n $('.js-select2').val(null).trigger(\"change\");\n last_selected = null;\n filtering_active = false;\n tree_clicked_bool = false;\n tree_root = tree(hierarchy(original_Data)); //passed by function\n current_Data = JSON.parse(JSON.stringify(original_Data));\n tree_root.each(function (d) {\n d.name_to_print = d.id; //transferring name to a name variable\n d.id = tree_i; //Assigning numerical Ids\n tree_i++;\n });\n tree_root.x0 = tree_root.x;\n tree_root.y0 = tree_root.y;\n tree_root.children.forEach(tree_collapseLevel);\n tree_update(tree_root);\n window.scrollTo(0,0);\n}", "title": "" } ]
e0afafb5c286b8e877dfa2491917b2a8
SCROLLBARS Prepare DOM reads needed to update the scrollbars. Done in one shot to minimize update/measure roundtrips.
[ { "docid": "e90d752981d61338552245de06d6ebed", "score": "0.56773794", "text": "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "title": "" } ]
[ { "docid": "8490829b550f1d3d2a6ed00f95cc4b39", "score": "0.7158125", "text": "function updateScrollbars(cm){var d=cm.display,docHeight=cm.doc.height,totalHeight=docHeight+paddingVert(d);d.sizer.style.minHeight=d.heightForcer.style.top=totalHeight+\"px\",d.gutters.style.height=Math.max(totalHeight,d.scroller.clientHeight-scrollerCutOff)+\"px\";var scrollHeight=Math.max(totalHeight,d.scroller.scrollHeight),needsH=d.scroller.scrollWidth>d.scroller.clientWidth+1,needsV=scrollHeight>d.scroller.clientHeight+1;needsV?(d.scrollbarV.style.display=\"block\",d.scrollbarV.style.bottom=needsH?scrollbarWidth(d.measure)+\"px\":\"0\",d.scrollbarV.firstChild.style.height=scrollHeight-d.scroller.clientHeight+d.scrollbarV.clientHeight+\"px\"):(d.scrollbarV.style.display=\"\",d.scrollbarV.firstChild.style.height=\"0\"),needsH?(d.scrollbarH.style.display=\"block\",d.scrollbarH.style.right=needsV?scrollbarWidth(d.measure)+\"px\":\"0\",d.scrollbarH.firstChild.style.width=d.scroller.scrollWidth-d.scroller.clientWidth+d.scrollbarH.clientWidth+\"px\"):(d.scrollbarH.style.display=\"\",d.scrollbarH.firstChild.style.width=\"0\"),needsH&&needsV?(d.scrollbarFiller.style.display=\"block\",d.scrollbarFiller.style.height=d.scrollbarFiller.style.width=scrollbarWidth(d.measure)+\"px\"):d.scrollbarFiller.style.display=\"\",needsH&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display=\"block\",d.gutterFiller.style.height=scrollbarWidth(d.measure)+\"px\",d.gutterFiller.style.width=d.gutters.offsetWidth+\"px\"):d.gutterFiller.style.display=\"\",mac_geLion&&0===scrollbarWidth(d.measure)&&(d.scrollbarV.style.minWidth=d.scrollbarH.style.minHeight=mac_geMountainLion?\"18px\":\"12px\",d.scrollbarV.style.pointerEvents=d.scrollbarH.style.pointerEvents=\"none\")}", "title": "" }, { "docid": "f9e198cb95d30683f64f1223fc95a144", "score": "0.6943641", "text": "function initScrollBar() {\n if ( !settings.scrollBar ) return;\n\n // TODO: Holding down the mouse on the bar should \"rapidfire\", like holding down space\n scrollBar = $( \"<div>\" ).\n addClass( \"sp-scroll-bar\" ).\n on( \"mousedown\", function( e ) {\n var clickStep = Math.round( (e.offsetY || e.clientY) / scrollBar.height() * ( pathList.length - 1) );\n // Close in on the clicked part instead of jumping directly to it.\n // This mimics the default browser scroll bar behavior.\n if ( Math.abs(clickStep - step) > BIG_STEP_SIZE) {\n clickStep = step + ( 5 * STEP_SIZE * ( clickStep > step ? 1 : -1 ) );\n }\n scrollToStep(clickStep);\n\n e.preventDefault();\n return false;\n });\n\n scrollHandle = $( \"<div>\" ).\n addClass( \"sp-scroll-handle\" ).\n on({\n click: function( e ) {\n e.preventDefault();\n return false;\n },\n mousedown: function( e ) {\n if ( e.button !== 0 ) return;\n isDragging = true;\n e.preventDefault();\n return false;\n }\n });\n $( document ).on({\n mouseup: function( e ) { isDragging = false; },\n mousemove: function( e ) { if( isDragging ) dragScrollHandler( e ); }\n });\n\n $( \"body\" ).prepend( scrollBar.append( scrollHandle ) );\n\n }", "title": "" }, { "docid": "90612ade8eb70493df93187e07e5012e", "score": "0.68606365", "text": "function setupScrollbarsDOM(destroy) {\n if(!destroy) {\n _scrollbarHorizontalElement = FRAMEWORK(generateDiv(_classNameScrollbar + _strSpace + _classNameScrollbarHorizontal));\n _scrollbarHorizontalTrackElement = FRAMEWORK(generateDiv(_classNameScrollbarTrack));\n _scrollbarHorizontalHandleElement = FRAMEWORK(generateDiv(_classNameScrollbarHandle));\n _scrollbarVerticalElement = FRAMEWORK(generateDiv(_classNameScrollbar + _strSpace + _classNameScrollbarVertical));\n _scrollbarVerticalTrackElement = FRAMEWORK(generateDiv(_classNameScrollbarTrack));\n _scrollbarVerticalHandleElement = FRAMEWORK(generateDiv(_classNameScrollbarHandle));\n\n _scrollbarHorizontalElement.append(_scrollbarHorizontalTrackElement);\n _scrollbarHorizontalTrackElement.append(_scrollbarHorizontalHandleElement);\n _scrollbarVerticalElement.append(_scrollbarVerticalTrackElement);\n _scrollbarVerticalTrackElement.append(_scrollbarVerticalHandleElement);\n\n _paddingElement.after(_scrollbarVerticalElement);\n _paddingElement.after(_scrollbarHorizontalElement);\n }\n else {\n remove(_scrollbarHorizontalElement);\n remove(_scrollbarVerticalElement);\n }\n }", "title": "" }, { "docid": "4d6f7d4e1f985a67b137f42ba3e84256", "score": "0.6633398", "text": "_initScrolls () {\n if (typeof OverlayScrollbars !== 'undefined') {\n const tempScrolls = [];\n OverlayScrollbars(document.querySelectorAll('.scroll'), {\n scrollbars: { autoHide: 'leave', autoHideDelay: 600 },\n overflowBehavior: { x: 'hidden', y: 'scroll' },\n });\n OverlayScrollbars(document.querySelectorAll('.scroll-horizontal'), {\n scrollbars: { autoHide: 'leave', autoHideDelay: 600 },\n overflowBehavior: { x: 'scroll', y: 'hidden' },\n });\n OverlayScrollbars(document.querySelectorAll('.data-table-rows .table-container'), {\n overflowBehavior: { x: 'scroll', y: 'hidden' },\n });\n OverlayScrollbars(document.querySelectorAll('.scroll-track-visible'), { overflowBehavior: { x: 'hidden', y: 'scroll' } });\n OverlayScrollbars(document.querySelectorAll('.scroll-horizontal-track-visible'), {\n overflowBehavior: { x: 'scroll', y: 'hidden' },\n });\n document.querySelectorAll('.scroll-by-count').forEach((el) => {\n if (typeof ScrollbarByCount === 'undefined') {\n console.log('ScrollbarByCount is undefined!');\n return;\n }\n let scrollByCount = new ScrollbarByCount(el);\n });\n }\n }", "title": "" }, { "docid": "3ed722cb4d148d1a9606d90ee4e882bc", "score": "0.66208327", "text": "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "3ed722cb4d148d1a9606d90ee4e882bc", "score": "0.66208327", "text": "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "b0212a436b802cf7b1a2e9fa4e8e6d3d", "score": "0.6606008", "text": "function initScrollbars () {\r\n scrollarea = $('.scroll-area').not('.left-sidebar .scroll-area');\r\n addScroll(scrollarea, options.colors.gray_lighter, '6px', options.colors.gray_lighter, '5px', false);\r\n }", "title": "" }, { "docid": "d776d44153bc34ebc4d2291954eb2f29", "score": "0.64969254", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "title": "" }, { "docid": "58d8caa33adbfcee308e0c0d5ec8c1fe", "score": "0.64643276", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "title": "" }, { "docid": "3e3baa649422db129749483ca8be8d5d", "score": "0.64643276", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "807126035c0c444e8b84603853a8dfaa", "score": "0.64562166", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "title": "" }, { "docid": "64b6d490205b4586da25dd38de498848", "score": "0.64477384", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "dde5140adeac0738fd618b62bb6a7e0c", "score": "0.6400603", "text": "function setupScrollbarsDOM(destroy) {\n var selectOrGenerateScrollbarDOM = function(isHorizontal) {\n var scrollbarClassName = isHorizontal ? _classNameScrollbarHorizontal : _classNameScrollbarVertical;\n var scrollbar = selectOrGenerateDivByClass(_classNameScrollbar + _strSpace + scrollbarClassName, true);\n var track = selectOrGenerateDivByClass(_classNameScrollbarTrack, scrollbar);\n var handle = selectOrGenerateDivByClass(_classNameScrollbarHandle, scrollbar);\n\n if(!_domExists && !destroy) {\n scrollbar.append(track);\n track.append(handle);\n }\n \n return {\n _scrollbar: scrollbar,\n _track: track,\n _handle: handle\n };\n };\n function resetScrollbarDOM(isHorizontal) {\n var scrollbarVars = getScrollbarVars(isHorizontal);\n var scrollbar = scrollbarVars._scrollbar;\n var track = scrollbarVars._track;\n var handle = scrollbarVars._handle;\n \n if(_domExists && _initialized) {\n each([ scrollbar, track, handle ], function(i, elm) { \n removeClass(elm.removeAttr(LEXICON.s), _classNamesDynamicDestroy);\n });\n }\n else {\n remove(scrollbar || selectOrGenerateScrollbarDOM(isHorizontal)._scrollbar);\n }\n }\n var horizontalElements;\n var verticalElements;\n \n if(!destroy) {\n horizontalElements = selectOrGenerateScrollbarDOM(true);\n verticalElements = selectOrGenerateScrollbarDOM();\n \n _scrollbarHorizontalElement = horizontalElements._scrollbar;\n _scrollbarHorizontalTrackElement = horizontalElements._track;\n _scrollbarHorizontalHandleElement = horizontalElements._handle;\n _scrollbarVerticalElement = verticalElements._scrollbar;\n _scrollbarVerticalTrackElement = verticalElements._track;\n _scrollbarVerticalHandleElement = verticalElements._handle;\n\n if(!_domExists) {\n _paddingElement.after(_scrollbarVerticalElement);\n _paddingElement.after(_scrollbarHorizontalElement);\n }\n }\n else {\n resetScrollbarDOM(true);\n resetScrollbarDOM();\n }\n }", "title": "" }, { "docid": "f44ffd29eb14af18b836e18b6720f836", "score": "0.6381542", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + 'px';\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + 'px';\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth + 1;\n var needsV = scrollHeight > d.scroller.clientHeight + 1;\n if (needsV) {\n d.scrollbarV.style.display = 'block';\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + 'px' : '0';\n d.scrollbarV.firstChild.style.height = scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight + 'px';\n } else\n d.scrollbarV.style.display = '';\n if (needsH) {\n d.scrollbarH.style.display = 'block';\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + 'px' : '0';\n d.scrollbarH.firstChild.style.width = d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth + 'px';\n } else\n d.scrollbarH.style.display = '';\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = 'block';\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + 'px';\n } else\n d.scrollbarFiller.style.display = '';\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = 'block';\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + 'px';\n d.gutterFiller.style.width = d.gutters.offsetWidth + 'px';\n } else\n d.gutterFiller.style.display = '';\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? '18px' : '12px';\n }", "title": "" }, { "docid": "ffc12fe15e8a728dfb4b5b0e17b5f219", "score": "0.6357489", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "title": "" }, { "docid": "5e84d3ff4bc55f5598b3514bd5e5dae4", "score": "0.63558125", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "title": "" }, { "docid": "5e84d3ff4bc55f5598b3514bd5e5dae4", "score": "0.63558125", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "title": "" }, { "docid": "98c3d732de2cc3933817c570d384b683", "score": "0.6329359", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "title": "" }, { "docid": "98c3d732de2cc3933817c570d384b683", "score": "0.6329359", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.6307157", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.6307157", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.6307157", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.6307157", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "e9f8a2faf1eb8505ad32b02e23e5e90d", "score": "0.6307157", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "80cdb26b216a037f6e9be9f9688580cd", "score": "0.6300793", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else {\n d.scrollbarFiller.style.display = \"\";\n }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else {\n d.gutterFiller.style.display = \"\";\n }\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "8c104ebdbb19592fe6f1fe721a377c27", "score": "0.6289858", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "613e0ccf29b346385d6a8132ebb11c34", "score": "0.62865186", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "title": "" }, { "docid": "d3bcff63768f1f4eab00b83b595db9ad", "score": "0.6273602", "text": "_refreshLayout() {\n const that = this;\n const source = that._items;\n\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that._height = null;\n\n if (!that._scrollView) {\n that._scrollView = new JQX.Utilities.Scroll(that, that.$.horizontalScrollBar, that.$.verticalScrollBar);\n }\n\n that.$itemsContainer.removeClass('hscroll');\n that.$itemsContainer.removeClass('vscroll');\n\n if (!source || source === null || source.length === 0) {\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n that.$filterInputContainer.removeClass('vscroll');\n that.$placeholder.removeClass('jqx-hidden');\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n that.$placeholder.addClass('jqx-hidden');\n\n const horizontalOffset = 2 * (parseInt(getComputedStyle(that.$.itemsInnerContainer).getPropertyValue('--jqx-list-item-horizontal-offset')) || 0);\n\n let hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n let vScrollHeight = that._scrollHeight;\n\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n that._refreshVerticalScrollBarVisibility(vScrollHeight);\n\n\n if (that.horizontalScrollBarVisibility === 'hidden') {\n that.$.itemsInnerContainer.style.width = that.$.itemsContainer.offsetWidth - horizontalOffset;\n }\n else {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth) + 'px';\n }\n\n if (that.computedVerticalScrollBarVisibility) {\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - that._scrollView.vScrollBar.offsetWidth;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.horizontalScrollBarVisibility !== 'hidden') {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth - that._scrollView.vScrollBar.offsetWidth) + 'px';\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n if (!(that.horizontalScrollBarVisibility === 'visible' && that.scrollWidth === 0)) {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n else if (that.horizontalScrollBarVisibility === 'visible') {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n\n that.scrollHeight = that.__scrollHeight;\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.computedHorizontalScrollBarVisibility) {\n that.scrollHeight = that._scrollHeight;\n that._refreshVerticalScrollBarVisibility(that.scrollHeight);\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n const isIE = /Trident|Edge/.test(navigator.userAgent);\n if (!that.isRefreshing && isIE) {\n setTimeout(function () {\n that.isRefreshing = true;\n that._refreshLayout();\n that.isRefreshing = false;\n }, 50);\n }\n }", "title": "" }, { "docid": "28ffc46a8f470c7dd28eb5633751b699", "score": "0.6269756", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else {\n d.scrollbarFiller.style.display = \"\";\n }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else {\n d.gutterFiller.style.display = \"\";\n }\n }", "title": "" }, { "docid": "4468444cd6ece0d061af5d62d5b456ee", "score": "0.6249815", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display\n\t var sizes = d.scrollbars.update(measure)\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\"\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n\t d.scrollbarFiller.style.width = sizes.right + \"px\"\n\t } else { d.scrollbarFiller.style.display = \"\" }\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\"\n\t d.gutterFiller.style.height = sizes.bottom + \"px\"\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n\t } else { d.gutterFiller.style.display = \"\" }\n\t}", "title": "" }, { "docid": "4468444cd6ece0d061af5d62d5b456ee", "score": "0.6249815", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display\n\t var sizes = d.scrollbars.update(measure)\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\"\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n\t d.scrollbarFiller.style.width = sizes.right + \"px\"\n\t } else { d.scrollbarFiller.style.display = \"\" }\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\"\n\t d.gutterFiller.style.height = sizes.bottom + \"px\"\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n\t } else { d.gutterFiller.style.display = \"\" }\n\t}", "title": "" }, { "docid": "bd4e160c65ce56416a36781e0d57c19a", "score": "0.6239062", "text": "function iuiScrollerLoaded()\n{\n//\tsetHeight();\n\tdocument.addEventListener('touchmove', function(e){ e.preventDefault(); });\n\tdocument.body.addEventListener('afterinsert', afterInsert, false);\n\t\n\tvar scrollDivs = document.querySelectorAll('.scroller');\n\tfor (var i=0; i<scrollDivs.length; i++)\n\t{\n\t\tvar scroller = new iScroll(scrollDivs[i])\n\t\tscrollDivs[i].scroller = scroller;\n\t\tscrollers.push(scroller);\n\t}\n\n\tnodes = document.querySelectorAll(\"body > *:not(.toolbar));\n\tfor (var i = 0; i < nodes.length ; i++)\n\t{\n\t\tnodes[i].addEventListener(\"aftertransition\", refreshScroller, false);\n\t}", "title": "" }, { "docid": "d2d923964ca5e0bacebc5b07028cf9d9", "score": "0.6226312", "text": "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else { d.gutterFiller.style.display = \"\"; }\n\t}", "title": "" }, { "docid": "35a493dca547e11a437d5a4581f425f5", "score": "0.6212844", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "title": "" }, { "docid": "11ab9d90edc9f39f4336a7036882e951", "score": "0.61884165", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display;\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n var needsV = scrollHeight > measure.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (scrollbarWidth(d.measure) === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "62e2a769207f731a25676b2c73b3b2f2", "score": "0.6186254", "text": "function updateScrollbarsInner(cm, measure) {\n let d = cm.display\n let sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else d.scrollbarFiller.style.display = \"\"\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else d.gutterFiller.style.display = \"\"\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "78a068d576a2c31c0cc080d19e0274a4", "score": "0.61797506", "text": "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "title": "" }, { "docid": "548b91b6fc922891f947388be17cd27a", "score": "0.6156518", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display;\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n var needsV = scrollHeight > measure.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n }", "title": "" }, { "docid": "dc8be5d62b5dacc66339944235d58589", "score": "0.6153851", "text": "function updateOtherDivsScroll(){\n columnOfSyllableCounts.scrollTop = editorArea.scrollTop;\n }", "title": "" }, { "docid": "2c6711c09c8babb6411709d487436a99", "score": "0.6093259", "text": "_refreshVerticalScrollBarVisibility( scrollHeight ) {\r\n const that = this;\r\n\r\n if ( that._autoHeight ) {\r\n that.scrollTop = 0;\r\n that.scrollHeight = 0;\r\n return;\r\n }\r\n\r\n if ( that.computedHorizontalScrollBarVisibility ) {\r\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\r\n }\r\n\r\n that.scrollHeight = scrollHeight;\r\n\r\n if ( that.paging.enabled && that.paging.spinner.visible ) {\r\n that.$.verticalScrollBarVisibility.classList.remove( 'lw-hidden' );\r\n }\r\n\r\n if ( !that.computedVerticalScrollBarVisibility ) {\r\n that.scrollTop = 0;\r\n }\r\n }", "title": "" }, { "docid": "082c63e20d3fefc90ae1d27b6cdab370", "score": "0.6038838", "text": "function _initScrollVars()\n {\n var elem_body_obj = $('body');\n wizmo.store(\"var_viewport_scroll_t\", elem_body_obj.scrollTop());\n wizmo.store(\"var_viewport_scroll_l\", elem_body_obj.scrollLeft());\n }", "title": "" }, { "docid": "d8cf213bfd88ece7b450878da1b30908", "score": "0.60315764", "text": "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "title": "" }, { "docid": "b09fb3769d0f64eda056f312236a45c1", "score": "0.6003426", "text": "function customScrollInit(){\n\t/*main navigation*/\n\tif($('.panel-frame').length){\n\t\t$('.panel-frame, .drop-visible__holder').mCustomScrollbar({\n\t\t\t//axis:\"x\",\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*main navigation end*/\n\n\t/*produce thumbs*/\n\t/*var $produceThumbs = $(\".produce-thumbs\");\n\tif($produceThumbs.length){\n\t\t$produceThumbs.mCustomScrollbar({\n\t\t\taxis:\"x\",\n\t\t\t//theme:\"dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\t//autoExpandScrollbar:true,\n\t\t\tadvanced:{autoExpandHorizontalScroll:true},\n\t\t\tsnapAmount:156,\n\t\t\tkeyboard:{scrollAmount:156},\n\t\t\tmouseWheel:{ deltaFactor:156},\n\t\t\tscrollInertia:400\n\t\t});\n\t}*/\n\t/*produce thumbs end*/\n\n\t/*products thumbs*/\n\tvar $prodThumbs = $(\".prod-thumbs\");\n\tif($prodThumbs.length){\n\t\t$prodThumbs.mCustomScrollbar({\n\t\t\taxis:\"x\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tadvanced:{autoExpandHorizontalScroll:true},\n\t\t\tmouseWheel:{\n\t\t\t\tenable: false\n\t\t\t},\n\t\t\tscrollInertia:500\n\t\t});\n\t}\n\t/*products thumbs end*/\n\n\t/*produce minimal*/\n\tvar $produceMinimal = $(\".produce-minimal\");\n\tif($produceMinimal.length){\n\t\t$produceMinimal.mCustomScrollbar({\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*produce minimal end*/\n\n\t/*produce full*/\n\tvar $produceFull = $('.location-info__holder, .produce-full-holder');\n\tif($produceFull.length){\n\t\t$produceFull.mCustomScrollbar({\n\t\t\t//axis:\"x\",\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true,\n\t\t\tcallbacks:{\n\t\t\t\tonInit:function(){\n\t\t\t\t\tconsole.log(\"Scrollbars initialized\", $(this));\n\t\t\t\t\t$(this).addClass('scrollbar-style-alt');\n\t\t\t\t}\n\t\t\t}\n\t\t\t//advanced:{autoExpandHorizontalScroll:true}\n\t\t});\n\t}\n\t/*produce full end*/\n\n\t/*product custom scroll*/\n\tvar $productMenu = $('.product-box__menu');\n\tif($productMenu.length){\n\t\t$productMenu.mCustomScrollbar({\n\t\t\ttheme:\"minimal-dark\",\n\t\t\tscrollbarPosition: \"inside\",\n\t\t\tautoExpandScrollbar:true\n\t\t});\n\t}\n\t/*product custom scroll end*/\n}", "title": "" }, { "docid": "9b559beabfe7fac9c22b3310d7d3c0d4", "score": "0.6003127", "text": "function nice_scrollbar() {\n \n jQuery(\".content-scroll\").niceScroll({cursorborder:\"\", cursorcolor:\"#A4A4A4\", boxzoom:false, cursoropacitymin:0.2, cursoropacitymax:0.8,background:\"#F6F6F6\"}); // First scrollable DIV\n }", "title": "" }, { "docid": "73b27b9e189a4845d67e4001f487fbed", "score": "0.5920282", "text": "function updateProgressBars() {\n var windowScroll = window.pageYOffset;\n var windowBottom = windowScroll + windowHeight;\n\n if (windowBottom >= sectionTop && !loaded) {\n progressBar1.style.width = '90%';\n progressBar2.style.width = '90%';\n progressBar3.style.width = '95%';\n progressBar4.style.width = '90%';\n progressBar5.style.width = '95%';\n progressBar6.style.width = '90%';\n progressBar7.style.width = '95%';\n progressBar8.style.width = '95%';\n progressBar9.style.width = '90%';\n progressBar10.style.width = '90%';\n progressBar11.style.width = '90%';\n\n loaded = true; // Set the flag to true once the progress bars are loaded\n }\n }", "title": "" }, { "docid": "f6412534a1621ed9d648b37a9b4b4fff", "score": "0.58622295", "text": "function updateProgressBars() {\n var windowScroll = window.pageYOffset;\n var windowBottom = windowScroll + windowHeight;\n\n if (windowBottom >= sectionTop && !loaded) {\n progressTechBar1.style.width = '90%';\n progressTechBar2.style.width = '50%';\n progressTechBar3.style.width = '40%';\n progressTechBar4.style.width = '50%';\n progressTechBar5.style.width = '90%';\n progressTechBar6.style.width = '80%';\n progressTechBar7.style.width = '80%';\n progressTechBar8.style.width = '80%';\n progressTechBar9.style.width = '90%';\n progressTechBar10.style.width = '70%';\n\n loaded = true; // Set the flag to true once the progress bars are loaded\n }\n }", "title": "" }, { "docid": "2ac66e58bad66186b211f2f54a41aae9", "score": "0.5850177", "text": "function mCustomScrollbars() {\n\t\t$(\"#mcs_container_left\").mCustomScrollbar(\"vertical\", 0, \"easeOutCirc\",\n\t\t\t\t0, \"auto\", \"yes\", \"yes\", 0);\n\t}", "title": "" }, { "docid": "c900d5ce793f3506dc48c18a6c0705f9", "score": "0.5849901", "text": "function initOverlayScrollbarsStatics() {\n if(!_pluginsGlobals)\n _pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults);\n if(!_pluginsAutoUpdateLoop)\n _pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);\n }", "title": "" }, { "docid": "c900d5ce793f3506dc48c18a6c0705f9", "score": "0.5849901", "text": "function initOverlayScrollbarsStatics() {\n if(!_pluginsGlobals)\n _pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults);\n if(!_pluginsAutoUpdateLoop)\n _pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);\n }", "title": "" }, { "docid": "792aea22b389b61e4614c676172148d3", "score": "0.58291245", "text": "_refreshLayout() {\r\n const that = this;\r\n const source = that.rows;\r\n\r\n if ( that._layoutSuspended ) {\r\n return;\r\n }\r\n\r\n that._visibleRows = null;\r\n that.__viewRows = null;\r\n that.__clientSize = null;\r\n that.__scrollHeight = null;\r\n that.__scrollWidth = null;\r\n that.__parentCells = null;\r\n\r\n that.$.columnFarContainer.classList.remove( 'vscroll' );\r\n that.$.columnNearContainer.classList.remove( 'vscroll' );\r\n\r\n that.$.scrollView.classList.remove( 'hscroll' );\r\n that.$.scrollView.classList.remove( 'vscroll' );\r\n\r\n that._refreshElementsVisibility();\r\n that._refreshColumnHeights();\r\n that._refreshContentHeight();\r\n\r\n if ( !( source && source.url ) ) {\r\n if ( !source || source === null || source.length === 0 || that.columns.length === 0 ) {\r\n const scrollViewTop = that.$.scrollView.offsetTop > 0 ? that.$.scrollView.offsetTop / 2 : 0;\r\n\r\n that.$.placeholder.classList.remove( 'lw-hidden' );\r\n that.$.placeholder.style.marginTop = scrollViewTop + 'px';\r\n\r\n that.scrollWidth = 0;\r\n that.scrollHeight = 0;\r\n\r\n return;\r\n }\r\n }\r\n\r\n if ( !that.__columnHeaderHeight ) {\r\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\r\n }\r\n\r\n if ( !that.__filterFooterOffsetHeight ) {\r\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains( 'lw-hidden' ) ? 0 : that.$.filterFooter.offsetHeight;\r\n }\r\n\r\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\r\n\r\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\r\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\r\n\r\n\r\n if ( that.paging.spinner.enabled && that.paging.enabled ) {\r\n if ( !that.pageScroll ) {\r\n const pageScroll = document.createElement( 'lw-scroll-bar' );\r\n\r\n pageScroll.orientation = 'vertical';\r\n pageScroll.style.height = '100%';\r\n pageScroll.style.width = '100%';\r\n pageScroll.max = Math.ceil( that.dataSource.length / that.paging.pageSize );\r\n pageScroll.step = that.paging.spinner.step;\r\n pageScroll.largeStep = that.paging.spinner.step;\r\n pageScroll.setAttribute( 'spinner', '' );\r\n pageScroll.setAttribute( 'lw-id', 'spinner' );\r\n pageScroll.ownerElement = that;\r\n\r\n that.addPropertyBinding( '[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader );\r\n\r\n pageScroll.addEventListener( 'change', function ( event ) {\r\n that.paging.pageIndex = event.detail.value;\r\n } );\r\n\r\n that.pageScroll = pageScroll;\r\n }\r\n\r\n that.htmlColumnLastChild.appendChild( that.pageScroll );\r\n }\r\n else {\r\n that.htmlColumnLastChild.innerHTML = '';\r\n }\r\n\r\n that._refreshScrollBars();\r\n\r\n }", "title": "" }, { "docid": "ceeb7847c97da34b627683b5e0e91b57", "score": "0.58157927", "text": "setScrollBarStatus() {\n const tableContainerRef = this.$refs[this.tableContainerRef];\n if (tableContainerRef) {\n const { scrollWidth, clientWidth, scrollHeight, clientHeight } =\n tableContainerRef;\n\n if (scrollWidth && clientWidth) {\n this.hasXScrollBar =\n scrollWidth - clientWidth ? true : false;\n }\n\n if (scrollHeight && clientHeight) {\n this.hasYScrollBar =\n scrollHeight - clientHeight ? true : false;\n }\n }\n }", "title": "" }, { "docid": "87c1862ea94d49e44a1853b7c3e0dcc2", "score": "0.57596034", "text": "updateBranchesContainerScroll() {\n const container = this._refBranchesContainer;\n\n if (container) {\n container.scrollLeft = container.scrollWidth - container.clientWidth;\n }\n }", "title": "" }, { "docid": "a2705f8d9f2ca361fffc2b55c2b65771", "score": "0.5753098", "text": "setScroll(){\n //mozilla firefox scroll hack\n //on a up to date version document.documentElement.style[\"scrollbar-width\"] is a string (so CSS is working)\n if (/firefox/i.test(navigator.userAgent) ? document.documentElement.style[\"scrollbar-width\"] === undef : false) {\n\n //small css trick to get the scrollbar width (must be 17px but cannot be sure)\n if (typeof gmDialog.scrollbarSize !== n) {\n let\n scrollable = doc.createElement('div'),\n contents = doc.createElement('div'),\n scrollablestyle, contentsstyle;\n\n scrollable.appendChild(contents);\n scrollablestyle = contentsstyle = \"width: 100%;padding:0;margin:0;display:block;overflow: unset;height:auto;\";\n scrollablestyle += \"overflow-y: scroll;opacity:0;z-index:-1;\";\n contentsstyle += \"height: 1px;\";\n scrollable.style = scrollablestyle;\n contents.style = contentsstyle;\n doc.body.appendChild(scrollable);\n gmDialog.scrollbarSize = scrollable.offsetWidth - contents.offsetWidth;\n doc.body.removeChild(scrollable);\n\n }\n let\n body = this.elements.body,\n scrollbarSize = gmDialog.scrollbarSize;\n\n if (scrollbarSize > 0) {\n body.style[\"margin-right\"] = `-${ 50 + scrollbarSize }px`; //adds the scrollbar size\n body.style[\"padding-right\"] = \"50px\"; // do not add the scrollbar size to prevent layout gap\n }\n\n }\n }", "title": "" }, { "docid": "7fd8a90ec26c949e71b0b6e9f16b9cab", "score": "0.5752591", "text": "function CustomHTMLScroll( content )\n {\n var scroll = {};\n\n var scrollPane = null;\n var scrollBar = null;\n\n var viewportHeight = 0;\n var scrollPaneHeight = 0;\n var scrollBarHeight = 0;\n\n var scrollTopMax = 0;\n var scrollBarMargins = 4;\n\n var startY = 0;\n var scrollSpeed = 30;\n var scrolling = false;\n\n scroll.setup = setup;\n scroll.refresh = refresh;\n $(window).resize(refresh);\n\n function setup()\n {\n scrollPane = content.parentNode;\n content.style.overflowY = \"hidden\";\n\n calculateProperties();\n\n setupScrollBar();\n setupScrollEvents();\n }\n function refresh()\n {\n calculateProperties();\n refreshScrollBar();\n adjustScrollBarToContent();\n }\n\n function calculateProperties()\n {\n viewportHeight = content.offsetHeight;\n scrollPaneHeight = scrollPane.offsetHeight;\n scrollTopMax = content.scrollHeight - viewportHeight;\n scrollBarHeight = calculateScrollbarHeight();\n }\n\n function calculateScrollbarHeight()\n {\n if(viewportHeight === content.scrollHeight) return 0;\n\n var perunage = viewportHeight / content.scrollHeight;\n\n return viewportHeight * perunage - scrollBarMargins * 2;\n }\n\n function setupScrollBar()\n {\n scrollBar = addElement( scrollPane, \"div\" );\n scrollBar.className = \"scrollBar\";\n scrollBar.style.position=\"absolute\";\n\n refreshScrollBar();\n }\n function refreshScrollBar()\n {\n scrollBar.style.left = content.offsetWidth - scrollBar.offsetWidth - scrollBarMargins + \"px\";\n scrollBar.style.top = scrollBarMargins + \"px\";\n scrollBar.style.height = scrollBarHeight + \"px\";\n scrollBar.style.opacity = 0;\n }\n\n function setupScrollEvents()\n {\n scrollPane.addEventListener( \"mouseover\", onShowScrollBar );\n scrollPane.addEventListener( \"mouseout\", onHideScrollBar );\n scrollPane.addEventListener( \"wheel\", onWheel );\n content.addEventListener( \"touchstart\", onTouchStart );\n content.addEventListener( \"touchmove\", onTouchMove );\n content.addEventListener( \"touchend\", onTouchEnd );\n scrollBar.addEventListener( \"mousedown\", onStartDrag );\n }\n\n function onShowScrollBar()\n {\n refresh();\n scrollBar.style.opacity = 1;\n }\n\n function onHideScrollBar()\n {\n if( !scrolling )\n scrollBar.style.opacity = 0;\n }\n\n function onWheel( e )\n {\n var delta = e.deltaY > 0 ? scrollSpeed : -scrollSpeed;\n content.scrollTop += delta;\n\n adjustScrollBarToContent();\n\n e.preventDefault();\n }\n\n function adjustScrollBarToContent()\n {\n var height = content.scrollHeight - viewportHeight;\n var perunage = content.scrollTop / height;\n var top = scrollBarMargins + ( scrollPaneHeight - scrollBarMargins * 3 - scrollBarHeight ) * perunage;\n\n scrollBar.style.top = top + \"px\";\n }\n\n function onTouchStart( e )\n {\n var touch = e.changedTouches[0];\n startY = parseFloat( touch.clientY );\n\n onShowScrollBar();\n\n e.preventDefault();\n }\n\n function onTouchMove( e )\n {\n var touch = e.changedTouches[0];\n\n content.scrollTop -= parseFloat( touch.clientY ) - startY;\n startY = parseFloat( touch.clientY );\n\n adjustScrollBarToContent();\n\n e.preventDefault();\n }\n\n function onTouchEnd( e )\n {\n onHideScrollBar();\n }\n\n function onStartDrag( e )\n {\n startY = e.clientY;\n\n setNodeSelectable( content, false );\n\n document.addEventListener( \"mousemove\", onDrag );\n document.addEventListener( \"mouseup\", onStopDrag );\n\n //prevents text selection\n e.preventDefault();\n }\n\n function onDrag( e )\n {\n scrolling = true;\n\n var top = parseFloat( scrollBar.style.top ) + e.clientY - startY;\n\n top = Math.max( top, scrollBarMargins );\n top = Math.min( top, scrollPaneHeight - scrollBarHeight - scrollBarMargins * 2 );\n\n scrollBar.style.top = top + \"px\";\n startY = e.clientY;\n\n adjustContentToScollBar();\n }\n\n function onStopDrag( e )\n {\n scrolling = false;\n\n setNodeSelectable( content, true );\n\n document.removeEventListener( \"mousemove\", onDrag );\n document.removeEventListener( \"mouseup\", onStopDrag );\n }\n\n function getPropertiesAreValid()\n {\n if( scrollPaneHeight < contentHeight )\n return true;\n else\n return false;\n }\n\n function adjustContentToScollBar()\n {\n var perunage = parseFloat( scrollBar.style.top ) / ( scrollPaneHeight - scrollBarHeight - scrollBarMargins * 2 );\n\n var top = perunage * scrollTopMax;\n\n content.scrollTop = top;\n }\n\n function addElement( parent, element )\n {\n var child = document.createElement( element );\n\n parent.appendChild( child );\n\n return child;\n }\n\n function setNodeSelectable( node, value )\n {\n if( node.nodeType != 1 )\n return;\n\n if( value )\n node.removeAttribute(\"unselectable\");\n else\n node.setAttribute(\"unselectable\", \"on\");\n\n var children = node.childNodes;\n\n for( var i = 0; i < children.length; i++ )\n setNodeSelectable( children[i], value );\n }\n\n\n return scroll;\n }", "title": "" }, { "docid": "f7b569f4ca4d0c821c0e3762365636ba", "score": "0.5739423", "text": "function init(){\n document.body.style.height = `${scrollable.getBoundingClientRect().height}px`;\n}", "title": "" }, { "docid": "1bd68c0c227d356de6794795924231c7", "score": "0.5738029", "text": "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "title": "" }, { "docid": "1bd68c0c227d356de6794795924231c7", "score": "0.5738029", "text": "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "title": "" }, { "docid": "1bd68c0c227d356de6794795924231c7", "score": "0.5738029", "text": "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "title": "" }, { "docid": "1bd68c0c227d356de6794795924231c7", "score": "0.5738029", "text": "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "title": "" }, { "docid": "1bd68c0c227d356de6794795924231c7", "score": "0.5738029", "text": "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "title": "" }, { "docid": "8a365b68f954857af688df2e20930fbb", "score": "0.57374656", "text": "function setupScrollbarEvents(isHorizontal) {\n var scrollbarVars = getScrollbarVars(isHorizontal);\n var scrollbarVarsInfo = scrollbarVars._info;\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var xy = scrollbarVars._x_y;\n var XY = scrollbarVars._X_Y;\n var scroll = _strScroll + scrollbarVars._Left_Top;\n var strActive = 'active';\n var strSnapHandle = 'snapHandle';\n var scrollDurationFactor = 1;\n var increaseDecreaseScrollAmountKeyCodes = [ 16, 17 ]; //shift, ctrl\n var trackTimeout;\n var mouseDownScroll;\n var mouseDownOffset;\n var mouseDownInvertedScale;\n \n function getPointerPosition(event) {\n return _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.\n }\n function getPreparedScrollbarsOption(name) {\n return _currentPreparedOptions.scrollbars[name];\n }\n function increaseTrackScrollAmount() {\n scrollDurationFactor = 0.5;\n }\n function decreaseTrackScrollAmount() {\n scrollDurationFactor = 1;\n }\n function documentKeyDown(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n increaseTrackScrollAmount();\n }\n function documentKeyUp(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n decreaseTrackScrollAmount();\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !getPreparedScrollbarsOption('touchSupport')) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function documentDragMove(event) {\n if(onMouseTouchDownContinue(event)) {\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var scrollRaw = (getPointerPosition(event) - mouseDownOffset) * mouseDownInvertedScale;\n var scrollDeltaPercent = scrollRaw / (trackLength - handleLength);\n var scrollDelta = (scrollRange * scrollDeltaPercent);\n scrollDelta = isFinite(scrollDelta) ? scrollDelta : 0;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)\n scrollDelta *= -1;\n\n _viewportElement[scroll](MATH.round(mouseDownScroll + scrollDelta));\n\n if(_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, mouseDownScroll + scrollDelta);\n\n if (!_supportPassiveEvents)\n COMPATIBILITY.prvD(event);\n }\n else\n documentMouseTouchUp(event);\n }\n function documentMouseTouchUp(event) {\n event = event || event.originalEvent;\n\n setupResponsiveEventListener(_documentElement,\n [ _strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent ],\n [ documentDragMove, documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart ],\n true);\n\n if(_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, true);\n\n _scrollbarsHandlesDefineScrollPos = false;\n removeClass(_bodyElement, _classNameDragging);\n removeClass(scrollbarVars._handle, strActive);\n removeClass(scrollbarVars._track, strActive);\n removeClass(scrollbarVars._scrollbar, strActive);\n\n mouseDownScroll = undefined;\n mouseDownOffset = undefined;\n mouseDownInvertedScale = 1;\n\n decreaseTrackScrollAmount();\n\n if (trackTimeout !== undefined) {\n _base.scrollStop();\n clearTimeout(trackTimeout);\n trackTimeout = undefined;\n }\n\n if(event) {\n var rect = _hostElementNative[LEXICON.bCR]();\n var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;\n\n //if mouse is outside host element\n if (!mouseInsideHost)\n hostOnMouseLeave();\n\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n }\n function onHandleMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event))\n onHandleMouseTouchDownAction(event);\n }\n function onHandleMouseTouchDownAction(event) {\n mouseDownScroll = _viewportElement[scroll]();\n mouseDownScroll = isNaN(mouseDownScroll) ? 0 : mouseDownScroll;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.n || !_isRTL)\n mouseDownScroll = mouseDownScroll < 0 ? 0 : mouseDownScroll;\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = getPointerPosition(event);\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._handle, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [ _strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strSelectStartEvent ],\n [ documentDragMove, documentMouseTouchUp, documentOnSelectStart ]);\n\n if(_msieVersion || !_documentMixed)\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n function onTrackMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event)) {\n var scrollDistance = MATH.round(_viewportSize[scrollbarVars._w_h]);\n var trackOffset = scrollbarVars._track.offset()[scrollbarVars._left_top];\n var ctrlKey = event.ctrlKey;\n var instantScroll = event.shiftKey;\n var instantScrollTransition = instantScroll && ctrlKey;\n var isFirstIteration = true;\n var easing = 'linear';\n var decreaseScroll;\n var finishedCondition;\n var scrollActionFinsished = function(transition) {\n if(_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, transition);\n };\n var scrollActionInstantFinished = function() {\n scrollActionFinsished();\n onHandleMouseTouchDownAction(event);\n };\n var scrollAction = function () {\n if(!_destroyed) {\n var mouseOffset = (mouseDownOffset - trackOffset) * mouseDownInvertedScale;\n var handleOffset = scrollbarVarsInfo._handleOffset;\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var currScroll = scrollbarVarsInfo._currentScroll;\n var scrollDuration = 270 * scrollDurationFactor;\n var timeoutDelay = isFirstIteration ? MATH.max(400, scrollDuration) : scrollDuration;\n var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent\n var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache);\n var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset;\n var scrollObj = { };\n var animationObj = {\n easing : easing,\n step : function(now) {\n if(_scrollbarsHandlesDefineScrollPos) {\n _viewportElement[scroll](now); //https://github.com/jquery/jquery/issues/4340\n refreshScrollbarHandleOffset(isHorizontal, now);\n }\n }\n };\n instantScrollPosition = isFinite(instantScrollPosition) ? instantScrollPosition : 0;\n instantScrollPosition = _isRTL && isHorizontal && !_rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n\n //_base.scrollStop();\n\n if(instantScroll) {\n _viewportElement[scroll](instantScrollPosition); //scroll instantly to new position\n if(instantScrollTransition) {\n //get the scroll position after instant scroll (in case CSS Snap Points are used) to get the correct snapped scroll position\n //and the animation stops at the correct point\n instantScrollPosition = _viewportElement[scroll]();\n //scroll back to the position before instant scrolling so animation can be performed\n _viewportElement[scroll](currScroll);\n\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.n ? -instantScrollPosition : instantScrollPosition;\n\n scrollObj[xy] = instantScrollPosition;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration : 130,\n complete : scrollActionInstantFinished\n }));\n }\n else\n scrollActionInstantFinished();\n }\n else {\n decreaseScroll = isFirstIteration ? decreaseScrollCondition : decreaseScroll;\n finishedCondition = rtlIsNormal\n ? (decreaseScroll ? handleOffset + handleLength >= mouseOffset : handleOffset <= mouseOffset)\n : (decreaseScroll ? handleOffset <= mouseOffset : handleOffset + handleLength >= mouseOffset);\n\n if (finishedCondition) {\n clearTimeout(trackTimeout);\n _base.scrollStop();\n trackTimeout = undefined;\n scrollActionFinsished(true);\n }\n else {\n trackTimeout = setTimeout(scrollAction, timeoutDelay);\n\n scrollObj[xy] = (decreaseScroll ? '-=' : '+=') + scrollDistance;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: scrollDuration\n }));\n }\n isFirstIteration = false;\n }\n }\n };\n if (ctrlKey)\n increaseTrackScrollAmount();\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = COMPATIBILITY.page(event)[xy];\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._track, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [ _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent ],\n [ documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart ]);\n\n scrollAction();\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n }\n function onTrackMouseTouchEnter(event) {\n //make sure both scrollbars will stay visible if one scrollbar is hovered if autoHide is \"scroll\" or \"move\".\n _scrollbarsHandleHovered = true;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(true);\n }\n function onTrackMouseTouchLeave(event) {\n _scrollbarsHandleHovered = false;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n function onScrollbarMouseTouchDown(event) {\n COMPATIBILITY.stpP(event);\n }\n \n addDestroyEventListener(scrollbarVars._handle, \n _strMouseTouchDownEvent, \n onHandleMouseTouchDown);\n addDestroyEventListener(scrollbarVars._track,\n [_strMouseTouchDownEvent, _strMouseTouchEnter, _strMouseTouchLeave], \n [onTrackMouseTouchDown, onTrackMouseTouchEnter, onTrackMouseTouchLeave]);\n addDestroyEventListener(scrollbarVars._scrollbar, \n _strMouseTouchDownEvent, \n onScrollbarMouseTouchDown);\n\n if (_supportTransition) {\n addDestroyEventListener(scrollbarVars._scrollbar, _strTransitionEndEvent, function(event) {\n if (event.target !== scrollbarVars._scrollbar[0])\n return;\n refreshScrollbarHandleLength(isHorizontal);\n refreshScrollbarHandleOffset(isHorizontal);\n });\n }\n }", "title": "" }, { "docid": "3497f4e06215448a6dbeca0ad8ee494b", "score": "0.57298875", "text": "function setupScrollbarEvents(isHorizontal) {\n var scrollbarVars = getScrollbarVars(isHorizontal);\n var scrollbarVarsInfo = scrollbarVars._info;\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var xy = scrollbarVars._x_y;\n var XY = scrollbarVars._X_Y;\n var scroll = _strScroll + scrollbarVars._Left_Top;\n var strActive = 'active';\n var strSnapHandle = 'snapHandle';\n var scrollDurationFactor = 1;\n var increaseDecreaseScrollAmountKeyCodes = [ 16, 17 ]; //shift, ctrl\n var trackTimeout;\n var mouseDownScroll;\n var mouseDownOffset;\n var mouseDownInvertedScale;\n\n function getPointerPosition(event) {\n return _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.\n }\n function getPreparedScrollbarsOption(name) {\n return _currentPreparedOptions.scrollbars[name];\n }\n function increaseTrackScrollAmount() {\n scrollDurationFactor = 0.5;\n }\n function decreaseTrackScrollAmount() {\n scrollDurationFactor = 1;\n }\n function documentKeyDown(event) {\n if (FRAMEWORK.inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n increaseTrackScrollAmount();\n }\n function documentKeyUp(event) {\n if (FRAMEWORK.inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n decreaseTrackScrollAmount();\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _isSleeping || _destroyed || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !getPreparedScrollbarsOption('touchSupport')) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function documentDragMove(event) {\n if(onMouseTouchDownContinue(event)) {\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var scrollRaw = (getPointerPosition(event) - mouseDownOffset) * mouseDownInvertedScale;\n var scrollDeltaPercent = scrollRaw / (trackLength - handleLength);\n var scrollDelta = (scrollRange * scrollDeltaPercent);\n scrollDelta = isFinite(scrollDelta) ? scrollDelta : 0;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)\n scrollDelta *= -1;\n\n _viewportElement[scroll](MATH.round(mouseDownScroll + scrollDelta));\n\n if(_scrollbarsHandleAsync)\n refreshScrollbarHandleOffset(isHorizontal, mouseDownScroll + scrollDelta);\n\n if (!_supportPassiveEvents)\n COMPATIBILITY.prvD(event);\n }\n else\n documentMouseTouchUp(event);\n }\n function documentMouseTouchUp(event) {\n event = event || event.originalEvent;\n\n _documentElement.off(_strMouseTouchMoveEvent, documentDragMove)\n .off(_strMouseTouchUpEvent, documentMouseTouchUp)\n .off(_strKeyDownEvent, documentKeyDown)\n .off(_strKeyUpEvent, documentKeyUp)\n .off(_strSelectStartEvent, documentOnSelectStart);\n\n if(_scrollbarsHandleAsync)\n refreshScrollbarHandleOffset(isHorizontal, true);\n\n _scrollbarsHandleAsync = false;\n removeClass(_bodyElement, _classNameDragging);\n removeClass(scrollbarVars._handle, strActive);\n removeClass(scrollbarVars._track, strActive);\n removeClass(scrollbarVars._scrollbar, strActive);\n\n mouseDownScroll = undefined;\n mouseDownOffset = undefined;\n mouseDownInvertedScale = 1;\n\n decreaseTrackScrollAmount();\n\n if (trackTimeout !== undefined) {\n _base.scrollStop();\n clearTimeout(trackTimeout);\n trackTimeout = undefined;\n }\n\n if(event) {\n var rect = _hostElementNative.getBoundingClientRect();\n var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;\n\n //if mouse is outside host element\n if (!mouseInsideHost)\n hostOnMouseLeave();\n\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n }\n function onHandleMouseTouchDown(event) {\n mouseDownScroll = _viewportElement[scroll]();\n mouseDownScroll = isNaN(mouseDownScroll) ? 0 : mouseDownScroll;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.n || !_isRTL)\n mouseDownScroll = mouseDownScroll < 0 ? 0 : mouseDownScroll;\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = getPointerPosition(event);\n\n _scrollbarsHandleAsync = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._handle, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n _documentElement.on(_strMouseTouchMoveEvent, documentDragMove)\n .on(_strMouseTouchUpEvent, documentMouseTouchUp)\n .on(_strSelectStartEvent, documentOnSelectStart);\n\n if(_msieVersion || !_documentMixed)\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n scrollbarVars._handle.on(_strMouseTouchDownEvent, function(event) {\n if (onMouseTouchDownContinue(event))\n onHandleMouseTouchDown(event);\n });\n scrollbarVars._track.on(_strMouseTouchDownEvent, function(event) {\n if (onMouseTouchDownContinue(event)) {\n var scrollDistance = MATH.round(_viewportSize[scrollbarVars._w_h]);\n var trackOffset = scrollbarVars._track.offset()[scrollbarVars._left_top];\n var ctrlKey = event.ctrlKey;\n var instantScroll = event.shiftKey;\n var instantScrollTransition = instantScroll && ctrlKey;\n var isFirstIteration = true;\n var easing = 'linear';\n var decreaseScroll;\n var finishedCondition;\n var scrollActionFinsished = function(transition) {\n if(_scrollbarsHandleAsync)\n refreshScrollbarHandleOffset(isHorizontal, transition);\n };\n var scrollActionInstantFinished = function() {\n scrollActionFinsished();\n onHandleMouseTouchDown(event);\n };\n var scrollAction = function () {\n if(!_destroyed) {\n var mouseOffset = (mouseDownOffset - trackOffset) * mouseDownInvertedScale;\n var handleOffset = scrollbarVarsInfo._handleOffset;\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var currScroll = scrollbarVarsInfo._currentScroll;\n var scrollDuration = 270 * scrollDurationFactor;\n var timeoutDelay = isFirstIteration ? MATH.max(400, scrollDuration) : scrollDuration;\n var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent\n var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache);\n var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset;\n var scrollObj = { };\n var animationObj = {\n easing : easing,\n step : function(now) {\n if(_scrollbarsHandleAsync) {\n _viewportElement[scroll](now); //https://github.com/jquery/jquery/issues/4340\n refreshScrollbarHandleOffset(isHorizontal, now);\n }\n }\n };\n instantScrollPosition = isFinite(instantScrollPosition) ? instantScrollPosition : 0;\n instantScrollPosition = _isRTL && isHorizontal && !_rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n\n //_base.scrollStop();\n\n if(instantScroll) {\n _viewportElement[scroll](instantScrollPosition); //scroll instantly to new position\n if(instantScrollTransition) {\n //get the scroll position after instant scroll (in case CSS Snap Points are used) to get the correct snapped scroll position\n //and the animation stops at the correct point\n instantScrollPosition = _viewportElement[scroll]();\n //scroll back to the position before instant scrolling so animation can be performed\n _viewportElement[scroll](currScroll);\n\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.n ? -instantScrollPosition : instantScrollPosition;\n\n scrollObj[xy] = instantScrollPosition;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration : 130,\n complete : scrollActionInstantFinished\n }));\n }\n else\n scrollActionInstantFinished();\n }\n else {\n decreaseScroll = isFirstIteration ? decreaseScrollCondition : decreaseScroll;\n finishedCondition = rtlIsNormal\n ? (decreaseScroll ? handleOffset + handleLength >= mouseOffset : handleOffset <= mouseOffset)\n : (decreaseScroll ? handleOffset <= mouseOffset : handleOffset + handleLength >= mouseOffset);\n\n if (finishedCondition) {\n clearTimeout(trackTimeout);\n _base.scrollStop();\n trackTimeout = undefined;\n scrollActionFinsished(true);\n }\n else {\n trackTimeout = setTimeout(scrollAction, timeoutDelay);\n\n scrollObj[xy] = (decreaseScroll ? '-=' : '+=') + scrollDistance;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: scrollDuration\n }));\n }\n isFirstIteration = false;\n }\n }\n };\n if (ctrlKey)\n increaseTrackScrollAmount();\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = COMPATIBILITY.page(event)[xy];\n\n _scrollbarsHandleAsync = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._track, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n _documentElement.on(_strMouseTouchUpEvent, documentMouseTouchUp)\n .on(_strKeyDownEvent, documentKeyDown)\n .on(_strKeyUpEvent, documentKeyUp)\n .on(_strSelectStartEvent, documentOnSelectStart);\n\n scrollAction();\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n }).on(_strMouseTouchEnter, function() { //make sure both scrollbars will stay visible if one scrollbar is hovered if autoHide is \"scroll\" or \"move\".\n _scrollbarsHandleHovered = true;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(true);\n\n }).on(_strMouseTouchLeave, function() {\n _scrollbarsHandleHovered = false;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n });\n scrollbarVars._scrollbar.on(_strMouseTouchDownEvent, function(event) {\n COMPATIBILITY.stpP(event);\n });\n if (_supportTransition) {\n scrollbarVars._scrollbar.on(_strTransitionEndEvent, function(event) {\n if (event.target !== scrollbarVars._scrollbar[0])\n return;\n refreshScrollbarHandleLength(isHorizontal);\n refreshScrollbarHandleOffset(isHorizontal);\n });\n }\n }", "title": "" }, { "docid": "ca512fd55963719135ebce1c160e95aa", "score": "0.57238925", "text": "function updateProgressBars() {\n var windowScroll = window.pageYOffset;\n var windowBottom = windowScroll + windowHeight;\n\n if (windowBottom >= sectionTop && !loaded) {\n progressLangBar1.style.width = '90%';\n progressLangBar2.style.width = '90%';\n\n loaded = true; // Set the flag to true once the progress bars are loaded\n }\n }", "title": "" }, { "docid": "3791903c443908f5862edf8038df20dd", "score": "0.57176065", "text": "function custome_scroll_init() {\n\n if ($('div').hasClass('mCustomScrollbar')) {\n $('.mCustomScrollbar').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n scrollInertia: 150,\n autoDraggerLength: true,\n autoExpandScrollbar: true,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n scrollButtons: { enable: false },\n });\n }\n /***************** custom-scroll-horizontal ****************/\n if ($('div').hasClass('custom-scroll-horizontal')) {\n var dragger_height = $(window).outerHeight() * 0.5\n if (dragger_height < 200) {\n $(\".hori-accord-detail \").height(\"350\");\n $(\".connectedSortable\").css(\"min-height\", \"320\");\n }\n else {\n $(\".hori-accord-detail \").height(dragger_height);\n $(\".connectedSortable\").css(\"min-height\", dragger_height - 30);\n }\n\n $('.custom-scroll.hori-accord-detail').mCustomScrollbar(\"update\");\n\n }\n /***************** view board design js *****************/\n\n /**************** common scroll ********************/\n if ($('div').hasClass('custom-scroll')) {\n $('.custom-scroll').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n scrollInertia: 150,\n autoDraggerLength: true,\n autoExpandScrollbar: true,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n scrollButtons: { enable: false },\n callbacks: {\n whileScrolling: function () {\n dropdown_position();\n }\n }\n });\n }\n /****************** employee-status scroll**************/\n if ($(\"div\").hasClass(\"employee-status\")) {\n setTimeout(function () {\n $('.employee-status').mCustomScrollbar({\n scrollbarPosition: \"outside\",\n axis: \"x\",\n autoDraggerLength: true,\n autoExpandScrollbar: true,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n scrollButtons: { enable: false },\n });\n }, 600);\n\n }\n /****************** birthday scroll **************/\n if ($(\"div\").hasClass(\"birthday-wrap\")) {\n $('.birthday-wrap').css(\"max-height\", ($(\".birthday-bg\").height() - $(\".birthday-bg\").children(\".panel-heading\").height() + 10));\n $('.birthday-wrap').css(\"height\", ($(\".birthday-bg\").height() - $(\".birthday-bg\").children(\".panel-heading\").height() - 20));\n setTimeout(function () {\n $('.birthday-wrap').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n delay: 2000,\n scrollButtons: { enable: false },\n });\n }, 300)\n }\n /****************** joinee scroll ***************/\n if ($(\"div\").hasClass(\"joinee-wrap\")) {\n $('.joinee-wrap').css(\"max-height\", ($(\".joinee-bg\").height() - $(\".joinee-bg\").children(\".panel-heading\").height() + 10));\n $('.joinee-wrap').css(\"height\", ($(\".joinee-bg\").height() - $(\".joinee-bg\").children(\".panel-heading\").height() - 20));\n setTimeout(function () {\n $('.joinee-wrap').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n delay: 2000,\n scrollButtons: { enable: false },\n\n });\n }, 300)\n\n }\n /****************** dash-chart-wrap scroll **************/\n if ($(\"div\").hasClass(\"dash-chart-wrap\")) {\n $('.dash-chart-wrap').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n scrollButtons: { enable: false },\n });\n }\n /****************** dash-chart-wrap scroll **************/\n if ($(\"div\").hasClass(\"dash-chart-wrap-2\")) {\n $('.dash-chart-wrap-2').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n\n scrollButtons: { enable: false },\n\n });\n }\n /****************** dash-chart-wrap scroll **************/\n if ($(\"div\").hasClass(\"dash-chart-wrap-3\")) {\n $('.dash-chart-wrap-3').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"minimal-dark\",\n scrollButtons: { enable: false },\n });\n }\n\n /***************** KRA scroll **************/\n if ($(\"div\").hasClass(\"content-scroll\")) {\n $('.content-scroll').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"y\",\n autoDraggerLength: true,\n autoExpandScrollbar: false,\n alwaysShowScrollbar: 0,\n updateOnContentResize: true,\n theme: \"light\",\n scrollButtons: { enable: false },\n });\n }\n\n /****************** org-chart-sub node scroll ***********************/\n $('.org-chart-sub').mCustomScrollbar({\n scrollbarPosition: \"inside\",\n axis: \"x\",\n autoDraggerLength: true,\n autoExpandScrollbar: true,\n updateOnContentResize: true,\n scrollButtons: { enable: true }\n })\n setTimeout(function () {\n var full_scroll_drag = $('.org-chart-sub .mCSB_dragger').width();\n var full_scroll_drag_wrap = $('.org-chart-sub .mCSB_draggerRail').width();\n var offset_left = (full_scroll_drag_wrap - full_scroll_drag) / 2;\n var offset_left = (offset_left * 100) / full_scroll_drag_wrap;\n // alert(offset_left);\n $('.org-chart-sub').mCustomScrollbar('scrollTo', offset_left + '%');\n }, 600);\n\n}", "title": "" }, { "docid": "7898608db26b658d1c528bbb1daf8536", "score": "0.56926346", "text": "reinitialiseScrollbar() {\n\n // ensure scrollpane has been initialised\n if (this.$scope.pane === undefined) {\n return;\n }\n\n // update the scrollpane on next digest\n this.$timeout(this.$scope.pane.reinitialise, 0, false);\n }", "title": "" } ]
8907a365b9792541e96c3550bce3be6f
update options object with new options
[ { "docid": "e5743c9776efd4b892d11ada31dc47d3", "score": "0.8173664", "text": "updateOptions(newOptions) {\r\n\t\tthis.options = {...this.options, ...newOptions} ;\r\n\t}", "title": "" } ]
[ { "docid": "6ea8e5d34fc5ba2d3f8b306651b84f6f", "score": "0.77403027", "text": "setOptions (options) {\n\t\tthis.options = this._extendObject(this.options, options);\n\t\tthis.update();\n\t}", "title": "" }, { "docid": "831499c7153c15bd4fc632e18a5877c2", "score": "0.76250947", "text": "function updateOptions ( optionsToUpdate ) {\n\n\t\tvar newOptions = testOptions({\n\t\t\tstart: [0, 0],\n\t\t\tmargin: optionsToUpdate.margin,\n\t\t\tlimit: optionsToUpdate.limit,\n\t\t\tstep: optionsToUpdate.step,\n\t\t\trange: optionsToUpdate.range,\n\t\t\tanimate: optionsToUpdate.animate\n\t\t});\n\n\t\toptions.margin = newOptions.margin;\n\t\toptions.limit = newOptions.limit;\n\t\toptions.step = newOptions.step;\n\t\toptions.range = newOptions.range;\n\t\toptions.animate = newOptions.animate;\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\t}", "title": "" }, { "docid": "967beeb45fc6fa41b061030785b7201f", "score": "0.758365", "text": "updateOptions(opts) {\n this.chart.options = Object.assign(this.chart.options, opts);\n this.refresh();\n }", "title": "" }, { "docid": "2fdf5d484521f17e15504e5ae35ed49e", "score": "0.7341281", "text": "updateOptions(data) {\n this.options = data;\n this.remove();\n }", "title": "" }, { "docid": "3e92dca41246a34802b6807b836120f5", "score": "0.7309234", "text": "setOptions(options) {\n if (typeof options === 'object') {\n Object.keys(options)\n .forEach((key) => {\n if (Object.prototype.hasOwnProperty.call(key)) {\n this._options[key] = options[key];\n }\n });\n }\n }", "title": "" }, { "docid": "371c2eb25983bd3cce097a4fcc6908bb", "score": "0.71958405", "text": "setOptions( options )\n {\n for( let a in options )\n {\n this.options[ a ] = options[ a ];\n }\n }", "title": "" }, { "docid": "31f8fafe9f58be5312f2fce98e7c8b5b", "score": "0.70937425", "text": "setOptions(options) {\n this._options = options;\n }", "title": "" }, { "docid": "31f8fafe9f58be5312f2fce98e7c8b5b", "score": "0.70937425", "text": "setOptions(options) {\n this._options = options;\n }", "title": "" }, { "docid": "babe7ec353358156ae708acd07bdf475", "score": "0.7063821", "text": "set options(options) {\n this._options = options\n }", "title": "" }, { "docid": "2520e83f2f26df2f99bb17abb30b6c75", "score": "0.7061099", "text": "setOptions(options) {\n Object.assign(this.options, options || {});\n return this.options;\n }", "title": "" }, { "docid": "a1f911be3191afe5c3c509c3a4fc19e2", "score": "0.70479864", "text": "function updateThisOptionsObject() {\r\n if (arguments[0] && typeof arguments[0] === \"object\") {\r\n var args = arguments[0];\r\n for (var arg in arguments[0]) {\r\n if (args.hasOwnProperty(arg) && defaults.hasOwnProperty(arg)) {\r\n defaults[arg] = args[arg];\r\n }\r\n }\r\n }\r\n this.options = defaults;\r\n }", "title": "" }, { "docid": "7988d99b764b7a081a505db981f5132f", "score": "0.6990328", "text": "function updateOptions() {\n var optionsRequest = countriesFactory.getCountries();\n optionsRequest.success(function(data, status, headers, config) {\n //workaround 400\n if (typeof data.data === 'undefined'){\n scope.options = null;\n } else {\n scope.options = data.data;\n }\n });\n }", "title": "" }, { "docid": "0bc3e5f4ccbdec7741a2775867cea6d5", "score": "0.6989675", "text": "onOptionsChanged(options) {\n\t\tif (options) {\n\t\t\tthis.options_ = Object.assign(this.source, options);\n\t\t}\n\t}", "title": "" }, { "docid": "f59138039903f2bd0e76c710b28afc92", "score": "0.6988326", "text": "function _update_options() {\n\n var config = carousel_configs.find(position);\n carousel.carousel('option', config);\n }", "title": "" }, { "docid": "1bc3f44273b4a8214d68eb77ba70146b", "score": "0.69176555", "text": "function updateOptions(settings) {\n // Update the cached options by doing a shallow copy of key/values.\n // This is needed because options is passed and used in addCommands and needs\n // to reflect the current cached values.\n Object.keys(settings.composite).forEach((key) => {\n options[key] = settings.composite[key];\n });\n }", "title": "" }, { "docid": "a0ffa677f3908dd79339743b34cee81a", "score": "0.6841687", "text": "updateOptions(options) {\r\n for (const property of Object.keys(options)) {\r\n if (options.hasOwnProperty(property)) {\r\n this._odataOptions[property] = options[property]; // replace of the property\r\n }\r\n // we need to keep the defaultSortBy for references whenever the user removes his Sorting\r\n // then we would revert to the defaultSortBy and the only way is to keep a hard copy here\r\n if (property === 'orderBy' || property === 'sortBy') {\r\n let sortBy = options[property];\r\n // make sure first char of each orderBy field is capitalize\r\n if (this._odataOptions.caseType === CaseType.pascalCase) {\r\n if (Array.isArray(sortBy)) {\r\n sortBy.forEach((field, index, inputArray) => {\r\n inputArray[index] = String.titleCase(field);\r\n });\r\n }\r\n else {\r\n sortBy = String.titleCase(options[property]);\r\n }\r\n }\r\n this._odataOptions.orderBy = sortBy;\r\n this._defaultSortBy = sortBy;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "485460c33eb3b3717c00b7c107f93f80", "score": "0.67507565", "text": "function _setOptions(optionsObject, preventUpdate) {\n for (var p in optionsObject) {\n options[p] = optionsObject[p];\n }\n if (preventUpdate !== true) {\n setup();\n }\n }", "title": "" }, { "docid": "70f455a8fa5563c1f8d17a6443eae4b5", "score": "0.67251307", "text": "setOptions(changeObject){\n let optionsProperty = Object.keys(changeObject)[0];\n this.options[optionsProperty] = changeObject[optionsProperty];\n }", "title": "" }, { "docid": "5ca332ad08ec8bffc819ea1ee30339d1", "score": "0.6720403", "text": "setOptions(options) {\n const configOptions = new OwlCarouselOConfig();\n const checkedOptions = this._validateOptions(options, configOptions);\n this._options = Object.assign(Object.assign({}, configOptions), checkedOptions);\n }", "title": "" }, { "docid": "79dad76dc33f7bdf437fb8559bf31b00", "score": "0.66708314", "text": "setOptions(options) {\n if (typeof options !== 'object') return this;\n for (var property in options) this[property] = options[property];\n return this;\n }", "title": "" }, { "docid": "34a2a756991830dd9698d5efcfd2050f", "score": "0.65922076", "text": "setOptions(options) {\n if (options && typeof options.delay !== \"undefined\") {\n this.delay = options.delay;\n }\n if (options && typeof options.max !== \"undefined\") {\n this.max = options.max;\n }\n this._flushIfNeeded();\n }", "title": "" }, { "docid": "34a2a756991830dd9698d5efcfd2050f", "score": "0.65922076", "text": "setOptions(options) {\n if (options && typeof options.delay !== \"undefined\") {\n this.delay = options.delay;\n }\n if (options && typeof options.max !== \"undefined\") {\n this.max = options.max;\n }\n this._flushIfNeeded();\n }", "title": "" }, { "docid": "232da8b2ca03ed66ced35732559ad373", "score": "0.65793115", "text": "function setOptions(results)\n {\n var oldOptions = $.extend(options, {});\n options = $.extend(options, results);\n\n $.each(callbacks, function(index, callback) {\n if (typeof callback == 'function') {\n callback(options, oldOptions);\n }\n });\n }", "title": "" }, { "docid": "e244647dd7018276a4da5db286de32ff", "score": "0.65565944", "text": "function refactorOptions(options) {\n options = options || {};\n options.countries = options.countries || {};\n \n if (options.AddressCompleteCountryByIP) options.setCountryByIP = !!options.AddressCompleteCountryByIP;\n if (options.AddressCompleteDefaultLanguage) options.culture = options.AddressCompleteDefaultLanguage;\n if (options.AddressCompleteDefaultCountry) options.countries.defaultCode = options.AddressCompleteDefaultCountry;\n if (options.AddressCompleteCountryList) options.countries.codesList = options.AddressCompleteCountryList;\n\n //set defaults\n options.setCursor = true;\n options.prompt = true;\n options.promptDelay = 0;\n options.manualEntry = true;\n\n //allow overriding of options\n addresscomplete.fire(\"options\", options);\n\n return options;\n }", "title": "" }, { "docid": "a45bce20ce1f96f56fa026f093210b84", "score": "0.65448195", "text": "function updateOptions() {\n\tsearchSuggest();\n}", "title": "" }, { "docid": "2f9f244b2e7203d913f976d972f0c885", "score": "0.65365577", "text": "function updateOptions(id, new_options, include_race, include_tour)\n{\n options = document.getElementById(id).options;\n // clear existing options\n options.length=0;\n // load new options filtering for race/tour\n for(i=0; i< new_options.length; i++) {\n if((new_options[i][2] && include_tour) || (new_options[i][3] && include_race)) {\n options.add(new Option(new_options[i][1], new_options[i][0]));\n }\n }\n}", "title": "" }, { "docid": "5423e5ebce7a2899d488866a87020051", "score": "0.6502371", "text": "function updateOptions(args) {\n for (var prop in args) {\n for (var i = 0; i < argsMap.length; i++) {\n var item = argsMap[i];\n if (item.param === prop) {\n item.assign(args[prop]);\n }\n }\n }\n}", "title": "" }, { "docid": "02b7b076d8652666db4ecc146a1f21cf", "score": "0.6491841", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\"margin\", \"limit\", \"padding\", \"range\", \"animate\", \"snap\", \"step\", \"format\"];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "02b7b076d8652666db4ecc146a1f21cf", "score": "0.6491841", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\"margin\", \"limit\", \"padding\", \"range\", \"animate\", \"snap\", \"step\", \"format\"];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "fd5163494960711bede5754b93b31bdb", "score": "0.6490256", "text": "function applyNewOptions() {\n\tgameOptions = clonedGameOptionsForMainMenu;\n}", "title": "" }, { "docid": "b2c04e6f2129550ddf83d218eeda58aa", "score": "0.6475819", "text": "async function updateOptions() {\n const res = await getSwitches();\n // TODO: handle any errors that occur here\n setSwitchData(res);\n\n }", "title": "" }, { "docid": "b8a4192cf0aaca982791a8daea17783d", "score": "0.647519", "text": "update() {\n const series = this;\n series.options = merge(series.options, arguments[0]);\n super.update.apply(series, arguments);\n }", "title": "" }, { "docid": "dd6d43a56e2ce534783c69a0ad68ba98", "score": "0.6458761", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name){\n if ( optionsToUpdate[name] !== undefined ) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name){\n if ( optionsToUpdate[name] !== undefined ) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if ( options.pips ) {\n pips(options.pips);\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "929817ab52a9bab151459bba9cc39a1f", "score": "0.64384186", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\r\n // Spectrum is created using the range, snap, direction and step options.\r\n // 'snap' and 'step' can be updated.\r\n // If 'snap' and 'step' are not passed, they should remain unchanged.\r\n var v = valueGet();\r\n\r\n var updateAble = [\"margin\", \"limit\", \"padding\", \"range\", \"animate\", \"snap\", \"step\", \"format\"];\r\n\r\n // Only change options that we're actually passed to update.\r\n updateAble.forEach(function(name) {\r\n if (optionsToUpdate[name] !== undefined) {\r\n originalOptions[name] = optionsToUpdate[name];\r\n }\r\n });\r\n\r\n var newOptions = testOptions(originalOptions);\r\n\r\n // Load new options into the slider state\r\n updateAble.forEach(function(name) {\r\n if (optionsToUpdate[name] !== undefined) {\r\n options[name] = newOptions[name];\r\n }\r\n });\r\n\r\n scope_Spectrum = newOptions.spectrum;\r\n\r\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\r\n options.margin = newOptions.margin;\r\n options.limit = newOptions.limit;\r\n options.padding = newOptions.padding;\r\n\r\n // Update pips, removes existing.\r\n if (options.pips) {\r\n pips(options.pips);\r\n }\r\n\r\n // Invalidate the current positioning so valueSet forces an update.\r\n scope_Locations = [];\r\n valueSet(optionsToUpdate.start || v, fireSetEvent);\r\n }", "title": "" }, { "docid": "0aaf02980534307bc5974fcaf9124dd2", "score": "0.6435175", "text": "_setOptions() {\n this.set(\n \"options\",\n this._getPickerOptions(data, this.allowNull, this.icon)\n );\n }", "title": "" }, { "docid": "0aaf02980534307bc5974fcaf9124dd2", "score": "0.6435175", "text": "_setOptions() {\n this.set(\n \"options\",\n this._getPickerOptions(data, this.allowNull, this.icon)\n );\n }", "title": "" }, { "docid": "3a9f42212a3a387f7ba8145bd37f1ccc", "score": "0.6430339", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n // Only change options that we're actually passed to update.\n updateAble.forEach(function (name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n var newOptions = testOptions(originalOptions);\n // Load new options into the slider state\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n scope_Spectrum = newOptions.spectrum;\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n }\n else {\n removePips();\n }\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n }\n else {\n removeTooltips();\n }\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(isSet(optionsToUpdate.start) ? optionsToUpdate.start : v, fireSetEvent);\n }", "title": "" }, { "docid": "c46a394a5c293663a8ad3f919eca216f", "score": "0.64297366", "text": "async opt_optionsChanged(options, save) {\n this.options.firstflag = options.firstflag;\n\t\tthis.setFrontendOptions(options);\n\t\tif(save){\n\t\t\toptionsSave(this.options);\n\t\t}\n return this.options;\n }", "title": "" }, { "docid": "1a526b5bf3a0399cb42dcb43e1a2bff9", "score": "0.64253056", "text": "function _processOptions(options) {\n if (typeof (options) !== 'undefined' && typeof (options) === 'object') {\n _options = _checkOptions(options);\n }\n angular.merge(_settings, _defaults, _options, _base);\n }", "title": "" }, { "docid": "768e5ac659ce7f9e4f131a725e492d1c", "score": "0.63821703", "text": "setOptions () {\n // Set options on this instance using clArgs (command-line-args)\n this.options = clArgs(this.settings.optionDefinitions)\n }", "title": "" }, { "docid": "fbcff1b9cf8f03153daf3a4868214617", "score": "0.63800263", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet();\n\n\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n\t\t// Only change options that we're actually passed to update.\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\tvar newOptions = testOptions(originalOptions);\n\n\t\t// Load new options into the slider state\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = newOptions[name];\n\t\t\t}\n\t\t});\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n\t\toptions.margin = newOptions.margin;\n\t\toptions.limit = newOptions.limit;\n\t\toptions.padding = newOptions.padding;\n\n\t\t// Update pips, removes existing.\n\t\tif ( options.pips ) {\n\t\t\tpips(options.pips);\n\t\t}\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "fbcff1b9cf8f03153daf3a4868214617", "score": "0.63800263", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet();\n\n\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n\t\t// Only change options that we're actually passed to update.\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\tvar newOptions = testOptions(originalOptions);\n\n\t\t// Load new options into the slider state\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = newOptions[name];\n\t\t\t}\n\t\t});\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n\t\toptions.margin = newOptions.margin;\n\t\toptions.limit = newOptions.limit;\n\t\toptions.padding = newOptions.padding;\n\n\t\t// Update pips, removes existing.\n\t\tif ( options.pips ) {\n\t\t\tpips(options.pips);\n\t\t}\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "fbcff1b9cf8f03153daf3a4868214617", "score": "0.63800263", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet();\n\n\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n\t\t// Only change options that we're actually passed to update.\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\tvar newOptions = testOptions(originalOptions);\n\n\t\t// Load new options into the slider state\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = newOptions[name];\n\t\t\t}\n\t\t});\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n\t\toptions.margin = newOptions.margin;\n\t\toptions.limit = newOptions.limit;\n\t\toptions.padding = newOptions.padding;\n\n\t\t// Update pips, removes existing.\n\t\tif ( options.pips ) {\n\t\t\tpips(options.pips);\n\t\t}\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "fbcff1b9cf8f03153daf3a4868214617", "score": "0.63800263", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet();\n\n\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n\t\t// Only change options that we're actually passed to update.\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\tvar newOptions = testOptions(originalOptions);\n\n\t\t// Load new options into the slider state\n\t\tupdateAble.forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = newOptions[name];\n\t\t\t}\n\t\t});\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n\t\toptions.margin = newOptions.margin;\n\t\toptions.limit = newOptions.limit;\n\t\toptions.padding = newOptions.padding;\n\n\t\t// Update pips, removes existing.\n\t\tif ( options.pips ) {\n\t\t\tpips(options.pips);\n\t\t}\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "b19ee6815c6a1a74f6b998f748953be1", "score": "0.6369304", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet(), newOptions = testOptions({\n\t\t\tstart: [0, 0],\n\t\t\tmargin: optionsToUpdate.margin,\n\t\t\tlimit: optionsToUpdate.limit,\n\t\t\tstep: optionsToUpdate.step === undefined ? options.singleStep : optionsToUpdate.step,\n\t\t\trange: optionsToUpdate.range,\n\t\t\tanimate: optionsToUpdate.animate,\n\t\t\tsnap: optionsToUpdate.snap === undefined ? options.snap : optionsToUpdate.snap\n\t\t});\n\n\t\t['margin', 'limit', 'range', 'animate'].forEach(function(name){\n\n\t\t\t// Only change options that we're actually passed to update.\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\t// Save current spectrum direction as testOptions in testRange call\n\t\t// doesn't rely on current direction\n\t\tnewOptions.spectrum.direction = scope_Spectrum.direction;\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [-1, -1];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "b19ee6815c6a1a74f6b998f748953be1", "score": "0.6369304", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\n\n\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\tvar v = valueGet(), newOptions = testOptions({\n\t\t\tstart: [0, 0],\n\t\t\tmargin: optionsToUpdate.margin,\n\t\t\tlimit: optionsToUpdate.limit,\n\t\t\tstep: optionsToUpdate.step === undefined ? options.singleStep : optionsToUpdate.step,\n\t\t\trange: optionsToUpdate.range,\n\t\t\tanimate: optionsToUpdate.animate,\n\t\t\tsnap: optionsToUpdate.snap === undefined ? options.snap : optionsToUpdate.snap\n\t\t});\n\n\t\t['margin', 'limit', 'range', 'animate'].forEach(function(name){\n\n\t\t\t// Only change options that we're actually passed to update.\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\t// Save current spectrum direction as testOptions in testRange call\n\t\t// doesn't rely on current direction\n\t\tnewOptions.spectrum.direction = scope_Spectrum.direction;\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [-1, -1];\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t}", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "8c6db612ab1b7c1940ac7ab147f13579", "score": "0.6358863", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "cd190df71210975fcb9f5462540d5079", "score": "0.6349616", "text": "setOptions(opts) {\n this.chart.options = opts;\n this.refresh();\n }", "title": "" }, { "docid": "c9f67045596f95439e6030cb87e512b5", "score": "0.6347654", "text": "cleanOptions() {\n let defaultOptions = {\n environmentVariables: false,\n key: undefined,\n specs: undefined,\n specsSuffix: _1.ConfigsConstants.SpecsSuffix,\n suffix: _1.ConfigsConstants.Suffix,\n verbose: true,\n };\n this._options = includes_1.Tools.DeepMergeObjects(defaultOptions, this._options);\n }", "title": "" }, { "docid": "cdf42d1b02fe61965b529e43a0f5838f", "score": "0.6333047", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\r\n\t\r\n\t\t\t// Spectrum is created using the range, snap, direction and step options.\r\n\t\t\t// 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.\r\n\t\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\r\n\t\t\tvar v = valueGet(), newOptions = testOptions({\r\n\t\t\t\tstart: [0, 0],\r\n\t\t\t\tmargin: optionsToUpdate.margin,\r\n\t\t\t\tlimit: optionsToUpdate.limit,\r\n\t\t\t\tstep: optionsToUpdate.step === undefined ? options.singleStep : optionsToUpdate.step,\r\n\t\t\t\trange: optionsToUpdate.range,\r\n\t\t\t\tanimate: optionsToUpdate.animate,\r\n\t\t\t\tsnap: optionsToUpdate.snap === undefined ? options.snap : optionsToUpdate.snap\r\n\t\t\t});\r\n\t\r\n\t\t\t['margin', 'limit', 'range', 'animate'].forEach(function(name){\r\n\t\r\n\t\t\t\t// Only change options that we're actually passed to update.\r\n\t\t\t\tif ( optionsToUpdate[name] !== undefined ) {\r\n\t\t\t\t\toptions[name] = optionsToUpdate[name];\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\r\n\t\t\t// Save current spectrum direction as testOptions in testRange call\r\n\t\t\t// doesn't rely on current direction\r\n\t\t\tnewOptions.spectrum.direction = scope_Spectrum.direction;\r\n\t\t\tscope_Spectrum = newOptions.spectrum;\r\n\t\r\n\t\t\t// Invalidate the current positioning so valueSet forces an update.\r\n\t\t\tscope_Locations = [-1, -1];\r\n\t\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\r\n\t\t}", "title": "" }, { "docid": "26c74309dab44beac8baacf3b9cb4bc5", "score": "0.6327362", "text": "setOptions(newValue, typeMap) {\n const values = Object(algorithm_lib[\"toArray\"])(newValue || []);\n const types = typeMap || {};\n if (lib[\"JSONExt\"].deepEqual(values, this._options) &&\n lib[\"JSONExt\"].deepEqual(types, this._typeMap)) {\n return;\n }\n if (values.length) {\n this._options = values;\n this._typeMap = types;\n this._orderedTypes = Private.findOrderedTypes(types);\n }\n else {\n this._options = [];\n this._typeMap = {};\n this._orderedTypes = [];\n }\n this._stateChanged.emit(undefined);\n }", "title": "" }, { "docid": "6dac6335f5452eb4db750fe1018016a8", "score": "0.63258433", "text": "setOptions(options) {\n // the attribute currencies has priority than the options in meta\n if (this._currencies && this._currencies.length > 0) {\n this.updateSuggestions(this._currencies);\n } else {\n let collection;\n if (options.list) {\n collection = options.list;\n } else {\n collection = options;\n }\n this._collection = collection;\n this.updateSuggestions();\n }\n }", "title": "" }, { "docid": "faf6fb29a4cb4bd95ad3e22d7825052d", "score": "0.6324957", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function (name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n // Save current spectrum direction as testOptions in testRange call\n // doesn't rely on current direction\n newOptions.spectrum.direction = scope_Spectrum.direction;\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "103f738b4d85444af724338d7f5afe2d", "score": "0.6321708", "text": "function updateOptions ( optionsToUpdate, fireSetEvent ) {\r\n\r\n\t\t// Spectrum is created using the range, snap, direction and step options.\r\n\t\t// 'snap' and 'step' can be updated.\r\n\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\r\n\t\tvar v = valueGet();\r\n\r\n\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\r\n\r\n\t\t// Only change options that we're actually passed to update.\r\n\t\tupdateAble.forEach(function(name){\r\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\r\n\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar newOptions = testOptions(originalOptions);\r\n\r\n\t\t// Load new options into the slider state\r\n\t\tupdateAble.forEach(function(name){\r\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\r\n\t\t\t\toptions[name] = newOptions[name];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tscope_Spectrum = newOptions.spectrum;\r\n\r\n\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\r\n\t\toptions.margin = newOptions.margin;\r\n\t\toptions.limit = newOptions.limit;\r\n\t\toptions.padding = newOptions.padding;\r\n\r\n\t\t// Update pips, removes existing.\r\n\t\tif ( options.pips ) {\r\n\t\t\tpips(options.pips);\r\n\t\t}\r\n\r\n\t\t// Invalidate the current positioning so valueSet forces an update.\r\n\t\tscope_Locations = [];\r\n\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\r\n\t}", "title": "" }, { "docid": "7cc86167c35bddf62c48cb54fd7e93c9", "score": "0.6321071", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n // Spectrum is created using the range, snap, direction and step options.\n // 'snap' and 'step' can be updated.\n // If 'snap' and 'step' are not passed, they should remain unchanged.\n var v = valueGet();\n\n var updateAble = [\n \"margin\",\n \"limit\",\n \"padding\",\n \"range\",\n \"animate\",\n \"snap\",\n \"step\",\n \"format\",\n \"pips\",\n \"tooltips\"\n ];\n\n // Only change options that we're actually passed to update.\n updateAble.forEach(function(name) {\n // Check for undefined. null removes the value.\n if (optionsToUpdate[name] !== undefined) {\n originalOptions[name] = optionsToUpdate[name];\n }\n });\n\n var newOptions = testOptions(originalOptions);\n\n // Load new options into the slider state\n updateAble.forEach(function(name) {\n if (optionsToUpdate[name] !== undefined) {\n options[name] = newOptions[name];\n }\n });\n\n scope_Spectrum = newOptions.spectrum;\n\n // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n options.margin = newOptions.margin;\n options.limit = newOptions.limit;\n options.padding = newOptions.padding;\n\n // Update pips, removes existing.\n if (options.pips) {\n pips(options.pips);\n } else {\n removePips();\n }\n\n // Update tooltips, removes existing.\n if (options.tooltips) {\n tooltips();\n } else {\n removeTooltips();\n }\n\n // Invalidate the current positioning so valueSet forces an update.\n scope_Locations = [];\n valueSet(optionsToUpdate.start || v, fireSetEvent);\n }", "title": "" }, { "docid": "4fb0c21149b61253e921cc622c5e7f37", "score": "0.6311939", "text": "function setOptions(objOptions) {\n\n g_options = jQuery.extend(g_options, objOptions);\n\n g_thumbs.setOptions(objOptions);\n }", "title": "" }, { "docid": "3ca09999a7f29ccc7a582245bf4bb7d6", "score": "0.6302391", "text": "function updateOptions(optionsToUpdate, fireSetEvent) {\n\n\t\t\t// Spectrum is created using the range, snap, direction and step options.\n\t\t\t// 'snap' and 'step' can be updated.\n\t\t\t// If 'snap' and 'step' are not passed, they should remain unchanged.\n\t\t\tvar v = valueGet();\n\n\t\t\tvar updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];\n\n\t\t\t// Only change options that we're actually passed to update.\n\t\t\tupdateAble.forEach(function (name) {\n\t\t\t\tif (optionsToUpdate[name] !== undefined) {\n\t\t\t\t\toriginalOptions[name] = optionsToUpdate[name];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar newOptions = testOptions(originalOptions);\n\n\t\t\t// Load new options into the slider state\n\t\t\tupdateAble.forEach(function (name) {\n\t\t\t\tif (optionsToUpdate[name] !== undefined) {\n\t\t\t\t\toptions[name] = newOptions[name];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t\t// Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)\n\t\t\toptions.margin = newOptions.margin;\n\t\t\toptions.limit = newOptions.limit;\n\t\t\toptions.padding = newOptions.padding;\n\n\t\t\t// Update pips, removes existing.\n\t\t\tif (options.pips) {\n\t\t\t\tpips(options.pips);\n\t\t\t}\n\n\t\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\t\tscope_Locations = [];\n\t\t\tvalueSet(optionsToUpdate.start || v, fireSetEvent);\n\t\t}", "title": "" }, { "docid": "e1ade9f987b416b2f0916421a3f5370c", "score": "0.6299283", "text": "function ew_UpdateOpts(ar) {\n\tif (ewLang.isArray(ar)) { \n\t\tvar u;\n\t\tvar cnt = ar.length; \n\t\tfor (i = 0; i < cnt; i++) {\n\t\t\tu = ar[i];\n\t\t\tif (ewLang.isBoolean(u[2]) && !u[2]) { // Ajax and sync\n\t\t\t\tu[0] = {id: u[0], values: ew_GetOptValues(ew_GetElements(u[0]))};\n\t\t\t\tu[1] = {id: u[1], values: ew_GetOptValues(ew_GetElements(u[1]))};\n\t\t\t} else {\n\t\t\t\tew_UpdateOpt(u[0], u[1], u[2]);\t\n\t\t\t} \t\n\t\t}\n\t\tfor (i = 0; i < cnt; i++) {\n\t\t\tu = ar[i];\n\t\t\tif (ewLang.isBoolean(u[2]) && !u[2]) {\n\t\t\t\tew_UpdateOpt(u[0], u[1], true);\t\t\t\n\t\t\t} \t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f03c3931a9793ca794a87f9d35c0913", "score": "0.6292953", "text": "function saveOptions () {\n ls.set('options', options);\n backgroundOptionsRefreshed();\n}", "title": "" }, { "docid": "2d891cd54e7efe0e617e510fd98f3bcb", "score": "0.6282985", "text": "function updateOptions() {\n /*jshint validthis:true */\n var propValue = this.getValue();\n var value = propValue != null ? propValue : this.state.value;\n var options = this.getDOMNode().options;\n var selectedValue = '' + value;\n\n for (var i = 0, l = options.length; i < l; i++) {\n var selected = this.props.multiple ?\n selectedValue.indexOf(options[i].value) >= 0 :\n selected = options[i].value === selectedValue;\n\n if (selected !== options[i].selected) {\n options[i].selected = selected;\n }\n }\n}", "title": "" }, { "docid": "3627616b8de70270bd6cd001e5dfd0aa", "score": "0.62797576", "text": "parseUserOptions() {\n if (!this.options) {\n Object.assign(this.options, this.defaultOptions);\n } else {\n try {\n eval('this.options='+this.options+';');\n\n Object.assign(this.options, Object.assign({}, this.defaultOptions, this.options));\n } catch(e) {\n console.error(e.message);\n }\n }\n }", "title": "" }, { "docid": "1a760a8c98cc7eae3518fdaabf99e42a", "score": "0.6236189", "text": "updateOptions(options, save) {\n if(save) {\n const { cookies } = this.props;\n cookies.set('options', options, { path: '/' });\n }\n \tthis.setState(this.state.trip.options = options);\n }", "title": "" }, { "docid": "ab02be2064d704f7993d8063bbccc304", "score": "0.6223051", "text": "function updateTaskOptions() {\n if ($state.params && $state.params.options) {\n var slug = $state.current.url.slice(1);\n var task = _.find(vm.process.tasks, function(task) {\n return task.slug === slug;\n });\n if (task) {\n task.options = $state.params.options;\n }\n }\n }", "title": "" }, { "docid": "cfe85b4e6626e96ee14724c16d9b2c16", "score": "0.6204244", "text": "function updateOptions(data) {\r\n for(var i=0; i < data[\"keys-0\"].length; i++) {\r\n options[i] = data[\"keys-0\"][i][\"key-0\"];\r\n }\r\n options.sort();\r\n}", "title": "" }, { "docid": "52e05c6b8b75fd8a94961568c123831b", "score": "0.61935425", "text": "_getOptions(options = {}) {\n return Object.assign({}, options, { serverSettings: this.serverSettings });\n }", "title": "" }, { "docid": "370ec7d7536a79923c129a410a15e703", "score": "0.6176075", "text": "function updateOptions(optionObject, optionsNode) {\n optionsNode = optionsNode || options;\n for (item in optionObject) {\n updateOptionsObject(optionObject, item, optionsNode)\n }\n }", "title": "" }, { "docid": "8a4b787a58af7dded30213cc3cb4caec", "score": "0.61736965", "text": "reinit(options) {\n\t // todo: add options type and validation\n\t this.options = options;\n\t this.emit('onInit');\n\t }", "title": "" }, { "docid": "abb02b52f97635c7b6728ca48d0d7e69", "score": "0.6154592", "text": "async setOptions(data) {\n util.deepExtend(this.state, data['parameters']);\n this.callback(this.nodeUid, data);\n }", "title": "" }, { "docid": "8da740c79802dcdd4c96acae74a58850", "score": "0.61200327", "text": "function setOptions(key, value) {\n var obj = key;\n if(arguments.length > 1){\n obj = {};\n obj[key] = value;\n }\n options = $module.options = scope.options = angular.extend(options, obj);\n scope.message = options.message;\n }", "title": "" }, { "docid": "463d1eb47dfb68e2ba1441fc7bda1c38", "score": "0.61194986", "text": "set options(value /*(any|Array)*/) {\n this._options = value;\n this.onOptionsChanged();\n }", "title": "" }, { "docid": "1de47378efa0305b6233988eb8d4476d", "score": "0.6109434", "text": "_setOptions() {}", "title": "" }, { "docid": "7e5d6c9a954eb2cd490fb1eff83671f6", "score": "0.61018115", "text": "function updateOption () {\n\n while( tmpOption.length > 0 ) applyOption( tmpOption.pop() );\n\n}", "title": "" }, { "docid": "bdf38fed7a38b138f82121b5a0e73e7f", "score": "0.6085764", "text": "setOptions(list, options) {\n for (let o of options) {\n let opt = new Option(o, o);\n list.append(opt);\n\n }\n }", "title": "" }, { "docid": "f2b09dba183f3dba92373f7c043bf2fb", "score": "0.6075073", "text": "updateOptionsInDom() {\n this.component.findAllParts(\"option\").forEach((el) => el.remove());\n this.component.options.forEach((k,v) => {\n var option = this.component.findPart(\"option_template\").cloneNode(true);\n option.setAttribute(\"data-component-part\", \"option\");\n option.setAttribute(\"data-option-value\", k.toString());\n option.style.display = null;\n option.innerText = v;\n this.options_container.append(option);\n }, this);\n }", "title": "" }, { "docid": "73e7fc175182339e9676130382626042", "score": "0.6074217", "text": "setOptions(options) {\n var ref, ref1, ref2, ref3, ref4, ref5;\n this.title = (ref = options.title) != null ? ref : '';\n this.slug = S(this.title).slugify().s;\n this.category = (ref1 = options.category) != null ? ref1 : null;\n this.ignoreFirstFileForToc = options.home != null;\n this.maxTocLevel = (ref2 = options.maxTocLevel) != null ? ref2 : 2;\n this.makeAssetsRelativeToGithub = (ref3 = options.makeAssetsRelativeToGithub) != null ? ref3 : false;\n this.rootDir = (ref4 = options.rootDir) != null ? ref4 : '.';\n this.links = (ref5 = options.links) != null ? ref5 : [];\n return this.options = _.extend({}, options);\n }", "title": "" }, { "docid": "6ec876bbc15d64acbeefdb46882ef766", "score": "0.6034267", "text": "constructor(options) {\n var args = [...arguments];\n this.options = (args.length > 0 && typeof args.slice(-1)[0] === 'object') ? args.pop() : undefined;\n this.setOptions(this.options);\n }", "title": "" }, { "docid": "21636c630aa978cf858c8753881077df", "score": "0.5967152", "text": "function setOptions(userOptions) {\n const options = this.options = merge(this.constructor.defaultOptions, this.defaultPolarOptions, defaultOptions[this.coll], // #16112\n userOptions);\n // Make sure the plotBands array is instanciated for each Axis\n // (#2649)\n if (!options.plotBands) {\n options.plotBands = [];\n }\n fireEvent(this, 'afterSetOptions');\n }", "title": "" }, { "docid": "468d376d819593f8d77d986117a41c64", "score": "0.5965684", "text": "function extendOptions () {\n\n if (!(options instanceof Object)) {\n options = {};\n }\n\n if (!$.jStorage) {\n options.debug && window.Debug.log({\n 'node': node,\n 'function': 'extendOptions()',\n 'arguments': '$.jStorage',\n 'message': 'WARNING - It is strongly recommended to have $.jStorage available on your page to store the result set(s)'\n });\n }\n\n var tpmOptions = Object.preventExtensions($.extend(true, {}, _options));\n\n for (var type in options) {\n if (!options.hasOwnProperty(type) || type === \"debug\") {\n continue;\n }\n\n if (typeof _options[type] === \"undefined\") {\n\n options.debug && window.Debug.log({\n 'node': node,\n 'function': 'extendOptions()',\n 'arguments': '{' + type + ': ' + JSON.stringify(options[type]) + '}',\n 'message': 'WARNING - Invalid option: ' + type\n });\n\n delete options[type];\n\n break;\n }\n\n for (var option in options[type]) {\n if (!options[type].hasOwnProperty(option)) {\n continue;\n }\n\n if (typeof _options[type][option] === \"undefined\") {\n options.debug && window.Debug.log({\n 'node': node,\n 'function': 'extendOptions()',\n 'arguments': '{' + option + ': ' + JSON.stringify(options[type][option]) + '}',\n 'message': 'WARNING - Invalid option: ' + option\n });\n\n delete options[type][option];\n\n continue;\n }\n\n if (option === \"jsonList\" && options[type][option] instanceof Object) {\n\n for (var list in options[type][option]) {\n if (!options[type][option].hasOwnProperty(list)) {\n continue;\n }\n\n if (!(options[type][option][list] instanceof Object) || list === \"data\") {\n list = \"list\";\n options[type][option] = {\n list: options[type][option]\n };\n }\n\n for (var listOption in options[type][option][list]) {\n\n if (!options[type][option][list].hasOwnProperty(listOption)) {\n continue;\n }\n\n if ($.inArray(listOption, _supported[type][option]) === -1) {\n\n options.debug && window.Debug.log({\n 'node': node,\n 'function': 'extendOptions()',\n 'arguments': '{' + listOption + ': ' + JSON.stringify(options[type][option][list][listOption]) + '}',\n 'message': 'WARNING - Invalid jsonList option: ' + listOption\n });\n\n delete options[type][option][list][listOption];\n\n continue;\n\n }\n }\n }\n\n } else if (_supported[type] &&\n _supported[type][option] &&\n $.inArray(options[type][option], _supported[type][option]) === -1) {\n\n options.debug && window.Debug.log({\n 'node': node,\n 'function': 'extendOptions()',\n 'arguments': \"{\" + option + \":\" + JSON.stringify(options[option]) + \"}\",\n 'message': 'WARNING - Unsupported option: ' + option\n });\n\n delete options[type][option];\n\n }\n\n }\n }\n\n options = $.extend(true, tpmOptions, options);\n\n }", "title": "" }, { "docid": "0cf8a8afe8cc2d2d12d5031e8787e796", "score": "0.59621865", "text": "setOptions(options) {\n this.options = Object.assign(this._defaultOptions, options);\n if (this.csrfToken()) {\n this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();\n }\n return options;\n }", "title": "" }, { "docid": "0cf8a8afe8cc2d2d12d5031e8787e796", "score": "0.59621865", "text": "setOptions(options) {\n this.options = Object.assign(this._defaultOptions, options);\n if (this.csrfToken()) {\n this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();\n }\n return options;\n }", "title": "" }, { "docid": "0cf8a8afe8cc2d2d12d5031e8787e796", "score": "0.59621865", "text": "setOptions(options) {\n this.options = Object.assign(this._defaultOptions, options);\n if (this.csrfToken()) {\n this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();\n }\n return options;\n }", "title": "" }, { "docid": "616b2555d11198767f84a47594231982", "score": "0.5956402", "text": "_setOption(key, value) {\n BaseGenerator.options[key] = value;\n }", "title": "" }, { "docid": "fc65ae32306edcf20a450f8cee7bc150", "score": "0.5945427", "text": "function create_options_watcher(path) {\n //bind_options();\n var loader = new THREE.XHRLoader(THREE.DefaultLoadingManager);\n loader.load(path, function (text) {\n var new_options = eval('(' + text + ')');\n for (var m in new_options) {\n options[m] = new_options[m];\n }\n });\n }", "title": "" }, { "docid": "bde15f489c01f8838d41a5f96fa14ef8", "score": "0.59448147", "text": "function extendOptions(options) {\n\t\t$.fn.toggleLoad.settings = $.extend(settings, defaults, $.fn.toggleLoad.settings, options);\n\t}", "title": "" }, { "docid": "bacbd99d1ba9cb8978de1e7285cfad15", "score": "0.5943718", "text": "#updateOptions () {\n try {\n const oldAudioNode = this.#audioNode\n this.#audioNode = this.#newAudioNode()\n for (const paramName of this.#paramNames) {\n if (this.#audioNode[paramName] instanceof AudioParam) {\n this.#audioNode[paramName].value = this.#audioNode[paramName].value\n } else {\n this.#audioNode[paramName] = this.#audioNode[paramName]\n }\n }\n this.#updateConnectionCount()\n this.#element.classList.remove('node-error')\n this.#element.title = ''\n } catch (err) {\n this.#element.classList.add('node-error')\n this.#element.title = err.toString()\n }\n }", "title": "" }, { "docid": "440783901469c00a81c42faa8cb58ddf", "score": "0.59385127", "text": "function updateOptionsUI() {\n\t\tconst crafts = [\n\t\t\t[ \"manuscriptMode\", \"craftManuscript\" ],\n\t\t\t[ \"compendiumMode\", \"craftCompendium\" ],\n\t\t\t[ \"blueprintMode\", \"craftBlueprint\" ],\n\t\t];\n\t\tfor (const craft of crafts) {\n\t\t\tAutoKittensOptions.furOptions[craft[0]] = Number(AutoKittensOptions.huntOptions[craft[1]]) + 2 * AutoKittensOptions.craftOptions[craft[1]];\n\t\t}\n\t\ttraverseObject(AutoKittensOptions);\n\t\tchangeTimeFormat();\n\t}", "title": "" }, { "docid": "3db4bdaa8cea5822b20b2df1da891147", "score": "0.5936128", "text": "applyAllOptions () {\n for (const name of this.api.settings.getFeatureOptions().names) {\n this.applyFeatureOption(name)\n this._store.commit('settings/incrementFeatureResetCounter')\n }\n for (const name of this.api.settings.getResourceOptions().names) { // eslint-disable-line no-unused-vars\n this._store.commit('settings/incrementResourceResetCounter')\n }\n for (const name of this.api.settings.getUiOptions().names) {\n this.applyUIOption(name, this.api.settings.getUiOptions().items[name].currentValue)\n this._store.commit('settings/incrementUiResetCounter')\n }\n }", "title": "" }, { "docid": "34d3d4e39581959b4d98ad4d9baaf343", "score": "0.5912872", "text": "initOptions() {\n this['options'] = this.getOptions();\n\n if (this['options']) {\n // if background color isnt set, set it to current default themes\n this['options'].bodyBG = this['options'].bodyBG || undefined;\n this['options'].headerBG = this['options'].headerBG || undefined;\n }\n }", "title": "" }, { "docid": "b835c360bc19a9c4af2115653b0f809a", "score": "0.59109944", "text": "configure(options) {\n (0,_pnp_common__WEBPACK_IMPORTED_MODULE_0__.mergeOptions)(this.data.options, options);\n return this;\n }", "title": "" }, { "docid": "4138f16a63cb9fe92010964c3996fdd0", "score": "0.5908853", "text": "clearOptions(){}", "title": "" }, { "docid": "57378ff6edd63cc389bf2501a79c077d", "score": "0.59055805", "text": "function setOptions(opts, name, value) {\n\tif(opts[name]) return;\n \topts[name] = value;\n}", "title": "" }, { "docid": "d21f9ca5b8a981da558a8a63fda56929", "score": "0.58986217", "text": "function restore_options() {\n\n}", "title": "" }, { "docid": "4f05d349fce16913955e314ddeed399a", "score": "0.5895684", "text": "function init(options) {\n var options = $.extend(defaults, options);\n }", "title": "" }, { "docid": "9308adcb63bc43d9da7f96f950d34bfa", "score": "0.588705", "text": "function _setOptions(options) {\n\t var tetherVal = _options.tether;\n\n\t for (attrname in options) {\n\t _options[attrname] = options[attrname];\n\t }\n\n\t if (tetherVal != _options.tether) {\n\t _enableTethering(_options.tether);\n\t }\n\n\t _render();\n\t }", "title": "" } ]
969901d4af1519c4963d678a46a2bd00
EVENT FUNCTION Get the point
[ { "docid": "e09ad14260a183642c05e9d06ad6ccda", "score": "0.6943452", "text": "function getPoint(evt) {\n // Get the point\n if (evt) {\n // Get the projected point\n point = evt.geometries[0];\n }\n else {\n // Get X and Y coordinates from text box\n xCoord = mapFrame.xCoordTextBox.get('value');\n yCoord = mapFrame.yCoordTextBox.get('value');\n point = new Point([xCoord, yCoord], new SpatialReference({ wkid: mapFrame.coordSystemSelect.value }));\n }\n\n // If address locator provided\n if (locatorService) {\n var params = new ProjectParameters();\n params.geometries = [point];\n // Locate addresses within specified metres\n locatorService.locationToAddress(point, 100);\n }\n else {\n goToPoint(point);\n }\n }", "title": "" } ]
[ { "docid": "4bfea82a9b8516c38d3ef560ce9e1c0c", "score": "0.7335187", "text": "function getEventPoint(evt) {\n\tvar p = root.createSVGPoint();\n\n\n\tp.x = evt.clientX-root.getBoundingClientRect().left;\n\tp.y = evt.clientY-root.getBoundingClientRect().top;\n\n\treturn p;\n}", "title": "" }, { "docid": "0c067289b4eace4a577bcbb75e7c7481", "score": "0.7119614", "text": "function getTwoPoints(event )\n {\n x1 = event.clientX;\n y1 = event.clientY;\n }", "title": "" }, { "docid": "7c03bf7a49a0fb72bee1d662fff4eb09", "score": "0.7079623", "text": "getPoint(){return this.point;}", "title": "" }, { "docid": "2127eb295c1d1a325101fd60f5b76dc0", "score": "0.6983242", "text": "function getX(evt)\r\n{\r\n\treturn\tgetPoint(evt).x;\r\n}", "title": "" }, { "docid": "45bf6b780b6c8d5cebbca59b0b1980a6", "score": "0.68935394", "text": "function getPoint(evt)\r\n{\r\n var SVGRoot = drawing.getDocumentElement();\r\n var m = SVGRoot.getScreenCTM(); \r\n var p = SVGRoot.createSVGPoint(); \r\n p.x = evt.clientX; \r\n p.y = evt.clientY; \r\n p = p.matrixTransform(m.inverse());\r\n\t return p; \r\n}", "title": "" }, { "docid": "5225e8892269856bd11f3ca02cbe88c0", "score": "0.68927246", "text": "function getEventPoint(evt) {\n var p = objTouchVars.elsvg.createSVGPoint();\n\n // console.log(evt);\n if (objZoomPanSettings.mobile) {\n p.x = evt.gesture.center.pageX - objTouchVars.svgx;\n\n // Hack to zoom in center - seems to be solved in ios 7\n if (window.app.state.ios && !window.app.state.ipad) {\n p.x = p.x - window.app.state.width / 2;\n }\n p.y = evt.gesture.center.pageY - objTouchVars.svgy;\n } else {\n p.x = evt.clientX - objTouchVars.svgx;\n p.y = evt.clientY - objTouchVars.svgy;\n }\n\n return p;\n}", "title": "" }, { "docid": "181cdb71415bc179170dd08276aaab48", "score": "0.68389857", "text": "GetPoint() {}", "title": "" }, { "docid": "e2607240861f9377c6711c24ef3a6ee6", "score": "0.6816085", "text": "getHitPoint(event) {\n\n var screenPoint = {\n x: event.clientX,\n y: event.clientY\n }\n\n var n = this.normalize(screenPoint)\n\n var hitPoint = this._viewer.utilities.getHitPoint(n.x, n.y)\n\n return hitPoint\n }", "title": "" }, { "docid": "d69b449e50d825044355ae2c9980f920", "score": "0.6703165", "text": "function getEventPoint(ev){ev=ev.originalEvent||ev;// support jQuery events\nreturn ev.touches&&ev.touches[0]||ev.changedTouches&&ev.changedTouches[0]||ev;}", "title": "" }, { "docid": "f8dbfa391340f5780bf2c304d7aa2b75", "score": "0.6685225", "text": "function getMousePos(evt) {\n\t\tvar canvas = document.getElementById(\"catapulta\");\n var rect = canvas.getBoundingClientRect();\n mousePos = {\n\t\t\tx: mousePos.x+Math.round(evt.movementX),\ny: mousePos.y+Math.round(evt.movementY)\n };\n\t\t//console.log(mousePos);\n}", "title": "" }, { "docid": "0a0c033ce7e87aebab3cafb0b59ea32b", "score": "0.6677252", "text": "function getEventPoint(event, svgNode) {\n var p = svgNode.node.createSVGPoint();\n\n if(!!('ontouchstart' in window)) { // Check tablet\n p.x = event.changedTouches[0].clientX;\n p.y = event.changedTouches[0].clientY;\n } else {\n p.x = event.clientX;\n p.y = event.clientY;\n }\n\n return p;\n }", "title": "" }, { "docid": "461243f8c7bb2210d104bae3862598f5", "score": "0.66295445", "text": "function pos(event){\r\n\tvar ex=event.pageX - event.target.offsetLeft;\r\n\tvar ey=event.pageY - event.target.offsetTop;\r\n\treturn{\r\n\t\tx:ex,\r\n\t\ty:ey\r\n\t};\r\n}", "title": "" }, { "docid": "b1dd06bfebc611be10e5fe7faf4e28e8", "score": "0.6626374", "text": "function getX(event)\n{\n return event.clientX - gl.canvas.offsetLeft - gl.canvas.offsetWidth/2;\n}", "title": "" }, { "docid": "e1ef1258270451fdee3e18609ba55611", "score": "0.6613513", "text": "function getEventLocation(element,event){\n var pos = getElementPosition(element);\n \n return {\n x: (event.pageX - pos.x),\n y: (event.pageY - pos.y)\n };\n}", "title": "" }, { "docid": "68f3156ebc68ed844df1333431fce55a", "score": "0.66033006", "text": "function getHitPoint(event) {\n\n var screenPoint = {\n x: event.clientX,\n y: event.clientY\n };\n\n var n = normalize(screenPoint);\n\n var hitPoint = viewer.utilities.getHitPoint(n.x, n.y);\n\n return hitPoint;\n }", "title": "" }, { "docid": "f6e8094b2b33c3b3e58dcb0ef67863dc", "score": "0.659369", "text": "function _mousePoint(event) {\n return {x: event.clientX, y: event.clientY};\n }", "title": "" }, { "docid": "1ed918618b84b765e4dadf11c4786736", "score": "0.6560455", "text": "mouseDown(evt, point) {}", "title": "" }, { "docid": "7874a181fd1dd38c50336d5721ddc723", "score": "0.6556611", "text": "function calCoordinate(e){\n var rslt = {};\n var offset = normalWindow.offset();\n rslt.left = Math.max(0, Math.min(e.pageX - offset.left - magnifier.width() / 2 , normalWindow.width() - magnifier.width()));\n rslt.top = Math.max(0, Math.min(e.pageY - offset.top - magnifier.height() / 2, normalWindow.height() - magnifier.height()));\n \n return rslt;\n }", "title": "" }, { "docid": "9512c07a26766384e8046c3c8978a295", "score": "0.65556455", "text": "position_from_event(event) {\n return this.position_from_offset(this.offset_from_event(event));\n }", "title": "" }, { "docid": "c465fb58e15b1ead867fc705ffc080d7", "score": "0.6491484", "text": "getMousePosition(event) {\n\n\t\t\t\t\tconst canvasRect = canvas.getBoundingClientRect();\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: event.clientX - canvasRect.x,\n\t\t\t\t\t\ty: event.clientY - canvasRect.y\n\t\t\t\t\t}\n\n\t\t\t\t}", "title": "" }, { "docid": "6e6ee75896e5de138359472733a4527e", "score": "0.6486816", "text": "function getMousePosition(canvas, event) {\n\n \t//var rect = canvas.getBoundingClientRect();\n \tvar xL = event.clientX - rect.left;\n \tvar yL = event.clientY - rect.top;\n\n \talert(\"xL is \" + xL + \" and yL is \" + yL);\n\n \treturn {\n \t\tx: xL,\n \t\ty: yL\n \t};\n }", "title": "" }, { "docid": "79636df613f65cf0f7908399c22ee256", "score": "0.64847696", "text": "function getPosition(event) {\r\n coord.x = event.clientX - canvasDraw.offsetLeft\r\n coord.y = event.clientY - canvasDraw.offsetTop\r\n}", "title": "" }, { "docid": "419468eea9356f43645c4b9987e9a578", "score": "0.64750606", "text": "function base_showInfo(e) {\n console.log(e.point.lng + \", \" + e.point.lat);\n}", "title": "" }, { "docid": "40a1264cb3d89f76df1c892cc7d1e8b8", "score": "0.6468176", "text": "function getPointFromEvent (event) {\n var point = {x:0, y:0};\n // If even is triggered by a touch event, we get the position of the first finger\n if (event.targetTouches) {\n point.x = event.targetTouches[0].clientX;\n point.y = event.targetTouches[0].clientY;\n } else {\n point.x = event.clientX;\n point.y = event.clientY;\n }\n\n return point;\n}", "title": "" }, { "docid": "f6914f4ae79a0eb97f0fdac534a8fd2f", "score": "0.646483", "text": "function MousePosition(event){\n return {\n x: event.pageX,\n y: event.pageY\n };\n}", "title": "" }, { "docid": "62a6f15c50bdeb34cd0e156afba81929", "score": "0.6439723", "text": "function mousePos(e) {\n\t\t\t\tvar rect = canvas.getBoundingClientRect();\n\t\t\t\treturn new mapboxgl.Point(\n\t\t\t\t\te.originalEvent.clientX - rect.left - canvas.clientLeft,\n\t\t\t\t\te.originalEvent.clientY - rect.top - canvas.clientTop\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "6e3ca6091f4794142251a8534d2ac0c8", "score": "0.64393044", "text": "function goToPoint(evt) {\n var content = \"<b>X: \" + (Math.round(point.x * 100) / 100) + \"<br/>\" + \"Y: \" + (Math.round(point.y * 100) / 100) + \"</b>\";\n // If address locator provided\n if (locatorService) {\n var address = evt.address.address.Match_addr;\n content += \"<br/><br/>\" + mapFrame.nls.closestAddress + \": \" + address;\n }\n\n // Add point to map\n var symbol = mapFrame.pointSymbolChooser.getSymbol();\n var graphic = new Graphic(point, symbol);\n map.graphics.add(graphic);\n\n // Zoom to point\n zoomExtent = map.extent.centerAt(point).expand(0.01);\n map.setExtent(zoomExtent);\n // Show popup\n map.infoWindow.setTitle(mapFrame.nls.location);\n map.infoWindow.setContent(content);\n map.infoWindow.show(point);\n\n // Hide loading bar\n html.setStyle(mapFrame.progressBar.domNode, 'display', 'none');\n }", "title": "" }, { "docid": "ddfd8bbd089fc28e644b317cf9440102", "score": "0.6417477", "text": "function getPosition(event) {\n coord.x = event.clientX - canvas.offsetLeft;\n coord.y = event.clientY - canvas.offsetTop;\n}", "title": "" }, { "docid": "8158698f78ba2efd4cfb58180568cbb6", "score": "0.64051116", "text": "showPoint() {\n console.log(this.getX() + \", \" + this.getY());\n }", "title": "" }, { "docid": "1458e0a1ef6528d72eb022990fa901a1", "score": "0.63982505", "text": "function FindMousePos(e) {\n mouseX = e.clientX;\n mouseY = e.clientY;\n //console.log(\"This is the xPos: \" + mouseX)\n //console.log(\"This is the yPos: \" + mouseY)\n}", "title": "" }, { "docid": "7556d65cc058bad5cf405e2f6aa55efa", "score": "0.6393999", "text": "getMousePos(mouseEvent) {\n return {\n x: mouseEvent.offsetX,\n y: mouseEvent.offsetY\n };\n }", "title": "" }, { "docid": "e6dd44ee2a69da310d1ad7f2584c620c", "score": "0.63647383", "text": "function getPos(evt, type) {\n var rect = canvas.getBoundingClientRect(), x, y;\n \n switch(type) {\n case 'mouse': \n x = evt.clientX - rect.left;\n y = evt.clientY - rect.top;\n break;\n\n case 'touch':\n x = event.targetTouches[0].clientX - rect.left;\n y = event.targetTouches[0].clientY - rect.top;\n break;\n }\n \n //return object of x and y\n return {\n x: x,\n y: y\n }\n}", "title": "" }, { "docid": "067d414e41460409c55aa6066c5fa6f7", "score": "0.6355655", "text": "function getPosition(event){\r\n var x = event.offsetX;\r\n var y = event.offsetY;\r\n document.getElementById(\"ptext\").innerHTML = \"Event x: \" + x + \" y: \" + y;\r\n\r\n //Iterate over clickable objects searching for a hit\r\n for (var i = 0; i < clickables.length; i++) {\r\n result = clickables[i].detect(x,y);\r\n if(result == true){\r\n break; //Only one thing can be clicked at a time\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d71833170c4fae26abf531345e92a0ba", "score": "0.6333526", "text": "function getPos(event) {\n if (event != null) {\n return { x: event.offsetX, y: event.offsetY }\n }\n return { x: 0, y: 0 }\n }", "title": "" }, { "docid": "6149695254c5b33a3e9551c1f152896d", "score": "0.63287956", "text": "function EPE_Pose(evt)\n{\n var x, y;\n if (EPE_IsTouch(evt))\n {\n var c = G2GetPose(EPE.canvas);\n x = evt.touches[0].pageX - c.x;\n y = evt.touches[0].pageY - c.y;\n }\n else\n {\n x = evt.offsetX;\n y = evt.offsetY;\n }\n\n return { x: x, y: y };\n}", "title": "" }, { "docid": "e1109d79ac08267b2618603233a572cd", "score": "0.6324235", "text": "function getEventPoint(ev) {\n\t ev = ev.originalEvent || ev; // support jQuery events\n\t return (ev.touches && ev.touches[0]) ||\n\t (ev.changedTouches && ev.changedTouches[0]) ||\n\t ev;\n\t}", "title": "" }, { "docid": "e1109d79ac08267b2618603233a572cd", "score": "0.6324235", "text": "function getEventPoint(ev) {\n\t ev = ev.originalEvent || ev; // support jQuery events\n\t return (ev.touches && ev.touches[0]) ||\n\t (ev.changedTouches && ev.changedTouches[0]) ||\n\t ev;\n\t}", "title": "" }, { "docid": "bbb13b776db7685586bf2c7119c2a093", "score": "0.6321734", "text": "function getMouse(e) {\n mx = e.clientX - canvas.offsetLeft;\n my = e.clientY - canvas.offsetTop;\n}", "title": "" }, { "docid": "fced7f2587db996fa6dd6deff8cd3e60", "score": "0.6304002", "text": "function getPosition(event){\n\n stop();\n var x = new Number();\n var y = new Number();\n var canvas = document.getElementById(\"canvas\");\n\n if (event.x != undefined && event.y != undefined){\n x = event.x;\n y = event.y;\n }else{ // Firefox method to get the position\n x = event.clientX + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n y = event.clientY + document.body.scrollTop +\n document.documentElement.scrollTop;\n }\n\n x -= canvas.offsetLeft;\n y -= canvas.offsetTop;\n\n // x and y now are numbers that needs to be rounded to square-size\n drawOnClick(Math.floor(x / squareSize) * squareSize,Math.floor(y / squareSize) * squareSize); //sent the values on %10=0\n\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "2c6c31f0e295da4eda2c881b203c703d", "score": "0.63022745", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}", "title": "" }, { "docid": "8516901f4a7ec1ebd251191a76f33f7b", "score": "0.63001555", "text": "function getMousePosition(canvas, evt){\n var rect = canvas.getBoundingClientRect();\n return{\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n }\n }", "title": "" }, { "docid": "082b1bbc1612af64e4201c2e282534b8", "score": "0.6297222", "text": "function getLocation (evt) {\n\tvar canvas = document.getElementById('webgl');\n\tvar mousePos = getMousePos(canvas, evt);\n\n\tvar coords = [mousePos.x, mousePos.y];\n\tdrawMode(coords);\n}", "title": "" }, { "docid": "72cb81284c81b1e6ee98e0909e27d7ee", "score": "0.62968045", "text": "function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n }", "title": "" }, { "docid": "7f24c91497fbbd7521e2d54e9e1f2a6d", "score": "0.6287424", "text": "function calculateMousePos(evt){\r\n\tvar rect = canvas.getBoundingClientRect();\r\n\tvar root = document.documentElement;\r\n\tvar mouseX = evt.clientX - rect.left - root.scrollLeft;\r\n\tvar mouseY = evt.clientY - rect.top - root.scrollTop;\r\n\t\r\n //alert(\"x:\" + mouseX + \" y:\" + mouseY);\r\n \r\n\treturn{\r\n\t\tx: mouseX,\r\n\t\ty: mouseY\r\n\t};\r\n}", "title": "" }, { "docid": "bfa8b71a799fee7ccb52ebb154a983db", "score": "0.62799317", "text": "function getPos(e) {\n var rc = e.getBoundingClientRect();\n\treturn {x:rc.left, y:rc.top};\n}", "title": "" }, { "docid": "25e5c9e15ddde14369d79d193711d33e", "score": "0.6269098", "text": "function trackPoints(e) {\n allPoints.push({ x: e.pageX, y: e.pageY });\n }", "title": "" }, { "docid": "754e7d7256ed294728713d1bd78dff63", "score": "0.6258691", "text": "function getMousePos(canvas, event) {\n\tvar rect = canvas.getBoundingClientRect();\n\treturn {\n\t\tx: event.clientX - rect.left,\n\t\ty: event.clientY - rect.top\n\n\t\t\n\t};\n}", "title": "" }, { "docid": "9a5ab836acc1cbaf317cae07565c044e", "score": "0.62524045", "text": "function getCurrentCoordinates(event){\n var x = event.clientX - canvas.getBoundingClientRect().left,\n y = event.clientY - canvas.getBoundingClientRect().top;\n // var x = event.clientX;\n // var y = event.clientY;\n\n return {x: x, y:y};\n}", "title": "" }, { "docid": "3f574083903ead6ab385b0d08bb0bd89", "score": "0.6250641", "text": "function mousePosition(evt){\r\n let rect = canvas.getBoundingClientRect();\r\n let root = document.documentElement;\r\n let mouseX = evt.clientX - rect.left - root.scrollLeft;\r\n let mouseY = evt.clientY - rect.top - root.scrollTop;\r\n\r\n return{\r\n x:mouseX,\r\n y:mouseY\r\n };\r\n}", "title": "" }, { "docid": "429dbe873f52060cbf5ade9b5e4ec54c", "score": "0.62479085", "text": "getPointData() {\r\n let iv = this.i.getPointData();\r\n return iv._inner;\r\n }", "title": "" }, { "docid": "149fb32033751098d770c6d5ab9d9736", "score": "0.6237954", "text": "function getMousePos(canvas, event) {\n var bounds = canvas.getBoundingClientRect();\n return {\n x : event.clientX - bounds.left,\n y : event.clientY - bounds.top\n };\n }", "title": "" }, { "docid": "18c05ec08a49a3517dac58f93dd98365", "score": "0.62329865", "text": "function getPosition(event) {\n if (event.x != undefined && event.y != undefined) {\n mouse.x = event.x;\n mouse.y = event.y;\n } else if (event.pageX != undefined && event.pageY != undefined) {\n mouse.x = event.pageX;\n mouse.y = event.pageY;\n } else {\n mouse.x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n mouse.y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n }\n\n mouse.x -= canvas.offsetLeft;\n mouse.y -= canvas.offsetTop;\n}", "title": "" }, { "docid": "3927381392d78274a43f78dc92fc5a11", "score": "0.62321395", "text": "function currentMousePosition(event) {\n let border = canvas.getBoundingClientRect();\n return {\"x\" : (event.clientX - border.left), \"y\" : (event.clientY - border.top)};\n}", "title": "" }, { "docid": "3cab9258ca30cbf19b9603fe49527b34", "score": "0.621933", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n \n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "0f5b432520a2b65be24a0f2b786afd7c", "score": "0.6217394", "text": "function onMouseDown(event) {\n console.log(mouse.x + \" \" + mouse.y);\n}", "title": "" }, { "docid": "d357a55dbce40a9b7705626b65c6ffb2", "score": "0.62140435", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "7c97eac6169ca4989ee3b4c8cb66a4f2", "score": "0.62109023", "text": "function point(e)\r\n{\t\r\n\tif (e.pageX || e.pageY)\r\n\t{\r\n\t\tthis.x = e.pageX;\r\n\t\tthis.y = e.pageY;\r\n\t}\r\n\telse if (e.clientX || e.clientY)\r\n\t{\r\n\t // need to use both document.body and document.documentElement to cater for various\r\n\t // combinations of IE 5/6 in normal and quirksmode\r\n\t\tthis.x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\r\n\t\tthis.y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\r\n\t}\r\n\t// give the point position relative to the popup\r\n\tthis.x -= popupOrigin.x;\r\n\tthis.y -= popupOrigin.y;\r\n}", "title": "" }, { "docid": "10e3c52785f115ee81f42ab51313eb86", "score": "0.62054473", "text": "function drawPoint(e) {\n\tcount++;\n\n\t// this is the first point, no need to draw a line\n\tif (x1 == null && y1 == null) {\n\t\tx1 = e.offsetX;\n\t\ty1 = e.offsetY;\n\t\treturn;\n\t}\n\n\t// their was a point before, we draw a line\n\tdrawLine(x1,y1,e.offsetX,e.offsetY,true);\n\tx1 = e.offsetX;\n\ty1 = e.offsetY;\n}", "title": "" }, { "docid": "c4c977bf39eb7d0912d12195d9fdbfe7", "score": "0.61822665", "text": "function getY(evt)\r\n{\r\n\treturn getPoint(evt).y;\r\n}", "title": "" }, { "docid": "b866e1835c12363528e93aaad7bb6929", "score": "0.61804724", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "b866e1835c12363528e93aaad7bb6929", "score": "0.61804724", "text": "function getMousePos(e) {\n if (!e)\n var e = event;\n\n if (e.offsetX) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n }\n else if (e.layerX) {\n mouseX = e.layerX;\n mouseY = e.layerY;\n }\n }", "title": "" }, { "docid": "6aaa2ae0e8960420e88dd14e7e56e846", "score": "0.61792684", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n\t\t\tx: evt.clientX - rect.left,\n\t\t\ty: evt.clientY - rect.top\n\t\t};\n\t}", "title": "" }, { "docid": "ace1d6d2c4630001a530df9b8a63102e", "score": "0.6178104", "text": "function getCoords(event) {\n var x = event.clientX;\n var y = event.clientY;\n var JQPeanut = document.getElementById(\"Peanut\");\n var ctx = JQPeanut.getContext(\"2d\");\n ctx.font = \"30px Arial\";\n\n $.get('./process_name.php', // ask the server to give the file \n { cursorS: [x, y] }, // data transferée\n function (echorev) {\n\n },\n \n );\n\n }", "title": "" }, { "docid": "f1a070f7f3413f733f9bb50e687e05ec", "score": "0.6172835", "text": "function getXY(evt) {\n let canvas = getCanvas();\n let rect = canvas.getBoundingClientRect();\n let x = evt.clientX - rect.left;\n let y = evt.clientY - rect.top;\n return [x, y];\n}", "title": "" }, { "docid": "d6034da7acb381d2953be25cb5cd71e3", "score": "0.6172013", "text": "function getMousePosition(evt) {\n\t\tvar CTM=svg.getScreenCTM();\n\t\t/*no multi-touch weirdness*/ if (evt.touches) {evt = evt.touches[0];}\n\t\treturn {x: (evt.clientX - CTM.e) / CTM.a};\n\t}", "title": "" }, { "docid": "feacf0978006a839fc53daf03c1f81b6", "score": "0.6153469", "text": "function getMousePos(evt) {\r\n mouseInitiated = true;\r\n let rect = canvas.getBoundingClientRect();\r\n let coordinates = pixelsToCoordinates((evt.clientX - rect.left), (evt.clientY - rect.top));\r\n return {\r\n x: coordinates.x,\r\n y: coordinates.y\r\n };\r\n}", "title": "" }, { "docid": "0dac5256540c03c6f2780cb1f55e212f", "score": "0.6148452", "text": "function showCoordinates(e) {\n alert(e.latlng);\n}", "title": "" }, { "docid": "80f4d1bdfaab927766b60e55a3482698", "score": "0.6147974", "text": "function shapeGrab( evt ) {\n \n //picking shape based on mousedown event\n shape = $(this).attr('id');\n mousePositionLeft = event.pageX;\n mousePositionTop = event.pageY;\n difLeft = mousePositionLeft - startPositionLeft;\n difTop = mousePositionTop - startPositionTop;\n\n \n console.log(shape);\n console.log(startPositionLeft);\n console.log(startPositionTop);\n\n}", "title": "" }, { "docid": "3e4241a5b3d4929a5283e2571ccb5ce8", "score": "0.6147448", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n\tvar mousePos = new vec(evt.clientX - rect.left,evt.clientY - rect.top);\n\treturn mousePos;\n}", "title": "" }, { "docid": "1ae78a4442d077e324ec144160e61a65", "score": "0.614575", "text": "function getMousePos(evt) {\n var rect = canvas.getBoundingClientRect();\n mousePosX = evt.clientX - rect.left;\n mousePosY = evt.clientY - rect.top;\n}", "title": "" }, { "docid": "cba88b0a1400cab829f01b0a6ff506f1", "score": "0.6139132", "text": "function getXYfromEvent(e)\n{\n\tvar result = {x:0, y:0};\n\tif (e.pageX || e.pageY) { \n\t result.x = e.pageX;\n\t result.y = e.pageY;\n\t}\n\telse { \n\t result.x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; \n\t result.y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; \n\t} \n\tresult.x -= canvas.offsetLeft;\n\tresult.y -= canvas.offsetTop;\n\treturn result;\n}", "title": "" }, { "docid": "cd322fd284da9dc7704f87f530dfc53b", "score": "0.6125177", "text": "function getMousePos(canvas, evt){\n\tvar rect = canvas.getBoundingClientRect();\n\treturn{\n\t x: evt.clientX - rect.left,\n\t y: evt.clientY - rect.top\n\t};\n}", "title": "" }, { "docid": "383f9f6aeb086f22d12703c38d3dc79a", "score": "0.61161596", "text": "function getMousePos( canvas, evt )\r\n{\r\n var rect = canvas.getBoundingClientRect();\r\n return {\r\n x: Math.floor(( evt.clientX - rect.left ) / cellsize ),\r\n y: Math.floor(( evt.clientY - rect.top ) / cellsize )\r\n };\r\n}", "title": "" }, { "docid": "c70cdee1ae6c0cd322cd61bd4bbd507c", "score": "0.6107538", "text": "function getMousePos(canvas, evt) {\n\t var rect = canvas.getBoundingClientRect();\n\t return {\n\t x: evt.clientX - rect.left,\n\t y: evt.clientY - rect.top\n\t };\n\t}", "title": "" }, { "docid": "41d9edb3bebbcd0dd28d77d3716b0c5b", "score": "0.6106717", "text": "function getPosition(e) {\t\n\t\t\t\n\t\t\t\t// get origin top/left position \n\t\t\t\tvar top = conf.relative ? trigger.position().top : trigger.offset().top, \n\t\t\t\t\t left = conf.relative ? trigger.position().left : trigger.offset().left,\n\t\t\t\t\t pos = conf.position[0];\n\n\t\t\t\ttop -= tip.outerHeight() - conf.offset[0];\n\t\t\t\tleft += trigger.outerWidth() + conf.offset[1];\n\t\t\t\n\t\t\t\t// adjust Y\t\t\n\t\t\t\tvar height = tip.outerHeight() + trigger.outerHeight();\n\t\t\t\tif (pos == 'center') \t{ top += height / 2; }\n\t\t\t\tif (pos == 'bottom') \t{ top += height; }\n\t\t\t\n\t\t\t\t// adjust X\n\t\t\t\tpos = conf.position[1]; \t\n\t\t\t\tvar width = tip.outerWidth() + trigger.outerWidth();\n\t\t\t\tif (pos == 'center') \t{ left -= width / 2; }\n\t\t\t\tif (pos == 'left') \t{ left -= width; }\t \n\t\t\t\n\t\t\t\treturn {top: top, left: left};\n\t\t\t}", "title": "" }, { "docid": "0e0b9fb81672de69687a6c27f26575d6", "score": "0.6105234", "text": "function newPoint(e) {\n\tvar posx = 0;\n\tvar posy = 0;\n\tif (!e) var e = window.event;\n\tif (e.pageX || e.pageY) \t{\n\t\tposx = e.pageX;\n\t\tposy = e.pageY;\n\t} else if (e.clientX || e.clientY) \t{\n\t\tposx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\tposy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n\t}\n return Point(posx,posy);\n}", "title": "" }, { "docid": "f5a9054f291cf44ef340b3209d4d6d85", "score": "0.6101152", "text": "function showCoords(event) {\n var x = event.clientX;\n var y = event.clientY;\n}", "title": "" }, { "docid": "24a7dbfee8c734408fef4a9dd6fabc92", "score": "0.60950685", "text": "function getCursorPosition(e) {\n var x;\n var y;\n if (e.pageX != undefined && e.pageY != undefined)\n {\n x = e.pageX;\n y = e.pageY;\n }\n else\n {\n x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n }\n x -= $('#chart')[0].offsetLeft;\n y -= $('#chart')[0].offsetTop;\n \n return {\"x\": x - 0.5, \"y\": y - 0.5};\n}", "title": "" }, { "docid": "ab7b3ea0e27d39e0b51950f4d43676e6", "score": "0.60941046", "text": "function getPointer( event ) {\n\n\t\tif ( this.domElement.ownerDocument.pointerLockElement ) {\n\n\t\t\treturn {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\tbutton: event.button\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconst rect = this.domElement.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\tx: ( event.clientX - rect.left ) / rect.width * 2 - 1,\n\t\t\t\ty: - ( event.clientY - rect.top ) / rect.height * 2 + 1,\n\t\t\t\tbutton: event.button\n\t\t\t};\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "eb1ad225b667df190f98234a380298bd", "score": "0.6086467", "text": "_eventPoint(event) {\n // Needs access to the top level SVG element.\n // const point = document.getElementById('svg-frame').createSVGPoint();\n // point.x = event.clientX;\n // point.y = event.clientY;\n // const ctm = this.container.getScreenCTM();\n // const inverse = ctm.inverse();\n // const p = point.matrixTransform(inverse);\n\n // Top level SVG exposes this as a function in context available\n // to any child component.\n const p = this.context.transformPoint(event.clientX, event.clientY, this.container);\n\n // // Relative to the focused box\n // const t = {\n // x: p.x - this.props.domain.x,\n // y: p.y - this.props.domain.y\n // };\n\n // // Relative to the parent\n // const r = {\n // x: t.x + this.props.domain.x,\n // y: t.y + this.props.domain.y\n // };\n\n return [p.x, p.y];\n }", "title": "" }, { "docid": "48f65628537ed0d4be1f51eadb976632", "score": "0.60826725", "text": "function getPosition(e) {\n\n var targ = GetTarget(e);\n\n // jQuery normalizes the pageX and pageY\n // pageX,Y are the mouse positions relative to the document\n // offset() returns the position of the element relative to the document\n\t\tif( $(targ) && $(targ).offset() ){\n\t\t\tvar x = e.pageX - $(targ).offset().left;\n\t\t\tvar y = e.pageY - $(targ).offset().top;\n\t\t\treturn { \"x\": x, \"y\": y };\n\t\t}\n}", "title": "" }, { "docid": "172429b0182d3334b20ce9b555f0fdd2", "score": "0.60753864", "text": "function getMousePos(canvas, event) {\n\tvar rect = canvas.getBoundingClientRect();\n\t\treturn {\n\t\tx: event.clientX - rect.left,\n\t\ty: event.clientY - rect.top\n\t};\n}", "title": "" }, { "docid": "1c7b05c57cf063904da5687c27300828", "score": "0.6071561", "text": "function getCoords(evt) {\n const canvas = canvasRef.current\n // probably need to calculate some offset here and use canvas\n return {x: evt.clientX, y: evt.clientY}\n }", "title": "" }, { "docid": "70fe4626b145f62c88b4784167517175", "score": "0.60707974", "text": "function getPos(event) {\n var mouseX = event.pageX - getOffSet(event.target).left,\n mouseY = event.pageY - getOffSet(event.target).top;\n return {\n x: mouseX,\n y: mouseY\n };\n} //from quirksmode.org. Modified slightly to return obj", "title": "" }, { "docid": "6996aeefc6b6943f8e12ee524a54c2c0", "score": "0.6064636", "text": "function getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n }", "title": "" }, { "docid": "d37dad023950f7585dc6860f686734bc", "score": "0.60643095", "text": "function mousePos(evt) {\r\n let rect = canvas.getBoundingClientRect();\r\n const root = document.documentElement;\r\n let mouseX = evt.clientX - rect.left - root.scrollLeft;\r\n let mouseY = evt.clientY - rect.top - root.scrollTop;\r\n return {\r\n x: mouseX,\r\n y: mouseY\r\n };\r\n\r\n }", "title": "" }, { "docid": "a830fdf3ccd7f50a0ee6cd789bd613e1", "score": "0.6062836", "text": "function xCoords(event) {\n var x = event.clientX;\n return x;\n}", "title": "" }, { "docid": "073b62a97ab4b0adc987496b5ddeced8", "score": "0.6062587", "text": "getMouseVec2(e){ return {x:e.pageX - this.offsetX, y:e.pageY - this.offsetY}; }", "title": "" }, { "docid": "01ec52b39f6886b816a42267f7ed33f0", "score": "0.60552055", "text": "function getCursorPositionOnCanvas(event) {\n var rect = canvas.getBoundingClientRect();\n var x = (event.clientX - rect.left) * (canvas.width / rect.width);\n var y = (event.clientY - rect.top) * (canvas.width / rect.width);\n return new Vector(x, y);\n}", "title": "" }, { "docid": "375e047bfc5f4779c72557570ee7c462", "score": "0.6053786", "text": "function addPoint(evt) {\n var latitude = evt.mapPoint.getLatitude();\n var longitude = evt.mapPoint.getLongitude();\n map.infoWindow.setTitle(\"Coordinates\");\n map.infoWindow.setContent(\"lat/lon : \" + latitude.toFixed(2) + \", \" + longitude.toFixed(2) +\n \"<br>screen x/y : \" + evt.screenPoint.x + \", \" + evt.screenPoint.y\n );\n map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));\n }", "title": "" }, { "docid": "3c6ace47417ed92fc7ba2a7aa2f094e0", "score": "0.6053707", "text": "function getMousePos(canvas, event) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top\n };\n }", "title": "" } ]
eeb00c8b13e37d730dbb3093bbb1f966
===================================================== ===================================== build Style Obj =====================================================
[ { "docid": "4353d30a107318f9924fac6a0cd30f11", "score": "0.54338646", "text": "function buildStyleObj(_ref2) {\n var styleStuff = _ref2.styleStuff,\n genStyles = _ref2.genStyles,\n args = _ref2.args,\n colors = _ref2.colors,\n caching = _ref2.caching,\n cached = _ref2.cached;\n\n\n if (!caching) {\n return genStyles(styleStuff, args, colors);\n }\n // quick test\n if (cached.value && cached.source[0] === args[0] && cached.source[0] === args[1]) {\n return cached.value;\n }\n // deep test\n var key = \"\" + JSON.stringify(args[0]) + JSON.stringify(args[1]);\n if (key === cached.key) {\n return cached.value;\n }\n\n cached.key = key;\n cached.source[0] = args[0];\n cached.source[1] = args[1];\n cached.value = genStyles(styleStuff, args, colors);\n return cached.value;\n}", "title": "" } ]
[ { "docid": "178c0e942b59b1c29e4be9c50a731a64", "score": "0.5691449", "text": "function compile(builder, options) {\n var sl = new Shoelace(builder, options);\n var buildType = builder.buildType;\n builder.buildType = function(type, fn, process) {\n if (type !== 'styles') return buildType.apply(builder, arguments);\n buildType.call(builder, type, function() {\n sl.build(fn);\n }, process);\n };\n builder.hook('before styles', function(pkg) {\n sl.load(pkg);\n });\n}", "title": "" }, { "docid": "97bfb6d811625769466786109c0a9817", "score": "0.5600914", "text": "function createStyle() {\r\n\t\tvar style = dst.cn('style');\r\n\t\tstyle.type = 'text/css';\r\n\t\tstyle.innerHTML='\\nbody {color:#000; font-size:10pt; background:#FFF; margin-top:0px; margin-bottom:0px; ' +\r\n\t\t\t\t'margin-left:0px; margin-right:0px; font-family:Verdana, Arial, Helvetica, sans-serif;}\\n' +\r\n\t\t\t\t'h1, h2, h3, span, form, img, li {margin:0; padding:0;}\\n' +\r\n\t\t\t\t'h1 {font-size:18pt;}\\n' +\r\n\t\t\t\t'.f8 {font-size:8pt;}\\n' +\r\n\t\t\t\t'.map_infobox_grey {background-color:#F0F0F0; width:100%;}\\n' +\r\n\t\t\t\t'table.map_infobox_grey tr {background-color: #FFF;}\\n' +\r\n\t\t\t\t'.c {color:#C0C0C0;}\\n' +\r\n\t\t\t\t'.b {font-weight:bold}\\n' +\r\n\t\t\t\t'.tbg {background-color: #C0C0C0; width:100%; text-align:center; font-size:10pt;}\\n' +\r\n\t\t\t\t'table.tbg tr {background-color: #FFFFFF;}\\n' +\r\n\t\t\t\t'.rbg {background-color: #FFFFFF; font-weight:bold; background-image: url(' + imgData['tbg'] + ');}\\n' +\r\n\t\t\t\t'table.tbg tr.cbg1 td, td.cbg1 {background-color:#F5F5F5}\\n' +\r\n\t\t\t\t'table.tbg td.cbg2 {background-color:#71D000}\\n' +\r\n\t\t\t\t'table.tbg tr.s7 td, td.s7 {padding-left:7px; text-align:left}\\n' +\r\n\t\t\t\t'table.tbg tr.r7 td, td.r7 {padding-right:7px; text-align:right}\\n' +\r\n\t\t\t\t'.slr3 { padding-left:3px; padding-right:3px; text-align:center}\\n' +\r\n\t\t\t\t'table.tbg td.ou {border-top:1px solid #71D000; border-bottom:1px solid #71D000; background-color:#F0FFF0; }\\n' +\r\n\t\t\t\t'table.tbg td.li {border-left:1px solid #71D000 }\\n' +\r\n\t\t\t\t'table.tbg td.re {border-right:1px solid #71D000}\\n';\r\n\r\n\t\treturn style;\r\n\t}", "title": "" }, { "docid": "a2b2327f8f7533bbe1d8260ee0a05dbf", "score": "0.55497277", "text": "build() {\n\n\t\t}", "title": "" }, { "docid": "2a3a32e127a091979795f101a0f0b145", "score": "0.5546184", "text": "function newBuildObject() {\n\twindow.currentBuild = {\n\t\tclassName : window.className,\n\t\tbuildName : 'Build Name',\n\t\tgameMode : 0,\n\t\ttraits : {\n\t\t\tline1 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t},\n\t\t\tline2 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t},\n\t\t\tline3 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t},\n\t\t\tline4 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t},\n\t\t\tline5 : {\n\t\t\t\ttotal : 0,\n\t\t\t\tadept : 0,\n\t\t\t\tmaster : 0,\n\t\t\t\tgrandmaster : 0\n\t\t\t}\n\t\t}\n\t};\n}", "title": "" }, { "docid": "52c1a631152c6e8a8a208af35b98d2a5", "score": "0.54384315", "text": "build() {}", "title": "" }, { "docid": "efa827701d4a4d6f9c6ed08a5f450a7b", "score": "0.54239756", "text": "function style(){\n var styles = Array.prototype.slice.call(arguments);\n var stored = new objct.e(store, objct.e.deep(ownerStyles));\n var returnStyles = [], style, extend, k;\n \n styles = flattenArray(styles);\n\n // flatten css \"classes\" and mix everything together -> output styles {};\n for(var i = 0; i<styles.length; i++) {\n style = styles[i];\n if(typeof style === \"string\") {\n if(!testConditional(style)) continue;\n // add namespace\n style = getNamespace(moduleNamespace, styles[i]);\n // get class\n style = getClassFromString(style, stored);\n }\n if(typeof style === \"object\") {\n\n // EXTEND STYLE\n if(typeof style._extend !== \"undefined\") {\n style._extend = typeof style._extend === \"string\" ?\n [style._extend]:\n style._extend;\n\n for(k=0; k<style._extend.length; k++) {\n if(!testConditional(style._extend[k])) continue;\n // add namespace\n extend = getNamespace(moduleNamespace, style._extend[k]);\n // get class\n extend = getClassFromString(extend, stored);\n\n if(typeof extend === \"object\"){\n returnStyles.push(extend);\n }\n }\n }\n\n returnStyles.push(style);\n }\n }\n\n styles = new objct(returnStyles);\n \n //cleanup \n returnStyles = {};\n for(style in styles){\n if(style !== \"_extend\" && (typeof styles[style] === \"string\" || typeof styles[style] === \"number\")) {\n returnStyles[style]= styles[style];\n }\n }\n return returnStyles;\n }", "title": "" }, { "docid": "79b0613abc029a43451969c5d0cceb17", "score": "0.537534", "text": "function styl(style) {\n// allow multiple style object args\n for (var i = 0; i < arguments.length; i++) {\n// extract keys from each style object\n \tfor (var key in arguments[i]) {\n// check that it is a valid key\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n \tself.style[key] = arguments[i][key]\n \t }\n \t}\n }\n return self;\n }", "title": "" }, { "docid": "ee6104bedd8f36f77b8d815804ad89eb", "score": "0.5351208", "text": "function finalize(lang) {\n var file = \"\";\n var lineEnding = \"\";\n if(lang == \"c\")\n lineEnding = \";\";\n \n file += langComment(lang, \"Autogenerated file; do not edit.\");\n if(lang == \"c\") {\n file += \"#include <lvgl/lvgl.h>\\n\\n\";\n } else if(lang == \"micropython\") {\n file += \"import lvgl as lv\\n\\n\";\n }\n\n file += \"\\n\\n\";\n file += \"# Initialize a custom theme*/\\n\";\n file += `class style_css_theme(lv.theme_t):\n def __init__(self):\n super().__init__()\n\n # This theme is based on active theme\n base_theme = lv.theme_get_act()\n self.copy(base_theme)\n\n # This theme will be applied only after base theme is applied\n self.set_base(base_theme)\n\n # Set the \"apply\" callback of this theme to our custom callback\n self.set_apply_cb(self.apply)\n\n # Activate this theme\n self.set_act()\n \n def apply(self, theme, obj, name):\n style_css_apply_cb(theme, obj, name)\\n\\ntheme = style_css_theme()\\n`;\n \n file += styleGen(lang, lineEnding, classes);\n file += styleGen(lang, lineEnding, objectTypeStyles);\n\n if(lang == \"c\")\n file += \"}\\n\";\n\n if(lang == \"c\")\n file += \"\\nstatic void lv_style_css_apply_cb(lv_theme_t * th, lv_obj_t * obj, lv_theme_style_t name) {\\n\";\n else if(lang == \"micropython\")\n file += \"\\ndef style_css_apply_cb(th, obj, name):\\n\";\n if(lang == \"c\") {\n file += \" lv_style_list_t * list;\\n\\n\";\n file += \" switch(name) {\\n\";\n }\n\n var widgetParts = {};\n var widgetNames = new Set(Object.keys(objectTypeStyles).map(wid => {\n var words = wid.split(\"_part_\");\n var widgetName = words[0];\n var widgetPartObj = widgetParts[widgetName] || [];\n widgetParts[widgetName] = widgetPartObj;\n widgetPartObj.push(words[1]);\n return widgetName;\n }));\n widgetNames.forEach(wid => {\n if(lang == \"c\")\n file += ` case LV_THEME_${wid.toUpperCase()}:\\n`;\n else if(lang == \"micropython\")\n file += ` if name == lv.THEME.${wid.toUpperCase()}:\\n`;\n widgetParts[wid].forEach(part => {\n if(lang == \"c\") {\n file += ` list = lv_obj_get_style_list(obj, LV_${wid.toUpperCase()}_PART_${part.toUpperCase()});\\n`;\n file += ` _lv_style_list_add_style(list, &lv_style_css_wid_${wid}_part_${part});\\n`;\n file += ` break;\\n`;\n } else if(lang == \"micropython\")\n file += ` obj.add_style(lv.${wid}.PART.${part.toUpperCase()}, style_css_wid_${wid}_part_${part})\\n`;\n });\n });\n if(lang == \"c\") {\n file += ` default:\\n`;\n file += ` break;\\n`;\n file += \" }\\n\";\n file += \"}\\n\";\n }\n \n return file;\n}", "title": "" }, { "docid": "bf94156f287c938279269dd0ed514990", "score": "0.53376544", "text": "function styl(style) {\n// allow multiple style object args\n for (var i = 0; i < arguments.length; i++) {\n// extract keys from each style object\n for (var key in arguments[i]) {\n// check that it is a valid key\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n for (var j = 0; j < selves.length; j++) {\n if (Object.prototype.hasOwnProperty.call(selves, j)) {\n selves[j].style[key] = arguments[i][key]\n } \n }\n }\n }\n }\n }", "title": "" }, { "docid": "554df988854472484bfeccc775d9a70e", "score": "0.5316786", "text": "function vendor(style) {\n for (var key in style)\n style['-' + prefix + '-' + key] = style[key]\n return style\n}", "title": "" }, { "docid": "5c13cbe3caff794b7db8a65d0c79f4c9", "score": "0.5315541", "text": "function buildElem(_ref) {\n var _element;\n\n var elemName = _ref.elemName,\n args = _ref.args,\n styleCSS = _ref.styleCSS,\n styleName = _ref.styleName,\n options = _ref.options,\n replacedStyle = _ref.replacedStyle,\n colors = _ref.colors;\n\n\n elemName = elemName[0] || args[1];\n var inlineStyle = null; //replacedStyle[styleName]();\n\n var baseStyle = styleCSS[styleName] && styleCSS[styleName].base || {};\n for (var propN in styleCSS[styleName]) {\n //if(specialCharacters.includes(propN[0]) || !!propN.match(new RegExp(`[${specialInnerCharacters}]`, \"gi\"))){\n if (/^[a-zA-Z0-9-]+$/.test(propN) === false) {\n baseStyle[propN] = styleCSS[styleName][propN];\n }\n }\n //splict \":\" and \"@\" from all over styles\n\n var _separateCssStyle = (0, _utils.separateCssStyle)(baseStyle),\n css = _separateCssStyle.css,\n style = _separateCssStyle.style;\n /*\n const cssPropNames = Object.keys(styleCSS[styleName])\n .filter(stylePropName => stylePropName[0] === \"@\" || stylePropName[0] === \":\");\n */\n\n\n var randomClassName = \"\";\n\n //if(0 < cssPropNames.length){\n if (css) {\n randomClassName = \"react-outline-\";\n if (!global.__TEST__) randomClassName += (0, _utils.makeid)();\n _utils.pubsub.publish(randomClassName, (0, _utils.genCss)({ randomClassName: randomClassName, css: css, styleCSS: styleCSS, colors: colors, style: style, styleName: styleName }));\n inlineStyle = {};\n }\n\n return (0, _element3.default)((_element = { elemName: elemName, css: css, styleCSS: styleCSS, inlineStyle: inlineStyle, style: style, styleName: styleName, colors: colors, randomClassName: randomClassName, options: options }, _defineProperty(_element, 'randomClassName', randomClassName), _defineProperty(_element, 'replacedStyle', replacedStyle), _element));\n}", "title": "" }, { "docid": "a463b7a08a31052db0df10e122a4c8f7", "score": "0.53016233", "text": "function makeStyle() {\n // center page\n if (!/\\d\\d-\\d\\d_\\d\\d-\\d\\d.HTML$/.test(BVBBPP.URL)) {\n var div = create(\"div\", null, \"id\", \"centerstyle\");\n while (document.body.hasChildNodes()) {\n div.appendChild(document.body.firstChild);\n }\n document.body.appendChild(div);\n }\n\n removeParents(document, \"i\");\n removeElements(document, \"style\");\n removeElements(document, \"h2\", /Fenster schlie/);\n removeElements(document, \"table\", /Fenster schlie/);\n\n // set css class when color attributes are present\n var elem = document.body.getElementsByTagName(\"*\");\n for (var j = 0; j < elem.length; j++) {\n var e = elem[j];\n if (e.getAttribute(\"border\") === \"0\" || e.getAttribute(\"style\") === \"border: 0\") {\n e.setAttribute(\"class\", \"borderless\");\n }\n var bgcolor = e.getAttribute(\"bgcolor\");\n var fgcolor = e.getAttribute(\"color\");\n for (var col in Styles) {\n var color = Styles[col];\n if (bgcolor === color.css) {\n e.setAttribute(\"class\", color.bg);\n }\n if (fgcolor === color.css) {\n e.setAttribute(\"class\", e.getAttribute(\"class\") + \" \" + color.col);\n }\n }\n }\n\n var icon = document.createElement(\"link\");\n icon.id = \"icon\";\n icon.rel = \"shortcut icon\";\n icon.href = \"http://www.bvbb.net/fileadmin/user_upload/pics/logo.jpg\";\n document.head.appendChild(icon);\n}", "title": "" }, { "docid": "e8bf019ef42916362a36d21b84f7798e", "score": "0.5268358", "text": "function startBuild(){\n\tvar b = $(\"body\");\n\tvar descText = \"I am a front-end \" + build(\"a\", \"web-developer\", \"\", \"web\") + \" and \" + build(\"a\", \".NET developer\", \"\", \"net\") + \".\";\n\tdescText += \"<br>\";\n\tdescText += \"I live in Kathmandu and I have completed GCE A-levels.\";\n\telement = build(\"div\", build(\"div\", build(\"h2\", \"Hello!\") + build(\"h1\",\"I am Oshan.\") + build(\"h3\",descText), \"main\"), \"landing\");\n\tb.html(element);\n\tcreateAttributes();\n\taddCSS();\n}", "title": "" }, { "docid": "146edb751ff2982c131fb02a0fc672ab", "score": "0.5264344", "text": "function Jw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "80bb6b344d13607e0b05907befb388d2", "score": "0.5236099", "text": "function addStyleDev (styles, list) {\n for (var i = 0; i < list.length; i++) {\n var parts = list[i].parts\n for (var j = 0; j < parts.length; j++) {\n var part = parts[j]\n styles[part.id] = {\n ids: [part.id],\n css: part.css,\n media: part.media\n }\n }\n }\n}", "title": "" }, { "docid": "4a655d3b6c82be9a16eee0b37cfc9a08", "score": "0.5228591", "text": "function scaffold() {\n\n console.log('→ Building'.cyan);\n\n exec('mkdir -p ' + [config.app_style, config.app_script, config.public_style, config.public_script].join(' '));\n exec('cp lib/template/style.styl ' + config.app_style);\n exec('cp lib/template/main.js ' + config.app_script);\n exec('cp lib/template/style.css ' + config.public_style);\n exec('cp lib/template/index.html ' + config.public_view);\n\n console.log('✔ done'.green);\n\n}", "title": "" }, { "docid": "8c47205df173e0a0f4c995ac6f1cb08f", "score": "0.52265924", "text": "function jw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "f5999700748866363e5e928daacb4601", "score": "0.52092314", "text": "function StyleSheetList() {}", "title": "" }, { "docid": "68c7548735ba2e83b4c8557b2bf557d8", "score": "0.51771796", "text": "function extractStyleParts() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var classes = [];\r\n var objects = [];\r\n var stylesheet = Stylesheet_1.Stylesheet.getInstance();\r\n function _processArgs(argsList) {\r\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\r\n var arg = argsList_1[_i];\r\n if (arg) {\r\n if (typeof arg === 'string') {\r\n if (arg.indexOf(' ') >= 0) {\r\n _processArgs(arg.split(' '));\r\n }\r\n else {\r\n var translatedArgs = stylesheet.argsFromClassName(arg);\r\n if (translatedArgs) {\r\n _processArgs(translatedArgs);\r\n }\r\n else {\r\n // Avoid adding the same class twice.\r\n if (classes.indexOf(arg) === -1) {\r\n classes.push(arg);\r\n }\r\n }\r\n }\r\n }\r\n else if (Array.isArray(arg)) {\r\n _processArgs(arg);\r\n }\r\n else if (typeof arg === 'object') {\r\n objects.push(arg);\r\n }\r\n }\r\n }\r\n }\r\n _processArgs(args);\r\n return {\r\n classes: classes,\r\n objects: objects\r\n };\r\n}", "title": "" }, { "docid": "68c7548735ba2e83b4c8557b2bf557d8", "score": "0.51771796", "text": "function extractStyleParts() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var classes = [];\r\n var objects = [];\r\n var stylesheet = Stylesheet_1.Stylesheet.getInstance();\r\n function _processArgs(argsList) {\r\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\r\n var arg = argsList_1[_i];\r\n if (arg) {\r\n if (typeof arg === 'string') {\r\n if (arg.indexOf(' ') >= 0) {\r\n _processArgs(arg.split(' '));\r\n }\r\n else {\r\n var translatedArgs = stylesheet.argsFromClassName(arg);\r\n if (translatedArgs) {\r\n _processArgs(translatedArgs);\r\n }\r\n else {\r\n // Avoid adding the same class twice.\r\n if (classes.indexOf(arg) === -1) {\r\n classes.push(arg);\r\n }\r\n }\r\n }\r\n }\r\n else if (Array.isArray(arg)) {\r\n _processArgs(arg);\r\n }\r\n else if (typeof arg === 'object') {\r\n objects.push(arg);\r\n }\r\n }\r\n }\r\n }\r\n _processArgs(args);\r\n return {\r\n classes: classes,\r\n objects: objects\r\n };\r\n}", "title": "" }, { "docid": "ed3c9d1283a7f791dbf0fc5c4cc55331", "score": "0.5173882", "text": "function add_css() {\n\tvar style = createElement(\"style\");\n\tstyle.id = 'svelte-1bf71pv-style';\n\tstyle.textContent = \".main.svelte-1bf71pv{height:3rem;background-color:#383838;width:100%;user-select:none;overflow:hidden;cursor:default}.logo.svelte-1bf71pv{width:2.5rem;font-size:2.5rem;margin:.25rem}.item.svelte-1bf71pv{color:white;text-align:center;height:2.5rem;position:relative;float:left;margin:.25rem;margin-left:0.4rem;display:flex;justify-content:center;align-content:center;flex-direction:column}button.svelte-1bf71pv{background-color:#383838;border:0px;outline:none;cursor:pointer}\";\n\tappendNode(style, document.head);\n}", "title": "" }, { "docid": "ff0c7f4e812f0cbbf266c65bb3526032", "score": "0.5148693", "text": "function objToCss(style) {\n return Object.entries(style)\n .map(([k, v]) => `${k}:${v}`)\n .join(\";\");\n}", "title": "" }, { "docid": "b2de4e4b32f77185f2032a00150dff60", "score": "0.5140903", "text": "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = Stylesheet_1.Stylesheet.getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "title": "" }, { "docid": "fb8671257e8036112c1f110b3f92244b", "score": "0.50829065", "text": "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__[\"Stylesheet\"].getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "title": "" }, { "docid": "fb8671257e8036112c1f110b3f92244b", "score": "0.50829065", "text": "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__[\"Stylesheet\"].getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "title": "" }, { "docid": "04ce295a79552d5a97f53b0d10b1334a", "score": "0.50806946", "text": "function add_css$2() {\n\tvar style = createElement(\"style\");\n\tstyle.id = 'svelte-1w4hdg9-style';\n\tstyle.textContent = \".main.svelte-1w4hdg9{background-color:#777777;height:100%;width:150px;position:relative;float:left;display:inline-flex;margin-left:1rem}\";\n\tappendNode(style, document.head);\n}", "title": "" }, { "docid": "a59629a49d2719cee29d1af9d165b2f5", "score": "0.50720286", "text": "function buildLegoObj(creatorName, color) {\n return ({\n creator: creatorName,\n color: color\n })\n}", "title": "" }, { "docid": "6cd3fac65fcdb47ac1ffbdd8f080ed7d", "score": "0.50601375", "text": "function compile() {\n\t\tvar compiledCss = '';\n\n\t\tif (!css.sheet){\n\t\t\tloadEditorStyleSheet();\n\t\t}\n\n\t\tif (css.sheet) {\n\t\t\tvar activeRules = getActiveRules();\n\t\t\tvar combinedRules = combineDupicateRules(activeRules);\n\n\t\t\t_.forEach(combinedRules, function(rule) {\n\t\t\t\tcompiledCss += rule + '\\n\\n';\n\t\t\t});\n\t\t}\n\n\t\tif (css.unsupportedRules) {\n\t\t\t_.forEach(css.unsupportedRules, function(ruleObj) {\n\t\t\t\tvar ruleText = ruleObj.selectorText + '{ ';\n\n\t\t\t\t_.forEach(ruleObj.declarations, function(declaration) {\n\t\t\t\t\truleText += declaration + '; ';\n\t\t\t\t});\n\n\t\t\t\truleText += '}';\n\t\t\t\tcompiledCss += ruleText + '\\n\\n';\n\t\t\t});\n\t\t}\n\n\t\tloadCss(compiledCss); //update css.sheet \n\t\t\n\t\treturn compiledCss;\n\t}", "title": "" }, { "docid": "eea7b8f6a6b1e147c9fe4548017f0c10", "score": "0.50600964", "text": "_setupStyles() {\n // declare fonts to be used\n this.doc.declareFont('Ubuntu Mono','monospace',FontPitch.Variable);\n this.doc.declareFont('Arial','Arial',FontPitch.Variable);\n // add standard style\n var style = new ParagraphStyle();\n style.setFontSize( 10 );\n style.setFontName('Arial');\n this.standardStyle = style;\n // add table attributes style\n var style = new ParagraphStyle();\n style.setFontSize( 8 );\n style.setFontName('Arial');\n this.tableStyle = style;\n // add table header style\n var style = new ParagraphStyle();\n style.setFontSize( 12 );\n style.setFontName('Arial');\n style.setTypeface(Typeface.Bold);\n this.tableHeaderStyle = style;\n // Add code style\n style = new ParagraphStyle();\n style.setFontSize( 6 );\n style.setFontName('Ubuntu Mono');\n this.codeStyle = style;\n // Generate the cell styles used for Tables\n // cst01, cst02 and cst03 are used for single rows and header rows\n // for multiple rows that should be surrounded by a thicker line:\n // cst11, cst12 and cst13 are used for the top row\n // cst21, cst22 and cst23 are used for the intermediate rows (only vertical lines)\n // cst31, cst32 and cst33 are used for the end row\n //\n var none = 'none';\n var thick = '1pt solid #000000';\n var thin = '0.5pt solid #000000';\n this.cst01 = new TableCellStyle()\n this.cst01.addBorder(DirectionType.top, thick);\n this.cst01.addBorder(DirectionType.left, thick);\n this.cst01.addBorder(DirectionType.bottom, thick);\n this.cst01.addBorder(DirectionType.right, thin);\n this.cst02 = new TableCellStyle()\n this.cst02.addBorder(DirectionType.top, thick);\n this.cst02.addBorder(DirectionType.left, none);\n this.cst02.addBorder(DirectionType.bottom, thick);\n this.cst02.addBorder(DirectionType.right, thin);\n this.cst03 = new TableCellStyle()\n this.cst03.addBorder(DirectionType.top, thick);\n this.cst03.addBorder(DirectionType.left, none);\n this.cst03.addBorder(DirectionType.bottom, thick);\n this.cst03.addBorder(DirectionType.right, thick);\n this.cst11 = new TableCellStyle()\n this.cst11.addBorder(DirectionType.top, thick);\n this.cst11.addBorder(DirectionType.left, thick);\n this.cst11.addBorder(DirectionType.bottom, none);\n this.cst11.addBorder(DirectionType.right, thin);\n this.cst12 = new TableCellStyle()\n this.cst12.addBorder(DirectionType.top, thick);\n this.cst12.addBorder(DirectionType.left, none);\n this.cst12.addBorder(DirectionType.bottom, none);\n this.cst12.addBorder(DirectionType.right, thin);\n this.cst13 = new TableCellStyle()\n this.cst13.addBorder(DirectionType.top, thick);\n this.cst13.addBorder(DirectionType.left, none);\n this.cst13.addBorder(DirectionType.bottom, none);\n this.cst13.addBorder(DirectionType.right, thick);\n this.cst21 = new TableCellStyle()\n this.cst21.addBorder(DirectionType.top, none);\n this.cst21.addBorder(DirectionType.left, thick);\n this.cst21.addBorder(DirectionType.bottom, none);\n this.cst21.addBorder(DirectionType.right, thin);\n this.cst22 = new TableCellStyle()\n this.cst22.addBorder(DirectionType.top, none);\n this.cst22.addBorder(DirectionType.left, none);\n this.cst22.addBorder(DirectionType.bottom, none);\n this.cst22.addBorder(DirectionType.right, thin);\n this.cst23 = new TableCellStyle()\n this.cst23.addBorder(DirectionType.top, none);\n this.cst23.addBorder(DirectionType.left, none);\n this.cst23.addBorder(DirectionType.bottom, none);\n this.cst23.addBorder(DirectionType.right, thick);\n this.cst31 = new TableCellStyle()\n this.cst31.addBorder(DirectionType.top, none);\n this.cst31.addBorder(DirectionType.left, thick);\n this.cst31.addBorder(DirectionType.bottom, thick);\n this.cst31.addBorder(DirectionType.right, thin);\n this.cst32 = new TableCellStyle()\n this.cst32.addBorder(DirectionType.top, none);\n this.cst32.addBorder(DirectionType.left, none);\n this.cst32.addBorder(DirectionType.bottom, thick);\n this.cst32.addBorder(DirectionType.right, thin);\n this.cst33 = new TableCellStyle()\n this.cst33.addBorder(DirectionType.top, none);\n this.cst33.addBorder(DirectionType.left, none);\n this.cst33.addBorder(DirectionType.bottom, thick);\n this.cst33.addBorder(DirectionType.right, thick);\n }", "title": "" }, { "docid": "19f7d0eaf167d46684d62a4688a5297e", "score": "0.50534374", "text": "function add_css$4() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-fwoihq-style\";\n\tstyle.textContent = \"summary.hier-summary.svelte-fwoihq{color:var(--text-title-h2);font-size:larger}summary.svelte-fwoihq{color:var(--text-title-h3)}h5.breadcrumbs-header.svelte-fwoihq{color:var(--text-title-h5)}ol.markdown-preview-view.svelte-fwoihq{padding-top:3px;padding-bottom:5px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "a3b634ff85034ac35193be95376d5701", "score": "0.50523645", "text": "compileStyle(style) {\n if (style.when !== undefined) {\n try {\n style._whenExpr = Array.isArray(style.when)\n ? Expr_1.Expr.fromJSON(style.when, this.m_definitions, this.m_definitionExprCache)\n : Expr_1.Expr.parse(style.when);\n // search for usages of '$layer' and any other\n // special symbol that can be used to speed up the evaluation\n // of the `when` conditions associated to this `style`.\n this.m_styleConditionClassifier.classify(style);\n if (style._whenExpr !== undefined) {\n style._whenExpr = style._whenExpr.intern(this.m_exprPool);\n }\n }\n catch (err) {\n logger.log(\"failed to evaluate expression\", JSON.stringify(style.when), \"error\", String(err));\n }\n }\n if (Array.isArray(style.styles)) {\n style.styles.forEach(nestedStyle => this.compileStyle(nestedStyle));\n }\n }", "title": "" }, { "docid": "dc442ec0907a2dc1295271cf5d40718d", "score": "0.5041119", "text": "function makeCSSManager(O){var D=true;\nfunction I(S){var R=document.styleSheets;for(var P=0;P<R.length;P++){var Q=R[P];if(Q.title==S){return Q;\n}}return null;}var A=I(O);function F(){return(A.cssRules||A.rules);}function N(P){if(A.deleteRule){A.deleteRule(P);\n}else{A.removeRule(P);}}function J(Q,P,R){if(!R){if(A.insertRule){A.insertRule(P+\" {}\",Q);}else{A.addRule(P,null,Q);\n}}else{var S=P+\" {\"+(R||\"\")+\"}\";if(A.insertRule){A.insertRule(S,Q);}else{A.addRule(P,R,Q);}}}var C=[];\nfunction G(Q){for(var P=0;P<C.length;P++){if(C[P]==Q){return P;}}return -1;}function E(P,R){if(D){var Q=G(P);\nif(Q<0){J(0,P,R);C.splice(0,0,P);Q=0;}return F().item(Q).style;}else{B[P]={};return B[P];}}var B={};function L(){while(C.length){B[C[0]]=E(C[0]);\nH(C[0]);}D=false;}function K(){return D;}function M(){D=true;for(var P in B){var Q=B[P].cssText;if(Q){E(P,String(Q));\n}else{var R=E(P);for(k in B[P]){if(B[P][k]){R[k]=B[P][k];}}}delete B[P];}}function H(Q){if(D){var P=G(Q);\nif(P>=0){N(P);C.splice(P,1);}}else{B[Q];}}return{selectorStyle:E,removeSelectorStyle:H,disable:L,enable:M,isEnabled:K,info:function(){return C.length+\":\"+F().length;\n}};}", "title": "" }, { "docid": "336f8d7cb5cfc653a02893de6e1b95f2", "score": "0.5040473", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-lrqbdu-style\";\n \tstyle.textContent = \"@keyframes svelte-lrqbdu-dash-frame{100%{stroke-dashoffset:0}}.knob-control__range.svelte-lrqbdu{fill:none;transition:stroke .1s ease-in}.knob-control__value.svelte-lrqbdu{animation-name:svelte-lrqbdu-dash-frame;animation-fill-mode:forwards;fill:none}.knob-control__text-display.svelte-lrqbdu{font-size:1.3rem;text-align:center}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "ed62f41446ade8a0fef833c9a0f87b80", "score": "0.5036049", "text": "function createCSS() {\r\n\t// Stretch background if enabled\r\n\tvar backgroundForBody = '';\r\n\tif (gcta['scrollType'] == 'stretch') {\r\n\t\tdoc2.getElementById('StretchDivImage').src = gcta['bgURL'];\r\n\t} else {\r\n\t\tdoc2.getElementById('StretchDivImage').src = '';\r\n\t\tbackgroundForBody = gcta['bgURL'];\r\n\t}\r\n\r\n\t// Create the CSS\r\n\tcss = '' +\r\n\t\t'.cP {background: url(\"'+backgroundForBody+'\") '+gcta['repeatStyle']+' '+gcta['scrollType']+' center center '+gcta['bgColor']+' !important;} ' + // Background\r\n\t\t'.TM, .TL {-moz-border-radius: 10px; border: 1px solid '+gcta['sideMoreBorder']+'; background: none repeat scroll 0 0 '+gcta['sideMoreBG']+'; opacity: '+gcta['sideMoreOpacity']+';} ' + // Side 'More' Link Background\r\n\t\t'#tintDiv {background-color: '+gcta['bgTint']+'; opacity: '+gcta['bgTintStrength']+'; width: 100%; height: 100%; position: fixed; top: 0pt; left: 0pt; z-index: -10000;} ' + // Background Tint\r\n\t\t'.qp {background: none; background-color: rgba('+HexToR(gcta['headerColorHex'])+', '+HexToG(gcta['headerColorHex'])+', '+HexToB(gcta['headerColorHex'])+', '+gcta['headerOpacity']+') !important;} ' + // Header\r\n\t\t'.T0, .TZ {background: none; background-color: rgba('+HexToR(gcta['moduleColor'])+', '+HexToG(gcta['moduleColor'])+', '+HexToB(gcta['moduleColor'])+', '+gcta['moduleOpacity']+') !important;} ' + // Module\r\n\t\t'.vC, .s .pt {background-color: transparent !important;} ' + // More Module Stuff\r\n\t\t'.pt, .pl, .pU {background-color: transparent !important;} ' + // Module Stuff - Quick Links fix\r\n\t\t'.q0CeU, .pk {opacity: '+gcta['mainOpacity']+' !important;} ' + // Main Area\r\n\t\t\r\n\t\t//Outer border\r\n\t\t'.z .p, .y .p, .z .o, .y .o, .y .m, .z .q, .y .q, .z .i, .y .i, .z .j, .y .j, .z .h, .y .h, .z .mq, .nZ {background-color: rgba('+HexToR(gcta['canvasMainBorderColor'])+', '+HexToG(gcta['canvasMainBorderColor'])+', '+HexToB(gcta['canvasMainBorderColor'])+', '+gcta['canvasMainBorderOpacity']+')!important;}.mq{margin-top: 0px!important;}.z .n{border-left:4px solid rgba('+HexToR(gcta['canvasMainBorderColor'])+', '+HexToG(gcta['canvasMainBorderColor'])+', '+HexToB(gcta['canvasMainBorderColor'])+', '+gcta['canvasMainBorderOpacity']+') !important;margin-left:0!important;}.z .k{border-right:4px solid rgba('+HexToR(gcta['canvasMainBorderColor'])+', '+HexToG(gcta['canvasMainBorderColor'])+', '+HexToB(gcta['canvasMainBorderColor'])+', '+gcta['canvasMainBorderOpacity']+') !important;margin-right:0!important;}.z .n, .y .n, .z .m {background-color: transparent!important;}' +\r\n\t\t\r\n\t\t// Email Table Empty Space BG\r\n\t\t'.TB {background-color: rgba('+HexToR(gcta['canvasMainEmptySpaceColor'])+', '+HexToG(gcta['canvasMainEmptySpaceColor'])+', '+HexToB(gcta['canvasMainEmptySpaceColor'])+', '+gcta['canvasMainEmptySpaceOpacity']+')!important;} .TC {border-bottom: 0!important;}' +\r\n\t\t\r\n\t\t// Button panel\r\n\t\t'.A1 {background-color: rgba('+HexToR(gcta['canvasMainButtonPanelTopColor'])+', '+HexToG(gcta['canvasMainButtonPanelTopColor'])+', '+HexToB(gcta['canvasMainButtonPanelTopColor'])+', '+gcta['canvasMainButtonPanelTopOpacity']+')!important;}' +\r\n\r\n\t\t// Bottom Button panel\r\n\t\t'.AY {background-color: rgba('+HexToR(gcta['canvasMainButtonPanelBottomColor'])+', '+HexToG(gcta['canvasMainButtonPanelBottomColor'])+', '+HexToB(gcta['canvasMainButtonPanelBottomColor'])+', '+gcta['canvasMainButtonPanelBottomOpacity']+')!important;}' +\r\n\t\t\r\n\t\t// Unread rows\r\n\t\t'.zE {background-color: rgba('+HexToR(gcta['canvasMainUnreadColor'])+', '+HexToG(gcta['canvasMainUnreadColor'])+', '+HexToB(gcta['canvasMainUnreadColor'])+', '+gcta['canvasMainUnreadOpacity']+')!important;}' +\r\n\r\n\t\t// Read rows\r\n\t\t'.yO {background-color: rgba('+HexToR(gcta['canvasMainReadColor'])+', '+HexToG(gcta['canvasMainReadColor'])+', '+HexToB(gcta['canvasMainReadColor'])+', '+gcta['canvasMainReadOpacity']+')!important;}' +\r\n\t\t\r\n\t\t// Unread selected rows\r\n\t\t'.zE.x7 {background-color: rgba('+HexToR(gcta['canvasMainUnreadSelectedColor'])+', '+HexToG(gcta['canvasMainUnreadSelectedColor'])+', '+HexToB(gcta['canvasMainUnreadSelectedColor'])+', '+gcta['canvasMainUnreadSelectedOpacity']+')!important;}' +\r\n\r\n\t\t// Read selected rows\r\n\t\t'.yO.x7 {background-color: rgba('+HexToR(gcta['canvasMainReadSelectedColor'])+', '+HexToG(gcta['canvasMainReadSelectedColor'])+', '+HexToB(gcta['canvasMainReadSelectedColor'])+', '+gcta['canvasMainReadSelectedOpacity']+')!important;}' +\r\n\t'';\r\n\t\r\n\t// Chat/Tasks panel CSS\r\n\tcssForChatAndTasks = '.AD {opacity: '+gcta['boxOpacity']+' !important;} ';\r\n\r\n\t// Add custom logo if provided\r\n\tif (gcta['logoURL'] != 'Theme-Specific Logo' && gcta['logoURL'] != '') {\r\n\t\tcss += '.Rgky9 {background-image: url(\"'+gcta['logoURL']+'\") !important;} ';\r\n\t}\r\n\r\n\t// Change header links if provided\r\n\tif (gcta['headerLinksColor'] != 'default' && gcta['headerLinksColor'] != '') {\r\n\t\tcss += 'a.gb1.qq, a.gb3.qq {color: '+gcta['headerLinksColor']+' !important;} ' +\r\n\t\t\t\t'.a7, .a8 .e {color: '+gcta['headerLinksColor']+' !important;} ';\r\n\t}\r\n\r\n\t// Change Buzz icon if provided\r\n\tif (gcta['buzzIconURL'] != 'Default Google Buzz Icon' && gcta['buzzIconURL'] != '') {\r\n\t\tdoc2.getElementsByClassName('Xo')[0].src = gcta['buzzIconURL'];\r\n\t\tdoc2.getElementsByClassName('Xo')[0].style.backgroundImage = 'none';\r\n\t} else {\r\n\t\tdoc2.getElementsByClassName('Xo')[0].src = 'https://mail.google.com/mail/images/cleardot.gif';\r\n\t\tdoc2.getElementsByClassName('Xo')[0].style.backgroundImage = '';\r\n\t}\r\n}", "title": "" }, { "docid": "ee85ba240da2f5c6e31f7caf197a774d", "score": "0.5020451", "text": "function writeStyleSheetForElement(styleObject,Query,documentWidth,currentBreakPoint){\n\n\tvar myCSSLookupKey = \"\\\\.\" + styleObject.id\n\n\tvar theExp = new RegExp(myCSSLookupKey+'\\\\s+(\\\\{[^}]+\\\\})','im')\n\n\tvar thescript = \"\";\n\n\tif(currentBreakPoint && currentBreakPoint > 0){\n\t\tthescript = Query(\"style.max-width-\"+currentBreakPoint)\n\t} else {\n\t\tthescript = Query(\"style.default\");\n\t}\n\tgroups = thescript.html().match(theExp)\n\n\tvar cssTextConstants = fs.readFileSync(path.join(process.env.HOMEDIR,\"public\",\"js\",\"cssText.js\")).toString();\n\n\tvar extConstants = fs.readFileSync(path.join(process.env.HOMEDIR,\"public\",\"js\",\"extensions2.js\")).toString();\n\n\tvar log = {}\n\tlog.debug = console.log;\n\n\t//After evaluating this line, we can use any functions in that file\n\teval(cssTextConstants)\n\n\teval(extConstants)\n\n\n\tif(groups && groups[1]){\n\n\t\t//from the included file\n\t\tstyleObject = computeDimensions(styleObject,Query,documentWidth)\n\n\t\tthescript.html(thescript.html().replace(theExp,styleObject.cssRule))\n\n\t\tconsole.log(\"Wrote rule and new background-image as \" + styleObject[\"background-image\"])\n\n\t\tQuery(\"#\"+styleObject.id).attr(\"style\",\"\");\n\t} \n\n\treturn Query;\n\n}", "title": "" }, { "docid": "9f11fd53ea0292442531cd85f4926acd", "score": "0.50175965", "text": "cramp(){return styles[cramp[this.id]];}", "title": "" }, { "docid": "41e5dfd99df5e2737ba2bb3942189d21", "score": "0.50170106", "text": "static get styles(){return[]}", "title": "" }, { "docid": "9e07cd7d01159551b3ddb8b42b94da3f", "score": "0.5016728", "text": "compileStyleSet() {\n this.styleSet.forEach(style => this.compileStyle(style));\n // Create optimized styleSets for each `layer` & `geometryType` tuple.\n this.styleSet.forEach(style => {\n this.getOptimizedStyleSet(this.m_tmpOptimizedSubSetKey.set(style.layer, style._geometryType));\n });\n }", "title": "" }, { "docid": "e710f634d9a77d8a5e76dc55f98f1e4a", "score": "0.5008604", "text": "function buildStyleElement() {\n var styleElement = document.createElement('style');\n styleElement.type = 'text/css';\n var rule = document.createTextNode(\n '@-webkit-keyframes spaceboots {' +\n\t '0% { -webkit-transform: translate(2px, 1px) rotate(0deg); }'+\n\t '10% { -webkit-transform: translate(-1px, -2px) rotate(-1deg); }'+\n\t '20% { -webkit-transform: translate(-3px, 0px) rotate(1deg); }'+\n\t '30% { -webkit-transform: translate(0px, 2px) rotate(0deg); }'+\n\t '40% { -webkit-transform: translate(1px, -1px) rotate(1deg); }'+\n\t '50% { -webkit-transform: translate(-1px, 2px) rotate(-1deg); }'+\n\t '60% { -webkit-transform: translate(-3px, 1px) rotate(0deg); }'+\n\t '70% { -webkit-transform: translate(2px, 1px) rotate(-1deg); }'+\n\t '80% { -webkit-transform: translate(-1px, -1px) rotate(1deg); }'+\n\t '90% { -webkit-transform: translate(2px, 2px) rotate(0deg); }'+\n\t '100% { -webkit-transform: translate(1px, -2px) rotate(-1deg); }'+\n '}');\n styleElement.appendChild(rule);\n return styleElement;\n}", "title": "" }, { "docid": "891a60bce223ed589e53764a430d0247", "score": "0.50065917", "text": "function createAnimationObjects() {\n //Populate initial Action option information\n if (actions != \"undefined\" && actions.length > 0) {\n for (var i = 0; i < actions[i].length; i++) {\n predicateOrder = [];\n for (var j = 0; j < actions[i].effects.length; j++) {\n predicateOrder.push(actions[i].effects[j].name);\n }\n actionOptions[actions[i].name].predicateOrdering =\n new ActionOption(predicateOrder);\n }\n }\n\n //Create the assosciative array that will hold lists of option predicates\n if (predicates != \"undefined\" && predicates.length > 0) {\n for (var i = 0; i < predicates.length; i++) {\n predicateOptions[predicates[i].name.toLowerCase()] = [];\n }\n }\n\n /* Ditto for types AND constants/objects that will for the remainder of\n this program be referred to as objects(they 're treated identically)\n It begins by applying the types to each object, which is necessary due\n to the formatting of the parser 's output, then populates the\n assosciative array\n */\n if (types != \"undefined\" && types.length > 0) {\n for (var i = 0; i < types.length; i++) {\n typeOptions[types[i]] = new TypeOption(types[i]);\n }\n var typeCounter = 0;\n var type = \"\";\n for (var i = 0; i < constants.names.length; i++) {\n if (i < constants.typeIndex[typeCounter]) {\n type = constants.types[typeCounter];\n } else {\n typeCounter++;\n type = constants.types[typeCounter];\n }\n var name = constants.names[i];\n initialObjectProperties[name] = new ObjectProperty(name, type);\n initialObjectProperties[name].location = [0, 0];\n }\n typeCounter = 0;\n\n for (var i = 0; i < objects.names.length; i++) {\n if (i < objects.typeIndex[typeCounter]) {\n type = objects.types[typeCounter];\n } else {\n type = objects.types[typeCounter];\n typeCounter++;\n }\n var name = objects.names[i];\n initialObjectProperties[name] = new ObjectProperty(name, type);\n initialObjectProperties[name].location = [0, 0];\n }\n } else {\n for (var i = 0; i < constants.names.length; i++) {\n var name = constants.names[i];\n initialObjectProperties[name] = new ObjectProperty(name);\n initialObjectProperties[name].location = [0, 0];\n }\n for (var i = 0; i < objects.names.length; i++) {\n var name = objects.names[i];\n initialObjectProperties[name] = new ObjectProperty(name);\n initialObjectProperties[name].location = [0, 0];\n }\n }\n}", "title": "" }, { "docid": "0eb38d58977749b32fd334d19a1f5979", "score": "0.49949828", "text": "function BuildPlatform () {\n\tif (bodyType != Rider.bodyMissing) {\n\t\tplatBody = CreateObjectOnPlatform(bodyType).GetComponent (PlatformBody);\n\t\tif (shrink)\n\t\t\tplatBody.shrinker = true;\n\t\telse \n\t\t\tplatBody.shrinker = false;\n\t}\n}", "title": "" }, { "docid": "fc7a47a521fc390818a943ed996fea30", "score": "0.4982828", "text": "function compileStyle(options) {\r\n return doCompileStyle({ ...options, isAsync: false });\r\n}", "title": "" }, { "docid": "643c7b322ce46d0f7441a215d029aa21", "score": "0.49811786", "text": "function add_css() {\n var style = (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.element)(\"style\");\n style.id = \"svelte-k92cej-style\";\n style.textContent = \".full-height.svelte-k92cej.svelte-k92cej{height:100vh}.flex-center.svelte-k92cej.svelte-k92cej{align-items:center;display:flex;justify-content:center}.position-ref.svelte-k92cej.svelte-k92cej{position:relative}.content.svelte-k92cej.svelte-k92cej{text-align:center}.title.svelte-k92cej.svelte-k92cej{font-size:84px}.links.svelte-k92cej>a.svelte-k92cej{color:#636b6f;padding:0 25px;font-size:13px;font-weight:600;letter-spacing:.1rem;text-decoration:none;text-transform:uppercase}.m-b-md.svelte-k92cej.svelte-k92cej{margin-bottom:30px}\";\n (0,svelte_internal__WEBPACK_IMPORTED_MODULE_0__.append)(document.head, style);\n}", "title": "" }, { "docid": "c46b925e1947657f6085f8ec83f14393", "score": "0.49785778", "text": "function quitHoggingBuildInlineStyle(obj){\n var style = new Array();\n $.each(obj, function(key, val){\n style.push(key + \": \" + val);\n });\n return style.join('; ');\n}", "title": "" }, { "docid": "5eb4b3990e2c218e80074a90e71d6bcf", "score": "0.49773213", "text": "sub(){return styles[sub[this.id]];}", "title": "" }, { "docid": "d358afb9b0df37d3e6b9f7178bd6e526", "score": "0.49735242", "text": "function buildUI(thisObj) {\r\n\t\tvar palleteObj = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", Defaults.scriptName, undefined, { resizeable: true });\r\n\r\n\t\t// Extra checks:\r\n\t\tif (!palleteObj) {\r\n\t\t\talert(Defaults.getLocalization(\"errorUnknownUI\"), Defaults.getLocalization(\"errorTitleError\"), true);\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t/******** DATA *******/\r\n\t\tpalleteObj.currentPath = new File($.fileName).path;\r\n\t\tpalleteObj.imagesFolderPath = palleteObj.currentPath + \"/SC_Src/images/\";\r\n\t\tpalleteObj.aa1Off = palleteObj.imagesFolderPath + \"aa1Off.png\";\r\n\t\tpalleteObj.aa1On = palleteObj.imagesFolderPath + \"aa1On.png\";\r\n\t\tpalleteObj.aa2Off = palleteObj.imagesFolderPath + \"aa2Off.png\";\r\n\t\tpalleteObj.aa2On = palleteObj.imagesFolderPath + \"aa2On.png\";\r\n\t\tpalleteObj.aa3Off = palleteObj.imagesFolderPath + \"aa3Off.png\";\r\n\t\tpalleteObj.aa3On = palleteObj.imagesFolderPath + \"aa3On.png\";\r\n\t\t//palleteObj.refresh = palleteObj.imagesFolderPath + \"refresh.png\";\r\n\t\t//palleteObj.create = palleteObj.imagesFolderPath + \"create.png\";\r\n\t\t//palleteObj.markers = [];\r\n\t\t//palleteObj.textLines = [];\r\n\t\t/******** ROOT COMP *******/\r\n\t\tif (!app.project) {\r\n\t\t\tapp.newProject();\r\n\t\t}\r\n\t\t/********************************************\r\n\t\t*\t\tBUILD UI:\r\n\t\t*********************************************/\r\n\t\tvar rootRes = \"Group {orientation: 'stack', alignment: ['fill','fill'], alignChildren: ['fill','fill']\";\r\n\t\trootRes += \"mainContent:Group{orientation:'column',\";\r\n\t\trootRes += \"layerDetails:Group{orientation:'row', alignment: ['left','top'], \";\r\n\t\t//\trootRes += \"genericStaticText:StaticText{text:'Now Editing layer:', alignment: ['left','top']},\"\r\n\t\t//rootRes += \"layerName:StaticText{text:'No layer selected', characters:20, alignment: ['left','top']},\"\r\n\t\trootRes += \"}\";// End LayerDetails\r\n\r\n\t\trootRes += \"input: EditText {preferredSize:[200,200], alignment: ['fill','fill'], properties:{multiline:true}, text:''},\"\r\n\t\t///rootRes += \"message:StaticText{text:'sdada', characters:40, alignment: ['fill','bottom']},\"\r\n\r\n\t\trootRes += \"buttons:Group{orientation:'row', alignment: ['right','bottom'], \";\r\n\r\n\t\trootRes += \"applyBtn:Button{size:[60,28],text:'Apply'},\"\r\n\t\trootRes += \"editBtn:Button{size:[60,28],text:'Edit'},\"\r\n\r\n\t\trootRes += \"saveSrt:Button{size:[80,28],text:'Export SRT'},\"\r\n\t\trootRes += \"getSrt:Button{size:[80,28],text:'Import SRT'},\"\r\n\r\n\t\trootRes += \"getLrc:Button{size:[80,28],text:'Import LRC'},\"\r\n\r\n\t\trootRes += \"}\";// End Buttons\r\n\t\trootRes += \"}\"; // End mainContent\r\n\t\trootRes += \"}\";// End Group\r\n\t\ttry {\r\n\t\t\tpalleteObj.rootGrp = palleteObj.add(rootRes);\r\n\t\t} catch (e) {\r\n\t\t\talert(Defaults.getLocalization(\"errorUnknownUI\"), Defaults.getLocalization(\"errorTitleError\"), true);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.spacing = 5;\r\n\t\tpalleteObj.rootGrp.mainContent.spacing = 0;\r\n\t\tpalleteObj.rootGrp.spacing = 0;\r\n\t\tpalleteObj.spacing = 0;\r\n\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.margins.top = 5;\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.margins.right = 5;\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.margins.bottom = 5;\r\n\r\n\t\tpalleteObj.rootGrp.mainContent.margins = 0;\r\n\t\tpalleteObj.rootGrp.margins = 0;\r\n\t\tpalleteObj.margins = 0;\r\n\r\n\t\tpalleteObj.rootGrp.mainContent.input.text = \"\";\r\n\r\n\r\n\t\t/********************************************\r\n\t\t*\t\tCONTROLS: EDIT SELECTED LAYER\r\n\t\t*********************************************/\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.saveSrt.onClick = function () {\r\n\t\t\tsaveSrt(palleteObj.rootGrp.mainContent.input.text);\r\n\t\t}\r\n\t\tvar allSrtContent = \"\";\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.getSrt.onClick = function () {\r\n\t\t\tvar currentComp = app.project.activeItem;\r\n\r\n\t\t\tif (currentComp && currentComp instanceof CompItem) {\r\n\t\t\t\tvar targetLayer = currentComp.selectedLayers; // check comp selected\r\n\t\t\t\tif (targetLayer.length != 0) { // check layer selected\r\n\r\n\t\t\t\t\tpalleteObj.rootGrp.mainContent.input.text = \"\";\r\n\t\t\t\t\tvar srtMarkerTime = getSrtaddMarkers();\r\n\t\t\t\t\tif (srtMarkerTime.length == 0) { return }\r\n\t\t\t\t\taddSubtitles();\r\n\t\t\t\t\taddPause(srtMarkerTime);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\talert(\"First, select an empty text layer\")\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\talert(\"First, select an empty text layer\")\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfunction getSrtaddMarkers() {\r\n\t\t\tapp.beginUndoGroup(\"get srt\");\r\n\r\n\t\t\tvar tempFile = new File;\r\n\t\t\tvar tempFile = tempFile.openDlg(\"Open a file\", \"Acceptable Files:*.srt\");\r\n\r\n\t\t\tif (tempFile == null) { return null } //check if it press Esc key\r\n\r\n\t\t\tvar filePathString = tempFile.fsName;\r\n\r\n\t\t\tif (tempFile.exists == true) {\r\n\t\t\t\ttempFile.open(\"r\");\r\n\t\t\t\tvar fileContents = tempFile.read();\r\n\t\t\t\ttempFile.close();\r\n\t\t\t} else {\r\n\t\t\t\talert(\"That file doesn't exist\");\r\n\t\t\t\treturn \"\"\r\n\t\t\t}\r\n\r\n\t\t\tif (fileContents.length < 3) {\r\n\t\t\t\treturn \"This file is empty\";\r\n\t\t\t}\r\n\r\n\t\t\tvar srtMarkerTimeArr = extractSrtTimeTextAndAddMarkers(fileContents);\r\n\r\n\t\t\treturn srtMarkerTimeArr;\r\n\r\n\t\t\tfunction clearAllMarkers(targetLayer) {\r\n\t\t\t\tvar nKey = targetLayer.property(\"ADBE Marker\");\r\n\t\t\t\t//\talert(nKey.reflect.properties.toString().replace(/,/g, \"\\n\"))\r\n\t\t\t\t//alert(nKey.reflect.methods.toString().replace(/,/g, \"\\n\"))\r\n\t\t\t\tif (nKey.numKeys > 0) {\r\n\t\t\t\t\tfor (var i = nKey.numKeys; i > 0; i--) {\r\n\t\t\t\t\t\tnKey.removeKey(i)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction extractSrtTimeTextAndAddMarkers(srtSring) {\r\n\t\t\t\tvar tempArr = srtSring.split('\\n\\n'); /// num, time and text group\r\n\r\n\t\t\t\tif (tempArr.length > 150) { // if the file is too large\r\n\r\n\t\t\t\t\tvar myWindow = new Window(\"dialog\", \"Do you want to continue?\");\r\n\t\t\t\t\tvar myInputGroup = myWindow.add(\"group\");\r\n\r\n\t\t\t\t\tvar msg = tempArr.length + \" lines found. It may take a cople of minite to load all lines.\"\r\n\t\t\t\t\tmyInputGroup.add(\"statictext\", undefined, msg);\r\n\r\n\t\t\t\t\tvar myButtonGroup = myWindow.add(\"group\");\r\n\t\t\t\t\tmyButtonGroup.alignment = \"right\";\r\n\t\t\t\t\tvar okBtn = myButtonGroup.add(\"button\", undefined, \"OK\");\r\n\t\t\t\t\tvar cancelBtn = myButtonGroup.add(\"button\", undefined, \"Cancel\");\r\n\r\n\t\t\t\t\tokBtn.onClick = function () {\r\n\t\t\t\t\t\tmyWindow.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar cancelRezult = false;\r\n\t\t\t\t\tcancelBtn.onClick = function () {\r\n\t\t\t\t\t\tmyWindow.close();\r\n\t\t\t\t\t\tcancelRezult = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmyWindow.show();\r\n\t\t\t\t}\r\n\t\t\t\tif (cancelRezult == true) { // user pressed Cancel\r\n\t\t\t\t\treturn []\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar currentComp = app.project.activeItem;\r\n\t\t\t\tvar targetLayer = currentComp.selectedLayers[0];\r\n\t\t\t\tvar markerTimeArr = [];\r\n\t\t\t\tallSrtContent = \"\";\r\n\t\t\t\tclearAllMarkers(targetLayer);\r\n\r\n\t\t\t\t//alert( targetLayer.property(\"ADBE Marker\").numKeys)\r\n\t\t\t\t//alert( tempArr.length + \" tempArr.length\")\r\n\r\n\r\n\t\t\t\tfor (i = 0; i < tempArr.length - 1; i++) {\r\n\r\n\t\t\t\t\tif (tempArr[i] != \"\") {\r\n\r\n\t\t\t\t\t\tvar startFrom = tempArr[i].indexOf(\"\\n\");\r\n\r\n\t\t\t\t\t\tvar timeAndContentString = tempArr[i].substr(startFrom + 1);\r\n\r\n\t\t\t\t\t\tvar startFrom_2 = timeAndContentString.indexOf(\"\\n\");\r\n\r\n\t\t\t\t\t\tvar timeString = timeAndContentString.substring(0, startFrom_2 + 1);\r\n\t\t\t\t\t\tvar timeArr = timeString.split(\"-->\");\r\n\r\n\t\t\t\t\t\tif (timeArr.length == 2) { // check if no more time string\r\n\r\n\t\t\t\t\t\t\tvar startMTime = convertTimeToSec(timeArr[0]);\r\n\t\t\t\t\t\t\tvar endMTime = convertTimeToSec(timeArr[1]);\r\n\r\n\t\t\t\t\t\t\tvar contentString = timeAndContentString.substring(startFrom_2 + 1).replace(/\\n/g, \" \");\r\n\t\t\t\t\t\t\t//contentString = cleanUpText(contentString);\r\n\t\t\t\t\t\t\t//alert(i + \" intere 6\")\r\n\r\n\t\t\t\t\t\t\tvar markerLable = new MarkerValue(\"start\" + (i));\r\n\t\t\t\t\t\t\ttargetLayer.property(\"ADBE Marker\").setValueAtTime(startMTime, markerLable);\r\n\t\t\t\t\t\t\t//targetLayer.sourceText.setValueAtTime(startMTime, contentString);\r\n\r\n\r\n\t\t\t\t\t\t\tmarkerTimeArr.push([startMTime, endMTime]);\r\n\t\t\t\t\t\t\tallSrtContent += contentString + \"\\n\";\r\n\r\n\t\t\t\t\t\t\tfunction convertTimeToSec(hms) {\r\n\t\t\t\t\t\t\t\thms = hms.replace(/ /g, \"\"); // remove space\r\n\t\t\t\t\t\t\t\tvar a = hms.split(/[^0-9]/);\r\n\t\t\t\t\t\t\t\tvar seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]) + (+a[3]) / 1000;\r\n\t\t\t\t\t\t\t\treturn seconds\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t///alert(palleteObj.rootGrp.mainContent.input.text )\r\n\r\n\r\n\r\n\t\t\t\tpalleteObj.rootGrp.mainContent.input.text = allSrtContent;\r\n\t\t\t\t//\talert(palleteObj.rootGrp.mainContent.input.text )\r\n\t\t\t\t//palleteObj.layout.layout(true);\r\n\t\t\t\t// palleteObj.layout.resize();\r\n\t\t\t\treturn markerTimeArr\r\n\r\n\t\t\t}\r\n\t\t\tapp.endUndoGroup();\r\n\t\t}\r\n\t\tfunction addPause(srtMarkerTime) {\r\n\t\t\tapp.beginUndoGroup(\"addPause\");\r\n\t\t\tvar currentComp = app.project.activeItem;\r\n\t\t\tvar targetLayer = currentComp.selectedLayers[0];\r\n\r\n\t\t\t///alert(targetLayer.name)\r\n\t\t\t//alert(targetLayer.properties.toString().replace(/,/g, \"\\n\"))\r\n\t\t\t//\talert(targetLayer.methods.toString().replace(/,/g, \"\\n\"))\r\n\r\n\r\n\t\t\tfor (var i = 0; i < srtMarkerTime.length - 1; i++) {\r\n\t\t\t\t///\talert(srtMarkerTime[i])\r\n\t\t\t\tif (srtMarkerTime[i][1] != srtMarkerTime[i + 1][0]) {\r\n\r\n\t\t\t\t\tvar markerLable = new MarkerValue(\"\");\r\n\t\t\t\t\ttargetLayer.property(\"ADBE Marker\").setValueAtTime(srtMarkerTime[i][1], markerLable);\r\n\t\t\t\t\t///\talert(\"33\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tapp.endUndoGroup();\r\n\r\n\t\t}\r\n\r\n\t\tvar allLrcContent = \"\";\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.getLrc.onClick = function () {\r\n\t\t\tvar currentComp = app.project.activeItem;\r\n\r\n\t\t\tif (currentComp && currentComp instanceof CompItem) {\r\n\t\t\t\tvar targetLayer = currentComp.selectedLayers; // check comp selected\r\n\t\t\t\tif (targetLayer.length != 0) { // check layer selected\r\n\r\n\t\t\t\t\tpalleteObj.rootGrp.mainContent.input.text = \"\";\r\n\t\t\t\t\tvar lrcMarkerTime = getLrcaddMarkers();\r\n\t\t\t\t\tif (lrcMarkerTime.length == 0) { return }\r\n\t\t\t\t\taddSubtitles();\r\n\t\t\t\t\taddPause(lrcMarkerTime);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\talert(\"First, select an empty text layer\")\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\talert(\"First, select an empty text layer\")\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfunction getLrcaddMarkers() {\r\n\t\t\tapp.beginUndoGroup(\"get lrc\");\r\n\r\n\t\t\tvar tempFile = new File;\r\n\t\t\tvar tempFile = tempFile.openDlg(\"Open a file\", \"Acceptable Files:*.lrc\");\r\n\r\n\t\t\tif (tempFile == null) { return null } //check if it press Esc key\r\n\r\n\t\t\tvar filePathString = tempFile.fsName;\r\n\r\n\t\t\tif (tempFile.exists == true) {\r\n\t\t\t\ttempFile.open(\"r\");\r\n\t\t\t\tvar fileContents = tempFile.read();\r\n\t\t\t\ttempFile.close();\r\n\t\t\t} else {\r\n\t\t\t\talert(\"That file doesn't exist\");\r\n\t\t\t\treturn \"\"\r\n\t\t\t}\r\n\r\n\t\t\tif (fileContents.length < 3) {\r\n\t\t\t\treturn \"This file is empty\";\r\n\t\t\t}\r\n\r\n\t\t\tvar srtMarkerTimeArr = extractLrcTimeTextAndAddMarkers(fileContents);\r\n\r\n\t\t\treturn srtMarkerTimeArr;\r\n\r\n\t\t\tfunction clearAllMarkers(targetLayer) {\r\n\t\t\t\tvar nKey = targetLayer.property(\"ADBE Marker\");\r\n\t\t\t\t//\talert(nKey.reflect.properties.toString().replace(/,/g, \"\\n\"))\r\n\t\t\t\t//alert(nKey.reflect.methods.toString().replace(/,/g, \"\\n\"))\r\n\t\t\t\tif (nKey.numKeys > 0) {\r\n\t\t\t\t\tfor (var i = nKey.numKeys; i > 0; i--) {\r\n\t\t\t\t\t\tnKey.removeKey(i)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction extractLrcTimeTextAndAddMarkers(srtSring) {\r\n\t\t\t\tvar tempArr = srtSring.split('\\n'); /// num, time and text group\r\n\r\n\t\t\t\tif (tempArr.length > 150) { // if the file is too large\r\n\r\n\t\t\t\t\tvar myWindow = new Window(\"dialog\", \"Do you want to continue?\");\r\n\t\t\t\t\tvar myInputGroup = myWindow.add(\"group\");\r\n\r\n\t\t\t\t\tvar msg = tempArr.length + \" lines found. It may take a cople of minite to load all lines.\"\r\n\t\t\t\t\tmyInputGroup.add(\"statictext\", undefined, msg);\r\n\r\n\t\t\t\t\tvar myButtonGroup = myWindow.add(\"group\");\r\n\t\t\t\t\tmyButtonGroup.alignment = \"right\";\r\n\t\t\t\t\tvar okBtn = myButtonGroup.add(\"button\", undefined, \"OK\");\r\n\t\t\t\t\tvar cancelBtn = myButtonGroup.add(\"button\", undefined, \"Cancel\");\r\n\r\n\t\t\t\t\tokBtn.onClick = function () {\r\n\t\t\t\t\t\tmyWindow.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar cancelRezult = false;\r\n\t\t\t\t\tcancelBtn.onClick = function () {\r\n\t\t\t\t\t\tmyWindow.close();\r\n\t\t\t\t\t\tcancelRezult = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmyWindow.show();\r\n\t\t\t\t}\r\n\t\t\t\tif (cancelRezult == true) { // user pressed Cancel\r\n\t\t\t\t\treturn []\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar currentComp = app.project.activeItem;\r\n\t\t\t\tvar targetLayer = currentComp.selectedLayers[0];\r\n\t\t\t\tvar markerTimeArr = [];\r\n\t\t\t\tallLrcContent = \"\";\r\n\t\t\t\tclearAllMarkers(targetLayer);\r\n\r\n\t\t\t\tvar prevTime = 0;\r\n\t\t\t\tvar firstLine = true;\r\n\t\t\t\tfor (i = 0; i < tempArr.length; i++) {\r\n\t\t\t\t\tif (tempArr[i] != \"\") {\r\n\t\t\t\t\t\tif(tempArr[i][1] < '0' || tempArr[i][1] > '9')\r\n\t\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\t\tvar pivot0 = tempArr[i].indexOf(\"[\");\r\n\t\t\t\t\t\tvar pivot1 = tempArr[i].indexOf(\"]\");\r\n\t\t\t\t\t\tvar timeString = tempArr[i].substr(pivot0 + 1, pivot1 - 1);\r\n\t\t\t\t\t\tvar contentString = tempArr[i].substr(pivot1 + 1);\r\n\t\t\t\t\t\tvar thisTime = convertTimeToSec(timeString);\r\n\r\n\t\t\t\t\t\tif(firstLine)\r\n\t\t\t\t\t\t\tfirstLine = false;\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif(thisTime - 0.05 < prevTime)\r\n\t\t\t\t\t\t\t\tmarkerTimeArr.push([prevTime, prevTime + 0.005]);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tmarkerTimeArr.push([prevTime, thisTime - 0.05]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar markerLable = new MarkerValue(\"start\" + (i));\r\n\t\t\t\t\t\t\ttargetLayer.property(\"ADBE Marker\").setValueAtTime(thisTime, markerLable);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tallLrcContent += contentString + \"\\n\";\r\n\r\n\t\t\t\t\t\tprevTime = thisTime;\r\n\r\n\t\t\t\t\t\tfunction convertTimeToSec(hms) {\r\n\t\t\t\t\t\t\thms = hms.replace(/ /g, \"\"); // remove space\r\n\t\t\t\t\t\t\tvar a = hms.split(/[^0-9]/);\r\n\t\t\t\t\t\t\tvar seconds = 0;\r\n\t\t\t\t\t\t\tif(a.length == 3)\r\n\t\t\t\t\t\t\t\tseconds = (+a[0]) * 60 + (+a[1]) + (+a[2]) / 100;\r\n\t\t\t\t\t\t\telse if(a.length == 4)\r\n\t\t\t\t\t\t\t\tseconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]) + (+a[3]) / 100;\r\n\t\t\t\t\t\t\treturn seconds\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmarkerTimeArr.push([prevTime, prevTime + 60]);\r\n\r\n\t\t\t\tpalleteObj.rootGrp.mainContent.input.text = allLrcContent;\r\n\t\t\t\t//\talert(palleteObj.rootGrp.mainContent.input.text )\r\n\t\t\t\t//palleteObj.layout.layout(true);\r\n\t\t\t\t// palleteObj.layout.resize();\r\n\t\t\t\treturn markerTimeArr\r\n\r\n\t\t\t}\r\n\t\t\tapp.endUndoGroup();\r\n\t\t}\r\n\r\n\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.editBtn.onClick = function () {\r\n\r\n\t\t\tselectLayer(true);\r\n\t\t}\r\n\t\tfunction selectLayer(withAlert) {\r\n\t\t\t// Check if selected layer is text\r\n\t\t\tvar selectedTextLayer = getSelectedTextLayer(withAlert);\r\n\t\t\tif (selectedTextLayer) {\r\n\t\t\t\t// Some UI:\r\n\t\t\t\t//palleteObj.rootGrp.mainContent.layerDetails.layerName.text = selectedTextLayer.name;\r\n\t\t\t\t// Continue to the next Step:\r\n\t\t\t\tgetDataFromLayer(selectedTextLayer, withAlert);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction getDataFromLayer(layer, withAlert) {\r\n\t\t\tvar textExpression = layer.property(\"Text\").property(\"Source Text\").expression;\r\n\t\t\tvar textsArray;\r\n\t\t\tif (textExpression.indexOf(\"var texts=\") > -1) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar subStartIndex = textExpression.indexOf(\"var texts=\") + 10;\r\n\t\t\t\t\tvar subEndIndex = textExpression.indexOf(\";;\");\r\n\t\t\t\t\tvar textsArrayAsString = textExpression.substring(subStartIndex, subEndIndex);\r\n\t\t\t\t\ttextsArrayAsString = textsArrayAsString.split(\"\\\\n\").join(\" \");\r\n\t\t\t\t\ttextsArray = eval(textsArrayAsString);\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tif (withAlert) {\r\n\t\t\t\t\t\talert(\"Error on Loading data from text layer. If error persist, please delete Text's expression\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Clean TextArea:\r\n\t\t\tpalleteObj.rootGrp.mainContent.input.text = \"\";\r\n\t\t\tif (textsArray && textsArray.length > 0) {\r\n\t\t\t\tfillDataFromTextLayerToTextArea(textsArray);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction fillDataFromTextLayerToTextArea(textLines) {\r\n\t\t\t// Add new lines one by one, with nre line separator\r\n\t\t\tfor (var i = 0; i < textLines.length; i++) {\r\n\t\t\t\tpalleteObj.rootGrp.mainContent.input.text = palleteObj.rootGrp.mainContent.input.text + textLines[i] + \"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tselectLayer(false);\r\n\r\n\t\t/********************************************\r\n\t\t\t\tCONTROLS: APPLY CHANGES\r\n\t\t*********************************************/\r\n\r\n\t\tpalleteObj.rootGrp.mainContent.buttons.applyBtn.onClick = function () {\r\n\t\t\tif (palleteObj.rootGrp.mainContent.input.text.length > 10) {\r\n\t\t\t\taddSubtitles()\r\n\t\t\t} else {\r\n\t\t\t\talert(\"The text field is empty. Please add your content in\");\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfunction addSubtitles() {\r\n\r\n\t\t\tapp.beginUndoGroup(\"Create Subtitles\");\r\n\t\t\tvar textLinesAll = palleteObj.rootGrp.mainContent.input.text.split(\"\\n\");\r\n\t\t\tvar textLines = [];\r\n\t\t\tfor (var i = 0; i < textLinesAll.length; i++) {\r\n\t\t\t\tif (textLinesAll[i] && textLinesAll[i].length > 0) {\r\n\t\t\t\t\ttextLines.push(textLinesAll[i].split(\"'\").join(\"\\\\'\"));\r\n\t\t\t\t\t//textLines.push(textLinesAll[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (textLines.length == 0) {\r\n\t\t\t\t//palleteObj.rootGrp.mainContent.message.text = Defaults.getLocalization(\"errorLinesNotFound\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!getRootComp()) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar selectedTextLayer = getSelectedTextLayer();\r\n\t\t\tif (!selectedTextLayer) {\r\n\t\t\t\talert(\"First, select a text layer\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Find Out if there is any difference between texts.length and the markers we have\r\n\t\t\tvar markerStartExists = false;\r\n\t\t\tvar needMoreMarkers = false;\r\n\t\t\tif (textLines.length > selectedTextLayer.property(\"ADBE Marker\").numKeys) {\r\n\t\t\t\tneedMoreMarkers = true;\r\n\t\t\t}\r\n\t\t\tif (selectedTextLayer.property(\"ADBE Marker\").numKeys > 0) {\r\n\t\t\t\t// Check if CTI is after last marker time:\r\n\t\t\t\tif (textLines.length > selectedTextLayer.property(\"ADBE Marker\").numKeys) {\r\n\t\t\t\t\tif (getRootComp().time < selectedTextLayer.property(\"ADBE Marker\").keyTime(selectedTextLayer.property(\"ADBE Marker\").numKeys)) {\r\n\t\t\t\t\t\talert(\"Please Move Current Time Indicator after the last marker.\");\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (var i = selectedTextLayer.property(\"ADBE Marker\").numKeys; i >= 1; i--) {\r\n\t\t\t\t\tif (selectedTextLayer.property(\"ADBE Marker\").keyValue(i) &&\r\n\t\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment &&\r\n\t\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment.indexOf('start') >= 0) {\r\n\t\t\t\t\t\tmarkerStartExists = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar textLinesIndex = 0;\r\n\t\t\tvar lastMarkerUsed = 1;\r\n\t\t\tvar lastMarkerTime = selectedTextLayer.inPoint;\r\n\t\t\tvar lastMarkerLabel = 1;\r\n\t\t\tif (selectedTextLayer.property(\"ADBE Marker\").numKeys > 0) {\r\n\t\t\t\tfor (var i = 1; i <= selectedTextLayer.property(\"ADBE Marker\").numKeys; i++) {\r\n\t\t\t\t\t//alert(\"i: \" + i + \", comm: \" + selectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment);\r\n\t\t\t\t\tif (selectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment.indexOf('start') >= 0 || !markerStartExists && i <= textLines.length) {\r\n\t\t\t\t\t\tlastMarkerTime = selectedTextLayer.property(\"ADBE Marker\").keyTime(i);\r\n\t\t\t\t\t\t//alert(\"pun marker la \" + lastMarkerTime + \"start\"+lastMarkerUsed);\r\n\t\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").setValueAtTime(lastMarkerTime, new MarkerValue(\"start\" + lastMarkerLabel));\r\n\t\t\t\t\t\ttextLinesIndex++;\r\n\t\t\t\t\t\tlastMarkerUsed = i + 1;\r\n\t\t\t\t\t\tlastMarkerLabel++;\r\n\t\t\t\t\t\t//alert(\"textLinesIndex: \" + textLinesIndex + \", lastMarkerUsed (to be used):\" + lastMarkerUsed);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar totalLetters = 0;\r\n\t\t\t//var textLinesIndexToStartCount = textLinesIndex == 0 ? textLinesIndex : textLinesIndex-1;\r\n\t\t\ttextLinesIndexToStartCount = selectedTextLayer.property(\"ADBE Marker\").numKeys > 0 ? selectedTextLayer.property(\"ADBE Marker\").numKeys - 1 : 0;\r\n\t\t\tfor (var i = textLinesIndexToStartCount; i < textLines.length; i++) {\r\n\t\t\t\ttotalLetters += textLines[i].length;\r\n\t\t\t}\r\n\r\n\t\t\t//alert(\"textLinesIndex \" + textLinesIndex + \", textLinesIndexToStartCount \" + textLinesIndexToStartCount + \", totalLetters \" + totalLetters);\r\n\r\n\t\t\tvar totalTime = getRootComp().time > 0 ? getRootComp().time : getRootComp().duration;\r\n\t\t\t//var timeLength = totalTime - lastMarkerTime;\r\n\t\t\tvar timeStartToCount = selectedTextLayer.property(\"ADBE Marker\").numKeys > 0 ? selectedTextLayer.property(\"ADBE Marker\").keyTime(selectedTextLayer.property(\"ADBE Marker\").numKeys) : selectedTextLayer.inPoint;\r\n\t\t\tvar timeLength = totalTime - timeStartToCount;\r\n\t\t\tvar timeForLetter = timeLength / totalLetters;\r\n\r\n\t\t\t//alert(\"totalTime = \" + totalTime + \", lastMarkerTime = \" + lastMarkerTime + \", timeLength = \" + timeLength + \", timeForLetter = \" + timeForLetter);\r\n\t\t\t//alert(\"textLinesIndex \" + textLinesIndex + \", lastMarkerLabel \" + lastMarkerLabel);\r\n\r\n\t\t\t// Continue to use markers or add mising markers\r\n\t\t\tfor (var i = textLinesIndex; i < textLines.length; i++) {\r\n\t\t\t\tif (lastMarkerUsed <= selectedTextLayer.property(\"ADBE Marker\").numKeys) {\r\n\t\t\t\t\tlastMarkerTime = selectedTextLayer.property(\"ADBE Marker\").keyTime(lastMarkerUsed);\r\n\t\t\t\t\t//selectedTextLayer.property(\"ADBE Marker\").setValueAtTime(lastMarkerTime, new MarkerValue(\"start\"+i));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\tlastMarkerTime += textLines[i - 1].length * timeForLetter;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").setValueAtTime(lastMarkerTime, new MarkerValue(\"start\" + lastMarkerLabel));\r\n\t\t\t\tlastMarkerUsed++;\r\n\t\t\t\tlastMarkerLabel++;\r\n\t\t\t}\r\n\t\t\t// Clean markers text that are after textLines.length (in case of user removing some subtitles after add then)\r\n\t\t\tfor (var i = lastMarkerUsed; i <= selectedTextLayer.property(\"ADBE Marker\").numKeys; i++) {\r\n\t\t\t\tif (selectedTextLayer.property(\"ADBE Marker\").keyValue(i) &&\r\n\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment &&\r\n\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").keyValue(i).comment.indexOf('start') >= 0) {\r\n\t\t\t\t\tvar markerTime = selectedTextLayer.property(\"ADBE Marker\").keyTime(i);\r\n\t\t\t\t\tselectedTextLayer.property(\"ADBE Marker\").setValueAtTime(markerTime, new MarkerValue(\"\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Cut selectedTextLayer after Ccurrent Time Indicator:\r\n\t\t\tif (getRootComp().time > 0 && needMoreMarkers) {\r\n\t\t\t\tselectedTextLayer.outPoint = getRootComp().time;\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// Start calculating background's dimensions and check if each subtitle fill on one line or two\r\n\t\t\tvar widths, heighs, heighsClean, widths2, heighs2, heighsClean2, textTotalHeights, textLinesASString;\r\n\t\t\twidths = heighs = heighsClean = widths2 = heighs2 = heighsClean2 = textTotalHeights = textLinesASString = \"[\";\r\n\t\t\tvar tempLayer = createTextLayer(getRootComp(), \"Working layer\", selectedTextLayer);\r\n\t\t\ttempLayer.shy = true;\r\n\t\t\tvar documentProperty = tempLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\");\r\n\t\t\tvar documentPropertyValue = documentProperty.value\r\n\r\n\t\t\tdocumentPropertyValue.text = \"a\";\r\n\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\t\t\tvar a_size = Math.round(tempLayer.sourceRectAtTime(0, false).height);\r\n\t\t\tdocumentPropertyValue.text = \"g\";\r\n\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\t\t\tvar g_size = Math.round(tempLayer.sourceRectAtTime(0, false).height);\r\n\r\n\r\n\t\t\tfor (var i = 0; i < textLines.length; i++) {\r\n\t\t\t\t// For the temp text layer, set text line:\r\n\t\t\t\tdocumentPropertyValue.text = textLines[i];\r\n\t\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\r\n\t\t\t\tif (tempLayer.sourceRectAtTime(0, false).width > getMaxWidth()) {\r\n\r\n\t\t\t\t\t// If the text line is to long: calculate after how many words must be cut:\r\n\t\t\t\t\tvar words = textLines[i].split(\" \");\r\n\t\t\t\t\t// Clean TextLayer of any text:\r\n\t\t\t\t\tdocumentPropertyValue.text = \"\";\r\n\t\t\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\t\t\t\t\tvar totH = 0;\r\n\r\n\t\t\t\t\tfor (var w = 0; w < words.length; w++) {\r\n\t\t\t\t\t\t// Add each word one by one untils fits no more:\r\n\t\t\t\t\t\t// Keep Last text that fits the composition:\r\n\t\t\t\t\t\tvar lastText = documentPropertyValue.text;\r\n\t\t\t\t\t\t// Save dimensions for Background 1:\r\n\t\t\t\t\t\tvar lastWidth = Math.round(tempLayer.sourceRectAtTime(0, false).width);\r\n\t\t\t\t\t\tvar lastHeight = Math.round(tempLayer.sourceRectAtTime(0, false).height);\r\n\r\n\t\t\t\t\t\tif (doesTextContainsSpecialChars(lastText)) {\r\n\t\t\t\t\t\t\t//var lastHeightClean = getLayerHeightForAnchor(getRootComp(), tempLayer);\r\n\t\t\t\t\t\t\tvar lastHeightClean = g_size - a_size;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tvar lastHeightClean = 0;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Add new word:\r\n\t\t\t\t\t\tif (w > 0) { // if is not first, add space;\r\n\t\t\t\t\t\t\tdocumentPropertyValue.text += \" \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdocumentPropertyValue.text += words[w];\r\n\t\t\t\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\r\n\t\t\t\t\t\t// If is to big, add new line and continue to add words:\r\n\t\t\t\t\t\tif (tempLayer.sourceRectAtTime(0, false).width > getMaxWidth()) {\r\n\t\t\t\t\t\t\t// Update textLines[i], add '\\n' for new line:\r\n\t\t\t\t\t\t\ttextLines[i] = lastText + \"\\\\n\"; // will keep the space that is before the first word of second line\r\n\t\t\t\t\t\t\t//textLines[i] = lastText.slice(-1) == \" \" ? lastText.substring(0,lastText.length-1) + \"\\\\n\" : lastText + \"\\\\n\"; // will remove the space that is before the first word of second line\r\n\r\n\t\t\t\t\t\t\t// Get Total Height of the TextLayer:\r\n\t\t\t\t\t\t\ttotH = Math.round(tempLayer.sourceRectAtTime(0, false).height);\r\n\r\n\t\t\t\t\t\t\tvar secondLine = \"\";\r\n\t\t\t\t\t\t\tfor (var t = w; t < words.length; t++) {\r\n\t\t\t\t\t\t\t\ttextLines[i] = textLines[i] + \" \" + words[t];\r\n\t\t\t\t\t\t\t\tsecondLine = secondLine + \" \" + words[t];\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tdocumentPropertyValue.text = lastText + \"\\n\" + secondLine;\r\n\t\t\t\t\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\t\t\t\t\t\t\ttotH = Math.round(tempLayer.sourceRectAtTime(0, false).height) - totH;\r\n\t\t\t\t\t\t\tif (!doesTextContainsSpecialChars(secondLine) && doesTextContainsSpecialChars(lastText)) {\r\n\t\t\t\t\t\t\t\ttotH = totH + g_size - a_size;\r\n\t\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t\t// Keep Dimensions for Background 1:\r\n\t\t\t\t\t\t\twidths += lastWidth + \",\";\r\n\t\t\t\t\t\t\theighs += lastHeight + \",\";\r\n\t\t\t\t\t\t\theighsClean += lastHeightClean + \",\";\r\n\r\n\t\t\t\t\t\t\t// Keep Dimensions for Background 2:\r\n\t\t\t\t\t\t\tdocumentPropertyValue.text = secondLine;\r\n\t\t\t\t\t\t\tdocumentProperty.setValue(documentPropertyValue);\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\twidths2 += Math.round(tempLayer.sourceRectAtTime(0, false).width) + \",\";\r\n\t\t\t\t\t\t\theighs2 += Math.round(tempLayer.sourceRectAtTime(0, false).height) + \",\";\r\n\r\n\t\t\t\t\t\t\tif (doesTextContainsSpecialChars(secondLine)) {\r\n\t\t\t\t\t\t\t\tvar vl = g_size - a_size;\r\n\t\t\t\t\t\t\t\theighsClean2 += vl + \",\";\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\theighsClean2 += 0 + \",\";\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Keep textTotalHeights:\r\n\t\t\t\t\t\t\ttextTotalHeights += totH + \",\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// If the text line fits the scene's dimension go on:\r\n\t\t\t\t\t// Keep Dimensions for Background 1:\r\n\t\t\t\t\twidths += Math.round(tempLayer.sourceRectAtTime(0, false).width) + \",\";\r\n\t\t\t\t\theighs += Math.round(tempLayer.sourceRectAtTime(0, false).height) + \",\";\r\n\t\t\t\t\t//heighs += a_size + \",\";\r\n\r\n\t\t\t\t\tif (doesTextContainsSpecialChars(textLines[i])) {\r\n\t\t\t\t\t\t//var hCl = getLayerHeightForAnchor(getRootComp(), tempLayer);\r\n\t\t\t\t\t\tvar hCl = g_size - a_size;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//var hCl = Math.round(tempLayer.sourceRectAtTime(0, false).height);\r\n\t\t\t\t\t\tvar hCl = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\theighsClean += hCl + \",\";\r\n\t\t\t\t\ttextTotalHeights += Math.round(tempLayer.sourceRectAtTime(0, false).height) + \",\";\r\n\r\n\t\t\t\t\t// Keep Dimensions for Background 2:\r\n\t\t\t\t\twidths2 += \"0,\";\r\n\t\t\t\t\theighs2 += \"0,\";\r\n\t\t\t\t\theighsClean2 += \"0,\";\r\n\t\t\t\t}\r\n\t\t\t\ttextLinesASString += \"'\" + textLines[i] + \"'\";\r\n\t\t\t\tif (i < textLines.length - 1) {\r\n\t\t\t\t\ttextLinesASString += \",\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttempLayer.remove();\r\n\t\t\twidths += \"]\";\r\n\t\t\theighs += \"]\";\r\n\t\t\theighsClean += \"]\";\r\n\t\t\twidths2 += \"]\";\r\n\t\t\theighs2 += \"]\";\r\n\t\t\theighsClean2 += \"]\";\r\n\t\t\ttextTotalHeights += \"]\";\r\n\t\t\ttextLinesASString += \"]\";\r\n\r\n\t\t\t// alert(\"widths = \" + widths)\r\n\t\t\t// alert(\"heighs = \" + heighs)\r\n\t\t\t// alert(\"heighsClean = \" + heighsClean)\r\n\t\t\t// alert(\"widths2 = \" + widths2)\r\n\t\t\t// alert(\"heighs2 = \" + heighs2)\r\n\t\t\t// alert(\"heighsClean2 = \" + heighsClean2)\r\n\t\t\t// alert(\"textTotalHeights = \" + textTotalHeights)\r\n\t\t\t// alert(\"textLinesASString = \" + textLinesASString)\r\n\r\n\t\t\tvar exp = \"var tt = '';\\n\"\r\n\t\t\texp += \"var texts=\" + textLinesASString + \";\\n\"\r\n\t\t\texp += \"for(i=thisComp.layer(index).marker.numKeys;i>=1;i--){\\n\"\r\n\t\t\texp += \"if(time >= thisComp.layer(index).marker.key(i).time){\\n\"\r\n\t\t\texp += \"var comm = thisComp.layer(index).marker.key(i).comment;\\n\"\r\n\t\t\texp += \"if(comm.indexOf('start') >= 0){\\n\"\r\n\t\t\texp += \"var textIndex = comm.substr(5);\\n\"\r\n\t\t\texp += \"var subIndex = parseInt(textIndex)-1;\\n\"\r\n\t\t\texp += \"if(subIndex >= 0 && subIndex < texts.length){\\n\"\r\n\t\t\texp += \"tt= texts[subIndex];\\n\"\r\n\t\t\texp += \"}\\n\"\r\n\t\t\texp += \"}\\n\"\r\n\t\t\texp += \"break;\\n\"\r\n\t\t\texp += \"}\\n\"\r\n\t\t\texp += \"}\\n\"\r\n\t\t\texp += \"tt;\\n\";\r\n\t\t\tselectedTextLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").expression = exp;\r\n\t\t\t// Center Text Layer:\r\n\t\t\tvar documentPropertyValue = selectedTextLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value;\r\n\t\t\tdocumentPropertyValue.text = \"\";\r\n\t\t\tdocumentPropertyValue.justification = ParagraphJustification.CENTER_JUSTIFY;\r\n\t\t\tselectedTextLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").setValue(documentPropertyValue);\r\n\r\n\t\t\t// Add Shape Layer:\r\n\t\t\t// Remove last one:\r\n\t\t\tvar backColor = [0, 0, 0, 0.8];\r\n\t\t\tfor (var i = 1; i <= getRootComp().numLayers; i++) {\r\n\t\t\t\tif (getRootComp().layer(i).name == \"background\" + \" \" + selectedTextLayer.name) {\r\n\t\t\t\t\tbackColor = getRootComp().layer(i).property(\"ADBE Root Vectors Group\").property(\"background1\").property(\"ADBE Vectors Group\").property(\"ADBE Vector Graphic - Fill\").property(\"ADBE Vector Fill Color\").value;\r\n\t\t\t\t\tgetRootComp().layer(i).remove();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar shapeLayer = getRootComp().layers.addShape();\r\n\t\t\tshapeLayer.name = \"background\" + \" \" + selectedTextLayer.name;\r\n\t\t\tshapeLayer.moveAfter(selectedTextLayer);\r\n\t\t\tshapeLayer.inPoint = selectedTextLayer.inPoint;\r\n\t\t\tshapeLayer.outPoint = selectedTextLayer.outPoint;\r\n\r\n\t\t\t// Add Background Rectangle Shapes:\r\n\t\t\tdrawBackground(shapeLayer, \"background1\", widths, heighs, heighsClean, textTotalHeights, backColor);\r\n\t\t\tdrawBackground(shapeLayer, \"background2\", widths2, heighs2, heighsClean2, textTotalHeights, backColor);\r\n\r\n\t\t\t// Select Text Layer:\r\n\t\t\tselectedTextLayer.selected = true;\r\n\t\t\tshapeLayer.selected = false;\r\n\r\n\t\t\t// Show Confirmation Message:\r\n\r\n\t\t\t//palleteObj.rootGrp.mainContent.message.text = Defaults.getLocalization(\"confirmCreate\").split(\"%1\").join(palleteObj.textLines.length);\r\n\r\n\t\t\tapp.endUndoGroup();\r\n\r\n\t\t}\r\n\t\t/********************************************\r\n\t\t*\t\t\t\tUTILS:\r\n\t\t*********************************************/\r\n\t\tfunction getMaxWidth() {\r\n\t\t\tif (MAX_WIDTH > 0) {\r\n\t\t\t\treturn MAX_WIDTH;\r\n\t\t\t}\r\n\t\t\treturn getRootComp().width - 100;\r\n\t\t}\r\n\t\tfunction doesTextContainsSpecialChars(textToCheck) {\r\n\t\t\treturn textToCheck.indexOf(\"y\") > -1 || textToCheck.indexOf(\"q\") > -1 || textToCheck.indexOf(\"p\") > -1 || textToCheck.indexOf(\"g\") > -1 || textToCheck.indexOf(\"j\") > -1;\r\n\t\t}\r\n\t\tfunction getRootComp() {\r\n\t\t\tvar rootCompCreated;\r\n\t\t\tif (app.project.activeItem && app.project.activeItem instanceof CompItem) {\r\n\t\t\t\treturn app.project.activeItem;\r\n\t\t\t} else {\r\n\t\t\t\talert(\"Please create a composition!\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction getSelectedTextLayer(withAlert) {\r\n\t\t\tif (app.project) {\r\n\t\t\t\tif (app.project.activeItem) {\r\n\t\t\t\t\tif (app.project.activeItem.selectedLayers && app.project.activeItem.selectedLayers.length > 0) {\r\n\t\t\t\t\t\t// Get first Selected Text Layer:\r\n\t\t\t\t\t\tfor (var i = 0; i < app.project.activeItem.selectedLayers.length; i++) {\r\n\t\t\t\t\t\t\tif (app.project.activeItem.selectedLayers[i] instanceof TextLayer) {\r\n\t\t\t\t\t\t\t\treturn app.project.activeItem.selectedLayers[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (withAlert) {\r\n\t\t\t\t\t\t\talert(\"First, select a text layer \");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (withAlert) {\r\n\t\t\t\t\t\t\talert(\"First, select a text layer to edit\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (withAlert) {\r\n\t\t\t\t\t\talert(\"Please create a Composition with at least one text layer.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (withAlert) {\r\n\t\t\t\t\talert(\"Please create a new Project.\");\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//\r\n\t\tfunction drawBackground(shapeLayer, vectorName, widths, heighs, heighsClean, textTotalHeights, backColor) {\r\n\t\t\t// Add Rectangle:\r\n\t\t\tvar vectorGroupUp = shapeLayer.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\n\t\t\tvectorGroupUp.name = vectorName;\r\n\t\t\tvectorGroupUp.property(\"ADBE Vectors Group\").addProperty(\"ADBE Vector Shape - Rect\");\r\n\t\t\t// Color it:\r\n\t\t\tshapeLayer.property(\"ADBE Root Vectors Group\").property(vectorName).property(\"ADBE Vectors Group\").addProperty(\"ADBE Vector Graphic - Fill\").property(\"ADBE Vector Fill Color\").setValue(backColor);\r\n\r\n\t\t\t// Set Position:\r\n\t\t\tvar positionProperty = shapeLayer.property(\"ADBE Root Vectors Group\").property(vectorName).property(\"ADBE Vector Transform Group\").property(\"ADBE Vector Position\");\r\n\t\t\tvar exp = \"var yy = 0;\\n\";\r\n\t\t\texp += \"var heights = \" + heighs + \";\\n\";\r\n\t\t\texp += \"var textTotalHeights = \" + textTotalHeights + \";\\n\";\r\n\t\t\texp += \"var heightsClean = \" + heighsClean + \";\\n\";\r\n\t\t\texp += \"for(i=thisComp.layer(index-1).marker.numKeys;i>=1;i--){\\n\";\r\n\t\t\texp += \"if(time >= thisComp.layer(index-1).marker.key(i).time){\\n\";\r\n\t\t\texp += \"var comm = thisComp.layer(index-1).marker.key(i).comment\\n\";\r\n\t\t\texp += \"if(comm.indexOf('start') >= 0){\\n\"\r\n\t\t\texp += \"var textIndex = comm.substr(5);\\n\"\r\n\t\t\texp += \"var subIndex = parseInt(textIndex)-1;\\n\"\r\n\t\t\texp += \"if(subIndex<heightsClean.length){\\n\";\r\n\t\t\tif (vectorName == \"background1\") {\r\n\t\t\t\t//exp += \"yy = thisComp.layer(index-1)('Transform')('Position')[1] - thisComp.height/2 - heights[subIndex]/2 - (heightsClean[subIndex] - heights[subIndex]);\\n\";\r\n\t\t\t\texp += \"yy = thisComp.layer(index-1)('Transform')('Position')[1] - thisComp.height/2 - heights[subIndex]/2 + heightsClean[subIndex];\\n\";\r\n\t\t\t} else {\r\n\t\t\t\t//exp += \"yy = thisComp.layer(index-1)('Transform')('Position')[1] - thisComp.height/2 + (textTotalHeights[subIndex] - heightsClean[subIndex] ) + heightsClean[subIndex]/2 - (heightsClean[subIndex] - heights[subIndex]);\\n\";\r\n\t\t\t\texp += \"yy = thisComp.layer(index-1)('Transform')('Position')[1] - thisComp.height/2 + textTotalHeights[subIndex] - heights[subIndex]/2 + heightsClean[subIndex];\\n\";\r\n\t\t\t}\r\n\t\t\texp += \"break;\\n\";\r\n\t\t\texp += \"}\\n\";\r\n\t\t\texp += \"}\\n\";\r\n\t\t\texp += \"}\\n\";\r\n\t\t\texp += \"}\\n\";\r\n\t\t\texp += \"[thisComp.layer(index-1)('Transform')('Position')[0]-thisComp.width/2 + value[0], yy + value[1]];\";\r\n\t\t\tpositionProperty.expression = exp;\r\n\r\n\t\t\t// Set Size with expression:\r\n\t\t\tshapeLayer.property(\"ADBE Root Vectors Group\").property(vectorName).property(\"ADBE Vectors Group\").property(\"ADBE Vector Shape - Rect\").property(\"ADBE Vector Rect Size\").setValue([0, 0]);\r\n\t\t\tvar sizeProperty = shapeLayer.property(\"ADBE Root Vectors Group\").property(vectorName).property(\"ADBE Vectors Group\").property(\"ADBE Vector Shape - Rect\").property(\"ADBE Vector Rect Size\");\r\n\r\n\t\t\t// Set Expression for size:\r\n\t\t\tvar exp = \"var ww = 0;\\\r\n\t\t\tvar hh = 0;\\\r\n\t\t\tvar widths = \"+ widths + \";\\\r\n\t\t\tvar heights = \"+ heighs + \";\\\r\n\t\t\tfor(i=thisComp.layer(index-1).marker.numKeys;i>=1;i--){\\\r\n\t\t\t\tif(time >= thisComp.layer(index-1).marker.key(i).time){\\\r\n\t\t\t\t\tvar comm = thisComp.layer(index-1).marker.key(i).comment;\\\r\n\t\t\t\t\tif(comm.indexOf('start') >= 0){\\\r\n\t\t\t\t\t\tvar textIndex = comm.substr(5);\\\r\n\t\t\t\t\t\tvar subIndex = parseInt(textIndex)-1;\\\r\n\t\t\t\t\t\tif(subIndex<widths.length){\\\r\n\t\t\t\t\t\t\tww = widths[subIndex] > 0? widths[subIndex] + heights[subIndex] * 0.25 : 0;\\\r\n\t\t\t\t\t\t\thh = heights[subIndex] > 0 ? heights[subIndex] + heights[subIndex] * 0.25: 0;\\\r\n\t\t\t\t\t\t}\\\r\n\t\t\t\t\t}\\\r\n\t\t\t\t\tbreak;\\\r\n\t\t\t\t}\\\r\n\t\t\t}\\\r\n\t\t\t[ww + value[0],hh + value[1]];\";\r\n\t\t\tsizeProperty.expression = exp;\r\n\t\t}\r\n\r\n\t\tfunction createTextLayer(comp, text, targetLayer) {\r\n\t\t\tvar newLayer = comp.layers.addText(text);\r\n\t\t\tnewLayer.name = text;\r\n\t\t\t// Doc:\r\n\t\t\tvar documentPropertyValue = (targetLayer) ? targetLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value : newLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value;\r\n\t\t\tdocumentPropertyValue.text = text;\r\n\t\t\tdocumentPropertyValue.justification = ParagraphJustification.CENTER_JUSTIFY;\r\n\t\t\tnewLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").setValue(documentPropertyValue);\r\n\t\t\t// Positionate:\r\n\t\t\tvar y = (targetLayer) ? targetLayer.property(\"ADBE Transform Group\").property(\"ADBE Position\").value[1] : comp.height / 2 - (newLayer.sourceRectAtTime(0, false).height + 50);\r\n\t\t\tnewLayer.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([newLayer.property(\"ADBE Transform Group\").property(\"ADBE Position\").value[0], y]);\r\n\t\t\treturn newLayer;\r\n\t\t}\r\n\t\tfunction getLayerHeightForAnchor(comp, layer) {\r\n\t\t\tvar doc = layer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value;\r\n\t\t\tdoc.text = doc.text.split(\"q\").join(\"\").split(\"y\").join(\"\").split(\"p\").join(\"\").split(\"g\").join(\"\").split(\"j\").join(\"\");\r\n\t\t\tvar fakeLayer = comp.layers.addText(doc.text);\r\n\t\t\tfakeLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").setValue(doc);\r\n\t\t\tvar layerH = fakeLayer.sourceRectAtTime(0, true).height;\r\n\t\t\tfakeLayer.remove();\r\n\t\t\treturn Math.round(layerH);\r\n\t\t}\r\n\t\t// Resize Pallete:\r\n\t\tresizePallete(palleteObj);\r\n\t\tpalleteObj.onResizing =\r\n\t\t\tpalleteObj.onRiseze = function () {\r\n\t\t\t\tthis.layout.resize();\r\n\t\t\t}\r\n\r\n\t\t//palleteObj.rootGrp.mainContent.message.text = \"\";\r\n\t\t// Return Pallete:\r\n\t\treturn palleteObj;\r\n\r\n\t}", "title": "" }, { "docid": "1552d9a23f3be0e956e7f8ec9da50ba9", "score": "0.49643546", "text": "function buildObj (cv, hv) {\n var treeObj = {\n C: cv,\n H: hv\n }\n growTree(treeObj)\n}", "title": "" }, { "docid": "bebdbce24b4cb73f725c316058a74104", "score": "0.49560612", "text": "function add_css() {\n var style = element(\"style\");\n style.id = \"svelte-1b7jqew-style\";\n style.textContent = \".title-wrapper.svelte-1b7jqew{display:flex;flex-direction:column;align-items:center;width:100%;padding:0.3em 0.5em;color:#333333}h2.svelte-1b7jqew,h3.svelte-1b7jqew{margin:0.2em 0;white-space:nowrap}h2.svelte-1b7jqew{font-size:1.4em;font-weight:bold}h3.svelte-1b7jqew{font-size:1.2em;font-weight:normal}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "391f93708930ca756d234ed88b5cf547", "score": "0.495583", "text": "function createStyle(style) {\n return new StyleImpl(style, secrets_1.secretToken);\n}", "title": "" }, { "docid": "c93c89bca5585bcca2c3bcc7851a564d", "score": "0.49440172", "text": "getStyle(){\n\t\treturn {\n\n\t\t}\n\t}", "title": "" }, { "docid": "500efa7fb6e5b9f5a4aa4dd028f3f731", "score": "0.49426877", "text": "function makeMainCss() {\n var styleEle = document.createElement('style');\n styleEle.type = 'text/css';\n styleEle.id = \"main-style-css\";\n styleEle.textContent = 'li.new-comment { border: 1px solid #f37221; }' +\n 'li.areplyToMe { border: 2px solid #10DD1B; }' +\n 'a { color: #f37221 !important; }' + \n '.commentId { color: #C5C5C5; }' +\n '.bad-match { color: #C5C5C5; }' +\n '.errorDisplayDiv { color: #FF3535; }' +\n '.new-text { color: #C5C5C5; display: none; }' +\n '.new-comment .new-text { display: inline; }' +\n '.anchor-floater { position: fixed; top: 1; left: 1; bottom: 1; right: 1; margin: auto; width: 200px; height: 130px; padding: 2px 5px; background: rgba(250, 250, 250, 0.90);}' +\n '.comments-floater { position: fixed; right: 4px; top: 4px; padding: 2px 5px; width: 250px;font-size: 14px; border-radius: 5px; background: rgba(250, 250, 250, 0.90); }' +\n '.keyboardFloater { position: fixed; right: 180px; top: 244px; padding: 2px 5px; width: 200px;font-size: 12px; border-radius: 5px; background: rgba(250, 250, 250, 0.90); }' +\n '.show-filter-floater { position: fixed; right: 4px; bottom: 0px; margin-bottom:0px; padding: 2px 5px; }' +\n '.filter-floater { position: fixed; right: 4px; bottom: 0px; margin-bottom:0px; padding: 2px 5px; height: 25vh; width: 250px;font-size: 14px; border-radius: 5px; background: rgba(250, 250, 250, 0.90); }' +\n '.sfilters { width: 250px; height: 20vh; }' +\n '.ufilters { width: 250px; height: 20vh; }' +\n '.cfilters { width: 250px; height: 20vh; }' +\n '.miscfilters { width: 250px; height: 19vh; }' +\n '.comments-scroller { word-wrap: break-word; max-height: 500px; max-height: 70vh; overflow-y:scroll; }' +\n '.comments-date { font-size: 11px; }' +\n '.comments-date-to-me { color: #109D1B; font-size: 11px !important; }' +\n 'a.comment-reply-link { font-size: 13px; }' +\n '.semantic-cell { display: table-cell; }' +\n '.cct-span { white-space: nowrap; }' +\n '.date-input { width: 100%; box-sizing: border-box; }' +\n '.input-span { width: 100%; padding-left: 5px; }' +\n '.hider { position: absolute; left: -22px; top: 6px;}' +\n 'span.next { position: absolute; left: -44px; top: 6px;}' +\n 'article.hide-me { display: none}' +\n 'span.prev { position: absolute; left: -66px; top: 6px;}';\n\n styleEle.textContent = styleEle.textContent + '';\n document.head.appendChild(styleEle);\n}", "title": "" }, { "docid": "ed5afc4f8147b510963b2ec1a119c17b", "score": "0.49386102", "text": "setStyle(style) {}", "title": "" }, { "docid": "fcbaa3067d7909867de55af00b8e4edd", "score": "0.49308938", "text": "function createStyleDictionary(styles) {\n let total = {}\n for (let k in styles) {\n const val = styles[k]\n //sort clz name to judge arbitrary order in multi-className\n k = sortSeq(k)\n //merge style chain from last condition\n const lastEle = getLastEle(k)\n //no sharing data. create new chain\n if (!total.hasOwnProperty(lastEle)) {\n total[lastEle] = createItem(k, val)[lastEle]\n } else {\n //merge chain data\n merge(createItem(k, styles[k]), total)\n }\n }\n return total\n}", "title": "" }, { "docid": "a547d8d838435518de1f0b4996f4a5a1", "score": "0.4930059", "text": "function compileObjectOverhead(currentHeading) {\n // Begin by compiling the button for the object.\n compileNavObjectButton(currentHeading);\n\n // Cycle through object children (if any), and run this function on them.\n for (var i = 0; i < window.headings[currentHeading]['subheadings'].length; i++) {\n compileObjectOverhead(window.headings[currentHeading]['subheadings'][i]);\n }\n\n // Proceed to compile the slideout for the object if it has children. - NEEDS CHILDREN BUTTONS\n if (window.headings[currentHeading]['actions'] === 'expand') {\n compileNavObjectSlideout(currentHeading);\n }\n // The object is now created. \n}", "title": "" }, { "docid": "604bb2200e5856bd8dcfc3c9d4ab50b0", "score": "0.49181184", "text": "function DomStyleObj(styleName){\n\t\t\n\t\tthis.styleName = styleName;\n\t}", "title": "" }, { "docid": "cbf5ed868c3f5f1016a719e4b6094195", "score": "0.49181053", "text": "function processStyles() {\n if (globalVar.project.styles.length <= 0) return;\n\n for (var i = globalVar.project.styles.length - 1; i >= 0; i--) {\n if (globalVar.project.styles[i].match(/https?:\\/\\//)) {\n d3.select(\"head\")\n .append(\"link\")\n .attr(\"rel\", \"stylesheet\")\n .attr(\"type\", \"text/css\")\n .attr(\"href\", globalVar.project.styles[i]);\n } else {\n d3.select(\"head\")\n .append(\"style\")\n .classed(\"kyrixstyles\", true)\n .attr(\"type\", \"text/css\")\n .html(globalVar.project.styles[i]);\n }\n }\n }", "title": "" }, { "docid": "c91ef6e11b192cbc72fd7c6fd4125b3d", "score": "0.49152976", "text": "function add_css$3() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-fq6v4k-style\";\n\tstyle.textContent = \"div.breadcrumbs-matrix.svelte-fq6v4k.svelte-fq6v4k{padding:5px}div.breadcrumbs-matrix.svelte-fq6v4k>div.svelte-fq6v4k{border:3px solid var(--background-modifier-border);border-radius:3px;text-align:center;margin:3px;position:relative;height:fit-content}div.breadcrumbs-matrix-square.svelte-fq6v4k.svelte-fq6v4k{border:1px solid var(--background-modifier-border)}.breadcrumbs-matrix-header.svelte-fq6v4k.svelte-fq6v4k{margin:2px}h3.breadcrumbs-matrix-header.svelte-fq6v4k.svelte-fq6v4k{color:var(--text-title-h3)}h5.breadcrumbs-matrix-header.svelte-fq6v4k.svelte-fq6v4k{color:var(--text-title-h5)}ol.svelte-fq6v4k.svelte-fq6v4k{margin:3px;padding-left:20px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "05b51862e252ab8183447ff015ac5d5a", "score": "0.49136445", "text": "function createImageStyle(image)\n {\n image.tag = 'image';\n\n // skip non image\n if (!image || (typeof image) != 'object' || !image.name || image.style)\n {\n return;\n }\n image.style = {position: 'absolute'};\n\n if (stylePos(image, image.style) || image.name == 'logo')\n {\n delete image.transformRotation;\n delete image.transformOrigin;\n styleSize(image, image.style);\n styleImageMaxSize(image, image.style);\n styleOrigin(image, image.style);\n styleRotation(image, image.style);\n calcObjBounds(image);\n styleImagePathColorTile(image, image.style);\n styleImageZIndex(image, image.style);\n }\n }", "title": "" }, { "docid": "f30ef15e73cb896220197adfc3a31e5e", "score": "0.49116814", "text": "function add_css$5() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1widvzq-style\";\n\tstyle.textContent = \".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "43987a8c07e9c05b9e489cbc68e3fb95", "score": "0.49064377", "text": "function compile(str, path){\n\treturn stylus(str)\n\t.set('filename', path)\n\t.use(nib())\n}", "title": "" }, { "docid": "36b3d34442d9f85ac950e40565b9bd93", "score": "0.4903819", "text": "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1vwr9dd-style\";\n\tstyle.textContent = \".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "e4e03a82efe620991929428162df3c80", "score": "0.49021733", "text": "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1biulrt-style\";\n\tstyle.textContent = \"svg.svelte-1biulrt.svelte-1biulrt{position:absolute;z-index:99;pointer-events:none}svg.svelte-1biulrt.svelte-1biulrt:hover{stroke-width:6}svg.svelte-1biulrt path.svelte-1biulrt{stroke:red;stroke-width:2;fill:#eee7;pointer-events:auto}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "3bc8dcd9cc9e18475cf792abfeda04ed", "score": "0.48991275", "text": "function Styling() {\r\n this.styles = {};\r\n }", "title": "" }, { "docid": "dbccccba336a5615cdd361593cc3580d", "score": "0.48964867", "text": "function yv(t,e,n,r,i,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),u._scopeId=r,u}", "title": "" }, { "docid": "72f5535b17a96e0248ab2c9613fb3c83", "score": "0.4895946", "text": "function parse(style) {\n return buildMeta(style)\n .then(buildMeta)\n .then(assignVars)\n .then(usercss.buildCode);\n }", "title": "" }, { "docid": "6522310d3630007aadd12989ee6df776", "score": "0.48910072", "text": "function createTextStyle(text)\n {\n if (!text || (typeof text) != 'object' || text.style)\n {\n return;\n }\n text.tag = 'text';\n text.style = {};\n text.inner = {};\n\n if (!stylePos(text, text.style))\n {\n return;\n }\n\n styleFontSize(text, text.inner);\n\n if (text.name == \"help\")\n {\n if (!text.textColor)\n {\n text.textColor = '777777';\n }\n if (!text.iconColor)\n {\n text.iconColor = '777777';\n }\n text.style.color = '#'+text.textColor.substring(0,6);\n }\n else if (text.anchor_label)\n {\n text.style.left = '100%';\n text.style.top = '0';\n text.inner['margin-left'] = util.pct(text.fontSize * 0.75,'vmin');\n if (!text.fontFamily)\n {\n text.inner['font-family'] = 'ohc_regular';\n }\n }\n else if (!text.pos)\n {\n text.style.display = 'none';\n return;\n }\n\n // default size for helpsystembar\n if (text.name == \"help\" && !text.size)\n {\n text.size = {w: text.pos\n ? 1 - text.pos.x // to right edge\n : 1, // full width\n h: text.fontSize\n ? text.fontSize + 0.01 // padding \n : 0.045};\n }\n\n styleSize(text, text.style);\n text.inner.width = text.style.width;\n\n if (!text.lineSpacing)\n {\n text.lineSpacing = self.defaultLineSpacing;\n }\n else\n {\n text.lineSpacing = util.round(text.lineSpacing * 1.03, 4);\n }\n\n calcObjBounds(text);\n\n if (text.size)\n {\n if (text.size.w)\n {\n text.style['max-width'] = text.style.width;\n }\n }\n\n if (text.name == 'md_description')\n {\n text.multiline = true;\n }\n\n var height = text.fontSize * self.defaultLineSpacing; // text.lineSpacing\n\n if (text.size && text.size.h)\n {\n height = text.size.h;\n }\n\n text.style.height = util.pct(height,'vh');\n\n text.rows = Math.floor(height / text.fontSize) || 1;\n if (text.multiline && text.lineSpacing)\n {\n if (text.name != 'gamelist')\n {\n text.inner['line-height'] = text.lineSpacing;\n }\n }\n\n styleColor(text, text.inner);\n styleBackgroundColor(text, text.style);\n styleAlignment(text, text.inner);\n styleFontFamily(text, text.inner);\n styleForceUppercase(text, text.inner);\n styleTextZIndex(text, text.style);\n }", "title": "" }, { "docid": "0e58bbeab50028c7c2dab49aa06855ae", "score": "0.48908228", "text": "function Vw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"style.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "d3d0b1435faaae4cb8aa2d71160c0ac7", "score": "0.48905465", "text": "stylesheet(rules, range) {\n return { type: common_1.nodeType.stylesheet, rules, range };\n }", "title": "" }, { "docid": "9176dfa46fc93df86a4f8f8cef113efa", "score": "0.4889938", "text": "function buildABear(name, age, fur, clothes, specialPower) {\n<<<<<<< HEAD\n // Declare a variable named greeting - value is a string with the name parameter interpolated in it\n=======\n // Declare a variable named greeting - value is a string with the name parameter interpolated in it \n>>>>>>> 3ed3d3e9c77c32c6b5c350e3ae9aeb8504c0dac7\n var greeting = `Hey partner! My name is ${name} - will you be my friend?!`;\n // Declare a variable named demographics - value is an array with the name and age parameters inside of it\n var demographics = [name, age];\n // Declare a variable named powerSaying - value is a string with the parameter specialPower concatenated into it\n var powerSaying = \"Did you know that I can \" + specialPower + \" ?\";\n // Declare an object named builtBear and open curly brackets\n var builtBear = {\n // Add key/value pair with the key of basicInfo and the value as the demogrphics variable\n basicInfo: demographics,\n<<<<<<< HEAD\n // Add key/value pair with the key of clothes and the value as the clothes parameter\n clothes: clothes,\n // Add key/value pair with the key of exterior and the value of the fur parameter\n exterior: fur,\n // Add key/value pair with the key cost and the value as the floating point number 49.99\n cost: 49.99,\n // Add key/value pair with the key sayings and the value as an array that includes the greeting variable,\n=======\n // Add key/value pair with the key of clothes and the value as the clothes parameter \n clothes: clothes,\n // Add key/value pair with the key of exterior and the value of the fur parameter \n exterior: fur,\n // Add key/value pair with the key cost and the value as the floating point number 49.99\n cost: 49.99,\n // Add key/value pair with the key sayings and the value as an array that includes the greeting variable, \n>>>>>>> 3ed3d3e9c77c32c6b5c350e3ae9aeb8504c0dac7\n //the powersaying variable, and a string of \"Goodnight my friend!\"\n sayings: [greeting, powerSaying, \"Goodnight my friend!\"],\n // Add key/value pair with the key isCuddly and the value as a boolean of true\n isCuddly: true,\n // Close the object's curly brackets\n };\n // When the function is called it will return the object builtBear value\n return builtBear\n // Close the function's curly brackets\n}", "title": "" }, { "docid": "f67caf4bea6f989bf6da176a15392504", "score": "0.4884837", "text": "function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? \"production\" === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }", "title": "" }, { "docid": "ccb1eab501a7826437c54557267ba412", "score": "0.48739216", "text": "setStyle(styles = {}) {\n let output = \"\";\n \n for (let key in styles) {\n let style = styles[key];\n if (style == null) {\n continue;\n }\n\n output += this.database[(style ? \"enter\" : \"exit\") + key[0].toUpperCase() + key.substring(1)];\n }\n\n this.write(output);\n }", "title": "" }, { "docid": "53c2d1141014c1b0a40e4eea2845b593", "score": "0.48670167", "text": "build() {\n\n }", "title": "" }, { "docid": "fd5f251add387e1a9edba76cd7cd079b", "score": "0.48617008", "text": "get style() {\n var maszaStyle = `\n position: absolute;\n z-index: 1;\n background-image: url(\"${this.spriteImg}\");\n background-size: ${this.sprite.x}px ${this.sprite.y}px;\n height: ${this.height}px;\n width: ${this.width}px;\n top: ${this.pos.y - this.height}px;\n left: ${this.pos.x - this.width/2}px;\n `;\n // Parse the variant (e.g. alternative frame)\n if(\n this.animation.altFrame &&\n this.animation.variants !== undefined &&\n this.animation.variants.altFrame !== undefined\n ) {\n maszaStyle += actionStyle(this.animation.variants.altFrame);\n }\n\n // Parse the action\n if(\n this.animation.actions !== undefined &&\n this.animation.actions[this.animation.type] !== undefined\n ) {\n maszaStyle += actionStyle(this.animation.actions[this.animation.type]);\n }\n\n // Flip the image if necessary\n if(this.animation.flipped) {\n maszaStyle += \"-moz-transform: scaleX(-1);-o-transform: scaleX(-1);-webkit-transform: scaleX(-1);transform: scaleX(-1);\";\n }\n return maszaStyle;\n }", "title": "" }, { "docid": "df48ccaf708f7b58faa8f4534415e5b3", "score": "0.4858044", "text": "function add_css$1() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-46v1v3-style\";\n\tstyle.textContent = \"div.breadcrumbs-trail-grid.svelte-46v1v3{border:2px solid var(--background-modifier-border);display:grid;align-items:stretch;width:auto;height:auto}div.breadcrumbs-trail-grid-item.svelte-46v1v3{display:flex;flex-direction:column;border:1px solid var(--background-modifier-border);align-items:center;justify-content:center;padding:2px;font-size:smaller}div.breadcrumbs-trail-grid-item.breadcrumbs-filler.svelte-46v1v3{opacity:0.7}.dot.svelte-46v1v3{height:5px;width:5px;border-radius:50%;display:inline-block}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "e042dc720a6bc0dcfd5a917fcb47a5d8", "score": "0.485547", "text": "function buildObj(cfgObj, baseObj)\n {\n // Try to find the corresponding constructor\n var ctor = baseObj[cfgObj.id];\n\n // Ensure that this is a valid constructor id\n if (!ctor || !(ctor.prototype instanceof baseObj))\n error('unknown dimension: \"' + cfgObj.id + '\"');\n\n // Create an object from the constructor\n var newObj = new ctor();\n\n // Load the configuration parameters for the object\n newObj.loadParams(cfgObj);\n\n return newObj;\n }", "title": "" }, { "docid": "6f2f8c7c450945ff4317c0884c4fbcfd", "score": "0.48547244", "text": "make() {\n\n }", "title": "" }, { "docid": "b267b4422419e07f08910ebb0c723c31", "score": "0.48533693", "text": "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-rb5mhu-style\";\n\tstyle.textContent = \"table.svelte-rb5mhu{border-collapse:collapse}td.svelte-rb5mhu:first-child{text-align:right}td.svelte-rb5mhu,th.svelte-rb5mhu{padding:3px;border:1px solid var(--background-modifier-border);white-space:pre-line}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "9a6d6012566bc33d556efbbfe1aec11b", "score": "0.48506135", "text": "function build_types_and_properties() {\n for(var i=0; i<Object.keys(schema_src['@graph']).length; i++) {\n // build classes\n if(schema_src['@graph'][i]['@type'] === 'rdfs:Class') {\n types.push(new Type(schema_src['@graph'][i]['@id'], schema_src['@graph'][i]['rdfs:comment'], schema_src['@graph'][i]['rdfs:label']));\n\n //sub types\n if(schema_src['@graph'][i].hasOwnProperty('rdfs:subClassOf')) {\n if(Object.keys(schema_src['@graph'][i]['rdfs:subClassOf']).length === 1) {\n types[types.length-1].subClassOf.push(schema_src['@graph'][i]['rdfs:subClassOf']['@id']);\n } else {\n for(var j=0; j<Object.keys(schema_src['@graph'][i]['rdfs:subClassOf']).length; j++) {\n types[types.length-1].subClassOf.push(schema_src['@graph'][i]['rdfs:subClassOf'][j]['@id']);\n }\n }\n }\n\n //parent types\n if(schema_src['@graph'][i].hasOwnProperty('schema:isPartOf')) {\n if(Object.keys(schema_src['@graph'][i]['schema:isPartOf']).length === 1) {\n types[types.length-1].isPartOf.push(schema_src['@graph'][i]['schema:isPartOf']['@id']);\n } else {\n for(var k=0; k<Object.keys(schema_src['@graph'][i]['schema:isPartOf']).length; k++) {\n types[types.length-1].isPartOf.push(schema_src['@graph'][i]['schema:isPartOf'][k]['@id']);\n }\n }\n }\n }\n\n // build properties\n if(schema_src['@graph'][i]['@type'] === 'rdf:Property') {\n properties.push(new Property(schema_src['@graph'][i]['@id'], schema_src['@graph'][i]['rdfs:comment'], schema_src['@graph'][i]['rdfs:label']));\n\n // add domainIncludes (types using this property)\n if(schema_src['@graph'][i].hasOwnProperty('schema:domainIncludes')) {\n if(Object.keys(schema_src['@graph'][i]['schema:domainIncludes']).length === 1) {\n properties[properties.length-1].domainIncludes.push(schema_src['@graph'][i]['schema:domainIncludes']['@id']);\n } else {\n for(var j=0; j<Object.keys(schema_src['@graph'][i]['schema:domainIncludes']).length; j++) {\n properties[properties.length-1].domainIncludes.push(schema_src['@graph'][i]['schema:domainIncludes'][j]['@id']);\n }\n }\n }\n\n // add rangeIncludes (data types)\n if(schema_src['@graph'][i].hasOwnProperty('schema:rangeIncludes')) {\n if(Object.keys(schema_src['@graph'][i]['schema:rangeIncludes']).length === 1) {\n properties[properties.length-1].rangeIncludes.push(schema_src['@graph'][i]['schema:rangeIncludes']['@id']);\n } else {\n for(var k=0; k<Object.keys(schema_src['@graph'][i]['schema:rangeIncludes']).length; k++) {\n properties[properties.length-1].rangeIncludes.push(schema_src['@graph'][i]['schema:rangeIncludes'][k]['@id']);\n }\n }\n } \n }\n }\n //console.log(types);\n //console.log(properties);\n}", "title": "" }, { "docid": "8559f8b3d12b700c4cb2bdeb087bf22e", "score": "0.4838769", "text": "function buildUI (thisObj ) {\n var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'FSS Fake Parallax',[0,0,150,260],{resizeable: true});\n\n if (win !== null) {\n\n var H = 25; // the height\n var W = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n\n // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\n // win.check_box.value = metaObject.setting1;\n win.do_it_button = win.add('button', [x ,y,x+W*3,y + H], 'do it');\n // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up');\n\n // win.check_box.onClick = function (){\n // alert(\"check\");\n // };\n win.do_it_button.onClick = function () {\n runit();\n };\n\n }\n return win;\n}", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.48328865", "text": "function DebugStyling() { }", "title": "" }, { "docid": "a1a20080d4071f2823e43a5f4e4180e4", "score": "0.48294073", "text": "function ANIMATE($anim) {\n\n var that = this,\n an = {},\n myData = {},\n styleCur = {},\n\n isOverflowOnNode;\n\n\n\n /**\n * FUNCTION CLASS\n */\n /**\n * CHECK & INITIALIZATION ANIMATION\n */\n function Init() {\n\n /**\n * SETUP VARIABLE AT FIRST\n */\n an.rubyID = DB.GetRubyID($anim);\n myData = that.data = vData[an.rubyID];\n\n // Setup initialization timer of object\n if( myData.tsInit == UNDE ) myData.tsInit = VA.tsCur;\n\n // Properties & options of object\n var prop = myData.prop,\n opts = myData.opts;\n\n an.propEnd = prop[prop.length - 1];\n an.optsEnd = opts[opts.length - 1];\n\n\n\n /**\n * SETUP AFTER START ANIMATION\n */\n SetupStyleBegin();\n Start();\n }\n\n\n /**\n * SETUP VALUE OF STYLE & TRANSFORM AT FIRST\n */\n function SetupStyleBegin() {\n\n // Setup properties of normal Style\n StyleBegin();\n\n // Setup properties of transform CSS\n TransformBegin();\n }\n\n\n /**\n * SETUP VALUE OF STYLE AT FIRST\n */\n function StyleBegin() {\n\n var styleBegin = an.optsEnd.styleBegin,\n styleEnd = an.optsEnd.styleEnd,\n opts = myData.opts,\n isAnimMulti = opts.length > 1;\n\n\n /**\n * LOOP TO SETUP VALUE NOT BE TRANSFORM CSS\n */\n for( var name in an.propEnd ) {\n if( $.inArray(name, VA.nameTf) === -1 ) {\n\n /**\n * SETUP STYLE END\n * + Parse & convert value of StyleEnd\n */\n var valueCur = an['propEnd'][name];\n styleEnd[name] = M.ParseCssStyle(valueCur);\n\n\n\n /**\n * SETUP STYLE BEGIN\n */\n // Case: name of properties have fixed value -> inherit value of tfEnd\n if( $.inArray(name, VA.propFixed) !== -1 ) {\n styleBegin[name] = styleEnd[name];\n }\n\n else {\n // Parse & convert value of StyleBegin\n valueCur = $anim.css(name);\n styleBegin[name] = M.ParseCssStyle(valueCur);\n }\n }\n }\n\n\n // Inherit StyleEnd of animation before\n if( isAnimMulti ) styleBegin = $.extend(styleBegin, opts[opts.length - 2]['styleEnd']);\n\n // Inherit properties of CSS Style 'point' have setup before\n if( myData.cssStyle !== null ) {\n styleBegin = $.extend(true, styleBegin, myData.cssStyle);\n\n // Remove properties CSS Style after inherit\n myData.cssStyle = null;\n }\n\n\n\n\n\n /**\n * SETUP INHERIT PROPERTIES OF STYLE-END FROM STYLE-BEGIN\n */\n for( var name in styleBegin ) {\n\n if( styleEnd[name] === UNDE ) {\n styleEnd[name] = styleBegin[name];\n }\n }\n }\n\n\n /**\n * SETUP VALUE OF TRANSFORM AT FIRST\n */\n function TransformBegin() {\n var opts = myData.opts;\n\n\n /**\n * GET TRANSFORM OF OBJECT AT FIRST\n */\n // Case: have many continuous animation\n var tfBegin;\n if( opts.length > 1 ) {\n\n // Get Transform-begin from Transform-end before\n tfBegin = $.extend({}, opts[opts.length - 2]['tfEnd']);\n }\n\n // Case: only 1 animation\n else {\n tfBegin = myData.tfCur;\n if( tfBegin == UNDE ) {\n\n var matrixBegin = MATRIX.getFromItem($anim);\n\n /**\n * PARSE MATRIX TO INITIAL PROPERTIES\n */\n tfBegin = MATRIX.parse(matrixBegin);\n }\n }\n\n\n // Inherit the properties CSS Transform 'point' have setup before\n if( myData.cssTf !== null ) {\n tfBegin = $.extend(true, tfBegin, myData.cssTf);\n\n // Remove CSS Transform property after inherit\n myData.cssTf = null;\n }\n\n\n\n\n\n /**\n * GET TRANSFORM-END FROM SETUP PROPERTIES\n */\n var tfEnd = TF.FromProp(an.propEnd);\n\n\n\n\n /**\n * SETUP TRANSFORM INHERIT FROM PROPERTIES BEFORE\n */\n // Inherit 'tfBegin' properties but 'tfEnd' does not have, order of Transform depends on options\n tfEnd = TF.Extend(tfBegin, tfEnd, an.optsEnd);\n\n var tfDefault = VA.tfDefault;\n for( var name in tfEnd ) {\n\n /**\n * ADDITIONAL PROPERTIES WITH TRANSFORM-BEGIN\n */\n if( tfBegin[name] === UNDE ) {\n\n // Case: value of properties !== default value\n if( tfEnd[name] != tfDefault[name] ) {\n\n // Case: name of property has fixed value -> inherit value from 'tfEnd'\n if( $.inArray(name, VA.propFixed) !== -1 ) tfBegin[name] = tfEnd[name];\n\n // Case normal -> default value\n else tfBegin[name] = tfDefault[name];\n }\n\n // Case similar to default value: remove from Transform-end\n else {\n delete tfEnd[name];\n }\n }\n\n\n\n /**\n * REMOVE PROPERTIES ON TRANSFORM BEGIN - END SIMILAR TO DEFAULT PROPERTIES\n */\n if( tfBegin[name] == tfDefault[name] && tfEnd[name] == tfDefault[name] ) {\n delete tfBegin[name];\n delete tfEnd[name];\n }\n }\n\n an.optsEnd.tfBegin = tfBegin;\n an.optsEnd.tfEnd = tfEnd;\n }\n\n\n /**\n * SETUP VALUE WHEN BEGIN ANIMATION\n */\n function Start() {\n\n /**\n * INSERT STYLE 'OVERFLOW' AT FIRST: FIXED FOR OLD BROWSER\n */\n var style = $anim.attr('style');\n isOverflowOnNode = style && style.indexOf('overflow') !== -1;\n\n // Unavailable\n // !isOverflowOnNode && $anim.css('overflow', 'hidden');\n\n\n\n /**\n * EXECUTE FUNCTION 'START' AT FIRST\n */\n !!an.optsEnd.start && an.optsEnd.start();\n }\n\n\n\n\n\n\n\n\n\n\n\n /**\n * SETUP NEXT VALUE OF OBJECT, CALL FUNCTION FROM 'TWEEN'\n * @param boolean isForceAnim Allways setup style for object\n */\n that.next = function(isForceAnim) {\n\n /**\n * SETUP CURRENT TIME\n * @param Int an.xCur Current time, in range [0, 1]\n * @param Boolean isAnimate Check setup current animation\n */\n var opts = myData.opts,\n isAnimate = false,\n isComplete = false,\n tCur = myData.tCur = VA.tsCur - myData.tsInit;\n\n\n for( var i = 0, len = opts.length; i < len; i++ ) {\n var optsCur = opts[i];\n\n // Case: tCur at the forward position the first Aniamtion\n if( tCur < optsCur.tPlay && i == 0 ) {\n\n // Case: allways setup Style of object\n if( isForceAnim ) {\n an.optsPos = i;\n an.xCur = 0;\n }\n\n // Case normal\n else an.xCur = null;\n break;\n }\n\n // Case: 'tCur' at the behide position the last Animation\n else if( tCur > optsCur.tEnd && i == len - 1 ) {\n an.optsPos = i;\n an.xCur = 1;\n isComplete = true;\n break;\n }\n\n // Case: 'tCur' located inside Animation\n else if( optsCur.tPlay <= tCur && tCur <= optsCur.tEnd ) {\n an.optsPos = i;\n an.xCur = $.GSGDEasing[optsCur.easing](null, tCur - optsCur.tPlay, 0, 1, optsCur.duration);\n isAnimate = true;\n break;\n }\n\n // Case: 'tCur' located outside Animation\n else if( !!opts[i + 1] && optsCur.tEnd < tCur && tCur < opts[i + 1].tPlay ) {\n an.optsPos = i;\n an.xCur = 1;\n break;\n }\n }\n\n\n\n\n /**\n * SETUP VALUE OF CURRENT STYLE ON OBJECT\n */\n if( an.xCur !== null && opts.length ) {\n\n // First, reset size of Item\n GetSizeItem();\n\n // Reset variable 'styleCur'\n styleCur = {};\n\n // Setup current Style value of the object\n StyleNormalCur();\n StyleTransformCur();\n $anim.css(styleCur);\n }\n\n\n\n /**\n * EXECUTE OPTION 'COMPLETE'\n */\n if( isComplete ) {\n var optsCur = opts[an.optsPos];\n !!optsCur.complete && optsCur.complete();\n }\n\n\n /**\n * Return value check have Animation\n */\n return isAnimate;\n };\n\n\n\n\n\n\n\n\n\n\n\n /**\n * CONVERT VALUE HAS OTHER UNIT TO 'PX'\n * + Support convert '%' to 'px'\n */\n function ConvertValue(name, valueCur) {\n\n /*\n * CASE: STRING\n */\n if( typeof valueCur == 'string' ) {\n\n /**\n * CASE: UNIT IS 'PX'\n */\n if( /px$/.test(valueCur) ) {\n valueCur = parseFloat(valueCur);\n }\n\n\n /**\n * CASE: UNIT IS '%'\n */\n else if( /\\%$/.test(valueCur) ) {\n\n // Name of property exist in conversion system\n var nameSizeFn = VA.percentRef[name];\n if( nameSizeFn !== UNDE ) {\n\n var sizeCur = an['size'][nameSizeFn];\n valueCur = sizeCur * parseFloat(valueCur) / 100;\n }\n }\n }\n\n\n\n /**\n * RETURN VALUE AFTER SETUP\n */\n return valueCur;\n }\n\n\n /**\n * GET SIZE OF ITEM IN CURRENT TIME\n */\n function GetSizeItem() {\n\n an.size = {\n 'OuterWidth' : M.OuterWidth($anim),\n 'OuterHeight' : M.OuterHeight($anim)\n };\n }\n\n\n /**\n * SETUP VALUE PLUS DEPENDS ON PROPERTY NAME\n */\n function ValueCurForNumber(name, valueBegin, valueEnd) {\n var nameToFloat = ['opacity'],\n plus = (valueEnd - valueBegin) * an.xCur;\n\n // Case: rounded number float\n if( $.inArray(name, nameToFloat) !== -1 ) {\n plus = Math.round(plus * 1000) / 1000;\n }\n\n // Case: rounded to integer\n else {\n\n /**\n * ADDITIONAL 1 FRACTION : ANIMATE SMOOTHER\n */\n plus = Math.round(plus * 10) / 10;\n }\n return valueBegin + plus;\n }\n\n\n /**\n * SETUP VALUE OF PROPERTY IS ARRAY[]\n */\n function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for( var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++ ) {\n\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]),\n vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n\n // Case: value 'begin' not exist\n if( vaBeginCur === UNDE ) vaBeginCur = vaEndCur;\n\n\n\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur,\n valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n\n aValue.push(valueCur + 'px');\n }\n\n\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }\n\n\n /**\n * SETUP NORMAL PROPERTIES AT THE CURRENT TIME\n */\n function StyleNormalCur() {\n var optsCur = myData['opts'][an.optsPos];\n\n\n for( var name in optsCur['styleBegin'] ) {\n var valueBegin = optsCur['styleBegin'][name],\n valueEnd = optsCur['styleEnd'][name],\n valueCur;\n\n\n /**\n * CASE: PROPERTY HAS VALUE IS ARRAY[]\n */\n if( $.isArray(valueBegin) ) {\n valueCur = ValueCurForArray(name, valueBegin, valueEnd);\n }\n\n\n /**\n * CASE: PROPERTY HAS OTHER VALUE\n */\n else {\n\n // Convert value String to Number (if posible)\n valueBegin = ConvertValue(name, valueBegin);\n valueEnd = ConvertValue(name, valueEnd);\n\n // Case: value of property is Number\n if( $.isNumeric(valueBegin) && $.isNumeric(valueEnd) ) {\n valueCur = ValueCurForNumber(name, valueBegin, valueEnd);\n }\n\n // Other case: keep changes\n else {\n valueCur = valueBegin;\n }\n }\n\n\n\n\n\n /**\n * REMOVE STYLES HAVE DEFAULT VALUE\n */\n if( optsCur.isClearStyleDefault && VA['styleDefault'][name] === valueCur ) {\n valueCur = '';\n }\n\n\n\n /**\n * STORE VALUE OF CURRENT PROPERTY\n */\n styleCur[name] = valueCur;\n }\n }\n\n\n /**\n * SETUP 'TRANSFORM' IN CURRENT TIME\n */\n function StyleTransformCur() {\n\n /**\n * SETUP CURRENT VALUE EACH TRANSFORM PROPERTIES\n */\n var optsCur = myData['opts'][an.optsPos],\n tfBegin = optsCur.tfBegin,\n tfEnd = optsCur.tfEnd,\n tfCur = {};\n\n for( var name in tfEnd ) {\n\n // Setup value 'plus' of each properties\n var tfBeginCur = TF.ConvertValueToPX($anim, name, tfBegin[name]),\n tfEndCur = TF.ConvertValueToPX($anim, name, tfEnd[name]),\n\n valuePlus = (tfEndCur - tfBeginCur) * an.xCur,\n valueCur = tfBeginCur + valuePlus;\n\n // Value of current property\n tfCur[name] = valueCur;\n }\n\n\n\n\n /**\n * CONVERT PARTICULAR PROPERTY OF TRANSFORM TO CSS\n */\n var cssTf = TF.ToCss(tfCur, optsCur);\n\n\n\n\n /**\n * STORE CURRENT TRANSFORM CSS\n */\n var nameTf = VA.prefix + 'transform';\n styleCur[nameTf] = cssTf;\n\n // Store current Transform into system\n myData.tfCur = tfCur;\n }\n\n\n\n\n\n\n\n\n\n\n\n // Initialize Animation\n Init();\n }", "title": "" }, { "docid": "a1a20080d4071f2823e43a5f4e4180e4", "score": "0.48294073", "text": "function ANIMATE($anim) {\n\n var that = this,\n an = {},\n myData = {},\n styleCur = {},\n\n isOverflowOnNode;\n\n\n\n /**\n * FUNCTION CLASS\n */\n /**\n * CHECK & INITIALIZATION ANIMATION\n */\n function Init() {\n\n /**\n * SETUP VARIABLE AT FIRST\n */\n an.rubyID = DB.GetRubyID($anim);\n myData = that.data = vData[an.rubyID];\n\n // Setup initialization timer of object\n if( myData.tsInit == UNDE ) myData.tsInit = VA.tsCur;\n\n // Properties & options of object\n var prop = myData.prop,\n opts = myData.opts;\n\n an.propEnd = prop[prop.length - 1];\n an.optsEnd = opts[opts.length - 1];\n\n\n\n /**\n * SETUP AFTER START ANIMATION\n */\n SetupStyleBegin();\n Start();\n }\n\n\n /**\n * SETUP VALUE OF STYLE & TRANSFORM AT FIRST\n */\n function SetupStyleBegin() {\n\n // Setup properties of normal Style\n StyleBegin();\n\n // Setup properties of transform CSS\n TransformBegin();\n }\n\n\n /**\n * SETUP VALUE OF STYLE AT FIRST\n */\n function StyleBegin() {\n\n var styleBegin = an.optsEnd.styleBegin,\n styleEnd = an.optsEnd.styleEnd,\n opts = myData.opts,\n isAnimMulti = opts.length > 1;\n\n\n /**\n * LOOP TO SETUP VALUE NOT BE TRANSFORM CSS\n */\n for( var name in an.propEnd ) {\n if( $.inArray(name, VA.nameTf) === -1 ) {\n\n /**\n * SETUP STYLE END\n * + Parse & convert value of StyleEnd\n */\n var valueCur = an['propEnd'][name];\n styleEnd[name] = M.ParseCssStyle(valueCur);\n\n\n\n /**\n * SETUP STYLE BEGIN\n */\n // Case: name of properties have fixed value -> inherit value of tfEnd\n if( $.inArray(name, VA.propFixed) !== -1 ) {\n styleBegin[name] = styleEnd[name];\n }\n\n else {\n // Parse & convert value of StyleBegin\n valueCur = $anim.css(name);\n styleBegin[name] = M.ParseCssStyle(valueCur);\n }\n }\n }\n\n\n // Inherit StyleEnd of animation before\n if( isAnimMulti ) styleBegin = $.extend(styleBegin, opts[opts.length - 2]['styleEnd']);\n\n // Inherit properties of CSS Style 'point' have setup before\n if( myData.cssStyle !== null ) {\n styleBegin = $.extend(true, styleBegin, myData.cssStyle);\n\n // Remove properties CSS Style after inherit\n myData.cssStyle = null;\n }\n\n\n\n\n\n /**\n * SETUP INHERIT PROPERTIES OF STYLE-END FROM STYLE-BEGIN\n */\n for( var name in styleBegin ) {\n\n if( styleEnd[name] === UNDE ) {\n styleEnd[name] = styleBegin[name];\n }\n }\n }\n\n\n /**\n * SETUP VALUE OF TRANSFORM AT FIRST\n */\n function TransformBegin() {\n var opts = myData.opts;\n\n\n /**\n * GET TRANSFORM OF OBJECT AT FIRST\n */\n // Case: have many continuous animation\n var tfBegin;\n if( opts.length > 1 ) {\n\n // Get Transform-begin from Transform-end before\n tfBegin = $.extend({}, opts[opts.length - 2]['tfEnd']);\n }\n\n // Case: only 1 animation\n else {\n tfBegin = myData.tfCur;\n if( tfBegin == UNDE ) {\n\n var matrixBegin = MATRIX.getFromItem($anim);\n\n /**\n * PARSE MATRIX TO INITIAL PROPERTIES\n */\n tfBegin = MATRIX.parse(matrixBegin);\n }\n }\n\n\n // Inherit the properties CSS Transform 'point' have setup before\n if( myData.cssTf !== null ) {\n tfBegin = $.extend(true, tfBegin, myData.cssTf);\n\n // Remove CSS Transform property after inherit\n myData.cssTf = null;\n }\n\n\n\n\n\n /**\n * GET TRANSFORM-END FROM SETUP PROPERTIES\n */\n var tfEnd = TF.FromProp(an.propEnd);\n\n\n\n\n /**\n * SETUP TRANSFORM INHERIT FROM PROPERTIES BEFORE\n */\n // Inherit 'tfBegin' properties but 'tfEnd' does not have, order of Transform depends on options\n tfEnd = TF.Extend(tfBegin, tfEnd, an.optsEnd);\n\n var tfDefault = VA.tfDefault;\n for( var name in tfEnd ) {\n\n /**\n * ADDITIONAL PROPERTIES WITH TRANSFORM-BEGIN\n */\n if( tfBegin[name] === UNDE ) {\n\n // Case: value of properties !== default value\n if( tfEnd[name] != tfDefault[name] ) {\n\n // Case: name of property has fixed value -> inherit value from 'tfEnd'\n if( $.inArray(name, VA.propFixed) !== -1 ) tfBegin[name] = tfEnd[name];\n\n // Case normal -> default value\n else tfBegin[name] = tfDefault[name];\n }\n\n // Case similar to default value: remove from Transform-end\n else {\n delete tfEnd[name];\n }\n }\n\n\n\n /**\n * REMOVE PROPERTIES ON TRANSFORM BEGIN - END SIMILAR TO DEFAULT PROPERTIES\n */\n if( tfBegin[name] == tfDefault[name] && tfEnd[name] == tfDefault[name] ) {\n delete tfBegin[name];\n delete tfEnd[name];\n }\n }\n\n an.optsEnd.tfBegin = tfBegin;\n an.optsEnd.tfEnd = tfEnd;\n }\n\n\n /**\n * SETUP VALUE WHEN BEGIN ANIMATION\n */\n function Start() {\n\n /**\n * INSERT STYLE 'OVERFLOW' AT FIRST: FIXED FOR OLD BROWSER\n */\n var style = $anim.attr('style');\n isOverflowOnNode = style && style.indexOf('overflow') !== -1;\n\n // Unavailable\n // !isOverflowOnNode && $anim.css('overflow', 'hidden');\n\n\n\n /**\n * EXECUTE FUNCTION 'START' AT FIRST\n */\n !!an.optsEnd.start && an.optsEnd.start();\n }\n\n\n\n\n\n\n\n\n\n\n\n /**\n * SETUP NEXT VALUE OF OBJECT, CALL FUNCTION FROM 'TWEEN'\n * @param boolean isForceAnim Allways setup style for object\n */\n that.next = function(isForceAnim) {\n\n /**\n * SETUP CURRENT TIME\n * @param Int an.xCur Current time, in range [0, 1]\n * @param Boolean isAnimate Check setup current animation\n */\n var opts = myData.opts,\n isAnimate = false,\n isComplete = false,\n tCur = myData.tCur = VA.tsCur - myData.tsInit;\n\n\n for( var i = 0, len = opts.length; i < len; i++ ) {\n var optsCur = opts[i];\n\n // Case: tCur at the forward position the first Aniamtion\n if( tCur < optsCur.tPlay && i == 0 ) {\n\n // Case: allways setup Style of object\n if( isForceAnim ) {\n an.optsPos = i;\n an.xCur = 0;\n }\n\n // Case normal\n else an.xCur = null;\n break;\n }\n\n // Case: 'tCur' at the behide position the last Animation\n else if( tCur > optsCur.tEnd && i == len - 1 ) {\n an.optsPos = i;\n an.xCur = 1;\n isComplete = true;\n break;\n }\n\n // Case: 'tCur' located inside Animation\n else if( optsCur.tPlay <= tCur && tCur <= optsCur.tEnd ) {\n an.optsPos = i;\n an.xCur = $.GSGDEasing[optsCur.easing](null, tCur - optsCur.tPlay, 0, 1, optsCur.duration);\n isAnimate = true;\n break;\n }\n\n // Case: 'tCur' located outside Animation\n else if( !!opts[i + 1] && optsCur.tEnd < tCur && tCur < opts[i + 1].tPlay ) {\n an.optsPos = i;\n an.xCur = 1;\n break;\n }\n }\n\n\n\n\n /**\n * SETUP VALUE OF CURRENT STYLE ON OBJECT\n */\n if( an.xCur !== null && opts.length ) {\n\n // First, reset size of Item\n GetSizeItem();\n\n // Reset variable 'styleCur'\n styleCur = {};\n\n // Setup current Style value of the object\n StyleNormalCur();\n StyleTransformCur();\n $anim.css(styleCur);\n }\n\n\n\n /**\n * EXECUTE OPTION 'COMPLETE'\n */\n if( isComplete ) {\n var optsCur = opts[an.optsPos];\n !!optsCur.complete && optsCur.complete();\n }\n\n\n /**\n * Return value check have Animation\n */\n return isAnimate;\n };\n\n\n\n\n\n\n\n\n\n\n\n /**\n * CONVERT VALUE HAS OTHER UNIT TO 'PX'\n * + Support convert '%' to 'px'\n */\n function ConvertValue(name, valueCur) {\n\n /*\n * CASE: STRING\n */\n if( typeof valueCur == 'string' ) {\n\n /**\n * CASE: UNIT IS 'PX'\n */\n if( /px$/.test(valueCur) ) {\n valueCur = parseFloat(valueCur);\n }\n\n\n /**\n * CASE: UNIT IS '%'\n */\n else if( /\\%$/.test(valueCur) ) {\n\n // Name of property exist in conversion system\n var nameSizeFn = VA.percentRef[name];\n if( nameSizeFn !== UNDE ) {\n\n var sizeCur = an['size'][nameSizeFn];\n valueCur = sizeCur * parseFloat(valueCur) / 100;\n }\n }\n }\n\n\n\n /**\n * RETURN VALUE AFTER SETUP\n */\n return valueCur;\n }\n\n\n /**\n * GET SIZE OF ITEM IN CURRENT TIME\n */\n function GetSizeItem() {\n\n an.size = {\n 'OuterWidth' : M.OuterWidth($anim),\n 'OuterHeight' : M.OuterHeight($anim)\n };\n }\n\n\n /**\n * SETUP VALUE PLUS DEPENDS ON PROPERTY NAME\n */\n function ValueCurForNumber(name, valueBegin, valueEnd) {\n var nameToFloat = ['opacity'],\n plus = (valueEnd - valueBegin) * an.xCur;\n\n // Case: rounded number float\n if( $.inArray(name, nameToFloat) !== -1 ) {\n plus = Math.round(plus * 1000) / 1000;\n }\n\n // Case: rounded to integer\n else {\n\n /**\n * ADDITIONAL 1 FRACTION : ANIMATE SMOOTHER\n */\n plus = Math.round(plus * 10) / 10;\n }\n return valueBegin + plus;\n }\n\n\n /**\n * SETUP VALUE OF PROPERTY IS ARRAY[]\n */\n function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for( var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++ ) {\n\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]),\n vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n\n // Case: value 'begin' not exist\n if( vaBeginCur === UNDE ) vaBeginCur = vaEndCur;\n\n\n\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur,\n valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n\n aValue.push(valueCur + 'px');\n }\n\n\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }\n\n\n /**\n * SETUP NORMAL PROPERTIES AT THE CURRENT TIME\n */\n function StyleNormalCur() {\n var optsCur = myData['opts'][an.optsPos];\n\n\n for( var name in optsCur['styleBegin'] ) {\n var valueBegin = optsCur['styleBegin'][name],\n valueEnd = optsCur['styleEnd'][name],\n valueCur;\n\n\n /**\n * CASE: PROPERTY HAS VALUE IS ARRAY[]\n */\n if( $.isArray(valueBegin) ) {\n valueCur = ValueCurForArray(name, valueBegin, valueEnd);\n }\n\n\n /**\n * CASE: PROPERTY HAS OTHER VALUE\n */\n else {\n\n // Convert value String to Number (if posible)\n valueBegin = ConvertValue(name, valueBegin);\n valueEnd = ConvertValue(name, valueEnd);\n\n // Case: value of property is Number\n if( $.isNumeric(valueBegin) && $.isNumeric(valueEnd) ) {\n valueCur = ValueCurForNumber(name, valueBegin, valueEnd);\n }\n\n // Other case: keep changes\n else {\n valueCur = valueBegin;\n }\n }\n\n\n\n\n\n /**\n * REMOVE STYLES HAVE DEFAULT VALUE\n */\n if( optsCur.isClearStyleDefault && VA['styleDefault'][name] === valueCur ) {\n valueCur = '';\n }\n\n\n\n /**\n * STORE VALUE OF CURRENT PROPERTY\n */\n styleCur[name] = valueCur;\n }\n }\n\n\n /**\n * SETUP 'TRANSFORM' IN CURRENT TIME\n */\n function StyleTransformCur() {\n\n /**\n * SETUP CURRENT VALUE EACH TRANSFORM PROPERTIES\n */\n var optsCur = myData['opts'][an.optsPos],\n tfBegin = optsCur.tfBegin,\n tfEnd = optsCur.tfEnd,\n tfCur = {};\n\n for( var name in tfEnd ) {\n\n // Setup value 'plus' of each properties\n var tfBeginCur = TF.ConvertValueToPX($anim, name, tfBegin[name]),\n tfEndCur = TF.ConvertValueToPX($anim, name, tfEnd[name]),\n\n valuePlus = (tfEndCur - tfBeginCur) * an.xCur,\n valueCur = tfBeginCur + valuePlus;\n\n // Value of current property\n tfCur[name] = valueCur;\n }\n\n\n\n\n /**\n * CONVERT PARTICULAR PROPERTY OF TRANSFORM TO CSS\n */\n var cssTf = TF.ToCss(tfCur, optsCur);\n\n\n\n\n /**\n * STORE CURRENT TRANSFORM CSS\n */\n var nameTf = VA.prefix + 'transform';\n styleCur[nameTf] = cssTf;\n\n // Store current Transform into system\n myData.tfCur = tfCur;\n }\n\n\n\n\n\n\n\n\n\n\n\n // Initialize Animation\n Init();\n }", "title": "" }, { "docid": "65a5a53159a65cafc84aff04c9f14833", "score": "0.48277795", "text": "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .set('compress', true)\n .use(nib())\n .import('nib');\n}", "title": "" }, { "docid": "4cb963515013f41802c450c554d65e7e", "score": "0.48206136", "text": "function cssBuild(cb){\r\n\treturn src(path.src.style)\r\n\t\t .pipe(plumber())\r\n .pipe(sass())\r\n .pipe(autoprefixer({\r\n browsers: autoprefixerList\r\n }))\r\n .pipe(rigger())\r\n .pipe(cleanCSS())\r\n .pipe(concat('style.css'))\r\n .pipe(dest(path.build.css))\r\n \r\n}", "title": "" }, { "docid": "38d669bf6868aa2eb197f778ddca9428", "score": "0.48190644", "text": "function bL(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"style.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "71a397ae680b919270ca72e0fc45eb3e", "score": "0.48147026", "text": "async function buildCss() {\n fs.rmdirSync(path.resolve(\"css\"), { recursive: true });\n fs.mkdirSync(path.resolve(\"css\"));\n\n Object.keys(themes).forEach(async (theme) => {\n try {\n const outFile = path.resolve(\"css\", theme + \".css\");\n const { css } = await sassRender({\n data: `\n @import \"node_modules/@carbon/themes/scss/themes\";\n\n $feature-flags: (\n enable-css-custom-properties: ${theme === \"all\"},\n grid-columns-16: true,\n );\n \n ${themes[theme]}\n ${shared.globals}\n ${shared.components}\n `,\n outFile,\n outputStyle: \"compact\",\n omitSourceMapUrl: true,\n });\n\n const prefixed = await postcss([\n autoprefixer({\n overrideBrowserslist: [\"last 1 version\", \"ie >= 11\", \"Firefox ESR\"],\n }),\n ]).process(css, { from: undefined });\n\n await writeFile(outFile, prefixed.css);\n } catch (e) {\n console.log(e);\n }\n });\n}", "title": "" }, { "docid": "0fb44a0678afcfaf6f2826b48036c597", "score": "0.4811538", "text": "function BuildObject(name, gender, age){\n this.name= name;\n this.gender = gender;\n this.age = age;\n}", "title": "" } ]
a9774ac7852869a66664436787d23998
Update's this OBJ's internal states.
[ { "docid": "d68b908714b2afd0b55cac5d2bff5389", "score": "0.0", "text": "update()\n\t{\n\t\tthis.world.update();\n\t\tthis.time++;\n\t\t\n\t\n\t}", "title": "" } ]
[ { "docid": "b61324c8ecaad87ce8e8007545d52701", "score": "0.68904245", "text": "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "title": "" }, { "docid": "c0b02f0b5bdb0196ea2afa2705d81f2a", "score": "0.6676343", "text": "update() {\n BaseState.update.call(this);\n }", "title": "" }, { "docid": "47907551995f85dcfd2ae64e363fb5ca", "score": "0.6576889", "text": "update() {\n this._objects.sky.update();\n this._objects.goal.update();\n }", "title": "" }, { "docid": "08b36e3bf508f2d7181549e35551b205", "score": "0.64562833", "text": "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "title": "" }, { "docid": "08b36e3bf508f2d7181549e35551b205", "score": "0.64562833", "text": "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "title": "" }, { "docid": "3be130051359f556eb12c28c9451ea3e", "score": "0.6435782", "text": "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "title": "" }, { "docid": "3d2995bfc834e785d4ccdb3092f7cac4", "score": "0.6388054", "text": "setNeedsUpdate() {\n this.context.layerManager.setNeedsUpdate(String(this));\n this.internalState.needsUpdate = true;\n }", "title": "" }, { "docid": "7e5117cf6edd17eee9941ede78390cdd", "score": "0.6312643", "text": "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "title": "" }, { "docid": "8296aaf9c53df4842135cb81ba163c55", "score": "0.6278908", "text": "function setState(obj) {\n States = { ...States, ...obj, _v: States._v + 1 };\n setTimeout(_ => {\n domUpdate();\n }, 0)\n}", "title": "" }, { "docid": "dd9c27b6a1487e76b3d159743b930335", "score": "0.62650734", "text": "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "title": "" }, { "docid": "ae22d515a11badb8e9c28e524405efb6", "score": "0.62206304", "text": "updateViewObjects(state) {\n //Node\n if (!this.viewObjects[\"main\"] ||\n (!this.skipLabel && !this.labels[state.labels[this.constructor.name]] && this[state.labels[this.constructor.name]])) {\n this.createViewObjects(state);\n }\n\n if (this.fixed) { copyCoords(this, this.foci || this.layout); }\n\n if (this.controlNodes) {\n copyCoords(this, getCenterOfMass(this.controlNodes).multiplyScalar(2)); //double the distance from center\n }\n\n copyCoords(this.viewObjects[\"main\"].position, this);\n\n this.updateLabels(state.labels[this.constructor.name], state.showLabels[this.constructor.name],\n this.viewObjects[\"main\"].position.clone().addScalar(5 + this.val * state.nodeRelSize));\n }", "title": "" }, { "docid": "cb372041710818c4cd108c98c0e8341a", "score": "0.6194151", "text": "function ModelState(){\n\t\n\t//Inherits from ModelObject but because it is the top level object\n\t//it does not use id, parentId, or parentDirtyListCallback so they\n\t//are set to null. It also does not need ModelObject methods,\n\t//so ModelState doesnt grab its prototypes.\n\tModelObject.call(this, \"State\", null, null, true);\n\n\t//The model state needs many things from the drawable object class.\n\t//the color and parentCallback functions are set to null\n\t//because it has no color or parent. Also, there is no\n\t//need to inherit any methods from this class so its prototypes are\n\t//not taken.\n\tDrawableObject.call(this, null, null);\n\n\t//the state object manages its own model matrix\n\t//and view matrix. The renderer handles proj\n\t//matrix...for now at least\n\tthis.modelMatrix = new Matrix4();\n\tthis.viewMatrix = new Matrix4();\n\n\tthis.inverseModelMatrix = new Matrix4();\n\tthis.inverseViewMatrix = new Matrix4();\n\n\tthis.tempWorldRay = new Vector4();\n\tthis.worldRay = new Vector3();\n\n\n\t//some temporary code to test moving around\n\tthis.radius = -2500;\n\tthis.angle = 0;\n\n\t\n\n\t//this is the state of the viewer or player or users\n\tthis.eyeX = 0.0;\n\tthis.eyeY = 1000.0;\n\tthis.eyeZ = 0.0;\n\n\tthis.lookX = -this.radius*Math.sin(this.angle);\n\tthis.lookY = 0.0;\n\tthis.lookZ = this.radius*Math.cos(this.angle);\n\n\tthis.isMovingForward = false;\n\tthis.isMovingBackward = false;\n\tthis.isMovingRight = false;\n\tthis.isMovingLeft = false;\n\tthis.isRotatingRight = false;\n\tthis.isRotatingLeft = false;\n\n\tthis.viewMatrix.setLookAt(this.eyeX, this.eyeY, this.eyeZ, \n\t\t\t\t\t\t\t\tthis.lookX, this.lookY, this.lookZ, \n\t\t\t\t\t\t\t\t0, 1, 0);\n\t\n\t//movement per millisecond\n\tthis.acceleration = 0.0005;\n\n\t//the dirtyList and the renderList is the handshake between the \"model\" \n\t//and the \"view\". The model and the renderer both have access to it. \n\t//Whatever you place in the dirtyList will be re-presented to the GPU because it \n\t//is new or it has changed...or it needs to be deleted.\n\t//whatever is in the renderList will be renderered. \n\t\n\t//i am going to try a single dirtyList for everything\n\tthis.dirtyList = [];\n\n\t\n\n\t//initialize the scene.\n\tthis.scene = new LabScene(this.idGen.getId(), \n\t\t\t\t\t\t\t\tthis.id, \n\t\t\t\t\t\t\t\tthis.dirtyListCallback.bind(this));\n\t\n\t//initialize one portal. Multiple portals will be supported in the final build.\n\t//may need a portal list\n\tthis.portal = new Portal(this.idGen.getId(), \n\t\t\t\t\t\t\t\tthis.id, \n\t\t\t\t\t\t\t\tthis.dirtyListCallback.bind(this)); \n\n\t//each object that is the parent to renderable objects must have a renderList\n\tthis.renderList.push(this.scene);\n\tthis.renderList.push(this.portal);\n\n\tthis.viewMatrix.setLookAt(this.eyeX, this.eyeY, this.eyeZ, \n\t\t\t\t\t\t\t\tthis.lookX, this.lookY, this.lookZ, \n\t\t\t\t\t\t\t\t0, 1, 0);\n\t\n}", "title": "" }, { "docid": "fa0011a074bdcf04f4035350db544490", "score": "0.6187633", "text": "update() {\n\n // if destroyed, then ignore\n if (this._state == Actor.DESTROYED) return;\n\n // update additional script\n this.update_before(this);\n\n // update skeleton of limbs of sprites\n this.skeleton.update();\n\n // update additional script\n this.update_more(this);\n }", "title": "" }, { "docid": "6dca7682d90c840fbc939b2f4c8bf616", "score": "0.6184633", "text": "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "title": "" }, { "docid": "130ad1b308d222592790678300343b06", "score": "0.61570966", "text": "function stateUpdated() {\n\tvar keys, i, key, value, thing;\n\n\t// we must wait for the players list before loading the cards\n\tif (!participantsLoaded) {\n\t\treturn;\n\t}\n\n\twaveState = wave.getState();\n\tif (!waveState) {\n\t\treturn;\n\t}\n\tkeys = waveState.getKeys();\n\twaveStateValues = {};\n\n\t// Update stuff\n\tfor (i = 0; (key=keys[i]); i++) {\n\t\tvalue = waveState.get(key);\n\t\tif (typeof value == \"string\") {\n\t\t\twaveStateValues[key] = value;\n\n\t\t\tthing = getThing(key);\n\t\t\tthing.updateState(value);\n\t\t}\n\t}\n\n\t// Check for deleted objects\n\t// by keys that were in the state before but now are not\n\tfor (i = waveStateKeys.length; i--;) {\n\t\tkey = waveStateKeys[i];\n\t\tif (!(key in waveStateValues)) {\n\t\t\tthing = getThing(key);\n\t\t\tthing.remove();\n\t\t}\n\t}\n\n\twaveStateKeys = keys;\n\n\tif (!stateLoaded) {\n\t\tstateLoaded = true;\n\t\tif (participantsLoaded) {\n\t\t\tonEverythingLoad();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0fc57b123fc80fa8132af7bd845faf13", "score": "0.6137307", "text": "_updateState() {\n const currentProps = this.props;\n const currentViewport = this.context.viewport;\n const propsInTransition = this._updateUniformTransition();\n this.internalState.propsInTransition = propsInTransition;\n // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n this.context.viewport = this.internalState.viewport || currentViewport;\n // Overwrite this.props during update to use in-transition prop values\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n const oldModels = this.getModels();\n\n // Safely call subclass lifecycle methods\n if (this.context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {\n // ignore error if gl context is missing\n }\n }\n // Execute extension updates\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n this._updateModules(updateParams, modelChanged);\n // End subclass lifecycle methods\n\n if (this.isComposite) {\n // Render or update previously rendered sublayers\n this._renderLayers(updateParams);\n } else {\n this.setNeedsRedraw();\n // Add any subclass attributes\n this._updateAttributes(this.props);\n\n // Note: Automatic instance count update only works for single layers\n if (this.state.model) {\n this.state.model.setInstanceCount(this.getNumInstances());\n }\n }\n } finally {\n // Restore shared context\n this.context.viewport = currentViewport;\n this.props = currentProps;\n this.clearChangeFlags();\n this.internalState.needsUpdate = false;\n this.internalState.resetOldProps();\n }\n }", "title": "" }, { "docid": "14740ceeb266cd0c1df263ff78f1c17e", "score": "0.601262", "text": "updateChanges() {\n for (let i = 0; i < this._size; i++) {\n this._markActive(i);\n }\n\n // get the position changes for each object in collision\n for (let i = 0; i < this._size; i++) {\n this._updatePosition(i);\n }\n\n // get the velocity changes for each object in collision\n for (let i = 0; i < this._size; i++) {\n this._updateVelocity(i);\n }\n\n // call onCollided() for every object\n for (let i = 0; i < this._size; i++) {\n this._callCollided(i);\n }\n }", "title": "" }, { "docid": "225de6e14f1c8c6688562c2b240f083e", "score": "0.6012511", "text": "animateObjects() {\n // Ask each AnimatedObject to update its loop and cell number if required.\n for (let aniObj of this.state.animatedObjects) {\n aniObj.updateLoopAndCel();\n }\n\n this.state.Vars[Defines.EGOEDGE] = 0;\n this.state.Vars[Defines.OBJHIT] = 0;\n this.state.Vars[Defines.OBJEDGE] = 0;\n\n // Restore the backgrounds of the previous drawn cels for each AnimatedObject.\n this.state.restoreBackgrounds(this.state.updateObjectList);\n\n // Ask each AnimatedObject to move if it needs to.\n for (let aniObj of this.state.animatedObjects) {\n aniObj.updatePosition();\n }\n\n // Draw the AnimatedObjects to screen in priority order.\n this.state.drawObjects(this.state.makeUpdateObjectList());\n this.state.showObjects(this.pixels, this.state.updateObjectList);\n\n // Clear the 'must be on water or land' bits for ego.\n this.state.ego.stayOnLand = false;\n this.state.ego.stayOnWater = false;\n }", "title": "" }, { "docid": "afc12dac8482a99c6cc6897aa6305ed8", "score": "0.59953845", "text": "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "title": "" }, { "docid": "23f99ebff50fd67289b65ceb85238705", "score": "0.59944063", "text": "function update() {\n // Extract from the object id the corresponding index of the array\n let index = checkIndex(this.id)[0];\n\n // Update the array based on the existing value of the array\n if (binaryNumbers[index]) {\n binaryNumbers[index] = 0;\n } else {\n binaryNumbers[index] = 1;\n }\n\n setIconAndNumbers();\n setDecimal();\n}", "title": "" }, { "docid": "5971a0bfcb23dbba4520a92f6dfd13b6", "score": "0.59931636", "text": "function update() {\n \n var object = editor.selected;\n if (object !== null) {\n object.visible = objectVisible.getValue();\n var selectObjectType = editor.getObjectType(object);\n var lineType = \"\";\n var scopeType = \"\";\n if (selectObjectType === 'line' || selectObjectType === 'hline' || selectObjectType === 'auline') {\n if (selectObjectType === 'line') {\n lineType = \"l\";\n }\n else if (selectObjectType === 'hline') {\n lineType = \"h\";\n }\n else {\n lineType = \"au\";\n }\n if (selectScope.dom.value == 1) {\n scopeType = \"unit\";\n }\n else {\n scopeType = \"area\";\n }\n console.log(\"upate\", objectName.getValue(), objectUserData.getValue(), materialColor.getHexValue(), selectType.getValue(), selectState.getValue(), scopeType, selectAParent.getValue(), lineType, objectLossRate.getValue());\n editor.updateAULineInfo(object, objectName.getValue(), objectUserData.getValue(), materialColor.getHexValue(), selectType.getValue(), selectState.getValue(), scopeType, selectAParent.getValue(), lineType, objectLossRate.getValue());\n } else {\n }\n }\n }", "title": "" }, { "docid": "6972dc8710a99f9c8b2d245b231c0510", "score": "0.5991208", "text": "update(_changedProperties) {\n super.update();\n }", "title": "" }, { "docid": "2dd5bbe6b111eb6a6e5aa85fe672367a", "score": "0.5982809", "text": "update() {\n const state = this.store.getState();\n\n if (this.isPresenting !== state.webvr.isPresenting) {\n this.vrEffect.setFullScreen(state.webvr.isPresenting);\n this.isPresenting = state.webvr.isPresenting;\n }\n\n if (this.isPresenting) {\n this.vrControls.update();\n } else {\n const dt = (state.app.timestamp - this.timestamp) || 0;\n this.timestamp = state.app.timestamp;\n\n this.flyControls.update(dt);\n }\n\n // update all components with their state\n const componentState = this.select(state);\n Object.keys(this.components)\n .forEach(id => this.components[id].update(componentState[id]));\n }", "title": "" }, { "docid": "5fa319446a4080c802103ea656240386", "score": "0.5973824", "text": "update(newState, silent) {\n silent = silent || false;\n // Set values on this to match the new state\n Object.keys(newState).forEach((prop) => {\n this[prop] = newState[prop];\n });\n\n if (!silent) {\n this.trigger('update', this.toJSON());\n }\n }", "title": "" }, { "docid": "20af6d5c9e4b52fa3ad9f7131bfacfcb", "score": "0.5971131", "text": "function update_obj(obj) {\n obj.transform = obj.matrix;\n obj.transform = CG.Matrix4.multiply(viewProjectionMatrix, obj.transform);\n\n obj.vector.forEach((vertex, index) => {\n obj.new_vertices[index] = obj.transform.multiplyVector3(vertex);\n });\n }", "title": "" }, { "docid": "3c7a606ed698be55d01a7492813b797a", "score": "0.5962951", "text": "update() {\n this.clear();\n this.draw();\n }", "title": "" }, { "docid": "f8c16fbf721b83f2c72c7b0b242e37ce", "score": "0.59558445", "text": "update() {\r\n this.move();\r\n this.bounce();\r\n this.paint();\r\n }", "title": "" }, { "docid": "4323685e73c997df42ddc1fec63554c6", "score": "0.5952795", "text": "function update(){\n updateSnakeMovement();\n updateGameFinishedState();\n updateFoodAcquiredState();\n }", "title": "" }, { "docid": "1d275b82438f51fb4ba450a65e574d69", "score": "0.59492815", "text": "update() {\n // AABB\n this.aabb.update(this.startX, this.startY, this.endX, this.endY, this.entity);\n }", "title": "" }, { "docid": "f0c4df82c5c6304e3cee20fee77005d8", "score": "0.5942257", "text": "update( )\r\n {\r\n\r\n this.app_state.update( )\r\n Input.update( )\r\n this.render( )\r\n requestAnimationFrame( ( ) =>\r\n {\r\n\r\n this.update( )\r\n\r\n } )\r\n\r\n }", "title": "" }, { "docid": "b7739deb7da8eac2f015627a3e3e6fac", "score": "0.59175897", "text": "update() {\n this.baseTexture.update();\n }", "title": "" }, { "docid": "c614bcd57c7da51c68ea816c257efd09", "score": "0.5899615", "text": "update() {\n let i, len;\n len = this.objects.length;\n for (i = 0; i < len; i++) {\n this.objects[i].update();\n }\n\n if (this.camera.update) {\n this.camera.update();\n }\n }", "title": "" }, { "docid": "61d3c96fff9028bad1949eee9deb66ce", "score": "0.58993167", "text": "update() {\n if (state.current.moving) {\n updateOnMove.map((object) => object.update());\n }\n }", "title": "" }, { "docid": "6d59e57c9615e0d2be159e314a850fe6", "score": "0.5899231", "text": "function _update() {\n if (this._transformGetter) this._output.transform = this._transformGetter();\n if (this._opacityGetter) this._output.opacity = this._opacityGetter();\n if (this._originGetter) this._output.origin = this._originGetter();\n if (this._alignGetter) this._output.align = this._alignGetter();\n if (this._sizeGetter) this._output.size = this._sizeGetter();\n }", "title": "" }, { "docid": "6138a5f3fffb66247db467d52cb5f370", "score": "0.5892069", "text": "update() {\n this.state = 0\n this.x += this.vx\n this.y += this.vy\n if ((this.x < quadtree.x)||(this.x > quadtree.width)||(this.y < quadtree.y)||(this.y > quadtree.height)) { this.destroy() }\n }", "title": "" }, { "docid": "3986c6a17e85fe1fa860a4d7f347223a", "score": "0.5891074", "text": "function update() {\n switch (currentState) {\n case State.FOLLOWING:\n if (ball.getOwner() === ctl) {\n currentState = State.AIMING;\n aimAndFire();\n } else {\n moveTowardsBall();\n currentState = State.WAITING;\n }\n case State.WAITING:\n break;\n case State.AIMING:\n break;\n }\n }", "title": "" }, { "docid": "a90c9e511cd889edd6b604a887eb7076", "score": "0.58783203", "text": "_updateBlendWeights() {\n if (!this._vertices || this._vertices.length === 0) return;\n\n if (this._vertices.length === 1) {\n [...this._states.values()][0].weight = 1;\n return;\n }\n\n // Initially set all sub-state weights to zero\n this._states.forEach(state => {\n state.setWeight(0);\n });\n this._phaseLeadState = null;\n\n const p = [this._blendValueX, this._blendValueY];\n\n if (this._vertices.length === 2) {\n this._setInfluenceClosestPointOnLine(p);\n } else {\n const triangle = this._triangles.find(triangle => {\n return MathUtils.isPointInTriangle(\n this._vertices[triangle[0]],\n this._vertices[triangle[1]],\n this._vertices[triangle[2]],\n p\n );\n });\n\n if (triangle) {\n this._setInfluenceTriangle(triangle, p);\n } else {\n this._setInfluenceClosestPointInTriangles(p);\n }\n }\n }", "title": "" }, { "docid": "f3830919b7913ed899915e1d1067556b", "score": "0.58633864", "text": "update() {\n if (this.newObst === true) {\n this.randomize();\n this.newObst = false;\n }\n }", "title": "" }, { "docid": "55baf673d1a7d355f24eeeabe6f7b6cd", "score": "0.58603096", "text": "updateState(newState) {\n this.setState(newState);\n }", "title": "" }, { "docid": "4cf2a10f4d822a5c99f410d972f220d3", "score": "0.5841325", "text": "update() {\n this.move();\n this.age();\n }", "title": "" }, { "docid": "25a8eb838f722417deaf45c2345a5ae8", "score": "0.5841147", "text": "update()\n {\n this.baseTexture.update();\n }", "title": "" }, { "docid": "6805d309c789c0993ca5e5c6b3d74af3", "score": "0.5830617", "text": "update() {\n\t\t\tif (this.worldObject.length < 1) {\n\t\t\t\tthis.occupied = false;\n\t\t\t}\n\t\t\telse if (this.worldObject.length === 1) {\n\t\t\t\tthis.occupied = true;\n\t\t\t}\n\t\t\telse if (this.worldObject.length > 1) {\n\t\t\t\tthis.worldObject = [this.worldObject[0]];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2b2ecdb499fa2ba6c8e7009c7ec2c20a", "score": "0.5824032", "text": "updateState() {\n this.setState({\n position: {\n x: this.x,\n y: this.y,\n },\n velocity: {\n vx: this.vx, \n vy: this.vy\n },\n moving : this.moving\n })\n }", "title": "" }, { "docid": "a96c4e08936eaba634068c2ecbc37704", "score": "0.5801687", "text": "function _update() {\n\t\t\t\t\t// points\n\t\t\t\t\tfor ( var d in _d ) {\n\t\t\t\t\t\t_d[d].point.setVanishingPoint( _vpx, _vpy );\n\t\t\t\t\t\t_d[d].point.setCenter( _cx, _cy, _cz );\n\t\t\t\t\t\t_d[d].point.x += _dx;\n\t\t\t\t\t \t_d[d].point.y += _dy;\n\t\t\t\t\t \t_d[d].point.z += _dz;\n\t\t\t\t\t \t_d[d].point.rotateX( _ax );\n\t\t\t\t\t \t_d[d].point.rotateY( _ay );\n\t\t\t\t\t \t_d[d].point.rotateZ( _az );\n\t\t\t\t\t}\n\t\t\t\t\t// set control points vanishing point\n\t\t\t\t\tfor ( var cp in _cp ) {\n\t\t\t\t\t\t_cp[cp].setVanishingPoint( _vpx, _vpy );\n\t\t\t\t\t\t_cp[cp].setCenter( _cx, _cy, _cz );\n\t\t\t\t\t\t_cp[cp].x += _dx;\n\t\t\t\t\t \t_cp[cp].y += _dy;\n\t\t\t\t\t \t_cp[cp].z += _dz;\n\t\t\t\t\t \t_cp[cp].rotateX( _ax );\n\t\t\t\t\t \t_cp[cp].rotateY( _ay );\n\t\t\t\t\t \t_cp[cp].rotateZ( _az );\n\t\t\t\t\t}\n\t\t\t\t\t// store offsets\n\t\t\t\t\t_tree.environment.offset.ax += _ax;\n\t\t\t\t\t_tree.environment.offset.ay += _ay;\n\t\t\t\t\t_tree.environment.offset.az += _az;\n\t\t\t\t\t_tree.environment.offset.dx += _dx;\n\t\t\t\t\t_tree.environment.offset.dy += _dy;\n\t\t\t\t\t_tree.environment.offset.dz += _dz;\n\t\t\t\t}", "title": "" }, { "docid": "d40dae9f64ae94a0e364ae79557df35d", "score": "0.57920074", "text": "refreshToPhysics() {\n if (!this.physicsObj) return\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "title": "" }, { "docid": "f8f8de8c8481732de7542319e8dce147", "score": "0.5791003", "text": "update(t){\r\n this.movingObject.update();\r\n this.fish.update(t);\r\n this.waterSurface.update(t);\r\n this.algaeSet.update(t);\r\n this.checkKeys();\r\n }", "title": "" }, { "docid": "1a22b97889e46f83b9147a113401c832", "score": "0.5773337", "text": "update() {\r\n this.paint();\r\n }", "title": "" }, { "docid": "12df2b21d255c5edf0fbcb3dce318abf", "score": "0.57704294", "text": "refreshToPhysics() {\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "title": "" }, { "docid": "d743dc8c8828366985b4505b5c1a8e51", "score": "0.57550937", "text": "function updateState() {\n //create our state object and notify our listener\n var state = {\n currentUniverseTime: new Date(currentUniverseTime)\n };\n\n fireStateChanged(state);\n\n // call update() again in a certain number of milliseconds\n updateStateTimeout = setTimeout(function () {\n updateState();\n }, timeBetweenStateUpdatesMs);\n }", "title": "" }, { "docid": "81c1c42bd05cc23a3432d7702c2e74ce", "score": "0.57543856", "text": "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "title": "" }, { "docid": "49d1816fe8cfce9c7313a7a866efb301", "score": "0.5751111", "text": "update(){\r\n this.draw();\r\n }", "title": "" }, { "docid": "e3d1cdcf1fdb29e9a789da2a313e9705", "score": "0.5746185", "text": "function updateScene() {\n for(let scobj of objects)\n scobj.update();\n}", "title": "" }, { "docid": "2994ee4c17b9613df258e61dbc6dbb0b", "score": "0.5745547", "text": "update()\n {\n \n }", "title": "" }, { "docid": "9acb9cd73d35c69499b1d4d59144878e", "score": "0.57444", "text": "function updateState() {\n gState.push({\n board: copyMat(gBoard),\n shownCount: gGame.shownCount,\n markedCount: gGame.markedCount,\n lives: gGame.lives,\n safeClick: gGame.safeClick,\n hints: gGame.hints,\n manualMode: gGame.isManualOn,\n gManualMode: gManualMode.isManualOn\n });\n}", "title": "" }, { "docid": "c52763bbfd77a3970d3c0db5196032b3", "score": "0.5743129", "text": "updateObjectDirections() {\n for (let aniObj of this.state.animatedObjects) {\n aniObj.updateDirection();\n }\n }", "title": "" }, { "docid": "ba85ce6a74da594a78e7348a025eb908", "score": "0.5741269", "text": "update(){\n\t\tif( !this.updated ) return this;\n\t\tthis.mesh.element_cnt\t= this.data.len;\n\t\tthis.updated\t\t\t= false;\n\n\t\t// Update the GPU buffers with the new data.\n\t\tif( this.mesh.element_cnt > 0 ){\n\t\t\tApp.buffer.update_data( this.buf, this.data.buffer );\n\t\t}\n\t\treturn this;\n\t}", "title": "" }, { "docid": "6984ecb4584ac8aee90a2fb7e4075734", "score": "0.5740516", "text": "calculateUpdates() {\n\t\tthis.stage.step();\n\t}", "title": "" }, { "docid": "fc31029eab2ac6e8bf1a3de1f4a88f13", "score": "0.5737319", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getMenu(),\n menuPrice: this.props.model.calcCost(),\n });\n }", "title": "" }, { "docid": "aafaac61a70968b7d55a2c1ed8f7a05e", "score": "0.5735932", "text": "function update() {\n controls.update();\n stats.update();\n }", "title": "" }, { "docid": "6189ef3c464baf8fff0712c7560869e8", "score": "0.57347643", "text": "function updateState(s) {\n s.wkWidth != null && (state.wkWidth = s.wkWidth);\n s.wkHeight != null && (state.wkHeight = s.wkHeight);\n s.bkWidth != null && (state.bkWidth = s.bkWidth);\n s.bkHeight != null && (state.bkHeight = s.bkHeight);\n s.x != null && (state.x = s.x);\n s.y != null && (state.y = s.y);\n }", "title": "" }, { "docid": "7333dc2f87354bcdd5d952df2554ef5b", "score": "0.5722777", "text": "update() {\n // Don't update when dead\n if (this.isDead()) {\n return;\n }\n\n this._applyConstantForces();\n\n this.vel = this.vel.add(this.acc);\n if (this.maxSpeed) {\n this.vel = this.vel.limit(this.maxSpeed);\n }\n\n this.prevPos = this.pos.clone();\n this.pos = this.pos.add(this.vel);\n\n // Reset acc for each cycle\n this.acc = this.acc.multiply(0);\n\n if (this.bindToScreen) {\n this._bindToScreen();\n }\n\n if (this.showTrail) {\n this.trail.push(this.pos.clone());\n this.trail = this.trail.splice(this.trail.length - this.trailLimit);\n }\n\n this.count += 1;\n }", "title": "" }, { "docid": "60877a4a4af9ba54cb43745b3d008c27", "score": "0.57097334", "text": "update() {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.dispatchEvent(Event_1.Event.getEvent(\"loaded\"));\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('loaded', this);\n // this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('update', this);\n }\n }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5709107", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5709107", "text": "update() { }", "title": "" }, { "docid": "02b0441a4aed2361b604210e7987a981", "score": "0.570788", "text": "update() {\n super.update();\n this.move();\n }", "title": "" }, { "docid": "b93f27a18577e49265e72725ce450ea7", "score": "0.5702058", "text": "update() {\r\n for (let i = 0; i < this.boids.length; i++) {\r\n let neighbours = this.neighbours(i).slice();\r\n \r\n this.cohesion(i, neighbours);\r\n this.alignment(i, neighbours);\r\n this.separation(i, neighbours);\r\n this.boids[i].update();\r\n }\r\n }", "title": "" }, { "docid": "17765fdf9c01be623e946f2a8856f9b0", "score": "0.5697537", "text": "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "title": "" }, { "docid": "ec73ad86709f93748f2a0488ec0c4f2d", "score": "0.5690205", "text": "update_all_rays() {\n for(let i=0;i<w.rays.length;++i) {\n w.rays[i].need_update = true;\n }\n }", "title": "" }, { "docid": "b65242759a67dc3bc61c25927a99cac8", "score": "0.56810004", "text": "update() {\r\n this.draw();\r\n inputChange();\r\n }", "title": "" }, { "docid": "8a7dc8c7e4b1acdd366685f57a88d330", "score": "0.56787926", "text": "refreshToPhysics() {\n this.copyVector(this.position, this.physicsObj.position);\n this.copyVector(this.velocity, this.physicsObj.velocity);\n this.physicsObj.angle = this.angle;\n this.physicsObj.angularVelocity = this.angularVelocity;\n }", "title": "" }, { "docid": "e26fd3a85cec8f2f06421ff46c3ce8be", "score": "0.56779027", "text": "update() {\n this.fsm.update();\n }", "title": "" }, { "docid": "161338a382f6088ba444a7bf74555687", "score": "0.5676155", "text": "function update() {\n // ... no implementation required\n }", "title": "" }, { "docid": "855a85b5f26b493702b9278efb119037", "score": "0.56736445", "text": "update () {}", "title": "" }, { "docid": "82da487c2e5f94880473ed3ed166164f", "score": "0.56708467", "text": "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "title": "" }, { "docid": "82dc69d321f893fd1eabeea49c267c7f", "score": "0.5670674", "text": "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "title": "" }, { "docid": "6527aece10b1f6a49faa6b9672055ed1", "score": "0.566994", "text": "update () {\n \tthis.modelMatrix.set();\n this.modelMatrix.scale(this.scale);\n this.modelMatrix.rotate(this.orientation);\n this.modelMatrix.translate(this.position);\n\n this.modelMatrixInverse = this.modelMatrix.clone().invert();\n }", "title": "" }, { "docid": "5d50e69f2dc538bd4cd5558764407482", "score": "0.56586707", "text": "function updateGraphState() {\n var curState = states[stateIndex];\n\n // show the queue, if applicable\n showQueue(curState.queue);\n\n // show distance matrix, if applicable\n showMatrix(curState.matrix);\n\n // update distances, if applicable\n showDistances(curState.distancesMap);\n\n // show heap, if applicable\n displayMinHeap(curState.heap);\n\n // show log, if applicable\n showLog(curState.log);\n\n // update node colors (visited and cur nodes)\n updateNodeColors(curState);\n}", "title": "" }, { "docid": "1b251685121095b734ff4ea74778e8ac", "score": "0.56576794", "text": "update() {\n // Subclasses should override\n }", "title": "" }, { "docid": "0ac912ec7da3a6e7ce7b80994867644e", "score": "0.56572425", "text": "function updateAll() {\n\t\tmoveAll();\n\t\tdrawAll();\n\t}", "title": "" }, { "docid": "73371f1a0e03d10c2d57cbd638006675", "score": "0.5656603", "text": "update() {\n super.update();\n let state = this.state;\n let entities = state.entities;\n entities.forEach(th => {\n th.data.repulse.set(0, 0);\n });\n entities.forEach(th => {\n this._processThinker(th)\n });\n // tous les sprites doivent etre relatifs à ce point de vue\n let p = state.player.data.position;\n entities.forEach(e => {\n e.sprite.position.set(e.data.position.sub(p));\n });\n ++this.state.time;\n state.player.sprite.position.set(0, 0);\n state.view.set(p);\n }", "title": "" }, { "docid": "2cfc03c7df0b3206a5f1571f72d7adde", "score": "0.56434655", "text": "onUpdate(data) {\n this.setState(data);\n }", "title": "" }, { "docid": "055bb27bb004fd12a6e899b856723303", "score": "0.5638476", "text": "update() {\n if(this.hasCollided()) {\n this.reset();\n }\n }", "title": "" }, { "docid": "43f07d2ff097cf623d676ade19b405f9", "score": "0.56379694", "text": "updated(_changedProperties){}", "title": "" }, { "docid": "43f07d2ff097cf623d676ade19b405f9", "score": "0.56379694", "text": "updated(_changedProperties){}", "title": "" }, { "docid": "1a10a6b730d064ee1baebc15d1a76318", "score": "0.563502", "text": "updateRendererStateObject()\r\n {\r\n // copy keys and values of both subscription returned data into the renderer state so the renderer \r\n // state will fill up with the gathered and always upToDate values\r\n for(var key in this.lastChangedAvTransportData)\r\n {\r\n // check if value has changed or if new key is not existent, if so then we do emit an event with the key and value\r\n if(this.rendererState[key] != this.lastChangedAvTransportData[key])\r\n {\r\n this.logVerbose(key + \" has changed from '\" + this.rendererState[key] + \"' to '\" + this.lastChangedAvTransportData[key] + \"'\");\r\n this.emit(\"rendererStateKeyValueChanged\", this, key, this.rendererState[key], this.lastChangedAvTransportData[key], \"\");\r\n }\r\n this.rendererState[key]=this.lastChangedAvTransportData[key];\r\n }\r\n for(var key in this.lastChangedRenderingControlData)\r\n {\r\n // check if value has changed or if new key is not existent, if so then we do emit an event with the key and value\r\n if(this.rendererState[key] != this.lastChangedRenderingControlData[key])\r\n {\r\n this.logVerbose(key + \" has changed from '\" + this.rendererState[key] + \"' to '\" + this.lastChangedRenderingControlData[key] + \"'\");\r\n this.emit(\"rendererStateKeyValueChanged\", this, key, this.rendererState[key], this.lastChangedRenderingControlData[key], \"\");\r\n }\r\n this.rendererState[key]=this.lastChangedRenderingControlData[key];\r\n }\r\n }", "title": "" }, { "docid": "4d11b9f8285fbc6a3222bdeda017e9ef", "score": "0.56345326", "text": "update() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "4d11b9f8285fbc6a3222bdeda017e9ef", "score": "0.56345326", "text": "update() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "d55c3c4d44ce9087e827e3668b70c610", "score": "0.5634166", "text": "initializeState() {\n const attrs = this.state.attributes;\n attrs.x = 0;\n attrs.y = 0;\n }", "title": "" }, { "docid": "75fc80f4f4b9937ac5246ec62188ded6", "score": "0.56310564", "text": "update(ctx) {\r\n let dt = ctx.deltaTime;\r\n // iterate through tracked items\r\n let inactive = 0;\r\n for (let i=this.items.length-1; i>=0; i--) {\r\n const item = this.items[i];\r\n // skip inactive items\r\n if (!item.active) {\r\n inactive++;\r\n continue;\r\n }\r\n // update each object\r\n item.update(ctx);\r\n // if any items are done, remove them\r\n if (item.done) {\r\n this.items.splice(i, 1);\r\n }\r\n }\r\n if (this.dbg) {\r\n this.dbgTimer += dt;\r\n if (this.dbgTimer > 1000) {\r\n this.dbgTimer = 0;\r\n debug.log(\"objs: \" + this.items.length + \" inactive: \" + inactive);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3b6d984a91cece79a8f0f303e3a7ffb4", "score": "0.5629401", "text": "reset() {\n this._objInfo.forEach(info => {\n info.obj.position.copy(info.pos);\n info.obj.up.copy(info.up);\n\n this._checkChange(info);\n info.last.pos.copy(info.pos);\n });\n }", "title": "" }, { "docid": "5237c38b976eefe26d70907687e8d52b", "score": "0.56185716", "text": "update()\n {\n this.scenes[this.currentScene].render(true);\n }", "title": "" }, { "docid": "8ea7a49eb7d889b85ed930c5163acdb0", "score": "0.56134516", "text": "update(state) {\n this.state = state;\n for (let id in this.state) {\n if (!(id in this.knights)) {\n\t\t\t\tconsole.log('making new knight')\n\t\t\t\tthis.knights[id] = new Knight();\n\t\t\t\tif (id == this.playerId){\n\t\t\t\t\tthis.playerKnight = this.knights[id];\n\t\t\t\t}\n this.stage.addChild(this.knights[id]);\n\t\t\t}\n\t\t\telse {\n this.knights[id].x = this.state[id].x;\n this.knights[id].y = this.state[id].y;\n }\n\t\t}\n\t\t\n\t\tfor (let id in this.knights){\n\t\t\tif (!(id in this.state)){\n\t\t\t\t// console.log('deleting knights')\n\t\t\t\tlet knight = this.knights[id];\n\t\t\t\tthis.stage.removeChild(knight);\n\t\t\t\tdelete this.knights[id];\n\t\t\t}\n\t\t}\n }", "title": "" }, { "docid": "25d1a21b9ab26c02cf627d01237ef3ad", "score": "0.5609992", "text": "update() {\n // Reset reference of non-collisions\n if (this._solidNoncollisions.length >= 1) {\n this._solidNoncollisions = [];\n }\n // Attempt movement\n if (this._moveRequested) {\n this._attemptMoveRequest();\n this._moveRequested = false;\n }\n }", "title": "" }, { "docid": "d1131dee9b65161fa273ca8fee0c503b", "score": "0.56033546", "text": "componentDidUpdate() {\n switch (Actions.currentScene) {\n case (Actions.Frontpage.name):\n this.setState({ frontSelect: true, obsSelect: false });\n break;\n case (Actions.Observation.name):\n this.setState({ frontSelect: false, obsSelect: true });\n break;\n }\n }", "title": "" }, { "docid": "4209b571800c98ff933b00330cf3444a", "score": "0.5598784", "text": "forceUpdate() {\n this.updating = true;\n m.redraw();\n }", "title": "" }, { "docid": "a9ce1e6e6d541683dd7c6b0d850e0fdf", "score": "0.55939114", "text": "update(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "title": "" }, { "docid": "d215a5b6b020c73d5db387da2a26acbe", "score": "0.55845785", "text": "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"recording\") {\n if (this[propName]) {\n this.textState = \"stop\";\n this.iconState = \"av:stop\";\n } else {\n this.textState = \"Record\";\n this.iconState = \"av:play-arrow\";\n } // observer to act on the recording piece\n\n\n this.toggleRecording(this[propName], oldValue);\n }\n });\n }", "title": "" }, { "docid": "a5bdf723c0eeae183d8c3efb44d229a5", "score": "0.5580914", "text": "update() {\n\n //Update the drag and drop system\n if (this.draggableSprites.length !== 0) this.updateDragAndDrop(this.draggableSprites);\n\n //Update the buttons and button-like interactive sprites\n if (this.buttons.length !== 0) this.updateButtons();\n }", "title": "" }, { "docid": "dafd26fe19c2ab36593c531c3209c62b", "score": "0.5580319", "text": "update(){\n\t\tthis.setState({\n\t\t\tusersCards:JSON.parse(JSON.stringify(modelInstance.getUsersCards())),\n\t\t\topponentsCards:JSON.parse(JSON.stringify(modelInstance.getOpponentsCards())),\n\t\t}, () => this.saveOriginalHealth());\n\t}", "title": "" }, { "docid": "b0d9951cee31ee80e453084833877ce3", "score": "0.55789965", "text": "function updateObjectsData() {\n\n for (var i = 0; i < numBalls; i++) {\n balls[i].nextX = balls[i].x + balls[i].velocityX;\n balls[i].nextY = balls[i].y + balls[i].velocityY;\n }\n }", "title": "" }, { "docid": "8d5e0538f59b4f6612959f04c700931c", "score": "0.55785006", "text": "componentDidUpdate(){\n if(this.state.receivedData === true){\n this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);\n this.init();\n }\n\n if(this.DisplayIndex){\n this.DisplayIndex = !this.DisplayIndex;\n this.utils.circles =[];\n }\n\n // update utils gloabl vars -> maybe there is a ore elegant way to do this \n this.utils.tallestTreeScale = this.state.RelScaling;\n this.utils.useCladogram = this.state.Cladogram;\n }", "title": "" } ]
6c6b553cd3e87a74d2b28d9005e63762
show the modal if the action requested is update or create
[ { "docid": "d2538af4f2aff6a628d9a8f2c9465384", "score": "0.7362242", "text": "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "title": "" } ]
[ { "docid": "61c54e255ed93a0528e262ac5b45685e", "score": "0.6605915", "text": "actionModalDialog() {\n this.send(this.get('action'));\n this.controller.set('showModal', false);\n }", "title": "" }, { "docid": "1a18580805a769e6fe6ea9c6c4113855", "score": "0.62982225", "text": "function successUpdate() {\n updateForm.style.display = \"none\";\n updateSuccessView.style.display = \"block\";\n setTimeout(closeUpdateModal, 1500);\n }", "title": "" }, { "docid": "51fc10121e9171fe2b4ebec36b2dcc81", "score": "0.6237407", "text": "function openModalEdit() {\n modalEdit.style.display = \"block\"\n }", "title": "" }, { "docid": "d0edd17204f7490c7a28e3d645096a4a", "score": "0.61733955", "text": "function editar() {\n\n\t$('#mdlAgendamento').modal('toggle');\n\t$('#mdlVerAgendamento').modal('hide');\n\n}", "title": "" }, { "docid": "a8af411d59a036a786f6e1de73327e52", "score": "0.6160467", "text": "function showModal({ isEditMode }) {\n seIsEditMode(isEditMode);\n setIsVisible(true);\n }", "title": "" }, { "docid": "bb5f7058782017590ae16f1433c2fa40", "score": "0.598259", "text": "function openDeleteModal() {\n if(angular.element(\"#delete-confirmation\").length > 0) {\n angular.element(\"#delete-confirmation\")[0].style.display = 'block';\n } \n }", "title": "" }, { "docid": "ef64b82bf180934be171cd66b3f4c55a", "score": "0.59729445", "text": "function modalEditOnShown(dialogRef) {\r\n\t\t\tvar rowData = dt.row('.selected').data(),\r\n\t\t\t\tmodalBody = dialogRef.getModalBody(),\r\n\t\t\t\r\n\t\t\t// For checking active licenses\r\n\t\t\tparams = { \r\n\t\t\t\tlicense_status: 1,\r\n\t\t\t\tclientLicenseId: rowData.client_id \r\n\t\t\t};\r\n\t\t\t\t\r\n\t\t\t// Check if client have active licenses\r\n\t\t\t$.post(WS_LIST_LICENSES, params)\r\n\t\t\t\t.done(function (results, status) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Remove elements for status\r\n\t\t\t\t\tmodalBody.find('select[data-field=\"status\"]').selectpicker('destroy');\r\n\t\t\t\t\tmodalBody.find('select[data-field=\"status\"]').remove();\r\n\t\t\t\t\tmodalBody.find('input[data-field=\"status\"]').remove();\r\n\t\t\t\t\tmodalBody.find('input[data-value=\"status\"]').remove();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Append input (readonly) \r\n\t\t\t\t\tif (results.response.type === 'SUCCESS') {\t\t\t\t\t\t\r\n\t\t\t\t\t\tmodalBody.find('#status-box').append(\r\n\t\t\t\t\t\t\t'<input type=\"hidden\" data-field=\"status\" value=\"1\">' +\r\n\t\t\t\t\t\t\t'<input type=\"text\" class=\"form-control\" data-value=\"status\" value=\"Active\" readonly>'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// Append select\r\n\t\t\t\t\t} else {\t\t\t\t\t\r\n\t\t\t\t\t\tmodalBody.find('#status-box').append(\r\n\t\t\t\t\t\t\t'<select class=\"form-control\" data-field=\"status\">' +\r\n\t\t\t\t\t\t\t\t'<option value=\"1\">Active</option>' +\r\n\t\t\t\t\t\t\t\t'<option value=\"0\">Inactive</option>' +\r\n\t\t\t\t\t\t\t'</select>'\r\n\t\t\t\t\t\t);\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t// Load form values\r\n\t\t\t\t\t$.each(rowData, function (name, value) {\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (name === 'status') {\r\n\t\t\t\t\t\t\tmodalBody.find('select[data-field=\"status\"]').val(value === 'Active' ? '1' : '0')\r\n\t\t\t\t\t\t\tmodalBody.find('select[data-field=\"status\"]').selectpicker();\r\n\t\t\t\t\t\t}\telse {\r\n\t\t\t\t\t\t\tmodalBody.find('input[data-field=\"' + name + '\"]').val(value);\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t\t\r\n\t\t\t\t// Show WS Error\r\n\t\t\t\t.fail(function () {\r\n\t\t\t\t\tSTIC.ShowWSError({ formId: params.formId });\r\n\t\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "78e489acdce552616fa9c42aeec9203a", "score": "0.5966247", "text": "function openSave () {\n $('#saveTemplate').modal('show');\n }", "title": "" }, { "docid": "78e489acdce552616fa9c42aeec9203a", "score": "0.5966247", "text": "function openSave () {\n $('#saveTemplate').modal('show');\n }", "title": "" }, { "docid": "6edd4b1785ced442cb74939fb12b6e13", "score": "0.5951751", "text": "function viewDetails(object) {\n if (target.value == 'person') {\n $('#person-edit-model').modal('show');\n setEditValuesPerson(object.target.id);\n } else if (target.value == 'company') {\n $('#company-edit-model').modal('show');\n setEditValuesCompany(object.target.id);\n } else {\n return;\n }\n}", "title": "" }, { "docid": "3330fbded193979418ec49b533fa427f", "score": "0.5934759", "text": "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "title": "" }, { "docid": "5f675680175f24affcfbbdcf5e8da640", "score": "0.59320545", "text": "function adminEditExam(){\n // Validate the data in the modal\n}", "title": "" }, { "docid": "15f095f4a71b6c419d81b74551379071", "score": "0.5931129", "text": "function showModal() {\n\tvar btnShowModal = $('.button-show-modal');\n\tif (btnShowModal.length > 0) {\n\t\tbtnShowModal.bind('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar modalTarget = $(this).data('target-modal');\n\t\t\tvar package = $(this).data('option');\n\n\t\t\tif (modalTarget.length > 0) {\n\t\t\t\t$(modalTarget).addClass('show');\n\n\t\t\t\tif ($(modalTarget).hasClass('show')) {\n\t\t\t\t\tchangeValueOptionInForm(package);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "b6793c4dd3231d049cd97684eb237bf3", "score": "0.59035975", "text": "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "title": "" }, { "docid": "f3b6e0efbd02978faddb87498f09b3ef", "score": "0.590266", "text": "function EditProductSuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editProductDialog').dialog('close');\n\n SuccessMessage(\"Information has been updated successfully\");\n\n //Reset Add Form\n //ResetAddProductForm();\n\n //Refresh Kendo Grid\n dtKendoGridRefresh();\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "8bbfab35c38a13b0fede08aef7955b24", "score": "0.58814293", "text": "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\t\tsaveTabindex();\n\t\ttdc.Grd.Modal.isVisible=true;\n\t}", "title": "" }, { "docid": "efc16773ed3f9696d0355e147682ec82", "score": "0.5877401", "text": "function _showModal(ev) {\n let annoData = newAnnotationService.defusekify(model.edit, true);\n let fragment = annoData.fragment;\n let subject = annoData.subject;\n\n model.docUrl = annoData.url;\n\n // Configura il modale e poi mostralo\n $mdDialog.show({\n controller: DialogController,\n controllerAs: 'dialog',\n //Deps, part.1\n bindToController: {\n fragment: fragment,\n subject: subject,\n annoData: annoData\n }, //Deps\n templateUrl: 'js/modules/editAnnotation/editAnnotationModal.tmpl.html',\n parent: angular.element(document.body),\n fullscreen: true,\n targetEvent: ev,\n //Deps, part.2\n fragment: fragment,\n subject: subject,\n annoData: annoData,\n //Deps\n userService: userService,\n clickOutsideToClose: true\n })\n .then(function(answer) {\n model.status = 'You said the information was \"' + answer + '\".';\n }, function() {\n model.status = 'You cancelled the dialog.';\n });\n }", "title": "" }, { "docid": "86f04f14b4da8d75661ba455ccda5b8e", "score": "0.5861557", "text": "function showModalAwardEventForm(fk_award, fk_event){\n\n _resetAwardFieldForm();\n\n // Update\n if(fk_award != undefined && fk_event != undefined){\n\n _formAction = 'edit';\n\n $.post('/admin/abrasce-award/award-event/list', {fk_award:fk_award, fk_event:fk_event}, function(response){\n\n if(!response.success){\n toastr.error(data.message);\n return;\n }\n\n var data = response.data;\n\n // Populate form\n $('#formAwardEvent select[name=fk_award]').val(data.fk_award);\n $('#formAwardEvent input[name=fk_event]').val(data.fk_event);\n $('#formAwardEvent input[name=title]').val(data.title);\n $('#formAwardEvent input[name=billing_days_to_due]').val(data.billing_days_to_due);\n $('#formAwardEvent input[name=registration_price]').val(data.registration_price);\n\n // Date setup\n var dateBegin = moment(data.registration_date_begin);\n var dateEnd = moment(data.registration_date_end);\n $('#formAwardEvent input[name=registration_date_begin]').val(dateBegin.format('DD/MM/YYYY HH:mm'));\n $('#formAwardEvent input[name=registration_date_end]').val(dateEnd.format('DD/MM/YYYY HH:mm'));\n\n // Logo\n if (data.logo != \"\") {\n $('#file-logo').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.logo + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.logo\n });\n }\n\n // Banner\n if (data.banner != \"\") {\n $('#file-banner').fileinput('refresh', {\n 'allowedFileExtensions': ['jpg', 'png', 'gif'],\n 'initialPreview': [\"<img src='/uploads/award-event/\" +data.banner + \"' class='file-preview-image'>\",],\n 'overwriteInitial': true,\n 'maxFileSize': 500,\n 'initialCaption': data.banner\n });\n }\n\n var description = $('#description-award-event').data(\"wysihtml5\").editor;\n description.setValue(data.description);\n\n // Show\n $('#modal-award-event-form').modal('show');\n\n }).fail(function(jqXHR, textStatus){\n\n toastr.error(\"Ocorreu um erro ao executar a solicitação: \" + textStatus);\n\n });\n\n }else{ // New\n\n _formAction = 'new';\n _resetAwardFieldForm();\n\n $('input[name=fk_event]').val(_fkEvent);\n\n $('#modal-award-event-form').modal('show');\n\n }\n\n}", "title": "" }, { "docid": "aff4a9767ff405747c7dc9e54df6f667", "score": "0.58533305", "text": "function editingConfirmation(){\n\t\t$( \"#formCourseEditing\" ).submit(function( e ) {\n\t\t \te.preventDefault();\n\t\t\tswal({\n title: 'Save Changes?',\n text: \"Saving Course Info Changes\",\n icon: 'warning',\n buttons:{\n confirm: {\n text : 'Save',\n className : 'btn btn-success'\n },\n cancel: {\n visible: true,\n className: 'btn btn-info'\n }\n }\t\n }).then((Save) => {\n \tif (Save)\n \t\teditingCourse();\n });\n });\n\t}", "title": "" }, { "docid": "3d6684ad8b8a95349a513619d3f7a9a2", "score": "0.58342695", "text": "function view_update_modal(id_table, url) {\n $(`#${id_table} tbody`).on('click', '.btn-info', function() {\n const id = $(this).data('id');\n const response = get(`${url}${id}`);\n response.then((res) => {\n load_preloader_container(res.form.id, 10);\n $('#modal_update').modal('show');\n set_data_in_form(res.form.id, res.data);\n stop_preloader(res.form.id, 1000);\n update_data(res.form.id, res.form.rules, res.form.confirm, res.form.url);\n }).catch((err) => {\n toastr.error(err.message);\n });\n });\n}", "title": "" }, { "docid": "6085610c6d37cfb4a442f187bed11c49", "score": "0.5834111", "text": "function updateModal(e) {\n var articleDoi = $('.schedule-cancel-btn[data-article-id=\"' + schedule.articleId + '\"]').attr('data-article-doi');\n $('.article-cancel-info', '#schedule-modal').html(articleDoi);\n validateForm();\n }", "title": "" }, { "docid": "6b64ab7494c1d3359f845ea05b148573", "score": "0.58296835", "text": "function openFormEditKienNghi() {\n showLoadingOverlay(modalIdKienNghi + \" .modal-content\");\n $.ajax({\n type: \"GET\",\n url: editKienNghiUrl,\n data: {\n id: HoSoVuAnID\n },\n success: function (response) {\n $(modalIdKienNghi + \" .modal-content\").html(response);\n\n hideLoadingOverlay(modalIdKienNghi + \" .modal-content\");\n }\n });\n }", "title": "" }, { "docid": "cdd9248545bc7e502e10c99cd103fcdc", "score": "0.5819026", "text": "function attShowModal() {\n setShowModal(!showModal);\n }", "title": "" }, { "docid": "9de66b77db3ad962bfe4e93c20f926ae", "score": "0.5808659", "text": "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "title": "" }, { "docid": "6558739067b88f234f6986156ebeb2ef", "score": "0.57904595", "text": "function place(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tdocument.getElementById('submitButton').style.opacity=0.3;\n\t\t\t\tcheckoutID=document.getElementById('checkoutID').value;\n\t\t\t\tid=sessionStorage.shopID;\n\t\t\t\tverifyCheckoutID(id,checkoutID)\n\t\t\t\t.then(function(){\n\t\t\t\t\tupdate(id,checkoutID)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log('updated');\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\t\t\t\t\tlocation.reload();\n\t\t\t\t})\n\t\t\t\t.catch(function(){\n\t\t\t\t\tdocument.getElementById('submitButton').setAttribute(\"data-toggle\",\"modal\");\n\t\t\t\t\t$(\"#myModal\").modal(\"show\");\n\t\t\t\t});\n\t\t\t\tdocument.getElementById('submitButton').style.opacity=1;\n\n\t\t\t}", "title": "" }, { "docid": "7966dd74bd83305022bb0575b278ff2a", "score": "0.57866436", "text": "function actionsThatRequireCreate(action) {\n if ((action !== 'edit' && action !== 'clone') || this.getCurrentUser().canUpdate(this.getModelDefinitionByName(this.props.params.modelType))) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "844e5ab578c77fc266807ccb76b651d2", "score": "0.5785677", "text": "function btnUpdate_click(dep) {\n const title = document.getElementById(\"mdCreateTitle\");\n title.textContent = \"Atualizar curso\";\n\n document.getElementById(\"txtName\").value = dep.name;\n actualId = dep.id;\n $(\"#modalCreate\").modal();\n}", "title": "" }, { "docid": "68e9978c4ef73f9731838e3fed133278", "score": "0.5764143", "text": "showEditModal(postToEdit) {\n this.props.mappedshowEditModal(postToEdit);\n }", "title": "" }, { "docid": "5978f2d909048fdcc09c75be84286eb9", "score": "0.57613695", "text": "openEditModal(){\n $('#detailComicModal').closeModal();\n $('#editComicModal').openModal();\n }", "title": "" }, { "docid": "37d914ab3418cbd2a28e17bf33bb82eb", "score": "0.57475173", "text": "checkToShowAddButton() {\n const hasResult = this.hasQuery && (! this.hasUsers && ! this.hasDepartment);\n\n this.setShowAddButton( hasResult );\n }", "title": "" }, { "docid": "81f46e9b60c1882f47d4d51f8bec82cb", "score": "0.57460386", "text": "function ajaxCreateOrEdit(data, url, action) {\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: data,\n\t\t\tasync: true,\n\t\t\tsuccess: function(id){\n\t\t\t\tif (action == 'create') {\n\t\t\t\t\tvar html = \"<div class='my-work card col-12 mt-3 px-2'>\"+\n\t\t\t\t\t\t\t\t\"<div class='row'>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-8 card-body'>\"+\n\t\t\t\t\t\t\t\t\t\t\"<h6 class='card-title work-name'>\"+data.workName+\"</h6>\"+\n\t\t\t\t\t\t\t\t\t\t\"<div class='card-footer p-0 border-0 work-time'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='far fa-calendar'><span class='ml-1 starting-day'>\"+data.startingDay+\"</span></li>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<span class='mx-2'>-</span>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='far fa-calendar-check'><span class='ml-1 ending-day'>\"+data.endingDay+\"</span></li>\"+\n\t\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-3 card-body text-center row align-items-center'>\"+\n\t\t\t\t\t\t\t\t\t\t\"<div class='progress p-0'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<div data-status=\"+data.status+\" class='progress-bar' role='progressbar' style='width: 100%' aria-valuenow='100' aria-valuemin='0' aria-valuemax='100'></div>\"+\n\t\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-1 card-body text-center'>\"+\n\t\t\t\t\t\t\t\t\t\t\"<button type='button' data-bs-toggle='modal' data-bs-target='#editModal' class='edit-btn btn btn-primary mb-1' data-id='\"+id+\"'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='far fa-edit'></li>\"+\n\t\t\t\t\t\t\t\t\t\t\"</button>\"+\n\t\t\t\t\t\t\t\t\t\t\"<button type='button' data-bs-toggle='modal' data-bs-target='#deleteModal' class='delete-btn btn btn-secondary mt-1' data-id='\"+id+\"'>\"+\n\t\t\t\t\t\t\t\t\t\t\t\"<li class='far fa-trash-alt'></li>\"+\n\t\t\t\t\t\t\t\t\t\t\"</button>\"+\n\t\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\t\"</div>\"+\n\t\t\t\t\t\t\t\"</div>\";\n\t\t\t\t\t$(html).prependTo($('#listWork'));\n\n\t\t\t\t\t// reset value input\n\t\t\t\t\t$('#formCreate input, select').val(\"\");\n\t\t\t\t}\n\n\t\t\t\tif (action == 'edit') {\n\t\t\t\t\t$btnEdit = $('.my-work').find('button[data-id='+data.id+']');\n\t\t\t\t\t$currentWork = $btnEdit.closest('.my-work');\n\n\t\t\t\t\t$currentWork.find('.work-name').html(data.workName);\n\t\t\t\t\t$currentWork.find('.starting-day').html(data.startingDay);\n\t\t\t\t\t$currentWork.find('.ending-day').html(data.endingDay);\n\t\t\t\t\t$currentWork.find('.progress-bar').attr('data-status', data.status);\n\n\t\t\t\t\t$('#editModal .btn-close').click();\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(error){\n\t\t\t\tif (action == 'create') {\n\t\t\t\t\t$('#formCreate .error-create').html(error);\n\t\t\t\t}\n\n\t\t\t\tif (action == 'edit') {\n\t\t\t\t\t$('#errorModal #contentError').html(error.responseText);\n\t\t\t\t\t$('#errorModal').modal('toggle');\n\t\t\t\t}\n\t\t\t\t$('#editModal .btn-close').click();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "db67cbbce5303ab4a06414f52609476c", "score": "0.57437336", "text": "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "title": "" }, { "docid": "03d047ca28ffd8047ccda3cb9b3c411d", "score": "0.573365", "text": "async function presentEditFeedModal( $item, langs_data ) {\n // create the modal with the `modal-page` component\n $doc.trigger('open-modal', [\n await modalController.create({\n component: 'modal-update-feed',\n componentProps: {\n 'langs' : langs_data,\n 'lang' : $item.data('lang'),\n 'id' : $item.data('id'),\n 'url' : $item.data('url'),\n 'title' : $item.find('ion-label h3 span').text(),\n 'allow_duplicates' : $item.data('allow-duplicates'),\n },\n }),\n function() {\n setTimeout(function() {\n $('#feed_title')[0].setFocus();\n }, 500);\n }\n ]);\n }", "title": "" }, { "docid": "f64ae19828b62a32301f9924050dc224", "score": "0.5729949", "text": "function displayAgentProfileModal() {\n\t\t \tvar action = $(\"#agentProfileModal\").attr(\"action\");\n\t\t \tif(action == 'Show Profile of') {\n\t\t \t\t$(\"#agentProfileModal\").modal(\"show\");\n\t\t \t\tshowHideOldPassword();\n\t\t \t\tshowHideChangePassModal();\n\t\t \t}\n\t\t }", "title": "" }, { "docid": "02068342c7237d0173540792ddd11d80", "score": "0.57298297", "text": "function actualizar_oi(){\n $('#confirmar_actualizar_oi').modal('show');\n}", "title": "" }, { "docid": "9d5fe371760d9ea8af568354bdcc451a", "score": "0.57202244", "text": "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "title": "" }, { "docid": "f3d60d81de5817352aa98027f8143464", "score": "0.571977", "text": "function toggleModal() {\n\n let form = document.getElementById('editModal');\n if (form.style.display === 'none') form.style.display = 'block';\n else form.style.display = 'none';\n}", "title": "" }, { "docid": "5c8fd17263653345953773cef787dd5c", "score": "0.57182854", "text": "function updatePublishModal(e) {\n $('#publish-action', '#publish-modal').prop('disabled', true).addClass('disabled');\n publish.isPublishing = true;\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5701451", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "111aa5833078ac7ac8f3218d78c31804", "score": "0.5700666", "text": "function model_details(nom,action) {\n\tvar\tinfo=jQuery('form[name=\"'+nom+'\"]').attr('id');\n\tinfo=info.split('_');//to get the model and the controller\n\tif((jQuery('form[name=\"'+nom+'\"] input[type=\"checkbox\"]:checked:not(input[name=\"master\"])').length==1)) {\n\t\tvar modelId=jQuery('form[name=\"'+nom+'\"] input[type=\"checkbox\"]:checked:not(input[name=\"master\"])').val();\n\t\tvar tr =jQuery('form[name=\"'+nom+'\"] input[type=\"checkbox\"]:checked').parents('tr');\n\t\t\n\t\tswitch(action){\n\t\t\tcase 'index':\n \t //hiding or showing other rows\n \t\t\tjQuery('tr:not(tr[id=\"first\"], tr[id=\"'+jQuery(tr).attr('id')+'\"])').toggle('fade');\n \t\t\tjQuery('div#pagination').toggle('fade');\n \t\t\tjQuery(\"#model_details\").toggle('fade')\n \t jQuery(\"#model_details\").html('<span id=\"loading\">Chargement...</span>')\n \t\t\tjQuery('#model_details').load(getBase()+'ventes/detail_index/'+modelId);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\tjQuery(document).ready(function(){\n \tjQuery('<div id=\"alert\" title=\"Message\">Select only one record !</div>')\n \t.dialog({modal:true, show:'slide',hide:'clip',\n \t\t\t\t\t\t\tbuttons: { \"Ok\": function() { jQuery(this).dialog(\"close\"); } }\n \t\t\t\t\t\t\t});\n \t});\n\t}\n}", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.5695842", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "bd9b58368097e2d2e7e2ef1e1edac86b", "score": "0.5688308", "text": "function modusModalMaaltijdfilterIsCreate() {\n\treturn (getModalMaaltijdfilterForm(false).attr('data-modus') == 'create') ? true : false;\n}", "title": "" }, { "docid": "396dfad2cdce2c6324f76f19f84418aa", "score": "0.5688221", "text": "function updateInfo() {\n const updatedInfoModal = document.getElementById('updatedInfoModal');\n\n updatedInfoModal.style.display = \"block\";\n\n $(\".okay\").on(\"click\", function () {\n updatedInfoModal.style.display = \"none\";\n })\n}", "title": "" }, { "docid": "0302ec496c69ee87ca94b115cddbf60c", "score": "0.5681865", "text": "showEditForm(data) {\n const newData = {\n id: data.id,\n title: data.title,\n city: data.city_id,\n oldTitle: data.title\n };\n\n this.showCreateForm(newData);\n }", "title": "" }, { "docid": "2fe15629dbd796e04fcd8531d2d78bb7", "score": "0.5676435", "text": "toggleCreateEvent() {\n this.toggleModal(true, createEventComponent);\n }", "title": "" }, { "docid": "023aa3e4969d8abf6868d876c57c40e5", "score": "0.5665028", "text": "function editRequirement( id )\n{\n $('#editRequirementModal .modal-title').text(\"Edit Requirement\")\n $('#editRequirementModal').init\n $('#editRequirementModal').modal\n ({\n keyboard: \"true\",\n remote: jsRoutes.controllers.RequirementController.editRequirement(id).absoluteURL()\n })\n}", "title": "" }, { "docid": "9f913241cc2031ecc0a2602d55008fda", "score": "0.56558603", "text": "showEdit() {\n this.closeFoldersInputs.closeAllInputs();\n this.folder.set('isEdit', true);\n this.set('errors', null);\n }", "title": "" }, { "docid": "a064d174cd27db107a6c858c613d8732", "score": "0.56536174", "text": "showEdit() {\n this.closeFoldersInputs.closeAllInputs();\n // set Manage checkbox\n if (this.folderUser.get('access') === 2) {\n this.set('access', true);\n } else {\n this.set('access', false);\n }\n\n this.folderUser.set('isEdit', true);\n }", "title": "" }, { "docid": "b97cd1c0128ca86dad9242449779a8de", "score": "0.5649118", "text": "function edit(ins_id, q_id) {\n if(!isEdit){\n let componentId = getComponentId(\"preview_\" + q_id);\n enableQuestion(componentId);\n $(\"#update_\" + q_id).removeClass('d-none').addClass('d-block');\n isEdit = true;\n }else{\n warningModal(mustFinishUpdate);\n }\n \n}", "title": "" }, { "docid": "7f35e736d701600ee7758fa85112c225", "score": "0.5645521", "text": "function displayModal() {\n\t\t\t\t$(\"#user-name\").text(newPerson.name);\n\t\t\t\t$(\"#match-name\").text(matchName);\n\t\t\t\t$(\"#match-img\").attr(\"src\", matchImage);\n\t\t\t\t$(\"#myModal\").modal();\n\t\t\t}", "title": "" }, { "docid": "8b11b5005461cf345c2c44e090ef3dc7", "score": "0.56445205", "text": "partialWithOptions(){\n //open modal\n \n this.$store.commit('product/modalId' , this.product.id)\n this.$store.commit('ui/addToCartModal' , true)\n\n \n }", "title": "" }, { "docid": "bcc2893a3a2216c7150017b6db2c5f78", "score": "0.5641841", "text": "function openOrCloseUpdateTaskForm() {\n const h2 = document.querySelector(\".container h2\");\n const submitInput = document.querySelector(`input[type=\"submit\"]`);\n\n if (modalOpen) {\n formContainer.style.pointerEvents = \"none\";\n formContainer.style.transform = \"scale(0)\";\n overlay.style.opacity = 0;\n modalOpen = false;\n } else {\n h2.textContent = \"Update Task\";\n submitInput.value = \"Update\";\n formContainer.style.pointerEvents = \"auto\";\n formContainer.style.transform = \"scale(1)\";\n overlay.style.opacity = 1;\n modalOpen = true;\n }\n}", "title": "" }, { "docid": "d2134e5872f889442e9dc810a323025e", "score": "0.5636491", "text": "function showEditDiv() {\n\tshowActionDiv('edit');\n}", "title": "" }, { "docid": "d2225369f50a60386587fbf5005b3056", "score": "0.5630366", "text": "getProject (mode, id) {\n Project.get({id}, (e, response) => {\n\n if (e === null && response) {\n\n let modal, form; \n\n if (mode === 'edit') {\n\n [modal, form] = [App.getModal('editProject'), App.getForm('editProjectForm')];\n \n\n } else if (mode === 'translate') {\n\n [modal, form] = [App.getModal('translateProject'), App.getForm('translateProjectForm')];\n\n } else if (mode === 'check') {\n \n [modal, form] = [App.getModal('checkProject'), App.getForm('checkProjectForm')];\n };\n\n form.update(id, response);\n modal.open();\n };\n });\n }", "title": "" }, { "docid": "ab37b7fbdf1148d272317db467631269", "score": "0.56039023", "text": "function openModal() {\n setIsModalOpen((isModalOpen) => !isModalOpen);\n dispatch(getObsQuestionnaireResponseDetail(id));\n }", "title": "" }, { "docid": "7e6dc6c4d3a41508a2bfb26ca6e5e75d", "score": "0.5603274", "text": "function showManageAgentSuccessAlert() {\n\t\t \tvar successMsg = $(\"#myModal\").attr(\"saveAgentWithSuccess\");\n\t\t \t\n\t\t \tif (successMsg !== undefined) {\n\t\t \t\tdisplaySuccessMsg(successMsg);\n\t\t \t}\n\t\t }", "title": "" }, { "docid": "c56df57430c551918457fa33d9bc1ab4", "score": "0.5599972", "text": "showEditProfilePictureModal(isButton){\n if(this.get(\"model.userLoggedIn\") && (isButton || $(window).width() >= 1200)){\n $(\"#editProfilePictureModal\").addClass(\"showModal\");\n $('body').css('position','fixed');\n $('body').css('overflow-y','scroll');\n this.set(\"profilePictureSuccessMessage\", null);\n }\n }", "title": "" }, { "docid": "2c9965c1f389be1b62553e0ef960abd3", "score": "0.5598283", "text": "function EditMemberHospitalSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editMemberHospitalDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Hospital updated successfully.\", \"dialogSuccess\");\n\n memberHospitalObjData.fnDraw();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "69657439d9b63a483e032203719944a9", "score": "0.55786765", "text": "showCreate(e){\n e.preventDefault();\n this.overlay.classList.toggle(\"show\");\n this.createUserModal.classList.toggle(\"show\");\n }", "title": "" }, { "docid": "953d433c43f23ebfe112a765ddb6f416", "score": "0.5578461", "text": "function classUpdated() {\n if ($(\"#edit-modal-bg\").css(\"display\") === \"block\") {\n $(\"#edit-modal-bg\").css(\"display\", \"none\");\n $(\"#update-success-modal-bg\").css(\"display\", \"block\");\n } else {\n $(\"#edit-modal-bg\").css(\"display\", \"block\");\n $(\"#update-success-modal-bg\").css(\"display\", \"none\");\n }\n }", "title": "" }, { "docid": "347a3dc2d9bdfd8f81550b5e7a45adbb", "score": "0.5577093", "text": "getUpdateStatus(e) {\n let obj = e.target,\n id = obj.dataset.pk\n ;\n\n MakeRequest({\n method: 'put',\n url: 'actividad/put/' + id,\n data : JSON.stringify({ estado : obj.checked ? 1 : 0 })\n }).then(response => {\n if (response === null) return Util.getMsnDialog('success', 'Updated');\n if (response.error) {\n return Util.getMsnDialog('danger', Util.getModelErrorMessages(response.message));\n }\n });\n }", "title": "" }, { "docid": "57dd2f8ebf8d57a1c3740ee3bb7f526e", "score": "0.55758524", "text": "function do_actions(e) {\n e.preventDefault();\n\n /**\n * Update the modal\n *\n * @param boolean $status The curent status.\n */\n var percentagedone = 0;\n function update_modal(status) {\n Y.log('update_modal');\n var header = M.util.get_string('status_header_'+status, 'local_rlsiteadmin'),\n minpercentage = 0,\n maxpercentage = 2;\n\n Y.one('#status-bar').show();\n\n switch(status) {\n case \"waiting\":\n minpercentage = 2;\n maxpercentage = 10;\n break;\n\n case \"running\":\n minpercentage = 0;\n maxpercentage = 90;\n break;\n }\n\n if (percentagedone < minpercentage) {\n percentagedone = minpercentage;\n }\n percentagedone = minpercentage + percentagedone + (maxpercentage - minpercentage - percentagedone) / 10;\n Y.one('#status-bar .bar').setStyle(\"width\", percentagedone+\"%\");\n\n Y.one('#status-header').setHTML(header, 'before');\n // Hide the spinner.\n\n /*\n // Enable the close button.\n $button = Y.one('#manage-actions-modal button');\n $button.set('disabled', false);\n // Don't know why this isn't done automatically. YUI bug?\n $button.removeClass('yui3-button-disabled');\n */\n }\n\n /**\n * Finish off the modal\n *\n * @param boolean $success Whether the action dispatching script reported success.\n * @param array $messages A list of messages to be printed with the result message.\n */\n function finish_modal(success, messages) {\n Y.log('finish_modal');\n Y.log(success);\n var result,\n length,\n msg = '',\n warn = '',\n i;\n\n if (success) {\n result = 'success';\n } else {\n result = 'failure';\n }\n\n // Remove status header and bar.\n Y.one('#status-header').remove();\n Y.one('#status-bar').remove();\n\n // Display messages if there are any.\n length = messages.length;\n if (length > 0) {\n for (i = 0; i < length; i += 1) {\n msg += '<li>'+messages[i]+\"</li>\\n\";\n }\n msg = '<ul>'+msg+\"</ul>\\n\";\n }\n\n length = configs.length;\n if (length > 0) {\n for (i = 0; i < length; i += 1) {\n warn += '<li>'+configs[i]+\"</li>\\n\";\n }\n warn = '<ul>'+M.util.get_string('plugins_require_configuration', 'local_rlsiteadmin')+\"</ul>\\n\"+\n '<ul>'+warn+\"</ul>\\n\"+\n '<ul>'+M.util.get_string('plugins_need_help', 'local_rlsiteadmin')+\"</ul>\\n\";\n }\n\n msg = '<h4>'+M.util.get_string(result, 'local_rlsiteadmin')+\"</h4>\\n\"+\n '<ul>'+M.util.get_string('actions_completed_'+result, 'local_rlsiteadmin')+\"</ul>\\n\"+\n msg+warn;\n Y.one('#action-results').insert(msg, 'before');\n // Hide the spinner.\n Y.one('#modal-content .fa-spinner').hide();\n // Enable the close button.\n $button = Y.one('#manage-actions-modal button');\n $button.set('disabled', false);\n // Don't know why this isn't done automatically. YUI bug?\n $button.removeClass('yui3-button-disabled');\n }\n\n // Formulate AJAX request, make request, and write results to modal.\n // Build the query string sent in POST request.\n var data = '';\n var configs = [];\n\n // Loop through all add actions.\n Y.log('Loop through add actions.');\n Y.Object.each(M.local_rlsiteadmin.data_actions.add, function(value, key) {\n Y.log(key+' -> '+value);\n if (data.length > 0) {\n data += '&';\n }\n data += 'add[]='+key;\n\n // Check for GAO+ (5) plugins\n if (5 === M.local_rlsiteadmin.data_addons[key].source) {\n configs[configs.length] = key;\n }\n });\n\n // Loop through all update actions.\n Y.log('Loop through update actions.');\n Y.Object.each(M.local_rlsiteadmin.data_actions.update, function(value, key) {\n if (data.length > 0) {\n data += '&';\n }\n data += 'update[]='+key;\n });\n\n // Loop through all remove actions.\n Y.log('Loop through remove actions.');\n Y.Object.each(M.local_rlsiteadmin.data_actions.remove, function(value, key) {\n if (data.length > 0) {\n data += '&';\n }\n data += 'remove[]='+key;\n });\n\n Y.log('data = ' + data);\n\n // AJAX to send actions.\n YUI().use(\"io-base\", function(Y) {\n var url = M.cfg.wwwroot+'/local/rlsiteadmin/mass/action.php';\n var cfg = {\n method: 'POST',\n data: data,\n on: {\n success: function(id, o) {\n Y.log('do_actions success');\n\n var $response = null;\n YUI().use('json-parse', function (Y) {\n try {\n $response = Y.JSON.parse(o.responseText);\n }\n catch (e) {\n Y.log(\"Parsing failed.\");\n }\n });\n\n // AJAX to send actions.\n function check_status() {\n YUI().use(\"io-base\", function(Y) {\n var url = M.cfg.wwwroot+'/local/rlsiteadmin/mass/addonstatus.php?addoncommand='+$response.file+'&hash='+$response.hash;\n var cfg = {\n method: 'GET',\n on: {\n success: function(id, o) {\n var $status = null;\n YUI().use('json-parse', function (Y) {\n try {\n $status = Y.JSON.parse(o.responseText);\n var status = \"waiting\";\n if ($status.running) {\n status = \"running\";\n } else if (!$status.running && $status.fileexists === false && $status.results) {\n status = \"completed\";\n }\n if (status != \"completed\") {\n update_modal(status);\n setTimeout(function() {\n check_status();\n }, 2000);\n } else {\n $response.results = $status.results;\n complete_feedback();\n }\n }\n catch (e) {\n Y.log(\"Parsing failed.\");\n }\n });\n },\n failure: function(c, o) {\n if (o.status == '503') {\n // Ignore failures caused by this site is upgrading messages.\n setTimeout(function() {\n check_status();\n }, 2000);\n return;\n }\n try {\n $status = Y.JSON.parse(o.responseText);\n complete_feedback();\n } catch (e) {\n // Some other error has occured. The progress bar will now stop moving.\n Y.log(\"Parsing failed.\");\n }\n }\n }\n };\n $addons = Y.io(url, cfg);\n });\n }\n check_status();\n\n function complete_feedback() {\n Y.log($response);\n var $success = false;\n // No all results have a $response.results returned. If messages exist generate one.\n if (typeof $response.results === 'undefined') {\n $response.results = '';\n }\n if (typeof $response.messages === 'undefined') {\n $response.messages = [];\n }\n if (typeof $response.results === '' && typeof $response.messages[0] != 'undefined') {\n $response.results = '';\n for (var i = 0; i < $response.messsages.length; i++) {\n $response.results += $response.messsages[i]+'<br>';\n };\n }\n $response.results = $response.results.toLowerCase();\n if (!$response.messages[0] &&\n ($response.results === undefined ||\n ($response.results.indexOf(\"unable\") == -1 && $response.results.indexOf(\"failed\") == -1))) {\n $success = true;\n Y.log('JSON response is success.');\n } else {\n Y.log('JSON response reports a failure.');\n }\n\n // Empty all plugin actions\n if (Object.keys(M.local_rlsiteadmin.data_actions.add).length > 0) {\n Y.Object.each(M.local_rlsiteadmin.data_actions.add, function($value, $key) {\n delete M.local_rlsiteadmin.data_actions.add[$key];\n });\n }\n if (Object.keys(M.local_rlsiteadmin.data_actions.remove).length > 0) {\n Y.Object.each(M.local_rlsiteadmin.data_actions.remove, function($value, $key) {\n delete M.local_rlsiteadmin.data_actions.remove[$key];\n });\n }\n if (Object.keys(M.local_rlsiteadmin.data_actions.update).length > 0) {\n Y.Object.each(M.local_rlsiteadmin.data_actions.update, function($value, $key) {\n delete M.local_rlsiteadmin.data_actions.update[$key];\n });\n }\n M.local_rlsiteadmin.action_dropdown_update();\n\n finish_modal($success, $response);\n }\n },\n failure: function() {\n Y.log('Action failure.');\n // TODO: Inject a failure message into the panel.\n // Enable the close button.\n Y.one('#manage-actions-modal button').set('disabled', false);\n // Hide the spinner.\n Y.one('#modal-content fa-spinner').hide();\n }\n }\n };\n $addons = Y.io(url, cfg);\n });\n }", "title": "" }, { "docid": "fab15c4f812070802977458aac9a931e", "score": "0.55705684", "text": "toggleModal () {\n\t\tthis.model.toggleModalState();\n\t\tthis.view.toggleModal( this.model.isModalOpen )\n\t}", "title": "" }, { "docid": "711301a38d418292aa4ef657a729fe6f", "score": "0.55696654", "text": "openUpdate(id) {\n this.setState({\n type_modal: 'update',\n id_current: id\n });\n let name_pk = this.props.pk_key;\n let detail = _.clone(_.find(this.state.data, { [name_pk]: id }));\n Object.keys(detail).forEach(function (item) {\n detail[item] = (detail[item] === null) ? '' : detail[item];\n });\n this.setState({\n row_current: detail\n });\n this.toggleModal();\n }", "title": "" }, { "docid": "b6daf8a6746bf4e2ee742f49f2f390cc", "score": "0.55687624", "text": "function update() {\n if (isEditorEmpty()) {\n show();\n } else {\n hide();\n }\n }", "title": "" }, { "docid": "cd16f728dc3ee224db9756838ea88214", "score": "0.55661243", "text": "rentalFormShow() {\n this.set('addNewRental', true);\n }", "title": "" }, { "docid": "bfd1b8292cd71006a0665391f27eebc1", "score": "0.5565271", "text": "function okOnGet(data, postFun){\r\n $(\"#\"+modal+\" .modal-body\").html(data.content);\r\n registerForm(postFun);\r\n $(\"#\"+modal).modal(\"show\");\r\n //mymodal.open();\r\n }", "title": "" }, { "docid": "87a38c7cb8fae9a4f2e0b8dc8b5effd7", "score": "0.5564254", "text": "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "title": "" }, { "docid": "87a38c7cb8fae9a4f2e0b8dc8b5effd7", "score": "0.5564254", "text": "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "title": "" }, { "docid": "f04ee1444a4b98ab9dba7ad233cd828c", "score": "0.5557365", "text": "function editCommandButton() {\n if (commandHasChanges()) {\n //changes -> öffne modal\n $('#resetButtonChanges').attr(\"onclick\", \"$('#uncommitedChangesModal').modal('hide');\");\n $('#discardChangesButton').attr(\"onclick\", \"editCommand()\");\n $('#uncommitedChangesModal').modal('show');\n } else {\n editCommand();\n }\n}", "title": "" }, { "docid": "180bd18304cc38a3feb63387d447f67d", "score": "0.55530214", "text": "onClickEdit() {\n this.setProperties({\n isOverViewModeActive: false,\n isEditModeActive: true\n });\n this.transitionToRoute('manage.alert.edit', this.get('id'));\n }", "title": "" }, { "docid": "106414ebc20b55328825dca6a1f0d14b", "score": "0.5551914", "text": "function onCreateNewStaffClick() {\n $('#modal-register-staff').modal('show');\n }", "title": "" }, { "docid": "15422872dd3bf710615458089fd2d4f3", "score": "0.55518836", "text": "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commitment\";\n vm.form.onSave = vm.add;\n vm.form.onClose = vm.form.show = false;\n\n vm.form.show = true;\n }", "title": "" }, { "docid": "51d1c1659c037b46d9b4e6f48138e6f8", "score": "0.5550147", "text": "function EditRequestTypeSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editRequestTypeDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data updated successfully.\", \"dialogSuccess\");\n\n ResetRequestTypeGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "d94aa49fd89e7e42137e9e46c877f49f", "score": "0.5549661", "text": "toggleModal({commit}, show) {\n commit(\"toggleModal\", show);\n }", "title": "" }, { "docid": "714d194ded6cdbc55496b7efb04b80ae", "score": "0.55421406", "text": "@action\n editRow() {\n set(this, 'isEditRow', true);\n }", "title": "" }, { "docid": "2bbfaf0473a64433cff1d551dba3d313", "score": "0.55391353", "text": "showModal(isEdit, subId) {\n this.setState({\n isShown: true,\n isEdit,\n subId,\n });\n }", "title": "" }, { "docid": "4aded168cdbb47131b9f1e5d2bef3421", "score": "0.55357844", "text": "function openProductEditModal() {\n $uibModal.open({\n templateUrl: '/components/products/partials' +\n '/productEditModal.html',\n backdrop: true,\n windowClass: 'modal',\n animation: true,\n controller: 'ProductEditModalController as modal',\n size: 'lg',\n resolve: {\n product: function () {\n return ctrl.product;\n },\n version: function () {\n return ctrl.nullVersion;\n }\n }\n });\n\n }", "title": "" }, { "docid": "a25ba37b6ce85d30fed45ab1b714d6bb", "score": "0.5531944", "text": "function categoryEdit(e){\n $('#catTitle').html('Edit Category');\n $('#catbtnTitle').html('Update Category');\n var showmenu = $(e).data('showmenu');\n var categoryId = $(e).data('categoryid');\n $('#category').val($(e).data('category'));\n $('#categoryId').val(categoryId);\n $('input[name=\"showMenu\"][value=\"' + showmenu + '\"]').prop('checked', true);\n // $('input:radio[name='+showMenu+']').attr('checked',true);\n $('#addCategory').modal('toggle'); \n}", "title": "" }, { "docid": "675a6badc46dc05f1936ba6aa210e0f2", "score": "0.5527616", "text": "function successModal(message1,message2) {\n $(\"#modalsave\").hide();\n $(\"#sure .modal-title\").text(message1);\n $(\"#sure .modal-body\").html(message2);\n $(\"#sure\").modal('show');\n $(\"#sure\").modal('handleUpdate'); \n }", "title": "" }, { "docid": "07d91b4d0c63880431661d416eecb9ca", "score": "0.5521368", "text": "function EditMemberDonateTypeSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editMemberDonateTypeDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Donate Type updated successfully.\", \"dialogSuccess\");\n\n memberDonateTypeObjData.fnDraw();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "b662e76b1c984baa106f7ec6892b26ac", "score": "0.552022", "text": "function mostrarModalEditCiudad(idCiudadUpdate, nombreCiudadUpdate, idMunicipioUpdate)\n{\n\t\n\t\n\t$(\"#editCiudad\").modal(\"show\");\n\t$(\"#nameCiudadIdEdit\").attr('value', nombreCiudadUpdate);\n\tdocument.getElementById(\"MunicipioSelectEdit\").value = idMunicipioUpdate;\n\t\n\t$(\"#editarCiudadValue\").click(function(){\n\n\t\tvar existeInTable = validarRegistroExistenteCiudad($(\"#nameCiudadIdEdit\").val(),$(\"#MunicipioSelectEdit\").val());\n\n\t\tif(existeInTable == \"No existe\"){\n\t\t\tmodificarCiudadFinal(idCiudadUpdate, $(\"#nameCiudadIdEdit\").val(), $(\"#MunicipioSelectEdit\").val());\n\t\t}\n\n\t})\n\n}", "title": "" }, { "docid": "cc597b58f44c782ca0745d505adbaf40", "score": "0.55197364", "text": "showEditDeleteModal(rowData) {\n $(\"#rid\").val(rowData.id);\n $(\"#rdescription\").val(rowData.description);\n $(\"#rprice\").val(rowData.price);\n $(\"#rrooms\").val(rowData.rooms);\n $(\"#rmail\").val(rowData.mail);\n $(\"#rname\").val(rowData.name);\n $(\"#rphoneNr\").val(rowData.phoneNr);\n $(\"#editDeleteModal\").modal('show');\n }", "title": "" }, { "docid": "516d9d17e2ac87426559c64ed1c98729", "score": "0.55184805", "text": "function modalDetail(id){\n _loading(1);\n $.post('/api/v1/ams/detail',{\n 'id_admin': userData['id'],\n 'token': userData['token'],\n 'status': 0,\n 'id': id,\n }, function (e) {\n let i;\n if(e['status'] === '00'){\n if (id > 0){\n $('#detail_id').text(e.id.id);\n $('#detail_name').text(e.id.name);\n $('#detail_phone').text(e.id.phone);\n $('#detail_email').text(e.id.email);\n $('#detail_role_id').text(e.id.role_id);\n $('#detail_role_name').text(e.id.role_name);\n }else{\n notif('danger', 'System Error!', 'user tidak terdaftar')\n }\n }else{\n notif('danger', 'System Error!', e.message);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n\n $('#modalDetail').modal('show');\n console.log(id);\n}", "title": "" }, { "docid": "db33d57d892fd9eb7550200347bbf263", "score": "0.55182654", "text": "function getShowById(id) {\n $(\"#title\").text(\"Show Detail\")\n $.ajax({\n url: '/Show/GetShowById/' + id,\n type: 'GET',\n datatype: 'json',\n success: function (data) {\n $(\"#Id\").val(data.Id);\n $(\"#Name\").val(data.Name);\n $(\"#Price\").val(data.Price);\n isUpdate = true;\n $(\"#showModal\").modal('show');\n },\n error: function (err) {\n alert(\"Error\" + err.ResponseText);\n }\n });\n}", "title": "" }, { "docid": "b3bfd7a1f10ec2a919cd83119c2bcc01", "score": "0.5516444", "text": "get showForm() {\n return !this.isLoading && !!this.sObjectName && !this.metadataError;\n }", "title": "" }, { "docid": "cb8fcb280583b269280892fd72a072a5", "score": "0.5515541", "text": "customShowModalPopup() { \n this.customFormModal = true;\n }", "title": "" }, { "docid": "a2e36c65b00324aea6dcb97b089c6b0a", "score": "0.5511508", "text": "function action (entity) {\n\t\t$uibModal.open({\n\t\t\ttemplateUrl: 'entities/city/action-dialog.html',\n\t\t\tcontroller: 'CityActionController',\n\t\t\tcontrollerAs: 'vm',\n\t\t\tsize: 'md',\n\t\t\tresolve: {\n\t\t\t\tcity: entity,\n\t\t\t\tdivisions: Division.getAll().$promise\n\t\t\t}\n\t\t})\n\t\t.result.then(\n\t\t\tfunction () {\n\t\t\t\tngTableService.ReloadPage(vm.tp);\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "6c44eb0dc3723787c17b8a8ef399ff33", "score": "0.55110836", "text": "function showAddTask() {\n vm.taskFormMode = 'add';\n vm.task = {};\n jQuery('#editTaskModal').modal('show');\n }", "title": "" }, { "docid": "f066019fc62c312d2bb2c7a14103d80e", "score": "0.5509298", "text": "function OpenNewHumanResourceModal() {\n NewHumanResourceAddEditShowHide(false);\n clearHumanResource();\n $('#newResourceModal').modal('show');\n}", "title": "" }, { "docid": "5e5a2299e4f505e81c0349b0667d05e1", "score": "0.550531", "text": "openAddModal(){\n document.getElementById(\"add_modal\").style.display = \"block\";\n }", "title": "" }, { "docid": "355ba7da5da54f16b7788789a7c72927", "score": "0.55033296", "text": "showModalDeleteSelected() {\n this.template.querySelector('.modal-selected-delete').show();\n }", "title": "" }, { "docid": "36be2f99ba84d7f9354c59fc0ce9c421", "score": "0.5500734", "text": "function showModal(title, body) {\n updateModal(title, body)\n $(modal).modal('show')\n}", "title": "" }, { "docid": "0dbbe3b8abd8fcfd062230e2aa692776", "score": "0.55002874", "text": "function btnEdit(orderId){\n $(\"#ldModal\").modal({\n backdrop:false,\n keyboard:false\n });\n $.ajax({\n type: \"POST\",\n url: \"/order/detail\",\n cache:false,\n data:{oid:orderId}\n }).done(function(data, textStatus){\n data = data.data;\n clearOdModal();\n $(\"#odid\").html(data.orderID);\n $(\"#odCTime\").html(data.orderDate);\n $(\"#odName\").html(data.product.name);\n $(\"#odDate\").html(data.startDate);\n $(\"#odPrice\").html(data.price.price);\n $(\"#odQty\").html(data.quantity);\n $(\"#odRemark\").val(data.remark);\n $(\"#odRemark\").attr('disabled',false);\n $(\"#odTotal\").html(data.totalPrice);\n var names = [];\n var phones = [];\n names.push(data.customer&&data.customer.name?data.customer.name:\"\");\n phones.push(data.customer&&data.customer.mobile?data.customer.mobile:\"\");\n htmlOrderDetailCustomers(1,names,phones);\n $(\"#btnOdSave\").show();\n $(\"#btnOdSave\").attr(\"oid\",orderId);\n $(\"#ldModal\").modal(\"hide\");\n $(\"#odModal\").modal();\n }).fail(function(){\n $(\"#ldModal\").modal(\"hide\");\n alert(\"网络异常,请重试!\");\n });\n}", "title": "" } ]
4937123966b3c258391c810f663839ad
This method is just needed for testing reasons This method needs to be updated after implementing the Sensitivity Analysis
[ { "docid": "4695678553141f466b111851d6075d9e", "score": "0.0", "text": "function create_objects_for_important(div_id_chart) {\n set_calculation_duration_is_over_false(div_id_chart);\n\n\n node_types_important = [{\n type: parent_type,\n node_width: 0,\n node_height: 0,\n color: color_parent_current_children.parent,\n donut_inner_radius: 20,\n min_height_donut: 140,\n min_width_donut: 300,\n pos_x: 0,\n is_calculated: false,\n group_nodes: []\n }, {\n type: current_node_type,\n node_width: 0,\n node_height: 0,\n color: color_parent_current_children.current,\n donut_inner_radius: 40,\n min_height_donut: 140,\n min_width_donut: 300,\n pos_x: 1/3,\n is_calculated: false,\n group_nodes: []\n }, {\n type: children_type,\n node_width: 0,\n node_height: 0,\n color: color_parent_current_children.children,\n donut_inner_radius: 20,\n min_height_donut: 140,\n min_width_donut: 300,\n pos_x: 2/3,\n is_calculated: false,\n group_nodes: []\n }];\n\n node_types_important_per_div.push({\n div_name: div_id_chart,\n node_types_important: node_types_important\n });\n\n //get current node object\n getNodeObjects_with_Virtual_evidences(function (response) {\n var current_nodes = response;\n node_types_important[1].group_nodes = current_nodes;\n\n getNodeObjects_with_Virtual_evidences(function (response) {\n var parent_nodes = response;\n node_types_important[0].group_nodes = parent_nodes;\n getNodeObjects_with_Virtual_evidences(function (response) {\n var child_nodes = response;\n\n node_types_important[2].group_nodes = child_nodes;\n\n node_types_important_per_div[get_index_of_chart_div_id(div_id_chart, node_types_important_per_div)].node_types_important = node_types_important;\n\n create_graphics_for_most_important_view(div_id_chart);\n\n set_calculation_duration_is_over_true(div_id_chart);\n\n }, child_node_ids);\n\n }, parent_node_ids);\n\n }, current_node_ids);\n}", "title": "" } ]
[ { "docid": "98e642ab00845dff59c197200b11e7aa", "score": "0.64307904", "text": "get sensitivity()\n\t{\n\t\treturn this._sensitivity;\n\t}", "title": "" }, { "docid": "574f09246a5527f27c20bd4528c7dfc9", "score": "0.59457856", "text": "get sensitivity() {\n return gainToDb(1 / this._inputBoost.gain.value);\n }", "title": "" }, { "docid": "88dedf0da8e2db62e6ed2fa6b9921a89", "score": "0.58877987", "text": "get sensitivity() {\n return (0, _Conversions.gainToDb)(1 / this._inputBoost.gain.value);\n }", "title": "" }, { "docid": "e74b81621d70f9ecf42d5a7ed8c488a4", "score": "0.5483599", "text": "get sensitivity() {\n return (0,_core_type_Conversions__WEBPACK_IMPORTED_MODULE_5__.gainToDb)(1 / this._inputBoost.gain.value);\n }", "title": "" }, { "docid": "e74b81621d70f9ecf42d5a7ed8c488a4", "score": "0.5483599", "text": "get sensitivity() {\n return (0,_core_type_Conversions__WEBPACK_IMPORTED_MODULE_5__.gainToDb)(1 / this._inputBoost.gain.value);\n }", "title": "" }, { "docid": "7b71bbace5cbea7a50721579f3e93ad5", "score": "0.54701525", "text": "get caseSensitivityInput() {\n return this._caseSensitivity;\n }", "title": "" }, { "docid": "d4ca48b0e6bc85c350a29bd755375412", "score": "0.53650284", "text": "function stringencyFactor(stringencyIndex){\n //return 1-stringencySensitivitySqr*(Math.pow(stringencyIndex/100,2));\n return 1-0.01*stringencySensitivityLin*stringencyIndex;\n //return 1;\n}", "title": "" }, { "docid": "83acc8121acf69eb847396b6324932c3", "score": "0.51945263", "text": "function adjustCaseSensitivity(){\n this.checked ? ignoreCase = true : ignoreCase = false;\n}", "title": "" }, { "docid": "0b0f4b548cd23871d5069248139c947e", "score": "0.50380737", "text": "function posSubCaseA (){\n// Subcase a:\n// exponentialValue() <= fractionalPart().length\nif(xtract.exponentialValue(userEntry)<=xtract.fractionalPart(userEntry).length) {\n// Test Case: +0012.3400e+1\n// Rule:\nconst originalSigFigsCnt=xtract.sigFiguresCount(userEntry) + xtract.leadingZeroesCount(userEntry);\nreturn originalSigFigsCnt;}\nreturn '';}", "title": "" }, { "docid": "7553c6fe8da81278846480e5ff0a80cd", "score": "0.4957737", "text": "onChangeSensitivityHandler (i,value){\n const instruments = this.state.instruments.slice();\n const instrument = instruments[i];\n if(instrument.sensitivity != value){\n instrument.sensitivity = value;\n instruments[i] = instrument;\n this.setState({instruments:instruments});\n }\n console.log('******Instrument Panel **********');\n console.log('Sensitivity of:', i);\n console.log('Set With Value:', value);\n }", "title": "" }, { "docid": "6375d047d97673eeff38eb05be6992a9", "score": "0.49526125", "text": "function negSubCaseA (){\n// Subcase a:\n// exponentialValue() <= integerPart().length - trailingZeroesCount()\nif(xtract.exponentialValue(userEntry)<=xtract.integerPart(userEntry).length - xtract.trailingZeroesCount(userEntry)) {\n// Test Case: +0012.3400e-1\n// Rule:\nconst originalSigFigsCnt=xtract.sigFiguresCount(userEntry) + xtract.leadingZeroesCount(userEntry);\nreturn originalSigFigsCnt;}\nreturn '';}", "title": "" }, { "docid": "5ea5c36c20f708f23828f45d7e467388", "score": "0.4934918", "text": "function saliency() {\n\n\tvar conceptCount = countConcepts(); // go through each predication and add the subject/object to an array returned with total and unique counts\n\tvar avgActivationWeight = computeAvgActivationWeight(conceptCount); // use the counts from above to calc the average count for all\n\n\tsetSC1(conceptCount, avgActivationWeight); \t\t\t\t\t\t// map counts >= average to true and rest to false\n\n\t// Calculate SC3 - repeat SC1 using the unique predications count\n\tsetAvgSumOther(conceptCount); \t// calc average of all other concepts for each concept\n\tsetSC3(conceptCount); \t// SC3 is SC2 of concepts from unique predications\n\tsetSalient(conceptCount); // set summaryLinks[i].predicate[j].salient = true if subj AND obj both true by SC1 or SC3.\n\n/* not in production version\n\tvar predicationCount = countPredications();\n\tbalancePredications(predicationCount);\n\tcomputeSRC1(predicationCount);\n\treturn join of conceptCount.SC1==true, uniqueConceptCount.SC3==true, relationCount??? and predicationCount.SRC1==true;\n*/\n\n}", "title": "" }, { "docid": "de33e7d28e27bddf7fc9aafae447849a", "score": "0.49250373", "text": "function test_mixed_attributes(){\r\n\t\r\n\tconsole.log(\"test_mixed_attributes....\")\r\n\r\n\tvar myMap = new Map();\r\n\tmyMap.set(\"Nominal\", new Nominal([\"0\",\"1\",\"2\", \"3\", \"4\"]));\r\n\tmyMap.set(\"Ordinal\", new Ordinal([\"0\",\"1\",\"2\",\"3\",\"4\"], 4, 0));\r\n\tmyMap.set(\"Numeric\", new Numeric(20.0, 0.0));\r\n\r\n\t//initialize\r\n\tvar similarityDist = new SimilarityDistanceClass(myMap);\r\n\r\n\tvar data = [ {\"Nominal\": \"1\", \"Ordinal\": \"1\", \"Numeric\": 5},\r\n\t\t\t\t {\"Nominal\": \"0\", \"Ordinal\": \"0\", \"Numeric\": 2},\r\n\t\t\t\t {\"Nominal\": \"1\", \"Ordinal\": \"1\", \"Numeric\": 5},\r\n\t\t\t\t {\"Nominal\": \"2\", \"Ordinal\": \"2\", \"Numeric\": 8},\r\n\t\t\t\t {\"Nominal\": \"3\", \"Ordinal\": \"3\", \"Numeric\": 9},\r\n\t\t\t\t {\"Nominal\": \"4\", \"Ordinal\": \"4\", \"Numeric\": 20}\r\n\t\t\t\t ];\r\n\t\r\n\tvar similarity_0_1 = similarityDist.compute(data[0], data[1]);\r\n\tvar similarity_0_2 = similarityDist.compute(data[0], data[2]);\r\n\tvar similarity_0_3 = similarityDist.compute(data[0], data[3]);\r\n\tvar similarity_0_4 = similarityDist.compute(data[0], data[4]);\r\n\tvar similarity_0_5 = similarityDist.compute(data[0], data[5]);\r\n\r\n\t//check that the first element is identical to second\r\n\tassert(similarity_0_2 == 1.0);\r\n\t\r\n\t//check that the first element and third one have the same similarity distance\r\n\tassert(similarity_0_1 == similarity_0_3);\r\n\t\r\n\t//check that the first element is more similar than the fourth one\r\n\tassert(similarity_0_1 > similarity_0_4);\r\n\r\n\t//check that the fourth element is more similar than the fifth\r\n\tassert(similarity_0_4 > similarity_0_5);\r\n\t\r\n\tconsole.log(\"PASS\")\r\n}", "title": "" }, { "docid": "e29a8476c56f20cfb513dfcdd4411f8f", "score": "0.4865783", "text": "function goToChangeSensitivity(){\n clientValuesFactory.setActiveWindow(windowViews.changeSensitivity);\n }", "title": "" }, { "docid": "d5e46efdab73c3a33b1a982602154d72", "score": "0.4851986", "text": "function verifier()\n\t{\n\t\tif (tabCases === tabSolution)\n\t\t{\n\t\t\tconsole.log(\"valide\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconsole.log(\"invalide\");\n\t\t}\n\t}", "title": "" }, { "docid": "24b6003ce48b592f3470cbae2bd44cdb", "score": "0.4848279", "text": "relevance(that){cov_25grm4ggn6.f[9]++;let total=(cov_25grm4ggn6.s[47]++,0);let words=(cov_25grm4ggn6.s[48]++,Object.keys(this.count));cov_25grm4ggn6.s[49]++;words.forEach(w=>{cov_25grm4ggn6.f[10]++;cov_25grm4ggn6.s[50]++;total+=this.rank(w)*that.rank(w);});//return the average rank of my words in the other vocabulary\ncov_25grm4ggn6.s[51]++;return total/words.length;}", "title": "" }, { "docid": "773fa6f0dd34f499d570d3d48050ee53", "score": "0.48445648", "text": "function DomPredictionHelper() {}", "title": "" }, { "docid": "99d726dd2292ebbb517ca17f38afae3d", "score": "0.48285615", "text": "recognize(sample ,dataset) {\n\n let points = convert(sample,dataset);\n // preprocess the sample to represent the candidate gesture\n let t0 = performance.now();\n // start timer\n let bestGestureClass = null;\n let bestScore = -Infinity;\n try {\n var candidateXY = new GestureSample(\"\", points[0]);\n var candidateYZ = new GestureSample(\"\", points[1]);\n var candidateZX = new GestureSample(\"\", points[2]);\n }\n catch{\n var t1 = performance.now();\n return { 'Name': 'No match', 'Time': t1 - t0, 'Score': 0.0 }\n }\n let Res = classify([this.GesturesXY, this.GesturesYZ, this.GesturesZX], [candidateXY, candidateYZ, candidateZX]);\n bestScore = Res[1]; // best (least) distance\n bestGestureClass = Res[0]; // point-cloud index\n\n var t1 = performance.now();\n // stop timer\n\n return (bestGestureClass == null) ? { 'Name': 'No match', 'Time': t1 - t0, 'Score': 0.0 } : { 'Name': bestGestureClass, 'Time': t1 - t0, 'Score': bestScore };\n }", "title": "" }, { "docid": "58914705e755ef12581e5999d991b716", "score": "0.48269916", "text": "function OR_RenalReplacmentTherapy(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of Renal replacement Therapies\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Enter Renal Replacement Therapies\n exestatus = Features.MvRRTSelect(TestName,\"ImdcomboboxitemHd\",exestatus);\n \n //Verify the number of Renal Replacement Therapies\n exestatus = Features.MvVerifyFinalOR(TestName, \"RenalReplacmentTherapy\" ,exestatus);\n \n //Enter Renal Replacement Therapies\n exestatus = Features.MvRRTSelect(TestName,\"ImdcomboboxitemCvvhdf\",exestatus);\n \n //Verify the number of Renal Replacement Therapies\n exestatus = Features.MvVerifyFinalOR(TestName, \"RenalReplacmentTherapy\" ,exestatus);\n\n //Enter Renal Replacement Therapies\n exestatus = Features.MvRRTSelect(TestName,\"ImdcomboboxitemCvvhd\",exestatus);\n \n //Verify the number of Renal Replacement Therapies\n exestatus = Features.MvVerifyFinalOR(TestName, \"RenalReplacmentTherapy\" ,exestatus);\n \n //Enter Renal Replacement Therapies\n exestatus = Features.MvRRTSelect(TestName,\"ImdcomboboxitemCvvh\",exestatus);\n \n //Verify the number of Renal Replacement Therapies\n exestatus = Features.MvVerifyFinalOR(TestName, \"RenalReplacmentTherapy\" ,exestatus);\n \n //Enter Renal Replacement Therapies\n exestatus = Features.MvRRTSelect(TestName,\"ImdcomboboxitemScuf\",exestatus);\n \n //Verify the number of Renal Replacement Therapies\n exestatus = Features.MvVerifyFinalOR(TestName, \"RenalReplacmentTherapy\" ,exestatus); \n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "0ce8be2a350a6ec36664c3952a3159a9", "score": "0.48224032", "text": "function getPageAttributeMatches() {\n\n\t\t// Return list of valid surveys based on page / site and check if override survey id needed\n\n\t\t// Remove surveys that are valid from the surveyDB array so that when we save it, \n\t\t// those ones are removed and not tested on future pages in the visit\n\t\t\n \tvar surveySubList = {};\n\t\tvar url = document.location.hostname + document.location.pathname;\n\t\tvar count = 0;\n\t\t\n\t\tfor (var i = 0; i < surveyDB.surveys.length; i++) {\n\t\t\t\n\t\t\tvar survey_i = surveyDB.surveys[i];\n\t\t\t\n\t\t\tif (overrideID) {\n\t\t\t\t\n\t\t\t\t// Skip this loop's logic if it's not the desired survey, \n\t\t\t\t// therefore there's no chance it will be selected\n\t\t\t\tif (survey_i.id !== overrideID){\n\t\t\t\t\n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\n\t\t\t\t// If it is the desired survey, set it's probability to 100%. \n\t\t\t\t// Note that the desired survey must still be applicable on this page \n\t\t\t\t// so the logic in the swtich statement still must execute meet the conditions\n\t\t\t\tsurvey_i.probability = 100;\n\t\t\t}\n\t\t\t\n\t\t\tswitch(survey_i.type) {\n\n\t\t\t\tcase \"Entire site\":\n\t\t\t\t\n\t\t\t\t\t// Get an object array of the sites to run the survey on\n\t\t\t\t\tvar sublist = getObjArr(survey_i[\"survey-urls\"]);\n\t\t\t\t\t\n\t\t\t\t\tfor (var c = 0; c < sublist.length; c++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//convert the value for the site into RegExp non-case sensitive\n\t\t\t\t\t\tvar b = new RegExp(sublist[c].site, \"i\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if the url matches the regEx\n\t\t\t\t\t\tif (b.test(url)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Store this survey's id and probability in the new object \n\t\t\t\t\t\t\t// (this object is later fed to getWeightedRandom)\n\n\t\t\t\t\t\t\t// Convert site survey probability into rate since it is \n\t\t\t\t\t\t\t// between 0 and Visitor Allocation for site wide type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tsurveySubList[survey_i.id] = \n\t\t\t\t\t\t\t\tsurvey_i.probability * surveyDB.settings[\"site-probability\"];\n\n\t\t\t\t\t\t\t// Keep track of the number of surveys that apply so we can \n\t\t\t\t\t\t\t// console log it later\n\t\t\t\t\t\t\tcount++;\n\n\t\t\t\t\t\t\t// Remove this survey from the DB, since we won't test for it on future pages\n\t\t\t\t\t\t\tsurveyDB.surveys.splice(i,1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Decrement i since the next record has moved to replace the current record\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\t\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase \"Page\":\n\n\t\t\t\t\tvar sublist = getObjArr(survey_i[\"survey-urls\"]);\n\t\t\t\t\t\n\t\t\t\t\tvar wLocation = window.location.href.toLowerCase();\n\n\t\t\t\t\tfor (var c = 0; c < sublist.length; c++) {\n\n\t\t\t\t\t\tif (wLocation.indexOf(sublist[c].url.toLowerCase()) !== -1 && i>=0) {\n\t\t\t\t\t\t\tsurveySubList[survey_i.id] = survey_i.probability * surveyDB.settings[\"page-probability\"];\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Remove the eligible survey from the DB, since we won't test for it on future pages\n\t\t\t\t\t\t\tsurveyDB.surveys.splice(i,1);\n\n\t\t\t\t\t\t\t// Decrement i since the next record has moved to replace the current record\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\t\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\tconsoleLog(count + \" potential surveys, selecting a survey\");\n\t\n\t\treturn surveySubList;\n\t}", "title": "" }, { "docid": "96d891ae7116b4b946a622be016e3503", "score": "0.47959095", "text": "function submitForm() {\n\n //eyeTribeData.push('{\"task\":\"val\"}');\n //eyeTribeData.push('{\"task\":\"car\"}');\n if($('#submit_button').text()==' Submit') {\n\n $(\"#eyedata\").val(JSON.stringify(eyeTribeData));\n $(\"#eyedatamap\").val($(\"#eyedatamap\").val());\n\n $(\"#sscore\").val($(\"#output\").text());\n var eval = Math.round(Math.abs($(\"#sscore\").val() - $(\"#hscore\").val())/10);\n var precision=0; \n var total=$(\".sampled\").length\n $(\".sampled\").each(function () {\n // we go over all sampled words\n elem = $(this);\n if (elem.attr('isviewed')==\"true\"){\n precision+=1;\n }\n })\n \n precision/=total;\n precision*=100;\n $(\"#sscore\").val(Math.round(precision*100)/100);\n console.log(precision);\n\n\tif($('#submit_button').text!=\"Next\")\n /*switch (eval) {\n case 0: //$(\"#feedback\").text(\"** Your Score is great! The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'>\");\n break;\n case 1: //$(\"#feedback\").text(\"** Your Score is good! The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n break;\n case 2: //$(\"#feedback\").text(\"** Your Score is okay. The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n break;\n case 3: //$(\"#feedback\").text(\"** Are you allright.. The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n break;\n case 4: //$(\"#feedback\").text(\"** Did you have your breakfast today??. The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/star.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n break;\n case 5: //$(\"#feedback\").text(\"** You are loosing it!!!. The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n break;\n default: //$(\"#feedback\").text(\"** Your are loosing it!!! The actual score is \"+Math.round($(\"#hscore\").val()));\n $(\"#feedback\").html(\"<img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'><img src='/appraise/files/img/estar.jpg'>\");\n }*/\n //$('.cd-popup').addClass('is-visible');\n $('#submit_button').html('<i class=\"icon-ok\"></i> Next');\n $(\"#feedback\").text(\"Precision: \" + precision +\" % out of \" + total + \" highlighted words\" );\n }\n else {\n $(\"#myform\").submit();\n $('#submit_button').html('<i class=\"icon-ok\"></i> Submit');\n };\n }", "title": "" }, { "docid": "e2bd2eb100e2ab2e945824f1b51fadda", "score": "0.4767397", "text": "function MathRecognitionData() {\n }", "title": "" }, { "docid": "1a6435ddf871fe4dfc9ae3f5d35aa437", "score": "0.47535232", "text": "normalizeFitness() {\n let sum = 0;\n this.chromosomes.forEach(chromosome => (sum += chromosome.fitness));\n this.chromosomes.forEach(chromosome => (chromosome.fitness /= sum));\n }", "title": "" }, { "docid": "589cbcb90826903b78823f8be3561db9", "score": "0.47479203", "text": "function ksTest (values, model) {\n let D = 0\n values.sort(function (a, b) {\n return a - b\n })\n for (let i = 0; i < values.length; i++) {\n D = Math.max(D, Math.abs((i + 1) / values.length - model(values[i])))\n // console.log(values[i], (i + 1) / values.length, model(values[i]))\n }\n // console.log(D)\n return D <= 1.628 / Math.sqrt(values.length)\n }", "title": "" }, { "docid": "aeb7828dd554bd9a97e30b7d489e195b", "score": "0.47183594", "text": "function randomSensFunc() {\n const mDecimals = $('#more-decimals').is(':checked');\n const rbs = document.querySelectorAll('input[name=\"game\"]');\n let yaw; for (const rb of rbs) {if (rb.checked) {yaw = rb.value;break;}}\n $('#overwatch').val('0.0066');$('#apex').val('0.022');$('#cs').val('0.022');\n $('#valorant').val('0.07');$('#fortnite').val('0.005555');$('#quake').val('0.022');\n\n var generate = Math.random() * 100;\n var low = Math.random() * (45 - 34.99) + 34.99;\n var medium = Math.random() * (35 - 25) + 25;\n var high = Math.random() * (24.99 - 15) + 15;\n var random = generate < 25 ?\n low\n : generate < 75 ?\n medium\n : generate < 99.99 ?\n high\n : 1.33;\n\n $('#icm').val(random.toFixed(mDecimals ? 5 : 2));\n $('#sensitivity').val((2.54 * 360 / (random * yaw * ($('#dpi').val() || '800'))).toFixed(mDecimals ? 5 : 2));\n}", "title": "" }, { "docid": "b6e812c21d652271d72daf30023defe7", "score": "0.47139415", "text": "function SEA () {}", "title": "" }, { "docid": "435d0ead80f4350c7689de9aee7769c1", "score": "0.47124657", "text": "function calcSA( data){\n\t\tvar A = App.data.player.soldiers.armed.attack,\n\t\t\tB = 0,\t// armed untrained\n\t\t\tC = App.data.player.weapons.attack.power,\n\t\t\tD = 0,\t// # unarmed trained\n\t\t\tE = 0,\t// # unarmed untrained\n\t\t\tF = App.data.player.technology.attack,\n\t\t\tG = App.data.race[ App.data.player.race ].bonus.attack,\n\t\t\tleftoverWeapons = 0, leftoverSoldiers = 0;\n\t\t\n\t\t// 2 scenarios: more weapons than trained soldiers, or less.\n\t\tif( App.data.player.weapons.attack.quantity >= A ){\n\t\t\t// \tall soldiers get weapons, and there are more for untrained soldiers\n\t\t\tleftoverWeapons = A - App.data.player.weapons.attack.quantity;\n\t\t\tB = App.data.player.soldiers.untrained - leftoverWeapons;\t// Untrained soldiers get remaining weapons\n\t\t\tE = App.data.player.soldiers.untrained - B;\t\t// Remaining untrained soldiers get no weapons\n\t\t\t\n\t\t} else{\n\t\t\t// Some soldiers get weapons, none left over for untrained soldiers\n\t\t\tleftoverSoldiers = abs( A - App.data.player.weapons.attack.quantity);\n\t\t\tA = App.data.player.weapons.attack.quantity - A;\n\t\t\tB = App.data.player.soldiers.untrained\n\t\t\t\n\t\t\tE = leftoverSoldiers;\n\t\t}\n\t\tvar armedUntrained = App.data.player.weapons.attack.quantity\n\t\t\t\n\t\t\t\n\t\treturn C;\n\t }", "title": "" }, { "docid": "7e722accc0b65319410a7b8ab565a351", "score": "0.47044834", "text": "function ObscenityFilter() {\n var BAD_WORD_REGEX = /\\b(2g1c|2 girls 1 cup|acrotomophilia|alabama hot pocket|alaskan pipeline|anal|anilingus|anus|arsehole|ass|asshole|assmunch|auto erotic|autoerotic|babeland|baby batter|baby juice|ball gag|ball gravy|ball kicking|ball licking|ball sack|ball sucking|bangbros|bareback|barely legal|barenaked|bastardo|bastinado|bbw|bdsm|beaver cleaver|beaver lips|bestiality|big black|big breasts|big knockers|big tits|bimbos|birdlock|bitch|black cock|blonde action|blonde on blonde action|blowjob|blow job|blow your load|blue waffle|blumpkin|bollocks|bondage|boner|boob|boobs|booty call|brown showers|brunette action|bukkake|bulldyke|bullet vibe|bung hole|bunghole|busty|butt|buttcheeks|butthole|camel toe|camgirl|camslut|camwhore|carpet muncher|carpetmuncher|chocolate rosebuds|circlejerk|cleveland steamer|clit|clitoris|clover clamps|clusterfuck|cock|cocks|copulation|coprolagnia|coprophilia|cornhole|creampie|cum|cumming|cunnilingus|cunt|darkie|date rape|daterape|deep throat|deepthroat|dendrophilia|dick|dildo|dirty pillows|dirty sanchez|doggie style|doggiestyle|doggy style|doggystyle|dog style|dolcett|domination|dominatrix|dommes|donkey punch|double dong|double penetration|dp action|dry hump|dvda|eat my ass|ecchi|ejaculation|erotic|erotism|escort|ethical slut|eunuch|faggot|fecal|felch|fellatio|feltch|female squirting|femdom|figging|fingerbang|fingering|fisting|foot fetish|footjob|frotting|fuck|fuck buttons|fudge packer|fudgepacker|futanari|gang bang|gay sex|genitals|giant cock|girl on|girl on top|girls gone wild|goatcx|goatse|gokkun|golden shower|goodpoop|goo girl|goregasm|grope|group sex|g-spot|guro|hand job|handjob|hard core|hardcore|hentai|homoerotic|honkey|hooker|hot carl|hot chick|how to kill|how to murder|huge fat|humping|incest|intercourse|jack off|jail bait|jailbait|jelly donut|jerk off|jigaboo|jiggaboo|jiggerboo|jizz|juggs|kike|kinbaku|kinkster|kinky|knobbing|leather restraint|leather straight jacket|lemon party|lolita|lovemaking|make me come|making out|male squirting|masturbate|masturbation|menage a trois|milf|missionary position|motherfucker|mound of venus|mr hands|muff diver|muffdiving|nambla|nawashi|negro|neonazi|nigga|nigger|nig nog|nimphomania|nipple|nipples|nsfw images|nude|nudity|nympho|nymphomania|octopussy|omorashi|one cup two girls|one guy one jar|orgasm|orgy|paedophile|panties|panty|pedobear|pedophile|pegging|penis|phone sex|piece of shit|pissing|piss pig|pisspig|playboy|pleasure chest|pole smoker|ponyplay|poof|poon|poontang|punany|poop chute|poopchute|porn|porno|pornography|prince albert piercing|pseudocopulation|pthc|pubes|pussy|queaf|raghead|raging boner|rape|raping|rapist|rectum|reverse cowgirl|rimjob|rimming|rosy palm|rosy palm and her 5 sisters|rusty trombone|sadism|santorum|scat|schlong|scissoring|scrotal|semen|sex|sexo|sexy|sexual|sexuality|shaved beaver|shaved pussy|shemale|shibari|shit|shota|shrimping|skeet|slanteye|slut|s&m|smut|snatch|snowballing|sodomize|sodomy|spic|splooge|splooge moose|spooge|spread legs|spunk|strap on|strapon|strappado|strip club|style doggy|suck|sucks|suicide girls|sultry women|swastika|swinger|tainted love|taste my|tea bagging|threesome|throating|tied up|tight white|tit|tits|titties|titty|tongue in a|topless|tosser|towelhead|tranny|tribadism|tub girl|tubgirl|tushy|twat|twink|twinkie|two girls one cup|undressing|upskirt|urethra play|urophilia|vagina|venus mound|vibrator|violet blue|violet wand|vorarephilia|voyeur|vulva|wank|wetback|wet dream|white power|women rapping|wrapping men|wrinkled starfish|xx|xxx|yaoi|yellow showers|yiffy|zoophilia|mile high club|facesitting|prostate|klismaphilia|intimacy|sloppy seconds|orgastic|urolagnia|teabagging|frot|foreplay|nyotaimori|anatomy|sumata|nanpa|kunzaya|adult|food play|dirty talk)\\b/;\n\n this.containsObscenity = function(word) {\n var wordLowerCase = word.toLowerCase();\n if (BAD_WORD_REGEX.test(wordLowerCase)) {\n return true;\n } else {\n return false;\n }\n\n }\n}", "title": "" }, { "docid": "c499b5fb0dc64c47961fd27eaf415a1d", "score": "0.4670432", "text": "calcScore() {\n return Math.round(Math.sqrt(Math.pow(this.skier.x, 2) + Math.pow(this.skier.y, 2)));\n }", "title": "" }, { "docid": "74b65d574ccbe7418cec88167a81900c", "score": "0.46675268", "text": "function determine() {\n\n // no angle vs given means SSS\n if (as.k && bs.k && cs.k) {\n return [\"SSS\"];\n }\n/* Only SSS works.\n\n // now test for all AAS possibilities\n else if (aa.k && ba.k && cs.k) {\n return [\"ASA\", \"c\"];\n }\n else if (aa.k && bs.k && ca.k) {\n return [\"ASA\", \"b\"];\n }\n else if (as.k && ba.k && ca.k) {\n return [\"ASA\", \"a\"];\n }\n\n // now test for all SAS possibilities\n else if (as.k && ba.k && cs.k) {\n return [\"SAS\", \"b\"];\n }\n else if (aa.k && bs.k && cs.k) {\n return [\"SAS\", \"a\"];\n }\n else if (as.k && bs.k && ca.k) {\n return [\"SAS\", \"a\"];\n }\n\n // now test for all ASA possibilities\n else if (aa.k && ca.k && cs.k) {\n return [\"AAS\", \"c\"];\n }\n else if (aa.k && ba.k && bs.k) {\n return [\"AAS\", \"b\"];\n }\n else if (as.k && aa.k && ca.k) {\n return [\"AAS\", \"a\"];\n }\n else if (aa.k && ba.k && as.k) {\n return [\"AAS\", \"a\"];\n }\n else if (ba.k && aa.k && bs.k) {\n return [\"AAS\", \"b\"];\n }\n else if (ca.k && ba.k && cs.k) {\n return [\"AAS\", \"c\"];\n }\n*/\n\n}", "title": "" }, { "docid": "15711b2654cfd18cfa2ea32e494f008b", "score": "0.46663114", "text": "function Virus() {\n const dir = 'CSynth\\\\data\\\\YorkStudents\\\\';\n let virus = this;\n let vvvv, hhhh;\n\n virus.load = function(thresh = 2) {\n CSynth.current = { fullDir: '' };\n \n const vv = processFile(dir + '1aq3_full.vdb');\n const vvv = vv.realcoords;\n const centre = vvv.reduce( (c,v) => c = c.add(v), new THREE.Vector3());\n vvvv = vvv.map(x => x.sub(centre));\n\n CSynth.current = { fullDir: '' };\n const hh = processFile(dir + 'Hong_2017_fullRNA.vdb');\n hhhh = hh.coords.map(x => x.sub(centre));\n\n return virus.pairs(thresh);\n }\n\n virus.pairs = function(thresh = 2) {\n\n const pairs = [];\n for (let i=0; i < vvvv.length; i++) {\n for (let j=0; j < hhhh.length; j++) {\n const l = vvvv[i].distanceTo(hhhh[j]);\n if (l < thresh) pairs.push({i, j, l});\n }\n }\n return pairs;\n }\n}", "title": "" }, { "docid": "c96694fe403644d94e2d3b03fe5d332b", "score": "0.46607792", "text": "function validation(data, predict) {\n\tvar roc = new Set();\n\n\t_.each(data, function(item) {\n\t\tif (predict(item)) {\n\t\t\tif (_.last(item) === '1') {\n\t\t\t\troc.add(\"TP\", 1);\n\t\t\t} else {\n\t\t\t\troc.add(\"FP\", 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (_.last(item) === '0') {\n\t\t\t\troc.add(\"TN\", 1);\n\t\t\t} else {\n\t\t\t\troc.add(\"FN\", 1);\n\t\t\t}\n\n\t\t}\n\t});\n\troc.debug();\n\tvar precision = roc.get('TP') / (roc.get('TP') + roc.get('FP'));\n\tvar reacll = roc.get('TP') / (roc.get('TP') + roc.get('FN'));\n\tvar accuracy = (roc.get('TP') + roc.get('TN')) / (roc.get('TP') + roc.get('FN') + roc.get('TN') + roc.get('FP'));\n\tconsole.log(\"precision:\" + precision);\n\tconsole.log(\"reacll:\" + reacll);\n\tconsole.log(\"accuracy:\" + accuracy);\n}", "title": "" }, { "docid": "73f03fbe47ff9b3d2d0406f4aad47f9a", "score": "0.4660088", "text": "function KeyWordValues() {\n\tvar theMap = new Map;\n\ttheMap.put('accessories', 0.1)\n\t.put('accountants', 0.1)\n\t.put('active life', 0.1)\n\t.put('acupuncture', 0.1)\n\t.put('adult education', 0.1)\n\t.put('adult entertainment', 0.1)\n\t.put('adult', 0.1)\n\t.put('advertising', 0.1)\n\t.put('afghan', 0.1)\n\t.put('african', 0.1)\n\t.put('airlines', 0.1)\n\t.put('airport shuttles', 0.1)\n\t.put('airports', 0.1)\n\t.put('allergists', 0.1)\n\t.put('altoatesine', 0.1)\n\t.put('amateur sports teams', 0.1)\n\t.put('american', 0.1)\n\t.put('amusement parks', 0.1)\n\t.put('anesthesiologists', 0.11)\n\t.put('animal shelters', 0.17)\n\t.put('antiques', 0.25)\n\t.put('apartments', 0.3)\n\t.put('appliances', 0.3)\n\t.put('appliances & repair', 0.39)\n\t.put('apulian', 0.4)\n\t.put('aquariums', 0.4)\n\t.put('arabian', 0.43)\n\t.put('arcades', 0.47)\n\t.put('archery', 0.47)\n\t.put('architects', 0.5)\n\t.put('argentine', 0.52)\n\t.put('armenian', 0.52)\n\t.put('art galleries', 0.53)\n\t.put('art schools', 0.54)\n\t.put('art supplies', 0.54)\n\t.put('arts & crafts', 0.54)\n\t.put('arts & entertainment', 0.54)\n\t.put('asian fusion', 0.54)\n\t.put('psychics & astrologers', 1.57)\n\t.put('auction houses', 0.55)\n\t.put('audiologist', 0.57)\n\t.put('australian', 0.57)\n\t.put('asutrian', 0.57)\n\t.put('authorized postal representative', 0.58)\n\t.put('auto detailing', 0.58)\n\t.put('auto glass services', 0.58)\n\t.put('auto loan providers', 0.58)\n\t.put('auto parts & supplies', 0.58)\n\t.put('auto repair', 0.59)\n\t.put('automotive', 0.6)\n\t.put('baby gear & furniture', 0.6)\n\t.put('baden', 0.61)\n\t.put('badminton', 0.61)\n\t.put('bagels', 0.61)\n\t.put('baguettes', 0.64)\n\t.put('bail bondsmen', 0.64)\n\t.put('bakeries', 0.64)\n\t.put('opera & ballet', 1.3)\n\t.put('bangladeshi', 0.64)\n\t.put('bankruptcy law', 0.64)\n\t.put('banks & credit unions', 0.65)\n\t.put('barbeque', 0.65)\n\t.put('barbers', 0.66)\n\t.put('barre classes', 0.66)\n\t.put('bars', 0.66)\n\t.put('bartenders', 0.66)\n\t.put('basque', 0.66)\n\t.put('bathing area', 0.66)\n\t.put('bavarian', 0.66)\n\t.put('beach bars', 0.67)\n\t.put('beaches', 0.67)\n\t.put('beauty & spas', 0.68)\n\t.put('bed & breakfast', 0.68)\n\t.put('beer bar', 0.68)\n\t.put('beer garden', 0.68)\n\t.put('beer gardens', 0.69)\n\t.put('beer hall', 0.7)\n\t.put('beer wine & spirits', 0.7)\n\t.put('belgian', 0.7)\n\t.put('bespoke clothing', 0.71)\n\t.put('betting centers', 0.71)\n\t.put('beverage store', 0.71)\n\t.put('bicycle paths', 0.72)\n\t.put('bicycles', 0.72)\n\t.put('bike associations', 0.72)\n\t.put('bike repair/maintenance', 0.72)\n\t.put('bike rentals', 0.72)\n\t.put('bike shop', 0.73)\n\t.put('bikes', 0.73)\n\t.put('bistros', 0.73)\n\t.put('black sea', 0.73)\n\t.put('blow dry/out services', 0.73)\n\t.put('boat charters', 0.73)\n\t.put('boat dealers', 0.74)\n\t.put('boat repair', 0.74)\n\t.put('boating', 0.74)\n\t.put('body shops', 0.74)\n\t.put('bookstores', 0.75)\n\t.put('boot camps', 0.75)\n\t.put('botanical gardens', 0.76)\n\t.put('bowling', 0.76)\n\t.put('boxing', 0.76)\n\t.put('brasseries', 0.76)\n\t.put('brazilian', 0.76)\n\t.put('breakfast & brunch', 0.77)\n\t.put('breweries', 0.77)\n\t.put('bridal', 0.77)\n\t.put('british', 0.77)\n\t.put('bubble tea', 0.77)\n\t.put('buddhist temples', 0.77)\n\t.put('buffets', 0.78)\n\t.put('building supplies', 0.78)\n\t.put('bulgarian', 0.78)\n\t.put('bulk billing', 0.78)\n\t.put('bungee jumping', 0.78)\n\t.put('burgers', 0.78)\n\t.put('burmese', 0.79)\n\t.put('business law', 0.8)\n\t.put('butcher', 0.8)\n\t.put('cafes', 0.8)\n\t.put('cafeteria', 0.81)\n\t.put('cajun/creole', 0.81)\n\t.put('patisserie/cake shop', 1.46)\n\t.put('calabrian', 0.81)\n\t.put('cambodian', 0.81)\n\t.put('campgrounds', 0.83)\n\t.put('canadian ', 0.83)\n\t.put('candy stores', 0.83)\n\t.put('cannabis clinics', 0.83)\n\t.put('canteen', 0.83)\n\t.put('cantonese', 0.84)\n\t.put('car dealers', 0.84)\n\t.put('car rental', 0.85)\n\t.put('gas & service stations', 1.05)\n\t.put('car stereo installation', 0.85)\n\t.put('car wash', 0.85)\n\t.put('cardiologists', 0.85)\n\t.put('cards & stationery', 0.86)\n\t.put('career counseling', 0.86)\n\t.put('caribbean', 0.86)\n\t.put('carpenters', 0.87)\n\t.put('carpet cleaning', 0.87)\n\t.put('carpet installation', 0.87)\n\t.put('carpeting', 0.87)\n\t.put('casinos', 0.88)\n\t.put('castles', 0.88)\n\t.put('catalan', 0.88)\n\t.put('caterers', 0.88)\n\t.put('funeral services & cemeteries', 1.06)\n\t.put('champagne bars', 0.89)\n\t.put('check cashing/pay-day loans', 0.9)\n\t.put('chee kufta', 0.9)\n\t.put('cheese shops', 0.9)\n\t.put('cheesesteaks', 0.9)\n\t.put('chicken shop', 0.9)\n\t.put('chicken wings', 0.9)\n\t.put('child care & day care', 0.96)\n\t.put('chinese bazaar', 0.91)\n\t.put('chinese', 0.92)\n\t.put('chiropractors', 0.92)\n\t.put('chocolatiers & shops', 0.92)\n\t.put('choirs', 0.92)\n\t.put('christmas markets', 0.93)\n\t.put('churches', 0.93)\n\t.put('churros', 0.93)\n\t.put('cinema', 0.93)\n\t.put('circus schools', 0.93)\n\t.put('climbing', 0.93)\n\t.put('children\\'s clothing', 0.93)\n\t.put('men\\'s clothing', 0.94)\n\t.put('women\\'s clothing', 0.94)\n\t.put('clowns', 0.94)\n\t.put('cocktail bars', 0.94)\n\t.put('coffee & tea', 0.94)\n\t.put('coffeeshops', 0.95)\n\t.put('college counseling', 0.95)\n\t.put('colleges & universities', 0.95)\n\t.put('colombian', 0.95)\n\t.put('comedy clubs', 0.95)\n\t.put('comfort food', 0.95)\n\t.put('comic books', 0.96)\n\t.put('commercial real estate', 0.96)\n\t.put('community centers', 0.96)\n\t.put('computers', 0.97)\n\t.put('concept shops', 0.97)\n\t.put('contractors', 0.97)\n\t.put('convenience stores', 0.97)\n\t.put('cooking schools', 0.98)\n\t.put('corsican', 0.98)\n\t.put('cosmetic dentists', 0.98)\n\t.put('cosmetic surgeons', 0.98)\n\t.put('cosmetics & beauty supply', 0.99)\n\t.put('cosmetology schools', 0.99)\n\t.put('costumes', 0.99)\n\t.put('country dance halls', 0.99)\n\t.put('courthouses', 1)\n\t.put('cpr classes', 1)\n\t.put('creperies', 1)\n\t.put('criminal defense law', 1)\n\t.put('embroidery & crochet', 1.05)\n\t.put('csa', 1)\n\t.put('cuban', 1.01)\n\t.put('cucina campana', 1.01)\n\t.put('cultural center', 1.01)\n\t.put('curry sausage', 1.01)\n\t.put('cypriot', 1.01)\n\t.put('czech/slovakian', 1.01)\n\t.put('dance clubs', 1.01)\n\t.put('dance restaurants', 1.01)\n\t.put('dance schools', 1.01)\n\t.put('dance studios', 1.01)\n\t.put('danish', 1.01)\n\t.put('data recovery', 1.02)\n\t.put('day spas', 1.02)\n\t.put('delicatessen', 1.02)\n\t.put('delis', 1.02)\n\t.put('couriers & delivery services', 1.01)\n\t.put('dental hygienists', 1.02)\n\t.put('dentists', 1.03)\n\t.put('department stores', 1.03)\n\t.put('departments of motor vehicles', 1.03)\n\t.put('dermatologists', 1.03)\n\t.put('desserts', 1.04)\n\t.put('diagnostic imaging', 1.04)\n\t.put('diagnostic services', 1.04)\n\t.put('dim sum', 1.04)\n\t.put('diners', 1.04)\n\t.put('disc golf', 1.04)\n\t.put('discount store', 1.04)\n\t.put('dive bars', 1.04)\n\t.put('diving', 1.05)\n\t.put('divorce & family law', 1.05)\n\t.put('djs', 1.05)\n\t.put('do-it-yourself food', 1.05)\n\t.put('doctors', 1.05)\n\t.put('dog parks', 1.05)\n\t.put('dog walkers', 1.05)\n\t.put('dolmus station', 1.05)\n\t.put('dominican', 1.05)\n\t.put('donairs', 1.05)\n\t.put('donuts', 1.06)\n\t.put('driving schools', 1.06)\n\t.put('drugstores', 1.06)\n\t.put('dry cleaning & laundry', 1.06)\n\t.put('dui law', 1.06)\n\t.put('music & dvds', 1.45)\n\t.put('ear nose & throat doctor', 1.07)\n\t.put('eastern european', 1.07)\n\t.put('eastern german', 1.08)\n\t.put('editorial services', 1.08)\n\t.put('education', 1.08)\n\t.put('educational services', 1.09)\n\t.put('egyptian', 1.09)\n\t.put('electricians', 1.09)\n\t.put('electronics', 1.1)\n\t.put('electronics repair', 1.1)\n\t.put('elementary schools', 1.1)\n\t.put('embassy', 1.11)\n\t.put('emilian', 1.11)\n\t.put('employment agencies', 1.11)\n\t.put('employment law', 1.12)\n\t.put('endodontists', 1.12)\n\t.put('estate planning law', 1.12)\n\t.put('ethiopian', 1.12)\n\t.put('ethnic food', 1.13)\n\t.put('ethic grocery', 1.13)\n\t.put('event photography', 1.14)\n\t.put('event planning & services', 1.14)\n\t.put('experiences', 1.14)\n\t.put('eyelash service', 1.14)\n\t.put('eyewear & opticians', 1.14)\n\t.put('fabric stores', 1.15)\n\t.put('family practice', 1.15)\n\t.put('farmers market', 1.15)\n\t.put('fashion', 1.15)\n\t.put('fasil music', 1.16)\n\t.put('fast food', 1.16)\n\t.put('ferries', 1.17)\n\t.put('fertility', 1.17)\n\t.put('festivals', 1.17)\n\t.put('filipino', 1.17)\n\t.put('video/film production', 6.82)\n\t.put('financial advising', 1.18)\n\t.put('financial services', 1.18)\n\t.put('fire departments', 1.18)\n\t.put('fireworks', 1.18)\n\t.put('first aid classes', 1.19)\n\t.put('fish & chips', 1.19)\n\t.put('fishing', 1.19)\n\t.put('flea markets', 1.19)\n\t.put('flight instruction', 1.19)\n\t.put('flooring', 1.19)\n\t.put('florists', 1.2)\n\t.put('flowers', 1.2)\n\t.put('flowers & gifts', 1.2)\n\t.put('fondue', 1.2)\n\t.put('food', 1.2)\n\t.put('food court', 1.21)\n\t.put('food delivery services', 1.21)\n\t.put('food stands', 1.21)\n\t.put('food trucks', 1.21)\n\t.put('formal wear', 1.21)\n\t.put('framing', 1.21)\n\t.put('free diving', 1.21)\n\t.put('french', 1.21)\n\t.put('french southwest', 1.22)\n\t.put('friterie', 1.22)\n\t.put('friulan', 1.22)\n\t.put('ice cream & frozen yogurt', 1.32)\n\t.put('fruits & veggies', 1.23)\n\t.put('fun fair', 1.23)\n\t.put('furniture reupholstery', 1.23)\n\t.put('furniture stores', 1.23)\n\t.put('fuzhou', 1.24)\n\t.put('galician', 1.24)\n\t.put('garage door services', 1.24)\n\t.put('gardeners', 1.24)\n\t.put('nurseries & gardening', 1.57)\n\t.put('gastroenterologist', 1.25)\n\t.put('gastropubs', 1.25)\n\t.put('gay bars', 1.25)\n\t.put('gelato', 1.25)\n\t.put('general dentistry', 1.25)\n\t.put('general festivals', 1.25)\n\t.put('general litigation', 1.25)\n\t.put('georgian', 1.26)\n\t.put('german', 1.26)\n\t.put('gerontologists', 1.27)\n\t.put('giblets', 1.27)\n\t.put('gift shops', 1.27)\n\t.put('gliding', 1.27)\n\t.put('gluten-free', 1.28)\n\t.put('go karts', 1.28)\n\t.put('golf', 1.28)\n\t.put('golf equipment', 1.28)\n\t.put('golf equipment shops', 1.28)\n\t.put('public services & government', 1.95)\n\t.put('gozleme', 1.28)\n\t.put('graphic design', 1.28)\n\t.put('greek', 1.28)\n\t.put('grocery', 1.29)\n\t.put('guest houses', 1.29)\n\t.put('gun/rifle ranges', 2.08)\n\t.put('guns & ammo', 1.29)\n\t.put('gymnastics', 1.29)\n\t.put('gyms', 1.3)\n\t.put('hair extensions', 1.3)\n\t.put('hair removal', 1.3)\n\t.put('hair salon for men', 1.3)\n\t.put('hair salons', 1.3)\n\t.put('hair stylists', 1.3)\n\t.put('haitian', 1.3)\n\t.put('hakka', 1.31)\n\t.put('halal', 1.31)\n\t.put('handyman', 1.32)\n\t.put('hang gliding', 1.33)\n\t.put('hardware stores', 1.33)\n\t.put('hats', 1.33)\n\t.put('hawaiian', 1.33)\n\t.put('health & medical', 1.33)\n\t.put('storefront clinic', 1.33)\n\t.put('health markets', 1.34)\n\t.put('hearing aid providers', 1.34)\n\t.put('hearing aids', 1.34)\n\t.put('heating & air conditioning/HVAC', 1.38)\n\t.put('henghwa', 1.34)\n\t.put('herbs & spices', 1.34)\n\t.put('hessian', 1.34)\n\t.put('middle schools and high schools', 1.54)\n\t.put('hiking', 1.34)\n\t.put('himalayan/nepalese', 1.35)\n\t.put('hindu temples', 1.35)\n\t.put('landmarks & historical buildings', 1.45)\n\t.put('hobby shops', 1.35)\n\t.put('hokkien', 1.35)\n\t.put('naturopathic/holistic', 1.605)\n\t.put('home & garden', 1.36)\n\t.put('home cleaning', 1.36)\n\t.put('home decor', 1.36)\n\t.put('home health care', 1.37)\n\t.put('home inspectors', 1.37)\n\t.put('home organization', 1.37)\n\t.put('home services', 1.37)\n\t.put('home staging', 1.37)\n\t.put('home theatre installation', 1.37)\n\t.put('home window tinting', 1.37)\n\t.put('hookah bars', 1.38)\n\t.put('horse boarding', 1.38)\n\t.put('horse racing', 1.38)\n\t.put('horseback riding', 1.38)\n\t.put('hospice', 1.39)\n\t.put('hospitals', 1.39)\n\t.put('hostels', 1.39)\n\t.put('hot air balloons', 1.39)\n\t.put('hot dogs', 1.4)\n\t.put('hot pot', 1.4)\n\t.put('hot tub & pool', 1.41)\n\t.put('hotel bar', 1.41)\n\t.put('hungarian', 1.41)\n\t.put('iberian', 1.42)\n\t.put('immigration law', 1.43)\n\t.put('indian', 1.43)\n\t.put('indonesian', 1.43)\n\t.put('indoor playcentre', 1.43)\n\t.put('fitness & instruction', 1.32)\n\t.put('insurance', 1.44)\n\t.put('interior design', 1.44)\n\t.put('internal medicine', 1.44)\n\t.put('international', 1.45)\n\t.put('internet cafes', 1.45)\n\t.put('internet service providers', 1.45)\n\t.put('investing', 1.45)\n\t.put('irish pub', 1.45)\n\t.put('irish', 1.45)\n\t.put('irrigation', 1.45)\n\t.put('isl& pub', 1.46)\n\t.put('israeli', 1.46)\n\t.put('it services & computer repair', 1.22)\n\t.put('italian', 1.47)\n\t.put('izakaya', 1.47)\n\t.put('japanese', 1.47)\n\t.put('jazz & blues', 1.47)\n\t.put('jewelry', 1.47)\n\t.put('jewelry repair', 1.47)\n\t.put('jewish', 1.47)\n\t.put('junk removal & hauling', 1.48)\n\t.put('karaoke', 1.48)\n\t.put('kebab', 1.49)\n\t.put('Keyword', 1.49)\n\t.put('kids activities', 1.5)\n\t.put('kiosk', 1.5)\n\t.put('kitchen & bath', 1.5)\n\t.put('kiteboarding', 1.5)\n\t.put('knitting supplies', 1.52)\n\t.put('korean', 1.52)\n\t.put('kosher', 1.52)\n\t.put('kurdish', 1.52)\n\t.put('laboratory testing', 1.53)\n\t.put('lactation services', 1.53)\n\t.put('lakes', 1.54)\n\t.put('landscape architects', 1.54)\n\t.put('landscaping', 1.55)\n\t.put('language schools', 1.55)\n\t.put('laos', 1.55)\n\t.put('laotian', 1.55)\n\t.put('laser eye surgery/lasik', 1.57)\n\t.put('laser hair removal', 1.57)\n\t.put('laser tag', 1.58)\n\t.put('latin american', 1.58)\n\t.put('lawn bowling', 1.59)\n\t.put('lawyers', 1.59)\n\t.put('leather goods', 1.59)\n\t.put('lebanese', 1.59)\n\t.put('leisure centers', 1.59)\n\t.put('libraries', 1.59)\n\t.put('life coach', 1.6)\n\t.put('lighting fixtures & equipment', 1.61)\n\t.put('ligurian', 1.62)\n\t.put('limos', 1.63)\n\t.put('linens', 1.63)\n\t.put('lingerie', 1.63)\n\t.put('live/raw food', 1.63)\n\t.put('local flavor', 1.63)\n\t.put('local services', 1.63)\n\t.put('keys & locksmiths', 1.57)\n\t.put('lounges', 1.64)\n\t.put('luggage', 1.64)\n\t.put('lumbard', 1.64)\n\t.put('lyonnais', 1.65)\n\t.put('magicians', 1.65)\n\t.put('makeup artists', 1.65)\n\t.put('malaysian', 1.66)\n\t.put('mamak', 1.67)\n\t.put('marching bands', 1.67)\n\t.put('market stalls', 1.67)\n\t.put('marketing', 1.68)\n\t.put('martial arts', 1.69)\n\t.put('masonry/concrete', 1.69)\n\t.put('mass media', 1.7)\n\t.put('massage', 1.7)\n\t.put('massage schools', 1.7)\n\t.put('massage therapy', 1.7)\n\t.put('matchmakers', 1.7)\n\t.put('maternity wear', 1.7)\n\t.put('mattresses', 1.71)\n\t.put('meat shops', 1.71)\n\t.put('meatballs', 1.71)\n\t.put('medical centers', 1.71)\n\t.put('medical spas', 1.71)\n\t.put('medical supplies', 1.72)\n\t.put('medical transportation', 1.72)\n\t.put('mediterranean', 1.72)\n\t.put('counseling & mental health', 6.93)\n\t.put('mexican', 1.73)\n\t.put('middle eastern', 1.74)\n\t.put('midwives', 1.75)\n\t.put('milk bars', 1.75)\n\t.put('mini golf', 1.75)\n\t.put('mobile clinics', 1.75)\n\t.put('mobile phone repair', 1.76)\n\t.put('mobile phones', 1.76)\n\t.put('modern australian', 1.76)\n\t.put('modern european', 1.77)\n\t.put('mongolian', 1.77)\n\t.put('moroccan', 1.78)\n\t.put('mortgage brokers', 1.78)\n\t.put('mosques', 1.78)\n\t.put('motorcycle dealers', 1.79)\n\t.put('motorcycle gear', 1.79)\n\t.put('motorcycle rental', 1.79)\n\t.put('motorcycle repair', 1.8)\n\t.put('mountain biking', 1.8)\n\t.put('movers', 1.8)\n\t.put('mulled wine', 1.82)\n\t.put('museums', 1.82)\n\t.put('music venues', 1.84)\n\t.put('musicians', 1.85)\n\t.put('nail salons', 1.86)\n\t.put('neurologist', 1.86)\n\t.put('new zeal&', 1.86)\n\t.put('newspapers & magazines', 1.14)\n\t.put('night food', 1.86)\n\t.put('nightlife', 1.86)\n\t.put('community service/non-profit', 1.42)\n\t.put('no keywords', 0.00)\n\t.put('northern german', 1.88)\n\t.put('notaries', 1.88)\n\t.put('nudist', 1.89)\n\t.put('nutritionists', 1.89)\n\t.put('nyonya', 1.89)\n\t.put('obstetricians & gynecologists', 1.9)\n\t.put('occupational therapy', 1.9)\n\t.put('office cleaning', 1.91)\n\t.put('office equipment', 1.91)\n\t.put('officiants', 1.92)\n\t.put('oil change stations', 1.92)\n\t.put('oncologist', 1.92)\n\t.put('open sandwiches', 1.92)\n\t.put('ophthalmologists', 1.93)\n\t.put('optometrists', 1.93)\n\t.put('oral surgeons', 1.94)\n\t.put('organic stores', 1.94)\n\t.put('oriental', 1.95)\n\t.put('orthodontists', 1.96)\n\t.put('orthopedists', 1.96)\n\t.put('osteopathic physicians', 1.96)\n\t.put('osteopaths', 1.98)\n\t.put('outdoor gear', 1.98)\n\t.put('outlet stores', 1.99)\n\t.put('paddleboarding', 1.99)\n\t.put('arroceria / paella', 1.27)\n\t.put('paintball', 2)\n\t.put('painters', 2)\n\t.put('pakistani', 2.02)\n\t.put('palatine', 2.02)\n\t.put('parent cafes', 2.02)\n\t.put('parking', 2.02)\n\t.put('parks', 2.05)\n\t.put('parma', 2.07)\n\t.put('party & event planning', 2.08)\n\t.put('party bus rentals', 2.1)\n\t.put('party equipment rentals', 2.1)\n\t.put('party supplies', 2.11)\n\t.put('pawn shops', 2.13)\n\t.put('pediatric dentists', 2.13)\n\t.put('pediatricians', 2.13)\n\t.put('performing arts', 2.14)\n\t.put('perfume', 2.16)\n\t.put('periodontists', 2.16)\n\t.put('permanent makeup', 2.19)\n\t.put('persian/iranian', 2.19)\n\t.put('personal assistants', 2.2)\n\t.put('personal chefs', 2.21)\n\t.put('personal injury law', 2.21)\n\t.put('personal shopping', 2.22)\n\t.put('peruvian', 2.23)\n\t.put('pest control', 2.23)\n\t.put('pet boarding/pet sitting', 2.25)\n\t.put('pet groomers', 2.24)\n\t.put('pet services', 2.26)\n\t.put('pet stores', 2.26)\n\t.put('pet training', 2.26)\n\t.put('pets', 2.26)\n\t.put('pharmacy', 2.28)\n\t.put('photographers', 2.29)\n\t.put('photography stores & services', 2.3)\n\t.put('physical therapy', 2.31)\n\t.put('piano bars', 2.31)\n\t.put('piercing', 2.33)\n\t.put('pierogis', 2.33)\n\t.put('pilates', 2.34)\n\t.put('pita', 2.35)\n\t.put('pizza', 2.35)\n\t.put('playgrounds', 2.36)\n\t.put('plumbing', 2.37)\n\t.put('plus size fashion', 2.38)\n\t.put('podiatrists', 2.38)\n\t.put('police departments', 2.38)\n\t.put('polish', 2.38)\n\t.put('pool cleaners', 2.39)\n\t.put('pool halls', 2.39)\n\t.put('pop-up shops', 2.4)\n\t.put('portuguese', 2.41)\n\t.put('post offices', 2.41)\n\t.put('potatoes', 2.42)\n\t.put('poutineries', 2.44)\n\t.put('preschools', 2.45)\n\t.put('pretzels', 2.5)\n\t.put('print media', 2.53)\n\t.put('printing services', 2.53)\n\t.put('private investigation', 2.54)\n\t.put('private schools', 2.56)\n\t.put('private tutors', 2.57)\n\t.put('proctologists', 2.58)\n\t.put('professional services', 2.58)\n\t.put('professional sports teams', 2.58)\n\t.put('property management', 2.59)\n\t.put('psychiatrists', 2.59)\n\t.put('pub food', 2.59)\n\t.put('public plazas', 2.6)\n\t.put('public relations', 2.61)\n\t.put('public transportation', 2.62)\n\t.put('pubs', 2.63)\n\t.put('puerto rican', 2.63)\n\t.put('pulmonologist', 2.64)\n\t.put('race tracks', 2.67)\n\t.put('radio stations', 2.69)\n\t.put('rafting/kayaking', 2.09)\n\t.put('ramen', 2.72)\n\t.put('real estate', 2.72)\n\t.put('real estate agents', 2.74)\n\t.put('real estate law', 2.74)\n\t.put('real estate services', 2.77)\n\t.put('record labels', 2.78)\n\t.put('recreation centers', 2.78)\n\t.put('recycling center', 2.79)\n\t.put('reflexology', 2.8)\n\t.put('registry office', 2.8)\n\t.put('rehabilitation center', 2.8)\n\t.put('recording & rehearsal studios', 2.80)\n\t.put('religious organizations', 2.84)\n\t.put('religious schools', 2.85)\n\t.put('resorts', 2.85)\n\t.put('restaurants', 2.85)\n\t.put('retirement homes', 2.86)\n\t.put('rhinelandian', 2.87)\n\t.put('rice', 2.87)\n\t.put('rock climbing', 2.89)\n\t.put('rolfing', 2.9)\n\t.put('roman', 2.9)\n\t.put('romanian', 2.9)\n\t.put('roofing', 2.92)\n\t.put('rotisserie chicken', 2.93)\n\t.put('rumanian', 2.93)\n\t.put('russian', 2.94)\n\t.put('rv dealers', 2.98)\n\t.put('rv parks', 2.99)\n\t.put('rv rental', 2.99)\n\t.put('sailing', 3)\n\t.put('salad', 3.01)\n\t.put('salvadoran', 3.03)\n\t.put('sandwiches', 3.04)\n\t.put('sardinian', 3.05)\n\t.put('saunas', 3.09)\n\t.put('scandinavian design', 3.1)\n\t.put('scandinavian', 3.12)\n\t.put('scottish', 3.14)\n\t.put('scuba diving', 3.16)\n\t.put('seafood', 3.16)\n\t.put('seafood markets', 3.17)\n\t.put('security services', 3.18)\n\t.put('security systems', 3.19)\n\t.put('self storage', 3.21)\n\t.put('senegalese', 3.22)\n\t.put('serbo croatian', 3.25)\n\t.put('session photography', 3.25)\n\t.put('sewing & alterations', 3.27)\n\t.put('shades & blinds', 3.31)\n\t.put('shanghainese', 3.32)\n\t.put('shared office spaces', 3.32)\n\t.put('shaved ice', 3.35)\n\t.put('shipping centers', 3.4)\n\t.put('shoe repair', 3.4)\n\t.put('shoe stores', 3.41)\n\t.put('shopping', 3.43)\n\t.put('shopping centers', 3.45)\n\t.put('sicilian', 3.46)\n\t.put('signature cuisine', 3.48)\n\t.put('singaporean', 3.48)\n\t.put('skate parks', 3.51)\n\t.put('skating rinks', 3.55)\n\t.put('ski resorts', 3.56)\n\t.put('skiing', 3.57)\n\t.put('skin care', 3.64)\n\t.put('skydiving', 3.65)\n\t.put('sleepwear', 3.66)\n\t.put('smog check stations', 3.7)\n\t.put('juice bars & smoothies', 2.60)\n\t.put('snow removal', 3.71)\n\t.put('soccer', 3.72)\n\t.put('social clubs', 3.74)\n\t.put('solar installation', 3.74)\n\t.put('soul food', 3.76)\n\t.put('soup', 3.78)\n\t.put('south african', 3.79)\n\t.put('southern', 3.79)\n\t.put('souvenir shops', 3.8)\n\t.put('spanish', 3.8)\n\t.put('special bikes', 3.83)\n\t.put('special education', 3.85)\n\t.put('specialty food', 3.86)\n\t.put('specialty schools', 3.91)\n\t.put('speech therapists', 3.97)\n\t.put('spin classes', 4.02)\n\t.put('spiritual shop', 4.03)\n\t.put('sport equipment hire', 4.03)\n\t.put('sporting goods', 4.14)\n\t.put('sports bars', 4.16)\n\t.put('sports clubs', 4.2)\n\t.put('sports medicine', 4.23)\n\t.put('sports wear', 4.25)\n\t.put('squash', 4.25)\n\t.put('stadiums & arenas', 4.32)\n\t.put('steakhouses', 4.41)\n\t.put('street art', 4.43)\n\t.put('street vendors', 4.45)\n\t.put('summer camps', 4.47)\n\t.put('surf shop', 4.5)\n\t.put('surfing', 4.55)\n\t.put('surgeons', 4.67)\n\t.put('sushi bars', 4.7)\n\t.put('swabian', 4.72)\n\t.put('swedish', 4.75)\n\t.put('swimming lessons/schools', 4.78)\n\t.put('swimming pools', 4.78)\n\t.put('swimwear', 4.81)\n\t.put('swiss food', 4.83)\n\t.put('synagogues', 4.84)\n\t.put('szechuan', 4.86)\n\t.put('screen printing/t-shirt printing', 4.03)\n\t.put('tabernas', 4.91)\n\t.put('tablao flamenco', 5)\n\t.put('tableware', 5.01)\n\t.put('tai chi', 5.02)\n\t.put('taiwanese', 5.11)\n\t.put('talent agencies', 5.19)\n\t.put('tanning', 5.2)\n\t.put('tapas bars', 5.22)\n\t.put('tapas/small plates', 5.32)\n\t.put('tattoo', 5.32)\n\t.put('tattoo removal', 5.32)\n\t.put('tax office', 5.34)\n\t.put('tax services', 5.34)\n\t.put('taxidermy', 5.41)\n\t.put('taxis', 5.46)\n\t.put('tea rooms', 5.47)\n\t.put('musical instruments & teachers', 3.68)\n\t.put('television service providers', 5.53)\n\t.put('television stations', 5.54)\n\t.put('tennis', 5.6)\n\t.put('teochew', 5.67)\n\t.put('teppanyaki', 5.71)\n\t.put('test preparation', 5.73)\n\t.put('tex-mex', 5.78)\n\t.put('thai', 5.84)\n\t.put('thrift stores', 5.97)\n\t.put('ticket sales', 5.97)\n\t.put('tickets', 6.02)\n\t.put('tires', 6.08)\n\t.put('tobacco shops', 6.12)\n\t.put('tours', 6.13)\n\t.put('towing', 6.15)\n\t.put('toy stores', 6.16)\n\t.put('trade fairs', 6.24)\n\t.put('traditional chinese medicine', 6.29)\n\t.put('traditional norwegian', 6.3)\n\t.put('traditional swedish', 6.36)\n\t.put('train stations', 6.46)\n\t.put('trainers', 6.58)\n\t.put('trampoline parks', 6.61)\n\t.put('translation services', 6.62)\n\t.put('transportation', 6.73)\n\t.put('hotels & travel', 4.17)\n\t.put('travel services', 7.05)\n\t.put('tree services', 7.07)\n\t.put('trinidadian', 7.08)\n\t.put('trophy shops', 7.16)\n\t.put('truck rental', 7.22)\n\t.put('tubing', 7.46)\n\t.put('turkish ravioli', 7.59)\n\t.put('turkish', 7.71)\n\t.put('tuscan', 7.91)\n\t.put('tutoring centers', 8.19)\n\t.put('ukrainian', 8.29)\n\t.put('uniforms', 8.43)\n\t.put('university housing', 8.44)\n\t.put('urgent care', 8.72)\n\t.put('urologists', 8.79)\n\t.put('used bookstore', 9.05)\n\t.put('used vintage & consignment', 9.07)\n\t.put('utilities', 9.24)\n\t.put('vacation rental agents', 9.69)\n\t.put('vacation rentals', 9.74)\n\t.put('vegan', 10.11)\n\t.put('vegetarian', 10.19)\n\t.put('venetian', 10.21)\n\t.put('venezuelan', 10.23)\n\t.put('venison', 10.38)\n\t.put('venues & event spaces', 10.93)\n\t.put('veterinarians', 11.12)\n\t.put('books, mags, music & video', 3.98)\n\t.put('videos & video game rental', 3.17)\n\t.put('videographers', 12.72)\n\t.put('vietnamese', 13.19)\n\t.put('vinyl records', 13.2)\n\t.put('vocational & technical school', 9.405)\n\t.put('walk-in clinics', 13.34)\n\t.put('watch repair', 13.92)\n\t.put('watches', 13.94)\n\t.put('water taxis', 14.04)\n\t.put('web design', 14.22)\n\t.put('wedding planning', 14.41)\n\t.put('weight loss centers', 14.81)\n\t.put('wholesale stores', 14.94)\n\t.put('wigs', 15.32)\n\t.put('window washing', 15.33)\n\t.put('windows installation', 16.39)\n\t.put('windshield installation & repair', 17.79)\n\t.put('wine bars', 27.79)\n\t.put('wineries', 29.67)\n\t.put('wok', 66.89); \n\treturn theMap; \n}", "title": "" }, { "docid": "11925a14673265b6b6d8affee0d1161e", "score": "0.46550754", "text": "function posSubCaseB (){\n// Subcase b:\n// exponentialValue() > fractionalPart().length\nif(xtract.exponentialValue(userEntry)>xtract.fractionalPart(userEntry).length) {\n// Test Case: +0012.3400e+5\n// Rule:\nconst originalSigFigsCnt=xtract.sigFiguresCount(userEntry) + xtract.leadingZeroesCount(userEntry) + (xtract.exponentialValue(userEntry) - xtract.fractionalPart(userEntry).length);\nreturn originalSigFigsCnt;}\nreturn '';}", "title": "" }, { "docid": "50610a55a8d9c988934ffe391b504f71", "score": "0.46512502", "text": "function calcLowerKgORBsa() {\n\n var currentCombo;\n\n\n for (var i = 0; i < allCombos.length; i++) {\n\n currentCombo = allCombos[i];\n\n currentCombo.m2OrKgLowerValue = currentCombo.lowerRoundValue / dosePerUnit;\n\n }\n }", "title": "" }, { "docid": "cd90bafd93ff6bf84b6693f718ad556f", "score": "0.46507418", "text": "function classify(sentence){\r\n\tvar highClass = \"none\";\r\n var highscore = 0;\r\n var score;\r\n mySet.forEach(function(current_value){\r\n\t\tscore = calculate_class_score_commonality(sentence, current_value);\r\n\t\tif (score > highscore) {\r\n\t\t\thighClass = current_value;\r\n\t\t\thighscore = score;\r\n\t\t}\r\n\t})\r\n var response_sentence;\r\n\tswitch (highClass) {\r\n \r\n case \" Cơ hội đậu \":\r\n response_sentence = \"Mình nghĩ mức điểm hằng năm không biến động nhiều. Nếu trên 16 điểm thì đừng quá lo lắng bạn nhé.\";\r\n break;\r\n\r\n case \" Chuẩn tiếng anh đầu vào \":\r\n response_sentence = \"Sau năm thứ nhất sinh viên được yêu cầu đạt chứng chỉ tiếng Anh TOEFL iBT 52 trở lên hoặc tương đương.\";\r\n break;\r\n\t//case \" ENGLISH IN \":\r\n // response_sentence = \"There is no requirements of English proficiency to enter our program. English is just an important factor to be considered in entrance examination.\";\r\n // break;\r\n\r\n case \" Có tiếng Anh rồi \":\r\n response_sentence = \"Có chứng chỉ rồi à... Mình sẽ trả lời bạn rõ hơn.\";\r\n break;\r\n\r\n case \" Chuẩn tiếng anh đầu ra \":\r\n response_sentence = \"Sinh viên chương trình tiên tiến Việt Mỹ tốt nghiệp với yêu cầu IELTS 6.0 trở lên bạn nhé! \";\r\n break;\r\n \r\n //case \" ENGLISH OUT \":\r\n // response_sentence = \"After the first year students are required to take the TOEFL iBT 52 or above certificate or equivalent English certificate. The curriculum is designed on a roadmap to help students improve their English proficiency. In foreign languages, they must have ability of level 4 or higher in accordance with the level of foreign language ability of Vietnam, or equivalent international certificate of TOEFL iBT 71, TOEFL PBT 530, IELTS 6.0.\";\r\n\t//\tbreak;\r\n\r\n //case \" EDUCATION \":\r\n // response_sentence = \"Well... You know our faculty has 5 training programs on automation, electronics and telecommunication. And you will not only study engineering but also other vital skills. More information are available at www.dut.udn.vn/fast\";\r\n // break;\r\n \r\n //case \" FACILITIES \":\r\n // response_sentence = \"We have a variaty of basic and specialized labs, such as General Electronics Lab, Microelectronics Fluke - Intel Computer Room and Cadence Chip Design - Texas Instrument Integrated Circuit and Instrumentation Laboratory and Research - Laboratory, research and development of intelligent robot technology - Laboratory of 3G and 4G National Instrument, R & S, AWR Library\";\r\n // break;\r\n case \" cơ sở vật chất \":\r\n response_sentence = \"Cơ sở vật chất có thể nói là hiện đại và đầy đủ nhất bạn nhé. Bạn có thể xem kỹ những thông tin về các phòng thực hành, phòng học, khu tự học và giải trí cũng như các thiết bị hiện đại tại đây: http://dut.udn.vn/Fast/Gioithieu/id/2654\";\r\n break;\r\n\r\n\t//case \" TUITION FEE \":\r\n // response_sentence = \"Tuition fee of two advanced programs is VND 10 million / student / semester. Each school year has 3 semesters and students pay tuition fees by semester.\";\r\n // break;\r\n case \" Học phí \":\r\n response_sentence = \"Mức học phí ở Chương trình Tiên tiến là 15 triệu đồng/1 sv/ 1 học kỳ. Còn mức học phí của PFIEV (Việt - Pháp) thì mình cập nhật sớm cho bạn nhé.\";\r\n break;\r\n\r\n //case \" ENTRANCE SCORE \":\r\n // response_sentence = \"For the year 2018, PFIEV = 15.23 || ECE = 15.3 || ES = 15.04. Please refer to the following link for more info: https://diemthi.tuyensinh247.com/diem-chuan/dai-hoc-bach-khoa-dai-hoc-da-nang-DDK.html\";\r\n // break;\r\n case \" Điểm chuẩn \":\r\n response_sentence = \"Điểm 2019 có thể tham khảo tại: https://diemthi.tuyensinh247.com/diem-chuan/dai-hoc-bach-khoa-dai-hoc-da-nang-DDK.html\";\r\n break;\r\n\r\n case \" Hình thức xét tuyển \":\r\n response_sentence = \"HÌnh thức xét tuyển xem chi tiết ở đây bạn nhé: http://dut.udn.vn/Fast/Gioithieu/id/2932\";\r\n break;\r\n\t\t\r\n\tcase \" Tính điểm \":\r\n response_sentence = \"Cách tính điểm quy về 3 môn thì cứ nhân hệ số xong rồi chia trung bình cộng là ra bạn nhé! Ví dụ lấy (Toán + Lý + Anh * 2) *3 / 4 là ra.\";\r\n break;\r\n\r\n case \" Ưu đãi \":\r\n response_sentence = \"Sinh viên có tổng điểm các môn thi từ 26,00 trở lên sẽ được hưởng ưu đãi. Ví dụ như học kỳ đầu tiên được miễn 100% học phí, hỗ trợ sinh hoạt phí 5 tháng. Các học kỳ sau đó sẽ tiếp tục được ưu đãi như học kỳ thứ nhất, nếu sinh viên duy trì được thành tích học tập Xuất sắc và kết quả rèn luyện Tốt.\";\r\n break;\r\n\t\t\r\n\tcase \" Nội dung đào tạo \":\r\n response_sentence = \"Khoa FAST đào tạo với 05 chương trình: Nhúng, Điện tử Viễn Thông, Công nghệ phần mềm, Sản xuất tự động, Tin học công nghiệp\";\r\n break;\r\n\t\t\r\n case \" Khả năng tiếng Anh \":\r\n response_sentence = \"Đừng lo lắng bạn à. Bạn sẽ có năm đầu tiên để học tiếng Anh và liên tục những năm sau đó nữa. Bạn thấy đấy, sinh viên khoa FAST nói tiếng Anh rất tốt.\";\r\n break;\r\n\r\n case \" Chỉ tiêu \":\r\n response_sentence = \"Chỉ tiêu tuyển sinh năm nay hiện chưa có dữ liệu bạn nhé. Năm 2018 thì như sau: ECE - 80 || ES - 40 || PFIEV - 100. Thông tin chi tiết bạn xem thêm tại http://dut.udn.vn/Tuyensinh2018/Gioithieu/id/2091\";\r\n break;\r\n\t\t\r\n\t case \" Điểm xét tuyển \":\r\n response_sentence = \" Điểm xét tuyển năm ngoái có thể xem ở đây: http://dut.udn.vn/fast\";\r\n break;\r\n\t\t\r\n\tcase \" Mức học bổng \":\r\n response_sentence = \" Mức học bổng cao lắm bạn à. Nghe là biết bạn học giỏi roài. *Wish* \";\r\n break;\r\n\t\r\n case \" Thời gian \":\r\n response_sentence = \"Thời gian có thể thay đổi. Bạn vui lòng đợi mình kiểm tra lại cho chắc chắn nhé.\";\r\n break;\r\n\t\t \r\n case \" Hồ sơ \":\r\n response_sentence = \"Liên quan đến hồ sơ giấy tờ thì bạn xem chi tiết tại: http://dut.udn.vn/Tintuc/Thongbao/id/3196\";\r\n break; \r\n\t \r\n case \" Việc làm \":\r\n response_sentence = \"Việc làm tốt lắm bạn. Viettel, Mobifone, Intel, eSilicon, Google, Facebook...\";\r\n break; \r\n\t \r\n case \" Du học \":\r\n response_sentence = \" Bạn xem chi tiết cơ hội du học của FAST ở đây nhé: www.dut.udn.vn/fast/\";\r\n break; \r\n\t \r\n\tcase \" Dự đoán điểm \":\r\n response_sentence = \" Khó quá bạn ơi. Nếu điểm không tăng thì sẽ giảm :))) \";\r\n break; \r\n\t\r\n\tcase \" Đề khó \":\r\n response_sentence = \"Đề năm nay cũng khó thật. Nhưng nước nổi thì bèo cũng nổi, khó thì khó chung mà.\";\r\n break;\r\n\t/////\r\n\t/////\r\n\tcase \" greeting \":\r\n response_sentence = \"Hello! I am FAST-Bot, how may I help you?\";\r\n break;\r\n\t\t\r\n case \" Chào hỏi \":\r\n response_sentence = \"Chào bạn, mình là FAST-Bot đến từ F.A.S.T. Mình có thể giúp gì cho bạn?\";\r\n break;\r\n\t\t\r\n //case \" ASK MORE \":\r\n response_sentence = \"You can ask me more about our faculty, such as tuition fee, facilities...\";\r\n break;\r\n\t\t\r\n case \" Hỏi tiếp \":\r\n response_sentence = \"Bạn có thể hỏi thêm nhiều vấn đề khác, mình có thể giải đáp giúp bạn. Chẳng hạn như điểm chuẩn năm ngoái, học phí...\";\r\n break;\r\n\r\n case \" NONSENSE \":\r\n response_sentence = \"You have a good sense of humor, don't you? :D \";\r\n break;\r\n\r\n case \" THANKS \":\r\n response_sentence = \"Don't mention it :)\";\r\n break;\r\n\t\t\r\n case \" Cảm ơn \":\r\n response_sentence = \"Không có gì đâu, giúp bạn là niềm vui của mình.\";\r\n break;\r\n\t\t\r\n case \" BYE \":\r\n response_sentence = \"Bye bye. Wish you a nice day!\";\r\n break;\r\n\t\t\r\n case \" Tạm biệt \":\r\n response_sentence = \"Chào bạn và chúc bạn một ngày tốt lành!\";\r\n break;\r\n\t\t\r\n case \" Cạn lời \":\r\n response_sentence = \"Speechless... Enjoy the sound of silience.\";\r\n break;\r\n\r\n case \" SLANG \":\r\n response_sentence = \"You're wasting your time :D\";\r\n break;\r\n\r\n case \" Không hiểu \":\r\n response_sentence = \"Bạn có thể hỏi ngắn gọn rõ ràng hơn không?\";\r\n break;\r\n\r\n case \" DONOT KNOW \":\r\n response_sentence = \"Pardon me. Can you again ask me more clearly?\";\r\n break;\r\n case \" FUN \":\r\n response_sentence = \"Don't make fun on me. I am still a child :( \";\r\n break;\r\n\r\n case \" HELP \":\r\n response_sentence = \"Sure, I am here to help you. Can you make it short so I can help you?\";\r\n break;\r\n case \" Giúp \":\r\n response_sentence = \"Chắc chắn rồi, mình ở đây để giúp bạn. Bạn có thể hỏi ngắn gọn hơn được không?\";\r\n break;\r\n case \" REASON \":\r\n response_sentence = \"I am not sure I can help you with this. Please wait for a short time.\";\r\n break;\r\n case \" Lý do \":\r\n response_sentence = \"Mình không chắc về câu trả lời. Mình sẽ gửi câu trả lời chính xác đến bạn sớm nhất có thể.\";\r\n break;\r\n case \" COMPLIMENT \":\r\n response_sentence = \"Thank you. I am still learning new things.\";\r\n break;\r\n case \" Khen \":\r\n response_sentence = \"Cảm ơn bạn nhiều. Mình còn học hỏi nhiều ở bạn nữa.\";\r\n break;\r\n\r\n case \" CONFIRM \":\r\n response_sentence = \"I am still learning and perfect myself but you can trust me.\";\r\n break;\r\n case \" Khẳng định \":\r\n response_sentence = \"Mình đang học hỏi và hoàn thiện bản thân nhưng bạn có thể tin mình.\";\r\n break;\r\n case \" An ủi \":\r\n response_sentence = \"Đừng lo quá bạn à. Tìm cách giải quyết là điều nên làm.\";\r\n break;\r\n\r\n case \" Chán \":\r\n response_sentence = \"Xem phim hoặc đọc sách yêu thích nào đó chẳng hạn.\";\r\n break;\r\n\r\n case \" BORED \":\r\n response_sentence = \"Read books, watch movie, or hang out with friends...will make you feel much better.\";\r\n break;\r\n\r\n case \" Đói \":\r\n response_sentence = \"Cơm đây cơm đây, ăn ngay kẻo đói :) \";\r\n break;\r\n\t \r\n case \" Khát \":\r\n response_sentence = \"Nước, nước đây!!! \";\r\n break;\r\n\t \r\n case \" Xàm xàm \":\r\n response_sentence = \"Bớt giỡn bạn ơi :( \";\r\n break;\r\n\tcase \" Hỏi thăm \":\r\n response_sentence = \"Mình vẫn khỏe, cảm ơn bạn <3 \";\r\n break;\r\n\t \r\n default:\r\n \t response_sentence = \"Xin lỗi, bạn hỏi rõ hơn được không? Hoặc vui lòng đợi tổ tư vấn nhé.\";\r\n}\r\n if (highscore < 0.01){\r\n \t response_sentence = \"Xin lỗi, bạn hỏi rõ hơn được không? Hoặc vui lòng đợi tổ tư vấn nhé.\";\r\n }\r\n\tconsole.log(\"sentence:\",sentence)\r\n\tconsole.log(\"class:\", highClass);\r\n\tconsole.log(\"score:\", highscore);\r\n console.log(response_sentence,\"\\n\");\r\n return (response_sentence);\r\n}", "title": "" }, { "docid": "5648f927d2352906f3f8ce6d896a1c5c", "score": "0.46272713", "text": "function automatedReadabilityIndex(letters, numbers, words, sentences) {\n    return (4.71 * ((letters + numbers) / words))\n        + (0.5 * (words / sentences))\n        - 21.43;\n}", "title": "" }, { "docid": "0b1a0a054ecc9a3c1957e7e8db5d7e61", "score": "0.46269324", "text": "function recommenderSensitivityValueListener() {\n var recommenderSensitivity = document.getElementById(\"recommenderSensitivity\");\n recommenderSensitivity.addEventListener(\"input\", function() {\n var newVal = recommenderSensitivity.value;\n chrome.storage.local.get(function(storage) {\n var cachedSettings = storage[\"cachedSettings\"];\n var oldSettings = storage[\"settings\"];\n if (!cachedSettings) {\n if (!oldSettings) {\n // Use default settings\n oldSettings = initialSettings;\n }\n cachedSettings = oldSettings;\n }\n\n cachedSettings[\"recommenderSensitivity\"] = newVal;\n var recommenderSensitivityVal = document.getElementById(\"recommenderSensitivityVal\");\n recommenderSensitivityVal.innerHTML = newVal;\n chrome.storage.local.set({ \"cachedSettings\": cachedSettings });\n });\n });\n}", "title": "" }, { "docid": "1c07c5107597f3182b5287f06ebc6763", "score": "0.46185362", "text": "function OR_AdmssnDueToRRT(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of\n //Number of ICU cases due to RRC\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Enter admission summary details - ICU admission due to RRC\n exestatus = Features.MvAdmissionSummary(TestName,exestatus);\n \n //Verify the number of ICU cases due to RRC\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfICUDueToRRC\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "46a035d29ded8034b3f2426f2157d025", "score": "0.4614213", "text": "function autov()\n{\n matrix= savematriz(1,matrizTranformacao);\n var values=numeric.eig(matrix._data);\n \n //console.log(values);\n var resu=\"\";\n for( var i=0;i<3;i++)\n {\n resu +=(\"O autovalor : \"+ math.round( values.lambda.x[i],2) +\"\\nPossui o autovetor : [\"+ math.round(values.E.x[0][i],2)+\",\"+ math.round(values.E.x[1][i],2)+\",\"+ math.round(values.E.x[2][i],2)+\"] \\n\");\n }\n alert(resu);\n}", "title": "" }, { "docid": "eae56da662de4adf7bcd785ea8d09451", "score": "0.45902652", "text": "function computeOrientationFunction() {\n\ttuning = [];\n\t// clgn_fr is the current lgn firing rates (16 array)\n\t// lweights is the current weights for each student, or just the current student\n\t// simply multiply these \n\tif (TA) {\n\t\tfor (var stud=0;stud<lweights.length;stud++) {\n\t\t\tcweights = lweights[stud];\n\n\t\t\tvar stuning = [];\n\t\t\tfor (var li=0;li<lgn_fr.length;li++) {\n\t\t\t\tstuning.push(dot(lgn_fr[li],cweights));\n\t\t\t}\n\t\t\ttuning.push(stuning);\n\t\t}\n\t} else {\n\t\tfor (var li=0;li<lgn_fr.length;li++) {\n\t\t\ttuning.push(dot(lgn_fr[li],lweights));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0f4c5a1d9812ef363764e48ce5efe8a2", "score": "0.45734403", "text": "function test_nominal_attribute(){\r\n\t\r\n\tconsole.log(\"test_nominal_attribute....\")\r\n\r\n\t\r\n\tvar myMap = new Map();\r\n\tmyMap.set(\"Nominal\", new Nominal([\"0\",\"1\",\"2\", \"3\", \"4\"]));\r\n\r\n\t//initialize\r\n\tvar similarityDist = new SimilarityDistanceClass(myMap);\r\n\r\n\tvar data = [ {\"Nominal\": \"1\"},\r\n\t\t\t\t {\"Nominal\": \"0\"},\r\n\t\t\t\t {\"Nominal\": \"1\"},\r\n\t\t\t\t {\"Nominal\": \"2\"},\r\n\t\t\t\t {\"Nominal\": \"3\"},\r\n\t\t\t\t {\"Nominal\": \"4\"},\r\n\t\t\t\t {\"Nominal\": -1}\r\n\t\t\t\t ];\r\n\t\r\n\tvar similarity_0_1 = similarityDist.compute(data[0], data[1]);\r\n\tvar similarity_0_2 = similarityDist.compute(data[0], data[2]);\r\n\tvar similarity_0_3 = similarityDist.compute(data[0], data[3]);\r\n\tvar similarity_0_4 = similarityDist.compute(data[0], data[4]);\r\n\tvar similarity_0_5 = similarityDist.compute(data[0], data[5]);\r\n\tvar similarity_0_6 = similarityDist.compute(data[0], data[6]); //with missing value\r\n\tvar similarity_6_0 = similarityDist.compute(data[6], data[0]); //with missing value\r\n\tvar similarity_6_6 = similarityDist.compute(data[6], data[6]); //with missing value\r\n\r\n\t//check that 1 is identical to 1\r\n\tassert(similarity_0_2 == 1.0);\r\n\t\r\n\t//check that 0 is same similar to 1 with 2\r\n\tassert(similarity_0_1 == similarity_0_3);\r\n\t\r\n\t//check that 0 is more similar to 1 than 3\r\n\tassert(similarity_0_1 == similarity_0_4);\r\n\r\n\t//check that 3 is more similar to 1 than 4\r\n\tassert(similarity_0_4 == similarity_0_5);\r\n\t\r\n\t\r\n\t//two missing values are identical\r\n\tassert(similarity_6_6 == 1.0);\r\n\t\r\n\t//distance with missing value is symmetric\r\n\tassert(similarity_0_6 == similarity_6_0);\r\n\t\r\n\t//check that 2 is more similar than missing value\r\n\tassert(similarity_0_1 == similarity_0_6);\r\n\t\r\n\tconsole.log(\"PASS\")\r\n}", "title": "" }, { "docid": "ae480d4a3506c0bb83da737f6814122b", "score": "0.45643315", "text": "function determination(data, x, y, uY, predict) {\n var SSE = 0,\n SST = 0;\n visitPoints(data, x, y, function (dx, dy) {\n var sse = dy - predict(dx),\n sst = dy - uY;\n SSE += sse * sse;\n SST += sst * sst;\n });\n return 1 - SSE / SST;\n}", "title": "" }, { "docid": "d0a6c718d66e7187592418791322c98a", "score": "0.45491904", "text": "function performScaling(reList){\n\tvar numReviews= reList.length;\n\tvar maxRelevance=0;\n\tfor(var i=0; i<numReviews; i++){\n\t\tif(reList[i]>maxRelevance){\n\t\t\tmaxRelevance=reList[i];\n\t\t}\n\t}\n\t\n\tfor(var i=0; i<numReviews; i++){\n\t\tvar scaledRelevance= (reList[i]/maxRelevance)*5;\n\t\treList[i]=scaledRelevance;\n\t}\n\t\t\n}", "title": "" }, { "docid": "bb6879fbe8328c4117b3c7e0eb1a90c2", "score": "0.45309323", "text": "function powerCalculation_vrms(sensitivity, volume_level, impedance) {\n\treturn 10 ** ((volume_level - (sensitivity - 10 * (Math.log(1000 / impedance)) / Math.log(10))) / 10)\n}", "title": "" }, { "docid": "431776e05de89777c43cc52a2d9189a1", "score": "0.4524147", "text": "function calculateViralityFactor(tweetCount, retweetCount) {\n var viralityFactor = 0;\n if(tweetCount !=0 ) {\n var battleTime = (endTime - startTime) / (1000 * 60);\n var tweetRate = (tweetCount / battleTime) / 100;\n var viralTimeFactor = (tweetRate > 1 ? 1 : tweetRate);\n var viralityFactor = Math.round((0.25 * (retweetCount / tweetCount) + 0.75 * viralTimeFactor) * 100);\n }\n return viralityFactor;\n}", "title": "" }, { "docid": "3ddb6afb85d31583fff3cff97641e126", "score": "0.45226848", "text": "get skewness(): number {\n return (Math.sqrt(2) * (this.a + this.b - 2 * this.c) * (2 * this.a - this.b - this.c) *(this.a + this.c - 2 * this.b)) / (5 * Math.pow(18 * this.variance, 1.5));\n }", "title": "" }, { "docid": "63c59258eadfc18ed17d925638462413", "score": "0.45219937", "text": "function svd(A) {\n var temp;\n//Compute the thin SVD from G. H. Golub and C. Reinsch, Numer. Math. 14, 403-420 (1970)\n\t//var prec= numeric.epsilon; //Math.pow(2,-52) // assumes double prec\n\tvar prec = 2.220446049250313e-16;\n var tolerance= 1.e-64/prec;\n\tvar itmax= 50;\n\tvar c=0;\n\tvar i=0;\n\tvar j=0;\n\tvar k=0;\n\tvar l=0;\n\t\n\t//var u= numeric.clone(A);\n\tvar u = U.matrix_copy(A);\n\n var m= u.length;\n\t\n\tvar n= u[0].length;\n\t\n\tif (m < n) throw \"Need more rows than columns\"\n\t\n\tvar e = new Array(n);\n\tvar q = new Array(n);\n\tfor (i=0; i<n; i++) e[i] = q[i] = 0.0;\n\tvar v = rep([n,n],0);\n//\tv.zero();\n\t\n \tfunction pythag(a,b)\n \t{\n\t\ta = Math.abs(a)\n\t\tb = Math.abs(b)\n\t\tif (a > b)\n\t\t\treturn a*Math.sqrt(1.0+(b*b/a/a))\n\t\telse if (b == 0.0) \n\t\t\treturn a\n\t\treturn b*Math.sqrt(1.0+(a*a/b/b))\n\t}\n\n\t//Householder's reduction to bidiagonal form\n\n\tvar f= 0.0;\n\tvar g= 0.0;\n\tvar h= 0.0;\n\tvar x= 0.0;\n\tvar y= 0.0;\n\tvar z= 0.0;\n\tvar s= 0.0;\n\t\n\tfor (i=0; i < n; i++)\n\t{\t\n\t\te[i]= g;\n\t\ts= 0.0;\n\t\tl= i+1;\n\t\tfor (j=i; j < m; j++) \n\t\t\ts += (u[j][i]*u[j][i]);\n\t\tif (s <= tolerance)\n\t\t\tg= 0.0;\n\t\telse\n\t\t{\t\n\t\t\tf= u[i][i];\n\t\t\tg= Math.sqrt(s);\n\t\t\tif (f >= 0.0) g= -g;\n\t\t\th= f*g-s\n\t\t\tu[i][i]=f-g;\n\t\t\tfor (j=l; j < n; j++)\n\t\t\t{\n\t\t\t\ts= 0.0\n\t\t\t\tfor (k=i; k < m; k++) \n\t\t\t\t\ts += u[k][i]*u[k][j]\n\t\t\t\tf= s/h\n\t\t\t\tfor (k=i; k < m; k++) \n\t\t\t\t\tu[k][j]+=f*u[k][i]\n\t\t\t}\n\t\t}\n\t\tq[i]= g\n\t\ts= 0.0\n\t\tfor (j=l; j < n; j++) \n\t\t\ts= s + u[i][j]*u[i][j]\n\t\tif (s <= tolerance)\n\t\t\tg= 0.0\n\t\telse\n\t\t{\t\n\t\t\tf= u[i][i+1]\n\t\t\tg= Math.sqrt(s)\n\t\t\tif (f >= 0.0) g= -g\n\t\t\th= f*g - s\n\t\t\tu[i][i+1] = f-g;\n\t\t\tfor (j=l; j < n; j++) e[j]= u[i][j]/h\n\t\t\tfor (j=l; j < m; j++)\n\t\t\t{\t\n\t\t\t\ts=0.0\n\t\t\t\tfor (k=l; k < n; k++) \n\t\t\t\t\ts += (u[j][k]*u[i][k])\n\t\t\t\tfor (k=l; k < n; k++) \n\t\t\t\t\tu[j][k]+=s*e[k]\n\t\t\t}\t\n\t\t}\n\t\ty= Math.abs(q[i])+Math.abs(e[i])\n\t\tif (y>x) \n\t\t\tx=y\n\t}\n\t\n\t// accumulation of right hand gtransformations\n\tfor (i=n-1; i != -1; i+= -1)\n\t{\t\n\t\tif (g != 0.0)\n\t\t{\n\t\t \th= g*u[i][i+1]\n\t\t\tfor (j=l; j < n; j++) \n\t\t\t\tv[j][i]=u[i][j]/h\n\t\t\tfor (j=l; j < n; j++)\n\t\t\t{\t\n\t\t\t\ts=0.0\n\t\t\t\tfor (k=l; k < n; k++) \n\t\t\t\t\ts += u[i][k]*v[k][j]\n\t\t\t\tfor (k=l; k < n; k++) \n\t\t\t\t\tv[k][j]+=(s*v[k][i])\n\t\t\t}\t\n\t\t}\n\t\tfor (j=l; j < n; j++)\n\t\t{\n\t\t\tv[i][j] = 0;\n\t\t\tv[j][i] = 0;\n\t\t}\n\t\tv[i][i] = 1;\n\t\tg= e[i]\n\t\tl= i\n\t}\n\t\n\t// accumulation of left hand transformations\n\tfor (i=n-1; i != -1; i+= -1)\n\t{\t\n\t\tl= i+1\n\t\tg= q[i]\n\t\tfor (j=l; j < n; j++) \n\t\t\tu[i][j] = 0;\n\t\tif (g != 0.0)\n\t\t{\n\t\t\th= u[i][i]*g\n\t\t\tfor (j=l; j < n; j++)\n\t\t\t{\n\t\t\t\ts=0.0\n\t\t\t\tfor (k=l; k < m; k++) s += u[k][i]*u[k][j];\n\t\t\t\tf= s/h\n\t\t\t\tfor (k=i; k < m; k++) u[k][j]+=f*u[k][i];\n\t\t\t}\n\t\t\tfor (j=i; j < m; j++) u[j][i] = u[j][i]/g;\n\t\t}\n\t\telse\n\t\t\tfor (j=i; j < m; j++) u[j][i] = 0;\n\t\tu[i][i] += 1;\n\t}\n\t\n\t// diagonalization of the bidiagonal form\n\tprec= prec*x\n\tfor (k=n-1; k != -1; k+= -1)\n\t{\n\t\tfor (var iteration=0; iteration < itmax; iteration++)\n\t\t{\t// test f splitting\n\t\t\tvar test_convergence = false\n\t\t\tfor (l=k; l != -1; l+= -1)\n\t\t\t{\t\n\t\t\t\tif (Math.abs(e[l]) <= prec)\n\t\t\t\t{\ttest_convergence= true\n\t\t\t\t\tbreak \n\t\t\t\t}\n\t\t\t\tif (Math.abs(q[l-1]) <= prec)\n\t\t\t\t\tbreak \n\t\t\t}\n\t\t\tif (!test_convergence)\n\t\t\t{\t// cancellation of e[l] if l>0\n\t\t\t\tc= 0.0\n\t\t\t\ts= 1.0\n\t\t\t\tvar l1= l-1\n\t\t\t\tfor (i =l; i<k+1; i++)\n\t\t\t\t{\t\n\t\t\t\t\tf= s*e[i]\n\t\t\t\t\te[i]= c*e[i]\n\t\t\t\t\tif (Math.abs(f) <= prec)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tg= q[i]\n\t\t\t\t\th= pythag(f,g)\n\t\t\t\t\tq[i]= h\n\t\t\t\t\tc= g/h\n\t\t\t\t\ts= -f/h\n\t\t\t\t\tfor (j=0; j < m; j++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\ty= u[j][l1]\n\t\t\t\t\t\tz= u[j][i]\n\t\t\t\t\t\tu[j][l1] = y*c+(z*s)\n\t\t\t\t\t\tu[j][i] = -y*s+(z*c)\n\t\t\t\t\t} \n\t\t\t\t}\t\n\t\t\t}\n\t\t\t// test f convergence\n\t\t\tz= q[k]\n\t\t\tif (l== k)\n\t\t\t{\t//convergence\n\t\t\t\tif (z<0.0)\n\t\t\t\t{\t//q[k] is made non-negative\n\t\t\t\t\tq[k]= -z\n\t\t\t\t\tfor (j=0; j < n; j++)\n\t\t\t\t\t\tv[j][k] = -v[j][k]\n\t\t\t\t}\n\t\t\t\tbreak //break out of iteration loop and move on to next k value\n\t\t\t}\n\t\t\tif (iteration >= itmax-1)\n\t\t\t\tthrow 'Error: no convergence.'\n\t\t\t// shift from bottom 2x2 minor\n\t\t\tx= q[l]\n\t\t\ty= q[k-1]\n\t\t\tg= e[k-1]\n\t\t\th= e[k]\n\t\t\tf= ((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y)\n\t\t\tg= pythag(f,1.0)\n\t\t\tif (f < 0.0)\n\t\t\t\tf= ((x-z)*(x+z)+h*(y/(f-g)-h))/x\n\t\t\telse\n\t\t\t\tf= ((x-z)*(x+z)+h*(y/(f+g)-h))/x\n\t\t\t// next QR transformation\n\t\t\tc= 1.0\n\t\t\ts= 1.0\n\t\t\tfor (i=l+1; i< k+1; i++)\n\t\t\t{\t\n\t\t\t\tg= e[i]\n\t\t\t\ty= q[i]\n\t\t\t\th= s*g\n\t\t\t\tg= c*g\n\t\t\t\tz= pythag(f,h)\n\t\t\t\te[i-1]= z\n\t\t\t\tc= f/z\n\t\t\t\ts= h/z\n\t\t\t\tf= x*c+g*s\n\t\t\t\tg= -x*s+g*c\n\t\t\t\th= y*s\n\t\t\t\ty= y*c\n\t\t\t\tfor (j=0; j < n; j++)\n\t\t\t\t{\t\n\t\t\t\t\tx= v[j][i-1]\n\t\t\t\t\tz= v[j][i]\n\t\t\t\t\tv[j][i-1] = x*c+z*s\n\t\t\t\t\tv[j][i] = -x*s+z*c\n\t\t\t\t}\n\t\t\t\tz= pythag(f,h)\n\t\t\t\tq[i-1]= z\n\t\t\t\tc= f/z\n\t\t\t\ts= h/z\n\t\t\t\tf= c*g+s*y\n\t\t\t\tx= -s*g+c*y\n\t\t\t\tfor (j=0; j < m; j++)\n\t\t\t\t{\n\t\t\t\t\ty= u[j][i-1]\n\t\t\t\t\tz= u[j][i]\n\t\t\t\t\tu[j][i-1] = y*c+z*s\n\t\t\t\t\tu[j][i] = -y*s+z*c\n\t\t\t\t}\n\t\t\t}\n\t\t\te[l]= 0.0\n\t\t\te[k]= f\n\t\t\tq[k]= x\n\t\t} \n\t}\n\t\t\n\t//vt= transpose(v)\n\t//return (u,q,vt)\n\tfor (i=0;i<q.length; i++) \n\t if (q[i] < prec) q[i] = 0\n\t \n\t//sort eigenvalues\t\n\tfor (i=0; i< n; i++)\n\t{\t \n\t//writeln(q)\n\t for (j=i-1; j >= 0; j--)\n\t {\n\t if (q[j] < q[i])\n\t {\n\t// writeln(i,'-',j)\n\t c = q[j]\n\t q[j] = q[i]\n\t q[i] = c\n\t for(k=0;k<u.length;k++) { temp = u[k][i]; u[k][i] = u[k][j]; u[k][j] = temp; }\n\t for(k=0;k<v.length;k++) { temp = v[k][i]; v[k][i] = v[k][j]; v[k][j] = temp; }\n//\t u.swapCols(i,j)\n//\t v.swapCols(i,j)\n\t i = j\t \n\t }\n\t }\t\n\t}\n\t\n\treturn {U:u,S:q,V:v}\n}", "title": "" }, { "docid": "492133110bd28cc65d110c536dd5e6f4", "score": "0.45208478", "text": "function negSubCaseB (){\n// Subcase b:\n// exponentialValue() > integerPart().length - trailingZeroesCount()\nif(xtract.exponentialValue(userEntry)>xtract.integerPart(userEntry).length - xtract.trailingZeroesCount(userEntry)) {\n// Test Case: +0012.3400e-3\n// Rule:\nconst originalSigFigsCnt=1 * xtract.sigFiguresCount(userEntry) + 1 * xtract.leadingZeroesCount(userEntry) + 1 * xtract.exponentialValue(userEntry) - 1 * (xtract.integerPart(userEntry).length - 1 * xtract.trailingZeroesCount(userEntry));\nreturn originalSigFigsCnt;}\nreturn ''}", "title": "" }, { "docid": "e650ba5b07f8b65030fb22e312185827", "score": "0.45169067", "text": "function adjustedCapital(anInstrument) {\n let result = 0;\n if (anInstrument.capital > 0) {\n if (anInstrument.interestRate > 0 && anInstrument.duration > 0) {\n result = (anInstrument.income / anInstrument.duration) * anInstrument.adjustmentFactor;\n }\n }\n return result;\n}", "title": "" }, { "docid": "a0bc23ffaaef69469d3ee84ea34e0555", "score": "0.45144597", "text": "function OR_KnownAllergyADRPrescriptionOverride(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of\n //Number of OR_KnownAllergyADRPrescriptionOverride\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Record known allergies\n exestatus = Features.MvRecordKnownAllergies(TestName,exestatus);\n \n //Administor the medicine which patient is allergic to\n exestatus = Features.MvAllergiesOR(TestName,exestatus);\n \n //Verify Allergy/ADR Prescription Override\n exestatus = Features.MvVerifyFinalOR(TestName, \"KnownAllergyADRPrescriptionOverride\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "3b71a2d8e48774b1de991d6ad13a72e9", "score": "0.45135075", "text": "function skillPtsToLevel( points, attLevel, difclty, baseAtt ) {\n// // e3 Eidetic Memory adjustment\n// if( document.loadedCharacter.hasTrait('EideticMemoryE3') && baseAtt=='IQ' /* no way in this context to check spell status */ ) {\n// points *= 2*document.loadedCharacter.getTrait('EideticMemoryE3').levels;\n// }\n// // two regimes, linear and exponential, joined at an inflection point\n// var inflectionPt = ( baseAtt=='IQ' ) ? 2 : 8;\t\t// 3rd edition rules\n// if( document.loadedCharacter.gameInfo.ruleset.match('e4') || difclty==3 ) { inflectionPt = 4; }\n// // deal with exponential case first\n// if( points<inflectionPt ) {\n// // inverse of formula below to calculate points from level (with att & dif as params)\n// // alert(\"skillPtsToLevel is returning \"+attLevel+' + Math.log('+points+')/Math.log(2) - '+difclty);\n// return attLevel + Math.floor( Math.log(points)/Math.log(2) ) - difclty;\n// }\n// // linear case\n// else {\n// var adj = Math.floor( Math.log(inflectionPt)/Math.log(2) ) - 1;\n// // alert(\"skillPtsToLevel is returning \"+attLevel+' + Math.floor('+points+'/'+inflectionPt+') - '+difclty+' + '+adj);\n// return attLevel + Math.floor(points/inflectionPt) - difclty + adj;\n// // return attLevel + Math.floor(points/inflectionPt) - difclty + 1;\n// }\n}", "title": "" }, { "docid": "069348f0c0437f5c57c5befc15401985", "score": "0.4512011", "text": "function exercise3(){\nconsole.log(\"EXERCISE 3 RESULTS\");\nconsole.log(priceGreaterThan(75));\nconsole.log(priceHeavierThan(1.8));\nconsole.log(transform());\n}", "title": "" }, { "docid": "77fab573aa6c0444ac8ef42cef18b694", "score": "0.45030335", "text": "function OR_MechanicallyVentilatedPatients(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the number of Mechanically Ventilated Patients and note the count of it.\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Validate Record Ventilation\n //exestatus = Features.MvRecordVentilation(TestName,exestatus);\n \n //Invasive ventilation only\n exestatus = Features.MvRecordInvasiveVentilation(TestName,exestatus);\n \n //Non-invasive ventilation only\n exestatus = Features.MvRecordNonInvasiveVentilation(TestName,exestatus);\n \n //Verify the number of ICU cases due to RRC\n exestatus = Features.MvVerifyFinalOR(TestName, \"MechanicallyVentilatedPatients\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "a1e02bc48c7f20d4d3bbfa6167344f9a", "score": "0.45025876", "text": "function OR_ReasonOfIntubation(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of\n //Number of Tracheostomies\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Add Unplanned extubation from - add clinical events\n exestatus = Features.MvAddSpecificClinicalEvent(TestName, \"Extubation (Unplanned)\", exestatus);\n \n //Add number of failed trial of NIV and failed extubations and Intubation\n exestatus = Features.MvTracheostomyTube(TestName, \"Tracheostomy (Percutaneous - Limited Dissection)\", exestatus);\n \n //Verify the Reason for Intubation\n exestatus = Features.MvVerifyFinalOR(TestName, \"ReasonOfIntubation\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "1c830660cc1de4b94bacc6be20693556", "score": "0.4499843", "text": "get skewness(): number {\r\n return 0;\r\n }", "title": "" }, { "docid": "807b381f76e9890b1b92e5651878d63b", "score": "0.4496981", "text": "function Prize() {}", "title": "" }, { "docid": "a8d446ae75d5af145514efbbae381361", "score": "0.44926763", "text": "get normalized() {\n return this.normalize();\n }", "title": "" }, { "docid": "1ca2b33e6f27f6a87643cd30815d5be6", "score": "0.44926172", "text": "Qa() {\r\n let f;\r\n if (this.SR() <= 4.71 * Math.pow(this.E / this.Fy, 0.5)) {\r\n f = Math.pow(0.658, this.Fy / this.Fe()) * this.Fy;\r\n } else {\r\n f = 0.877 * this.Fe();\r\n }\r\n\r\n if (this.WT.D_T >= 1.49 * Math.pow(this.E / f, 0.5)) {\r\n var be =\r\n 1.92 *\r\n this.WT.TW *\r\n Math.pow(this.E / f) *\r\n (1 - (0.34 / this.WT.BF_2TF) * Math.pow(this.E / f, 0.5));\r\n var Aeff = be * this.WT.TW + this.WT.BF * this.WT.TF;\r\n return Aeff / this.WT.A;\r\n } else {\r\n return 1;\r\n }\r\n }", "title": "" }, { "docid": "3e1266028ef414b667b75b4d3cb40bfb", "score": "0.44862115", "text": "function Stats() {\n this.counts = {\n pass:0,\n invalid:0,\n fail:0\n };\n this.shrinkCounts = {\n pass:0,\n invalid:0,\n fail:0\n };\n this.results = [];\n this.shrinkResults = [];\n\n /**\n * List of tags (created by calling Case.classify) with counts.\n * @field\n */\n this.tags = [];\n /**\n * Histogram of collected values (create by calling Case.collect)\n * @field\n */\n this.collected = null;\n\n this.addInvalid = function(args){\n this.counts.invalid++;\n this.results.push({result:'invalid', args:args});\n };\n this.addPass = function(args){\n this.counts.pass++;\n this.results.push({result:'pass', args:args});\n };\n this.addFail = function(args){\n this.counts.fail++;\n this.results.push({result:'fail', args:args});\n };\n this.addShrinkInvalid = function(args){\n this.shrinkCounts.invalid++;\n this.shrinkResults.push({result:'invalid', args:args});\n };\n this.addShrinkPass = function(args){\n this.shrinkCounts.pass++;\n this.shrinkResults.push({result:'pass', args:args});\n };\n this.addShrinkFail = function(args){\n this.shrinkCounts.fail++;\n this.shrinkResults.push({result:'fail', args:args});\n };\n\n this.addTags = function (ts) {\n var i, j, tag, found;\n\n for (i = 0; i < ts.length; i++) {\n tag = ts[i];\n found = false;\n for (j = 0; j < this.tags.length; j++) {\n if (this.tags[j][1] === tag) {\n found = true;\n this.tags[j][0] += 1;\n }\n }\n if (!found) {\n this.tags.push([1, tag]);\n }\n }\n };\n\n this.newResult = function (prop) {\n if (this.counts.pass > 0) {\n return new Pass(prop, this);\n } else {\n return new Invalid(prop, this);\n }\n };\n\n this.toString = function () {\n return '(pass=' + this.counts.pass + ', invalid=' + this.counts.invalid + ')';\n };\n }", "title": "" }, { "docid": "2abc718c71eb2edba6f5c7e2fd7f66f7", "score": "0.4484787", "text": "function compare(userReviews, reviewerObject) {\n var results = [];\n for (var reviewer in reviewerObject) {\n if (reviewerObject.hasOwnProperty(reviewer)) {\n var reviews = reviewerObject[reviewer];\n var k = Cohen.kappa(user, reviews, 5, 'linear');\n var numReviews = Object.keys(reviews).length;\n \n //console.log(reviewer + \": \" + JSON.stringify(reviews));\n \n var agreement = {'reviewer': reviewer, 'kappa': k, 'numReviews': numReviews};\n results.push(agreement);\n }\n }\n //console.log(\"In irr, in compare: \" + results);\n var returnVal = results.filter(function(rev) {\n return typeof rev.kappa === 'number';\n }).sort(function(a,b) {\n return b.kappa - a.kappa;\n });\n //console.log(returnVal.slice(0,5));\n return returnVal.slice(0,5); // returns the top five agreements;\n }", "title": "" }, { "docid": "5d07e662f707142fd70c3a4cb33c3a59", "score": "0.44777608", "text": "constructor(parent, sensitivity, side) {\n this.parent = parent;\n this.sensitivity = sensitivity;\n this.side = side;\n this.y = 0.5;\n }", "title": "" }, { "docid": "087622ecd1e2b516afeebb3df3170531", "score": "0.44765478", "text": "function _confidence (votes) {\n var n = votes.length,\n ups = votes.filter(function (vote) {\n return (vote.value > 0);\n });\n\n var z = 1.0;\n var phat = ups.length / n;\n return Math.sqrt(phat+z*z/(2*n)-z*((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n);\n }", "title": "" }, { "docid": "e3870bc4f633da99b231c3f5d044a30d", "score": "0.44722474", "text": "function predict() {\r\n classifier.predict(gotResults);\r\n}", "title": "" }, { "docid": "f1568db50341d7d7950ee2053dc2ba49", "score": "0.44699052", "text": "function gotResult(error, results) {\r\n // Display error in the console\r\n if (error) {\r\n console.error(error);\r\n } else {\r\n // The results are in an array ordered by confidence.\r\n console.log(results.value);\r\n //document.getElementById('label').innerHTML='Label: ' + results[0].label;\r\n //document.getElementById('score').innerHTML='Confidence: ' + nf(results[0].confidence, 0, 2);\r\n if(results.value>=0.5)\r\n document.getElementById('label').innerHTML=\"Right\";\r\n else\r\n document.getElementById('label').innerHTML=\"left\";\r\n predictor.predict(img, gotResult);\r\n }\r\n}", "title": "" }, { "docid": "4e64516de3f61183131654db6bf666fd", "score": "0.44642448", "text": "handleVerdict() {\n \n if (this.state.score <= this.state.quiz.questions.length / 2) {\n return 'SAD!';\n } else {\n return 'You are a pretty cool guy!';\n }\n\n }", "title": "" }, { "docid": "6110241a87d8724e45a8542aa480df51", "score": "0.44631746", "text": "get RnDQuality() {\n let quality = 0;\n let scoreBeforeAging;\n let agingImpact;\n // Getting R&D\n // Getting Major gives +6 points, getting Major is equal to getting Minor.\n switch (this.improvementResult) {\n case ENUMS.IMPROVEMENT_TYPE[ENUMS.IMPROVEMENT_TYPE.MINOR]:\n case ENUMS.IMPROVEMENT_TYPE[ENUMS.IMPROVEMENT_TYPE.MAJOR]:\n quality += 6;\n break;\n }\n // Implementation of R&D\n if (this.isImprovementsImplemented) {\n // Implementation of Major gives + 20 points\n // It is possible to leave a major improvement for so long that a second one is reported.\n // In this case when you do take one up, you automatically take both with an increased marketing effect.\n quality += (20 * this.notImplementedRnd.size());\n }\n // Aging process reduces quality estimate\n // depending on the absolute value, estimate is reduced each period.\n // The higher quality estimate of the product, the faster it becomes old.\n scoreBeforeAging = (this.lastRnDQuality + quality - 60) / 20;\n agingImpact = scoreBeforeAging > 0 ? Math.floor(scoreBeforeAging) + 4 : 0;\n quality -= agingImpact;\n quality += this.lastRnDQuality;\n return quality;\n }", "title": "" }, { "docid": "f91a5a2e6f4b80b9a63409ec613798ab", "score": "0.4458142", "text": "function Ssim() {}", "title": "" }, { "docid": "08a4c091450dd40c6c535771c0712e07", "score": "0.44572684", "text": "checkCorrectness(answer) {\n if (this.props.game.currentImage.bone.nameLatin.toLowerCase() === answer.toLowerCase()) {\n return 100\n } else {\n return 0\n }\n }", "title": "" }, { "docid": "4caa226a300f76d2d1583bedb5c971df", "score": "0.4456259", "text": "function crossNormalizeS1a(image) {\n // var precVV = image.select('VV').reduceRegion({\n // reducer: ee.Reducer.percentile([0,98]),\n // geometry: aoi,\n // scale: 10,\n // tileScale: 16,\n // maxPixels: 1e13\n // });\n // var precVH = image.select('VH').reduceRegion({\n // reducer: ee.Reducer.percentile([0,98]),\n // geometry: aoi,\n // scale: 10,\n // tileScale: 16,\n // maxPixels: 1e13\n // });\n \n // var imageVV = normalize(image, 'VV', precVV.get('VV_p0'), precVV.get('VV_p98'));\n // var imageVH = normalize(image, 'VH', precVH.get('VH_p0'), precVH.get('VH_p98'));\n \n var imageVV = normalize(image, 'VV', 0.0000187, 0.1643852); // p0 for whole Greece for S2 and S3\n var imageVH = normalize(image, 'VH', 0.0000066, 0.0301957); // p98 for whole Greece for S2 and S3\n \n var rescaled = imageVV.addBands(imageVH);\n \n return rescaled.copyProperties(image).set(interval, image.get(interval));\n }", "title": "" }, { "docid": "c18f7976dd1907a7fc0d6f658b16f708", "score": "0.44562557", "text": "calculateSiaPatterns(points) {\n //get all the vectors below the diagonal of the translation matrix\n var halfTable = this.vectorTable.map((col, i) => col.slice(i + 1));\n //transform into a list by merging the table's columns\n var vectorList = arrayutils_1.mergeSortedArrays(halfTable);\n //group by translation vectors\n var patternMap = this.groupByKeys(vectorList);\n //get the map's values\n return Object.keys(patternMap).map(key => patternMap[key]);\n }", "title": "" }, { "docid": "451b7d40668ef5139b72cdb37ddd7865", "score": "0.44478312", "text": "function getRSI (data, sensitivity=14, days=7) {\n var set = [];\n var rs;\n var averageGain;\n var averageLoss;\n var sumOfGains = 0;\n var sumOfLosses = 0;\n var lastValue;\n if (data.length > sensitivity) {\n lastValue = data[0][1];\n for (var i = 1; i < data.length; i++) {\n let thisValue = data[i][1]\n if (i < sensitivity) {\n if (thisValue > lastValue) {\n sumOfGains += thisValue - lastValue;\n }\n else if (thisValue < lastValue) {\n sumOfLosses += lastValue - thisValue;\n }\n }\n if (i >= sensitivity) {\n // First Average Gain = Sum of Gains over the past N periods / N\n // First Average Loss = Sum of Losses over the past N periods / N\n if (i === sensitivity) {\n averageGain = sumOfGains / sensitivity;\n averageLoss = sumOfLosses / sensitivity;\n }\n else {\n // Average Gain = [(previous Average Gain) * (N-1) + Current Gain] / N\n // Average Loss = [(previous Average Loss) * (N-1) - Current Loss] / N\n if (thisValue > lastValue) {\n averageGain = (averageGain * (sensitivity - 1) + (thisValue - lastValue)) / sensitivity;\n }\n else if (thisValue < lastValue) {\n averageLoss = (averageLoss * (sensitivity - 1) + (lastValue - thisValue)) / sensitivity;\n }\n }\n // RS = Average Gain / Average Loss\n // Should the averageLoss be zero, RS is 100 by definition.\n // RSI = 100 - 100 / (1 + RS)\n rs = Math.min(averageGain / averageLoss, 100);\n rsi = 100 - 100 / (1 + rs);\n set.push([data[i][0], rsi]);\n }\n lastValue = thisValue;\n }\n }\n return getRecentData(set, days);\n}", "title": "" }, { "docid": "18589bf4134328cbb564df6d84b3c967", "score": "0.4444374", "text": "function trsv (A, x, isLower) {\n var dot = blas1.dot;\n var n = A.shape[1];\n var i = 0;\n if (isLower) {\n x.set(0, x.get(0) / A.get(0, 0));\n for (i = 1; i < n; i++) {\n x.set(i, (x.get(i) - dot(A.pick(i, null).hi(i), x.hi(i))) / A.get(i, i));\n }\n } else {\n x.set(n - 1, x.get(n - 1) / A.get(n - 1, n - 1));\n for (i = n - 2; i >= 0; i--) {\n x.set(i, (x.get(i) - dot(A.pick(i, null).lo(i + 1), x.lo(i + 1))) / A.get(i, i));\n }\n }\n return true;\n}", "title": "" }, { "docid": "9fda29ba01746f95ff504ea57a8cf20c", "score": "0.44430035", "text": "function getSpecialScore( feat1, feat2 ) {\n var medianRent, medianCrime;\n medianRent = allRent.sort( function( a, b ){ return b-a })[ allRent.length / 2 ];\n medianCrime = allCrime.sort(function( a, b ){ return b-a })[ allCrime.length / 2 ];\n var medianVector = Math.pow(medianRent * medianRent + medianCrime * medianCrime,.5)\n var localVector = Math.pow(Math.pow(localCrime,4.2) + localRent * localRent,.5);\n var maxVector = Math.pow(maxCrime * maxCrime + maxRent * maxRent,.5);\n var result = Math.abs( (medianVector - localVector) / (medianVector - maxVector) );\n //console.log(result);\n return result;\n}", "title": "" }, { "docid": "0940fb18208c69d93b168e4626e509e1", "score": "0.44425896", "text": "function validateSpeechResponseLowerCase(response, expectedWords) {\n notEqual(response[\"recognition\"], undefined, \"recognition\");\n var recog = response[\"recognition\"];\n notEqual(recog[\"responseID\"], undefined, \"responseID\");\n var nb = recog[\"nbest\"];\n var nBestElement = nb.shift();\n var hyp = nBestElement[\"hypothesis\"];\n var expectedResultText = expectedWords.charAt(0).toUpperCase() + expectedWords.slice(1) + \".\";\n \n if (nBestElement) {\n equal(hyp, expectedWords, \"Expected Words\");\n notEqual(nBestElement[\"hypothesis\"], undefined, \"hypothesis\");\n notEqual(nBestElement[\"languageID\"], undefined, \"languageID\");\n equal(nBestElement[\"languageID\"], \"en-US\", \"American English\");\n notEqual(nBestElement[\"confidence\"], undefined, \"confidence\");\n notEqual(nBestElement[\"grade\"], undefined, \"grade\");\n //equal(nBestElement[\"grade\"], \"accept\", \"acceptable\");\n notEqual(nBestElement[\"resultText\"], undefined, \"resultText\");\n equal(nBestElement[\"resultText\"], expectedResultText, \"expected result text\");\n notEqual(nBestElement[\"words\"].shift(), undefined, \"words\");\n notEqual(nBestElement[\"wordScores\"].shift(), undefined, \"wordScores\");\n }\n}", "title": "" }, { "docid": "a9ca57308908616d041b23d24b1c60e3", "score": "0.44388238", "text": "fittest() {\n let currentFitness = this.chromosomes[0].calculateFitness(),\n f = 0,\n currentBestIndex = 0;\n this.chromosomes.forEach((chromosome, index) => {\n if (index == 0) return;\n f = chromosome.calculateFitness();\n if (f > currentFitness) {\n currentFitness = f;\n currentBestIndex = index;\n }\n });\n this.bestChromosomeIndex = currentBestIndex;\n return this;\n }", "title": "" }, { "docid": "26275022be9b0d4bacbda15261e73b37", "score": "0.44327304", "text": "normalize_() {\n return this.scale_(1 / this.l2());\n }", "title": "" }, { "docid": "8f4e649f6f35c78bcf21aef5f93041c5", "score": "0.44312117", "text": "function similarityScore(patientID, subjectID, knnAttributes) {\r\n let score = 0;\r\n let outOf = 1;\r\n\r\n // console.log(knnAttributes)\r\n \r\n //giving error \r\n // if(self.patients[patientID].AgeAtTx && self.patients[subjectID].AgeAtTx){\r\n // let tieBreaker = -(Math.abs(self.patients[patientID].AgeAtTx - self.patients[subjectID].AgeAtTx)) / 150; // max age diff - 150\r\n\r\n // score += tieBreaker;\r\n\r\n // }\r\n\r\n let tieBreaker = -(Math.abs(self.patients[patientID].AgeAtTx - self.patients[subjectID].AgeAtTx)) / 150; // max age diff - 150\r\n\r\n score += tieBreaker;\r\n \r\n\r\n for (let attribute of knnAttributes) {\r\n // console.log(patientID, self.patients[patientID][axes[attribute].name] === self.patients[subjectID][axes[attribute].name]);\r\n if (self.patients[patientID][self.axes[attribute].name] === self.patients[subjectID][self.axes[attribute].name]) {\r\n score += 1;\r\n }\r\n if (self.patients[patientID][self.axes[attribute].name] != \"N/A\" && self.patients[subjectID][self.axes[attribute].name]!= \"N/A\" ) {\r\n outOf += 1;\r\n }\r\n }\r\n // let twoDecimalScore = score.toFixed(2)\r\n let percentage = (score / outOf) * 100;\r\n // let twoFix = percentage.toFixed(2);\r\n // let result = percentage.toFixed(2) + \" %\"\r\n\r\n // result = score + \" / \" + outOf\r\n return percentage;\r\n }", "title": "" }, { "docid": "5b5de18dc7c237b3b938c60c33f60a85", "score": "0.4429952", "text": "function OnRackingDamageToWallsOtherStructuralDamage_Change( e )\r\n{\r\n try\r\n {\r\n var newRapidEvaluationValue = Alloy.Globals.replaceCharAt( 2 , Alloy.Globals.ATC20ModeRapidEvaluation[\"EVALUATION\"] , e.id ) ;\r\n Alloy.Globals.ATC20ModeRapidEvaluation[\"EVALUATION\"] = newRapidEvaluationValue ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "title": "" }, { "docid": "0adb8c08d8cc8a235c21dd4cae1e5da0", "score": "0.44264868", "text": "function stressScore(sa,sb){\n if (sa.stressed && sb.stressed){\n return 0.75;\n } else if (sa.stressed || sb.stressed) {\n return 0.5;\n } else {\n return 0.25;\n }\n }", "title": "" }, { "docid": "05b93579156608feeec753908396ef2d", "score": "0.44258037", "text": "function isCaseSensitive() {\n return document.getElementById(\"caseSensitive\").checked;\n}", "title": "" }, { "docid": "e772cc0cc167a5ac39876349ae198a3e", "score": "0.44182456", "text": "function getSurfabilityArray(origDataObj,level) {\n \n var dataObj=origDataObj;\n\n /* if(includeDummyData === true){\n dataObj=addDummyDataToDataset(origDataObj);\n }; */\n\n console.log(dataObj);\n\n const unsurfable=1.5; //waveheight\n const beginner_max = 2.0;\n const intermediate_max=4.0;\n \n var surfable=false;\n var surfableArray=[];\n var isWindOK=false;\n var isWindDirOK=false;\n var isSwellOK=true;\n // check wind direction (SW, S or W, NW above 15knots = 28km/hr means not surfable)\n $.each(dataObj,function(index){\n \n //Check wind direction\n var wind_directions=dataObj[index].wind_direction_texts;\n const poorwindsDirections=['S','SSW','SW','WSW','W'];\n\n if(poorwindsDirections.indexOf(wind_directions[0])<0 && poorwindsDirections.indexOf(wind_directions[1])<0 && poorwindsDirections.indexOf(wind_directions[2])<0){\n isWindDirOK=true;\n };\n \n //Check wind speed (<15 knots or 27.78 km/hr)\n if (dataObj[index].wind_speeds[0]<28){\n isWindOK=true;\n }; \n\n //check swell max height(<1.5m means not surfable)\n //Maximum height depends on level\n var swell_height=dataObj[index].swell_heights[2];\n console.log({swell_height});\n if(swell_height<unsurfable){\n isSwellOK=false;\n } else if (level === 'beginner' && swell_height > beginner_max) {\n isSwellOK=false;\n } else if (level === 'intermediate' && swell_height > intermediate_max) {\n isSwellOK=false;\n } else {\n isSwellOK=true;\n };\n \n //Surfable assessment\n if(isWindDirOK && isWindOK && isSwellOK){\n surfable=true;\n } else surfable=false;\n surfableArray.push(surfable);\n })\n return surfableArray;\n }", "title": "" }, { "docid": "4583893bae55e6d7241875299f8e16ea", "score": "0.44141805", "text": "function analyse(actual, predicted) {\n console.log('analyse')\n return actual.reduce((samples, tone, i) => {\n samples[tone -1][predicted[i] -1]++;\n return samples\n }, [...new Array(5)].map(() => new Array(5).fill(0)))\n}", "title": "" }, { "docid": "65d013f91b706ff0989c89cf2316162d", "score": "0.4409474", "text": "function $$route$recognizer$$sortSolutions(states) {\n return states.sort(function (a, b) {\n return b.specificity.val - a.specificity.val;\n });\n }", "title": "" }, { "docid": "103470ee92fa2f77ca04b2a4655acca6", "score": "0.4407491", "text": "function OR_MROinICU(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of\n //Number of MRO in ICU\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU \n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Update the patient to have developed MROs in ICU\n exestatus = Features.MVAlertsAndIsolationRequirements(TestName,exestatus);\n \n //Verify the number of MRO in ICU\n exestatus = Features.MvVerifyFinalOR(TestName, \"MROinICU\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "47696209b346f5a7c18497e8220c3ae9", "score": "0.44068727", "text": "naturalSelection() {\n // let maxFitness = 0;\n this.matingPool = [];\n\n // Find the highest fitness value in the population\n // this.population.forEach(member => {\n // maxFitness = member.fitness > maxFitness ? member.fitness : maxFitness;\n // });\n\n // Based on fitness, each member is added to the mating pool a weighed number of times\n // higher fitness = more instance in pool = more likely to be picked as a parent\n // lower fitness = less instance in pool = less likely to be picked as a parent\n // this.population.forEach(member => {\n // const fitness = util.map(member.fitness, 0, maxFitness, 0, 1);\n \n // // Arbitrary multiplier\n // // let n = Math.floor(fitness * 50);\n // let n = Math.floor(fitness / 100);\n\n // for ( ; n >= 0; n--) {\n // // console.log('member.fitness ', member.fitness, ' > cutoff ', maxFitness * 0.75);\n // if (member.fitness > this.lowestFitness * 1.25) {\n // // console.log('IN')\n // this.matingPool.push(member);\n // }\n // }\n // });\n\n this.matingPool = this.population;\n this.removeLowestFitnessFromPool();\n }", "title": "" }, { "docid": "71127895eb9ee684317cadf46abe9299", "score": "0.44068718", "text": "function normalizeAnswers(data) {\n\treturn data.toString().toLowerCase()\n}", "title": "" }, { "docid": "18d88aaf0e6dd4ca7abf466606b60464", "score": "0.44030526", "text": "function utdpcalc(){\n var ut= {\n engahl:[3,4],\n engasl:[3,4], //same class as hl\n spanasl: [6,4],\n spanahl: [27,5,\"SPN 601D, 611D, 312L, 327W, 327C\",18,4,\"SPN 601D, 610D, 611D\",22,5,\"SPN 506, 507, 312K, 312L, 327W, 327C\",16,4,\"506,507, 312K, 312L\"], //diff course qualification for same score given option\n spanab: [0, 0],\n spansl: [ 10,4],\n spanhl: [16,4,\"SPN 506, 508K, 312K, 312L\",18,4,\"SPN 601D, 610D, 611D\"], //diff course qualification for same score given option\n frenchab: [0, 0],\n frenchsl: [12,4],\n frenchhl: [24,6,21,4,5],\n italab: [0, 0],\n italsl: [6,4],\n italhl: [21,4,12,3,6,2],\n germab: [0,0],\n germsl: [10,4],\n sssl: [0,0,3,4],\n sshl: [3,4],\n biosl: [3,4],\n biohl: [3,4,5,6],\n chemsl: [3,4],\n chemhl: [6,9,5],\n physl: [4,4],\n phyhl: [14,5,4,4],\n cssl: [3,4],\n cshl: [3,4], //diff class qualification than sl\n mstudiessl: [3,4,\"M 302\"], //diff class qualification than math sl\n mathsl: [3,4,\"M 305G\"],\n mathhl: [4,5,\"408C\",4,4,\"408K\"], //diff class from 4 score and 5+ score\n fumath: [7,4],\n va: [3,4],\n msl: [0,0],\n mhl: [3,4],\n th: [3,4]\n };\n\n\n\n\nfunction ll(){\n console.log(\"ll3: \" + llCourse);\n if (llCourse == \"English A: Literature SL\"|| llCourse == \"English A: Language and Literature SL\"){\n if (llCred >= ut.engasl[1]){\n llCredit = ut.engasl[0];\n }\n else if (llCred<ut.engasl[1]){\n llCredit = 0;\n }\n else {\n llCredit = \"no input\";\n}\n}\n\n else if (llCourse == \"English A: Literature HL\"|| llCourse == \"English A: Language and Literature HL\"){\n if (llCred >= ut.engahl[1]){\n llCredit = ut.engahl[0];\n }\n else if (llCred<ut.engahl[1]){\n llCredit = 0;\n }\n else {\n llCredit = \"no input\"\n }\n }\n else if (llCourse == \"Spanish A: Literature SL\"|| llCourse == \"Spanish A: Language and Literature SL\"){\n if (llCred >= ut.spanasl[1]){\n llCredit = ut.spanasl[0];\n }\n else if (llCred < ut.spanasl[1]){\n llCredit = 0;\n }\n else {\n llCredit = \"no input\"\n }\n }\n else if (llCourse == \"Spanish A: Literature HL\"|| llCourse == \"Spanish A: Language and Literature HL\"){\n if (llCred >= ut.spanahl[1]){\n llCredit = ut.spanahl[0] + \" or \" + ut.spanahl[6];\n llCommentary = \"The 27 credits: \" + ut.spanahl[2] + \". The 22 credits: \" + ut.spanahl[8];\n }\n else if (llCred == ut.spanahl[4]){\n console.log(\"rawr\")\n llCredit = ut.spanahl[3] + \" or \" + ut.spanahl[9];\n console.log(llCredit)\n llCommentary = \"The 18 credits: \" + ut.spanahl[5] + \".\" + \" The 16 credits: \" + ut.spanahl[11];\n }\n else if (llCred < ut.spanahl[4]){\n llCredit = 0;\n }\n else {\n llCredit = \"no input\"\n }\n }\n}\n//lang lit 1st input\nllCourse = document.getElementById(\"langlit\").value;\nllCred = document.getElementById(\"llscore\").value;\ndocument.getElementById(\"llcourse\").innerHTML = llCourse;\ndocument.getElementById(\"lltest\").innerHTML = llCred;\nconsole.log(llCourse)\nconsole.log(llCred)\n if (llCred !== \" \"){\n ll();\n console.log(llCredit)\n document.getElementById(\"llcredit\").innerHTML = llCredit;\n document.getElementById(\"llcommentary\").innerHTML = llCommentary;\n}\nllCourse = \" \";\nllCred = \" \";\nllCredit = \" \";\nllCommentary = \" \";\n\n\n//lang lit 2nd input\nllCourse = document.getElementById(\"langlit2\").value;\nllCred = document.getElementById(\"llscore2\").value;\nif (llCourse !== \" \"){\ndocument.getElementById(\"llcourse2\").innerHTML = llCourse;\ndocument.getElementById(\"lltest2\").innerHTML = llCred;\n if (llCred !== \" \"){\n \t ll();\n\t document.getElementById(\"llcredit2\").innerHTML = llCredit;\n\t document.getElementById(\"llcommentary2\").innerHTML = llCommentary;\n}\nllCourse = \" \";\nllCred = \" \";\nllCredit = \" \";\nllCommentary = \" \";\n}\n\n\n\n\nutMI()\n}", "title": "" }, { "docid": "8f4c24ba9f895f68cb7885dfd00f154b", "score": "0.43995127", "text": "function solve(testCase) {\n\n return \"IMPOSSIBLE\";\n}", "title": "" }, { "docid": "4879a03def7527e69b8a141b7bc8f16f", "score": "0.43966344", "text": "function OR_SUMMARY01(TestName)\n{\n var exestatus = true;\n var browser;\n \n //Login\n exestatus = Features.MvLogin(TestName,exestatus);\n \n //Admit a patient in ICU - this is required to load the correct department in Operational reports\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Launch the operational reports\n exestatus = Features.MvLaunchOperationalReports(TestName, browser, exestatus);\n \n //Launch the summary report and note the previous counts of\n //Number of Admissions \n //Number of ICU Admissions \n //Number of HDU Admissions \n //Number of CCU Admissions \n //Number of Undocumented Admissions \n //Number of Patients \n //Number of ICU Deaths\n exestatus = Features.MvExtractInitialOpReports(TestName, browser, exestatus);\n \n //Admit a patient in ICU - to check admission count is increased\n exestatus = Features.MvPatientRegister(TestName,exestatus);\n \n //Verify the number of Admissions - OR = Operational reports\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfAdmissions\" ,exestatus);\n \n //Verify the number of Undocumented admissions\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfUndocAdmissions\" ,exestatus);\n \n //Enter admission summary details - default to ICU\n exestatus = Features.MvAdmissionSummary(TestName,exestatus);\n \n //Verify the number of ICU admissions\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfICUAdmissions\" ,exestatus);\n \n //Change the type of care to HDU\n exestatus = Features.MvChangeTypeOfAdmission(TestName, \"HDU\", exestatus)\n \n //Verify the number of HDU admissions\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfHDUAdmissions\" ,exestatus);\n \n //Change the type of care to CCU\n exestatus = Features.MvChangeTypeOfAdmission(TestName, \"CCU\", exestatus)\n \n //Verify the number of CCU admissions\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfCCUAdmissions\" ,exestatus); \n \n //Fill discharge summary as died and then release the patient\n exestatus = Features.MVMedicalDischargeSummary(TestName,exestatus);\n exestatus = Features.MvReleasePatient(TestName,exestatus);\n \n //Verify the number of ICU deaths\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfICUDeaths\" ,exestatus);\n \n //Verify the number of Patients\n exestatus = Features.MvVerifyFinalOR(TestName, \"numberOfPatients\" ,exestatus);\n \n //Logout\n exestatus = Features.MvLogout(TestName,exestatus);\n \n //Close the browser after report is verified\n exestatus = Features.MvBrowserLogout(TestName, browser, exestatus);\n}", "title": "" }, { "docid": "456d940db8cf46bea5ab9cba1319fa24", "score": "0.43929723", "text": "function predict(data,weight){\n let f = 0;\n // It is indeed feature importance'\n // 1) IP 2) URL_L 3)Tiny 4)@symbol 5)// 6) Pre-Suf 7)Subdo 8)SSL 9)favicon 10)port 11)HTTPS 12)request 13)urlAnc 14) links 15)SFh 16)Sub2email, 17)Iframe\n weight = [0.013788, 0.012826, 0.007719, 0.007658, 0.005637, 0.054063, 0.067220, 0.398514, 0.007717, 0.003685, 0.006968, 0.025216, 0.302614, 0.051036, 0.024597, 0.006438, 0.004302];\n for (let i = 0; i< data.length; i++){\n console.log(data[i]);\n f += data[i] * weight[i];\n console.log('The added weights for \\n',f);\n // alert(Math.max(...weight));\n }\n console.log(f);\n \n f > 0 ? console.log('Phishing'): console.log('Not Phishing');\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator\n\n\n return f > 0 ? 1: -1; // IF F IS GREATER THAN 0 THAN IT IS PHISH IF NOT THEN WE ARE GOOD TO GO\n}", "title": "" }, { "docid": "412113c622237f9be71972e85b5a1867", "score": "0.43883315", "text": "calcRating() {\n let allyRating = this.allyRating;\n let totalXP = this.totalXP;\n let combatDifficulty = \"trivial\";\n\n Object.keys(allyRating).forEach(function(key) {\n let threshold = allyRating[key];\n if (totalXP >= threshold) {\n combatDifficulty = key;\n }\n });\n\n this.combatDifficulty = combatDifficulty;\n }", "title": "" }, { "docid": "8b67b2fa258d9da21da2bfdc125124d0", "score": "0.43874815", "text": "function test_numeric_attribute(){\r\n\t\r\n\tconsole.log(\"test_numeric_attribute....\")\r\n\t\t\r\n\tvar myMap = new Map();\r\n\tmyMap.set(\"Numeric\", new Numeric(20.0, 0.0));\r\n\r\n\t//initialize\r\n\tvar numericSimilarityDistance = new SimilarityDistanceClass(myMap);\r\n\r\n\tvar data = [ {\"Numeric\": 5},\r\n\t\t\t\t {\"Numeric\": 2},\r\n\t\t\t\t {\"Numeric\": 5},\r\n\t\t\t\t {\"Numeric\": 8},\r\n\t\t\t\t {\"Numeric\": 9},\r\n\t\t\t\t {\"Numeric\": 20},\r\n\t\t\t\t {\"Numeric\": -1}\r\n\t\t\t\t ];\r\n\t\r\n\tvar similarity_0_1 = numericSimilarityDistance.compute(data[0], data[1]);\r\n\tvar similarity_0_2 = numericSimilarityDistance.compute(data[0], data[2]);\r\n\tvar similarity_0_3 = numericSimilarityDistance.compute(data[0], data[3]);\r\n\tvar similarity_0_4 = numericSimilarityDistance.compute(data[0], data[4]);\r\n\tvar similarity_0_5 = numericSimilarityDistance.compute(data[0], data[5]);\r\n\tvar similarity_0_6 = numericSimilarityDistance.compute(data[0], data[6]); //with missing value\r\n\tvar similarity_6_0 = numericSimilarityDistance.compute(data[6], data[0]); //with missing value\r\n\tvar similarity_6_6 = numericSimilarityDistance.compute(data[6], data[6]); //with missing value\r\n\t\r\n\r\n\t//check that 5 is identical to 5\r\n\tassert(similarity_0_2 == 1.0);\r\n\t\r\n\t//check that 2 is same similar to 5 with 8\r\n\tassert(similarity_0_1 == similarity_0_3);\r\n\t\r\n\t//check that 2 is more similar to 5 than 9\r\n\tassert(similarity_0_1 > similarity_0_4);\r\n\r\n\t//check that 9 is more similar to 5 than 20\r\n\tassert(similarity_0_4 > similarity_0_5);\r\n\t\r\n\t\r\n\t//two missing values are identical\r\n\tassert(similarity_6_6 == 1.0);\r\n\t\r\n\t//distance with missing value is symmetric\r\n\tassert(similarity_0_6 == similarity_6_0);\r\n\t\r\n\t//check that 2 is more similar than missing value\r\n\tassert(similarity_0_1 > similarity_0_6);\r\n\t\r\n\t//check that 9 is more similar than missing value\r\n\tassert(similarity_0_4 > similarity_0_6);\r\n\t\r\n\t//check that missing value is more similar than 20\r\n\tassert(similarity_0_6 > similarity_0_5);\r\n\t\r\n\tconsole.log(\"PASS\")\r\n}", "title": "" }, { "docid": "afa1b33e869ba1f5c420432d8a1fc8ef", "score": "0.43871415", "text": "function spinalCase(str) {\n // \"It's such a fine line between stupid, and clever.\"\n // --David St. Hubbins\n str = str.replace(/([a-z])([A-Z])/g, '$1 $2');\n str = str.toLowerCase().replace(/\\s/g,\"-\").replace(/_/g,\"-\");\n console.log(str);\n return str;\n }", "title": "" }, { "docid": "80a1753134cebb30900fcabc6bc67ba8", "score": "0.43838245", "text": "function toTitleCaseStrong(str) {\n\t\t\tif (!str) {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t\tvar allCaps = (str === str.toUpperCase());\n\t\t\t// Cap first letter of each word\n\t\t\tstr = str.replace(/([A-Za-z\\u00C0-\\u017F][^\\s-\\/]*) */g, function(txt) {\n\t\t\t\treturn ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n\t\t\t});\n\t\t\t// Cap O'Reilley's, L'Amour, D'Artagnan as long as 5+ letters\n\t\t\tstr = str.replace(/[oOlLdD]'[A-Za-z']{3,}/g, function(txt) {\n\t\t\t\treturn ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.charAt(1) + txt.charAt(2).toUpperCase() + txt.substr(3).toLowerCase();\n\t\t\t});\n\t\t\t// Cap McFarley's, as long as 5+ letters long\n\t\t\tstr = str.replace(/[mM][cC][A-Za-z']{3,}/g, function(txt) {\n\t\t\t\treturn ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.charAt(1).toLowerCase() + txt.charAt(2).toUpperCase() + txt.substr(3).toLowerCase();\n\t\t\t});\n\t\t\t// anything sith an \"&\" sign, cap the word after &\n\t\t\tstr = str.replace(/&\\w+/g, function(txt) {\n\t\t\t\treturn ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0) + txt.charAt(1).toUpperCase() + txt.substr(2);\n\t\t\t});\n\t\t\t// lowercase any from the ignoreWords list\n\t\t\tstr = str.replace(/[^ ]+/g, function(txt) {\n\t\t\t\tvar txtLC = txt.toLowerCase();\n\t\t\t\treturn (ignoreWords.indexOf(txtLC) > -1) ? txtLC : txt;\n\t\t\t});\n\t\t\t// uppercase any from the capWords List\n\t\t\tstr = str.replace(/[^ ]+/g, function(txt) {\n\t\t\t\tvar txtLC = txt.toUpperCase();\n\t\t\t\treturn (capWords.indexOf(txtLC) > -1) ? txtLC : txt;\n\t\t\t});\n\t\t\t// Cap first letter of entire name\n\t\t\tstr = str.charAt(0).toUpperCase() + str.substr(1);\n\t\t\treturn str;\n\t\t}", "title": "" }, { "docid": "5bfeb8b49e9b71905e00a1fd9408d2b2", "score": "0.43775013", "text": "generateAnswers2(answer, allCountries) {\n\n let wrongCountries = allCountries.filter(country => country.alpha3Code !== answer.alpha3Code); \n let countOfAnswers = 4;\n let positionOfCorrectAnswer = Math.floor(Math.random() * (countOfAnswers + 1));\n this.answers = []; \n\n for(let i=0; i< countOfAnswers; i++) {\n if (i === positionOfCorrectAnswer) {\n this.answers.push(answer.capital);\n\n } else {\n let randomAnswer = wrongCountries[Math.floor(Math.random() * wrongCountries.length)]; \n wrongCountries = wrongCountries.filter(country => country.alpha3Code !== randomAnswer.alpha3Code);\n \n //this.answers.push(randomAnswer.capital);\n this.answers.push( randomAnswer.capital );\n } \n }\n ////// ENVOI VERS NAME TO CAPITAL ///////// \n\n this.nameToCapital(this.answers)\n \n }", "title": "" }, { "docid": "87b44fa1700dfa998d63d554d648c339", "score": "0.43740264", "text": "function performRating(data, weights) {\n\n // copy data\n var ratings = JSON.parse(JSON.stringify(data));\n\n // calculate privacy indizes\n for(var i in ratings) {\n\n var idx = 1.0;\n var rating = ratings[i];\n\n if(rating.personal_category.indexOf(\"none\") >= 0) {\n rating.personal_category = [];\n }\n\n if(rating.personal_target.indexOf(\"none\") >= 0) {\n rating.personal_target = [];\n }\n\n if(rating.unspecific_target.indexOf(\"none\") >= 0) {\n rating.unspecific_target = [];\n }\n\n // initial \"no risk\" szenario\n if(rating.personal_target.length === 0 &&\n rating.unspecific_target.length === 0 &&\n rating.personal_category.length === 0)\n {\n idx = 0.0;\n }\n else {\n\n // security multiplier\n if (rating.secure_transmission === false &&\n rating.personal_target.length > 0)\n {\n multiplier.security = 1.0;\n }\n else {\n multiplier.security = 0.0;\n }\n\n // personal data target\n multiplier.personal_target = 0.0;\n\n for(var j in rating.personal_target) {\n\n // if there is an \"unknown\" target, break the constant\n // additions of risks and assign unknown risk\n if(rating.personal_target[j] === \"unknown\") {\n multiplier.personal_target = personalTargetWeights[rating.personal_target[j]];\n break;\n }\n\n multiplier.personal_target += personalTargetWeights[rating.personal_target[j]];\n }\n\n // category\n multiplier.category = 0.0;\n for(var k in rating.personal_category) {\n multiplier.category += categoryWeights[rating.personal_category[k]];\n }\n\n // unspecific data targe\n multiplier.unspecific_target = 1.0;\n\n\t\t\t// login\n\t\t\tmultiplier.login_required = (rating.login === true) ? 1.0 : 0.0;\n\n if(rating.unspecific_target.length === 0) {\n multiplier.unspecific_target = 0.0;\n }\n else {\n if(rating.unspecific_target.length == 1 && rating.unspecific_target[0] === \"none\") {\n multiplier.unspecific_target = 0.0;\n }\n }\n\n // source of rating\n multiplier.rating_source = 1.0;\n for(var l in rating.rating_source) {\n\n var rs = rating.rating_source[l];\n if(rs.length <= 2) continue;\n\n // always add the smallest number available\n if(sourceRatingWeights[rs] < multiplier.rating_source) {\n multiplier.rating_source = sourceRatingWeights[rs];\n }\n }\n\n // reasonableness\n multiplier.data_reasonable = (rating.data_reasonable === false) ? 1.0 : 0.0;\n\n // privacy index\n idx = multiplier.security * weights.security +\n multiplier.personal_target * weights.personal_target +\n multiplier.category * weights.category +\n\t\t\t\t multiplier.login_required * weights.login_required +\n multiplier.unspecific_target * weights.unspecific_target +\n multiplier.data_reasonable * weights.data_reasonable;\n\n var influence_key = [\"security\", \"personal_target\", \"category\", \"login_required\", \"unspecific_target\", \"data_reasonable\"];\n var influence_val = [multiplier.security * weights.security, multiplier.personal_target * weights.personal_target,\n multiplier.category * weights.category, multiplier.login_required * weights.login_required,\n\t\t\t\t\t\t\t\tmultiplier.unspecific_target * weights.unspecific_target, multiplier.data_reasonable * weights.data_reasonable];\n\n // find maximum influence value index\n var max_influence_val = Math.max.apply(null, influence_val);\n var max_influence_idx = influence_val.indexOf(max_influence_val);\n\n // store the rating influence key\n rating.influence_key = influence_key[max_influence_idx];\n\t\t\trating.multiplier = JSON.parse(JSON.stringify(multiplier));\n\t\t\trating.weights = weights;\n\n if(idx > maxRating) maxRating = idx;\n }\n\n\t\trating.archetype = (archetypes[rating.id]) ? archetypes[rating.id] : null;\n rating.privacy_index = parseFloat(idx);\n rating.privacy_index_confidence = 1 - multiplier.rating_source;\n\n if(rating.id === false) {\n console.log(rating);\n console.log(multiplier);\n }\n }\n\n // apply correction to risk index based on maximum rating\n var corr = 1.0 / parseFloat(maxRating);\n for(var m in ratings) {\n //ratings[m].privacy_index = parseInt(ratings[m].privacy_index * 100);\n\t\tratings[m].privacy_index = parseInt(parseFloat(ratings[m].privacy_index) * parseFloat(corr) * 100.0);\n\t}\n\n return ratings;\n}", "title": "" }, { "docid": "811247b1e8a777cc3bea9732a4f212f7", "score": "0.43672293", "text": "get skewness(): number {\n return 0;\n }", "title": "" }, { "docid": "e18803a08abde6cf5fb6e3bccd01c87e", "score": "0.4363883", "text": "function checkEyeShoulderRatio() {\n\t// Pose will look like [{part:'nose',position: {x: 0,y:0},score:.99}]\n\t// 1\tleftEye\n\t// 2\trightEye\n\t// 5\tleftShoulder\n\t// 6\trightShoulder\n}", "title": "" }, { "docid": "04ce5007c433c057e92a22e9db39df13", "score": "0.43566576", "text": "constructor() {\n\n\t\t\t/**\n\t\t\t * The rotation sensitivity.\n\t\t\t *\n\t\t\t * @type {Number}\n\t\t\t */\n\n\t\t\tthis.rotation = 0.0025;\n\n\t\t\t/**\n\t\t\t * The translation sensitivity.\n\t\t\t *\n\t\t\t * @type {Number}\n\t\t\t */\n\n\t\t\tthis.translation = 1.0;\n\n\t\t\t/**\n\t\t\t * The zoom sensitivity.\n\t\t\t *\n\t\t\t * @type {Number}\n\t\t\t */\n\n\t\t\tthis.zoom = 0.1;\n\n\t\t}", "title": "" }, { "docid": "6440b252dcfc49b43883fe6fa857e942", "score": "0.43550923", "text": "function skillLevelToPts( level, attLevel, difclty, baseAtt ) {\n// var adjLev = level - attLevel + difclty;\n// \t//alert(\"in skillLevelToPts\\n\"+level+\" - \"+attLevel+\" + \"+difclty+\" = \"+adjLev);\n// var inflectionPt = ( baseAtt=='IQ' ) ? 2 : 8;\t\t// 3rd edition rules\n// if( document.loadedCharacter.gameInfo.ruleset.match('e4') || difclty==3 ) { inflectionPt = 4; }\n// // if( adjLev < -1 ) {\n// // // alert('skillLevelToPts returning 0');\n// // return 0;\n// // }\n// // else\n// var points = ( adjLev < 4 ) ? Math.pow( 2, adjLev ) : inflectionPt*(adjLev - 0);\n// // before returning, need to adjust for e3 Eidetic Memory\n// if( document.loadedCharacter.hasTrait('EideticMemoryE3') && baseAtt=='IQ' /* no way in this context to check spell status */ ) {\n// points /= 2*document.loadedCharacter.getTrait('EideticMemoryE3').levels;\n// }\n// return ( document.loadedCharacter.gameInfo.ruleset.match('e4') ) ? Math.floor(points) : Math.floor(2*points)/2;\n}", "title": "" } ]
1f901a6a919059c1e796c3d9c2ca5caf
Notification of character data inside an element.
[ { "docid": "7f7c7cd427d55ac0f7d73903980f5bd7", "score": "0.5398993", "text": "function zenXMLContentHandler_characters(chars)\n{\n}", "title": "" } ]
[ { "docid": "cd88dbee77368b7195b73ba0ac575137", "score": "0.6215149", "text": "characterData({ target, oldValue }) {\n\t\t\tgetNode(target).nodeValue = target.data;\n\t\t}", "title": "" }, { "docid": "97b25a71db1186f38e57ae3610d68eb0", "score": "0.60009617", "text": "function ElementData() { }", "title": "" }, { "docid": "97b25a71db1186f38e57ae3610d68eb0", "score": "0.60009617", "text": "function ElementData() { }", "title": "" }, { "docid": "f4092daa59e3920767a5d27a824ed330", "score": "0.5792911", "text": "function data(c) {\n if (c == \"<\") {\n return tagOpen;\n } else if (c == EOF) {\n emit({\n type: \"EOF\"\n });\n return;\n } else {\n emit({\n type: \"text\",\n content: c\n });\n return data;\n }\n}", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5613935", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5613935", "text": "function TextData() { }", "title": "" }, { "docid": "51fed5df5efa05abe7a820c09d03181f", "score": "0.55458057", "text": "text() {\n const data = this.takeUntil('<');\n return { type: interfaces_1.TokenType.Text, data: data };\n }", "title": "" }, { "docid": "d335422525505702514580c680ca8db7", "score": "0.5414256", "text": "[content] (char) {\n \tthis.state = this.tagType === startTag && this.tagName in content_map\n \t\t? content_map [this.tagName] : data\n return false\n }", "title": "" }, { "docid": "39d5140ae11370dfd9b7a81661ee832f", "score": "0.5315322", "text": "set data(data) {\n this._data = data || {};\n\n this._element.innerHTML = this._data.text || '';\n }", "title": "" }, { "docid": "c8cc8f1e138232fb6f5dc78a300821bf", "score": "0.52771264", "text": "function updateDataInputData(e) {\n var elmInputBoxText = elmInputBoxContent.html();\n elmInputBox.val(convertSpace(elmInputBoxText));\n log(elmInputBox.val(), 'elmInputBoxText : ');\n tmpEle = elmInputBox;\n }", "title": "" }, { "docid": "48ef53254dbde4ac05f477a933ffc077", "score": "0.5243675", "text": "function addCharacter(char){\n showNotice(false);\n var emailDisplay = document.getElementById('emailDisplay');\n emailDisplay.innerHTML += char;\n if (getSize(emailDisplay) > emailDisplayStartSize){\n setTypeSize(currTypeSize + 1);\n }\n }", "title": "" }, { "docid": "04ddb413449e565aabced52c6c4c3505", "score": "0.5235069", "text": "attributeChangedCallback(name, oldValue, newValue) {\n console.log('Popup element data attribute changed.');\n }", "title": "" }, { "docid": "59c20a2277c740ea67572872b9b14695", "score": "0.52317834", "text": "function listen_for_change(evt)\n{\n var node = evt.target;\n //GM_log('in change node, data='+node.data+'; was='+evt.prevValue);\n document.body.removeEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n node.data = translate(node.data);\n document.body.addEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n}", "title": "" }, { "docid": "59c20a2277c740ea67572872b9b14695", "score": "0.52317834", "text": "function listen_for_change(evt)\n{\n var node = evt.target;\n //GM_log('in change node, data='+node.data+'; was='+evt.prevValue);\n document.body.removeEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n node.data = translate(node.data);\n document.body.addEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n}", "title": "" }, { "docid": "59c20a2277c740ea67572872b9b14695", "score": "0.52317834", "text": "function listen_for_change(evt)\n{\n var node = evt.target;\n //GM_log('in change node, data='+node.data+'; was='+evt.prevValue);\n document.body.removeEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n node.data = translate(node.data);\n document.body.addEventListener( 'DOMCharacterDataModified', listen_for_change, false );\n}", "title": "" }, { "docid": "00f903be65f07f56f27f2a5813b8bd96", "score": "0.52184266", "text": "onDataReceived(/* string */ aData) {}", "title": "" }, { "docid": "dbe7dff70e69aa719999794797612f49", "score": "0.5216847", "text": "function onData(message) {\n\n console.log(`${message.text}`);\n}", "title": "" }, { "docid": "69cdc18276d271607c4cafebb2bd147b", "score": "0.52028793", "text": "function handlePlainCharacter(element, char) {\n const prefix = element[typedPrefixSymbol] || '';\n element[typedPrefixSymbol] = prefix + char.toLowerCase();\n element.selectItemWithTextPrefix(element[typedPrefixSymbol]);\n setPrefixTimeout(element);\n}", "title": "" }, { "docid": "8ece4958b962306bfe29e1be10246f45", "score": "0.5196206", "text": "function processTagData() {\n $(opts.host + '[data-vala]').each(function () {\n const data = JSON.parse(this.dataset.vala)\n if (Array.isArray(data)) {\n this.innerHTML = vala($(this).text(), data, opts.cls)\n }\n })\n }", "title": "" }, { "docid": "afb2d3a205208f1f324c9ecdf1c86144", "score": "0.5188006", "text": "function getText(data)\r\n{\r\n\treturn data;\r\n}", "title": "" }, { "docid": "1938cc6e89b0eee561653b22d0b5f732", "score": "0.51770765", "text": "[selfClosingStartTag] (char) {\n \tif (char === '>') {\n \t\tthis.emitInclusive (T.finishSelfClosingTag)\n \t\tthis.state = data\n \t}\n \telse if (SPACE.test (char) || char === '/') {\n \t}\n \telse {\n \t\tthis.emit (T.space)\n \t\tthis.state = attributeName\n \t}\n }", "title": "" }, { "docid": "ce3636591a6d9a95fe837551ca21a25c", "score": "0.51751596", "text": "get textContent() {\n return this.element.textContent;\n }", "title": "" }, { "docid": "4c56527fac4ad98f68f4ee8384ac03ee", "score": "0.5163934", "text": "function renderContent(element) {\n\t\tvar content = element.get_contentText();\n\t\tcontent = content.replace(/\\[(([a-z0-9_.\\u00aa\\u00b5\\u00ba\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u02bb-\\u02c1\\u02d0-\\u02d1\\u02e0-\\u02e4\\u02ee\\u0370-\\u0373\\u0376-\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0621-\\u064a\\u0660-\\u0669\\u066e-\\u066f\\u0671-\\u06d3\\u06d5\\u06e5-\\u06e6\\u06ee-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07c0-\\u07ea\\u07f4-\\u07f5\\u07fa\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0966-\\u096f\\u0971-\\u0972\\u097b-\\u097f\\u0985-\\u098c\\u098f-\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc-\\u09dd\\u09df-\\u09e1\\u09e6-\\u09f1\\u0a05-\\u0a0a\\u0a0f-\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32-\\u0a33\\u0a35-\\u0a36\\u0a38-\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a66-\\u0a6f\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2-\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0-\\u0ae1\\u0ae6-\\u0aef\\u0b05-\\u0b0c\\u0b0f-\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32-\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c-\\u0b5d\\u0b5f-\\u0b61\\u0b66-\\u0b6f\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99-\\u0b9a\\u0b9c\\u0b9e-\\u0b9f\\u0ba3-\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0be6-\\u0bef\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58-\\u0c59\\u0c60-\\u0c61\\u0c66-\\u0c6f\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0-\\u0ce1\\u0ce6-\\u0cef\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d28\\u0d2a-\\u0d39\\u0d3d\\u0d60-\\u0d61\\u0d66-\\u0d6f\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32-\\u0e33\\u0e40-\\u0e46\\u0e50-\\u0e59\\u0e81-\\u0e82\\u0e84\\u0e87-\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa-\\u0eab\\u0ead-\\u0eb0\\u0eb2-\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0ed0-\\u0ed9\\u0edc-\\u0edd\\u0f00\\u0f20-\\u0f29\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8b\\u1000-\\u102a\\u103f-\\u1049\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065-\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u1090-\\u1099\\u10a0-\\u10c5\\u10d0-\\u10fa\\u10fc\\u1100-\\u1159\\u115f-\\u11a2\\u11a8-\\u11f9\\u1200-\\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\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u1676\\u1681-\\u169a\\u16a0-\\u16ea\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u17e0-\\u17e9\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u1900-\\u191c\\u1946-\\u196d\\u1970-\\u1974\\u1980-\\u19a9\\u19c1-\\u19c7\\u19d0-\\u19d9\\u1a00-\\u1a16\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b50-\\u1b59\\u1b83-\\u1ba0\\u1bae-\\u1bb9\\u1c00-\\u1c23\\u1c40-\\u1c49\\u1c4d-\\u1c7d\\u1d00-\\u1dbf\\u1e00-\\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\\u2071\\u207f\\u2090-\\u2094\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2183-\\u2184\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2c6f\\u2c71-\\u2c7d\\u2c80-\\u2ce4\\u2d00-\\u2d25\\u2d30-\\u2d65\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3006\\u3031-\\u3035\\u303b-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31b7\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fc3\\ua000-\\ua48c\\ua500-\\ua60c\\ua610-\\ua62b\\ua640-\\ua65f\\ua662-\\ua66e\\ua680-\\ua697\\ua722-\\ua788\\ua78b-\\ua78c\\ua7fb-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8d0-\\ua8d9\\ua900-\\ua925\\ua930-\\ua946\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa50-\\uaa59\\uac00-\\ud7a3\\uf900-\\ufa2d\\ufa30-\\ufa6a\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff10-\\uff19\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]+)(?:\\:(.+?))?)\\]/gi, \"<span class='c-forms-layout-content-token'>$1</span>\");\n\t\tcontent = content.replace(/\\s+href=\\\".*?\\\"/gi, '');\n\t\treturn \"<div class='c-forms-layout-field-content'><div class='c-html c-editor'>\" + content + \"</div></div>\";\n\t}", "title": "" }, { "docid": "367dcf3bb94da9cf30019438ef16eb0c", "score": "0.5158831", "text": "function flushData() {\n if (currentCharacters) {\n currentElement.appendChild(\n doc.createTextNode(currentCharacters));\n currentCharacters = '';\n }\n else if (currentCdata) {\n currentElement.appendChild(\n doc.createCDATASection(currentCdata));\n currentCdata = '';\n }\n }", "title": "" }, { "docid": "a14ac4edee6d942f01fc01b1ba263c0a", "score": "0.5157314", "text": "get textContent() {\n return this.nodeValue;\n }", "title": "" }, { "docid": "d0abe236e45eedcaa997abc60a9dd94d", "score": "0.5145861", "text": "function scriptDataEndTagNameI(c){\n if(c == \"p\") {\n return scriptDataEndTagNameP;\n } else {\n emit({\n type:\"text\",\n content:\"</scri\"\n });\n emit({\n type:\"text\",\n content:c\n });\n return scriptData;\n }\n}", "title": "" }, { "docid": "9c166a46d7ca1a49afa18ead1597a346", "score": "0.51376283", "text": "function fireAnnouncement() {\n var newText = document.getElementById('announcement-text').value;\n socket.emit('fire announcement', newText);\n}", "title": "" }, { "docid": "c2be6761431bd2063d93af578ca01d55", "score": "0.5130189", "text": "function addRenderTextNodeEventListener(elem, elemId, nakedValue) {\n elem.addEventListener('renderTextNodeEvent', function () {\n setBoundElements(nakedValue, elem, elemId, 'innervalue');\n elem.nodeValue = findAndReplaceExecResult(elem, nakedValue, elem.model);\n });\n }", "title": "" }, { "docid": "cb86b4ed2e41f4eca2f3cb1b54dc0da6", "score": "0.51036865", "text": "function charFromElement(element){\n if (element == null){\n return \" \"\n } else{\n return element.originChar\n }\n}", "title": "" }, { "docid": "fd475cb3e25c5c09c0ad9657dad318cd", "score": "0.51020205", "text": "function charFromElement(element){\n if(element == null)\n return \" \";\n else\n return element.originChar;\n}", "title": "" }, { "docid": "810957fdc5f344b35cd5daa0827e01f1", "score": "0.51017827", "text": "function onNodeMessage(message, element){\n nodeSocket.on(message, function(data){\n //This makes the element into a jquery object, whether it's\n // a selector string, a dom element, or a jquery object\n element = $(element);\n\n //Make sure the content has changed\n //Have to check this way because .html does some conversions on the text\n if($(\"<div />\").html(data.update).html() == element.html()){\n //console.log(\"Update is same content, not updating\");\n return;\n }\n if(data.update != \"\"){\n //console.log('got an update');\n element.fadeOut(400, function(){\n element.html(data.update);\n element.fadeIn();\n });\n }\n });\n}", "title": "" }, { "docid": "e892b8d60607884a0f9babfb0d26e6c3", "score": "0.50967914", "text": "function onChatMessageReceived(data) {\n var element = document.getElementById(\"comment\");\n var currentText = element.value;\n var message = data.name + \" : \" + data.chat + \"\\n\";\n currentText = currentText + message;\n element.value = currentText;\n}", "title": "" }, { "docid": "c3f5ef8f7f112a4671b2016a6bf979ff", "score": "0.5096647", "text": "function pushSmiley(e) {\n message.value += e;\n}", "title": "" }, { "docid": "1227457c85c52a88bca59becfd4b9d55", "score": "0.5071966", "text": "getText (element, callback) {\n const iterator = new NodeIterator(element)\n let next\n while ((next = iterator.getNext())) {\n if (next.nodeType === nodeType.textNode && next.data !== '') {\n callback(next.data)\n } else if (next.nodeType === nodeType.elementNode && next.nodeName === 'BR') {\n callback(' ')\n }\n }\n }", "title": "" }, { "docid": "566b8555af43efaa5d97b02035c8a0a6", "score": "0.50510275", "text": "get data() {\n return this.getStringAttribute('data');\n }", "title": "" }, { "docid": "1a090e19ce0487f2e1ebf44579ca4700", "score": "0.50495", "text": "function getDataText(sElementId) {\n $(sElementId).text(getData(sElementId));\n}", "title": "" }, { "docid": "4110d3106df73219bf82adbcdbda4b7d", "score": "0.5046402", "text": "function charFromElement(element) {\n if (element == null)\n return \" \";\n else\n return element.originChar;\n}", "title": "" }, { "docid": "6c7e092507d304cbda49b7e29f088955", "score": "0.50452936", "text": "function addAtom(elt, value, text) {\n var g = elt.append('g')\n .attr(\"data-value\",value)\n .attr('data-ismovable', 'true');\n addLiteral(g,text || value);\n g[0][0].addEventListener('mousedown',touchop.msDown);\n }", "title": "" }, { "docid": "31060b3d12c798cf957968a8fbc73e8f", "score": "0.5039437", "text": "function onData(data: Buffer) {\n const strData = data.toString()\n strData.split('\\n').forEach(str => onMessage(str))\n }", "title": "" }, { "docid": "9351e3665284709ea398e7318476dd3f", "score": "0.5028002", "text": "function dataCallback(data, isNotification){\n\n\tvar UUID = this.uuid;\t// Get the UUID of the notifying characteristic. \n\n\tconsole.log('------------------------------------------');\n\tconsole.log('BLE Notification for characteristic with uuid: ' +UUID);\n\tconsole.log('characteristic data value is ' + data.toString('hex'));\n\tconsole.log('------------------------------------------');\n\t\n\tmqttPublishToTopic(data.toString('hex'));\n}", "title": "" }, { "docid": "25f1b311776200203a771059a4559939", "score": "0.5019556", "text": "function changeElem(element) {\n if (element.hasChildNodes()) {\n element.childNodes.forEach(changeElem)\n } else {\n // do something awesome to the element...\n // like... manipulate mentions of \"josh mu\"\n if (element.nodeType === Text.TEXT_NODE) {\n const found = element.textContent.match(/josh mu/gi)\n if (found) {\n const newElem = document.createElement('span')\n newElem.innerHTML = element.textContent.replace(\n /josh mu/gi,\n `<span class=\"chrome-extension-style\">JOSH 🐮MOOOOO!</span>`\n )\n element.replaceWith(newElem)\n }\n }\n }\n}", "title": "" }, { "docid": "2671e801983307982ebd41ff12b9ca8f", "score": "0.5010287", "text": "function getSpecialData(charNum) {\n\t\"use strict\";\n\tif (specInfo.hasOwnProperty($(\"#special-\" + charNum).val())) {\n\t\t$(\"#special-\" + charNum).data(\"info\", specInfo[$(\"#special-\" + charNum).val()]);\n\t\tif (specInfo[$(\"#special-\" + charNum).val()].hasOwnProperty(\"description\")) {\n\t\t\t$(\"#special-desc-\" + charNum).text(specInfo[$(\"#special-\" + charNum).val()].description);\n\t\t} else {\n\t\t\t$(\"#special-desc-\" + charNum).text(\"No effect.\");\n\t\t}\n\t} else {\t// no special\n\t\t$(\"#special-\" + charNum).data(\"info\", {});\n\t\t$(\"#special-desc-\" + charNum).text(\"No effect.\");\n\t} \n}", "title": "" }, { "docid": "e7dd4cef03fa065a840251bb2a295328", "score": "0.5008763", "text": "function data(elem, attr) {\n\t\t\t\t// should we return an array if attr is \"[…]\" ?\n\t\t\t\treturn elem.getAttribute(\"data-\" + attr);\n\t\t}", "title": "" }, { "docid": "8b34263d50287a359c0c5265dcdc37e6", "score": "0.500046", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "8b34263d50287a359c0c5265dcdc37e6", "score": "0.500046", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "10dc19a95cca80dbaf7f737dc67eba4c", "score": "0.49994805", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$5.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$5.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "e7ab7d6f73152daa50940ae5b400b527", "score": "0.49748653", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$6.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$6.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "a10303d637a6667c94491147d8346488", "score": "0.49703884", "text": "function updateHtmlElement (element, data, dataProperty) {\n if (element) {\n console.log(data);\n console.log(typeof data);\n console.log(data[displayName]);\n element.innerHTML = data[dataProperty];\n }\n }", "title": "" }, { "docid": "2b53c4d2ecb0d9f63c7b49ed7632f7dd", "score": "0.49584332", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$1.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$1.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "38c0eff1a921581c456026e91ba54db1", "score": "0.49495485", "text": "function getText(elem)\n {\n if (!elem) { return null; }\n\n var str = \"\";\n if (elem.childNodes.length === 0 && elem.nodeType ==\n Strophe.ElementType.TEXT) {\n str += elem.nodeValue;\n }\n\n for (var i = 0; i < elem.childNodes.length; i++) {\n if (elem.childNodes[i].nodeType == Strophe.ElementType.TEXT) {\n str += elem.childNodes[i].nodeValue;\n }\n\t\t\telse if (elem.nodeType == Strophe.ElementType.NORMAL) {\n\t\t\t\t\tstr = str+elem.childNodes[i].nodeName+\": \";\n\t\t\t\t\tstr+=getText(elem.childNodes[i]);\n\t\t\t}\n\t\t}\n\n return str;\n }", "title": "" }, { "docid": "cb3f11ce2b8640c5e711937f6688dc28", "score": "0.4949529", "text": "updateOneCharacterInfo() {\n document.querySelector(\n \".characters-container\"\n ).innerHTML = this.formCharacterElement(this.response);\n }", "title": "" }, { "docid": "098952e63b90d4edbc13e6c4739fdffb", "score": "0.49482504", "text": "function CharacterDataImpl(data) {\n var _this = _super.call(this) || this;\n _this._data = data;\n return _this;\n }", "title": "" }, { "docid": "c574365bd557d4e32ff2e1db617f92bb", "score": "0.49333122", "text": "function next_char() { c = ++pos < xml.length ? xml[pos] : undefined; }", "title": "" }, { "docid": "f7a776d9af1396d4cf8bb42a6218dfa7", "score": "0.4931828", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$1.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$1.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n\n this._emitSeveralCodePoints(this.tempBuff);\n\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "9de0e7ad82a8069efea417933fca20eb", "score": "0.4925422", "text": "function data(c) {\n\n}", "title": "" }, { "docid": "aae14161689945e10b43b289615d7287", "score": "0.4913778", "text": "get onDataEventName() {\n return \"data\";\n }", "title": "" }, { "docid": "0dcba0f51a22c1d107c0333289a24c8e", "score": "0.49087036", "text": "function writeData () {\n data = input.value();\n var html = report.html();\n html = \"<li><strong>TX:-->&nbsp;</strong>\" + data + html;\n report.html(html);\n socket.emit('message', data);\n \n}", "title": "" }, { "docid": "700ea3a6124a458efe76a93e8474bd70", "score": "0.4903227", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "700ea3a6124a458efe76a93e8474bd70", "score": "0.4903227", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "7337c3d5de2e16359260b92928003558", "score": "0.49027762", "text": "[beforeAttributeName] (char) {\n \tif (SPACE.test (char)) {\n \t}\n \telse if (char === '/') {\n \t\tthis.emit (T.space)\n \t\tthis.state = selfClosingStartTag\n \t}\n \telse if (char === '>') {\n \t\tthis.emit (T.space)\n \t\tthis.emitInclusive (T.finishTag)\n \t\tthis.state = content\n \t}\n \telse {\n \t\tthis.emit (T.space)\n \t\tthis.state = attributeName\n \t}\n }", "title": "" }, { "docid": "336a082164de7d96cfb8f25b50323ffa", "score": "0.48942804", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $$5.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $$5.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "ffa7740913f36e28c486d4a635e00676", "score": "0.48889613", "text": "function getCharDetails(event) {\n // reset selected character color\n allNames.forEach(name => {\n name.style.color = 'black';\n })\n\n\n // reset character details\n details.forEach(detail => {\n detail.textContent = '';\n })\n // saves character name\n event.target.style.color = 'red';\n let charName = event.target.textContent\n\n // let para = document.createElement('p');\n // loop through characters\n characters.forEach(character => {\n if (character.name === charName) {\n name.textContent = `Name: ${character.name}`;\n if (character.born.length) {\n born.textContent = `Born: ${character.born}`;\n } else {\n born.textContent = `Born: unknown`;\n }\n if (character.died.length) {\n died.textContent = `Died: ${character.died}`;\n } else {\n died.textContent = 'Died: Still alive (as far as we know)'\n }\n titles.textContent = `Titles: ${character.titles}`;\n aliases.textContent = `Aliases: ${character.aliases}`;\n }\n })\n\n\n}", "title": "" }, { "docid": "5761e2347dfbc0212b789abc3f31c5dc", "score": "0.48809454", "text": "function isContainXMLCharacter(value) {\n return escapeHtml(value) != value;\n}", "title": "" }, { "docid": "4d8f0206c474d93135503348f46a90b4", "score": "0.48756626", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $$6.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $$6.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "301b79c94b58a6efd9f77844821830f7", "score": "0.48748633", "text": "function messagePrint(el) {\n console.log(el.value);\n}", "title": "" }, { "docid": "c28d42eef5b404168681257725516101", "score": "0.4865245", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $$1.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $$1.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n\n this._emitSeveralCodePoints(this.tempBuff);\n\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "f5a4d2f69dbab29c025c5adf6ab1e1c0", "score": "0.48622936", "text": "function isDataElement(node) {\n return node && node.nodeType !== Node.COMMENT_NODE;\n}", "title": "" }, { "docid": "b232597204dae8f433e39153e7709dda", "score": "0.4861265", "text": "[SCRIPT_DATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n } else if (cp === $$1.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n } else if (cp === $$1.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "76dce61cb427d936ded22ffeb4985cdc", "score": "0.48586714", "text": "function WireContentForEditableText(content) {\n if (content.children.length != 0) {\n for (var i = 0; i < content.children.length; i++) {\n WireContentForEditableText(content.children[i]);\n }\n } else if(content != undefined) {\n var changeTextClickSubscriber;\n $(content).click(function (event) {\n ChangeTextClickSubscriber(content);\n });\n }\n}", "title": "" }, { "docid": "7a22eb925fe7e670b4b1b82a8835708e", "score": "0.48505682", "text": "function text(elem, value) {\n if (arguments.length == 1) {\n //---- GET value ----\n value = elem.textContent;\n return value;\n } else {\n //---- SET value ----\n var actualValue = value;\n\n if (typeof value === \"function\") {\n actualValue = value(elem.dataItem, elem.dataIndex);\n }\n\n elem.textContent = actualValue;\n }\n }", "title": "" }, { "docid": "d0661302624f1227ea067be55f933c62", "score": "0.4844684", "text": "function a(e,t){return 1===e.nodeType&&e.getAttribute(h)===String(t)||8===e.nodeType&&e.nodeValue===\" react-text: \"+t+\" \"||8===e.nodeType&&e.nodeValue===\" react-empty: \"+t+\" \"}", "title": "" }, { "docid": "27aa355db80b074292c497995bae8152", "score": "0.48239264", "text": "function _singleChar(reader, pred) {\n\t\tvar c = reader.currentElement();\n\t\tif (pred(c)) { reader.consumeCurrentElement(); return new Element(this, c); }\n\t\treturn false;\n\t}", "title": "" }, { "docid": "8e0d10fe35e8e291d2752b83743fc69c", "score": "0.4822912", "text": "[tagName] (char) {\n \tif (SPACE.test (char)) {\n \t\tthis.emit (T.tagName)\n \t\tthis.state = beforeAttributeName\n \t}\n \telse if (char === '/') {\n \t\tthis.emit (T.tagName)\n \t\tthis.state = selfClosingStartTag\n \t}\n \telse if (char === '>') {\n \t\tthis.emit (T.tagName)\n \t\tthis.emitInclusive (T.finishTag)\n \t\tthis.state = content\n \t}\n \telse {\n \t\tthis.p++\n \t\t// The following is a bit of a hack, used in `content`,\n \t\t// for supporting rcdata and rawtext elements\n \t\tif (this.tagType === startTag)\n \t\t\tthis.tagName = this.tagName + char.toLowerCase ()\n \t}\n }", "title": "" }, { "docid": "b8cf9a6b6f3dd0b386f7c94d32f4ac2d", "score": "0.4817681", "text": "function getElementText(elem)\n {\n if ( elem == null ) return \"\" ;\n logDebug(\"getElementText: \", elem.childNodes) ;\n var txt = \"\" ;\n for ( var i = 0 ; i < elem.childNodes.length ; i++ )\n {\n if ( elem.childNodes[i].nodeType == 3 )\n {\n txt += elem.childNodes[i].nodeValue ;\n }\n }\n return txt ;\n }", "title": "" }, { "docid": "a0f5a10f26a4663ffe986e1eb7071675", "score": "0.48078924", "text": "function eventCallback (e){\n msg.innerHTML = e.type;\n}", "title": "" }, { "docid": "1b27afc3772c22c9245044534911c114", "score": "0.48067105", "text": "function addDataToDom(data) {\n console.log('Adding quote to dom: ' + data);\n\n const quoteContainer = document.getElementById('quote-container');\n quoteContainer.innerText = data;\n}", "title": "" }, { "docid": "757b184bbbb43f92f35aa0e04ed74f47", "score": "0.4805595", "text": "[RAWTEXT_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RAWTEXT_STATE);\n }\n }", "title": "" }, { "docid": "757b184bbbb43f92f35aa0e04ed74f47", "score": "0.4805595", "text": "[RAWTEXT_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RAWTEXT_STATE);\n }\n }", "title": "" }, { "docid": "c61d36c6b80d7fc3fa757d5cd6857639", "score": "0.4804858", "text": "[beforeAttributeValue] (char) {\n \tif (SPACE.test (char)) {\n \t}\n \telse if (char === '\"' || char === \"'\") {\n \t\tthis.emit (T.attributeAssign)\n \t\tthis.state = attributeData\n \t\t\tthis.quotation = char\n \t\tthis.emitInclusive (T.beginAttributeValue)\n \t}\n \telse if (char === '>') {\n \t\tthis.emit (T.attributeAssign)\n \t\tthis.emit (T.beginAttributeValue)\n \t\tthis.emit (T.attributeData, { error:'missing attribute value' })\n \t\tthis.emit (T.finishAttributeValue)\n \t\tthis.emitInclusive (T.finishTag)\n \t\tthis.state = content\n \t}\n \telse if (char === '&') {\n \t\tthis.emit (T.attributeAssign)\n \t\tthis.emit (T.beginAttributeValue)\n this.quotation = ''\n this.returnState = attributeData\n \t\tthis.state = charRef\n }\n \telse {\n \t\tthis.emit (T.attributeAssign)\n \t\tthis.emit (T.beginAttributeValue)\n \t\tthis.state = attributeData\n \t\t\tthis.quotation = ''\n \t\tif (char === '<' || char === '=' || char === '`')\n \t\t this.emit (T.attributeData, { error: 'attribute values must not start with a ('+char+') character'})\n \t}\n }", "title": "" }, { "docid": "c5539672db51c823775320db54aa947d", "score": "0.4796475", "text": "function _getData($element) {\n\t\treturn $element.data(namespace);\n\t}", "title": "" }, { "docid": "5360700b29bd45513cc152826a1c97f9", "score": "0.47946155", "text": "function put_message( data){\n\tvar message = document.getElementById( \"message\");\n\tmessage.innerHTML = data;}", "title": "" }, { "docid": "50e4cc989f9262be233c738f4afcdf64", "score": "0.4786783", "text": "function connectionDataCallback(data) {\n // handle text\n if (data.type === MAQAW_DATA_TYPE.TEXT) {\n that.chatSession.newTextReceived(data.text);\n // show an alert that new text has been received\n alertNewText();\n }\n if (data.type === MAQAW_DATA_TYPE.SCREEN) {\n that.mirror && that.mirror.data(data);\n }\n // information about the visitor\n if (data.type === MAQAW_DATA_TYPE.VISITOR_INFO) {\n handleVisitorInfo(data);\n }\n }", "title": "" }, { "docid": "eb51fdf06504a72ac86efaa84fd4dc62", "score": "0.47712734", "text": "function direct_text_content (element) {\n // Return the text from this element only, not including any text from child elements. Takes a plain DOM element, not a Jquery collection.\n let text = ''\n let child_node\n for (child_node of element.childNodes) {\n if (child_node.nodeType === 3) text += child_node.textContent\n }\n return text\n}", "title": "" }, { "docid": "49619b5a0c194e3d693214f4c5a818f4", "score": "0.47702348", "text": "onPaste(event) {\n const data = {\n text: event.detail.data.innerHTML\n };\n\n this.data = data;\n }", "title": "" }, { "docid": "536bca0554a396f32aa41959cac7d99f", "score": "0.4768196", "text": "[RAWTEXT_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$6.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$6.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RAWTEXT_STATE);\n }\n }", "title": "" }, { "docid": "eda05e779ac084463aeda1c922d2ce98", "score": "0.4763624", "text": "appendText(element, text) {\n this.ApplicationController.dom.appendText(element, text);\n }", "title": "" }, { "docid": "1d5f27e06df1354ef858558297b1c4f1", "score": "0.4762346", "text": "[RAWTEXT_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$5.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$5.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RAWTEXT_STATE);\n }\n }", "title": "" }, { "docid": "e280bd36ae965c5effe5c9e21b5c5854", "score": "0.47599226", "text": "function typeWriteLetter(elem, text) {\n if (i < text.length) {\n\n // get text from previous step\n var temp = \"\";\n if (i > 0) {\n temp = elem.textContent.substring(0, i);\n }\n\n // add one letter and a cursor if it is in desktop-version\n if (desktop) {\n elem.textContent = temp + text.charAt(i) + \"|\";\n } else {\n elem.textContent = temp + text.charAt(i);\n }\n i++;\n\n // call again as long as the text is complete\n setTimeout(typeWriteLetter, generateSpeed(), elem, text);\n } else {\n if (elem.classList.contains('cite')) {\n // cursor animation between cite and name writing\n i = 0;\n setTimeout(cursorAnimation, 0, elem, 1, 0);\n } else {\n // call remove function\n i = 0;\n setTimeout(cursorAnimation, cursorSpeed / 2, nameElem, 3, 0);\n }\n }\n }", "title": "" }, { "docid": "201875a0be391bf8b5742b034b1d99a8", "score": "0.47593474", "text": "[RAWTEXT_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $$1.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $$1.GREATER_THAN_SIGN) {\n this._emitCurrentToken();\n this.state = DATA_STATE;\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RAWTEXT_STATE);\n }\n }", "title": "" }, { "docid": "70e6b6a6ebb1bf0c6a3520795a67ab44", "score": "0.47575974", "text": "[plaintext] (char) {\n }", "title": "" }, { "docid": "9e1b1a423239776251d4436e8de3b15c", "score": "0.47571674", "text": "function scriptDataEndTagNameC(c){\n if(c == \"r\") {\n return scriptDataEndTagNameR;\n } else {\n emit({\n type:\"text\",\n content:\"</sc\"\n });\n emit({\n type:\"text\",\n content:c\n });\n return scriptData;\n }\n}", "title": "" }, { "docid": "8640bf7f26924f81d64d596f593051e7", "score": "0.4757038", "text": "static get observedAttributes(){\n return ['text'];\n }", "title": "" }, { "docid": "ad1e5d249c7ca70604564e64007d7e75", "score": "0.4756758", "text": "function statusMessage(element,message){\n \n element.addEventListener(\"mouseover\", ()=> {\n let text = document.createTextNode(message);\n document.getElementById(\"status\").appendChild(text);\n });\n element.addEventListener(\"mouseout\", ()=> {\n let paragraph = document.getElementById(\"status\");\n paragraph.removeChild(paragraph.firstChild);\n });\n}", "title": "" }, { "docid": "7888f379c6f86170f80bd8e8930ddc9d", "score": "0.4755792", "text": "attributeChangedCallback(attrName, oldVal, newVal) {\n if (oldVal !== newVal) {\n if (attrName === \"data\") {\n try {\n const data = JSON.parse(newVal);\n this._data = data;\n } catch (e) {\n console.error(\n \"Failed to parse `data` attribute in `errors-display` element\",\n e\n );\n }\n }\n this.render();\n }\n }", "title": "" }, { "docid": "2ecce6c8d841edffc147de4e65b9bf5c", "score": "0.4754871", "text": "get data() {\n // let text = this._element.innerHTML;\n this._data.text = text;\n this._data.class = this._element.class !== undefined && this._element.class.length > 0 ? this._element.class : [];\n this._data.style = this._element.style !== undefined && typeof this._element.style === 'object' ? this._element.style : {};\n this._data.stretched = data.stretched !== undefined ? data.stretched : false;\n\n return this._data;\n }", "title": "" }, { "docid": "36695f1e734ca6681308fd84383ded27", "score": "0.4753346", "text": "function attachObserver()\n{\n mutationObserver.observe(document.querySelector('.messages'), {\n childList: true,\n attributes: true,\n subtree: true,\n characterData: true\n });\n}", "title": "" }, { "docid": "41dc5d177d4b2c318dea339ec4cf53e3", "score": "0.47519302", "text": "function onAtCharRead(buffer){\n var array = new Uint8Array(buffer);\n document.getElementById('onAlarmSwitch').checked = (array[0] !== 0);\n document.getElementById('onAlarmTimeHour').textContent = array[1];\n document.getElementById('onAlarmTimeMinute').textContent = array[2];\n document.getElementById('onAlarmTimeSecond').textContent = array[3];\n document.getElementById('onAlarmHourInput'). value = array[1];\n document.getElementById('onAlarmMinuteInput'). value = array[2];\n document.getElementById('onAlarmSecondInput'). value = array[3];\n console.log('finished the read');\n}", "title": "" }, { "docid": "2e7831aa19a647454dbfe1c1fe304dcd", "score": "0.47488877", "text": "function scriptDataEndTagNameS(c){\n if(c == \"c\") {\n return scriptDataEndTagNameC;\n } else {\n emit({\n type:\"text\",\n content:\"</s\"\n });\n emit({\n type:\"text\",\n content:c\n });\n return scriptData;\n }\n}", "title": "" }, { "docid": "b6a7ba22316924985cc2de568ae481de", "score": "0.47458735", "text": "[RCDATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this.state = DATA_STATE;\n this._emitCurrentToken();\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RCDATA_STATE);\n }\n }", "title": "" }, { "docid": "b6a7ba22316924985cc2de568ae481de", "score": "0.47458735", "text": "[RCDATA_END_TAG_NAME_STATE](cp) {\n if (isAsciiUpper(cp)) {\n this.currentToken.tagName += toAsciiLowerChar(cp);\n this.tempBuff.push(cp);\n } else if (isAsciiLower(cp)) {\n this.currentToken.tagName += toChar(cp);\n this.tempBuff.push(cp);\n } else {\n if (this.lastStartTagName === this.currentToken.tagName) {\n if (isWhitespace(cp)) {\n this.state = BEFORE_ATTRIBUTE_NAME_STATE;\n return;\n }\n\n if (cp === $.SOLIDUS) {\n this.state = SELF_CLOSING_START_TAG_STATE;\n return;\n }\n\n if (cp === $.GREATER_THAN_SIGN) {\n this.state = DATA_STATE;\n this._emitCurrentToken();\n return;\n }\n }\n\n this._emitChars('</');\n this._emitSeveralCodePoints(this.tempBuff);\n this._reconsumeInState(RCDATA_STATE);\n }\n }", "title": "" } ]
e1457e2e97ebc330760565c67fa578b8
ticket order details after submit
[ { "docid": "2e1d71d603b7525e77f0acacfcd0773c", "score": "0.6033164", "text": "function ticketOrderDetails() {\n const firstTicketQuantity = getTicketInputValue('first-ticket-input');\n const economyTicketQuantity = getTicketInputValue('economy-ticket-input');\n const rootDiv= document.querySelector('.booking');\n // new div element create\n const newDiv = document.createElement('div');\n newDiv.style.cssText = \"padding: 20px; background-color: white; text-align: center; color: green\";\n newDiv.textContent = \"Order Success\"\n rootDiv.appendChild(newDiv);\n // ticket order element create\n orderInfo('First Ticket', firstTicketQuantity, 150)\n orderInfo('Economy Ticket', economyTicketQuantity, 100)\n function orderInfo(title, ticketQuantity, price) {\n const h2 = document.createElement('h2');\n h2.textContent = title + \"(\" + ticketQuantity + \")\" + \" = $\" + ticketQuantity * price;\n newDiv.appendChild(h2);\n }\n\n // horizontal element create\n horizontalElement();\n function horizontalElement() {\n const hr = document.createElement('hr');\n newDiv.appendChild(hr);\n }\n\n // sub total element create\n const subTotal = firstTicketQuantity * 150 + economyTicketQuantity * 100\n subTotalElement();\n function subTotalElement() {\n const subTotalElement = document.createElement('h2');\n subTotalElement.innerHTML = \"SubTotal &nbsp; &nbsp; = &nbsp; &nbsp; $\" + subTotal;\n newDiv.appendChild(subTotalElement);\n }\n \n // vat element create\n const vat = subTotal * 0.1\n vatElement();\n function vatElement() {\n const vatElement = document.createElement('h2');\n vatElement.innerHTML = \"Vat &nbsp; &nbsp; = &nbsp; &nbsp; $\" + vat;\n newDiv.appendChild(vatElement);\n }\n \n // horizontal element create\n horizontalElement();\n\n // total element create\n const total = subTotal + vat;\n totalElement();\n function totalElement() {\n const totalElement = document.createElement('h2');\n totalElement.innerHTML = \"Total &nbsp; &nbsp; = &nbsp; &nbsp; $\" + total;\n newDiv.appendChild(totalElement);\n }\n \n\n //checkout element create\n function checkout() {\n const checkoutElement = document.createElement('input');\n checkoutElement.setAttribute('type','submit');\n checkoutElement.setAttribute('value','Checkout');\n checkoutElement.style.cssText = \"width: 150px; padding: 10px; color: green; background-color: orange; font-size: 25px; cursor: pointer; border: none; font-weight: bold; margin-top: 20px; border-radius: 8px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)\";\n newDiv.appendChild(checkoutElement);\n }\n checkout();\n \n}", "title": "" } ]
[ { "docid": "d2f393e93e6d50695fb28b4a188e5bd8", "score": "0.6811961", "text": "function OrderDetails() {\n var errorJson;\n if (!EAUtils.ValidateSession()) {\n return;\n }\n var requestObject = EAUtils.ExtractRequestObject();\n if (requestObject) {\n var order = OrderMgr.getOrder(requestObject.order_no);\n if (order) {\n ISML.renderTemplate('responses/eabasketjson', {\n Order : order\n });\n }\n } else {\n errorJson = '{\"httpStatus\":501}';\n ISML.renderTemplate('responses/eabasketjson', {\n errorJson : errorJson\n });\n return;\n }\n}", "title": "" }, { "docid": "7459c35214a4e630e8b6a9a3e5d3914c", "score": "0.6587779", "text": "function tr_submitCheckout() {\r\n if (!tr_validateCheckout()) return;\r\n\r\n var order = {};\r\n order.toolCode = $(\"#toolSelector\").val();\r\n order.rentalDays = $(\"#rentalDays\").val();\r\n order.discount = $(\"#discount\").val();\r\n order.checkoutDate = $(\"#checkoutDate\").val();\r\n //console.log(\"Order = \" + JSON.stringify(order));\r\n\r\n tr_ajax(\"api/checkout\", \"POST\", order, function(data) {\r\n //console.log(\"Data = \" + JSON.stringify(data));\r\n\r\n // if validation errors - display\r\n if (data.status === 'OK') {\r\n // show the agreement screen / div\r\n showRentalAgreement(data.result);\r\n\r\n } else if (data.status === 'VALIDATION') {\r\n tr_displayFieldError(data.field, data.message);\r\n\r\n } else { // General error\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "6b068aa91dd96d7f7b0d04bcaa3571c0", "score": "0.6567338", "text": "function orderDetails() {\n\tvar resourceHelper = require(\"~/cartridge/scripts/util/resource\")\n\tvar utils = require(\"~/cartridge/scripts/util/affirmUtils\")\n\tvar orderRefId = request.httpParameterMap.orderRefId.stringValue\n\tvar order = OrderMgr.searchOrder(\"custom.AffirmExternalId = {0}\", orderRefId)\n\tvar shipment = order.getDefaultShipment()\n\tvar handleTransaction = require(\"~/cartridge/scripts/handleTransaction\")\n\ttry {\n\t\thandleTransaction.read(orderRefId)\n\t} catch (error) {\n\t\tlog.error(\"Exception occured while fetching transaction history: \" + error)\n\t}\n\tvar amountAuth = utils.toDollars(order.custom.AffirmAuthAmount)\n\tvar amountCaptured = utils.toDollars(order.custom.AffirmCapturedAmount)\n\tvar amountRefunded = utils.toDollars(order.custom.AffirmRefundedAmount)\n\tvar amountDue = amountAuth - amountCaptured\n\tvar authBalance = amountCaptured - amountRefunded\n\tvar transactionHistory = order.custom.AffirmTransactionHistory || \"[]\"\n\tISML.renderTemplate(\"application/orderdetails\", {\n\t\tresourceHelper: resourceHelper,\n\t\torder: order,\n\t\tshippingAddress: shipment.shippingAddress,\n\t\ttransactionHistory: transactionHistory,\n\t\tamountDue: amountDue,\n\t\tamountAuth: amountAuth,\n\t\tamountCaptured: amountCaptured,\n\t\tamountRefunded: amountRefunded,\n\t\tauthBalance: authBalance,\n\t})\n}", "title": "" }, { "docid": "b0fa8f0e277668d6d71ba28d3dfbb481", "score": "0.63980776", "text": "submitOrder() {\n if (this.state.billing.adress == null) {\n alert(\"Please, specify your adress\");\n return;\n } else if (this.state.billing.name == null) {\n alert(\"Please, specify your name\");\n return;\n } else if (this.state.billing.phone == null || this.checkPhone(this.state.billing.phone) == null) {\n alert(\"Please, specify your correct phone\");\n return;\n }\n\n const order = this.cookies.get('Order', false),\n o = Object.entries(order);\n \n let list = o.map((o) => {\n let data = o[1];\n return data.name;\n });\n\n axios({\n method: 'post',\n url: 'orders/collect',\n data: {\n price: this.state.priceRu,\n order: list\n }\n }).then((res) => {\n alert(res.data);\n }).catch((err) => {\n console.log(err);\n });\n return;\n\n }", "title": "" }, { "docid": "5c92aab39842a28115cb3eaf59fe299b", "score": "0.633803", "text": "function sasubmit(order) {\n var orderResult = Cybersource.GetOrder(order);\n if (orderResult.error) {\n return { carterror: true };\n }\n return { submit: true, Order: orderResult.Order };\n}", "title": "" }, { "docid": "38e7b6fa2bbed34bb5ac202efb87335a", "score": "0.6263567", "text": "function submitOrder(event){\n event.preventDefault()\n\n // assign form to a variable for reset later\n let orderForm = getOrderForm()\n\n // find full name\n let fullNameInput = document.getElementById('name')\n\n // find address input\n let addressInput = document.getElementById('address')\n\n fetch('http://localhost:3000/api/v1/orders', {\n method: 'POST',\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n order: {\n name: fullNameInput.value,\n address: addressInput.value,\n flavor_ids: getFlavorIds(),\n }\n })\n }).then(res => res.json()).then(json => {\n // updateOrderForm(json)\n toggleOrderForm()\n\n renderOrderDetails(json)\n\n })\n}", "title": "" }, { "docid": "a350fd89dd820a8818965ceee1ec9d5a", "score": "0.62113947", "text": "submitOrderForm() {\r\n console.log('========First name========='); //Print label in console\r\n console.log('First Name:', this.firstname); //display data of the named field in the console\r\n console.log('========Last name=========');\r\n console.log('Last Name:', this.lastname);\r\n console.log('========Email Adress=========');\r\n console.log('Email:', this.email);\r\n console.log('========= Pick up and pay in store (true/false)========');\r\n console.log('Instore:', this.instore);\r\n console.log('========= Ship and pay online (true/false)========');\r\n console.log('Online:', this.online);\r\n console.log('========Street Address=========');\r\n console.log('Last Name:', this.streetaddress);\r\n console.log('========City=========');\r\n console.log('City:', this.city);\r\n console.log('========state=========');\r\n console.log('State:', this.state);\r\n console.log('========Card Number=========');\r\n console.log('Card Number:', this.cardnumber);\r\n console.log('========CVC=========');\r\n console.log('CVC:', this.cvc);\r\n console.log('========Expiry Date=========');\r\n console.log('Expiry Date:', this.expirydate);\r\n\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "816a2660fe6302822ac2b3560f969c39", "score": "0.6163383", "text": "function submit() {\n // Calls the COPlaceOrder controller that does the place order action and any payment authorization.\n // COPlaceOrder returns a JSON object with an order_created key and a boolean value if the order was created successfully.\n // If the order creation failed, it returns a JSON object with an error key and a boolean value.\n var placeOrderResult = app.getController('COPlaceOrder').Start();\n if (placeOrderResult.error) {\n start({\n PlaceOrderError: placeOrderResult.PlaceOrderError\n });\n } else if (placeOrderResult.order_created) {\n showConfirmation(placeOrderResult.Order);\n }\n}", "title": "" }, { "docid": "286dbc99dc650c478e440523ddfd26e1", "score": "0.6151556", "text": "function submitGuestOrder() {\n let menu = JSON.parse(localStorage.getItem('courses'));\n var billStr = [];\n var sum = 0;\n for (let i = 0; i < menu.length; i++) {\n let qStr = document.getElementById('orderQuantity' + i);\n if (qStr.value > 0) {\n let orderObj = '{\"name\":\"' + menu[i].name + '\",\"quantity\":\"' + qStr.value + '\",\"total\":\"' + menu[i].price * qStr.value + '\"}';\n sum += menu[i].price * qStr.value;\n billStr.push(orderObj);\n }\n }\n let f = document.getElementById('shipmentInfoForm');\n let fullName = f.elements['fullName'].value;\n let address = f.elements['address'].value;\n let notes = f.elements['notes'].value;\n let str = '{\"fullName\":\"' + fullName + '\",\"address\":\"' + address + '\",\"notes\":\"' + notes + '\"}';\n billStr.push(str);\n addNewOrder(billStr);\n alertOrder();\n}", "title": "" }, { "docid": "a5a15725cf09461a7bd9e1cd45e7fa41", "score": "0.6073712", "text": "function submitPaymentInfo(evt) {\n if (evt) evt.preventDefault(); // when running tests there is no event\n\n let curPayment = createCurPayment();\n\n if (curPayment) {\n paymentId += 1;\n\n allPayments['payment' + paymentId] = curPayment;\n\n appendPaymentTable(curPayment, 'payment' + paymentId);\n updateServerTable();\n updateSummary();\n\n billAmtInput.value = '';\n tipAmtInput.value = '';\n }\n}", "title": "" }, { "docid": "aa67b4f259d9ab2bd1f05c3744196398", "score": "0.602126", "text": "async submitProduct () {\r\n // const data = {\r\n // RequestList: this.RequestList\r\n // }\r\n // await this.updateOrder()\r\n }", "title": "" }, { "docid": "23eccf70b0d250d837d074a7d58fa656", "score": "0.6013138", "text": "function view_order(order_id){\n\tif(order_id != ''){\n\t\t$('#order_id_order_id').val(order_id);\n\t var info = 'id=' + order_id;\n\t\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: \"dashboard/getOrder/\"+order_id,\n\t\tdata: '',\n\t\tsuccess: function(data){\t\t\n\t\t\t\t $('.updatetextOrder').html(data);\n\t\t\t\t $('#order_popup').modal('show');\n\t\t}\n\t\t});\n\t }\n}", "title": "" }, { "docid": "e47aaa4688f2df2bd6304dab3315b7bf", "score": "0.5964332", "text": "function handleSubmit(event) {\n event.preventDefault()\n //creation of a new order using the existing product details stored in value of form, \n //and the typed details from customer in local formState\n const newOrder = {\n name: formState.name,\n address: formState.address,\n email: formState.email,\n phone_number: formState.phone_number,\n nail_length: formState.nail_length,\n nail_shape: formState.nail_shape,\n nail_style: formState.nail_style,\n cost: formState.cost,\n image: {\n description: formState.image.description,\n fileLink: formState.image.fileLink\n }\n }\n //call async add order function which awaits a post request to server\n addOrder(newOrder).then((newOrder) => {\n // add new order to store (global state)\n dispatch({\n type: 'setOrders',\n data: [newOrder, ...orders]\n })\n // send to confirmation page \n history.push(`/order/confirm/${newOrder._id}`)\n }).catch((error) => {\n //catch any errors with product creation and set in local state, will pop up as an alert\n const status = error.response ? error.response.status : 500\n console.log('Caught error on edit', error)\n if(status === 403)\n setErrorMessage(\"Oops! It appears we lost your login session. Make sure 3rd party cookies are not blocked by your browser settings.\")\n else\n setErrorMessage(\"Well, this is embarrassing... There was a problem on the server.\")\n })\n }", "title": "" }, { "docid": "8f9f79db2a8f1f162301e59506f5a290", "score": "0.59169894", "text": "static editReport(ord_no) {\n return (dispatch, getState) => {\n dispatch(actionDispatch(ActionType.EDIT_REPORT));\n const Cookie = getState().authReducer.cookie;\n let form = new FormData();\n form.append(\"entity_no\", ord_no);\n \n post(\"/edit\", form, Cookie)\n .then(response => {\n if (response.error) {\n throw response.error;\n }\n response.ord_no = ord_no;\n response.isEditFromOrder = true;\n \n dispatch(\n actionDispatch(ActionType.EDIT_REPORT_SUCCESS)\n );\n dispatch(\n actionDispatch(ActionType.EDIT_REPORT_SUCCESS_ORDER, response)\n )\n dispatch(OrderAction.freightCalculation(response))\n dispatch(OrderAction.getFlavourPacks())\n \n Actions.productlist({\n selectedCustomer: response.selectedCustomer\n });\n })\n .catch(error => {\n console.log(\"error\", error);\n dispatch(\n actionDispatch(ActionType.EDIT_REPORT_FAIL, error)\n );\n });\n };\n }", "title": "" }, { "docid": "99fd219d3c5ee741d1a98ff5fa3b8f10", "score": "0.5905077", "text": "function createOrder() {\n axios.post('order/create', {\n user: localStorage.getItem(\"userID\"),\n vendor: localStorage.getItem(\"vendorID\"),\n snacks: submitOrder,\n prices: calcTotal()\n }).then(response => {\n if (response.data.success) {\n notification.open({\n message: \"Order has been placed!\",\n description: \"You can see the details or change the order from see orders\",\n duration: 3\n });\n } else {\n message.error(\"An error in order placement!\");\n }\n });\n }", "title": "" }, { "docid": "9324b5311f9fde5e25bff19f5a32b2a5", "score": "0.59036475", "text": "function displaySingleTicket(ticketId) {\n\n console.log(\"displaySingleTicket: Entering\");\n\n var ticketChain = TicketChain.deployed();\n\n var singleTicketlement = document.getElementById(\"single_ticket\").value;\n\n ticketChain.getTicketDetails.call(ticketId).then(function(value) {\n\n console.log(\"Have result of getTicketDetails\");\n\n console.log(value);\n console.log(value.description);\n\n document.getElementById(\"single_ticket\").innerHTML = value;\n\n }).catch(function(e) {\n console.log(e);\n setStatus(\"An error occured; see log.\");\n });\n}", "title": "" }, { "docid": "80d0a75d3feaae9257b1d597b9a8a1b8", "score": "0.58929837", "text": "getOrderDetails() {\n this.$refs.spinner.showSpinner();\n if (this.globals.isB2C()) {\n this.manageTransactionService.getOrderDetailsB2C({},\n this.handleOrderDetailsSuccess,\n this.handleOrderDetailsError,\n this.orderCode,\n );\n } else if (this.globals.isB2B() && !this.isAdmin) {\n this.manageTransactionService.getOrderDetailsB2BBuyer({},\n this.handleOrderDetailsSuccess,\n this.handleOrderDetailsError,\n this.orderCode,\n );\n } else if (this.globals.isB2B() && this.isAdmin) {\n this.manageTransactionService.getOrderDetailsB2BAdmin({},\n this.handleOrderDetailsSuccess,\n this.handleOrderDetailsError,\n this.orderCode,\n );\n }\n }", "title": "" }, { "docid": "040556829451eea2dbcb28e89be8d0f4", "score": "0.5858561", "text": "function submitOrderForm(event){\n document.getElementById('new_order').submit()\n}", "title": "" }, { "docid": "068314c884d741d042a973bd183428d0", "score": "0.5836574", "text": "function sendOrder() {\n let name = document.getElementById('inputName').value;\n let house = document.getElementById('inputHouse').value;\n let street = document.getElementById('inputStreet').value;\n let city = document.getElementById('inputCity').value;\n let zip = document.getElementById('inputZip').value;\n\n let delivery = {};\n delivery.name = name;\n delivery.address = `${house}, ${street}\\n${city}\\n${zip}`;\n\n let email = document.getElementById('inputEmail').value;\n let phone = document.getElementById('inputPhone').value;\n\n let contact = {};\n contact.email = email;\n contact.phone = phone;\n\n let order = {};\n order.products = basket.products;\n order.delivery = delivery;\n order.contact = contact;\n\n // Save from here: https://stackoverflow.com/a/30832210\n let blob = new Blob([JSON.stringify(order)], {\n type: \"text/plain;charset=utf-8\"\n });\n let filename = `order ${name}.txt`;\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(blob, filename);\n else { // Others\n let a = document.createElement(\"a\"),\n url = URL.createObjectURL(blob);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function() {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n };\n\n let form = document.getElementById('order');\n form.reset();\n}", "title": "" }, { "docid": "2a154475eb713fef4a76920c7091a279", "score": "0.58263916", "text": "function issueSalesOrder(order_id, options={}) {\n\n let html = `\n <div class='alert alert-block alert-info'>\n {% trans \"Issue this Sales Order?\" %}\n </div>`;\n\n constructForm(`{% url \"api-so-list\" %}${order_id}/issue/`, {\n method: 'POST',\n title: '{% trans \"Issue Sales Order\" %}',\n confirm: true,\n preFormContent: html,\n onSuccess: function(response) {\n handleFormSuccess(response, options);\n }\n });\n}", "title": "" }, { "docid": "5b14667d7cf57488b2ac70c9be4c7c51", "score": "0.5821211", "text": "function fnReturnGenInfo(){\ndocument.forms[0].action=\"MainFeatureInfo.do?method=fetchComponentDesc&orderKeyId=\"+document.forms[0].orderKey.value;\ndocument.forms[0].submit();\n}", "title": "" }, { "docid": "457af3ba0893c3d301b3db8ac4e05e60", "score": "0.58188736", "text": "function Ticket(no,issues, Discription, date) {\n this.SrNo = no\n this.issues = issues\n this.Discription = Discription\n this.date = date\n}", "title": "" }, { "docid": "32fd0ce4c5333cb62b41e45d81e96c92", "score": "0.58138084", "text": "function addOrder() {\n \n webview.send(\"add-order\", {\n mail : webOrder.mail,\n numProduct : webOrder.numProduct,\n shop : webOrder.shop,\n numOrder: webOrder.numOrder\n });\n}", "title": "" }, { "docid": "525848d069eb9d9169adbc62cc1ceb71", "score": "0.57867897", "text": "function postOrder() {\n let phone = id(\"phone-number\").value;\n let email = id(\"email\").value;\n let emailRegex = /^\\S+@\\S+.\\S+$/;\n if (Object.keys(cart).length > 0 && phone.length === PHONE_LENGTH && emailRegex.test(email)) {\n\n let order = new FormData();\n order.append(\"phone\", phone);\n order.append(\"email\", email);\n order.append(\"cart\", JSON.stringify(cart));\n if (user.length > 0) {\n order.append(\"user\", user);\n }\n\n fetch(\"/order\", {method: \"POST\", body: order})\n .then(checkStatus)\n .then(() => {\n displayStatus(\"Your Order Is On The Way!\");\n cart = {};\n updateCart();\n clearFields();\n if (user.length > 0) {\n populateYourOrders();\n }\n })\n .catch(() => {displayStatus(\"Something went wrong placing your order, try again!\");});\n } else {\n displayStatus(\"Please input all required information\");\n }\n highlightOrder(phone, emailRegex.test(email));\n }", "title": "" }, { "docid": "cfe618672034846fff7c425c3e0751a8", "score": "0.5781761", "text": "function submitOrder(){\n\tlet info = {}\n\tinfo.restaurantID = select.selectedIndex;\n\tinfo.restaurantName = select.options[select.selectedIndex].value;\n\tinfo.subtotal = currentSubtotal.toFixed(2);\n\tinfo.total = currentTotal.toFixed(2);\n\tinfo.fee = currentFee.toFixed(2);\n\tinfo.tax = (currentSubtotal * 0.1).toFixed(2);\n\tinfo.order = order;\n\t\n\treq = new XMLHttpRequest();\n\treq.onreadystatechange = function() {\n\t\tif(this.readyState==4 && this.status==200){\n\t\t\talert(\"Order placed!\")\n\t\t\tconsole.log(this.responseText);\n\t\t\torder = {}\n\t\t\tselectRestaurant();\n\t\t}\n\t}\n\t\t\t\t\t\n\treq.open(\"POST\", `http://localhost:3000/orders`);\n\treq.setRequestHeader(\"Content-Type\", \"application/json\");\n\treq.send(JSON.stringify(info));\n}", "title": "" }, { "docid": "d28c023ccc507249b4451b0f9f23f2ce", "score": "0.57530934", "text": "async function submitOrder(e) {\n e.preventDefault();\n setLoading(true);\n setError(null);\n setMessage(null);\n const body = {\n name: values.name,\n email: values.email,\n order: attachNamesAndPricesToOrder(order, pizzas),\n orderTotal: formatMoney(calculateOrderTotal(order, pizzas)),\n mapleSyrup: values.mapleSyrup,\n };\n const response = await fetch(\n `${process.env.GATSBY_SERVERLESS_BASE}/placeOrder`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n }\n );\n const t = await response.text();\n const text = JSON.parse(t);\n\n // 1 check if everything worked\n // 2 if response.status >= 400 && response.status <= 600 BAD\n if (response.status >= 400 && response.status <= 600) {\n setLoading(false);\n setError(text.error);\n } else {\n setLoading(false);\n setMessage(text.message);\n }\n }", "title": "" }, { "docid": "0148b73a9f78ed2ba9fc9c0ad3d745fc", "score": "0.57459587", "text": "function handleTicketEdit() {\n var currentTicket = $(this)\n .parent()\n .parent()\n .data(\"ticket\");\n window.location.href = \"/cms?ticket_id=\" + currentTicket.id;\n }", "title": "" }, { "docid": "eaec388c0c3d784d1098a82366a34929", "score": "0.5733209", "text": "function parseOrderInfo() {\n\t\t// Order number\n\t\tif ($(emailHtml).find('h2:contains(\"Order Confirmation\")').next(\"a\").length) {\n\t\t\treceipt.orderNumber = $(emailHtml).find('h2:contains(\"Order Confirmation\")').next(\"a\").text();\n\t\t}\n\n\t\t// Order Date\n\t\tif ($(emailHtml).find('td:contains(\"Order #\") span:contains(\"Placed on\")').length) {\n\t\t\tvar dateString = $(emailHtml).find('td:contains(\"Order #\") span:contains(\"Placed on\")').text();\n\n\t\t\tdateString = dateString.split(\"Placed on \")[1];\n\t\t\treceipt.orderDate = new Date(dateString);\n\t\t}\n\t}", "title": "" }, { "docid": "19651c82710953efe0f913044cbd2e0d", "score": "0.57236713", "text": "function confirmationOrder() {\n getForm();\n dataToSend = JSON.stringify({ contact, products});\n console.log(dataToSend);\n postForm(dataToSend);\n}", "title": "" }, { "docid": "9a7f35e17866486f1c461718bfd16ca5", "score": "0.57200414", "text": "function loadOrderToInput(paramOrder) {\n $('#inp-order-date').val(paramOrder.orderDate);\n $('#inp-required-date').val(paramOrder.requiredDate);\n $('#inp-shipped-date').val(paramOrder.shippedDate);\n $('#inp-status').val(paramOrder.status);\n $('#inp-message').val(paramOrder.comments);\n }", "title": "" }, { "docid": "ac08739212e9d46256df97ab94bd9a42", "score": "0.57195896", "text": "function saveOrderInfo(){\n var firstNameItem;\n var lastNameItem;\n var costPerTicketItem;\n var numberOfTicketsItem;\n var emailItem;\n var creditNumItem;\n\n var firstName;\n var lastName;\n var costPerTicket;\n var numberOfTickets;\n var email;\n var creditNum;\n\n var totalCostOrder;\n var submitButton;\n\n document.addEventListener('click', function(event){\n\n if(event.target.id == \"order\"){\n\n firstNameItem = document.getElementById(\"first-name\");\n lastNameItem = document.getElementById(\"last-name\");\n costPerTicketItem = document.getElementById(\"event-price\");\n numberOfTicketsItem = document.getElementById(\"number-tickets-box\");\n emailItem = document.getElementById(\"email\");\n creditNumItem = document.getElementById(\"credit\");\n\n firstName = firstNameItem.value;\n lastName = lastNameItem.value;\n costPerTicket = costPerTicketItem.innerHTML;\n numberOfTickets = numberOfTicketsItem.value;\n email = emailItem.value;\n creditNum = clean_nonnumbers(creditNumItem.value);\n\n costPerTicket = clean_nonnumbers(costPerTicket);\n totalCostOrder = costPerTicket*numberOfTickets;\n submitButton = document.getElementById(\"order\");\n\n while(creditNum.length > 4)\n {\n creditNum = creditNum.substr(1);\n }\n\n\n // console.log(\"first \" + firstName);\n // console.log(\"last \" + lastName);\n // console.log(\"cost \" + costPerTicket);\n // console.log(\"num \" + numberOfTickets);\n // console.log(\"email \" + email);\n // console.log(\"credit \" + creditNum);\n\n localStorage.setItem(\"order-first-name\", firstName);\n localStorage.setItem(\"order-last-name\", lastName);\n localStorage.setItem(\"order-cost\", totalCostOrder);\n localStorage.setItem(\"order-email\", email);\n localStorage.setItem(\"order-credit-last-four\", creditNum);\n }\n });\n }", "title": "" }, { "docid": "b9f4af2b4bffab8487339ba0320b9514", "score": "0.5712398", "text": "function saveorderdetails()\n\t{\n\t\tvar type = 'save_order';\n\t\tvar url = web_url+type;\n\t\t\n\t\tvar iUserId = $(\"#iUserId\").val();\n\t\tvar iApplicationId = $(\"#iApplicationId\").val();\n\t\tvar iAppTabId = $(\"#iAppTabId\").val();\n\t\tvar iItemId = $(\"#iItemId\").val();\n\t\tvar iMenuId = $(\"#iMenuID\").val();\n\t\tvar vName = $(\"#vNamed\").val();\n\t\tvar tAddress = $(\"#tAddress\").val();\n\t\tvar vPhone = $(\"#vPhone\").val();\n\t\tvar tEmail = $(\"#tEmail\").val();\n\t\tvar vArea = $(\"#vArea\").val();\n\t\tvar vPincode = $(\"#vPincode\").val();\n\t\tvar vQuantity = $(\"#vQuantity\").val();\n\t\t\t\t\n\t\tif(vName==\"\")\n\t\t{\n $(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Name.</div>');\n\t\t\t $(\"#contact_validation\").show();\n\t\t\t $(\"#vName\").focus();\n\t\t\t return false;\n }\n\t\t\t\t\n\t\tif(tAddress==\"\")\n\t\t{\n\t\t\t $(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Address.</div>');\n $(\"#contact_validation\").show();\n $(\"#tAddress\").focus();\n return false;\n\t\t}\n\t\tif(vPhone==\"\")\n\t\t{\n\t\t\t $(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Number.</div>');\n $(\"#contact_validation\").show();\n $(\"#vPhone\").focus();\n return false;\n\t\t}\n\t\t/*if(vPhone !='' && vPhone != /^[\\d\\s\\(\\)\\-]+$/){\n\t\t\t$(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Number.</div>');\n $(\"#contact_validation\").show();\n $(\"#vPhone\").focus();\n return false;\n\t\t}else{\n\t\t\t$(\"#contact_validation\").hide();\n\t\t}*/\n\t\tif(vPhone !='' && vPhone.length > 10 || vPhone.length < 10){\n\t\t\t$(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Valid Number.</div>');\n $(\"#contact_validation\").show();\n $(\"#vPhone\").focus();\n return false;\n }else{\n \t$(\"#contact_validation\").hide();\n }\n if(tEmail==\"\"){\n\t\t\t$(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please Enter Email.</div>');\n $(\"#contact_validation\").show();\n $(\"#tEmail\").focus();\n return false;\n\t\t}else{\n\t\t\t$(\"#contact_validation\").hide();\n\t\t}\n\t\tvar emailRegexStr = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n \t\tvar isvalid = emailRegexStr.test(tEmail); \n\t\tif(isvalid==false){\n\t\t\t$(\"#contact_validation\").html('<div style=\"color: #b94a48;background-color: #f2dede;border-color: #eed3d7; text-align:center;\">Please enter valid email.</div>');\n $(\"#contact_validation\").show();\n $(\"#tEmail\").focus();\n return false;\n\t\t} \t\n\t\t$.ajax({\n\t\t\t\turl: url,\n\t\t\t\ttype: \"GET\",\n\t\t\t\tdataType: \"jsonp\",\n\t\t\t\tdata:'vName='+vName+'&tAddress='+tAddress+'&vPhone='+vPhone+'&tEmail='+tEmail+'&vArea='+vArea+'&vPincode='+vPincode+'&iUserId='+iUserId+\"&iApplicationId=\"+iApplicationId+\"&iAppTabId=\"+iAppTabId,\n\t\t\t\tcrossDomain: true,\n\t\t\t\tsuccess: function (result) \n\t\t\t\t{\n\t\t\t\t\tvar html = '';\n\t\t\t\t\thtml += '<center>';\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml += '<div data-role=\"fieldcontain\" class=\"wrapmain\">';\n\t\t\t\t\t\thtml += '<h3>';\n\t\t\t\t\t\t\thtml += 'Payment';\n\t\t\t\t\t\thtml += '</h3>';\n\t\t\t\t\t\thtml += '<a class=\"join_btn\" href=\"javascript:credit_card_payment('+result['Orderdetails']+','+result['iApplicationId']+','+result['iAppTabId']+','+result['iUserId']+');\" data-role=\"button\" data-inline=\"true\">Credit card</a>';\n\t\t\t\t\t\thtml += '</div>';\n\t\t\t\t\t\t\n\t\t\t\t\thtml += '</center>';\n\t\t\t\t\t\n\t\t\t\t\t$(\"#payment_detail\").html(html);\n\t\t\t\t\t$.mobile.changePage(\"#payment_detail_main\", \"pop\", true);\n\t\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "e7f962f2ee453c85666d6d3c9cdf8e7a", "score": "0.5704879", "text": "@wire(getRecord, { recordId: '$recordId', fields: FIELDS})\n getOrderDetails(result) {\n \n if (result.error) {\n \n } else if (result.data) {\n this.order = result.data;\n }\n }", "title": "" }, { "docid": "6a410b9493b41c778752c956c3e307fa", "score": "0.5701967", "text": "function order()\n{\n if (checkCart())\n {\n //Check which delivery button is chosen\n //if (checkOrder())\n var addressType = 1;\n if ($(\"#addressRadio1\").prop(\"checked\"))\n addressType = 0;\n var address = \"\";\n var validateResult = true;\n if (addressType == 0)\n {\n //built in address;\n address = $(\"#lblOrgAddress\").text();\n }\n else\n {\n address = $(\"#lblNewAddress\").val();\n //some validation? \n var validator = $(\"#addressForm\").validate({\n rules: {\n newAddress: {\n required: true,\n }\n },\n errorClass: \"errorClass\"\n });\n validateResult = validator.form();\n }\n //$(\".myRadios\").find(\":selected\");\n //\n //authenticate the delivery address\n //\n //\n //store it for email\n //\n //order function\n //building order from cookie\n if (validateResult)\n {\n var cart = JSON.parse($.cookie(\"cart\"));\n var username = cart.username;\n var cartArray = cartToJsonArray(cart.cart);\n\n var orderObj = {};\n orderObj.username = username;\n orderObj.orderItems = [];\n for (i = 0; i < cartArray.length; i++)\n {\n var newItem = {inventoryId: cartArray[i].productId, quantity: cartArray[i].qty, discount: cartArray[i].discount};\n orderObj.orderItems.push(newItem); //add to array\n }\n orderObj.address = address;\n //check here for json format\n orderObj = JSON.stringify(orderObj);//json object is good to go\n $(\"#btnUpdate\").ajaxWrapper(\"/BasketApp/api/Orders/checkout\", success, fail, orderObj, \"application/json\");\n function success(data)\n {\n //check if there is any error message\n if (data.error)\n {\n $(\"#cartMsgPane\").addClass(\"alert alert-danger\");\n $(\"#cartMsgPane\").html(\"<center>\" + errorMessage + \"</center>\");\n }\n else\n {\n //no error\n //get cookie for one last time\n var cart = JSON.parse($.cookie(\"cart\"));\n cart = cart.cart;\n cart = cartToJsonArray(cart);\n //add address to cart for display\n cart.address = address;\n includes(\"CheckoutSuccess_template\", cart, \"#modalContent\");\n //delete cookie\n cart = JSON.parse($.cookie(\"cart\"));\n cart.cart = {};\n $.cookie(\"cart\", JSON.stringify(cart));\n cartCountUpdate();\n listProducts();\n }\n }\n function fail(data)\n {\n console.log(\"checkout fail\");\n }\n }\n }\n}", "title": "" }, { "docid": "523b8f59f3c113a71cafd98aa2bf61ca", "score": "0.57015455", "text": "function actionTicketList()\n {\n var BddId = 'EtlTool'\n var Environnement = 'PRD'\n BddTool.QueryExecBdd(`\n SELECT TicketID AS \"TicketID\", \n Environnement AS \"Environnement\", \n CreationDate AS \"CreationDate\", \n Responsable AS \"Responsable\" \n FROM TicketJob \n WHERE Responsable = '${BddTool.ChaineFormater(Identifiant)}' \n `, reject, (recordset) => { \n for (var record of recordset) {\n Result.push({\n Type: 'Ticket',\n TicketID: record.TicketID,\n Environnement: record.Environnement,\n Responsable: record.Responsable,\n ActionDate: record.CreationDate\n })\n }\n TreatedList.TicketFlg = true\n checkTreated()\n })\n }", "title": "" }, { "docid": "cb4eed85268cb1a5060840f46f487c9d", "score": "0.56795704", "text": "function submit_payment_receipt()\n\t{\n\t\tvar type = 'send_order_receipt';\n\t\tvar url = web_url+type;\t\n\t\tvar data = $(\"#frm\").serialize();\n\t\t\n\t\t$.ajax({\n\t\t\t\turl: url,\n\t\t\t\ttype: \"GET\",\n\t\t\t\tdataType: \"jsonp\",\n\t\t\t\tdata:'iCustOrderId='+iCustOrderId,\n\t\t\t\tcrossDomain: true,\n\t\t\t\tsuccess: function (result) \n\t\t\t\t{\n\t\t\t\t\t$(\"#loyalty_detail\").html(receipt.receipt);\n\t\t\t\t\t$.mobile.changePage(\"#loyalty_detail_main\", \"pop\", true);\n\t\t\t\t}\n\t\t\t});\n\t}", "title": "" }, { "docid": "69d5291aa60f15368137d8fb9787810b", "score": "0.56583226", "text": "function addOrder() {\n $.ajax({\n type: 'POST',\n url: './api/order',\n data: JSON.stringify({ \n firstName, \n lastName, \n company, \n deliveryAdress, \n billingAdress, \n country, \n city, \n state, \n zipCode, \n phoneNumber}),\n dataType: 'JSON',\n contentType: 'application/json',\n success: handleSuccess\n });\n }", "title": "" }, { "docid": "91e72e5373d32c29f9e80d5a6feee146", "score": "0.5648549", "text": "function handleSubmit(event) {\n event.preventDefault();\n props.addOrder(props.order, name, phoneNumber);\n setName(\"\");\n setPhoneNumber(\"\");\n }", "title": "" }, { "docid": "bc76d3f03c81829a8f0351b5c58254ac", "score": "0.5638942", "text": "function newOrder(event) {\r\n \t\tevent.preventDefault();\r\n\t\tevent.stopPropagation();\r\n\t\tlet order = document.forms.order;\r\n\r\n\r\n\t\torder.name.parentNode.classList.add('was-validated');\r\n\r\n\r\n\r\n\t\tif (/[a-zA-Zа-яА-Я ]/.test(order.name.value)) {\r\n\t\t\tlet re = /\\+7\\d{10}|8\\d{10}/;\r\n\t\t\tlet input = order.phone;\r\n\t\t\tif (re.test(input.value) & ((input.value[0] == '8' & input.value.length == 11) | (input.value[0] == '+' & input.value.length == 12))) {\r\n\t\t\t\tfunction GetFormattedDate() {\r\n\t\t\t\t\tvar date = new Date();\r\n\t\t\t\t var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\r\n\t\t\t\t var day = (\"0\" + (date.getDate())).slice(-2);\r\n\t\t\t\t var year = date.getFullYear();\r\n\t\t\t\t var hour = (\"0\" + (date.getHours())).slice(-2);\r\n\t\t\t\t var min = (\"0\" + (date.getMinutes())).slice(-2);\r\n\t\t\t\t var seg = (\"0\" + (date.getSeconds())).slice(-2);\r\n\t\t\t\t return year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + min + \":\" + seg;\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tlet passcode = new Uint16Array(1);\r\n\t\t\t\twhile (passcode[0] < 1000) window.crypto.getRandomValues(passcode);\r\n\r\n\t\t\t\torder.passcode.value = passcode[0];\r\n\r\n\t\t\t\tlet data = {\r\n\t\t\t\t\tpasscode: passcode[0], \r\n\t\t\t\t\tname: order.name.value, \r\n\t\t\t\t\tphone: order.phone.value, \r\n\t\t\t\t\taddress: order.address.value,\r\n\t\t\t\t\tdeliverytype: order.DeliveryType.value,\r\n\t\t\t\t\torderbody: user.cart.str_cart, \r\n\t\t\t\t\tcomment: order.comment.value,\r\n\t\t\t\t\tordertime: GetFormattedDate()\r\n\t\t\t\t};\r\n\r\n\t\t\t\tdocument.getElementById(\"modalBody\").classList.toggle('d-none');\r\n\t\t\t\tdocument.getElementById(\"modalBodySpinner\").classList.toggle('d-none');\r\n\r\n\t\t\t\tdocument.forms.order.orderBody.value = user.cart.str_cart;\r\n\r\n\t\t\t\tpost(\"/orders/new-order\", \r\n\t\t\t\t\tJSON.stringify(data),\r\n\t\t\t\t\t(result) => {\r\n\t\t\t\t\t\tuser.cart.delete();\r\n\t\t\t\t\t\tlet randomV = new Uint16Array(1);\r\n\t\t\t\t\t\twindow.crypto.getRandomValues(randomV);\r\n\t\t\t\t\t\tfirebase.database().ref('NewOrders').set(randomV[0])\r\n\t\t\t\t\t\t.then((v) => {\r\n\t\t\t\t\t\t\tdocument.location = \"/buy?id=\"+result+\"&passcode=\"+passcode[0];\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch((error) => {\r\n\t\t\t\t\t\t\tdocument.location = \"/buy?id=\"+result+\"&passcode=\"+passcode[0];\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t },\r\n\t\t \t(err) => {\r\n\t\t \t\tdocument.getElementById(\"modalBody\").classList.toggle('d-none');\r\n\t\t\t\t\t\tdocument.getElementById(\"modalBodySpinner\").classList.toggle('d-none');\r\n\t\t \t\terr_log(err);\r\n\t\t \t});\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tinput.classList.add('is-invalid');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "b0558a05c8a970f58cfaba900d8f1c97", "score": "0.5626946", "text": "function addOrder() {\n console.log('Add a new order');\n let data = {};\n\n // $(\"div[id^='post-new-']\").each(function () {\n // let field = $(this).attr('id').substr(9);\n // let value = $(this).html();\n // data[field] = value;\n // });\n\n data['customerName'] = $(\"div#post-new-user_id\").html();\n data['itemId'] = $(\"div#post-new-body\").html();\n data['amount'] = $(\"div#post-new-image_url\").html();\n\n // let data_final = {};\n // data_final['customerName'] = data.customerName;\n // data_final['itemId'] = data.itemId;\n // data_final['amount'] = data.amount;\n\n console.log(data);\n // console.log('final data');\n // console.log(data_final);\n\n const url = baseUrl_API + \"/orders\";\n console.log(url);\n\n fetch(url, {\n method: 'POST',\n headers: {\n \"Authorization\": \"Bearer \" + jwt,\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(data)\n })\n .then(checkFetch)\n .then(() => showAllOrders())\n .catch(err => showMessage(\"Errors\", err))\n}", "title": "" }, { "docid": "200b2945a0e218c2eb8c294dac356ff7", "score": "0.5618633", "text": "function OrderRegenOrder(data,pane) {\n $.unblockUI();\n UpdateFormPreview(pane);\n}", "title": "" }, { "docid": "b60e701c30b417cb432b2ef51965ff93", "score": "0.56027853", "text": "function handleSubmit(event) {\n event.preventDefault();\n // console.log('You get a coffee. And you get a monkey. And you get a puppy');\n\n const url = API_URL;\n const method = event.target.method;\n const elements = event.target.elements;\n const data = {\n strength: elements.strength.value,\n flavor: elements.flavor.value,\n size: elements.size.value,\n coffee: elements.coffee.value,\n emailAddress: elements.emailAddress.value\n };\n fetch(url, {\n method: method,\n headers: {\n \"Content-type\": \"application/json; charset=utf-8\", \n },\n body: JSON.stringify(data)\n })\n .then(r => r.json())\n .then( (orderInfo) => { //Wrap it in a anonymous function \n // First checks for the exsistance of then name.\n if (orderInfo.name && (orderInfo.name === \"Validation error\")) {\n notifyUser(`I'm sorry. Please fill out the coffee field and the email address field.`);\n } else {\n notifyUser(`Your coffee is totally (not) on the way.`)\n }\n })\n}", "title": "" }, { "docid": "e365158a2f15199f9fca4bc8cada5b1c", "score": "0.56019163", "text": "function showOrUpdateOrder(orderDto) {\n // If we have an existing order, we must update its status.\n for (var i = 0; i < orders.length; i += 1) {\n if (orders[i].id == orderDto.id) {\n orders[i].number = orderDto.number;\n orders[i].name = orderDto.name;\n orders[i].seat = orderDto.seatLabel;\n orders[i].isAddOn = orderDto.isAddOn;\n orders[i].state = orderDto.state;\n inProgressOrdersPrereation();\n doneOrdersPrereation();\n return;\n }\n }\n\n // If we didn't find an existing order, we must add this new order.\n var order = {\n id: orderDto.id,\n number: orderDto.number,\n name: orderDto.name,\n seat: orderDto.seatLabel,\n isAddOn: orderDto.isAddOn,\n state: orderDto.state\n };\n var timer = { id: order.id, number: order.number, totalSeconds: orderDto.totalSeconds };\n orders.push(order);\n timers.push(timer);\n inProgressOrdersPrereation();\n doneOrdersPrereation();\n}", "title": "" }, { "docid": "686d73806545861af220f0dbfb9860eb", "score": "0.5600552", "text": "function fnModifySpec()\n{\n\tvar orderKey = document.forms[0].orderKey.value;\n\tvar secSeq = document.forms[0].orderSecSeqNo.value;\n\t\n\tdocument.forms[0].action=\"OrderSection.do?method=fetchSectionDetails&orderKey=\"+orderKey\n\t\t\t\t\t\t\t+\"&secSeq=\"+secSeq+\"&revCode=1\";\n\tdocument.forms[0].submit();\n}", "title": "" }, { "docid": "09e8bbcb76eea58005c9dd9dfd7b87d1", "score": "0.5592318", "text": "function createOrderObj(order,i,orderElement) {\n var orderStr = '<tr><th>Order #' + i + '</th></tr>';\n let sum = 0;\n for (let i = 0; i < order.length - 1; i++) {\n let orderObj = JSON.parse(order[i]);\n let str = '<tr><td>' + orderObj.quantity + ' ' + orderObj.name + '</td><td>' + orderObj.total + '$</td></tr > ';\n sum = +sum + +orderObj.total;\n orderStr += str;\n }\n let orderObj = JSON.parse(order[order.length - 1]);\n orderStr += '<tr><td>Name:' + orderObj.fullName + '</td></tr>';\n orderStr += '<tr><td>Address:' + orderObj.address + '</td></tr>';\n orderStr += '<tr><td>Notes:' + orderObj.notes + '</td></tr>';\n orderStr += '<tr><td>Total order price: ' + sum + '$</td></tr>';\n if (orderElement == 'openOrdersTbl') {\n orderStr += '<input type=\"button\" class=\"order-btn\" value=\"Handle order\" onclick=\"forward1('+i+')\"></input>';\n }\n if (orderElement == 'processOrdersTbl') {\n orderStr += '<input type=\"button\" class=\"order-btn\" value=\"Handle order\" onclick=\"forward2(' + i + ')\"></input>';\n }\n if (orderElement == 'finishedOrdersTbl') {\n orderStr += '<input type=\"button\" class=\"order-btn\" value=\"Clear order\" onclick=\"clearOrder(' + i + ')\"></input>';\n } document.getElementById(orderElement).innerHTML += orderStr;\n}", "title": "" }, { "docid": "f3d4bbdc665de3343b93e7390bd57870", "score": "0.55866", "text": "function Add2ShopCart(form)\n{\nvar display;\nfor(var i=0; i<form.elements.length;i++)\ndisplay=display+ \">>\"+ form.elements[i].name + \" = \"+form.elements[i].value;\n\n//alert(display);\n\n if (!busy) {\n busy = true;\n form.action=\"OrderItemAdd\";\n form.URL.value='OrderCalculate?URL=OrderItemDisplay';\n form.submit();\n }\n}", "title": "" }, { "docid": "2bff42d5e07693f55a7b3fcad64144ed", "score": "0.55860007", "text": "function OrderTicketItem(data, orderItem) {\n\n\t\tvar self = this;\n\n\t\tif (data && orderItem) {\n\n\t\t\tthis.orderItem = orderItem;\n\n\t\t\tthis.reference = data.reference;\n\t\t\tthis.id = data.id;\n\t\t\tthis.amount= data.amount;\n\t\t\tthis.description = data.description;\n\t\t\tthis.shipping = data.shipping;\n\n\t\t\tthis.createElement();\n\n\t\t\tdatabase.ref('transactions/' + this.orderItem.reference + '/tickets/' + this.reference + '/').child('shipping').on('value', function (snap) {\n\n\t\t\t\tself.updateShippingStatus(snap.val());\n\n\t\t\t});\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "a7a217de7a4da8b58185b4b0efbff246", "score": "0.5575524", "text": "function loadOrderModal(data) {\n let order = data.order;\n //Loads order information for the order modal box.\n $('#orderModalNumber').text(order.zto_number);\n $('#orderModalQuestionType').text(order.question_types);\n $('#orderModalQuestionText').text(order.question_text);\n $('#orderModalCustomer').text(order.customer);\n $('#orderModalCreateTime').text(order.create_time);\n $('#orderModalServiceName').text(order.service);\n\n}", "title": "" }, { "docid": "302369a9b1f6fa6d694214acb5c9f567", "score": "0.5571239", "text": "function submitOrder() {\n if (checkRequired() == true) {\n let isMember = JSON.parse(localStorage.getItem('isMember'));\n if (isMember == false) {\n submitGuestOrder();\n }\n else {\n submitMemberOrder();\n }\n clearForm();\n updateOrderNum('openOrders', '+');\n }\n}", "title": "" }, { "docid": "f9d638ad273d9c8ecc946b145ca35b41", "score": "0.55580413", "text": "function populatePaymentDetails(){\n if (CURRENT_URL.includes('#')) {\n\t\tlet orderId = CURRENT_URL.substr(CURRENT_URL.indexOf('#') + 1, CURRENT_URL.length);\n\t\tconsole.log(orderId);\n\t\t$(\"#order-id\").val(orderId);\n\n\t}\n}", "title": "" }, { "docid": "4a4716b371a59b15327120de7fce8a27", "score": "0.55475587", "text": "function success() {\n var placeOrderResult = app.getController('COPlaceOrder').Start();\n if (placeOrderResult.error) {\n app.getController('COSummary').Start({\n PlaceOrderError: new Status(Status.ERROR, 'basket.changed.error')\n });\n } else if (placeOrderResult.order_created) {\n app.getController('COSummary').ShowConfirmation(placeOrderResult.Order);\n }\n}", "title": "" }, { "docid": "dd79745fbdbb9a2bd5f28a514339d8c8", "score": "0.5531617", "text": "submitOrder() {\n var self = this;\n\n // When submitting the order, save the order total id, so you can tell the consumer\n self.setState({lookupId: self.state.orderTotalId});\n\n self.state.submittedOrder.map(function(orderItem, index) {\n\n // Set up each individual order with existing info (product id, order total id, order quantity)\n var order = {\n order_total_id: self.state.orderTotalId, \n product_id: orderItem.product_id, \n order_quantity: orderItem.order_quantity\n };\n\n // Grab product info from product id \n var productInfo = self.state.products.filter(function(product) {\n return product.product_id === self.state.submittedOrder[index].product_id; \n });\n\n // Combine product info to the order \n order.product_name = productInfo[0].product_name;\n order.product_price = productInfo[0].product_price;\n order.product_description = productInfo[0].product_description;\n order.product_image = productInfo[0].product_image;\n order.product_category = productInfo[0].product_category;\n order.product_stock = productInfo[0].product_stock;\n order.order_total_id = self.state.orderTotalId;\n\n // Make post request to add new order to the database\n superagent\n .post('/orders')\n .set('Content-Type', 'application/json')\n .send(order)\n .end(function(err, res){\n if (err || !res.ok) {\n return console.log(err);\n } else {\n // After submitting an order, update orders and prepare next total order ID\n self.setState({orderTotalId: (self.state.orderTotalId + 1)});\n self.setState({orders: self.state.orders.concat(order)});\n }\n }); \n })\n }", "title": "" }, { "docid": "b05d4e7ce0a1b81c6d84ea47459df6a7", "score": "0.5529831", "text": "static renderListOrders() {\n GestionPages.gestionPages(\"yourOrders\");\n let contenu = `<form id=\"nbOrder\">\n <div class=\"form-group\">\n <label for=\"nbOrder\">Order number</label>\n <input type=\"text\" class=\"form-control\" id=\"nbOrderInput\" aria-describedby=\"number help\" placeholder=\"Enter order number\" data-toggle=\"popover\" data-content=\"Error number order\" required>\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">Submit</button>\n </form>`;\n document.querySelector(\"#orders\").innerHTML = contenu;\n\n //when customer clikcs on the button \"submit\"\n $(\"#nbOrder\").submit(event => {\n event.preventDefault();\n let valOrder = document.querySelector(\"#nbOrderInput\").value;\n fetch(`http://localhost:9091/api/chargen/${valOrder}`).then((reponse) => {\n if (reponse.ok) {\n window.location.replace(`http://localhost:9091/command/${valOrder}`);\n } else {\n $(\"#nbOrderInput\").popover(\"show\");\n throw new Error(\"connection problem\");\n }\n });\n }\n );\n }", "title": "" }, { "docid": "1f50f05296753a85adebdfeac07452f9", "score": "0.55261296", "text": "handleCheckout() {\n // TODO: API; create an order object containing the information\n let month = this.state.month;\n let day = this.state.day;\n let hour = this.state.hour;\n let min = this.state.min;\n // axios.post(`${baseUrl}/placeorder`, {\n // username: this.props.navigation.state.params.username,\n // food_ordered: {\n\t// restaurant_name: this.props.navigation.state.params.rname,\n\t// address: this.props.navigation.state.params.addr,\n\t// price: this.props.navigation.state.params.price,\n\t// ...order\n // },\n // deliver_time: `${month}_${day}_${hour}_${min}`,\n // deliver_address: this.state.location,\n // fee: this.state.tip\n // }).then(res => {\n // // redirect to profile\n // }).catch(err => {\n // console.log(err);\n // });\n }", "title": "" }, { "docid": "7a0d811c3d8aa130f5093e435584479c", "score": "0.5525811", "text": "async function createOrder() {\n const itemsForNewOrder = []\n let totalOrder = 0\n Object.entries(newOrder).forEach(([key, value]) => {\n if (Number(value.quantity) > 0) {\n itemsForNewOrder.push({\n 'product-id': key,\n quantity: value.quantity,\n 'unit-price': value.unitPrice,\n total: value.total\n })\n totalOrder += Number(value.total)\n }\n })\n if (itemsForNewOrder.length > 0) {\n const createNewOrder = {\n 'customer-id': atomLoggedCustomer,\n items: itemsForNewOrder,\n total: totalOrder.toFixed(2).toString()\n }\n let responseFromFetch = null\n\n // *** Fetch -> POST order (new order of the logged-in customer)\n // and receives the id of that order so we can fill it locally as well\n await fetch(\n 'http://my-json-server.typicode.com/AlexAxis/alexis-teamleader-codingtest-ordering/orders',\n {\n method: 'POST',\n body: JSON.stringify(createNewOrder),\n headers: {\n 'Content-type': 'application/json; charset=UTF-8'\n }\n }\n )\n .then((response) => response.json())\n .then((json) => {\n responseFromFetch = json\n })\n .catch((err) => {\n toast.error(err)\n })\n\n const currentCustomerOrders = JSON.parse(JSON.stringify(atomOrders))\n currentCustomerOrders[atomLoggedCustomer].push(responseFromFetch)\n setAtomOrders(currentCustomerOrders)\n resetOrder()\n toast.success('Order created successfully')\n toast.info(`Check the 'Order List' page`)\n } else {\n toast.warning('WARNING: Empty quantities of products')\n }\n }", "title": "" }, { "docid": "ad7cf567c4a38fc52379065e8969e570", "score": "0.5524831", "text": "function handleSubmit(event) {\n event.preventDefault()\n const newOrder = {\n customer_name: formState.customer_name,\n delivery_address: formState.delivery_address,\n order_details: formState.order_details,\n contact_number: formState.contact_number\n \n }\n addOrderPost(newOrder).then((newOrder) => {\n dispatch({\n type: \"setOrderPosts\",\n data: [newOrder, ...orderPosts]\n })\n history.push(`/orders/${newOrder._id}`)\n \n }).catch((error) => {\n const status = error.response ? error.response.status : 500\n console.log(\"caught error on edit\", error)\n if(status === 403)\n setErrorMessage(\"Log in to make your order\")\n else\n setErrorMessage(\"Well, this is embarrassing... There was a problem on the server.\")\n })\n }", "title": "" }, { "docid": "806f3d9f266a07e953dfde9186b932d0", "score": "0.5521703", "text": "printOrder(order, print_ip, print_port){\n try{\n let printData = {\n eventName: this.config.eventName,\n eventDate: this.config.eventDate,\n eventLocation: this.config.eventLocation,\n footerline: this.config.footerline,\n reference: order.reference,\n created: order.created_at,\n payment: order.payment_method,\n tickets: []\n };\n\n order.tickets.forEach(ticket => {\n\n let qrData = {\n u: ticket.uuid,\n t: ticket.type.id\n };\n \n // base64 encoded\n let encrypted_qr = Buffer.from(JSON.stringify(qrData)).toString('base64');\n\n let ticketData = {\n uuid: ticket.uuid,\n data: Object.assign({},ticket.data),\n type: Object.assign({},ticket.type),\n qrdata: encrypted_qr\n }\n\n printData.tickets.push(ticketData);\n });\n \n // print on specific printer...\n Printer.print(print_ip, print_port, printData);\n } catch(err){\n console.log(\"Printing Error:\")\n console.trace(err);\n }\n }", "title": "" }, { "docid": "074ecd8ef224a991c07a5cae3942e32a", "score": "0.5510026", "text": "async function createOtrsTicket()\n{\n \n // pick content div\n let content = document.getElementById(\"content\");\n \n // determine the issue number for use in ticket title\n let h2_array = content.getElementsByTagName(\"h2\");\n let h2 = h2_array[0];\n let match = /Open (Issue #\\d+)/.exec(h2.innerHTML);\n if (!match) {\n alert(`Cannot parse h2 of '${title}'`);\n throw(\"\");\n } \n \n // give user opportunity to amend title\n let title = match[1];\n title = prompt(\"ticket title:\", title);\n \n // determine username of complainant\n match = /Reported as \\S+ by <a[^>]+>([^<]+)</.exec(content.innerHTML);\n if (!match) {\n alert(`Cannot extract complainant username`);\n throw(\"\");\n }\n let complainant = match[1];\n \n // now clean up the HTML of the issue, by \n // 1. dropping unwanted links\n // 2. dropping the input box at the end\n // 3. fixing a href/img src URLs so they still work in OTRS\n \n let clone = content.cloneNode(true);\n let form = document.evaluate(\"//form\", clone, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n form.parentNode.removeChild(form);\n\n let anchors = clone.getElementsByTagName(\"a\");\n for (let anchor of anchors) \n {\n if (anchor.href.startsWith(\"https://www.openstreetmap.org/issues\")) {\n anchor.href= \"\";\n anchor.innerHTML = \"\";\n } else if (anchor.href.startsWith(\"/\")) {\n anchor.href = \"https://www.openstreetmap.org \" + anchor.href;\n } else {\n anchor.href = anchor.href;\n } \n }\n \n let images = clone.getElementsByTagName(\"img\");\n for (let image of images) {\n if (image.src.startsWith(\"/\")) {\n image.src = \"https://www.openstreetmap.org \" + image.src;\n } else {\n image.src = image.src;\n } \n }\n \n // create JSON message for OTRS\n let ticket = { \n \"Ticket\" : {\n \"Queue\" : queue,\n \"State\" : \"open\",\n \"Priority\" : \"3 normal\",\n \"CustomerUser\" : `${encodeURI(complainant)}@thisdoesnotwork.users.openstreetmap.org`,\n \"Title\" : title\n },\n \"Article\" : {\n \"CommunicationChannel\" : \"Phone\",\n \"ContentType\" : \"text/html; charset=utf8\",\n \"Subject\" : title,\n \"Body\" : clone.innerHTML\n }\n };\n\n // try to retrieve username and password for OTRS from the GreaseMonkey variable store.\n // if not present, ask user & save to store\n let username = GM_getValue(\"otrs_username\");\n if (!username || username === \"\") \n {\n username = prompt(\"OTRS User Name:\");\n GM_setValue(\"otrs_username\", username);\n }\n let password = GM_getValue(\"otrs_password\");\n if (!password || password === \"\") \n {\n password = prompt(\"OTRS Password:\");\n GM_setValue(\"otrs_password\", password);\n }\n \n // add username and password to JSON payload.\n ticket.UserLogin = username;\n ticket.Password = password;\n \n // prepare and execute POST request\n let settings = {\n \"method\" : \"POST\",\n \"body\" : JSON.stringify(ticket)\n };\n let response = await fetch(`https://otrs.openstreetmap.org/otrs/nph-genericinterface.pl/Webservice/OsmWebsiteIntegration/createTicket`, settings);\n let json = await response.json();\n \n // check for error (note, a low-level error like host not responding would cause an exception above\n // and break things)\n if (json.Error) {\n if (json.Error.ErrorCode == \"TicketCreate.AuthFail\") {\n alert(\"OTRS Authentication failed. Try again.\");\n // we have to delete the stored user name and password so that the script asks again next time.\n GM_deleteValue(\"otrs_username\");\n GM_deleteValue(\"otrs_password\");\n return;\n } else {\n alert(\"OTRS error: \" + json.Error.ErrorMessage);\n return;\n }\n }\n \n // on success, plant message into textarea that user can then submit.\n // we *could* close the ticket automatically but let's not do that at this point in time.\n let textarea = document.getElementById(\"issue_comment_body\");\n textarea.value = `OTRS ticket created: #${json.TicketNumber}\\nhttps://otrs.openstreetmap.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=${json.TicketID}`;\n\n // disable the \"create ticket\" link\n if (newlink) \n {\n newlink.innerHTML = \"<s>Create OTRS ticket</s>\";\n newlink.removeEventListener(\"click\", createOtrsTicket);\n newlink.removeAttribute(\"href\");\n newlink.style.enabled = false;\n }\n}", "title": "" }, { "docid": "e1ba35cf18542f72cbb9ee6963f57e91", "score": "0.5506642", "text": "function submitForm(items) {\n // 表單驗證成功\n // contents of submitting\n var orderDict = status();\n\n // 驗證總金額是否為0\n if (orderDict['total'] <= 0) {\n alert(\"你似乎沒購買任何商品!\");\n return;\n } else {\n if (!confirm(\"確定要結帳?\")) {\n return;\n }\n }\n\n // show checkout alert\n alert('【結帳 Checkout】\\n' + orderDict['outputText']);\n \n\n // prepare the post data\n var email = $('[name=\"email\"]').val() || '未填寫';\n\n // confirm to post order\n if (!confirm(\"按下確定送出訂單\\n確認信將會寄至:\" + email)) {\n return;\n }\n\n // prepare the post data\n var name = $('[name=\"name\"]').val() || '未填寫';\n var studentID = $('[name=\"studentID\"]').val() || '未填寫';\n var department = $('[name=\"department\"]').val() || '未填寫';\n var grade = $('[name=\"grade\"]').val() || '未填寫';\n var phoneNumber = $('[name=\"phoneNumber\"]').val() || '未填寫';\n var time = function() {\n var selected;\n $('[name=\"date\"]').each(function() {\n if ($(this).prop('checked') === true)\n selected = $(this).val();\n });\n if (!selected) {\n selected = '未填寫';\n }\n return selected;\n }\n var total = orderDict['total'];\n // client info\n var now = moment(moment().valueOf()).format('YYYY-MM-DD HH:mm:ss');\n var href = window.location.href;\n\n //create the json construction\n var dict = {\n \"timestamp\": now,\n \"name\": name,\n \"studentID\": studentID,\n \"department\": department,\n \"grade\": grade,\n \"phoneNumber\": phoneNumber,\n \"email\": email,\n \"time\": time(),\n \"total\": total,\n \"quantity\": orderDict,\n \"href\": href,\n };\n\n var postData = dict;\n postData['method'] = \"write\";\n\n var jsonObj = [];\n jsonObj.push(dict);\n postData['jsonRaw'] = JSON.stringify(jsonObj);\n\n // do ajax submit\n $.ajax({\n type: \"post\",\n data: postData,\n url: \"https://script.google.com/macros/s/AKfycbw-DnUUzyCPoS8F6QKOz12o9S8_pwamMN0cpWjxPE38f3wyWRAj/exec\",\n // 填入網路應用程式網址\n success: function(e) {\n alert(e);\n }\n });\n\n //finished\n alert(\"訂單已送出!確認信已寄至您的電子郵件信箱!\");\n\n $('[href=\"assets/style.css\"]').removeAttr(\"href\");\n var mailBody = sendMail(dict);\n var body = document.querySelector('body')\n body.innerHTML = mailBody;\n}", "title": "" }, { "docid": "28a3d9bc633c9892238268615a4058ef", "score": "0.5502704", "text": "function fnViewCurrentEDLNumbers(){\n\n\tvar dataLocationType=\"W\"; ////for workingspec(\"W\") order in modiy screen only\n\t\n\tvar orderkey = document.forms['OrderSectionForm'].orderKey.value;\n\t\n\tvar orderNo = document.forms['OrderSectionForm'].hdnorderno.value;\n\t\n\tvar modelName = document.forms['OrderSectionForm'].modelName.value;\n\t\n\tvar customerName = document.forms['OrderSectionForm'].customerName.value;\n\t\n\tvar statusDesc = document.forms['OrderSectionForm'].statusDesc.value;\n \t\n\twindow.open(\"historyEdlAction.do?method=fetchEdlNo&orderKey=\"+orderkey+\"&OrderNum=\"+orderNo+\"&CustomerName=\"+customerName+\"&SpecStatus=\"+statusDesc+\"&modelName=\"+modelName+\"&dataLocationType=\"+dataLocationType+\"\",'OrderClause','location=0,resizable=yes ,status=0,scrollbars=1,WIDTH=900,height=500');\n}", "title": "" }, { "docid": "0fe5a66ace566ff434c4c73351c58f52", "score": "0.54967314", "text": "function submitCheckout() {\n const productIds = [];\n\n state.cart.forEach((item) => {\n for (let i = 0; i < item.purchaseQuantity; i++) {\n productIds.push(item._id);\n }\n });\n\n getCheckout({\n variables: { products: productIds }\n });\n }", "title": "" }, { "docid": "59bb2c3798ac25883d3e2eb0eec3e299", "score": "0.5488648", "text": "function sendOrder(e) {\n e.preventDefault();\n const order = data.map((ele) => ({\n id: ele.id,\n nameProduct: ele.name,\n quantity: ele.count,\n }));\n\n createCollection(order, name, mesa, time, resetOrders);\n }", "title": "" }, { "docid": "054b06e567f6bb7f1024721b6a9ef13d", "score": "0.54886204", "text": "function fnDeletedClausesHistory()\n{\n\tvar orderkey=document.forms[0].orderKey.value;\n\tvar secSeqNo=document.forms[0].orderSecSeqNo.value;\n\n\tdocument.forms[0].action=\"OrderSection.do?method=deletedClausesHistoy&secSeqNo=\"+secSeqNo;\n\tdocument.forms[0].submit();\n\t\n}", "title": "" }, { "docid": "3fe996543aed264455c549d286ebd56c", "score": "0.5487302", "text": "function submitOrder() {\n let form = document.forms[\"orderform\"].elements;\n let products = localStorage.getItem(\"cartContent\").split(\",\");\n let sentData = {\n contact: {\n firstName: form.firstname.value,\n lastName: form.lastname.value,\n address: form.address.value,\n city: form.city.value,\n email: form.formemail.value,\n },\n products: products,\n };\n fetch(\"http://localhost:3000/api/teddies/order\", { method: \"POST\", body: JSON.stringify(sentData), headers: { \"Content-Type\": \"application/json\" } })\n .then((res) => res.json())\n .then((json) => {\n console.log(json);\n let orderId = json.orderId;\n localStorage.setItem(\"cartContent\", \"\");\n window.location.href = \"commande.html?id=\" + orderId;\n });\n}", "title": "" }, { "docid": "2f88d38c8afe00b40cd5132a101f0baf", "score": "0.5480262", "text": "function addProductionOrderDetail(index, idProduct, quantity, name ){\n\t var hiddens = '';\n\t hiddens+='<input type=\"hidden\" value=\"'+idProduct+'\" name=\"productionOrderDetail['+index+'].idProduct\" />';\n\t hiddens+='<input type=\"hidden\" value=\"'+quantity+'\" name=\"productionOrderDetail['+index+'].quantity\" />';\n\t hiddens+='<input type=\"hidden\" value=\"'+name+'\" name=\"productionOrderDetail['+index+'].name\" />';\n\t return hiddens;\n }", "title": "" }, { "docid": "81bf71ef37df6ada916090be66ffef7a", "score": "0.5468827", "text": "function getOrder() {\n\n let form = document.forms[\"contactInfoForm\"];\n let fd = new FormData(form)\n let data = {};\n\n for (let [key, prop] of fd) {\n data[key] = prop;\n }\n\n var order = new Object();\n var customer = new Object();\n var details = new Array();\n customer.name = data.fname + \" \" + data.lname;\n customer.number = data.phoneNumber;\n customer.email = data.eMail;\n order.customer = customer;\n order.pickupDateTime = \"2021-04-26T10:00:00Z\";\n order.comment = data.comments;\n\n //using code from https://stackoverflow.com/questions/18238173/javascript-loop-through-json-array as refrence\n for (var i = 0; i < itemsInCart.length; i++) {\n var obj = itemsInCart[i];\n var prod = new Object();\n var d = new Object();\n prod.id = obj.product.id;\n d.product = prod;\n d.size = obj.size;\n if (obj.size == \"Small\") {\n d.price = obj.product.smallprice;\n } else if (obj.size == \"Medium\") {\n d.price = obj.product.mediumprice;\n } else if (obj.size == \"Large\") {\n d.price = obj.product.mediumprice;\n }\n details.push(d);\n }\n\n order.details = details;\n console.log(order);\n\n return JSON.stringify(order);\n}", "title": "" }, { "docid": "73ad779ad23f16084fab4b66f7a5cfde", "score": "0.5459727", "text": "function callOnOrderService() {\n\tcurrentPageInOnOrder = 1;\n\tif ($('#orderPopUpCntnt').html() == '') {\n\n\t\tvar hdrParam = {\n\n\t\t\t\"iv_article\" : articleNo,\n\t\t\t\"iv_order_no\" : \"\",\n\t\t\t\"iv_delivery_from\" : \"\",\n\t\t\t\"iv_delivery_to\" : \"\",\n\t\t\t\"iv_order_type\" : \"\",\n\t\t\t\"iv_order_status\" : \"\",\n\t\t\t\"iv_node_id\" : \"\",\n\t\t\t\"iv_node_lvl\" : \"\",\n\t\t\t\"iv_srs_ind\" : \"\",\n\t\t\t\"iv_supplier_no\" : \"\",\n\t\t\t\"iv_session_id\" : \"111\",\n\t\t\t\"iv_site\" : $('#posSite').val(),\n\t\t\t\"iv_sales_org\" : $('#salesOrg').val(),\n\t\t\t\"iv_check_alloc\" : \"\",\n\t\t\t\"iv_alloc_flag\" : \"Y\",\n\t\t\t\"iv_article_filter\" : 'Y',\n\t\t\t\"iv_deleted_flag\" : 'N',\n\t\t\t\"iv_tab_code\" : \"SOO\"\n\t\t};\n\t\tvar inputDataForHdr = JSON.stringify(hdrParam);\n\t\tconsole.log(getOrderHdrBasicInfoUrl + ' ' + inputDataForHdr);\n\t\tstartLoading();\n\n\t\t$\n\t\t\t\t.post(getOrderHdrBasicInfoUrl, inputDataForHdr)\n\t\t\t\t.done(\n\t\t\t\t\t\tfunction(response) {\n\n\t\t\t\t\t\t\tvar orderList = response;\n\t\t\t\t\t\t\tif (orderList != null && orderList != undefined\n\t\t\t\t\t\t\t\t\t&& orderList.length > 0\n\t\t\t\t\t\t\t\t\t&& orderList[0].order_no != undefined) {\n\t\t\t\t\t\t\t\trecordCountInOnOrder = orderList.length;\n\t\t\t\t\t\t\t\tvar j = 1;\n\t\t\t\t\t\t\t\tvar k = 1;\n\t\t\t\t\t\t\t\tvar content = '';\n\n\t\t\t\t\t\t\t\tvar tableStart = '<table cellspacing=\"0\" class=\" ContentTable \" id=\"onOrderTable\"><thead><tr><th class=\"\">Order #</th><th class=\"centerValue\">Order Qty.</th>'\n\t\t\t\t\t\t\t\t\t\t+ '<th class=\"centerValue\">Delivery Date</th><th class=\"\">Supplier</th><th class=\"\">Source</th><th class=\"lastColumn centerValue\">Status</th>'\n\t\t\t\t\t\t\t\t\t\t+ '</tr></thead><tbody >';\n\t\t\t\t\t\t\t\tvar tableEnd = '</tbody></table>';\n\t\t\t\t\t\t\t\tvar list = orderList;\n\t\t\t\t\t\t\t\tfor ( var i = 0; i < list.length; i++) {\n\t\t\t\t\t\t\t\t\tlist[i].som_order_no = list[i].som_order_no != null ? list[i].som_order_no\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].order_no = list[i].order_no != null ? list[i].order_no\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].order_status = list[i].order_status != null ? list[i].order_status\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].supplier_name = list[i].supplier_name != null ? list[i].supplier_name\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].supplier_no = list[i].supplier_no != null ? list[i].supplier_no\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].source = list[i].source != null ? list[i].source\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].total_cartons = list[i].total_cartons != null ? list[i].total_cartons\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].total_pallets = list[i].total_pallets != null ? list[i].total_pallets\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tlist[i].delivery_date = list[i].delivery_date != null ? list[i].delivery_date\n\t\t\t\t\t\t\t\t\t\t\t: \"\";\n\t\t\t\t\t\t\t\t\tcontent += '<tr class=\"page-' + j + ' ';\n\t\t\t\t\t\t\t\t\tif (i > 6) {\n\t\t\t\t\t\t\t\t\t\tcontent += 'hideBlock';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcontent += '\" ><td>';\n\t\t\t\t\t\t\t\t\tif (list[i].som_order_no == \"\") {\n\t\t\t\t\t\t\t\t\t\tcontent += list[i].order_no.replace(\n\t\t\t\t\t\t\t\t\t\t\t\t/^0+/, '')\n\t\t\t\t\t\t\t\t\t\t\t\t+ '</td>';\n\t\t\t\t\t\t\t\t\t} else if (list[i].som_order_no != list[i].order_no) {\n\t\t\t\t\t\t\t\t\t\tcontent += list[i].som_order_no\n\t\t\t\t\t\t\t\t\t\t\t\t+ ' ('\n\t\t\t\t\t\t\t\t\t\t\t\t+ list[i].order_no.replace(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/^0+/, '') + ')'\n\t\t\t\t\t\t\t\t\t\t\t\t+ '</td>';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tcontent += list[i].order_no.replace(\n\t\t\t\t\t\t\t\t\t\t\t\t/^0+/, '')\n\t\t\t\t\t\t\t\t\t\t\t\t+ '</td>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcontent += '<td class=\"centerValue\">'\n\t\t\t\t\t\t\t\t\t\t\t+ list[i].total_cartons\n\t\t\t\t\t\t\t\t\t\t\t+ '</td><td class=\"centerValue\">'\n\t\t\t\t\t\t\t\t\t\t\t+ (list[i].delivery_date != '' ? (list[i].delivery_date)\t\t// defect Defect_9935\n\t\t\t\t\t\t\t\t\t\t\t\t\t: '') + '</td>'\n\t\t\t\t\t\t\t\t\t\t\t+ '<td class=\"\">';\n\t\t\t\t\t\t\t\t\tif (list[i].supplier_name != '')\n\t\t\t\t\t\t\t\t\t\tcontent += list[i].supplier_name;\n\t\t\t\t\t\t\t\t\tif (list[i].supplier_no != '')\n\t\t\t\t\t\t\t\t\t\tcontent += '(' + list[i].supplier_no\n\t\t\t\t\t\t\t\t\t\t\t\t+ ')';\n\t\t\t\t\t\t\t\t\tcontent += '</td>'\n\t\t\t\t\t\t\t\t\t\t\t+ '<td class=\"centerValue\">'\n\t\t\t\t\t\t\t\t\t\t\t+ list[i].source + '</td>'\n\t\t\t\t\t\t\t\t\t\t\t+ '<td class=\"centerValue\">'\n\t\t\t\t\t\t\t\t\t\t\t+ list[i].order_status + '</td>';\n\t\t\t\t\t\t\t\t\tcontent += '</tr>';\n\n\t\t\t\t\t\t\t\t\tif (k % 7 == 0) {\n\t\t\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tk++;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$('#orderPopUpCntnt').html(\n\t\t\t\t\t\t\t\t\t\ttableStart + content + tableEnd);\n\t\t\t\t\t\t\t\t$('.onOrderTitle').removeClass('hideBlock');\n\t\t\t\t\t\t\t\t$('#onOrderCount').text(recordCountInOnOrder);\n\t\t\t\t\t\t\t\t$('.onOrderPaginationDiv').pagination({\n\t\t\t\t\t\t\t\t\titems : recordCountInOnOrder,\n\t\t\t\t\t\t\t\t\titemsOnPage : 7,\n\t\t\t\t\t\t\t\t\tcssStyle : 'compact-theme',\n\t\t\t\t\t\t\t\t\tcurrentPage : currentPageInOnOrder,\n\t\t\t\t\t\t\t\t\tonPageClick : function(pageNumber, event) {\n\t\t\t\t\t\t\t\t\t\tgetOnOrdersForPagination(pageNumber);\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\tif (recordCountInOnOrder / itemsOnPage > 1) {\n\t\t\t\t\t\t\t\t\t$('.onOrderPaginationDiv').removeClass(\n\t\t\t\t\t\t\t\t\t\t\t'hideBlock');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('.onOrderPaginationDiv').addClass(\n\t\t\t\t\t\t\t\t\t\t\t'hideBlock');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('.onOrderPaginationDiv')\n\t\t\t\t\t\t\t\t\t\t.addClass('hideBlock');\n\t\t\t\t\t\t\t\t$('.onOrderTitle').addClass('hideBlock');\n\t\t\t\t\t\t\t\tvar error = '<table class=\"ContentTable\" cellspacing=\"0\"><tbody id=\"orderPopUpErrorTable\"></tbody></table>';\n\t\t\t\t\t\t\t\t$('#orderPopUpCntnt').html(error);\n\t\t\t\t\t\t\t\t$('#orderPopUpErrorTable')\n\t\t\t\t\t\t\t\t\t\t.html(\n\t\t\t\t\t\t\t\t\t\t\t\t'<div class=\"errorDiv promoError\"><label>No Data Found.</label></div>');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstopLoading();\n\n\t\t\t\t\t\t});\n\t}\n}", "title": "" }, { "docid": "e68a03b423c1959842960ff639f9a30c", "score": "0.5439314", "text": "function getQuoteDetails(){\r\n\r\n }", "title": "" }, { "docid": "87d79738d5079c1ae31718c33ff8d8f1", "score": "0.5435812", "text": "function OrderSummary() {\n\n var mbDataLoaded = false;\n var mbSavePending = false;\n var mbSaving = false;\n var mbSaveAndClear = false;\n var mbSettingFieldValues = false;\n var mbCancellingChanges = false;\n \n var mbEventHandlersAttached = false; //Ensures event handlers are not attached multiple times.\n \n var mbIE = (!window.addEventListener || navigator.appName.indexOf(\"Internet Explorer\") >= 0) ? true : false;\n \n var mbUseProxy = false;\n var msXHRResponseFormat = \"XML\";\n \n var moAjax = null;\n var moAjaxEmployees = null;\n var moAjaxOrderSummary = null;\n var moAjaxOrderQty = null;\n \n var moCloak = new Cloaker();\n \n var moStatusMsg = null;\n var moMainBox = $(\"OrderSummaryBox\");\n var moOrderQtyBox = $(\"QtyFieldsGroup\");\n \n var moActionBar = null;\n var moActionRefresh = null;\n var moActionSave = null;\n var moActionCancel = null;\n \n var moOrderSummary = null;\n var moOrderQty = null;\n var moEmployees = null;\n \n var msOrderID = null;\n var msEmployeeID = null;\n \n var mbEmployeesLoading = false;\n var mbOrderQtyLoading = false;\n \n var msModifiedSummaryValues = null;\n var msModifiedQtyValues = null;\n \n var msUserType = $(\"UserType\").value;\n \n //\"submit\" for an order that has been \"authorized\" but not yet submitted for processing.\n //\"save\" for an order that has already been submitted for processing and can be editted\n var msSaveMode = \"save\";\n \n //-------------------------------------------------------------------------------------\n // Function to return a reference to the specified element/object in the specified container.\n //-------------------------------------------------------------------------------------\n function $field(sID, oBox) {\n\n if (!oBox) oBox = moMainBox;\n\n var oItem = null;\n \n try {\n\t for (var i=0; i < oBox.childNodes.length; i++)\n\t {\n\t var oItem = oBox.childNodes[i];\n\t if (oItem.id == sID) return oItem;\n\t }\n }\n catch(e) {\n return null;\n }\n \n //If we get here, element/field item was not found.\n return null;\n }\n \n //-------------------------------------------------------------------------------------\n // Function to return the value for the specified element/object in the specified container.\n //-------------------------------------------------------------------------------------\n function $fieldVal(sID, oBox) {\n \n if (!oBox) oBox = moMainBox;\n\n var oItem = null;\n \n try {\n\t for (var i=0; i < oBox.childNodes.length; i++)\n\t {\n\t var oItem = oBox.childNodes[i];\n\t if (oItem.id == sID) return oItem.value;\n\t }\n }\n catch(e) {\n return null;\n }\n \n //If we get here, element/field item was not found.\n return null;\n }\n\n //-------------------------------------------------------------------------------------\n // Cancel pending changes. \n //-------------------------------------------------------------------------------------\n this.CancelChanges = function() {\n\n //if (IsBusy()) return;\n \n //If no pending changes to the Order Summary or the Item List, get outta here.\n if (!mbSavePending) {\n sMsg = \"There are no unsaved changes to cancel.\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", true, true, \"\", 4000);\n return;\n }\n \n //Verify CANCEL action.\n var sMsg = \"Are you sure you want to cancel your changes? \\n\";\n if (!confirm(sMsg)) return;\n \n var sMsg = \"Cancelling changes and refreshing order information, please wait...\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, false);\n \n //Set success message to be displayed.\n mbCancellingChanges = true; \n \n //Reset SAVE PENDING flag.\n SetSave(\"off\");\n \n //Reset SAVE PENDING flag in Order Items list.\n //moOrderItemsList.SetSaveOff();\n \n //Initiate refresh of Order information.\n Refresh();\n \n //Initiate refresh of Order Items information.\n //moOrderItemsList.RefreshInit();\n \n } \t\n \n //-------------------------------------------------------------------------------------\n // Public access to Checks the Qty Requirements against what is currently selected in the list of \n // selected products.\n //-------------------------------------------------------------------------------------\n this.CheckQtyRequirements_public = function() \n {\n CheckQtyRequirements();\n }\n \n //-------------------------------------------------------------------------------------\n // Resets/clears all status message objects when the user begins typing into an input \n // field.\n //-------------------------------------------------------------------------------------\n function ClearStatusMsg() \n {\n\n SetStatusMsg(\"MainStatusMsg\", \"\");\n //SetStatusMsg(\"StatusMsg\", \"\");\n }\n \n //-------------------------------------------------------------------------------------\n // Public method to return the Save Action object for the Order Summary.\n //-------------------------------------------------------------------------------------\n this.GetSaveAction = function() \n {\n return moActionSave;\n }\n\n \n //-------------------------------------------------------------------------------------\n // Public method to return the Company ID for this order.\n //-------------------------------------------------------------------------------------\n this.GetCompanyID = function() \n {\n return $data(\"CompanyID\", moOrderSummary[0]);\n }\n \n //-------------------------------------------------------------------------------------\n // Returns object containing field value and whether it has been updated or not.\n //-------------------------------------------------------------------------------------\n function GetFieldValue(oData, sFieldID) {\n \t\n var oResult = null;\n \n var oFields = oData.childNodes;\n \n for (var i=0; i < oFields.length; i++){\n var oField = oFields[i];\n if (oField.id === sFieldID) {\n var sTag = oField.tagName.toLowerCase();\n //sCurrVal = (sTag === \"label\") ? oField.innerHTML : oField.value;\n sCurrVal = (oField.readOnly === true || sTag === \"label\") ? oField.getAttribute(\"LastVal\") : oField.value;\n sLastVal = oField.getAttribute(\"LastVal\");\n oResult = {\n \"Updated\" : (sCurrVal === sLastVal) ? false : true,\n \"Value\" : sCurrVal\n };\n break;\n }\n } \n\n //Return result.\n return oResult;\n }\n \n //-------------------------------------------------------------------------------------\n // Returns field value, and whether it has been updated or not, for a FieldsGroup \n // container.\n //-------------------------------------------------------------------------------------\n function GetFieldGroupValue(oBox, sFieldID) {\n \t\n var oResult = null;\n \n var oFieldWraps = oBox.childNodes;\n \n for (var i=0; i < oFieldWraps.length; i++)\n {\n var oFieldWrap = oFieldWraps[i];\n \n //ignore text nodes.\n if (oFieldWrap.nodeType != 1) continue;\n \n var oFields = oFieldWrap.childNodes;\n \n for (var p=0; p < oFields.length; p++)\n {\n var oField = oFields[p];\n \n //ignore text nodes.\n if (oField.nodeType != 1) continue;\n \n if (oField.id === sFieldID) {\n var sTag = oField.tagName.toLowerCase();\n sCurrVal = (sTag === \"label\") ? oField.innerHTML : oField.value;\n //sCurrVal = (oField.readOnly === true || sTag === \"label\") ? oField.getAttribute(\"LastVal\") : oField.value;\n sLastVal = oField.getAttribute(\"LastVal\");\n oResult = {\n \"Updated\" : (sCurrVal === sLastVal) ? false : true,\n \"Value\" : sCurrVal\n };\n return oResult;\n break;\n }\n }\n } \n\n //Return result.\n return oResult;\n \n }\n \n //-------------------------------------------------------------------------------------\n // Returns changes to Quantity Requirements in pipe-delimited string.\n //-------------------------------------------------------------------------------------\n function GetModifiedQtyValues() {\n\n var sVals = \"\";\n \n var bInvalidValuesFound = false;\n \n var oData = moOrderQtyBox.childNodes;\n\n //Build pipe-delimited string of values. Each name-value pair is separated by a \n //single pipe character, and each record is separated by two pipe-characters. \n var bValidDate;\n for (var i=0; i<oData.length; i++)\n {\n //ignore text nodes.\n if (oData[i].nodeType != 1) continue; \n \n //Ignore the instructional message.\n if (oData[i].id == \"QtyMsgFieldWrapper\") continue;\n \n var sStatus = oData[i].getAttribute(\"UpdateStatus\");\n \n var sOrderID = oData[i].getAttribute(\"OrderID\");\n var sProductGroupID = oData[i].getAttribute(\"ProductGroupID\");\n var sQty = GetFieldValue(oData[i],\"OrderQty\").Value;\n \n if (sStatus == \"delete\") \n {\n sVals += \"UpdateStatus=\" + sStatus + \"|\";\n sVals += \"OrderID=\" + sOrderID + \"|\";\n sVals += \"ProductGroupID=\" + sProductGroupID + \"|\";\n \n sVals += \"|\"; //Double-up pipe character for record delimiter.\n }\n else\n if (sStatus == \"update\" || sStatus == \"insert\") \n {\n sVals += \"UpdateStatus=\" + sStatus + \"|\";\n sVals += \"OrderID=\" + sOrderID + \"|\";\n sVals += \"ProductGroupID=\" + sProductGroupID + \"|\";\n sVals += \"Qty=\" + sQty + \"|\";\n \n //var oField = GetFieldValue(\"RegCount\");\n //if (oDateField.Updated) sVals += \"RegCount=\" + oField.Value + \"|\";\n \n sVals += \"|\"; //Double-up pipe character for record delimiter.\n }\n \n }\n\n //alert(\"Modified Exam Time values: \" + sVals);\n\n //Return string to caller.\n return (bInvalidValuesFound) ? \"ERROR: Invalid values found.\" : sVals;\n }\n\n //-------------------------------------------------------------------------------------\n // Returns a string of pipe-delimited values containing modified field values in the \n // Orders List.\n //-------------------------------------------------------------------------------------\n function GetModifiedSummaryValues() {\n\n var sVals = \"\";\n \n var bInvalidValuesFound = false;\n\n //Build pipe-delimited string of values. Each name-value pair is separated by a \n //single pipe character, and each record is separated by two pipe-characters. \n var bValidDate;\n \n //Get the update status and the Order ID for the row.\n var sStatus = \"update\";\n var sOrderID = msOrderID;\n \n var oBox = null;\n \n //\n //Get field values.\n //\n \n oBox = $(\"GeneralFieldsGroup\"); \n var oOrderStatus = GetFieldGroupValue(oBox,\"OrderStatus\");\n \n oBox = $(\"DateFieldsGroup\"); \n if (oBox)\n {\n var oAuthorizeDate = GetFieldGroupValue(oBox,\"AuthorizeDate\",true);\n var oSubmitDate = GetFieldGroupValue(oBox,\"SubmitDate\", true);\n var oEstimateDate = GetFieldGroupValue(oBox,\"EstimateDate\",true);\n var oProcessDate = GetFieldGroupValue(oBox,\"ProcessDate\", true);\n var oShipDate = GetFieldGroupValue(oBox,\"ShipDate\", true);\n var oDeliverDate = GetFieldGroupValue(oBox,\"DeliverDate\", true);\n var oHoldDate = GetFieldGroupValue(oBox,\"HoldDate\", true);\n var oCancelDate = GetFieldGroupValue(oBox,\"CancelDate\", true);\n var oCloseDate = GetFieldGroupValue(oBox,\"CloseDate\", true);\n } \n \n oBox = $(\"CustomFieldsGroup\"); \n if (oBox)\n {\n var oCustom1 = GetFieldGroupValue(oBox,\"Custom1\");\n var oCustom2 = GetFieldGroupValue(oBox,\"Custom2\");\n var oCustom3 = GetFieldGroupValue(oBox,\"Custom3\");\n var oCustom4 = GetFieldGroupValue(oBox,\"Custom4\");\n var oCustom5 = GetFieldGroupValue(oBox,\"Custom5\");\n }\n \n oBox = $(\"CommentsFieldsGroup\"); \n if (oBox)\n {\n var oComments = GetFieldGroupValue(oBox,\"Comments\");\n }\n \n oBox = $(\"DeliveryFieldsGroup\"); \n if (oBox)\n {\n var oDeliverMethod = GetFieldGroupValue(oBox,\"DeliverMethod\");\n var oDeliverAddrLine1 = GetFieldGroupValue(oBox,\"DeliverAddrLine1\");\n var oDeliverAddrLine2 = GetFieldGroupValue(oBox,\"DeliverAddrLine2\");\n var oDeliverAddrLine3 = GetFieldGroupValue(oBox,\"DeliverAddrLine3\");\n }\n \n //\n //Build pipe-delimited string of values.\n //\n \n if (sStatus == \"delete\") \n {\n sVals += \"UpdateStatus=\" + sStatus + \"|\";\n sVals += \"OrderID=\" + sOrderID + \"|\";\n \n sVals += \"|\"; //Double-up pipe character for record delimiter.\n }\n else\n if (sStatus == \"update\" || sStatus == \"insert\") \n {\n //Set the type of database update that will be done.\n sVals += \"UpdateStatus=\" + sStatus + \"|\";\n sVals += \"OrderID=\" + sOrderID + \"|\";\n \n //Hold onto the initial length so we can dertermine is any fields were actually updated.\n var iInitValsLen = sVals.length;\n \n //OrderStatus field updated?\n if (oOrderStatus.Updated) sVals += \"OrderStatus=\" + oOrderStatus.Value + \"|\";\n \n //Check each Date field for changes.\n if (oAuthorizeDate && oAuthorizeDate.Updated) sVals += \"AuthorizeDate=\" + oAuthorizeDate.Value + \"|\";\n if (oSubmitDate && oSubmitDate.Updated) sVals += \"SubmitDate=\" + oSubmitDate.Value + \"|\";\n if (oEstimateDate && oEstimateDate.Updated) sVals += \"EstimateDate=\" + oEstimateDate.Value + \"|\";\n if (oProcessDate && oProcessDate.Updated) sVals += \"ProcessDate=\" + oProcessDate.Value + \"|\";\n if (oShipDate && oShipDate.Updated) sVals += \"ShipDate=\" + oShipDate.Value + \"|\";\n if (oDeliverDate && oDeliverDate.Updated) sVals += \"DeliverDate=\" + oDeliverDate.Value + \"|\";\n if (oHoldDate && oHoldDate.Updated) sVals += \"HoldDate=\" + oHoldDate.Value + \"|\";\n if (oCancelDate && oCancelDate.Updated) sVals += \"CancelDate=\" + oCancelDate.Value + \"|\";\n if (oCloseDate && oCloseDate.Updated) sVals += \"CloseDate=\" + oCloseDate.Value + \"|\";\n \n //Check Delivery fields for changes.\n if (oDeliverMethod && oDeliverMethod.Updated) sVals += \"DeliverMethod=\" + oDeliverMethod.Value + \"|\";\n if (oDeliverAddrLine1 && oDeliverAddrLine1.Updated) sVals += \"DeliverAddrLine1=\" + oDeliverAddrLine1.Value + \"|\";\n if (oDeliverAddrLine2 && oDeliverAddrLine2.Updated) sVals += \"DeliverAddrLine2=\" + oDeliverAddrLine2.Value + \"|\";\n if (oDeliverAddrLine3 && oDeliverAddrLine3.Updated) sVals += \"DeliverAddrLine3=\" + oDeliverAddrLine3.Value + \"|\";\n \n //Check Comments field for changes.\n if (oComments && oComments.Updated) sVals += \"Comments=\" + oComments.Value + \"|\";\n \n //Check each Custom Field for changes.\n if (oCustom1 && oCustom1.Updated) sVals += \"Custom1=\" + oCustom1.Value + \"|\";\n if (oCustom2 && oCustom2.Updated) sVals += \"Custom2=\" + oCustom2.Value + \"|\";\n if (oCustom3 && oCustom3.Updated) sVals += \"Custom3=\" + oCustom3.Value + \"|\";\n if (oCustom4 && oCustom4.Updated) sVals += \"Custom4=\" + oCustom4.Value + \"|\";\n if (oCustom5 && oCustom5.Updated) sVals += \"Custom5=\" + oCustom5.Value + \"|\";\n \n //Double-up pipe character for record delimiter. \n sVals += \"|\";\n }\n \n //If the initial lenght of the string is the same as the final length, then that means\n //no changes were made to any Summary fields, so clear the string so we don't think \n //an update made and send an incomplete update (no data) to the database.\n if ((iInitValsLen + 1) == sVals.length) sVals = \"\";\n\n //Return string to caller.\n return (bInvalidValuesFound) ? \"ERROR: Invalid values found.\" : sVals;\n }\n \n //-------------------------------------------------------------------------------------\n // Return Qty Requirement for the specified product category and product group. \n //-------------------------------------------------------------------------------------\n this.GetQtyRequirement = function(sSearchCategoryID, sSearchGroupID) \n {\n var iQty = 0;\n \n //Display data.\n for (var i=0; i < moOrderQty.length; i++) \n {\n var oRecord = moOrderQty[i];\n \n var sCategoryID = $data(\"ProductCategoryID\", oRecord);\n var sGroupID = $data(\"ProductGroupID\", oRecord);\n var sQty = $data(\"Qty\", oRecord);\n \n if (sSearchCategoryID == sCategoryID && sSearchGroupID == sGroupID)\n {\n iQty = parseInt(sQty,10);\n break;\n }\n }\n \n return iQty;\n \n }\n \n //-------------------------------------------------------------------------------------\n // Retrieves all data required by the user interface.\n //-------------------------------------------------------------------------------------\n this.Init = function(sOrderID) {\n \n msOrderID = sOrderID;\n \n //Set the status message object.\n var oLabels = moMainBox.getElementsByTagName(\"LABEL\");\n for (var i=0; i<oLabels.length; i++)\n {\n if (oLabels[i].className == \"StatusMsg\") \n {\n moStatusMsg = oLabels[i];\n break;\n }\n }\n \n //Get reference to the action bar object.\n var oItems = $(\"OrderActionBox\").getElementsByTagName(\"DIV\");\n for (var i=0; i<oItems.length; i++)\n {\n if (oItems[i].className.indexOf(\"ActionBar\") >= 0) \n {\n moActionBar = oItems[i];\n break;\n }\n }\n \n //Get reference to each action.\n var oItems = moActionBar.getElementsByTagName(\"a\");\n for (var i=0; i<oItems.length; i++)\n {\n switch (oItems[i].id)\n {\n case \"ActionRefresh\":\n moActionRefresh = oItems[i];\n break;\n case \"ActionSave\":\n moActionSave = oItems[i];\n break;\n case \"ActionCancel\":\n moActionCancel = oItems[i];\n break;\n }\n }\n \n //If order number is missing or invalid, display error message and get outta here.\n if (!msOrderID || msOrderID == \"0\") \n {\n var sMsg = \"No order information available (invalid order serial number).\";\n var sDetails = \"Invalid or missing order serial number.\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, sDetails, true, false);\n return;\n }\n \n //Initiate retrieval of Qty Requirements. When done, retrieval of the Order Summary\n //data is initiated.\n RetrieveQtyRequirements();\n \n }\n \n //-------------------------------------------------------------------------------------\n // Returns status of SAVE PENDING flag.\n //-------------------------------------------------------------------------------------\n this.IsSavePending = function() {\n \n return mbSavePending;\n \n }\n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the Custom Fields container.\n //-------------------------------------------------------------------------------------\n function PopulateCustomFieldsBox(oData) {\n \n var oBox = $(\"CustomFieldsGroup\");\n \n try {\n //Only display for admin users.\n if (msUserType != \"admin\") \n {\n \t oBox.parentNode.style.display = \"none\";\n \t return;\n \t }\n \t}\n \tcatch(e) {return;}\n \n oBox.innerHTML = \"\";\n \n for (var i=1; i<=5; i++) \n {\n //Insert container for all columns/fields.\n\t var oItemBox = document.createElement(\"DIV\");\n\t oItemBox.id = \"Custom\" + i + \"FieldWrapper\";\n\t oItemBox.className = \"FieldWrapper\";\n\t oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n\t oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = \"Custom\" + i + \"Hdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr\";\n oItem.style.marginLeft = \"15px\";\n //oItem.style.width = \"300px\";\n oItem.innerHTML = \"Custom Field \" + i + \": \"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = \"Custom\" + i;\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n\t oItem.style.padding = \"2px 0px 3px 2px\";\n oItem.maxLength = \"60\";\n oItem.style.left = \"105px\";\n oItem.style.width = \"270px\";\t\n oItem.value = eval(\"oData.Custom\" + i);\n oItem.setAttribute(\"LastVal\", eval(\"oData.Custom\" + i));\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n \n }\n }\n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the Comments container.\n //-------------------------------------------------------------------------------------\n function PopulateCommentsBox(oData) {\n \n var oBox = $(\"CommentsFieldsGroup\");\n \n try {\n //Only display for admin users.\n if (msUserType != \"admin\") \n {\n \t oBox.parentNode.style.display = \"none\";\n \t return;\n \t }\n \t}\n \tcatch(e) {return;}\n \n oBox.innerHTML = \"\";\n \n //Insert container for all columns/fields.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = \"CommentsFieldWrapper\";\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"395px\";\n oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = \"CommentsFieldHdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr Right\";\n oItem.style.width = \"370px\";\n oItem.style.margin = \"0px 0px 2px 0px\";\n oItem.innerHTML = \"(800 characters max)\"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n var oItem = document.createElement(\"TEXTAREA\");\n //oItem.type = \"text\";\t\n oItem.id = \"Comments\";\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n oItem.style.padding = \"3px 3px 3px 3px\";\n oItem.maxLength = \"800\";\n oItem.style.margin = \"20px 0px 8px 8px\";\n //oItem.style.top = \"10px\";\n //oItem.style.left = \"10px\";\n oItem.style.width = \"375px\";\t\n oItem.style.height = \"100px\";\t\n oItem.value = oData.Comments;\n oItem.setAttribute(\"LastVal\", oData.Comments);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n \n }\n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the Dates container.\n //-------------------------------------------------------------------------------------\n function PopulateDatesBox(oData) {\n \n var oBox = $(\"DateFieldsGroup\");\n \n oBox.innerHTML = \"\";\n \n var bAllowEdit = (msUserType == \"admin\") ? true : false;\n \n //var bAllowEdit_Hold = (msUserType == \"purchaser\") ? true : bAllowEdit;\n //var bAllowEdit_Cancel = (msUserType == \"purchaser\") ? true : bAllowEdit;\n \n var sUpdateStatus = \"existing\";\n \n PopulateDatesBoxItem(oBox, \"Authorized Date\", oData, \"AuthorizeDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Submitted Date\", oData, \"SubmitDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Estimated Date\", oData, \"EstimateDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Processing Date\", oData, \"ProcessDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Shipped Date\", oData, \"ShipDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Delivered Date\", oData, \"DeliverDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Hold Date\", oData, \"HoldDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Cancel Date\", oData, \"CancelDate\", bAllowEdit, sUpdateStatus);\n PopulateDatesBoxItem(oBox, \"Close Date\", oData, \"CloseDate\", bAllowEdit, sUpdateStatus);\n \t\n }\n\n //-------------------------------------------------------------------------------------\n // Inserts a new Date-specific objects/elements into the Dates box.\n //-------------------------------------------------------------------------------------\n function PopulateDatesBoxItem(oBox, sName, oData, sField, bAllowEdit, sUpdateStatus) {\n\n //example: PopulateOrderBoxItemDate(oItemBox, \"AuthDate\", oData, \"AuthorizedDate\", \"existing\")\n\n //Adjustment for field padding and/or border width.\n var iAdjust = 0;\n var iWidthAdjust = -2;\n var iCalAdjust = 0;\n \n //Insert container for all the field header and the field value.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = sField + \"FieldWrapper\";\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"395px\";\n oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = sField + \"Hdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr Right\";\n oItem.style.marginLeft = \"5px\";\n oItem.style.width = \"120px\";\n oItem.innerHTML = sName + \": \"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = sField;\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n //oItem.style.padding = \"2px 0px 3px 2px\";\n oItem.maxLength = \"60\";\n oItem.style.left = \"130px\";\n oItem.style.width = \"110px\";\t\n var sDateVal = eval(\"oData.\" + sField);\n var sDateDetailVal = eval(\"oData.\" + sField + \"Detail\");\n var sSetBy = eval(\"oData.\" + sField + \"ByName\");\n oItem.value = sDateVal;\n oItem.title = \"Set by \" + sSetBy + \" on \" + sDateDetailVal;\n oItem.setAttribute(\"LastVal\", sDateVal);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n AddEvt(oItem, \"keydown\", SetSave);\n AddEvt(oItem, \"change\", SetSave);\n oItemBox.appendChild(oItem);\n \n //Additional tweaks - if not edittable.\n if (!bAllowEdit)\n {\n oItem.readOnly = true;\n oItem.className += \" ReadOnly\";\n oItem.style.borderWidth = \"1px\";\n }\n \n //Insert Exam Date calendar image.\n\t //if (sUpdateStatus == \"insert\") {\n\t var oItem = document.createElement(\"IMG\");\n\t oItem.id = sField + \"Cal\";\n\t oItem.className = \"FieldCal2\";\n\t if (!bAllowEdit) oItem.style.cursor = \"default\";\n\t oItem.src = \"img/calendar.jpg\";\n oItem.style.top = \"2px\";\n oItem.style.left = \"250px\";\n //oItem.style.left = oItemBox.lastChild.offsetLeft + oItemBox.lastChild.offsetWidth - iCalAdjust + \"px\";\n if (bAllowEdit === true) AddEvt(oItem, \"click\", CalendarPopup_Show);\n\t oItemBox.appendChild(oItem);\n //}\n \n } \n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the Delivery container.\n //-------------------------------------------------------------------------------------\n function PopulateDeliveryBox(oData) {\n \n var oBox = $(\"DeliveryFieldsGroup\");\n \n oBox.innerHTML = \"\";\n \n var bAllowEdit = (msUserType == \"admin\") ? true : false;\n \n //if (msSaveMode == \"submit\") bAllowEdit = true;\n \n //Insert container for all columns/fields.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = \"DeliveryFieldWrapper\" + oData.OrderID;\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"395px\";\n //oItemBox.style.border = \"solid 1px red\";\n oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.style.height = \"30px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n //oItem.id = \"DeliverMethodHdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.left = \"10px\";\n //oItem.style.width = \"100px\";\n oItem.style.margin = \"0px 0px 2px 0px\";\n oItem.innerHTML = \"Delivery Method: \"; \n oItemBox.appendChild(oItem);\n \n\t //Insert Delivery Method dropdown.\n// var oItem = document.createElement(\"SELECT\");\n// oItem.id = \"DeliverMethod\";\n// oItem.className = (mbIE)? \"FieldValDropdown2IE\" : \"FieldValDropdown2\";\n// oItem.style.marginLeft = \"10px\";\n// //oItem.style.width = \"100px\";\t\n// PopulateDeliverMethodDropdown(oItem, oData.DeliverMethod);\n// oItem.setAttribute(\"LastVal\", oData.DeliverMethod);\n// AddEvt(oItem, \"change\", SetSave);\n// AddEvt(oItem, \"change\", SetChangeToDeliverMethod);\n// //AddEvt(oItem, \"blur\", SetChangeToOrderStatus);\n// oItemBox.appendChild(oItem);\n// \n \n if (bAllowEdit == true) \n {\n var oItem = document.createElement(\"SELECT\");\n oItem.id = \"DeliverMethod\";\n oItem.className = (mbIE)? \"FieldValDropdown2IE\" : \"FieldValDropdown2\";\n oItem.style.marginLeft = \"10px\";\n //oItem.style.width = \"100px\";\t\n PopulateDeliverMethodDropdown(oItem, oData.DeliverMethod);\n oItem.setAttribute(\"LastVal\", oData.DeliverMethod);\n AddEvt(oItem, \"change\", SetSave);\n AddEvt(oItem, \"change\", SetChangeToDeliverMethod);\n //AddEvt(oItem, \"blur\", SetChangeToOrderStatus);\n oItemBox.appendChild(oItem);\n }\n else\n {\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = \"DeliverMethod\";\n oItem.className = \"FieldVal2 ReadOnly\";\n oItem.readOnly = true;\n oItem.style.borderWidth = \"1px\";\n //oItem.style.padding = \"2px 0px 3px 2px\";\n //oItem.maxLength = \"60\";\n oItem.style.marginLeft = \"10px\";\n oItem.style.width = \"120px\";\t\n var sVal = oData.DeliverMethod;\n oItem.value = sVal;\n //oItem.title = \"Details: blah, blah, blah \";\n oItem.setAttribute(\"LastVal\", sVal);\n //oItem.setAttribute(\"OrderID\", oData.OrderID);\n //AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n }\n \n //Insert link to tracking information.\n var oItem = document.createElement(\"LABEL\");\n //oItem.id = \"ViewTrackingInfo\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.left = \"20px\";\n oItem.style.color = \"rgb(0,0,255)\";\n //oItem.style.width = \"100px\";\n oItem.style.margin = \"0px 0px 2px 0px\";\n oItem.style.cursor = \"pointer\";\n oItem.innerHTML = \"view tracking information\"; \n AddEvt(oItem, \"click\", ShowTrackingInfo);\n oItemBox.appendChild(oItem);\n \n //Insert Delivery Address Lines.\n for (var i=1; i<=3; i++) \n {\n //Insert container for all columns/fields.\n\t var oItemBox = document.createElement(\"DIV\");\n\t oItemBox.id = \"DeliverAddrLine\" + i + \"FieldWrapper\";\n\t oItemBox.className = \"FieldWrapper\";\n\t oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n\t oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = \"DeliverAddrLine\" + i + \"Hdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.marginLeft = \"10px\";\n oItem.style.width = \"120px\";\n oItem.innerHTML = \"Address Line \" + i + \": \"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = \"DeliverAddrLine\" + i;\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n\t oItem.style.padding = \"2px 0px 3px 2px\";\n oItem.maxLength = \"50\";\n oItem.style.marginLeft = \"10px\";\n oItem.style.width = \"250px\";\t\n oItem.value = eval(\"oData.DeliverAddrLine\" + i);\n var bReadOnly = (oData.DeliverMethod.toLowerCase().indexOf(\"other\") >= 0) ? false : true;\n oItem.readOnly = bReadOnly;\n oItem.style.backgroundColor = (bReadOnly) ? \"rgb(240,240,240)\" : \"rgb(255,255,255)\";\n oItem.setAttribute(\"LastVal\", eval(\"oData.DeliverAddrLine\" + i));\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n \n //Additional tweaks - if not edittable.\n if (!bAllowEdit)\n {\n oItem.readOnly = true;\n oItem.className += \" ReadOnly\";\n oItem.style.borderWidth = \"1px\";\n oItem.style.backgroundColor = \"transparent\";\n }\n\n \n }\n }\n \n //-------------------------------------------------------------------------------------\n // Populates dropdown with Delivery Method options and sets the initial value.\n //-------------------------------------------------------------------------------------\n function PopulateDeliverMethodDropdown(oDropdown, sInitialValue) {\n \t \n //Get reference to XMLDOMNodeList.\n //var oResults = dbExamTypes.DataNodeList();\n\n //Populate dropdown.\n //AddSelectOption(document, oDropdown, \" \", 0, 0);\n AddSelectOption(document, oDropdown, \"Employee Site\", \"Employee Site\", 0);\n AddSelectOption(document, oDropdown, \"Pick Up\", \"Pick Up\", 1);\n AddSelectOption(document, oDropdown, \"Other Address\", \"Other Address\", 2);\n \n if (sInitialValue != null) SetSelectValue(oDropdown, sInitialValue);\n\n } \n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the General Fields container.\n //-------------------------------------------------------------------------------------\n function PopulateGeneralBox(oData) {\n \n var oBox = $(\"GeneralFieldsGroup\");\n \n oBox.innerHTML = \"\";\n \t\n \t//Display the order number in the box title.\n var sName = oData.FirstName + \" \" + oData.LastName;\n var sOrderNum = oData.OrderNumber;\n $(\"OrderActionBoxTitle\").innerHTML = \"Details for Order #\" + sOrderNum;\n $(\"OrderActionBoxTitle\").setAttribute(\"OrderID\", oData.OrderID);\n \n //Insert a new field objects for each General field to be displayed.\n \n PopulateGeneralBoxItem(oBox, \"Serial Number\", oData, \"OrderNumber\", false, \"existing\");\n PopulateGeneralBoxItem(oBox, \"Authorized By\", oData, \"AuthorizeDateByName\", false, \"existing\");\n \n if (msUserType == \"admin\" || msUserType == \"purchaser\") \n {\n PopulateGeneralBoxItem(oBox, \"Order Status\", oData, \"OrderStatus\", true, \"existing\");\n //PopulateGeneralBoxItem(oBox, \"Payment Method\", oData, \"PaymentMethod\", false, \"existing\");\n //PopulateGeneralBoxItem(oBox, \"CC/PO Number\", oData, \"PaymentNumber\", false, \"existing\");\n }\n else {\n PopulateGeneralBoxItem(oBox, \"Order Status\", oData, \"OrderStatus\", false, \"existing\");\n }\n \n PopulateGeneralBoxItem(oBox, \"Company Name\", oData, \"CompanyName\", false, \"existing\");\n PopulateGeneralBoxItem(oBox, \"Company Site\", oData, \"CompanySiteName\", false, \"existing\");\n PopulateGeneralBoxItem(oBox, \"Employee Name\", oData, \"FullName\", false, \"existing\");\n PopulateGeneralBoxItem(oBox, \"Employee Email\", oData, \"EmailAddr\", false, \"existing\");\n PopulateGeneralBoxItem(oBox, \"Employee Phone\", oData, \"Phone1\", false, \"existing\");\n \n }\n \n //-------------------------------------------------------------------------------------\n // Inserts a General Summary field object/element into the container.\n //-------------------------------------------------------------------------------------\n function PopulateGeneralBoxItem(oBox, sName, oData, sField, bAllowEdit, UpdateStatus) \n {\n //Insert container for the field header and field value.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = sField + \"FieldWrapper\";\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"395px\";\n oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = sField + \"Hdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2 Right\";\n oItem.style.marginLeft = \"5px\";\n oItem.style.width = \"120px\";\n oItem.innerHTML = sName + \": \"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n if (sField == \"OrderStatus\" && bAllowEdit == true) \n {\n var oItem = document.createElement(\"SELECT\");\n oItem.id = sField; //+ oData.OrderID;\n oItem.className = (mbIE)? \"FieldValDropdown2IE\" : \"FieldValDropdown2\";\n oItem.style.marginLeft = \"10px\";\n //oItem.style.width = \"100px\";\t\n PopulateOrderStatusDropdown(\"all\", oItem, oData.OrderStatus);\n oItem.setAttribute(\"LastVal\", oData.OrderStatus);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n AddEvt(oItem, \"change\", SetSave);\n AddEvt(oItem, \"change\", SetChangeToOrderStatus);\n //AddEvt(oItem, \"blur\", SetChangeToOrderStatus);\n oItemBox.appendChild(oItem);\n }\n else\n {\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = sField; //+ oData.OrderID;\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n //oItem.style.padding = \"2px 0px 3px 2px\";\n //oItem.maxLength = \"60\";\n oItem.style.marginLeft = \"10px\";\n oItem.style.width = \"200px\";\t\n var sVal = eval(\"oData.\" + sField);\n oItem.value = sVal;\n //oItem.title = \"Details: blah, blah, blah \";\n oItem.setAttribute(\"LastVal\", sVal);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n //AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n }\n \n //\n //Additional tweaks... \n //\n \n //If Order Number make bold.\n if (sField == \"OrderNumber\") oItem.style.fontWeight = \"bold\";\n \n //If Order Status and read only, then make bold.\n if ((sField == \"OrderStatus\") && !bAllowEdit) oItem.style.fontWeight = \"bold\";\n \n //Additional tweaks - if not edittable.\n if (!bAllowEdit)\n {\n oItem.readOnly = true;\n oItem.className = \"FieldVal2 ReadOnly\";\n oItem.style.borderWidth = \"0px\";\n }\n\n } \n \n //-------------------------------------------------------------------------------------\n // Populates the fields in the Payment Fields container.\n //-------------------------------------------------------------------------------------\n function PopulatePaymentMethodBox(oData) {\n \n var oBox = $(\"PaymentFieldsGroup\");\n \n oBox.innerHTML = \"\";\n \t\n \n //Insert a new field objects for each Payment field to be displayed.\n \n PopulatePaymentMethodBoxItem(oBox, \"Authorized By\", oData, \"AuthorizeDateByName\", false, \"existing\");\n \n if (msUserType == \"admin\" || msUserType == \"purchaser\") \n {\n PopulatePaymentMethodBoxItem(oBox, \"Payment Method\", oData, \"PaymentMethod\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"PO Number\", oData, \"PaymentPO\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"CC Type\", oData, \"PaymentCCType\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"CC Name\", oData, \"PaymentCCName\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"CC Number\", oData, \"PaymentCCNumber\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"CC Expire Month\", oData, \"PaymentCCExpMonth\", false, \"existing\");\n PopulatePaymentMethodBoxItem(oBox, \"CC Expire Year\", oData, \"PaymentCCExpYear\", false, \"existing\");\n }\n \n } \n \n //-------------------------------------------------------------------------------------\n // Inserts a Payment Method field object/element into the container.\n //-------------------------------------------------------------------------------------\n function PopulatePaymentMethodBoxItem(oBox, sName, oData, sField, bAllowEdit, UpdateStatus) \n {\n //Insert container for the field header and field value.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = sField + \"FieldWrapper\";\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"395px\";\n oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n\n //Insert field header.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = sField + \"Hdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2 Right\";\n oItem.style.marginLeft = \"5px\";\n oItem.style.width = \"120px\";\n oItem.innerHTML = sName + \": \"; \n oItemBox.appendChild(oItem);\n \n //Insert field value.\n var oItem = document.createElement(\"INPUT\");\n oItem.type = \"text\";\t\n oItem.id = sField; //+ oData.OrderID;\n oItem.className = \"FieldVal2\";\n oItem.style.borderWidth = \"1px\";\n //oItem.style.padding = \"2px 0px 3px 2px\";\n //oItem.maxLength = \"60\";\n oItem.style.marginLeft = \"10px\";\n oItem.style.width = \"200px\";\t\n var sVal = eval(\"oData.\" + sField);\n oItem.value = sVal;\n //oItem.title = \"Details: blah, blah, blah \";\n oItem.setAttribute(\"LastVal\", sVal);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n //AddEvt(oItem, \"keydown\", SetSave);\n oItemBox.appendChild(oItem);\n \n //\n //Additional tweaks... \n //\n \n //Additional tweaks - if not edittable.\n if (!bAllowEdit)\n {\n oItem.readOnly = true;\n oItem.className = \"FieldVal2 ReadOnly\";\n oItem.style.borderWidth = \"0px\";\n }\n\n } \n \n //-------------------------------------------------------------------------------------\n // Inserts a new data item into the Order Qty data box.\n //-------------------------------------------------------------------------------------\n function PopulateQtyBoxItem(oBox, oData, sUpdateStatus) {\n\n var bAllowEdit = (msUserType == \"admin\" || msUserType == \"purchaser\") ? true : false;\n \n //Adjustment for field padding and/or border width.\n var iAdjust = 1;\n var iCalAdjust = 23;\n \n //Insert container for all columns/fields.\n\t var oItemBox = document.createElement(\"DIV\");\n\t oItemBox.id = \"DataItemBox\";\n\t oItemBox.className = \"FieldWrapper\";\n\t oItemBox.style.margin = \"5px 0px 5px 0px\";\n oItemBox.setAttribute(\"UpdateStatus\", sUpdateStatus);\n oItemBox.setAttribute(\"OrderID\", IsNull(oData.OrderID, \"0\"));\n oItemBox.setAttribute(\"ProductCategoryID\", oData.ProductCategoryID);\n oItemBox.setAttribute(\"ProductGroupID\", oData.ProductGroupID);\n\t oBox.appendChild(oItemBox);\n \n //Insert input field for Order Quantity.\n\t var oItem = document.createElement(\"INPUT\");\n\t oItem.type = \"text\";\t\n\t oItem.id = \"OrderQty\";\n\t //oItem.className = \"FieldVal Center\";\n\t oItem.className = \"FieldVal2 Center\";\n\t oItem.maxLength = \"3\";\n oItem.style.left = \"10px\";\n oItem.style.width = \"30px\";\t\n //oItem.style.width = $(\"OrderQtyHdr\").offsetWidth + \"px\";\t\n\t oItem.value = oData.Qty;\n oItem.setAttribute(\"LastVal\", oData.Qty);\n oItem.setAttribute(\"OrderID\", oData.OrderID);\n oItem.setAttribute(\"ProductCategoryID\", oData.ProductCategoryID);\n oItem.setAttribute(\"ProductGroupID\", oData.ProductGroupID);\n AddEvt(oItem, \"keydown\", SetSave);\n\t oItemBox.appendChild(oItem);\n\t \t \n //Additional tweaks - if not edittable.\n if (!bAllowEdit)\n {\n oItem.readOnly = true;\n oItem.className += \" ReadOnly\";\n }\n\n //Insert field for Order Category and Group.\n var oItem = document.createElement(\"LABEL\");\n //oItem.type = \"text\";\n oItem.id = \"OrderQtyHdr\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.marginLeft = \"15px\";\n //oItem.style.width = \"300px\";\n var sCat = (oData.ProductCategory === oData.ProductGroup) ? oData.ProductCategory : oData.ProductCategory += \" - \" + oData.ProductGroup;\n oItem.innerHTML = sCat; \n oItem.setAttribute(\"ProductCategoryID\", oData.ProductCategoryID);\n oItem.setAttribute(\"ProductGroupID\", oData.ProductGroupID);\n oItemBox.appendChild(oItem);\n \n /************ \n //Insert field for Qty flag.\n var oItem = document.createElement(\"LABEL\");\n oItem.id = \"QtyFlag\";\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.display = \"inline-block\";\n oItem.style.width = \"10px\";\n oItem.style.marginLeft = \"10px\";\n //oItem.style.textAlign = \"left\";\n oItem.innerHTML = \"<b style='color:red;'>*</b>\"; \n oItemBox.appendChild(oItem);\n **************/\n \n //if (oData.Qty == \"0\") oItem.style.visibility = \"hidden\";\n\n } \n \n //-------------------------------------------------------------------------------------\n // Inserts a note into Qty Requirements box for items whose quantity requirement has\n // not been met.\n //-------------------------------------------------------------------------------------\n function PopulateQtyBoxReqMsg() {\n \n var oBox = $(\"QtyFieldsGroup\");\n \n //Insert container for the message objects.\n var oItemBox = document.createElement(\"DIV\");\n oItemBox.id = \"QtyMsgFieldWrapper\";\n oItemBox.className = \"FieldWrapper\";\n oItemBox.style.width = \"380px\";\n oItemBox.style.margin = \"10px 0px 5px 10px\";\n oItemBox.setAttribute(\"UpdateStatus\", \"existing\");\n //oItemBox.setAttribute(\"OrderID\", oData.OrderID);\n oBox.appendChild(oItemBox);\n \n //Insert field for message.\n var oItem = document.createElement(\"LABEL\");\n //oItem.type = \"text\";\n oItem.id = \"QtyMsg\";\n //oItem.readOnly = true; //do not allow editting\n oItem.tabIndex = -1; //prevent tab stop\n oItem.className = \"FieldHdr2\";\n oItem.style.display = \"inline-block\";\n oItem.style.left = \"5px\";\n oItem.style.width = \"370px\";\n oItem.style.marginTop = \"10px\";\n oItem.style.padding = \"3px 0px 3px 2px\";\n oItem.style.border = \"solid 0px rgb(40,40,40)\";\n oItem.style.borderWidth = \"1px 0px 0px 0px\";\n oItem.style.height = \"30px\";\n //oItem.style.textAlign = \"left\";\n var sMsg = \"Items flagged with a red asterisk (<b style='color:red;'>*</b>) are \";\n sMsg += \"under or over the specified quantity requirement.\";\n oItem.innerHTML = sMsg; \n oItemBox.appendChild(oItem);\n }\n \n //-------------------------------------------------------------------------------------\n // Initiate refreshing the data. \n //-------------------------------------------------------------------------------------\n this.RefreshInit = function() {\n \n Refresh();\n \n }\n \n //-------------------------------------------------------------------------------------\n // Refreshes the data. \n //-------------------------------------------------------------------------------------\n function Refresh() {\n\n //if (IsBusy()) return;\n \n //If changes have not been saved, display message and get outta here.\n //if (mbSavePending && bForce == false) {\n if (mbSavePending) {\n sMsg = \"There are unsaved changes pending. Please save or cancel your changes. \";\n alert(sMsg);\n //SetStatusMsg(\"StatusMsg\", sMsg, \"\", true, true, \"\", 4000);\n return;\n }\n \n var sMsg = \"Refreshing order information, please wait...\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, false);\n \n RetrieveQtyRequirements();\n \n } \n \n //-------------------------------------------------------------------------------------\n // Submits AJAX request to retrieve order summary information.\n //-------------------------------------------------------------------------------------\n function RetrieveOrderSummary() {\n\n\t //Display status message. \n\t //ClearStatusMsg(\"main\"); \n\t SetStatusMsg(\"MainStatusMsg\", \"Retrieving order details...\", \"\", false);\n \t \n\t //Create XmlHttpRequest object.\n\t moAjax = AjaxCreate(\"Order Summary\");\n\t if (!moAjax) return;\n \n\t //Build parms string.\n var sParms\t= \"\";\n\t sParms += \"&Action=\" + encodeURI(\"GetOrder\");\n\t sParms += \"&OrderID=\" + encodeURI(msOrderID);\n \t\n\t //Initiate call to database.\n\t var bSuccess = AjaxSend(moAjax, sParms, RetrieveOrderSummaryCallback);\n \t\n\t //If not initiated, clear all status messages. \n\t if (!bSuccess) ClearStatusMsg();\n\n }\n\n //-------------------------------------------------------------------------------------\n // Callback for RetrieveOrderSummary method. \n //-------------------------------------------------------------------------------------\n function RetrieveOrderSummaryCallback() \n { \n\t var bKeepTrying = ((moAjax.readyState == 4) && (moAjax.status == 200)) ? false : true;\n\t \n\t if (bKeepTrying) return; \n \n\t\tvar sResult = moAjax.responseText;\n\t\t\n\t\tvar sError = AjaxError(sResult);\n\t\tif (sError.length > 0) \n\t\t{\n\t\t alert(\"Unable to retrieve order summary information. \\n\\n\\ Error details:\" + sError);\n\t\t mbCancellingChanges = false;\n\t\t moAjax = null;\n\t\t return;\n\t\t}\n\t\t\n\t\tvar oXml = (mbIE) ? moAjax.responseXML.childNodes[0] : moAjax.responseXML.documentElement; \n \n //Display appropriate message if no orders remaining.\n if (!oXml || oXml.getElementsByTagName(\"Table\").length == 0) \n { \n //moOrderItemsList.innerHTML = '<p id=\"NoItemsMsg\">There are no order items available.</p>';\n var sMsg = \"No order data available.\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, true);\n //SetStatusMsg(\"StatusMsg\", \"\");\n\t\t moAjax = null;\n return;\n }\n\t\t \n\t\tmoOrderSummary = oXml.getElementsByTagName(\"Table\");\n\t\t\n\t\t//Release memory for AJAX object.\n\t\tmoAjax = null;\n\t\t\n\t\t//Clear the data box contents.\n\t\t//moOrderDataBox.innerHTML = \"\";\n\t\t\n //Pull data from XML returned.\n var oRecord = moOrderSummary[0];\n \n var oAuthorizeDateParts = ParseOrderDate($data(\"AuthorizeDate\", oRecord));\n var oEstimateDateParts = ParseOrderDate($data(\"EstimateDate\", oRecord));\n var oSubmitDateParts = ParseOrderDate($data(\"SubmitDate\", oRecord));\n var oProcessDateParts = ParseOrderDate($data(\"ProcessDate\", oRecord));\n var oShipDateParts = ParseOrderDate($data(\"ShipDate\", oRecord));\n var oDeliverDateParts = ParseOrderDate($data(\"DeliverDate\", oRecord));\n var oHoldDateParts = ParseOrderDate($data(\"HoldDate\", oRecord));\n var oCancelDateParts = ParseOrderDate($data(\"CancelDate\", oRecord));\n var oCloseDateParts = ParseOrderDate($data(\"CloseDate\", oRecord));\n \n var oData = \n {\n \"OrderID\" : $data(\"OrderID\", oRecord), \n \"OrderNumber\" : $data(\"OrderNumber\", oRecord), \n \"OrderStatus\" : $data(\"OrderStatus\", oRecord), \n \n \"CompanyID\" : $data(\"CompanyID\", oRecord), \n \"CompanyName\" : $data(\"CompanyName\", oRecord), \n \"CompanySiteID\" : $data(\"CompanySiteID\", oRecord), \n \"CompanySiteName\" : $data(\"CompanySiteName\", oRecord), \n \"EmployeeID\" : $data(\"EmployeeID\", oRecord), \n \"FirstName\" : $data(\"FirstName\", oRecord), \n \"LastName\" : $data(\"LastName\", oRecord), \n \"FullName\" : $data(\"FirstName\", oRecord) + \" \" + $data(\"LastName\", oRecord), \n \"Gender\" : $data(\"Gender\", oRecord), \n \"EmailAddr\" : $data(\"EmailAddr\", oRecord), \n \"Phone1\" : $data(\"Phone1\", oRecord), \n \"Phone2\" : $data(\"Phone2\", oRecord), \n \n \"PaymentMethod\" : IsNull($data(\"PaymentMethod\",oRecord), ''), \n \"PaymentPO\" : IsNull($data(\"PaymentPO\",oRecord), ''), \n \"PaymentCCType\" : IsNull($data(\"PaymentCCType\",oRecord), ''), \n \"PaymentCCName\" : IsNull($data(\"PaymentCCName\",oRecord), ''), \n \"PaymentCCNumber\" : IsNull($data(\"PaymentCCNumber\",oRecord), ''), \n \"PaymentCCExpMonth\" : IsNull($data(\"PaymentCCExpMonth\",oRecord), ''), \n \"PaymentCCExpYear\" : IsNull($data(\"PaymentCCExpYear\",oRecord), ''), \n \n \"AuthorizeDate\" : oAuthorizeDateParts.Date, \n \"AuthorizeDateDetail\": oAuthorizeDateParts.DateTime, \n \"EstimateDate\" : oEstimateDateParts.Date, \n \"EstimateDateDetail\": oEstimateDateParts.DateTime, \n \"SubmitDate\" : oSubmitDateParts.Date,\n \"SubmitDateDetail\" : oSubmitDateParts.DateTime,\n \"ProcessDate\" : oProcessDateParts.Date,\n \"ProcessDateDetail\" : oProcessDateParts.DateTime,\n \"ShipDate\" : oShipDateParts.Date,\n \"ShipDateDetail\" : oShipDateParts.DateTime,\n \"DeliverDate\" : oDeliverDateParts.Date,\n \"DeliverDateDetail\" : oDeliverDateParts.DateTime,\n \"CloseDate\" : oCloseDateParts.Date,\n \"CloseDateDetail\" : oCloseDateParts.DateTime,\n \"HoldDate\" : oHoldDateParts.Date, \n \"HoldDateDetail\" : oHoldDateParts.DateTime, \n \"CancelDate\" : oCancelDateParts.Date, \n \"CancelDateDetail\" : oCancelDateParts.DateTime, \n \n \"AuthorizeDateBy\" : $data(\"AuthorizeDateBy\",oRecord), \n \"AuthorizeDateByName\" : $data(\"AuthorizeDateByName\",oRecord), \n \"EstimateDateBy\" : $data(\"EstimateDateBy\",oRecord), \n \"EstimateDateByName\" : $data(\"EstimateDateByName\",oRecord), \n \"SubmitDateBy\" : $data(\"SubmitDateBy\",oRecord), \n \"SubmitDateByName\" : $data(\"SubmitDateByName\",oRecord), \n \"ProcessDateBy\" : $data(\"ProcessDateBy\",oRecord), \n \"ProcessDateByName\" : $data(\"ProcessDateByName\",oRecord), \n \"ShipDateBy\" : $data(\"ShipDateBy\",oRecord), \n \"ShipDateByName\" : $data(\"ShipDateByName\",oRecord), \n \"DeliverDateBy\" : $data(\"DeliverDateBy\",oRecord), \n \"DeliverDateByName\" : $data(\"DeliverDateByName\",oRecord), \n \"CloseDateBy\" : $data(\"CloseDateBy\",oRecord), \n \"CloseDateByName\" : $data(\"CloseDateByName\",oRecord), \n \"HoldDateBy\" : $data(\"HoldDateBy\",oRecord), \n \"HoldDateByName\" : $data(\"HoldDateByName\",oRecord), \n \"CancelDateBy\" : $data(\"CancelDateBy\",oRecord), \n \"CancelDateByName\" : $data(\"CancelDateByName\",oRecord), \n \n \"DeliverMethod\" : $data(\"DeliverMethod\", oRecord),\n \"DeliverAddrLine1\" : IsNull($data(\"DeliverAddrLine1\", oRecord),\"\"),\n \"DeliverAddrLine2\" : IsNull($data(\"DeliverAddrLine2\", oRecord),\"\"),\n \"DeliverAddrLine3\" : IsNull($data(\"DeliverAddrLine3\", oRecord),\"\"),\n \n \"Custom1\" : IsNull($data(\"Custom1\", oRecord),\"\"),\n \"Custom2\" : IsNull($data(\"Custom2\", oRecord),\"\"),\n \"Custom3\" : IsNull($data(\"Custom3\", oRecord),\"\"),\n \"Custom4\" : IsNull($data(\"Custom4\", oRecord),\"\"),\n \"Custom5\" : IsNull($data(\"Custom5\", oRecord),\"\"),\n \n \"Comments\" : IsNull($data(\"Comments\", oRecord),\"\")\n }\n \n //Get Employee ID. \n msEmployeeID = oData.EmployeeID;\n \n //If not an admin user and this is a Closed or Cancelled order, hide all actions on the Action Bar.\n if (msUserType != \"admin\" && (oData.OrderStatus == \"Cancelled\" || oData.OrderStatus == \"Closed\"))\n {\n moActionBar.style.visibility = \"hidden\";\n //moOrderItemsList.DisableActionBar();\n }\n else \n if ((msUserType == \"general\" || msUserType == \"general\") && oData.OrderStatus != \"Authorized\")\n {\n moActionBar.style.visibility = \"hidden\";\n //moOrderItemsList.DisableActionBar();\n }\n\t \n\t //Display General info. \n\t PopulateGeneralBox(oData);\n\t \n\t //Display Payment Method info.\n\t if ($(\"PaymentFieldsGroupBox\")) PopulatePaymentMethodBox(oData);\n\t \n\t //Display Dates info. \n\t PopulateDatesBox(oData);\n\t \n\t //Display Dates info. \n\t PopulateCustomFieldsBox(oData);\n\t \n\t //Display Comments info. \n\t PopulateCommentsBox(oData);\n\t \n\t //Display Delivery info. \n\t PopulateDeliveryBox(oData);\n\t \n\t //Set the mode for changes to the order.\n\t SetSaveMode();\n \n //Adjust layout of the data box and its container.\n //AdjustDataBoxLayout(moMainBox, moOrderDataBox, $(\"OrderColHdr\"));\n //Display success message.\n var sMsg = (mbCancellingChanges) ? \"Changes cancelled. Order data refreshed.\" : \"Order retrieved successfully.\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, true);\n \n //var sMsg = (mbCancellingChanges) ? \"Changes cancelled. Order summary data refreshed.\" : \"Order summary data retrieved successfully.\";\n //SetStatusMsg(\"StatusMsg\", sMsg, \"\", false, true);\n \n mbCancellingChanges = false;\n \n SetSave(\"off\");\n \n //Flag quantity requirements that have not been met. \n //try {\n // CheckQtyRequirements();\n //}\n //catch(e) {}\n \n //If this is an employee (general user) and the order has not been submitted, display the \n //Current Sizes popup to capture any helpful information about sizes the user is currently \n //wearing.\n //if (msUserType == \"general\" && oData.OrderStatus == \"Authorized\") ShowCurrentSizesUI(oData.EmployeeID);\n\n }\n \n //-------------------------------------------------------------------------------------\n // Submits AJAX request to retrieve order quantity requirements.\n //-------------------------------------------------------------------------------------\n function RetrieveQtyRequirements() {\n\n\t //Display status message. \n\t //ClearStatusMsg(\"main\"); \n\t SetStatusMsg(\"MainStatusMsg\", \"Retrieving quantity requirements...\", \"\", false);\n \t \n\t //Create XmlHttpRequest object.\n\t moAjaxOrderQty = AjaxCreate(\"Order Quantities\");\n\t if (!moAjaxOrderQty) return;\n \n\t //Build parms string.\n var sParms\t= \"\";\n\t sParms += \"&Action=\" + encodeURI(\"GetOrderQtySpecs\");\n\t sParms += \"&OrderID=\" + encodeURI(msOrderID);\n \t\n\t //Initiate call to database.\n\t var bSuccess = AjaxSend(moAjaxOrderQty, sParms, RetrieveQtyRequirementsCallback);\n \t\n\t //If not initiated, clear all status messages. \n\t if (!bSuccess) ClearStatusMsg();\n\n }\n\n //-------------------------------------------------------------------------------------\n // Callback for RetrieveQtyRequirements method. \n //-------------------------------------------------------------------------------------\n function RetrieveQtyRequirementsCallback() \n { \n\t if ((moAjaxOrderQty.readyState == 4) && (moAjaxOrderQty.status == 200)) \n\t { \n\t\t\tvar sResult = moAjaxOrderQty.responseText;\n\t\t\t\n\t\t\tvar sError = AjaxError(sResult);\n\t\t\tif (sError.length > 0) \n\t\t\t{\n\t\t\t alert(\"Unable to retrieve Quantity Requirements. \\n\\n\\ Error details:\" + sError);\n\t\t\t moAjaxOrderQty = null;\n\t\t\t return;\n\t\t\t}\n\t\t\t\n\t\t\tvar oXml = (mbIE) ? moAjaxOrderQty.responseXML.childNodes[0] : moAjaxOrderQty.responseXML.documentElement; \n\t\t\t \n\t\t\tmoOrderQty = oXml.getElementsByTagName(\"Table\");\n\t\t\t\n\t\t\t//Release memory for AJAX object.\n\t\t\tmoAjaxOrderQty = null;\n\t\t\t\n\t\t\t//Clear the data box contents.\n\t\t\tmoOrderQtyBox.innerHTML = \"\";\n\t\t\t\n //Display data.\n for (var i=0; i < moOrderQty.length; i++) \n {\n var oRecord = moOrderQty[i];\n \n var oData = {\n\t\t \"OrderID\" : $data(\"OrderID\", oRecord), \n\t\t \"ProductCategoryID\" : $data(\"ProductCategoryID\", oRecord), \n\t\t \"ProductCategory\" : $data(\"ProductCategory\", oRecord), \n\t\t \"ProductGroupID\" : $data(\"ProductGroupID\", oRecord), \n\t\t \"ProductGroup\" : $data(\"ProductGroup\", oRecord), \n\t\t \"Qty\" : $data(\"Qty\", oRecord) \n\t\t }\n\t\t \n\t\t PopulateQtyBoxItem(moOrderQtyBox, oData, \"existing\");\n\t\t }\n\n //PopulateQtyBoxReqMsg();\n \n //Adjust height of popup.\n //moMainBox.style.height = moOrderQtyBox.offsetTop + (moOrderQty.length * 30) + \"px\"; \n \t\t\n\t\t //SetStatusMsg(\"StatusMsg\", \"\");\n\t\t \t\t \n //Initiate refresh of the Order Summary information.\n RetrieveOrderSummary(); \n\n\t } \n }\n\n //-------------------------------------------------------------------------------------\n // Saves Order changes to the database.\n //-------------------------------------------------------------------------------------\n this.SaveChanges = function() {\n \n //If processing another action don't allow save action.\n //if (IsBusy()) return;\n if (mbSaving) return;\n \n if (!ValidateChanges()) return; \n \n msModifiedSummaryValues = GetModifiedSummaryValues();\n msModifiedQtyValues = GetModifiedQtyValues();\n //msModifiedItemValues = moOrderItemsList.GetModifiedValuesInit();\n \n //testing... \n //alert(\"Modified Values: \\n\\n\" + msModifiedValues);\n //alert(\"Modified Qty Values: \\n\\n\" + msModifiedQtyValues);\n //return;\n \n //Make sure there are changes to be saved.\n if (msModifiedSummaryValues.length == 0 && \n msModifiedQtyValues.length == 0 \n //&& msModifiedItemValues.length == 0 \n ) \n {\n var sMsg = \"There are no changes pending, save action cancelled.\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, true, \"red\");\n return;\n }\n \n mbSaving = true;\n \n //var sMsg = (msSaveMode == \"submit\") ? \"Submitting new order for processing...\" : \"Saving order changes, please wait...\";\n var sMsg = \"Saving changes, please wait...\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, false);\n \n\t //Create XmlHttpRequest object.\n\t moAjax = AjaxCreate(\"Order Changes\");\n\t if (!moAjax) return;\n \n\t //Build parms string.\n var sParms\t= \"\";\n\t sParms += \"&Action=\" + encodeURI(\"SaveOrder\");\n\t sParms += \"&UserID=\" + encodeURI($(\"UserID\").value);\n\t sParms += \"&OrderID=\" + encodeURI($data(\"OrderID\", moOrderSummary[0]));\n\t sParms += \"&OrderNumber=\" + encodeURI($data(\"OrderNumber\", moOrderSummary[0]));\n\t sParms += \"&FirstName=\" + encodeURI($data(\"FirstName\", moOrderSummary[0]));\n\t sParms += \"&LastName=\" + encodeURI($data(\"LastName\", moOrderSummary[0]));\n\t sParms += \"&EmailAddr=\" + encodeURI($data(\"EmailAddr\", moOrderSummary[0]));\n\t sParms += \"&OrderStatus=\" + encodeURI($(\"OrderStatus\").value);\n\t \n\t //var sSendOrderConfirmation = (msSaveMode == \"submit\") ? \"yes\" : \"no\";\n\t var sSendOrderConfirmation = \"no\";\n\t sParms += \"&SendOrderConfirmation=\" + encodeURI(sSendOrderConfirmation);\n\t \n\t if (msModifiedSummaryValues.length > 0)\n\t sParms += \"&SummaryValues=\" + encodeURI(msModifiedSummaryValues);\n\t \n\t if (msModifiedQtyValues.length > 0)\n\t sParms += \"&QtyValues=\" + encodeURI(msModifiedQtyValues);\n\t \n\t //if (msModifiedItemValues.length > 0)\n\t // sParms += \"&OrderItemValues=\" + encodeURI(msModifiedItemValues);\n \t\n\t //Initiate call to database.\n\t var bSuccess = AjaxSend(moAjax, sParms, SaveOrderChangesCallback);\n \t\n\t //If not initiated, clear all status messages. \n\t if (!bSuccess) {\n\t ClearStatusMsg(); \n\t mbSaving = false;\n\t } \n\t \n } \n\n //-------------------------------------------------------------------------------------\n // Callback for SaveOrderChanges method. \n //-------------------------------------------------------------------------------------\n function SaveOrderChangesCallback() \n { \n\t var bKeepTrying = ((moAjax.readyState == 4) && (moAjax.status == 200)) ? false : true;\n\t \n\t if (bKeepTrying) return; \n\t \n\t\tvar sResult = moAjax.responseText;\n\t\t\n\t\t//Check for error.\n\t\tvar sError = AjaxError(sResult);\n\t\tif (sError.length > 0) \n\t\t{\n var sMsg = \"Unable to save order changes.\";\n var sMsgDetail = \"Error details: \" + sError;\n SetStatusMsg(\"MainStatusMsg\", sMsg, sMsgDetail, true, false);\n\t moAjax = null;\n\t mbSaving = false;\n\t return;\n\t\t}\n\t\t\n\t\t//var oXml = (mbIE) ? moAjax.responseXML.childNodes[0] : moAjax.responseXML.documentElement; \n\t\t \n\t\t//moOrderQty = oXml.getElementsByTagName(\"Table\");\n\t\t\n\t\t//Release memory for AJAX object.\n\t\tmoAjax = null;\n \n //Clear flag.\n mbSaving = false;\n \n //Display success message.\n var sMsg = \"Changes saved successfully\";\n SetStatusMsg(\"MainStatusMsg\", sMsg, \"\", false, true);\n \n //Apply changes to status if the order was just submitted.\n //PopulateOrderStatusDropdown(msUserType, $(\"OrderStatus\"), \"Submitted\");\n \n SetSave(\"off\")\n \n //moOrderItemsList.SetSaveOff();\n \n //Refresh the orders list.\n //Refresh();\n \n }\n \n //-------------------------------------------------------------------------------------\n // Called when a change to the Delivery Method is made by the user.\n //-------------------------------------------------------------------------------------\n function SetChangeToDeliverMethod(e) {\n\n\t var evt = window.event || e;\n\t var oSrc = evt.srcElement || e.target;\n\t var sType = evt.type || e.type;\n\n //If old value and new value are the same, get outta here.\n var sNewVal = oSrc.value;\n var sLastVal = oSrc.getAttribute(\"LastVal\");\n \n //***DAN TEMPORARY*** if (sNewVal == sLastVal) return;\n \n\t var oDataItemBox = oSrc.parentNode;\n //oDataItemBox.setAttribute(\"DeptID\", sNewVal);\n \n //Enable/disable the Address Lines.\n for (var i=1; i<=3; i++) \n {\n if (sNewVal === \"Other Address\") \n {\n $(\"DeliverAddrLine\" + i).readOnly = false;\n $(\"DeliverAddrLine\" + i).style.backgroundColor = \"rgb(255,255,255)\";\n }\n else \n {\n $(\"DeliverAddrLine\" + i).value = \"\";\n $(\"DeliverAddrLine\" + i).readOnly = true;\n $(\"DeliverAddrLine\" + i).style.backgroundColor = \"rgb(240,240,240)\";\n }\n }\n \n \n //Set SAVE PENDING flags on.\n SetSave(\"on\");\n \n } \n \n //-------------------------------------------------------------------------------------\n // Called when a change to the Order Status is made by the user.\n //-------------------------------------------------------------------------------------\n function SetChangeToOrderStatus(e) {\n\n\t var evt = window.event || e;\n\t var oSrc = evt.srcElement || e.target;\n\t var sType = evt.type || e.type;\n\n //If old value and new value are the same, get outta here.\n var sNewVal = oSrc.value;\n var sLastVal = oSrc.getAttribute(\"LastVal\");\n if (sNewVal == sLastVal) return;\n \n //If the change is not valid, get outta here.\n if (!ValidateChangeToOrderStatus(sNewVal, sLastVal))\n {\n SetSelectText(oSrc, sLastVal);\n return false;\n }\n \n //Update the appropriate date field.\n switch (oSrc.value.toLowerCase()) \n {\n case \"authorized\":\n var sID = \"AuthorizeDate\";\n break;\n case \"submitted\":\n var sID = \"SubmitDate\";\n break;\n case \"processing\":\n var sID = \"ProcessDate\";\n break;\n case \"shipped\":\n var sID = \"ShipDate\";\n break;\n case \"delivered\":\n var sID = \"DeliverDate\";\n break;\n case \"closed\":\n var sID = \"CloseDate\";\n break;\n case \"hold\":\n var sID = \"HoldDate\";\n break;\n case \"cancelled\":\n var sID = \"CancelDate\";\n break;\n default:\n alert(\"Status not recognized\");\n break;\n return;\n }\n \n //Change the color of the dropdown value.\n //oSrc.style.color = \"red\";\n \n\t var oBox = $(\"DateFieldsGroup\");\n\t \n\t for (var i=0; i < oBox.childNodes.length; i++)\n {\n var oWrap = oBox.childNodes[i];\n \n //ignore text nodes.\n if (oWrap.nodeType != 1) continue;\n \n if (oWrap.className.indexOf(\"FieldWrapper\") >= 0) \n {\n var oDateField = oWrap.getElementsByTagName(\"INPUT\")[0];\n \n //Revert any existing change back to its original value and color.\n if (oDateField.value != oDateField.getAttribute(\"LastVal\"))\n {\n oDateField.value = oDateField.getAttribute(\"LastVal\");\n oDateField.style.color = oDateField.getAttribute(\"LastColor\");\n }\n \n //Set the date value to the current date and set the color to red.\n if (oDateField.id == sID) \n {\n var dDate = new Date();\n var iMonth = dDate.getMonth() + 1;\n var iYear = dDate.getFullYear();\n var iDay = dDate.getDate();\n \n var sDate = iYear.toString() + \"/\" + iMonth.toString() + \"/\" + iDay.toString();\n\n oDateField.value = sDate;\n oDateField.setAttribute(\"LastColor\", oDateField.style.color);\n //oDateField.style.color = \"red\";\n oDateField.style.fontWeight = \"normal\";\n }\n }\n }\n \n SetSaveMode();\n \n SetSave(\"on\");\n \n }\n \n //-------------------------------------------------------------------------------------\n // Public access to the SetDataBoxItemStatus method. \n //-------------------------------------------------------------------------------------\n this.SetDataBoxItemStatusInit = function(oDataField) {\n \n SetDataBoxItemStatus(oDataField);\n \n }\n \n //-------------------------------------------------------------------------------------\n // Set the Update Status of a data box item (record/row). \n //-------------------------------------------------------------------------------------\n function SetDataBoxItemStatus(oDataField) {\n \n try {\n var oParent = oDataField.parentNode;\n if (oParent.id == \"DataItemBox\" || oParent.className.indexOf(\"FieldWrapper\") >= 0) {\n var sStatus = oParent.getAttribute(\"UpdateStatus\").toLowerCase();\n if (sStatus == \"existing\") oParent.setAttribute(\"UpdateStatus\", \"update\");\n }\n }\n catch(e) {\n //do nothing, it might not apply\n }\n \n } \n \n //-------------------------------------------------------------------------------------\n // Access to private function for setting SAVE PENDING flags.\n //-------------------------------------------------------------------------------------\n this.SetSaveInit = function(sSwitch) {\n \n SetSave(sSwitch);\n \n }\n \n //-------------------------------------------------------------------------------------\n // Set SAVE PENDING flags.\n //-------------------------------------------------------------------------------------\n function SetSave(arg1, arg2) {\n //this.SetSave = function(arg1, arg2) {\n\n\t var sSwitch = \"\";\n \t\t\n\t //alert(\"Typeof arg1 = \" + typeof(arg1));\n\t //alert(\"Typeof arg2 = \" + typeof(arg2));\n \t\n\t //If running FireFox browser.\n\t if (typeof(arg1) == \"object\") \n\t {\n\t\t sSwitch = arg2;\n\t\t var evt = window.event || arg1;\n\t\t var oSrc = evt.srcElement || arg1.target;\n\t\t var sType = evt.type || arg1.type;\n var oSave = moActionSave;\n\t }\n\t else\n\t {\n\t\t sSwitch = arg1;\n\t\t var oSave = moActionSave;\n\t\t //alert(\"oSave object = \" + oSave.id);\n\t }\n\n if (sSwitch == \"off\") {\n oSave.style.color = oSave.setAttribute(\"DefaultColor\", \"blue\");\n oSave.style.color = \"blue\";\n mbSavePending = false;\n return;\n }\n \n //If tabkey, ignore.\n if (oSrc) {\n if (evt.keyCode == 9) return;\n }\n \n oSave.style.color = \"red\";\n mbSavePending = true;\n \n //Clear field-level messages, if any.\n if (oSrc) {\n var sFieldMsgID = oSrc.id + \"Msg\";\n if ($(sFieldMsgID)) $(sFieldMsgID).style.display = \"none\"; \n }\n \n //Make sure Update Status of the data fields wrapper is set to indicate an update \n //occurred.\n SetDataBoxItemStatus(oSrc); \n \n } \n \n //-------------------------------------------------------------------------------------\n // Set the mode based on Order Status. If this is a new order that has been \"authorized\" \n // but not yet submitted for processing by the employee, then the submit mode is \"submit\".\n // Otherwise, the submit mode is \"save\" to indicate the order has been submitted for \n // processing and changes are allowed. In some cases, based on permissions, no changes\n // are allowed and the order information is effectively \"read only\".\n //-------------------------------------------------------------------------------------\n function SetSaveMode() {\n \n \n $(\"ActionSave\").innerHTML = \"Save Changes\";\n msSaveMode = \"save\";\n \n return;\n \n// try \n// {\n// if ($(\"OrderStatus\").value == \"Authorized\")\n// {\n// $(\"ActionSave\").innerHTML = \"Submit Order\";\n// msSaveMode = \"submit\";\n// \n// }\n// else\n// {\n// $(\"ActionSave\").innerHTML = \"Save Changes\";\n// msSaveMode = \"save\";\n// \n// }\n// }\n// catch(e){}\n \n }\n \n //-------------------------------------------------------------------------------------\n // Sets status message. \n //-------------------------------------------------------------------------------------\n function SetStatusMsg(sMsgID, sMsg, sDetails, bError, bTimeout, sColor, iTimeoutLength) \n {\n\t var oMsg = (sMsgID == \"StatusMsg\") ? moStatusMsg : $(sMsgID);\n \t\n\t if (bError) \n\t {\n\t\t oMsg.style.color = \"red\";\n\t\t oMsg.innerHTML = sMsg;\n\t\t oMsg.title = sDetails;\n\t\t oMsg.style.visibility = \"visible\";\n\t }\n\t else if ((sMsg.length > 0) && (!bError))\n\t {\n\t\t oMsg.style.color = (sColor) ? sColor : \"rgb(0,192,30)\"; //darker green by default\n\t\t oMsg.innerHTML = sMsg;\n\t\t if (sDetails) oMsg.title = sDetails;\n\t\t oMsg.style.visibility = \"visible\";\n\t }\n\t else \n\t {\n\t\t oMsg.style.color = \"green\";\n\t\t oMsg.innerHTML = \"\";\n\t\t oMsg.title = \"\";\n\t\t oMsg.style.visibility = \"hidden\";\n\t }\t\t\n \n\t //Clear message after a delay, if requested.\n\t if (bTimeout) {\n\t iTimeoutLength = (iTimeoutLength == null) ? 2000 : iTimeoutLength;\n\t //setTimeout(\"SetStatusMsg('\" + sMsgID + \"','')\", iTimeoutLength); \n\t //setTimeout(\"ClearStatusMsg()\", iTimeoutLength); \n\t setTimeout(function() {SetStatusMsg(sMsgID,\"\");}, iTimeoutLength); \n\t } \n\n }\n\n //-------------------------------------------------------------------------------------\n // Display tracking information. \n //-------------------------------------------------------------------------------------\n function ShowTrackingInfo() \n {\n alert(\"Tracking information not available.\");\n }\n\n //-------------------------------------------------------------------------------------\n // Validates data. \n //-------------------------------------------------------------------------------------\n function ValidateChanges() \n {\n var bValid = true;\n \n // if (!bValid) \n // { \n // var sMsg = \"The xxxx value is invalid.\";\n // SetStatusMsg(\"StatusMsg\", sMsg, \"\", false, true, \"red\", 4000);\n // return false;\n // }\n \n return bValid;\n } \n \n //-------------------------------------------------------------------------------------\n // Returns new XMLHttpRequest object. \n //-------------------------------------------------------------------------------------\n function AjaxCreate(sDataType) \n {\n var xhr;\n \n\t try \n\t {\n\t if (window.XMLHttpRequest) \n\t { \n\t\t xhr = new XMLHttpRequest();\n\t } \n\t else if (window.ActiveXObject) \n\t { \n\t\t xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t }\n\t }\n\t catch(e) \n\t {\n\t var sMsg = \"Error: Unable to create data access object for \" + sDataType + \" data. \\n\\n\";\n\t sMsg += \"Error Details: \" + e.message; \n\t\t alert(sMsg);\n\t }\n\t \n\t //Make sure the XHR object is really created.\n\t if (!xhr)\n\t {\n\t var sMsg = \"Error: Unable to create data access object for \" + sDataType + \" data. \\n\\n\";\n\t sMsg += \"Error Details: Unknown error.\"; \n\t\t alert(sMsg);\n\t } \n\t \n\t return xhr; \n }\n\n //-------------------------------------------------------------------------------------\n // Returns Ajax error (if any). \n //-------------------------------------------------------------------------------------\n function AjaxError(sResults) \n { \n var sError = \"\";\n \n try \n {\n var oResults = sResults.split(\"|\");\n\t var sStatus = oResults[0].split(\"=\")[1];\n\t if (sStatus.toLowerCase() == \"error\")\n\t {\n\t sError = oResults[1].split(\"=\")[1];\n\t }\n\t }\n\t catch(e) {}\n\t \n\t return sError;\n }\n\n //-------------------------------------------------------------------------------------\n // Initiate XMLHttpRequest call to specified URL/URI. \n //-------------------------------------------------------------------------------------\n function AjaxSend(oAjax, sParms, oCallback, bUseXdp){ \n \n var sType = \"POST\"; \n\n\t //Set URL/URI. \n\t var sURL = \"db.aspx\";\n\t \n\t //If using a server-side cross-domain proxy, modify the URL and establish the\n\t //URL/URI for the server-side proxy.\n\t if (bUseXdp) \n\t {\n\t\t //Set URL for remote URL and server-side proxy.\n\t\t var sRemoteURL = $(\"XXXXXX\").value + sURL;\n\t\t sURL = \"xdp.aspx\";\n \t\n\t //Modify parms string for use by server-side proxy. Replace equal signs and ampersands so proxy \n\t //ignores the fieldname-value pairs and passes them on to the remote URL.\n\t sParms = sParms.replace(/=/g,\"||\");\n\t sParms = sParms.replace(/&/g,\"|*|\");\n \t\t\n\t sParms = \"Parms=\"\t\t+ sParms;\n\t sParms += \"&RemoteURL=\" + sRemoteURL;\n\t sParms += \"&Format=\"\t+ msXHRResponseFormat;\n }\n \t\n\t if (sType == \"POST\") \n\t {\t\n\t\t //Set POST properties and send HTTP request.\n\t\t //moAjax.onreadystatechange = OnAjaxStateChange; \n\t\t oAjax.onreadystatechange = oCallback; \n\t\t oAjax.open(\"POST\", sURL, true); \n\t\t oAjax.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\t //oAjax.setRequestHeader(\"Content-length\", sParms.length);\n\t\t oAjax.send(sParms);\n\t }\n\t else if (sType == \"GET\") \n\t {\n\t\t alert(\"AJAX GET-style call not implemented. Request cancelled.\");\n\t\t return false;\n\t }\n \t\n\t return true;\n }\n\n}", "title": "" }, { "docid": "ecbc9b15602edfb5ff0a3babe2bf5b6b", "score": "0.5426379", "text": "function getOrderDetails(orderId) {\n\n return new Promise((resolve, reject) => {\n ShopifySDK.orders.fetchOrder(orderId)\n .then(response => {\n resolve(response);\n })\n .catch(err => {\n reject(err);\n });\n });\n}", "title": "" }, { "docid": "8fe8c8d240e972d6ac9111557074422b", "score": "0.5424767", "text": "enterOC_Order(ctx) {}", "title": "" }, { "docid": "70cd0effea7d7fb76ce374f5a9320c16", "score": "0.5422859", "text": "function addQuote(params) {\n rest.update(\n {\n entity: \"Quote\",\n cntrl: \"/Admin/Quote\",\n data: params,\n success: function (model) {\n \n $(form).find(\"#QuoteID\").val(model.QuoteID);\n \n openUnQuotedJobs($(form).find(\"#ClientID\").val());\n }\n });\n }", "title": "" }, { "docid": "85ba8fb90dbf1efb46ce011430bd9c6d", "score": "0.54206485", "text": "handleSubmit(event) {\n event.preventDefault();\n let fields = event.detail.fields;\n let caseObj = {};\n caseObj.Id = this.recordId;\n caseObj.CCP_Mode__c = this.isSubmitShow ? this.caseObj.CCP_Mode__c : fields.CCP_Mode__c;\n caseObj.CCP_Remarks__c = fields.CCP_Remarks__c;\n console.log(caseObj);\n this.updateCaseWithCCP(caseObj);\n }", "title": "" }, { "docid": "6a0e0ca8ac07b44413ef6dd887bc1ec3", "score": "0.5416093", "text": "function fetchTicket(ticketId, numTickets) {\n console.log('fetchTicket: Entering');\n\n var ticketChain = TicketChain.deployed();\n\n ticketChain.getTicketDetails.call(ticketId).then(function(value) {\n var ticketDetails = parseTicketFromTicketDetailsResponse(value);\n console.log();\n if (ticketDetails.owner === account) {\n addMyTicket(ticketId, ticketDetails);\n } else if (ticketDetails.forSale) {\n addAvailableTicket(ticketId, ticketDetails);\n }\n // Show no tickets\n if(ticketId == numTickets && $('#myTickets tbody > tr').length == 0) {\n $('#notickets').show();\n }\n }).catch(function(e) {\n console.log(e);\n setStatus(\"Error see log.\");\n });\n}", "title": "" }, { "docid": "57900f46ffda015287f5c9c6349fd2bd", "score": "0.5414495", "text": "function ControllerClickOrderDone(OrderId) {\n\tvar ModifyOrderData = new Object();\n\tModifyOrderData.OrderId = OrderId;\n\tModifyOrderData.Action = \"OrderToDone\";\n\tSendToServer(\"ModifyOrder\", ModifyOrderData, CallBackControllerModifyOrder, AppTimeOutCallBack);\n}", "title": "" }, { "docid": "2cd3c5f1948828b91cdf1a33537eb11f", "score": "0.54057914", "text": "function payTicket(e) {\n e.preventDefault();\n restMessages();\n let customer = customers.filter(cust => {\n return cust.ticketNumber.toString() === ticketNumberPay;\n });\n\n if (customer.length > 0) {\n customers.map((cust, index) => {\n if (cust.ticketNumber.toString() === ticketNumberPay) {\n customers[index].paid = true;\n }\n });\n let currentTime = Date.now();\n let diff = (currentTime - customer.entryTime) / 1000;\n diff /= 60 * 60;\n let totalTime = Math.abs(diff);\n if (totalTime > 6) {\n setResponseMessage('Your all day payment is $10.13');\n } else if (totalTime > 3) {\n setResponseMessage('Your upto 6 hr payment is $6.75');\n } else if (totalTime > 1) {\n setResponseMessage('Your upto 3 hr payment is $4.50');\n } else {\n setResponseMessage('Your upto 1 hr payment is $3');\n }\n } else {\n setErrorMessage(\n 'There is no Ticket with that number, Please validate the number and try again.'\n );\n }\n }", "title": "" }, { "docid": "e0339c7f4ab149d03ba1b13500daf929", "score": "0.5401836", "text": "function addToInvForm(orderItem, quantItem){\n var orderList = document.getElementById('orderList');\n orderList.style.display = 'block';\n\n var addTable = document.getElementById('orderTable');\n\n var newRow = document.createElement(\"TR\");\n addTable.appendChild(newRow);\n\n // Populate row with order details\n for (var i = 0; i < 4; i++) {\n var tableCell = document.createElement(\"TD\");\n var tableText = document.createTextNode(orderItem[0][i]);\n tableCell.appendChild(tableText);\n newRow.appendChild(tableCell);\n }\n\n // Add Quantity\n var quantCell = document.createElement(\"TD\");\n var quantText = document.createTextNode(quantItem);\n quantCell.appendChild(quantText);\n newRow.appendChild(quantCell);\n\n // Add Cost\n var costCell = document.createElement(\"TD\");\n var costText = document.createTextNode((orderItem[0][3] * quantItem).toFixed(2));\n costCell.appendChild(costText);\n newRow.appendChild(costCell);\n\n // Add Update Button\n var updateTD = document.createElement(\"TD\");\n var updateButton = document.createElement('button');\n updateButton.setAttribute(\"type\", \"button\");\n updateButton.classList.add(\"btn\", \"btn-success\");\n updateButton.innerText = \"Update\";\n updateButton.style.display = 'block';\n updateTD.appendChild(updateButton);\n //Attach Update function\n updateButton.onclick = function(updateButton) {\n var tr = updateButton.path[2];\n var currentRow = tr.cells;\n\n // Make Quantity cell editable.\n currentRow.item(4).contentEditable = \"true\";\n currentRow.item(4).classList.add(\"form-cell-style\");\n\n // Hide Update Button and Show Submit button.\n var ub = currentRow.item(6).childNodes[0];\n ub.style.display = 'none';\n var sb = currentRow.item(6).childNodes[1];\n sb.style.display = 'block';\n\n // Hide Delete Button.\n var db = currentRow.item(7).childNodes[0];\n db.style.display = 'none';\n }\n\n // Add Submit Button\n var submitButton = document.createElement('button');\n submitButton.setAttribute(\"type\", \"button\");\n submitButton.classList.add(\"btn\", \"btn-success\");\n submitButton.innerText = \"Submit\";\n submitButton.style.display = 'none';\n updateTD.appendChild(submitButton);\n // Attach Submit Button\n submitButton.onclick = function(submitButton) {\n var tr = submitButton.path[2];\n var currentRow = tr.cells;\n\n // Make Quantity cell uneditable.\n currentRow.item(4).contentEditable = \"false\";\n currentRow.item(4).classList.remove(\"form-cell-style\");\n\n // Show Update Button and Hide Submit button.\n var ub = currentRow.item(6).childNodes[0];\n ub.style.display = 'block';\n var sb = currentRow.item(6).childNodes[1];\n sb.style.display = 'none';\n\n // Show Delete Button.\n var db = currentRow.item(7).childNodes[0];\n db.style.display = 'block';\n44\n // Update cost\n var costCell = currentRow.item(5);\n costCell.innerHTML = Number(currentRow.item(4).innerHTML) * Number(currentRow.item(3).innerHTML);\n }\n newRow.appendChild(updateTD);\n\n // Add Delete Button\n var deleteTD = document.createElement(\"TD\");\n var deleteButton = document.createElement('button');\n deleteButton.setAttribute(\"type\", \"button\");\n deleteButton.classList.add(\"btn\", \"btn-danger\");\n deleteButton.innerText = \"Delete\";\n deleteButton.style.display = 'block';\n deleteTD.appendChild(deleteButton);\n // Attach Delete function\n deleteButton.onclick = function(deleteButton) {\n var table = document.getElementById(\"orderTable\");\n var tr = deleteButton.path[2];\n var row = tr.rowIndex;\n table.deleteRow(row);\n };\n\n newRow.appendChild(deleteTD);\n}", "title": "" }, { "docid": "55b91a103bf0ae08327d220684f1a846", "score": "0.5395534", "text": "function readOrderInfo(){\n var nameItem;\n var orderNumItem;\n var totalCostItem;\n var creditNumberItem;\n var emailItem;\n\n var name;\n var cost;\n var credit;\n var email;\n\n var pageName = document.getElementById(\"body-confirmation\");\n if(pageName != null){\n nameItem = document.getElementById(\"name-thanks\");\n orderNumItem = document.getElementById(\"order-number\");\n totalCostItem = document.getElementById(\"total-cost\");\n creditNumberItem = document.getElementById(\"credit-number\");\n emailItem = document.getElementById(\"emailed-to\");\n\n name = localStorage.getItem(\"order-first-name\") + \" \" + localStorage.getItem(\"order-last-name\");\n cost = localStorage.getItem(\"order-cost\");\n credit = localStorage.getItem(\"order-credit-last-four\");\n email = localStorage.getItem(\"order-email\");\n\n\n nameItem.innerHTML = \"Thank You for your order \" + name + \"!\";\n orderNumItem.innerHTML = \"Order Number: \" + generateOrderNumber();\n totalCostItem.innerHTML = \"Total Charged: $\" + cost;\n creditNumberItem.innerHTML = \"Credit Card Number: XXXX-XXXX-XXXX-\" + credit;\n emailItem.innerHTML = \"Order Information and tickets have been emailed to the following email: \" + email;\n }\n\n }", "title": "" }, { "docid": "9654178c06fd2d9a4945f4b7c9cc6843", "score": "0.5390443", "text": "function onBeforeSubmit(type, form) {\n\t\tif (type == 'delete') {\n\t\t\treturn;\n\t\t}\n\n\t\tEC.po = nsdal.fromRecord(nlapiGetNewRecord(), poFields);\n\t\tEC.po.withSublist('item', lineItemFields);\n\t\t// enrich po object with the custom sublist for milestone history records\n\t\tEC.po.withSublist('recmachcustrecord_sm_history_purchase_order', ['custrecord_sm_history_item']);\n\t\tEC.setDeliveryDates(type);\n\t\tEC.validateDeliveryDates(EC.po.shipdate, EC.po.custbody_ship_window_end_date);\n\t\tif (type == 'edit' || type == 'xedit') {\n\t\t\tEC.po.externalid = EC.generatePOnumber();\n\t\t}\n\t\tEC.setPOversion();\n\t\t// prevent errors with xedit on PO approval list\n\t\tif (type != 'xedit') {\n\t\t\tEC.setTotals();\n\t\t\tEC.setDefaultLineSupplier();\n\t\t\tEC.setHTSvalues();\n\t\t\tEC.setTradingPartner();\n\t\t\tEC.setRetailPrices();\n\t\t}\n\t\tEC.processClosedLines();\n\t\tEC.setMasterCaseAndLot();\n\t\tEC.createShippingMilestones();\n\t\tEC.retriggerPurchaseOrderExport(type.toString());\n\t\tEC.setOriginalQuantities();\n\t}", "title": "" }, { "docid": "843802fa96315dc9abcd5cd0fd936e16", "score": "0.5384303", "text": "function orderSubmit() {\n\tif(document.getElementById('total').value != \"\") {\n\t\tdocument.getElementById(\"orderForm\").submit();\n\t}\n\telse {\n\t\talert(\"Choose at least one product to order\"); \t\n\t}\n}", "title": "" }, { "docid": "4c54c831c46b7189cf75fb0f5668ec5b", "score": "0.53703797", "text": "function onAfterSubmit(type) {\n\t\tif (type.toString() === 'create' || EC.missingShippingMilestoneHistories()) {\n\t\t\tEC.po = nsdal.loadObject('purchaseorder', nlapiGetRecordId(), poFields);\n\t\t\tEC.po.withSublist('item', lineItemFields);\n\t\t\tEC.po.withSublist('recmachcustrecord_sm_history_purchase_order', ['custrecord_sm_history_item', 'id']);\n\t\t\t// this is in onAfterSubmit because we need a tranid to be assigned in order\n\t\t\t// to generate the PO number\n\t\t\tEC.po.externalid = EC.generatePOnumber();\n\t\t\t// setDeliveryDates(type)\n\t\t\t// validateDeliveryDates(po.duedate, po.custbody_ship_window_end_date)\n\t\t\t// po.externalid = generatePOnumber()\n\n\t\t\tEC.linkShippingMilestoneHistories();\n\n\t\t\tEC.po.save();\n\t\t}\n\t}", "title": "" }, { "docid": "0d4f635f463e71eed3bb8811960974c7", "score": "0.53661627", "text": "function Ticket(id, subject, description, date, status) {\n this.id = id;\n this.subject = subject;\n this.description = description;\n this.date = date;\n this.status = status;\n }", "title": "" }, { "docid": "b32c0ba2a9f1ec2137257aa20f658296", "score": "0.5355816", "text": "function submitEdit(){\n\t\tif(validate()) {\n\t\t\tvar editObj = JSON.parse(localStorage.getItem(\"editObj\"));\n\t\t\teditObj.data[editObj.id].companies = $(\"#companies\").val();\n\t\t\teditObj.data[editObj.id].stock = $(\"#stock\").val();\n\t\t\teditObj.data[editObj.id].amount = $(\"#amount\").val();\n\t\t\teditObj.data[editObj.id].shipping = $(\"#shipping\").val();\n\t\t\teditObj.data[editObj.id].lastUpdated = new Date().toISOString().slice(0,10);\n\t\t\tlocalStorage.setItem(\"editObj\", JSON.stringify(editObj));\n\t\t\twindow.location.replace(\"inventory.html\");\n\t\t} else {\n\t\t\talert(\"Please enter valid integer for stock/amount/shipping\");\n\t\t}//end if/else\n\t}//end function submitEdit", "title": "" }, { "docid": "a7a984ace9bac8e39b14fd690d1ba142", "score": "0.5354333", "text": "function selectorderdetails(iUserId,iApplicationId,iAppTabId)\n\t{\n\t\tvar html ='';\n\t\t\n\t\thtml += '<center>';\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"wrapmain\">';\n\t\t\n\t\thtml += '<h3>';\n\t\t\thtml += 'Order Details';\n\t\thtml += '</h3>';\n\t\t\n\t\thtml += '<form name=\"order_frm\" id=\"order_frm\">';\n\t\t\n\t\thtml += '<input type=\"hidden\" name=\"iUserId\" id=\"iUserId\" value=\"'+iUserId+'\" />';\n\t\thtml += '<input type=\"hidden\" name=\"iApplicationId\" id=\"iApplicationId\" value=\"'+iApplicationId+'\" />';\n\t\thtml += '<input type=\"hidden\" name=\"iAppTabId\" id=\"iAppTabId\" value=\"'+iAppTabId+'\" />';\n\t\t\n\t\thtml += '<div id=\"contact_validation\" style=\"display:none;\"></div>';\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"vNamed\">Your Name :</label>';\n\t\t\thtml += '<input type=\"text\" name=\"vName\" id=\"vNamed\" placeholder=\"Enter Your Full Name\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"tAddress\">Your Address:</label>';\n\t\t\thtml += '<input type=\"text\" name=\"tAddress\" id=\"tAddress\" placeholder=\"Enter Your Address\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"vPhone\">Your Phone:</label>';\n\t\t\thtml += '<input type=\"text\" name=\"vPhone\" id=\"vPhone\" placeholder=\"Enter Your Mobile No\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"vPhone\">Your Email:</label>';\n\t\t\thtml += '<input type=\"text\" name=\"tEmail\" id=\"tEmail\" placeholder=\"Enter Your Email\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"vArea\">Your Area :</label>';\n\t\t\thtml += '<input type=\"text\" name=\"vArea\" id=\"vArea\" placeholder=\"Enter Your Area Name\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<div data-role=\"fieldcontain\" class=\"ui-hide-label\">';\n\t\t\thtml += '<label for=\"vPincode\">Your Pincode :</label>';\n\t\t\thtml += '<input type=\"text\" name=\"vPincode\" id=\"vPincode\" placeholder=\"Enter Your Area Pincode\"/>';\n\t\thtml += '</div>';\n\t\t\n\t\thtml += '<a class=\"join_btn\" href=\"javascript:saveorderdetails();\" data-role=\"button\" data-inline=\"true\">submit order</a>';\n\t\thtml += '</form>';\n\t\thtml += '</div></center>';\n\t\t\n\t\t/** Order title **/\n\t\tvar title=\"Order\";\n\t\t$(\"#orderdetailtitle\").html(title);\n\t\t$(\"#order_detail\").html(html);\n\t\t$.mobile.changePage(\"#order_detail_main\", \"pop\", true);\n\t}", "title": "" }, { "docid": "dfec21c32874acf1530ee90e90e71f44", "score": "0.53536874", "text": "function OnOrderNowClicked() {\r\n\r\n\r\n generateTotalUpdateFoodCart();\r\n updateCartElements();\r\n\r\n $('.totalBill').html(userObject.total + \" NIS\");\r\n $('#restAddress').html(userObject.restaurantAddress);\r\n\r\n $('#food-cart-popup').modal('hide');\r\n\r\n userObject.subTotal = userObject.total;\r\n\r\n cash_pickup_from_link = false;\r\n\r\n $('#delivery-parent').show();\r\n\r\n $('#delivery-info').show();\r\n\r\n $('#delivery-info').addClass('show');\r\n\r\n orderNow(); // CALL TO FRONT END // MOVE USER TO TAKE PERSONAL INFORMATION\r\n\r\n\r\n}", "title": "" }, { "docid": "27fb4be4ca325d945898a848ed1c3f93", "score": "0.534979", "text": "function searchOnHoldOrder(accountId) {\r\n\tvar $viewOrderForm = $('#viewOrderForm');\r\n\t$('#soldToSAPId', $viewOrderForm).val(accountId);\r\n\t$('#sapOrderStatus', $viewOrderForm).val('HOLD');\r\n\t$viewOrderForm.submit();\r\n}", "title": "" }, { "docid": "fd9c96142b56dbb1eb6412fdaa01170b", "score": "0.53486127", "text": "function submitFWTicket() {\n\tvar customerType = _(\"customerType\").value;\n\n\t//alert(\"submit FTicket hit\");\n\tif (!(_(\"customerType\").value == \"fw\")) {\n\t\tsubmitTicket();\n\t}\n\telse {\n\t\tif (ticketInuse) {\n\t\t\treturn;\n\t\t}\n\t\tclearNotice();\n\t\tvar params = new Array();\n\n\t\tvar currentIssue = \"\";\n\t\tvar currentIssueText = \"\";\n\n\t\tcurrentIssue = _(\"fwDataIssue\").value;\n\t\tcurrentIssueText = _(\"fwDataIssue\").options[_(\"fwDataIssue\").selectedIndex].text;\n\n\n\t\tif (_(\"contactname\") && _(\"contactnumber\") && _(\"contacttype\") && currentIssue != \"\") {\n\t\t\tvar contactname = _(\"contactname\").value.substr(0, 16);\n\t\t\tvar contactnumber = _(\"contactnumber\").value.replace(/[^0-9]/g, '').substr(0, 10);\n\t\t\tvar contacttype = _(\"contacttype\").selectedIndex;\n\t\t}\n\t\telse {\n\t\t\tparams = new Array();\n\t\t\tparams.push(new Array('lanid', _(\"lanid\").value));\n\t\t\tparams.push(new Array('error', 'Missing element in submitTicket, line 809'));\n\t\t\terrorAjax.addRequest('error.php', params);\n\t\t\tif (brandon()) {\n\t\t\t\twindow.location.href = \"xmpp:[email protected]?message&amp;subject=tt&amp;body=Missing%20element%20in%20submitTicket\";\n\t\t\t}\n\t\t\talert(\"Unexpected error.\\r\\nClick ok to send error report and reload the page.\");\n\t\t\twindow.location.href = unescape(window.location.pathname);\n\t\t\treturn;\n\t\t}\n\n\t\t/*if (contactnumber == _(\"wtn\").value.replace(/[^0-9]/g, '').substr(0, 10)) {\n alert(\"The WTN can not be the same as the CTN for this customer. Please ensure that the WTN and CTN do not match.\");\n return;\n }*/\n\n\t\tif ((_(\"customerType\").value == \"fw\" && _(\"fwDataIssue\").options[_(\"fwDataIssue\").selectedIndex].attributes['speed'])) {\n\t\t\tif (_('provSpeed').value.length == 0) {\n\t\t\t\t_('provSpeed').focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (_('resultSpeed').value.length == 0) {\n\t\t\t\t_('resultSpeed').focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar perc70 = Math.round((70 * Number(_('provSpeed').value)) / 100);\n\t\t\tif (Number(_('resultSpeed').value) >= perc70) {\n\t\t\t\talert(\"Customer is getting more than 70% provisioned/trained speed.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (_(\"customerType\").value == \"fw\" && _(\"fwNotes\").value.replace(/\\s/g, '').length == 0) {\n\t\t\talert(\"Please briefly describe the issue the customer is experiencing in the notes field.\");\n\t\t\t_(\"fwNotes\").focus();\n\t\t\treturn;\n\t\t}\n\n\t\tif (contactnumber.substr(0, 1) == '0') {\n\t\t\talert(\"This is not a valid contact number, enter a valid contact number.\");\n\t\t\t_(\"contactnumber\").focus();\n\t\t\t_(\"contactnumber\").select();\n\t\t\treturn;\n\t\t}\n\n\t\tif (contactnumber.match(/0/g)) {\n\t\t\tif (contactnumber.match(/0/g).length >= 6) {\n\t\t\t\talert(\"This is not a valid contact number, enter a valid contact number.\");\n\t\t\t\t_(\"contactnumber\").focus();\n\t\t\t\t_(\"contactnumber\").select();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (_(\"wireless\").selectedIndex == 0) {\n\t\t\talert(\"Please select how the customer is connected.\");\n\t\t\t_(\"wireless\").focus();\n\t\t\treturn;\n\t\t}\n\n\t\tif (contactnumber == _(\"wtn\").value.replace(/[^0-9]/g, '').substr(0, 10)) {\n\t\t\t/* alert(\"The contact number you entered is invalid, have you asked for another contact number?\\r\\n\\r\\n\" +\n \"If we do not provide a valid contact number then a repair tech will not be able to reach the customer to work the ticket.\\r\\n\\r\\n\" +\n \"Click OK to enter a DIFFERENT contact number, or, if the customer has NO OTHER contact numbers, re-enter the contact number. \" +\n \"Failure to enter a valid contact number can result in administrative action. \");\n var nnum = prompt(\n \"Invalid Contact Number! Re-enter a different contact number below, or if NO OTHER numbers, re-enter same number.\", \"\");\n */\n\t\t\tvar nnum = prompt(\n\t\t\t\t\"The contact number you entered is invalid, have you asked for another contact number?\\r\\n\\r\\n\" +\n\t\t\t\t\"If we do not provide a valid contact number then a repair tech will not be able to reach the customer to work the ticket.\\r\\n\\r\\n\" +\n\t\t\t\t\"Re-enter a different contact number below, or if NO OTHER numbers, re-enter same number.\\r\\n\\r\\n\" +\n\t\t\t\t\"Failure to enter a valid contact number can result in administrative action. \", \"\");\n\t\t\tif (nnum == null) {\n\t\t\t\talert(\"The number you entered is not valid.\\r\\n\" + nnum + \"\\r\\n\\r\\nPlease try again.\");\n\t\t\t\t_(\"contactnumber\").focus();\n\t\t\t\t_(\"contactnumber\").select();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnnum = nnum.replace(/[^0-9]/g, '').substr(0, 10);\n\t\t\tif (nnum.replace(/[^0-9]/g, '').substr(0, 10).length != 10 || nnum.substr(0, 1) == '0') {\n\t\t\t\talert(\"The number you entered is not valid.\\r\\n\" + nnum + \"\\r\\n\\r\\nPlease try again.\");\n\t\t\t\t_(\"contactnumber\").focus();\n\t\t\t\t_(\"contactnumber\").select();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (nnum.match(/0/g)) {\n\t\t\t\tif (nnum.match(/0/g).length >= 6) {\n\t\t\t\t\talert(\"The number you entered is not valid.\\r\\n\" + nnum + \"\\r\\n\\r\\nPlease try again.\");\n\t\t\t\t\t_(\"contactnumber\").focus();\n\t\t\t\t\t_(\"contactnumber\").select();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontactnumber = nnum;\n\t\t\t_(\"contactnumber\").value = nnum;\n\t\t\t//alert(\"Contact number is the same as the DSL number. Please obtain an alternate contact number for this customer.\");\n\t\t\t//return;\n\t\t}\n\n\n\t\tswitch (true) {\n\t\t\tcase (contactname.length == 0):\n\t\t\t\t_(\"contactname\").focus();\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t\tcase (contactnumber.length != 10):\n\t\t\t\t_(\"contactnumber\").focus();\n\t\t\t\t_(\"contactnumber\").select();\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t\tcase (contacttype == 0):\n\t\t\t\t_(\"contacttype\").focus();\n\t\t\t\treturn;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (env == 3) {\n\t\t\tif (_('epixhour1').value.replace(/[^0-9]/g, '').length == 0) {\n\t\t\t\t_('epixhour1').focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (_('epixhour2').value.replace(/[^0-9]/g, '').length == 0) {\n\t\t\t\t_('epixhour2').focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (_(\"s\")) {\n\t\t\t_(\"s\").style.display = \"none\";\n\t\t}\n\t\tif (_(\"l\")) {\n\t\t\t_(\"l\").style.display = \"inline\";\n\t\t}\n\n\t\tvar confirmString = 'Please verify with the customer that the following information is correct:\\r\\n\\r\\n';\n\t\tparams = new Array();\n\n\t\tparams.push(new Array('lanid', urlencode(_(\"lanid\").value.toUpperCase().substr(0, 10))));\n\t\tparams.push(new Array('lanpw', urlencode(_(\"lanpwd\").value)));\n\t\tparams.push(new Array('wtn', _(\"wtn\").value.replace(/[^0-9]/g, '').substr(0, 10)));\n\t\tparams.push(new Array('USI', _('USI').value));\n\t\tparams.push(new Array('wireless', _('wireless').value));\n\t\tparams.push(new Array('fwNotes', _('fwNotes').value));\n\t\tparams.push(new Array('contactName', urlencode(contactname.substr(0, 31))));\n\t\tconfirmString += 'Contact Name: ' + contactname.substr(0, 16) + '\\r\\n';\n\t\tparams.push(new Array('contactNumber', contactnumber.replace(/[^0-9]/g, '').substr(0, 10)));\n\t\tconfirmString += 'Contact Number: ' + contactnumber.replace(/[^0-9]/g, '').substr(0, 10) + ' ';\n\t\tparams.push(new Array('contactType', contacttype));\n\t\tconfirmString += _(\"contacttype\").options[contacttype].text + '\\r\\n';\n\n\t\tparams.push(new Array('customerType', customerType));\n\t\tconfirmString += 'Customer Type: ' + customerType + '\\r\\n';\n\n\t\tparams.push(new Array('fwRouter', _(\"fwRouter\").options[_(\"fwRouter\").selectedIndex].text));\n\t\tconfirmString += 'FW Router: ' + _(\"fwRouter\").options[_(\"fwRouter\").selectedIndex].text;\n\n\t\tparams.push(new Array('issue', currentIssue));\n\t\tconfirmString += 'Issue: ' + currentIssueText + '\\r\\n';\n\n\t\tparams.push(new Array('env', env));\n\t\tif (env == 3) {\n\t\t\tparams.push(new Array('epixhour1', _('epixhour1').value.replace(/[^0-9]/g, '')));\n\t\t\tparams.push(new Array('epixhour2', _('epixhour2').value.replace(/[^0-9]/g, '')));\n\t\t}\n\n\t\tif (_(\"insidewire\")) {\n\t\t\tif (_(\"insidewire\").checked) {\n\t\t\t\tparams.push(new Array('iwc', '1'));\n\t\t\t\tconfirmString += 'Sold Inside Wire: Yes\\r\\n';\n\t\t\t}\n\t\t}\n\t\t/*\n if (_('cbdsl').checked) {\n params.push(new Array('cbdsl', '1'));\n params.push(new Array('wbdsl', _('wbdsl').value));\n params.push(new Array('lbdsl', _('lbdsl').value));\n confirmString += 'BDSL: Yes\\r\\nBDSL WAN: ' + _('wbdsl').value + '\\r\\nBDSL LAN: ' + _('lbdsl').value;\n }*/\n\n\t\tparams.push(new Array('phoneissue', _(\"phoneissue\").selectedIndex));\n\t\t/*if (_(\"cblue\").checked) {\n params.push(new Array('cblue', '1'));\n confirmString += \"Code Blue: True\\r\\n\";\n }*/\n\t\tif ((_(\"customerType\").value == \"fw\" && _(\"dataIssue\").options[_(\"fwDataIssue\").selectedIndex].attributes['speed'])) {\n\t\t\tconfirmString += \"Provisioned Speed: \" + _('provSpeed').value + \"\\r\\n\";\n\t\t\tconfirmString += \"Test Results: \" + _('resultSpeed').value + \"\\r\\n\";\n\t\t\tparams.push(new Array(\"provSpeed\", _('provSpeed').value));\n\t\t\tparams.push(new Array(\"resultSpeed\", _('resultSpeed').value));\n\t\t}\n\n\t\tif ($('#newcommittype').val().length == 0) {\n\t\t\tcreateError(\"You must select an appointment type\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar type = $('#newcommittype').val();\n\t\tvar committ = null;\n\t\tswitch (type) {\n\t\t\tcase 'D':\n\t\t\t\tcommitt = $('#newcommitallday');\n\t\t\t\tbreak;\n\t\t\tcase 'A':\n\t\t\t\tcommitt = $('#newcommitam');\n\t\t\t\tbreak;\n\t\t\tcase 'P':\n\t\t\t\tcommitt = $('#newcommitpm');\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\tcommitt = $('#newcommit4h');\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\tcommitt = $('#newcommit2h');\n\t\t\t\tbreak;\n\t\t\t\t;\n\t\t}\n\n\t\tvar split = committ.val().split('|');\n\t\tcdate = split[0];\n\t\tcstart = split[1];\n\t\tcend = split[2];\n\t\tvar date = split[0];\n\t\tvar start = split[1].replace(/[^0-9]/g, '');\n\t\tvar end = split[2].replace(/[^0-9]/g, '');\n\n\t\tvar dsplit = date.split('/');\n\t\tdate = ''.concat(padLeft(dsplit[0].replace(/[^0-9]/g, ''), 2), padLeft(dsplit[1].replace(/[^0-9]/g, ''), 2), padLeft(dsplit[2].replace(/[^0-9]/g, ''), 2));\n\t\tparams.push(['appttype', type]);\n\t\tparams.push(['apptdate', date]);\n\t\tparams.push(['apptstart', start]);\n\t\tparams.push(['apptend', end]);\n\n\n\t\tif (confirm(confirmString)) {\n\t\t\tticketInuse = true;\n\t\t\tticketAjax.addRequest('submitFWTicket.php', params, ticketFWSubmit);\n\t\t}\n\t\telse {\n\t\t\t_(\"s\").style.display = \"inline\";\n\t\t\t_(\"l\").style.display = \"none\";\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "1af3ca3d477af2a17b2896b2d332655a", "score": "0.5347991", "text": "async placeOpenOrder() {\n let account = await ftx.getAccount();\n let collateral = account.freeCollateral;\n let amountUsd = this.leverage * collateral / this.limit;\n console.log(`amountUsd: ${amountUsd}`);\n\n let orderbook = await ftx.getOrderBookFixed(this.market);\n let mid = (orderbook.bids[0][0] + orderbook.asks[0][0]) / 2;\n // mid = orderbook.asks[0][0]; // TODO for testing\n let sizeIncrementParts = ('' + this.marketDetails.sizeIncrement).split('.');\n let numDigits = sizeIncrementParts.length > 1 ? sizeIncrementParts[1].length : 0;\n this.size = parseFloat((amountUsd / mid).toFixed(numDigits));\n let orderString = `PLACING ${this.side} ORDER ${this.market} AT MID ($${mid})`;\n console.log(orderString)\n if(this.logging) twilio.sendSms(['5197772459'], orderString);\n\n let order = {\n market: this.market,\n side: this.side,\n price: mid,\n type: \"limit\",\n size: this.size,\n };\n\n let res = await ftx.query({ method: 'POST', path: '/orders', body: order, authRoute: true });\n this.openOrder = res.result;\n console.log(this.openOrder);\n }", "title": "" }, { "docid": "119f560e312f9ddd9bc672acdac77122", "score": "0.53399485", "text": "submit(e) {\n e.preventDefault();\n let form = e.target;\n this.errors = this.checkForErrors(form);\n if (!this.errors.length) {\n // if form contents are valid then move to next step\n this.triggerEnableOrderSummary();\n \n // store payment details in store\n const formData = new FormData(form);\n const cardHolderName = formData.get('cardHolderName');\n const cardNumber = formData.get('cardNumber');\n const cardExpiry = formData.get('cardExpiry');\n const cardCVV = formData.get('cardCVV');\n store.dispatch(addPaymentInCheckout({ cardHolderName, cardNumber, cardExpiry, cardCVV }));\n }\n }", "title": "" }, { "docid": "dcf1b1203fff2836cf4d109f17461842", "score": "0.53227997", "text": "function SmartOrderRefill() {}", "title": "" }, { "docid": "9e09d87d57bde057cfb7caf6a987c595", "score": "0.5321328", "text": "_order_entered(event) {\n const order = event.detail;\n if (isNaN(order.price)) {\n this.$.log.error('Invalid order entered');\n return;\n }\n this.$.trader_state.enter_order(order.price, 1, order.is_bid, order.asset_name);\n }", "title": "" }, { "docid": "df28a84b307461cfd4d9cdac214eca90", "score": "0.5314747", "text": "function createNewOrderData(){\n //get shipping method\n var shippingPrice = document.getElementById(\"option\").value;\n switch(shippingPrice){\n case \"5\":\n this.shippingMethod = \"6 Days Ground\"\n break;\n case \"10\":\n this.shippingMethod = \"2 Days Expedited\"\n break;\n case \"30\":\n this.shippingMethod = \"Overnight\"\n break;\n }\n let orderInfo = {\n ClothID: this.productData.id,\n firstNameValue : firstName.value.trim(), \n lastNameValue : lastName.value.trim(),\n phoneValue : phone.value.trim(),\n emailValue : email.value.trim(),\n addressValue : address.value.trim(),\n cityValue : city.value.trim(),\n stateValue : state.value.trim(),\n zipcodeValue : zipcode.value.trim(),\n ShippingMethod: this.shippingMethod,\n Quantity: this.productData.quantity,\n Tax: this.tax.toFixed(2),\n TotalPrice: this.total.toFixed(2),\n CardLast4Digit: cardNo.value.trim().substring(12,17),\n CardExpDate: exp.value.trim()\n }\n \n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function (){\n if (this.readyState == 4 && this.status == 200) {\n orderID = xhr.responseText;\n console.log(orderID)\n localStorage.setItem('orderID', JSON.stringify({OrderID:orderID }));\n window.location.href = \"confirmation.html\"; \n } \n }\n xhr.open(\"POST\", \"form-customerInfo.php\",true);\n xhr.setRequestHeader(\"content-type\", \"application/json\");\n xhr.send(JSON.stringify(orderInfo));\n }", "title": "" }, { "docid": "3e48681dd5cd853ef4417f11929ca942", "score": "0.53124446", "text": "function success() {\n\tvar placeOrderResult = app.getController('COPlaceOrder').Start();\n\tif (placeOrderResult.error) {\n\t\tapp.getController('COSummary').Start({\n\t\t\tPlaceOrderError : new Status(Status.ERROR, 'basket.changed.error')\n\t\t});\n\t} else if (placeOrderResult.order_created) {\n\t\tapp.getController('COSummary').ShowConfirmation(placeOrderResult.Order);\n\t}\n}", "title": "" }, { "docid": "fc645567f9d954dabbcf32d5a53fae31", "score": "0.53114814", "text": "function RetrieveWebOrder() {\n var requestObject = EAUtils.ExtractRequestObject();\n if (!requestObject) {\n EAUtils.UpdateProductMessages();\n } else {\n var ScriptResult = Transaction.wrap(function() {\n return GetOrderFromOrderToken.getOrderFromToken(requestObject.token);\n });\n if (!ScriptResult.orderNo) {\n EAUtils.UpdateProductMessages();\n } else {\n var order = OrderMgr.getOrder(requestObject.order_no);\n if (!order) {\n EAUtils.UpdateProductMessages();\n } else {\n EAUtils.UpdateProductMessages(order);\n }\n }\n }\n\n}", "title": "" }, { "docid": "71483a3c7fd71b6d64fc59f26c589407", "score": "0.5306971", "text": "function clientdetails()\n{ \n\npostData=$('#inv_id').val();\n// alert(postData);\nvar request = $.ajax({\n url: '../job-supplier-payment-get-client-details/'+postData,\n type: 'GET',\n dataType: 'JSON'\n });\n request.done( function (result) {\n console.log(result);\n var values=JSON.stringify(result);\n $(\"#details\").val(result[0].client_name+'-'+result[0].JobId);\n $(\"#job_no\").val(result[0].JobId);\n$(\"#amount\").val(result[0].GrandTotal);\nconsole.log(result[0].client_name);\nconsole.log(result[0].JobId);\n });\n\n}", "title": "" }, { "docid": "81b605f5d9f32efa7d806ef3c6e5a66e", "score": "0.5305117", "text": "function VsflexOrderTask_OnClick() {\n var vsflexGrid = vsflexOrderTask;\n var row = vsflexGrid.Row;\n var col = vsflexGrid.Col;\n if (row < vsflexGrid.FixedRows\n || col < vsflexGrid.FixedCols \n || col > _OrderTaskGridColIndexs.OrderExecuted) return;\n\n var data = vsflexGrid.RowData(row);\n var orderType = data.type;\n\n var orders = data.object;\n\n var cellData = vsflexGrid.Cell(flexcpData, row, col);\n if (typeof (cellData) == \"undefined\") return;\n\n var orderAction = cellData.Action\n switch (orderAction) {\n case FillOrderAction.NoneAction:\n break;\n case FillOrderAction.OnOrderAccept:\n var isEnable = cellData.IsEnable;\n if (isEnable) {\n OnOrderAccept(row);\n }\n break;\n case FillOrderAction.OnOrderReject:\n var isEnable = cellData.IsEnable;\n if (isEnable) {\n OnOrderReject(row);\n }\n break;\n case FillOrderAction.OnOrderDetail:\n OnOrderDetail(row);\n break;\n case FillOrderAction.OnOrderAcceptPlace:\n OnOrderAcceptPlace(row);\n break;\n case FillOrderAction.OnOrderRejectPlace:\n OnOrderRejectPlace(row);\n break;\n case FillOrderAction.OnOrderAcceptCancel:\n OnOrderAcceptCancel(row);\n break;\n case FillOrderAction.OnOrderRejectCancel:\n OnOrderRejectCancel(row);\n break;\n case FillOrderAction.OnOrderUpdate:\n\n var isEnable = cellData.IsEnable;\n if (isEnable) {\n OnOrderUpdate(row);\n }\n break;\n case FillOrderAction.OnOrderModify:\n var isEnable = cellData.IsEnable;\n if (isEnable) {\n OnOrderModify(row);\n }\n break;\n case FillOrderAction.OnOrderWait:\n OnOrderWait(row) ;\n break;\n case FillOrderAction.OnOrderExecute:\n OnOrderExecute(row);\n break;\n case FillOrderAction.OnOrderCancel:\n OnOrderCancel(row);\n break;\n }\n vsflexGrid.Col = _OrderTaskGridColIndexs.Item;\n}", "title": "" }, { "docid": "8e7348407bede530ffbc3243b83c97ce", "score": "0.5302655", "text": "function handleSubmit(event) {\n\n event.preventDefault();\n console.log(event.target);\n\n // get all the values from the form\n var drink = event.target;\n var name = drink.name.value;\n var size = drink.size.value;\n var isHot = drink.isHot.checked;\n var dType = drink.drinkType.value;\n var milk = drink.milk.value;\n\n\n new Coffee(name, size, milk, isHot, dType);\nconsole.log(Coffee.all);\n\n sendOrderToLS();\n renderOrders();\n}", "title": "" }, { "docid": "055f40770631a93d747a6132ddd3b099", "score": "0.53010184", "text": "function openOrder(symbol, quantity, price, execution, action, hidden, post_only, reduce) {\n const id = Date.now();\n results[id] = function (error, data) {\n if (error) console.log(\"fail to place the order\");\n else console.log(\"order is placed\", data);\n };\n send({\n m: 'o',\n a: action,\n s: symbol,\n q: quantity * satoshi,\n p: price * satoshi,\n e: execution,\n h: hidden,\n po: post_only,\n r: reduce,\n myId: \"my optional Id\",\n id: \"you can provide an id to get the result of your message if you use the websocket api\"\n });\n}", "title": "" }, { "docid": "830695684d428c606737f8e44b15501d", "score": "0.5300541", "text": "function _billing(){\n _detail_page('overview');\n _submit_billing();\n}", "title": "" }, { "docid": "ae9338a57744cee320b491e1f9cebe9a", "score": "0.52959406", "text": "function getTicket() {\n restMessages();\n if (vacancy === 'No Vacancy') {\n setErrorMessage('Sorry but there are no more spots available');\n } else {\n let ticketNumber = Math.floor(Math.random() * 1000000000);\n setCustomers([\n ...customers,\n { entryTime: Date.now(), ticketNumber, paid: false }\n ]);\n setTotalSpotsAvalible(TotalSpotsAvalible - 1);\n setResponseMessage(`your ticket number is ${ticketNumber}`);\n if (TotalSpotsAvalible - 1 === 0) {\n setVacancy('No Vacancy');\n }\n }\n }", "title": "" } ]
019c6c173340e919409fd830beef0c0c
function to get total
[ { "docid": "e4cc8a0fda6eedf05843f47d6b40bc14", "score": "0.0", "text": "function updateCartTotal() {\nlet totalPriceRow = document.getElementsByClassName('totalTd');\nvar total = 0;\nfor (var i = 0; i < totalPriceRow.length; i++) {\n let con=Number(totalPriceRow[i].innerHTML);\n total+=con ;\n}\nlet theTotal=document.getElementById('total_price');\ntheTotal.innerHTML=total;\n}", "title": "" } ]
[ { "docid": "52bdddf1a5ff93a34f9dabebdc96961b", "score": "0.8132858", "text": "function getTotal() {\n\t\treturn _total;\n\t}", "title": "" }, { "docid": "9d3447f5fba323f2fcd34c30379b76fb", "score": "0.79872555", "text": "function total() {\n var sum = sumUpPrices()\n return sum\n}", "title": "" }, { "docid": "c82104def4c4acc95992a0e3ab698538", "score": "0.7922595", "text": "GetTotal(){\n var TotalPrice=0;\n for(let i=0;i<this.items.length;i++){\n TotalPrice+=this.items[i].TotalPrice;\n }\n return TotalPrice;\n }", "title": "" }, { "docid": "adf16fe611f52555efc0ad49b86d39e8", "score": "0.7827141", "text": "function total(type){\n var sum = 0;\n data.allItems[type].forEach(function(curr){\n sum += curr.value;\n });\n if(type === 'inc'){\n data.totalInc = sum;\n } else if(type === 'exp'){\n data.totalExp = sum;\n }\n return sum;\n }", "title": "" }, { "docid": "dd798b98da63396a385de1598bc70a5b", "score": "0.7814438", "text": "function totalCount() {\n return total;\n}", "title": "" }, { "docid": "4dd5eaca70e8db0c99b2a1684051e7f5", "score": "0.77033734", "text": "getTotal(){\n \n this.total = this.cart.reduce((p, i) => i.cantidad * i.precio + p, 0) \n return this.total\n\n }", "title": "" }, { "docid": "055592a8f41148fd4997b5bb9ea3236a", "score": "0.76761514", "text": "sumTotal() {\n this.total = 0;\n for ( let i = 0; i < this.expenses.length; i++) {\n this.total += this.expenses[i].price;\n } return this.total;\n }", "title": "" }, { "docid": "d781cd0950692dd134bdc385180fa016", "score": "0.76420456", "text": "function calculateTotal() {\n let sum = 0;\n state.cart.forEach(item => {\n sum += item.price * item.purchaseQuantity;\n });\n return sum.toFixed(2);\n }", "title": "" }, { "docid": "017780fcccbedd0adf2453092ca5f3a2", "score": "0.7637606", "text": "getTotal() {\n\t\tlet totalPrice = 0;\n\n\t\tthis.products.forEach((product) => {\n\t\t\ttotalPrice += product.price;\n\t\t});\n\n\t\treturn totalPrice;\n\t}", "title": "" }, { "docid": "00ffc0901c9edcc00666ed74849dd3f2", "score": "0.76140404", "text": "getTotal() {\n let subTotal = this.getSubTotal();\n let shippingCost = this.getShippingDetails().price;\n return (shippingCost) ? subTotal + shippingCost : subTotal;\n }", "title": "" }, { "docid": "5c240365024272ba2f5624da23fbe8ab", "score": "0.7604847", "text": "function calcTotal () {\n var calcTotal = shoppingCart.reduce(function(acc, val){\n return acc + val;\n });\n return calcTotal;\n}", "title": "" }, { "docid": "f85c8e4cf72b54b3adb73193c20381a2", "score": "0.75832546", "text": "function getTotal(){\n\tlet totalValue = 0\n\tfor(let i=0 ; i<_cart.length;i++){\n\t\tlet currentProduct = _cart[i]\n\t\ttotalValue = totalValue + (currentProduct.count * currentProduct.value)\n\t}\n\treturn totalValue\n}", "title": "" }, { "docid": "e62aaa9eafd9ec67bacf81167d1d3169", "score": "0.75814795", "text": "function calculateTotal() {\n return filteredCart.reduce((acc, curr) => acc + curr.price, 0)\n }", "title": "" }, { "docid": "f293a5b88c0e2166037c7894ff0e35ef", "score": "0.75684655", "text": "getTotal() {\n return Object.values(this.props.basket).reduce((acc, item) => {\n acc += (Number(item.qty) * Number(item.product_price));\n return acc;\n }, 0)\n }", "title": "" }, { "docid": "25f0e46de5f57c0ff590e750cb17f73a", "score": "0.75304335", "text": "function getTotal() {\n $scope.total = 0;\n\n // For every entry in transaction, multiple its price times quantity and add to the total\n $scope.transaction.forEach(function (item) {\n $scope.total += item.price * item.quantity;\n });\n }", "title": "" }, { "docid": "814b9ce942cdb46167189e556d1ef6d7", "score": "0.75039446", "text": "total() {\n return Object.entries(this.productCounters).reduce(\n (total, [productCode, counter]) => {\n const { price } = this.products[productCode];\n const productTotal = price * counter;\n const productDiscount = this.getProductTotalDiscountValue(productCode);\n return total + (productTotal - productDiscount);\n },\n 0\n );\n }", "title": "" }, { "docid": "a1072a73e07d9462d4d82d1e4a4ed40e", "score": "0.7496043", "text": "function getTotal()\n{\n if (epargne == null)\n {\n return getRecettesTotal() - getDepensesTotal();\n } else {\n return (epargne + getRecettesTotal()) - getDepensesTotal();\n }\n}", "title": "" }, { "docid": "70f1df50d0c0a85001f35509f7d3f42e", "score": "0.7481542", "text": "function calcularTotal() {\r\n // Limpiamos precio anterior\r\n total = 0;\r\n // Recorremos el array del carrito\r\n carrito.forEach((item) => {\r\n // De cada elemento obtenemos su precio\r\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\r\n return itemBaseDatos.id === parseInt(item);\r\n });\r\n total = total + miItem[0].precio;\r\n });\r\n // Renderizamos el precio en el HTML\r\n DOMtotal.textContent = total.toFixed(2);\r\n }", "title": "" }, { "docid": "6592275e934e9b0c236ed4b8aa956014", "score": "0.7474264", "text": "function findtotal( ) {\n var subtotal = 0;\n var total = 0;\n var countarray = [];\n var taxrate = $('.taxrate').text();\n $('.active>.itemPrice').each(function() {\n countarray.push(+($(this).text()))\n });\n for (var i = 0, j = countarray.length; i < j; i += 1) { \n subtotal = subtotal + countarray[i]; \n };\n $('.subtotal').text(subtotal);\n var tax = Math.round((subtotal * taxrate/100) *100)/100;;\n $('.tax').text(tax);\n total = Math.round((tax + subtotal)*100)/100;\n // total = (tax + subtotal);\n $('.total').text(total);\n }", "title": "" }, { "docid": "351964e7bb51976b6e35fd16d9ed19d8", "score": "0.7458959", "text": "function getTotalPrice()\n{\n const bestPrice = parseInt(getValue('best-price'));\n const memoryPrice = parseInt(getValue('extra-memory-price'));\n const storagePrice = parseInt(getValue('extra-storage-price'));\n const deliveryCharge = parseInt(getValue('delivery-charge-price'));\n return bestPrice + memoryPrice + storagePrice + deliveryCharge;\n}", "title": "" }, { "docid": "8200acdc640e883eb1e62814c3e98a0a", "score": "0.7456548", "text": "function total() {\n var sum = 0;\n for (var x = 0; x < cart.length; x++) {\n var item = cart[x]\n var itemPrice = item.itemPrice\n sum = sum + item.itemPrice\n // sum += cart[x].itemPrice;\n }\n return sum;\n}", "title": "" }, { "docid": "36b797193af86acc8f4fb6a39614c458", "score": "0.74557084", "text": "function totalValue (items){\n var ordrItem = new Array;\n var tValue = Number;\n console.log('Prueba Items', items);\n ordrItem = items;\n\n ordrItem.forEach(element => {tValue += element.total; });\n return tValue;\n}", "title": "" }, { "docid": "08d67fd6391928852373fe3e7449087c", "score": "0.74400127", "text": "get total() { return this._total }", "title": "" }, { "docid": "a9064b85e7a1da20c449887c5a871ef5", "score": "0.74095833", "text": "function getSum(total, num) {\n\t\t\t\t \treturn total + num;\n\t\t\t\t\t\t}", "title": "" }, { "docid": "69bda3d8f4b0ec1e80ac0dc4dc496f38", "score": "0.7408804", "text": "function getChecksTotal(){\n var total = 0;\n vm.checks.forEach(function (check) {\n total += check.checkAmount;\n });\n console.log('checks Total: ' + total);\n vm.checksTotalAmount = total;\n }", "title": "" }, { "docid": "ebb884761be4dfb5eeada7d99bf33268", "score": "0.7401369", "text": "function calculate_total(frm, name) {\n var entries = frm.doc.accounting_entries;\n var total = 0;\n for (var i in entries) {\n total = total + entries[i][name];\n }\n return total;\n}", "title": "" }, { "docid": "9f37df8a4abc1c4dfa92d6da3e29da13", "score": "0.7387017", "text": "function getTotal() {\nvar total = 0;\ntotal += parseInt(trailerPrice);\ntotal += parseInt(shipping);\n\t//calculate option total\n\tvar price = $('.price').text();\n\tprice = price.split(\"$\")\n\tfor(i=1;i<price.length;i++){\n\t var temp = price[i];\n\t temp = temp.replace(/\\D/g,'');//get rid of the dollar sign\n\t total += parseInt(temp);\n }\nreturn parseInt(total);\n}", "title": "" }, { "docid": "c46e89955281abc545594043c4081496", "score": "0.7372622", "text": "function getSum() {\n var sum = 0\n for (var i = 0; i < total.length; i++) {\n sum += parseInt(total[i]);\n }\n console.log(sum);\n $(\"#total-p\").text(\"$: \" + sum + \".00\")\n\n}", "title": "" }, { "docid": "8791de80f3b5e63facea751dad6fd9ed", "score": "0.73679584", "text": "total_price() {\n var sum = 0;\n //********recorre el array selected sumando los valores********//\n this.selected.forEach(e => {sum += e.valor;});\n return sum\n }", "title": "" }, { "docid": "6ab9bbda8a3085447289da5cfb14d7d6", "score": "0.73584586", "text": "function calcularTotal() {\n \n total = 0;\n \n carrito.forEach((item) => {\n \n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + miItem[0].precio;\n });\n \n DOMtotal.textContent = total.toFixed(2);\n }", "title": "" }, { "docid": "37f34677d43717a7fdce955ec58a32b8", "score": "0.7351048", "text": "get total() {\n return this._data.total;\n }", "title": "" }, { "docid": "e233cd67d7156f52e083eec744e62cd7", "score": "0.7332333", "text": "cartNetTotal() {\n return parseFloat(this.itemsCollection.sum(item => item.quantity * item.unitPrice))\n }", "title": "" }, { "docid": "168aab2e7ebc8c4e128667b1846de688", "score": "0.7327499", "text": "function getDepensesTotal()\n{\n let temp = 0;\n for (let depense of depenses)\n {\n temp += depense.montant;\n }\n\n return temp;\n}", "title": "" }, { "docid": "b3ab53ea89b8ddb3368f00ef6322f840", "score": "0.73269975", "text": "function valorTotal() {\n\t\tvar valorTotal = 0,\n\t\t\tvalor;\n\t\t\n\t\t$('.grid tbody tr').each(function(i){\n\t\t\tvalor = $(this).find('.itemTotal').text();\n\t\t\tvalor = valor.replace('R$ ', '').replace('.', '').replace(',', '.');\n\t\t\tvalorTotal += parseFloat(valor);\n\t\t});\n\t\t$('.valorTotal').text('R$ '+ number_format(valorTotal, 2, ',', '.'));\n\t}", "title": "" }, { "docid": "360ab0068f8546f01579a2d7ef58ebb1", "score": "0.73253936", "text": "function calculateSum() {\n\t\tvar sum = 0;\n\t\t//iterate through each subtotal class and add values\n\n\t\t\t$(\".subtotal\").each(function(){\n\t\t\t\t//remove dollar sign so we can add values\n\t\t\t\tvar value = $(this).text().replace(\"$\",\"\");\n\t\t\t//add only if value is number\n\t\t\t\tif (!isNaN(value) && value.length != 0) {\n\t\t\t\t\tsum += parseFloat(value);\n\t\t\t}\n\t\t});\n\t\t$(\".total\").text(\"$\" + sum);\n\t}", "title": "" }, { "docid": "fbb374a523b1b4ee3ee2f3023e136ba3", "score": "0.7322356", "text": "function totalsum(){\n\tlet sum=0;\n for (i=0; i<itemsincart.length; i++){\n \tsum += itemsincart[i].price * itemsincart[i].quantity;\n }\n total.innerText=\"Total: $\"+sum;\n}", "title": "" }, { "docid": "d88f0a7bcbaa52d852f5e74bde704942", "score": "0.7318856", "text": "function getSum(total, num) {\nreturn total + num;}", "title": "" }, { "docid": "eb14419ec1b14838421e6dae0b202848", "score": "0.7318312", "text": "function getTotal() {\n // Calculate Total from Wanted & Caught Lists\n total = wantedCount + caughtCount;\n\n // Display Total\n document.querySelector('#item-count').textContent = `Total Villains: ${total}`;\n totalArea = document.querySelector('.total-area');\n totalArea.className = \"total-area\";\n}", "title": "" }, { "docid": "37e3acf0f059cff2894b1277a3305d42", "score": "0.7317453", "text": "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n carrito.forEach((item) => {\n // De cada elemento obtenemos su precio\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + miItem[0].precio;\n });\n\n DOMtotal.textContent = total.toFixed(2);\n }", "title": "" }, { "docid": "41e4ba96be7752ef7fc5b256a5d0c8d3", "score": "0.73127025", "text": "function grandTotal(){\n var sum = 0;\n $('.sum').each(function(){\n sum += parseInt($(this).html() || 0);\n $('#grandtotal').html(sum);\n })\n }", "title": "" }, { "docid": "6600810fbe66c804ed941475d09cf5ff", "score": "0.73046744", "text": "function total() {\n let totalPrice =\n parseFloat(bestPriceElem.innerText) +\n parseFloat(memoryCostElem.innerText) +\n parseFloat(storageCostElem.innerText) +\n parseFloat(deliveryChargeElem.innerText);\n\n return totalPrice;\n}", "title": "" }, { "docid": "d54f9848f39f125fd75bb80a41224945", "score": "0.73024887", "text": "function countTotal() {\n\t\tvar result = ret_amt.val().split(',').join('') - disc_total.val().split(',').join('')\n\t\tvar hasil = numberWithCommas(result)\n\t\tret_total.val(hasil)\n }", "title": "" }, { "docid": "f852cf9dd3c4bd1d02f4e4e050bb3df0", "score": "0.72970206", "text": "static getTotalCalories() {\n\t\tdocument.querySelector('#t-cal').innerText = Item.totalCalories();\n\t}", "title": "" }, { "docid": "9ab98cd26bb9ffbd1e1b54482a900e22", "score": "0.728746", "text": "calcTotal(){\r\n\t\tconst sum = Number(this.jobsSubtotal) + Number(this.extraHours);\r\n\t\treturn sum.toFixed(2);\r\n\t}", "title": "" }, { "docid": "292aa79ceb4edec8b28bddb089d602b6", "score": "0.7282008", "text": "function CalcTotal() {\n var total = 0.00;\n var items = $(\".itemRow\");\n items.each(function (index, element) {\n if ($(this).children().last().prev().prev().children().first().is(':checked')) {\n var price = parseFloat($(this).children().last().prev().prev().prev().html());\n var course = parseFloat($(this).children().last().val().toString().replace(\",\", \".\"));\n total += parseFloat(price * course);\n }\n });\n\n //Get the currency of user' organisation\n $.get(\"/HelpModule//Currency/GetBaseCurrency\").done(function (data) {\n total = total.toFixed(2);\n $(\"#total\").html(total.toString() + \" \" + data.Notation);\n });\n\n }", "title": "" }, { "docid": "80d768f4c6a149f3273fce8e85a5affb", "score": "0.7276281", "text": "get totalAmount() {//use getters to get the value\n const sum = this.items.reduce(\n (previousValue, currentItem) => previousValue + currentItem.price,\n 0\n );\n return sum;\n }", "title": "" }, { "docid": "1ce0fa9cd69b8e82cc9f32b2b49c4b2e", "score": "0.7274516", "text": "function sumTotal(data) {\n\n // reset the total sum;\n //\n var sum = 0;\n\n // Go through the elements and collect the internal texts.\n // Each string is parsed to an integer.\n //\n for (i = 0; i < data.length; i++) {\n sum += parseInt(data[i].innerText);\n }\n return sum;\n}", "title": "" }, { "docid": "70f4636441d4a091a0584b34427a2678", "score": "0.7272558", "text": "getTotal() {\n return this.items.reduce((acc, item) => {\n const amount = Money({ amount: item.quantity * item.product.price });\n let discount = Money({ amount: 0 });\n\n if (\n item.condition &&\n item.condition.percentage &&\n item.quantity > item.condition.minimum\n ) {\n discount = amount.percentage(item.condition.percentage);\n }\n\n return acc.add(amount).subtract(discount);\n }, Money({ amount: 0 }));\n }", "title": "" }, { "docid": "f3cc9d35235839e62261df3762ab62a7", "score": "0.7271415", "text": "get totalPrice() {\n return this.items.reduce((accumulator, current) => accumulator + current.totalPrice, 0);\n }", "title": "" }, { "docid": "6d977ade853b85e59c8dadb4a48ac340", "score": "0.72594965", "text": "get _total() {\n return this._get('_total');\n }", "title": "" }, { "docid": "f79a193aaacd4ad179429a224f564a05", "score": "0.72577864", "text": "function contarTotal(){\n let total = 0;\n for(let item of carrito){\n total += item.precio\n }\n return total;\n}", "title": "" }, { "docid": "9d8f7ecaf415fcc3d5af9c1407567995", "score": "0.7244085", "text": "function getSum(total, num) {\n return total + num;\n }", "title": "" }, { "docid": "1f0a6de2f85ea1655fa35d50fc8108db", "score": "0.7235405", "text": "caculateTotal(){\n var total = this.state.total;\n var i;\n var subtotal;\n for(i=0; i<this.state.cartProducts.length; i++ ){\n \tsubtotal = this.state.cartProducts[i].pro_price * this.state.cartProducts[i].pro_quan;\n \ttotal = total + subtotal;\n }\n return total\n }", "title": "" }, { "docid": "b33573aef5aae725f0deb886de215bcd", "score": "0.7233014", "text": "function getSum(total,num){\r\n\t\treturn total + num;\r\n\t}", "title": "" }, { "docid": "541c3775c98b4e165dcc1b1d7ca368ce", "score": "0.7227675", "text": "function calcTotal(){\n\ttotal = 0\n\tfor (const [key, value] of Object.entries(storage)){\n\t\tsub = parseInt(list[key].precio * storage[key])\n\t\ttotal = total + sub;\n\t\tlet precioTotal = document.getElementById(\"precioTotal\");\n\t\tif (precioTotal != null){\n\t\t\tprecioTotal.innerHTML = \"¥\" + total\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3d2f7e77412cced4a8d670df38ec8fb4", "score": "0.72177345", "text": "function getCartTotal (data) {\n let total = 0\n for(var i = 0; i < data.length; i++) {\n total += data[i].total\n }\n return total\n}", "title": "" }, { "docid": "fd5dccfe0460af757694f6e82b628747", "score": "0.7208316", "text": "function getConsumeTotal() {\n var items = this.items;\n\n\n var itemToday = { 'energy':0,'co2':0, 'trees':0 }\n var itemYesterday = { 'energy':0,'co2':0,'trees':0}\n\n for(var i = 0; i< items.length ; i++ ){\n itemToday.energy += extractNumber(items[i].today.energy);\n itemToday.co2 += extractNumber(items[i].today.co2);\n itemToday.trees += extractNumber(items[i].today.trees);\n\n itemYesterday.energy += extractNumber(items[i].yesterday.energy);\n itemYesterday.co2 += extractNumber(items[i].yesterday.co2);\n itemYesterday.trees += extractNumber(items[i].yesterday.trees);\n }\n\n\n itemToday.energy = itemToday.energy + \" kWh\" \n itemToday.co2 = itemToday.co2 + \" kilos\"\n itemToday.trees = itemToday.trees + \" arboles\"\n\n itemYesterday.energy = itemYesterday.energy + \" kWh\"\n itemYesterday.co2 = itemYesterday.co2 + \" kilos\"\n itemYesterday.trees = itemYesterday.trees + \" arboles\"\n\n return {\n today: itemToday,\n yesterday: itemYesterday, \n title: \"Datos del Grupo LOPESAN\",\n title2: \"Datos del Grupo LOPESAN\",\n img:getHotleImg('total'),\n };\n }", "title": "" }, { "docid": "aa7b9e89149a00d6102333730b494888", "score": "0.7197911", "text": "function totalOrderSum() {\r\n let table = tables[tableName];\r\n let cart = table[\"cart\"];\r\n\r\n let sum = 0;\r\n for (let item in cart){\r\n beverage = cart[item];\r\n namn = beverage.namn\r\n \r\n sum += table[\"amount\"][namn] * parseInt(beverage.prisinklmoms);\r\n }\r\n\r\n return sum;\r\n}", "title": "" }, { "docid": "57888050543583813669a884eb91caf5", "score": "0.71967405", "text": "get total() {\r\n return this._total;\r\n }", "title": "" }, { "docid": "62f072235c5e5e0b86a9d745d3b90949", "score": "0.71939445", "text": "function calcularTotal() {\n //Sumar todos los valores de subtotal\n\n var suma = 0;\n $('.subtotal').each(function() {\n suma += parseFloat($(this).text());\n });\n\n \n //Imprimo ese valor en el span total global\n $('.precioTotal').html(suma);\n console.log(suma);\n }", "title": "" }, { "docid": "b4a23845c3728abdfbc69d2d58159dca", "score": "0.71825856", "text": "function jumlahAsetAlih() {\r\n sum_ori_acq.forEach(el => {\r\n result1 = el.total;\r\n });\r\n return result1;\r\n }", "title": "" }, { "docid": "b33a17946a28104e274e0baf67eddc9b", "score": "0.7182293", "text": "totalPrice() {\n for(let i = 0; i < this.pricingRules.length; i++){\n this.items = this.pricingRules[i].runRule(this.currentCustomer, this.pricingRules[i].customers, this.pricingRules[i].type, this.items);\n }\n let total = 0;\n for(let i = 0; i < this.items.length; i++){\n total += this.items[i].price;\n }\n return total;\n }", "title": "" }, { "docid": "7872bf8d439c67108399450d1877bc4d", "score": "0.7174718", "text": "getSubTotal() {\n let amount = 0;\n this.model.cart.products.forEach(function (product) {\n amount += product.quantity * product.details.pricing.retail;\n });\n return amount;\n }", "title": "" }, { "docid": "8cc80e7bd23bc1e1d6e02622b6d01b1b", "score": "0.71696705", "text": "function fieldsTotal(){\n\t\tvar add = 0;\n $(\".field\").each(function() {\n add += Number($(this).val());\n });\n return add;\n\t}", "title": "" }, { "docid": "18dcd2fe5aae9922dcf7df45ae3d6175", "score": "0.7169162", "text": "function cal() {\r\n total += parseInt(obj[id()].price);\r\n }", "title": "" }, { "docid": "7254160d644efe423cc1d01dbd8dfa40", "score": "0.71682894", "text": "function totals(taxes, price, quantity){\n \n var unit_tax = unitTax(taxes, price);\n \n var tot_tax = unit_tax * quantity;\n var tot_net = price * quantity;\n\n var tot_tax_dom = parseFloat($('#taxtotal').text());\n tot_tax_dom += tot_tax;\n $('#taxtotal').empty();\n $('#taxtotal').text(tot_tax_dom.toFixed(2));\n\n var main_tot = parseFloat($('#maintotal').text());\n main_tot += tot_net + tot_tax;\n $('#maintotal').empty();\n $('#maintotal').text(main_tot.toFixed(2));\n\n return (tot_tax + tot_net).toFixed(2);\n }", "title": "" }, { "docid": "b04c57246100609cede7cf0485b597da", "score": "0.71635634", "text": "function total(array) {\n var total = 0;\n array.forEach(function (item, index) {\n total += item;\n });\n return total;\n }", "title": "" }, { "docid": "e8099dbb3a9fdf86b2580d2f8be104d0", "score": "0.716104", "text": "calculateTotalPerPerson(){\n var tip = this.calculateTipPerPerson();\n var total = tip + Number(this.billAmount/this.numberOfPeople);\n return total;\n }", "title": "" }, { "docid": "6544f5ef4747d36c12406ccea7fe0ff7", "score": "0.7158599", "text": "function calculateTotal(){\n var totalCount = 0;\n jQuery('#transaction_points, [id^=transaction_points_u]').each(function(){\n if (jQuery(this).html().substr(0,1) == '-') {\n totalCount -= getNumericValueOfPointElement(jQuery(this));\n } else {\n totalCount += getNumericValueOfPointElement(jQuery(this));\n }\n });\n\n // get points shortcut\n var pointsShortcut = '';\n var firstRowPoints = jQuery('#transaction_points, [id^=transaction_points_u]').first();\n if (firstRowPoints.length != 0) {\n pointsShortcut = getAlphabeticalValueOfPointElement(firstRowPoints);\n }\n\n var totalRow =\n '<tr><th style=\"background-color: #f7d117; padding: 8px 20px;\">TOTAL</th>' +\n '<th style=\"background-color: #f7d117;\"></th>' +\n '<th id=\"totalCount\" style=\"background-color: #f7d117; padding: 8px 20px; text-align: center;\">' + totalCount + pointsShortcut + '</th></tr>';\n\n jQuery('#transaction_table tbody:first-child').append(totalRow);\n}", "title": "" }, { "docid": "6d6c813b82c3b15f9559551aaf0247f1", "score": "0.7154308", "text": "function getTotal()\n{\n\tvar sum = 0;\n\tfor(var i = 0; i < transactions.length; i++)\n\t{\n\t\tvar tempDate = getUTC(transactions[i].date);\n\t\tif (transactions[i].cost > 0 && tempDate > startUTC)\n\t\t{\n\t\t\tsum += transactions[i].cost;\n\t\t}\n\t}\n\treturn sum;\n}", "title": "" }, { "docid": "6ed417adca47f0fd50e6263ec154528e", "score": "0.7148446", "text": "function cartTotal() {\n let total = 0;\n carrito.forEach(navCartItem => {\n const itemPrice = navCartItem.precioProd\n const itemCantidad = navCartItem.cantidadProd\n total = total + (itemPrice * itemCantidad);\n });\n totalCarrito.innerHTML = `${\n total.toFixed(2)\n }`;\n return total\n}", "title": "" }, { "docid": "93d4aae129c2f213715b38a8426445c5", "score": "0.71458274", "text": "totalSpent(){\n return this.meals().reduce((sum, meal) =>{\n return sum + meal.price\n },0)\n }", "title": "" }, { "docid": "7968067aab117c2b624f857f4533925d", "score": "0.7134422", "text": "function totalCarrito(carrito) {\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total.toFixed(2);\n}", "title": "" }, { "docid": "92a48bdbdff70cde7927123ea5c96d8e", "score": "0.71310514", "text": "function totalCalculate() {\r\n total = 0;\r\n carrito.forEach((item) => {\r\n const miItem = products.filter((itemBaseDatos) => {\r\n return itemBaseDatos.id === parseInt(item);\r\n });\r\n total = total + miItem[0].precio;\r\n });\r\n DOMtotal.textContent = total;\r\n}", "title": "" }, { "docid": "001b7f2dafd9f397c1518c87a4d2bca0", "score": "0.71285886", "text": "function totalCarrito(carrito) {\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total;\n}", "title": "" }, { "docid": "3e23174eb9ced6e1c7c8dd1ed5891b08", "score": "0.71203035", "text": "function caltotal(){\n var total = 0;\n\n for (var k = 1; k<tablebody.children.length; k++){\n var gg = parseInt(tablebody.children[k].children[4].textContent);\n total += gg;\n }\n document.getElementById('ans').textContent = \"Your total is: INR \"+ total;\n\n}", "title": "" }, { "docid": "c9b0e778d516b663627660e157ca364d", "score": "0.71184254", "text": "function ccount_total()\n{\n\tvar sum = 0;\n\n\tfor (var key in ccount) {\n\t\tif (ccount.hasOwnProperty(key) && key !== '') {\n\t\t\tsum += ccount[key]['c'];\n\t\t}\n\t}\n\n\tccount_write(sum);\n}", "title": "" }, { "docid": "0657efd9ddc8a6faf7a9baf7c6559d11", "score": "0.7118176", "text": "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n // Recorremos el array del carrito\n carrito.forEach((item) => {\n\n // De cada elemento obtenemos su precio\n\n let miItem = productos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(item);\n });\n total = total + miItem[0].precio;\n\n });\n ////actualizacion de cuotas dependiendo valor total\n cuotas6()\n // Renderizamos el precio en el HTML\n HTMLtotal.textContent = total.toFixed(2);\n HTMLtotal.setAttribute(\"style\", \"color:rgb(0, 150, 67)\")\n}", "title": "" }, { "docid": "ced720bc30bf6f54bc67552e74bf5e92", "score": "0.7117247", "text": "countTotal() {\n\t\tlet total = 0;\n\t\tconst myList = this.state.data;\n\t\tObject.keys(myList).forEach(function(key, index) {\n\t\t\ttotal = total + myList[key].count;\n\t\t});\n\t\treturn total;\n\t}", "title": "" }, { "docid": "571bac1f213c96a8d840d6b21b2525ab", "score": "0.71159285", "text": "function totalItems( quantity ) {\n totItems = ( totItems + quantity );\n }", "title": "" }, { "docid": "1c3460a2d65b28ba8581f32019ca584f", "score": "0.7113874", "text": "get totalQuantity() {\n return this.items.reduce((accumulator, current) => accumulator + current.quantity, 0);\n }", "title": "" }, { "docid": "3a43e001915b429ac20d934d0b7e80cc", "score": "0.71091855", "text": "function atualizaTotal(){\n var codigo;\n var itemCompra;\n var total = 0;\n for(codigo in lista){\n itemCompra = lista[codigo];\n total += itemCompra.subt;\n }\n $('#total').html('<b>Total($)</b>='+total);\n}", "title": "" }, { "docid": "8edd2558c2e97463cb85d16d566d3e6c", "score": "0.7103504", "text": "getTotalPrice(){\n let total = 0;\n this.items.forEach(item=>{\n total += item.price * item.qty;\n });\n\n return total;\n }", "title": "" }, { "docid": "7207c660e830ad6943a25680c97a594b", "score": "0.7102644", "text": "function countTotalPrice() {\n total = 0;\n for (let i = 0; i < items.length; i++) {\n total +=\n +items[i].count.innerHTML * +items[i].price.innerHTML.replace(\"$\", \"\");\n }\n total = Math.round((total + shippingPrice) * 100) / 100;\n\n totalPriceHtml.innerHTML = `\\$${total}`;\n}", "title": "" }, { "docid": "6b0b66990323e2d472963206cb8910e4", "score": "0.7102131", "text": "function getTotalAmount() {\n\tvar totalAmount = 0;\n\tvar subTotal;\n\tvar rowCollection;\n\n\trowCollection = Array.from(document.getElementsByClassName('table-Row')) // array of order item table rows\n\n\tfor (var i = 0; i < rowCollection.length; i++) {\n\t\t//subTotal = Number(rowCollection[i].children[4].innerHTML)\n\t\tsubTotal = parseFloat(rowCollection[i].children[5].textContent)\n\t\tconsole.log(subTotal)\n\t\ttotalAmount = totalAmount + subTotal;\n\t}\n\n\tdocument.getElementById('grandTotal').textContent = totalAmount;\n}", "title": "" }, { "docid": "0dea8ba05e2b8340b31f19305cedd963", "score": "0.71014667", "text": "function getTotal(){\n var mytotal = total.innerHTML;\n mytotal = mytotal.substr(1);\n return Number(mytotal)*100;\n }", "title": "" }, { "docid": "8c2d3d138297f8f82953c31c67e630de", "score": "0.709698", "text": "get total() {\n for (i=0; i<this.arr.length; i++) {\n sum += this.arr[i]; \n }\n return sum;\n }", "title": "" }, { "docid": "6fb523e38deb282559ed737721f8f654", "score": "0.7096336", "text": "totalPrice(){\n var total = 0;\n for(var i = 0; i<this.state.dataCart.length; i++){\n total+= this.state.dataCart[i].totalPrice\n }\n return total;\n }", "title": "" }, { "docid": "9ca5129d0933ecd87b9e8ee0351e9d8c", "score": "0.7087269", "text": "function calcTotalErnte(){\n\t\ttotalErnte=new Object();\n\t\tfor(var zF=0;zF<zoneErnte.length;zF++){\n\t\t\tfor(var k in zoneErnte[zF]){\n\t\t\t\tif(!zoneErnte[zF].hasOwnProperty(k)){ continue; }\n\t\t\t\tif (!totalErnte[k]){ totalErnte[k]=0; }\n\t\t\t\ttotalErnte[k] += zoneErnte[zF][k][0];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "8c99da6542689e951c8dbcc48d76b2ec", "score": "0.70868886", "text": "function total() {\n // write your code here\n let totalPrice = 0\n for (var i = 0; i < cart.length; i++){\n for (var item in cart[i]){\n totalPrice += cart[i][item]\n }\n }\n return totalPrice\n}", "title": "" }, { "docid": "63403fa1e373c30da40de12a41020dd2", "score": "0.7085495", "text": "function calculaTotal(){\n\t\tvar totales = 0;\n\t\t$('table#Body_detallePedidosProductos tr').each(function(index) {\n\t\t\t\tvar subtotal = $(this).children().filter(\"[id^=detallePedidosProductos_16_]\").attr(\"valor\");\n\t\t\t\tsubtotal = subtotal == \"\" ? subtotal = 0 : subtotal ;\n\t\t\t\ttotales += parseFloat(subtotal);\n\t\t\t\t});\n\t\t\n\t\t$(\"#total\").val(formatear_pesos(totales));\n\t\t$(\"#subtotal\").val(formatear_pesos(totales));\n\t\t//calculaTotalPedidos();\n\t\t\n\t\t}", "title": "" }, { "docid": "a84d049081020a2f6006385fe2696922", "score": "0.7080872", "text": "function computeTotalQuantity() {\n let total = 0;\n for (let item of findAllItems()) {\n total += item.quantity;\n }\n return total;\n}", "title": "" }, { "docid": "d572cc0fa5e2db66bbb1ad2b161b49d9", "score": "0.7080867", "text": "get totalDeItens() {\n let quantidade = 0;\n\n for (const item of this.itens) {\n quantidade += item.quantidade\n }\n\n return quantidade;\n }", "title": "" }, { "docid": "1843d96a759b80bd6f7d2fa34610f108", "score": "0.70715743", "text": "function setTotal(){\n total = 0;\n for(let fooditem of foodAdded){\n total += +$(`.${fooditem}`).find('.order-total').text().slice(1);\n }\n $('.cart-total').text(`$${total}`);\n $('#strID').data('amount', `${total}`)\n }", "title": "" }, { "docid": "f139bbbc0a39da95d81df9738c4b6f27", "score": "0.7061696", "text": "function _calculateTotal(action, totalsName) {\n var sum = 0;\n\n // _budetData.allItems[action].forEach(function (cur) {\n // sum += cur.value;\n // });\n sum = _budetData.allItems[action].reduce(function (acc, cur) {\n return acc + cur.value;\n }, 0);\n\n _budetData.totals[totalsName] = sum;\n }", "title": "" }, { "docid": "9b02e1b229b873c8fafc04fc7a7e7161", "score": "0.7060777", "text": "function getTotal(product){\n return product.count > 0 ? product.count * product.price : 0;\n}", "title": "" }, { "docid": "f42045f826b59cd101da5f3f885d5532", "score": "0.7060721", "text": "async getTotal() {\n return await this.total.textContent;\n }", "title": "" }, { "docid": "90b0a32f85abf28f3f96ac7a39291d1c", "score": "0.7059145", "text": "function total (){\n\n document.getElementById('total').innerHTML = \"Total Monthly Payments: $\" + loans.reduce(function totalObjects(total, num){\n \n return total + parseInt(num.monthlyPayment);\n }, intitialValue) \n \n}", "title": "" }, { "docid": "51f1209ce1bf1e5e43320f7cfb94ee6b", "score": "0.7052439", "text": "function invoiceSubTotal() {\n var total = 0.00;\n angular.forEach($scope.invoice.items, function(item, key) {\n total += (item.qty * item.cost);\n });\n return total;\n }", "title": "" }, { "docid": "ae1582d79c10c11a30c58e7679b4a200", "score": "0.7049383", "text": "function calculateTotal() {\n var totalamount = 0;\n for (var beer in regular.shoppinglist) {\n if (regular.shoppinglist.hasOwnProperty(beer)) {\n numberofbeers = regular.shoppinglist[beer];\n totalamount = totalamount + regular.allbeers[beer].price*numberofbeers; // Add the price to the total\n }\n }\n console.log(\"total is now: \" + totalamount);\n return totalamount;\n}", "title": "" }, { "docid": "bb4f3548516cd87f99969c9cf4284929", "score": "0.7042669", "text": "function getTotalAmount() {\n let totalAmount = 0;\n\n cartItems.forEach((productItem) => {\n totalAmount += productItem.price;\n });\n\n return totalAmount;\n}", "title": "" } ]
46dd70cf00870d72d17eb07e29ed689b
End of Table creation
[ { "docid": "e2d1c72767b28792f136a78b89784472", "score": "0.0", "text": "function createTr(count, tdBox) {\r\n let arr = [];\r\n let i = 0;\r\n for (i; i < count; i += 1) {\r\n arr.push(tdBox(i).addClass(`tabl_row_${ i }`));\r\n }\r\n return arr;\r\n}", "title": "" } ]
[ { "docid": "5fab3a1feedfa994a6a125e5d0ea1b59", "score": "0.7243592", "text": "function endTable()\n\n{ if(_rowStarted)\n\n { _outputBuffer += '</tr>';\n\n _rowStarted = false;\n\n }\n\n _outputBuffer += '</table>';\n\n}", "title": "" }, { "docid": "ceb7fb06df98a5b18ae829ff1ab52995", "score": "0.6972239", "text": "function finalize(){\n tableCounter++;\n if (tableCounter === closeCounter){\n //Print Results\n printResults(tableDeviations);\n //Close DB connection\n db.close();\n console.log('Database connection closed');\n }\n}", "title": "" }, { "docid": "83a2746971a0cb1233d063028f5da383", "score": "0.6717552", "text": "function EndTable() {\n\tif (arguments.length != 0) {\n\t\terror('Error 090: EndTable(); must have empty parentheses.');\n\t}\n\telse if (EDITOR_OBJECT == null) {\n\t\terror(\t'Error 091: EndTable(); must come after a call to ' +\n\t\t\t\t'StartNewTable(width);');\n\t}\n\telse if ( !(EDITOR_OBJECT instanceof table) ) {\n\t\terror(\t'Error 092: EndTable(); must come after a call to ' +\n\t\t\t\t'StartNewTable(width);');\n\t}\n\telse if (!ERROR_FOUND) {\n\t\tvar current_table = EDITOR_OBJECT;\n\t\tvar table_html = '';\n\n\t\ttable_html += \t'<table class=\"' + current_table.class + '\">' + \n\t\t\t\t\t\t'<tr class=\"' + current_table.class + '\">';\n\t\ttable_index = 0;\n\t\tfor (j = 0; j < current_table.content.length; j++) {\n\t\t\tif (table_index == current_table.max_width) {\n\t\t\t\t// create a new row if we reach the max width\n\t\t\t\ttable_html += '</tr><tr class=\"' + current_table.class + '\">';\n\t\t\t\ttable_index = 0;\n\t\t\t}\n\t\t\tvar item = current_table.content[j];\n\t\t\tif ((item instanceof text) || (item instanceof text_block)) {\n\t\t\t\tif ( (table_index + item.span) > current_table.max_width ) {\n\t\t\t\t\t// create a new row if we reach the max width\n\t\t\t\t\ttable_html += '</tr><tr class=\"' + current_table.class + '\">';\n\t\t\t\t\ttable_index = 0;\n\t\t\t\t}\n\t\t\t\ttable_html += \t'<td colspan=\"' +\n\t\t\t\t\t\t\t\titem.span +\n\t\t\t\t\t\t\t\t'\" class=\"' + current_table.class + '\">' +\n\t\t\t\t\t\t\t\titem.html +\n\t\t\t\t\t\t\t\t'</td>';\n\t\t\t\ttable_index += item.span;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttable_html += \t'<td class=\"' + current_table.class + '\">';\n\t\t\t\ttable_html += \titem.html;\n\t\t\t\ttable_html += \t'</td>';\n\t\t\t\ttable_index += 1;\n\t\t\t}\n\t\t}\n\t\ttable_html += '</tr></table>';\n\n\t\tcurrent_table.html = table_html;\n\t\tEDITOR_OBJECT = EDITOR_STACK.pop();\n\t}\n}", "title": "" }, { "docid": "1f9aff6df7f81d9b134c2d81952c1824", "score": "0.62698615", "text": "function createTableFooter() {\n var footerRow = document.createElement('tr');\n addElement(footerRow, 'th', 'Total Hourly Sales');\n for (var time = firstHourOfBusiness; time <= lastHourOfBusiness; time++) {\n footerSums[time] = addElement(footerRow, 'td', '');\n }\n updateFooter();\n tFoot.appendChild(footerRow);\n}", "title": "" }, { "docid": "0a0cbba203fb1d3700acb588ac256226", "score": "0.62568575", "text": "function tableProcessComplete() {\n\n numTablesProcessed++;\n if (numTablesProcessed === numTablesToProcess) {\n sqlConn.closeAll();\n logger.log(\"info\", \"process completed!\");\n }\n}", "title": "" }, { "docid": "41dc2cbf8e861655beafebb5871aaaab", "score": "0.61747646", "text": "function limpiarTablaHorario() {\n tableTres.clear().draw();\n}", "title": "" }, { "docid": "d2d67baa981a4daf9dcb27879fb20ab3", "score": "0.6161152", "text": "function createNewTable(){\n for (var i = 0; i < headers.length; i++) {\n topRefugeesTable.addColumn(headers[i]);\n }\n for (var i = 0; i < refugeeTable.getRowCount(); i++) {\n var totalRefugees = refugeeTable.getNum(i, 'Total');\n if (totalRefugees >= 100000) {\n var newRow = topRefugeesTable.addRow()\n for (var j = 0; j < headers.length; j++) {\n newRow.setString(headers[j], refugeeTable.getString(i, headers[j]));\n }\n }\n }\n print('New top refugee table created...');\n print(topRefugeesTable);\n}", "title": "" }, { "docid": "703c263be036d58e8140223e7e5f8ab0", "score": "0.6136193", "text": "function destroy() {\n Y.log( 'Destroying table element: ' + element.getDomId(), 'debug', NAME );\n }", "title": "" }, { "docid": "fd304bb336cf392155ca070243469437", "score": "0.6073195", "text": "clean () {\n this.table.clear()\n }", "title": "" }, { "docid": "7e12760d1a69b6ab2c9353092371df0d", "score": "0.60469216", "text": "function generateTable() {\n emptyTable();\n generateRows();\n generateHead();\n generateColumns();\n borderWidth();\n}", "title": "" }, { "docid": "3b6d13e6350afb21e5735525b0604468", "score": "0.59868884", "text": "function dropTable() {\n\n db.transaction(function (tx) { tx.executeSql(dropStatement, [], showEntry, onError); });\n\n resetForm();\n\n initDatabase();\n\n}", "title": "" }, { "docid": "e784d07200e695a786a59a2ee7ffa79a", "score": "0.598048", "text": "function done(){\n var table = document.getElementById('salvo-table');\n table.innerHTML=\"\";\n var tableContent = createTableContent(app.games);\n table.innerHTML = tableContent;\n}", "title": "" }, { "docid": "0aa10bebbe08117f21b39a45c9747710", "score": "0.5952492", "text": "function tableFooter() {\n const footEl=document.createElement('tfoot');\n\n //const parentEl=document.getElementById('table');\n tableEl.setAttribute('id','tf');\n tableEl.appendChild(footEl);\n\n const tableTrFootEl=document.createElement('tr');\n footEl.appendChild(tableTrFootEl);\n\n const tableHeaderFootEl =document.createElement('th');\n tableHeaderFootEl.textContent='Totaly Hours'\n tableTrFootEl.appendChild(tableHeaderFootEl);\n\n for(var i=0;i<operationHours.length;i++){\n\n const tableTdFootEl=document.createElement('td');\n tableTdFootEl.textContent= allStoresPursPerHour[i];\n tableTrFootEl.appendChild(tableTdFootEl);\n }\nconst totalsFootEl=document.createElement('td');\ntotalsFootEl.textContent = totalByFinalDay;\ntableTrFootEl.appendChild(totalsFootEl);\n\n\n\n}", "title": "" }, { "docid": "2ffa6af0ceecd21af7044e872b133b65", "score": "0.595085", "text": "function MakeAgainTable() {\n // We Must have to delete the total of row last from count array\n TableElement.removeChild(TableElement.childNodes[Count]);\n //TableElement.deleteRow(-1);\n // creat new city and added\n let row_2 = document.createElement('tr')\n TableElement.appendChild(row_2)\n\n let th_1 = document.createElement('th')\n th_1.textContent = 'Total OF C/H'\n row_2.appendChild(th_1)\n\n\n // calcualate the total after added the city\n for (let i = 0; i < hours.length; i++) {\n\n let td_1 = document.createElement('td');\n td_1.textContent = Row[i];\n row_2.appendChild(td_1);\n }\n}", "title": "" }, { "docid": "2d5940ba9e3a53982ab668ab695e546a", "score": "0.59141433", "text": "function clearTable() {\n var table = document.getElementById('outputTable')\n var rowCount =table.rows.length\n for (var i = rowCount - 1; i > 0; i--) {\n table.deleteRow(i);\n }\n table.deleteTHead()\n table.createTHead().setAttribute(\"id\", \"outputTableHeader\")\n }", "title": "" }, { "docid": "9ae54026a4b4a27e8a3d3131a976822e", "score": "0.59030384", "text": "function TableExport() { }", "title": "" }, { "docid": "6f0cbb5ff8142d7bbf78fd5e7c934c3e", "score": "0.5882255", "text": "function newRow()\n\n{ _outputBuffer += '</tr>';\n\n _rowStarted = false;\n\n}", "title": "" }, { "docid": "3aab936d53c2193be123e17b7b5fcacd", "score": "0.5869295", "text": "function setupTable(tx) {\n //tx.executeSql('DROP TABLE IF EXISTS WRITINGTIME');\n //tx.executeSql('DROP TABLE IF EXISTS NEWS');\n //tx.executeSql('DROP TABLE IF EXISTS SERVICES');\n //tx.executeSql('DROP TABLE IF EXISTS BANNERS');\n tx.executeSql('CREATE TABLE IF NOT EXISTS WRITINGTIME (name, created)');\n tx.executeSql('insert into WRITINGTIME (name, created) values(\"newsWritingTime\", 0)');\n tx.executeSql('insert into WRITINGTIME (name, created) values(\"servicesWritingTime\", 0)');\n tx.executeSql('insert into WRITINGTIME (name, created) values(\"bannersWritingTime\", 0)');\n tx.executeSql('insert into WRITINGTIME (name, created) values(\"locatorWritingTime\", 0)');\n\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS NEWS (id INTEGER, header, small_content, content, image, created INTEGER)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS BANNERS (id INTEGER, header, small_content, content, image, created INTEGER)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS SERVICES (id INTEGER, header, small_content, content, image, created INTEGER, on_main INTEGER)\");\n\n tx.executeSql(\"select * from WRITINGTIME\", [], function (tx, data) {\n var len = data.rows.length;\n if (len > 0 && len < 5) {\n for (var i = 0; i < len; i++) {\n eval(data.rows.item(i).name + ' = ' + data.rows.item(i).created);\n window[data.rows.item(i).name] = data.rows.item(i).created;\n //alert('wt = ' + data.rows.item(i).name);\n }\n }\n }, dbErrorHandler);\n\n}", "title": "" }, { "docid": "888caa0ff9dc039c8582d2d809bb46ad", "score": "0.58315945", "text": "function deleteTable() {\n d3.select(\"tbody\")\n .selectAll(\"tr\").remove()\n .selectAll(\"td\").remove();\n }", "title": "" }, { "docid": "9ce5598695a2a10204553fdeb06d4112", "score": "0.5829252", "text": "static async createDeletedTable() {\n try {\n await this.create(tableSchema.deletedPropertyKey, `${tableName.DELETED}`);\n await debug('Deleted Properties table created');\n } catch (err) {\n // debug(err);\n }\n }", "title": "" }, { "docid": "5aa42d4db7e16eb43fec17edf38971b5", "score": "0.5820713", "text": "function emptytheTable (){\n // Morgen\n var tablemorgen = document.getElementById(\"tablemorgendata\");\n var rowCount = tablemorgen.rows.length;\n for (i = rowCount-1; i >= 1; i--) {\n tablemorgen.deleteRow(i);\n console.log(\"Deleted Row:\" + i);\n }\n // Mittag\n var tablemittag = document.getElementById(\"tablemittagdata\");\n var rowCount = tablemittag.rows.length;\n for (i = rowCount-1; i >= 1; i--) {\n tablemittag.deleteRow(i);\n console.log(\"Deleted Row:\" + i);\n }\n // Abend\n var tableabend = document.getElementById(\"tableabenddata\");\n var rowCount = tableabend.rows.length;\n for (i = rowCount-1; i >= 1; i--) {\n tableabend.deleteRow(i);\n console.log(\"Deleted Row:\" + i);\n }\n // Nacht\n var tablenacht = document.getElementById(\"tablenachtdata\");\n var rowCount = tablenacht.rows.length;\n for (i = rowCount-1; i >= 1; i--) {\n tablenacht.deleteRow(i);\n console.log(\"Deleted Row:\" + i);\n }\n}", "title": "" }, { "docid": "fac0b2d3a7df0bbe0f51beaedd44eee7", "score": "0.5816191", "text": "function endCategory() {\n\treturn '</tbody></table></div>';\n}", "title": "" }, { "docid": "19711c707516d386cfa3a5f5d387879b", "score": "0.581211", "text": "function handlePostAddRow(table) {\r\n\r\n}", "title": "" }, { "docid": "8d157bc02c9c7da40ceafb5ac1a08b21", "score": "0.5806079", "text": "function buildTable(data) {\n // First, clear out any existing data\n tbody.html(\"\");\n}", "title": "" }, { "docid": "e958d1fc2fe80d93660efbce76a1884b", "score": "0.57890886", "text": "function initialize(){\n newTable();\n}", "title": "" }, { "docid": "1227b6dbdf2320a90187dda18b89f0e5", "score": "0.5763117", "text": "function init() {\n // createtable funcion\n createTable();\n}", "title": "" }, { "docid": "ecb873a677a24bef65457011700c7ea4", "score": "0.5759687", "text": "function CreateWindowFooter ()\n {\n\t\ttext += \" </table>\\n\";\n\t\ttext += \" </form>\\n\";\n\t\ttext += \" </body>\\n\";\n\t\ttext += \"</html>\\n\";\n }", "title": "" }, { "docid": "41ae2098f89ad410605851be1a21fe0f", "score": "0.5757886", "text": "function footer() {\n var salesTable = document.getElementById('tabl');\n var trE1 = document.createElement('tr');\n var tdE1 = document.createElement('td');\n tdE1.textContent = 'Total';\n trE1.appendChild(tdE1);\n\n calculateEachHrLoc(trE1);\n salesTable.appendChild(trE1);\n\n}", "title": "" }, { "docid": "7c5b6e397009e8afc6843ee5b67a8397", "score": "0.5744734", "text": "function CleanStopTable(){\n var table = document.getElementById('tblEstaciones');\n for(var i = table.rows.length - 1; i > 0; i--)\n {\n table.deleteRow(i);\n }\n}", "title": "" }, { "docid": "69d46cd5a34c3493343c577d1ad6f4b1", "score": "0.57302713", "text": "function desenhaTabela(siglaDoSistema,nomeSistema ,nomeRealSistema,versao)\r\r\r\n{\r\r\r\n linha = \"<BR><BR>\"; \r\r\r\n desenhaInicioTabela(siglaDoSistema, nomeSistema, nomeRealSistema, altura, largura);\r\r\r\n document.writeln(linha);\r\r\r\n desenhaFinalTabela(siglaDoSistema, nomeSistema, nomeRealSistema, altura, largura,versao);\r\r\r\n}", "title": "" }, { "docid": "7752ad9da3836c7b4d787c35d5909cc5", "score": "0.57045114", "text": "function LimparTabela() {\n table.rows(\"[role=row]\").remove().draw(false);\n }", "title": "" }, { "docid": "2e3900c94dbdc690c88b4fbb1c10baf7", "score": "0.57006335", "text": "function tableStart() {\n document.write(\"<table>\");\n}", "title": "" }, { "docid": "311bd59024b3780cf749ec5734ef286d", "score": "0.56964236", "text": "destroy(){\n let tf = this.tf;\n let tbl = tf.tbl;\n\n if(!this.initialized){\n return;\n }\n let t = Dom.remove(tbl);\n this.tblMainCont.parentNode.insertBefore(t, this.tblMainCont);\n Dom.remove(this.tblMainCont);\n\n this.tblMainCont = null;\n this.headTblCont = null;\n this.headTbl = null;\n this.tblCont = null;\n\n tbl.outerHTML = this.sourceTblHtml;\n //needed to keep reference of table element for future usage\n this.tf.tbl = Dom.id(tf.id);\n\n this.initialized = false;\n }", "title": "" }, { "docid": "37fa2bd0c8f786e0b443c79e73471b48", "score": "0.569323", "text": "function clearTable(){\n tableContents.html(\"<tr></tr>\")\n}", "title": "" }, { "docid": "7d42dd9dd1ff0773fb167cddeb523275", "score": "0.568975", "text": "function next(){\n count--\n if(count < 1){\n table.appendRows(tableData);\n doneCallback();\n };\n }", "title": "" }, { "docid": "840ade5195bfa390a86910c3c583ddd4", "score": "0.56833684", "text": "function build() {\n makeTable();\n}", "title": "" }, { "docid": "da00a29b74dddeaa01f2b59d8a7dc8f0", "score": "0.5670759", "text": "async function finishTable(id) {\n setTablesError(null);\n const abortController = new AbortController();\n\n // Window confirmation dialogue\n if (\n !window.confirm(\n \"Is this table ready to seat new guests?\\nThis cannot be undone.\"\n )\n )\n return () => abortController.abort();\n\n // After confirmation, finishReservation then loadDashboard again\n try {\n await finishReservation(id, abortController.signal);\n loadDashboard();\n } catch (error) {\n setTablesError(error);\n }\n return () => abortController.abort();\n }", "title": "" }, { "docid": "5d7f997fc20ef05899f0ce6255751d3f", "score": "0.5666776", "text": "function destroyTable() {\n if ($.fn.DataTable.isDataTable('#ordersGrid')) {\n $('#ordersGrid').DataTable().destroy();\n $('#ordersGrid').empty();\n }\n }", "title": "" }, { "docid": "0136884a31f5d4cef385c219650d5877", "score": "0.5664877", "text": "function clearTable() {\n for (var i = 1; i < leaderboardTable.rows.length;) {\n leaderboardTable.deleteRow(i);\n }\n}", "title": "" }, { "docid": "7270a6e24d51020a1fbcf04e33e83026", "score": "0.56627464", "text": "function structureNewTable(tableData){\r\n\tvar tbodyPointer = findTBodyPointer();\r\n\tfor(var i = 0; i < tableData.length; i++){\r\n\t\t// create row element\r\n\t\tvar newRow = tbodyPointer.insertRow(i+1);\r\n\t\tfor (var j = 0; j < tableData[i].length; j++) {\r\n\t\t\tvar newCell = newRow.insertCell(j);\r\n\t\t\tnewCell.appendChild(document.createTextNode(tableData[i][j]));\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "5ae449c5e0adcb22021db06f00f54264", "score": "0.5659834", "text": "function tableFooterSetup(){\n\n var tblFooter = document.getElementById('salesTableTotal');\n var tblRow = document.createElement('tr');\n tblFooter.appendChild(tblRow);\n\n var rowHeader = document.createElement('th'); \n rowHeader.textContent = 'Totals:';\n rowHeader.id = 'totalsRow';\n tblRow.appendChild(rowHeader);\n var col = 1;\n \n for(var i = 0; i < locationTotals.length; i++){\n var cell = tblRow.insertCell(col);\n cell.textContent = locationTotals[i];\n col++;\n };\n\n cell = tblRow.insertCell(col);\n cell.id = \"grandTotal\";\n cell.textContent = grandTotal;\n}", "title": "" }, { "docid": "32f2dd964e09ee1f835e090150a740e3", "score": "0.5644101", "text": "function dropTable(){\n \n db.transaction(function(tx) {\n \n tx.executeSql(\"DROP table employee\");\n tx.executeSql(\"DROP table empbackup\");\n });\n \n alert(\"table dropped 1\");\n \n db.transaction(function(tx) {\n \n \n tx.executeSql(\"DROP table empbackup\");\n });\n \n \n \n \n alert(\"Table Dropped\");\n showData();\n \n }", "title": "" }, { "docid": "b18b7971f2b97e2ae39c0b30a0bfa826", "score": "0.56319237", "text": "function finalCompiler() {\r\n cookiesTable.deleteTFoot();\r\n var newFoot = document.createElement('tfoot');\r\n cookiesTable.appendChild(newFoot);\r\n var footRow = document.createElement('tr');\r\n newFoot.appendChild(footRow);\r\n var footTotalTitle = document.createElement('th');\r\n footTotalTitle.textContent = 'Total';\r\n footRow.appendChild(footTotalTitle);\r\n var calcGrandTotal = 0;\r\n for (var r = 0; r < 15; r++){\r\n var dailySum = 0;\r\n for (var j = 0; j < SalmonCookies.allLocs.length; j++) {\r\n dailySum += SalmonCookies.allLocs[j].totalPerHour[r];\r\n }\r\n var hourlyTotal = document.createElement('td');\r\n hourlyTotal.textContent = dailySum;\r\n footRow.appendChild(hourlyTotal);\r\n calcGrandTotal += dailySum;\r\n }\r\n var grandTotal = document.createElement('td');\r\n grandTotal.textContent = `Grand Total: ${calcGrandTotal}`;\r\n footRow.appendChild(grandTotal);\r\n}", "title": "" }, { "docid": "bde1fb70c3f01b514e1425779b34734d", "score": "0.56318223", "text": "closeTableRow () {\n const row = this._popStackItem();\n row.next.rows.push(row.cells);\n }", "title": "" }, { "docid": "bde1fb70c3f01b514e1425779b34734d", "score": "0.56318223", "text": "closeTableRow () {\n const row = this._popStackItem();\n row.next.rows.push(row.cells);\n }", "title": "" }, { "docid": "c3049d3515cae198f0797db9d147bee3", "score": "0.56290436", "text": "function createTable() {\n var main = $('#region-main');\n var table = $('<table></table>');\n table.attr('id', 'local-barcode-table');\n table.addClass('generaltable');\n table.addClass('local-barcode-table');\n\n var thead = table.append('<thead></thead>');\n var header = thead.append('<tr></tr>');\n header.html('<th colspan=\"8\" class=\"local-barcode-th-left local-barcode-sm-hide\">' + strings[1] +\n ' - (<span id=\"local_barcode_id_count\">' +\n '0</span> ' + strings[6] + ')</th>' +\n '<th colspan=\"17\" class=\"local-barcode-th-center\">' + strings[0] + '</th>' +\n '<th colspan=\"5\" class=\"local-barcode-th-right\">' + strings[8] +\n '(<span id=\"local_barcode_id_submit_count\">0</span>)</th>');\n table.append('<tbody id=\"tbody\"></tbody>');\n\n main.append(table);\n }", "title": "" }, { "docid": "755d4f63bcd377b9470a2bcf4a9227b6", "score": "0.5616396", "text": "function beforeQuit() {\n getSharedvar().invoke.debug('app is ready to quit')\n let writeData = loadDataOjectFromTable()\n get_module('index/table').write(JSON.stringify(writeData))\n}", "title": "" }, { "docid": "429e8222ad5176a71fdddd4579b9af51", "score": "0.5613141", "text": "function emptyTables(){\n db.transaction(\n function(tx) {\n try{\n tx.executeSql(\"DELETE FROM \"+optionsTable);\n tx.executeSql(\"DELETE FROM \"+sessionsTable);\n tx.executeSql(\"VACUUM;\");\n }catch(err){\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "4f096638c3d631e22f714d0db6f374a1", "score": "0.5609623", "text": "function createTableFooter() {\n\n // Create the Row\n var trElement = document.createElement('tr');\n // append to table\n myTable.appendChild(trElement);\n\n //Add a TD with 'Totals'\n var thElement = document.createElement('th');\n trElement.appendChild(thElement);\n thElement.textContent = ('Totals');\n\n // getting through each store and add up each hourly total\n // hit each store that exists\n // as we hit each store, we need to loop through he hours, and sum each hour\n var grandTotal = 0;\n loop1: for (var i = 0; i < hours.length; i++) {\n\n // Define a value to sum\n var hourlySum = 0;\n\n // create our new Table Data cell \n var tdElement = document.createElement('td');\n trElement.appendChild(tdElement);\n\n // loop through each store\n loop2: for (var j = 0; j < stores.length; j++) {\n\n // grab values from a store, at an hour (6am / 7am ....)\n hourlySum += stores[j].cookiesEachHour[i];\n grandTotal += stores[j].cookiesEachHour[i];\n\n }\n\n // when loop2 is finished, we can add our content\n tdElement.textContent = hourlySum;\n }\n\n // create add content, append\n tdElement = document.createElement('td');\n trElement.appendChild(tdElement);\n tdElement.textContent = grandTotal;\n}", "title": "" }, { "docid": "4551b7e98759afffa2b594e4f80dbd80", "score": "0.5605062", "text": "function createTables(db) {\n/* To wipe out the table (if you are still experimenting with schemas,\n for example), enable this block. */\n/*\n\tif (0) {\n db.transaction(\n function (transaction) {\n transaction.executeSql('DROP TABLE portion;');\n transaction.executeSql('DROP TABLE plate;');\n transaction.executeSql('DROP TABLE slate;');\n transaction.executeSql('DROP TABLE food;');\n }\n );\n}\n\ndb.transaction(\n function (transaction) {\n\n\t\t\ttransaction.executeSql(\n\t\t\t'CREATE TABLE IF NOT EXISTS portion ' +\n\t\t\t' (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n\t\t\t' type varchar(16), name varchar(32), description varchar(100), master integer, isInactive integer );'\n\t\t\t);\n\n\t\t\ttransaction.executeSql(\n\t\t\t\t\t'CREATE TABLE IF NOT EXISTS plate ' +\n\t\t\t\t\t' (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n\t\t\t\t\t' type varchar(16), name varchar(32), description varchar(100), master integer, portion1 integer, portion2 integer, portion3 integer, portion4 integer, portion5 integer, portion6 integer, portion7 integer, portion8 integer, portion9 integer, isInactive integer );'\n\t\t\t\t\t);\n\n\t\t\ttransaction.executeSql(\n\t\t\t\t\t'CREATE TABLE IF NOT EXISTS slate ' +\n\t\t\t\t\t' (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n\t\t\t\t\t' date varchar(16), name varchar(32), description varchar(100), breakfast integer, lunch integer, dinner integer, isInactive integer );'\n\t\t\t\t\t);\n\n\t\t\ttransaction.executeSql(\n\t\t\t\t\t'CREATE TABLE IF NOT EXISTS food ' +\n\t\t\t\t\t' (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' +\n\t\t\t\t\t' slate integer, type varchar(16), portion integer, master integer, isInactive integer);'\n\t\t\t\t\t);\n\n } // end function(transaction)\n); // end datab.transaction\n*/\n}", "title": "" }, { "docid": "37c6ad9e5961576e0b6d8a4319e12590", "score": "0.56027704", "text": "function footer() {\n let row_2 = document.createElement('tr')\n TableElement.appendChild(row_2)\n // Add New TH in the table (The Total)\n let th_1 = document.createElement('th')\n th_1.textContent = 'total C/ber H'\n row_2.appendChild(th_1)\n// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n// The Total Of each Row in the table\n for (let i = 0; i < hours.length; i++) {\n\n let td_1 = document.createElement('td');\n td_1.textContent = Row[i];\n row_2.appendChild(td_1);\n //console.log(td_1);\n }\n}", "title": "" }, { "docid": "0113744f20d41e393d42b04a7ae68534", "score": "0.559868", "text": "function afterConnection() {\n connection.query(\"SELECT * FROM products\", function(err, rows) {\n if (err) throw err;\n // CLI table starts here\n let table = new Table({\n head: [\"Item ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10, 45, 20, 10, 10]\n });\n // Loops through rows that are being passed thru from querying SQL\n for (let i = 0; i < rows.length; i++) {\n table.push([\n rows[i].item_id,\n rows[i].product_name,\n rows[i].department_name,\n rows[i].price,\n rows[i].stock_quantity\n ]);\n }\n console.log(table.toString());\n start();\n });\n}", "title": "" }, { "docid": "a39510bd39ae20f38c9ea70179da2d89", "score": "0.55947995", "text": "generateParseTable() {\n this.writeData(\n 'TABLE',\n this._buildJuliaTable(this.generateParseTableData()),\n );\n }", "title": "" }, { "docid": "70cb4fd0a9e38ac4d4c878103ed1ea8f", "score": "0.5589014", "text": "createTable() {\r\n console.log(this.dataProperties.CreateTableQuery());\r\n fetch(this.dataProperties.DatabaseUrl, {\r\n method: 'POST',\r\n headers: header,\r\n body: createFetchBody(this.dataProperties.CreateTableQuery),\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n // console.log(data);\r\n console.log('finished table create query.');\r\n });\r\n }", "title": "" }, { "docid": "f6d80b7df62cd84ee4b53f6377bb29c1", "score": "0.5587192", "text": "function footerMaker(){\n var targetOldFoot = document.getElementById('table-footer');\n targetOldFoot.parentNode.removeChild(targetOldFoot);\n var tableFoot = document.createElement('tfoot');\n table.appendChild(tableFoot);\n var footRow = document.createElement('tr');\n footRow.setAttribute(\"id\", \"Totals\"); \n\n footRow.textContent = \"Totals\"\n tableFoot.appendChild(footRow);\n var hourlyTotals = 0;\n for (var i =0; i < hrsOfOp.length; i++){\n hourlyTotals = 0;\n for(var j =0; j < standArray.length; j++){\n var grabNum = standArray[j].array;\n hourlyTotals += grabNum[i];\n }\n var footCell = document.createElement('td');\n footCell.textContent = hourlyTotals;\n footRow.appendChild(footCell);\n }\n}", "title": "" }, { "docid": "c98cd8dae7de086a1fb30a013554d8d5", "score": "0.55856884", "text": "function clearTable() {\n client.query('DELETE FROM meals').then(console.log('Cleared Tables'))\n .catch(console.error);\n}", "title": "" }, { "docid": "4d03a4042055f0d0d4fe1ecbf22f7ef1", "score": "0.5573803", "text": "function clearTable(table) {\n table.empty();\n}", "title": "" }, { "docid": "0fbf1da6048014fee382cff83dbc08ae", "score": "0.5567433", "text": "createTable() {\n\t\tBirthday.dynamodb.createTable(Birthday.schema, (err) => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error('Unable to create table. Error JSON:', JSON.stringify(err, null, 2));\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "99e65a0a6501c9c59875ad2aa5d06491", "score": "0.55637527", "text": "createEventTable() {\r\n const sql = `\r\n CREATE TABLE IF NOT EXISTS event (\r\n Eventid integer PRIMARY KEY,\r\n name text,\r\n category text,\r\n type text,\r\n RSO_name text,\r\n description text,\r\n date integer,\r\n time integer,\r\n address text,\r\n admin_approved integer,\r\n contact_email integer,\r\n contact_phone integer)`\r\n return this.DB.run(sql)\r\n }", "title": "" }, { "docid": "867c1d1ddbfbaa7c8d7ddb6a826d4000", "score": "0.55564284", "text": "function cleanupUFOTable(){\n var ufoTable = document.getElementById('ufo-table');\n var tableRows = ufoTable.getElementsByTagName('tr');\n var rowCount = tableRows.length;\n \n for (var x=rowCount-1; x>0; x--) {\n ufoTable.deleteRow(x);\n }\n }", "title": "" }, { "docid": "7b945e305fb0b546a24f16077ea3bbfb", "score": "0.5553783", "text": "_removeRows() {\n while(this.table.rows.length > 1) this.table.deleteRow(1);\n }", "title": "" }, { "docid": "7524006b22f5eef74b237ac1ce8e1791", "score": "0.5541356", "text": "function createTable(tx)\n{\n tx.executeSql('CREATE TABLE IF NOT EXISTS day(date Date PRIMARY KEY, mood INT, physicalActivity INT, notes TEXT)')\n}", "title": "" }, { "docid": "34416b075c04a86c512ba277d532573d", "score": "0.5539901", "text": "function create_table(){\n savedDevices()\n connectedDevices()\n project()\n apk()\n}", "title": "" }, { "docid": "c84cc1983307363d154141006bc9777c", "score": "0.55297726", "text": "function createRelationTable() {\n\tvar token = getClientStore().token;\n\tsessionStorage.token = token;\n\ttotalRecordsize = retrieveRelationRecordCount();\n\tif (totalRecordsize == 0) {\n\t\tobjCommon.displayEmptyMessageInGrid(getUiProps().MSG0233, \"Relation\");\n\t\tobjCommon.disableButton('#btnDeleteRelation');\n\t\t$('#chkSelectall').attr('checked', false);\n\t\t$(\"#mainRelationTable tbody\").empty();\n\t} else {\n\t\t$(\"#dvemptyTableMessage\").hide();\n\t\tvar json = objRelation.retrieveChunkedData(objCommon.minRecordInterval, objCommon.noOfRecordsToBeFetched);\n\t\tvar recordSize = 0;\n\t\tcreateChunkedRelationTable(json, recordSize);\n\t\tvar tableID = $('#mainRelationTable');\n\t\tobjCommon.createPaginationView(totalRecordsize, objCommon.MAXROWS,\n\t\t\t\t\t\ttableID, objRelation, json, createChunkedRelationTable,\n\t\t\t\t\t\t\"Relation\");\n\t\tobjCommon.checkCellContainerVisibility();\n\t}\n}", "title": "" }, { "docid": "18b027e936a96f0540841a8d1908144f", "score": "0.5519778", "text": "function setupTable(tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS todos(id INTEGER PRIMARY KEY, gebruiker, beschrijving, aangemaaktOp)\");\n}", "title": "" }, { "docid": "8ee9864e24dacd2ff460d739638a7eb7", "score": "0.55193913", "text": "function clear_ufo_table(){\n ufo_tbody.selectAll(\"tr\").remove();\n}", "title": "" }, { "docid": "a502a58eb72613eb5946d78d40ed9a16", "score": "0.5517664", "text": "clear() {\n\t/* Delete the table and make a new one */\n\tthis.storage.clear();\n\tthis.storage.makeTable();\n\t\n\t/* Notify the event with a Toast */\n\tlet toast = Toast.create({\n message: 'Table Cleared',\n duration: 2000,\n position: 'bottom',\n\t showCloseButton: true\n });\n this.nav.present(toast);\n\n\t/* Reset the data and redraw the graph */\n\tthis.labels = [];\n\tthis.db = [];\n\tthis.makeChart();\n }", "title": "" }, { "docid": "fabbf6d096d5979880f30e01994af20e", "score": "0.5512121", "text": "function newTable(){\r\n\r\n\t// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces\r\n\tvar body = document.getElementsByTagName(\"body\")[0];\r\n\r\n\t// Create table, thead, and tbody elements\r\n\tvar table = document.createElement(\"table\");\r\n\ttable.id = \"table\";\r\n\tvar tableHead = document.createElement(\"thead\");\r\n\tvar tableBody = document.createElement(\"tbody\");\r\n\ttableBody.id = \"tbody\";\r\n\r\n\t// Create the Headers\r\n\tvar rowHdr = document.createElement(\"tr\");\r\n\tfor(var i=0; i<4; i++){\r\n\t\tvar hdr = document.createElement(\"th\");\r\n\t\tvar hdrText = document.createTextNode(\"Header \" + (i+1));\r\n\t\thdr.appendChild(hdrText);\r\n\t\trowHdr.appendChild(hdr);\r\n\t}\r\n\t// Add to the table head (thead)\r\n\ttableHead.appendChild(rowHdr);\r\n\r\n\t// Create the data cells\r\n\tfor(var i=1; i<4; i++){\r\n\t\tvar row = document.createElement(\"tr\");\r\n\t\tfor(var j=1; j<5; j++){\r\n\t\t\tvar data = document.createElement(\"td\");\r\n\t\t\tdata.id = i+\",\"+j; //setting id for each cell (row, col)\r\n\t\t\tvar dataText = document.createTextNode(i+\",\"+j);\r\n\t\t\tdata.appendChild(dataText);\r\n\t\t\trow.appendChild(data);\r\n\t\t}\r\n\t\t// Add to the table body (tbdody)\r\n\t\ttableBody.appendChild(row);\r\n\t}\r\n\r\n\ttable.appendChild(tableHead);\r\n\ttable.appendChild(tableBody);\r\n\tbody.appendChild(table);\r\n\t// Give the table a border with width 1\r\n\ttable.setAttribute(\"border\", 1);\r\n}", "title": "" }, { "docid": "43780d5c7e85505f261c22dad417bd11", "score": "0.5505783", "text": "function criaTabela(tx) {//se a tabela nao existe entao cria\n tx.executeSql('CREATE TABLE IF NOT EXISTS COORDENADAS (id,latitude,longitude,sensibilidade,nivel)');\n }", "title": "" }, { "docid": "3902a0de3851586be4f9e22f972a20ab", "score": "0.549835", "text": "function createNewTableCircle()\n{\n addTable('CT'+tables.length, 90, 90, 'CI', 100, 0, 1);\n}", "title": "" }, { "docid": "026f34865e51f87624687869beb351f9", "score": "0.54926693", "text": "function deleteTable()\n{\n var tBody = document.getElementById(\"firstCalendarBody\");\n while (tBody.rows.length > 0) {\n tBody.deleteRow(0);\n }\n}", "title": "" }, { "docid": "4d2a11f72838e979ac22b8ff955804c4", "score": "0.54892963", "text": "function createTable(){\n\n log.info('creating table');\n var createQuery = \"CREATE TABLE `\" + config.get('mysql:database') + \"`.`usage_recommendations` (\" +\n \"`id` INT NOT NULL AUTO_INCREMENT, \" +\n \"`timestamp` TEXT, \" +\n \"`username` TEXT, \" +\n \"`file_name` TEXT, \" +\n \"`description` TEXT, \" +\n \"`teacher_count` TEXT, \" +\n \"`teacher_ethnicities` TEXT, \" +\n \"`student_ethnicities` TEXT, \" +\n \"`activities` TEXT, \" +\n \"`technical_issues` TEXT, \" +\n \"`start_1` TEXT, \" +\n \"`stop_1` TEXT, \" +\n \"`usage_1` TEXT, \" +\n \"`notes_1` TEXT, \" +\n \"`start_2` TEXT, \" +\n \"`stop_2` TEXT, \" +\n \"`usage_2` TEXT, \" +\n \"`notes_2` TEXT, \" +\n \"`start_3` TEXT, \" +\n \"`stop_3` TEXT, \" +\n \"`usage_3` TEXT, \" +\n \"`notes_3` TEXT, \" +\n \"`start_4` TEXT, \" +\n \"`stop_4` TEXT, \" +\n \"`usage_4` TEXT, \" +\n \"`notes_4` TEXT, \" +\n \"`start_5` TEXT, \" +\n \"`stop_5` TEXT, \" +\n \"`usage_5` TEXT, \" +\n \"`notes_5` TEXT, \" +\n \"`start_6` TEXT, \" +\n \"`stop_6` TEXT, \" +\n \"`usage_6` TEXT, \" +\n \"`notes_6` TEXT, \" +\n \"`start_7` TEXT, \" +\n \"`stop_7` TEXT, \" +\n \"`usage_7` TEXT, \" +\n \"`notes_7` TEXT, \" +\n \"`start_8` TEXT, \" +\n \"`stop_8` TEXT, \" +\n \"`usage_8` TEXT, \" +\n \"`notes_8` TEXT, \" +\n \"`start_9` TEXT, \" +\n \"`stop_9` TEXT, \" +\n \"`usage_9` TEXT, \" +\n \"`notes_9` TEXT, \" +\n \"`start_10` TEXT, \" +\n \"`stop_10` TEXT, \" +\n \"`usage_10` TEXT, \" +\n \"`notes_10` TEXT, \" +\n \"`meta` TEXT, \" +\n\n \"PRIMARY KEY (`id`) ) \" +\n \"ENGINE = MyISAM \" +\n \"DEFAULT CHARACTER SET = utf8;\";\n\n return pool.getConnectionAsync()\n .then(function(connection){\n if(connection){\n log.info('connection established: ' + connection.threadId);\n return connection.query(createQuery, function(err, rows, columns){\n if(err){\n log.warn(err);\n }\n release(connection);\n });\n }\n })\n ;\n}", "title": "" }, { "docid": "aa8255bda2e01b21f6e011c13358f966", "score": "0.54728526", "text": "function createTable(tableData) {\n // Clear existing table\n tbody.html(\"\")\n \n // Loop through tableData, append table and add rows to web page \n tableData.forEach(info => {\n console.log(info);\n const row = tbody.append(\"tr\");\n Object.values(info).forEach((value) => {\n console.log(value);\n let cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "title": "" }, { "docid": "8ec859a6db7c2bfbbfeb103fc44a6527", "score": "0.5466973", "text": "function createsTablePlaceholder()\n {\n tb = $$\n .c('table')\n .to( stdMod.legendRoot$ )\n .cls( 'main-legend ' + theorion )\n\n //removes set of .main-legend.]theorion[ {\n .css( 'border-collapse', 'collapse' )\n ()\n //css( 'table-layout', 'auto' ) //makes problem ... table moves out of pane ...\n //css( 'width', '500px' ) //possible responsivness problems\n ;\n }", "title": "" }, { "docid": "10da8dc2924ed2bb61b263d0469adbbb", "score": "0.5463046", "text": "function createAllTable() {\n let table = document.getElementById(\"tableHeadParkType\");\n table.innerHTML = \"\";\n let row = table.insertRow(table.rows.length);\n let cell1 = row.insertCell(0);\n cell1.innerHTML = \"Name\";\n let cell2 = row.insertCell(1);\n cell2.innerHTML = \"Address\";\n let cell3 = row.insertCell(2);\n cell3.innerHTML = \"City\";\n let cell4 = row.insertCell(3);\n cell4.innerHTML = \"State\";\n let cell5 = row.insertCell(4);\n cell5.innerHTML = \"Zip\";\n let cell6 = row.insertCell(5);\n cell6.innerHTML = \"Phone\";\n let cell7 = row.insertCell(6);\n cell7.innerHTML = \"Fax\";\n let cell8 = row.insertCell(7);\n cell8.innerHTML = \"Latitude\";\n let cell9 = row.insertCell(8);\n cell9.innerHTML = \"Longitude\";\n table.appendChild(row);\n table = document.getElementById(\"tableBodyParkType\");\n table.innerHTML = \"\";\n for (let i = 0; i < objs.parks.length; i++) {\n let row = table.insertRow(table.rows.length);\n let cell1 = row.insertCell(0);\n cell1.innerHTML = objs.parks[i].LocationName;\n table.appendChild(row);\n let cell2 = row.insertCell(1);\n cell2.innerHTML = objs.parks[i].Address;\n table.appendChild(row);\n let cell3 = row.insertCell(2);\n cell3.innerHTML = objs.parks[i].City;\n table.appendChild(row);\n let cell4 = row.insertCell(3);\n cell4.innerHTML = objs.parks[i].State;\n table.appendChild(row);\n let cell5 = row.insertCell(4);\n cell5.innerHTML = objs.parks[i].ZipCode;\n table.appendChild(row);\n let cell6 = row.insertCell(5);\n cell6.innerHTML = objs.parks[i].Phone;\n table.appendChild(row);\n let cell7 = row.insertCell(6);\n cell7.innerHTML = objs.parks[i].Fax;\n table.appendChild(row);\n let cell8 = row.insertCell(7);\n cell8.innerHTML = objs.parks[i].Latitude;\n table.appendChild(row);\n let cell9 = row.insertCell(8);\n cell9.innerHTML = objs.parks[i].Longitude;\n table.appendChild(row);\n }\n }", "title": "" }, { "docid": "14a398f00a8a0544bfe457d059ccd4e8", "score": "0.5461227", "text": "function generateTable3(table, arrayData) {\n for (var i = 0; i < arrayData.length; i++) {\n var row = table.insertRow();\n var cell1 = row.insertCell();\n var cell2 = row.insertCell();\n var textTime = document.createTextNode(arrayData[i][0]);\n var textBlank = document.createTextNode(\"\");\n cell1.appendChild(textTime);\n row.appendChild(cell1);\n cell2.appendChild(textBlank);\n row.appendChild(cell2);\n }\n}", "title": "" }, { "docid": "a782b5049b2782722b2a1209edb0b59b", "score": "0.545302", "text": "function append_table_leg (table, mode, start_time, duration)\n{\n var row = table.insertRow(table.rows.length);\n var mode_cell = row.insertCell(0);\n mode_cell.innerHTML = mode;\n var start_time_cell = row.insertCell(1);\n start_time_cell.innerHTML = start_time;\n var duration_cell = row.insertCell(2);\n duration_cell.innerHTML = duration;\n}", "title": "" }, { "docid": "b85fcce5525a3818e1154d93baa0ca77", "score": "0.54526746", "text": "function populateDB(tx) {\n console.log(\"POPULATE DB\");\n tx.executeSql('Create Table IF NOT EXISTS categorias_ingreso(id_categoria_ingreso integer primary key, nombre_categoria_ingreso text )');\n tx.executeSql('Create Table IF NOT EXISTS categorias_egreso(id_categoria_egreso integer primary key, nombre_categoria_egreso text )');\n tx.executeSql('Create Table IF NOT EXISTS subcategorias_egreso(id_subcategoria_egreso integer primary key, nombre_subcategoria_egreso, id_categoria_egreso integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_ingreso(id_saldo_ingreso integer primary key, fecha_ingreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_ingresado real, id_categoria_ingreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_egreso(id_saldo_egreso integer primary key, fecha_egreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_egresado real, id_subcategoria_egreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS cta(id_cuenta_in integer primary key, nombre text, saldo real, isActive integer)');\n }", "title": "" }, { "docid": "985123a674a9cc66c1c86f76fd2303a3", "score": "0.5441692", "text": "function end(){\n \n }", "title": "" }, { "docid": "a5a62965acc67fa53b4f0ed5448c8ea7", "score": "0.544021", "text": "function killFooter() {\r\n var footer = storeSalesTable.lastChild;\r\n footer.remove();\r\n}", "title": "" }, { "docid": "8614a1e03a3786ab7be4dbac4db806b7", "score": "0.54401684", "text": "fetchFreshTableData() {\n //\n }", "title": "" }, { "docid": "7117545ae32d1a9a3f6803b8bcf9fb0e", "score": "0.5430531", "text": "function dropTableParametriOffline() {\r\n\t db.transaction(dropTableParametriOfflineExecute, errorDB);\r\n}", "title": "" }, { "docid": "45bbbb4b160659ae661809f5b1dd601d", "score": "0.5430207", "text": "function updateTable() {\n // empty table\n $(\"#table-body\").empty();\n\n // updates values in table for each object key\n for (i = 0; i < trainNameArray.length; i++) {\n //ensures that time is in the past\n timeConverted = moment(trainTimesArray[i], \"hh:mm\").subtract(1, \"years\");\n trainName = trainNameArray[i]\n trainDestination = trainDestinationArray[i];\n trainFrequency = trainFreqsArray[i];\n showTrains();\n };\n }", "title": "" }, { "docid": "c8c43e3425bbc26ed900fa6c93a9cd7d", "score": "0.5428989", "text": "deleteTableName(){\n let requestUrl = this.get_delete_url();\n this.props.reportRepository.deleteTableList(requestUrl, null).then((answer) => {\n this.getTableList();\n });\n }", "title": "" }, { "docid": "1f13e8ff1c7f7eaf6dd9713d5b93c74e", "score": "0.54281735", "text": "function draw_table()\n {\n for (j = 0; j <= height; j++)\n {\n $(\"table\").append(\"<tr></tr>\");\n\n for(i = 0; i < width; i++)\n { \n $(\"tr:nth-child(\"+j+\")\").append(\"<td class='empty'></td>\");\n }\n }\n }", "title": "" }, { "docid": "99777779f0d93f957999098e74980628", "score": "0.5425934", "text": "function createOpTable() {\n var fBody = document.getElementById('operator_table');\n var bTbl = document.createElement('table');\n bTbl.style.borderCollapse = \"collapse\";\n bTbl.style.width = '40%';\n bTbl.style.align = 'center';\n bTbl.setAttribute('border','1');\n bTbl.style.marginLeft = '5%';\n bTbl.fontsize ='13px';\n var tbdy = document.createElement('tbody');\n tbdy.texAlign=\"center\";\n var tr = document.createElement('tr');\n tr.style.textAlign = 'center'\n \n\n th = document.createElement('th');\n th.innerHTML = \"Operators\";\n th.width = '16.6%';\n tr.appendChild(th);\n tbdy.appendChild(tr);\n \n /*th = document.createElement('th');\n th.innerHTML = \"Delete\";\n th.width = '16.6%';\n tr.appendChild(th);\n tbdy.appendChild(tr);\n */\n\n bTbl.appendChild(tbdy);\n fBody.appendChild(bTbl);\n\n $(\"#opearato_table\").append($(bTbl));\n}", "title": "" }, { "docid": "df8d93590747adce4d2c6f321cb98e9a", "score": "0.54163575", "text": "function initialTable(data) {\n // remove existing table content\n tbody.html(\"\");\n // create the loop & loop through the data\n data.forEach((record) => {\n var row = tbody.append(\"tr\");\n Object.entries(record).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "461a907442731016d9612831032e93d7", "score": "0.541266", "text": "function removeTableData() {\r\n hideTable();\r\n d3.selectAll(\".row_info\").remove();\r\n }", "title": "" }, { "docid": "d0d2b7a83d838ed13c4e11faad96617b", "score": "0.54053307", "text": "function populateDB(tx) {\n tx.executeSql('Create Table IF NOT EXISTS categorias_ingreso(id_categoria_ingreso integer primary key, nombre_categoria_ingreso text )');\n tx.executeSql('Create Table IF NOT EXISTS categorias_egreso(id_categoria_egreso integer primary key, nombre_categoria_egreso text )');\n tx.executeSql('Create Table IF NOT EXISTS subcategorias_egreso(id_subcategoria_egreso integer primary key, nombre_subcategoria_egreso, id_categoria_egreso integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_ingreso(id_saldo_ingreso integer primary key, fecha_ingreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_ingresado real, id_categoria_ingreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_egreso(id_saldo_egreso integer primary key, fecha_egreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_egresado real, id_subcategoria_egreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS cta(id_cuenta_in integer primary key, nombre text, saldo real, isActive integer)');\n tx.executeSql(\"INSERT OR IGNORE INTO cta(id_cuenta_in, nombre, saldo) values (1,'Yoshi', 0)\");\n }", "title": "" }, { "docid": "136deca93272386d4bae30643cf3d58a", "score": "0.5404535", "text": "function clearTable(){\n console.log(\"Clearing table\");\n let rows = document.getElementsByClassName(\"row\");\n for(let i = rows.length-1; i >= 0; i--){\n rows[i].parentNode.removeChild(rows[i]);\n }\n }", "title": "" }, { "docid": "ff851fd74722bb9b34898b52d24846c7", "score": "0.54011726", "text": "function createTableFooter(queryID) {\n const footerRow = document.createElement('tr');\n footerRow.className = \"book-row\";\n fetch('/book-indices'+ '?session-id=' + sessionId + '&query-id=' + queryID).then(response => response.json()).then((indices) => {\n const prevColumn = createColumn(\"previous\", indices.hasPrev, queryID);\n const pageColumn = createPageColumn(indices);\n const moreColumn = createColumn(\"more\", indices.hasMore, queryID);\n footerRow.appendChild(prevColumn);\n footerRow.appendChild(pageColumn);\n footerRow.appendChild(moreColumn);\n });\n return footerRow;\n}", "title": "" }, { "docid": "d3a92ef8fe1630b2997e963f26c924f9", "score": "0.5400984", "text": "function clearTable() { \n while (tableBody.hasChildNodes()){\n tableBody.removeChild(tableBody.firstChild);\n }\n}", "title": "" }, { "docid": "4cf15b870d6c6d0deda65c7050afb501", "score": "0.53947663", "text": "function makeTable() {\n $('#current-time').text(moment().format(\"h:mm A\"))\n database.ref().on(\"value\", function(snapshot) {\n allTrains = snapshot.val()\n $('#table-body').empty()\n for (key in allTrains) {\n data = allTrains[key]\n data.key = key\n createRow(data)\n }\n // Handle the errors\n }, function(errorObject) {\n console.log(\"Errors handled: \" + errorObject.code);\n });\n}", "title": "" }, { "docid": "0f782bcb8f95d1e88c43d0a7f8b55e44", "score": "0.5394281", "text": "function writeTableToHtml() {\r\n\tvar rowIndex, colIndex;\r\n\tvar tableData = dynTable_tableDataUpdated;\r\n\r\n\t// detele all rows in tbody except for the first one\r\n\tvar tbodyPointer = findTBodyPointer();\r\n\twhile(tbodyPointer.rows.length > 1) {\r\n\t\ttbodyPointer.deleteRow(1);\r\n\t}\r\n\t// write updated tbody of table to HTML\r\n\tstructureNewTable(dynTable_tableDataUpdated);\r\n}", "title": "" }, { "docid": "1ba6357c5551fe64a7d8003e2a833659", "score": "0.5394215", "text": "visitCreate_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "2ab2d5f1f0aff96218cb6705453ea334", "score": "0.5389654", "text": "function saveTable() {\n var cols = $(\"#col\").val();\n var rows = $(\"#rows\").val();\n var colstart = $(\"#colstart\").val();\n var rowstart = $(\"#rowstart\").val();\n var number = Math.ceil((Math.random(200) + 1) * 100);\n var name = \"1\" + number.toString();\n console.log(name)\n document.getElementById(\"savetabledata\").innerHTML = `<br><br><label style=\"font-weight:bold;padding-left:20px\" id=\"table1row` + name + `\"></label>\n <label style=\"font-weight:bold;padding-left:20px\" id=\"table1col`+ name + `\"></label>\n <label style=\"font-weight:bold;padding-left:20px\" id=\"table1colstartingvalue`+ name + `\"></label>\n <label style=\"font-weight:bold;padding-left:20px\" id=\"table1rowstartingvalue`+ name + `\"></label>\n <button type=\"button\" class=\"btn btn-success\" id= \"button`+ name + `\" onclick=\"deleteTable(`+name+`)\"\n style=\"width:100px;margin-left:20px;height:40px;margin-top:5px\">Delete</button>\n <table style=\"font-family: arial, sans-serif;border-collapse: collapse;width: 100%;\">\n <tbody id=\"tabled1`+ name + `\">\n </tbody>\n </table>` + document.getElementById(\"savetabledata\").innerHTML;\n\n document.getElementById(\"table1row\" + name).innerHTML = 'Number Of Rows: ' + rows; //Display rows when saved\n document.getElementById(\"table1col\" + name).innerHTML = 'Number Of Columns: ' + cols; //Display columns when saved\n document.getElementById(\"table1colstartingvalue\" + name).innerHTML = 'Column Starting Value: ' + colstart; //Display starting value of column when saved\n document.getElementById(\"table1rowstartingvalue\" + name).innerHTML = 'Row Starting Value: ' + rowstart; //Display starting value of row when saved\n\n var tr = '';\n var table = \"\";\n var ab = 0;\n var cd = 0;\n\n if (!isNaN(parseInt(cols)) && !isNaN(parseInt(rows)) && !isNaN(parseInt(colstart)) && !isNaN(parseInt(rowstart))) {\n $(\"#tabled1\" + name).html('');\n var flag = false;\n var colflag = false;\n var hideflag = false;\n for (var i = 0; i < rows; i++) {\n table += '<tr>';\n var rowcount = i + parseInt(rowstart);\n if (flag == true) {\n table += '<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: black;color: white;\">' + rowcount + '</td>';\n }\n else\n table += '<td style=\"color:white;\">' + i + '</td>';\n\n for (var j = 0; j < cols; j++) {\n var jcol = j + parseInt(colstart);\n if (hideflag == false) {\n if (j == 0 && colflag == false) {\n\n\n table += '<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: black;color: white;\">' + jcol + '</td>';\n flag = true;\n colflag = true;\n i = -1;\n }\n else\n table += '<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: black;color: white;\">' + jcol + '</td>';\n }\n else {\n var tmp = (j + parseInt(colstart)) * (i + parseInt(rowstart));\n console.log(tmp)\n table += '<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;color:black\">' + tmp + '</td>';\n }\n }\n hideflag = true;\n table += '</tr>';\n }\n $(\"#tabled1\" + name).append(table);\n }\n\n else {\n $(\"#tabled1\" + name).html('');\n var table = '<tr><td>Please enter numeric value.</td></tr>';\n $(\"#tabled1\" + name).append(table);\n }\n}", "title": "" }, { "docid": "b9a45634091817d5a367994707c51e11", "score": "0.5384632", "text": "function main(){\n tableCreate(4,4);\n makeButtons();\n}", "title": "" }, { "docid": "729ae26c79b6d0f54cdb766e80aca35c", "score": "0.53796226", "text": "function onDropDB(tx)\n{\n tx.executeSql('DROP TABLE IF EXISTS TODOLIST');\n}", "title": "" }, { "docid": "a4fae5a8ec90586cd2a738c73f15dbe8", "score": "0.5378208", "text": "function populateDB(tx) {\n tx.executeSql('Create Table IF NOT EXISTS categorias_ingreso(id_categoria_ingreso integer primary key, nombre_categoria_ingreso text )');\n tx.executeSql('Create Table IF NOT EXISTS categorias_egreso(id_categoria_egreso integer primary key, nombre_categoria_egreso text )');\n tx.executeSql('Create Table IF NOT EXISTS subcategorias_egreso(id_subcategoria_egreso integer primary key, nombre_subcategoria_egreso, id_categoria_egreso integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_ingreso(id_saldo_ingreso integer primary key, fecha_ingreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_ingresado real, id_categoria_ingreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS saldos_egreso(id_saldo_egreso integer primary key, fecha_egreso TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, monto_egresado real, id_subcategoria_egreso integer, id_cuenta_in integer)');\n tx.executeSql('Create Table IF NOT EXISTS cta(id_cuenta_in integer primary key, nombre text, saldo real, isActive integer)');\n tx.executeSql(\"INSERT OR IGNORE INTO cta(id_cuenta_in, nombre, saldo,isActive) values (1,'Default', 0, 1)\");\n }", "title": "" }, { "docid": "4640d373e84cadb846357d7fc6974b20", "score": "0.53777516", "text": "createTable() {\n this.table = new Array(this.rows);\n for (let i = 0; i < this.rows; i++) {\n this.table[i] = new Array(this.columns);\n for (let j = 0; j < this.columns; j++)\n this.table[i][j] = 0;\n }\n }", "title": "" }, { "docid": "4ddc68d523d42995e6345c427873d4a8", "score": "0.537621", "text": "function myremovetable() {\n\tmylog(\"Removing Table...\");\n\tWL.JSONStore.get('mycustomers').removeCollection().then(function(res) {\n\t\tmylog(\"Table removed\");\n\t}).fail(function(errobject) {\n\t\tWL.Logger.debug(errobject.toString());\n\t\tmylog(\"Error removing table...\");\n\t});\n}", "title": "" } ]
a03dc4ea6e491cf3e382ad6577ebec80
PART 2: SHOW WEATHER
[ { "docid": "d5606a934f25ba15ae967ca1ae3ed3fe", "score": "0.0", "text": "function replaceForecast(response){\n $('#weather-info').html(response.forecast);\n}", "title": "" } ]
[ { "docid": "b945500cece59aa0f8de958e6b4f91c9", "score": "0.5666244", "text": "function searchWeather(req, res) {\r\n // database of information\r\n dbQuery('weathers', req, res, infoExists, noWeather);\r\n}", "title": "" }, { "docid": "5a30e6e6bc09c4b55e8ebfcd60f48245", "score": "0.54840267", "text": "function getWeather (request, response) {\r\n const handler = new Feature (request);\r\n handler.cacheHit = (results) => {\r\n console.log('cacheHit');\r\n response.send(results.rows);\r\n }\r\n handler.cacheMiss = () => {\r\n console.log('cacheMiss');\r\n Weather.fetch(request.query)\r\n .then( results => response.send(results))\r\n .catch( error => handleError(error));\r\n }\r\n handler.tableName = 'weathers',\r\n handler.lookupFeature();\r\n}", "title": "" }, { "docid": "f78680063ee1d30b83659f0d07a5d23d", "score": "0.543897", "text": "function getWheater(woeid){\n fetch\n (`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\n .then(result => {\n console.log(result);\n return result.json();\n })\n .then(data => {\n const today = data.consolidated_weather[0];\n console.log(`Temperatures in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\n })\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "3a8f490487d6473c986aad2ef89fc9ff", "score": "0.5383398", "text": "function getWheather() {\n let lat = gMarkers[0].getPosition().lat();\n let lng = gMarkers[0].getPosition().lng();\n _connectWheatherApi(lat, lng)\n .then(ans => {\n let weahter = ans.data.weather[0].description;\n let humidity = ans.data.main.humidity;\n let country = ans.data.sys.country;\n renderWheather(weahter, humidity, country);\n })\n .catch(err => {\n console.log('Error:', err)\n })\n}", "title": "" }, { "docid": "ccfeb8b7524c89100f6266b250f5f174", "score": "0.53566825", "text": "function extractInfo(weather) {\n forecast.length = 0;\n tempMax.length = 0;\n tempMin.length = 0;\n dateMeasured.length = 0;\n daysIndex.length = 0;\n daysOfWeek.length = 0;\n wind.length = 0;\n cityAlert.textContent = weather.city.name;\n for (let i = 0; i < weather.list.length; i += 8) {\n forecast.push(weather.list[i].weather[0].main);\n tempMax.push(weather.list[i].main.temp_max);\n tempMin.push(weather.list[i].main.temp_min);\n dateMeasured.push(weather.list[i].dt_txt);\n wind.push(weather.list[i].wind.speed);\n }\n for (let i = 0; i < dateMeasured.length; i++) {\n let d = new Date(dateMeasured[i]);\n daysIndex.push(d.getDay());\n daysOfWeek.push(dayName[daysIndex[i]]);\n }\n displayWeather();\n}", "title": "" }, { "docid": "e6540b9179992a930e7c0f9ac16006cb", "score": "0.53337085", "text": "function getWeather(woeid) {\n fetch(\n `https://crossorigin.me/https://www.metaweather.com/api/location/${woeid}/`\n )\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n //console.log(data);\n const today = data.consolidated_weather[0];\n console.log(\n `Temeperatures in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`\n );\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "5e3bb96b3da72bbd208a187f99110d73", "score": "0.5325013", "text": "function collectWeather($,search_word){\n var data= {};\n data.temperature= $('#detail-now .temp').text();\n var stats= $(\".stats li\").map(function() {\n return $(this).text();\n }).toArray();\n data.city=search_word;\n data.windDirection= stats[0];\n data.windSpeed = stats [1];\n data.humidity= stats[2];\n // get the name of the icon class and extrect the number from it\n var iconNum = $('#detail-now div.icon').attr(\"class\").match(/\\d+/g)[0];\n // all numbers between 1-9, add '0' to the left\n iconNum = (iconNum < 10) ? (\"0\" + iconNum) : iconNum;\n // complete link to the correct wether icon\n data.icon = \"https://vortex.accuweather.com/adc2010/images/slate/icons/\" + iconNum + \".svg\";\n return data;\n}", "title": "" }, { "docid": "49483eea3a3a731e23f5480d87bfd07b", "score": "0.5243883", "text": "function getWeather(woeid) {\n fetch(`https://crossorigin.me/https://www.metaweather.com/api/location/${woeid}/`)\n .then(result => {\n // console.log(result);\n return result.json();\n })\n .then(data => {\n // console.log(data);\n const today = data.consolidated_weather[0];\n console.log(`Temperatures today in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\n })\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "b5c33412eb522e5e61a4ad400bb419b6", "score": "0.5240101", "text": "function getWeatherData (city) {\n return weather(city)\n}", "title": "" }, { "docid": "2365b3ae5216b41d03e0a71477869614", "score": "0.5183483", "text": "statistics(req, res) {\n let type = req.query.type;\n this._statistics.getSearchStringFrequency(type).then(function (result) {\n logger.info(`INFO iprquery#statistics result: ` + result);\n let frequencies = [];\n result.rows.map(record => {\n frequencies.push([record.keywords, Number(record.num)]);\n });\n \n res.send(frequencies);\n }).catch(err => {\n throw new Error(\n logger.error(`ERROR iprquery#statistics Error: `, err)\n )\n });\n }", "title": "" }, { "docid": "12232c22fb7099ff7ae11e5c63a71cfb", "score": "0.51782906", "text": "function data_get_info()\n\t{ return { op: \"get_info\" }; }", "title": "" }, { "docid": "c3c07adff8cafa5de71259ed66b09a96", "score": "0.51742744", "text": "function searchWeather() {\n let apiKey = \"b61fef651891eb9cf133b7845c0e062a\";\n let units = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(displayWeather);\n }", "title": "" }, { "docid": "481941c5758304a95726593013a4c379", "score": "0.51696354", "text": "function printWeather(location, weather) {\n console.log(\"Today it is \" + weather.currently.temperature + \" F at \" + location + \".\");\n}", "title": "" }, { "docid": "7733e67fcd9a595a631adf52fcf26acf", "score": "0.5157505", "text": "function getWeather(request, response) {\n lookUp('weathers', {\n tableName: Weather.tableName,\n query: request.query.data,\n cacheMiss: function () {\n const url=`https://api.darksky.net/forecast/${process.env.WEATHER_API_KEY}/${request.query.data.latitude},${request.query.data.longitude}`;\n return superagent.get(url)\n .then(result => {\n const weatherSummaries = result.body.daily.data.map(day => {\n const weatherItem = new Weather(day);\n weatherItem.save(request.query.data.id);\n return weatherItem;\n });\n response.send(weatherSummaries);\n })\n .catch(error => handleError(error, response));\n },\n cacheHit: function (resultsArray) {\n let ageOfResultsInMinutes = (Date.now() - resultsArray[0].created_at) / (1000 * 60);\n if (ageOfResultsInMinutes > 60) {\n eraseTable('weathers', request.query.data.id);\n this.cacheMiss();\n } else {\n response.send(resultsArray);\n }\n }\n });\n}", "title": "" }, { "docid": "de26309783507a2b527aee41f8b34bce", "score": "0.5145342", "text": "function weatherLog(response, city) {\n var indices = [0, 8, 16, 24, 32, 39]\n\n for (i = 0; i < indices.length; i++) {\n\n var conditions = {};\n conditions.sky = response.list[indices[i]].weather[0].main;\n conditions.icon = response.list[indices[i]].weather[0].icon;\n var tempC = response.list[indices[i]].main.temp;\n conditions.temp = Math.round(((tempC - 273.15) * 9 / 5) + 32);\n conditions.humidity = response.list[indices[i]].main.humidity;\n conditions.wind = response.list[indices[i]].wind.speed;\n\n var today = moment();\n var date = datePlusDay(today, i);\n\n conditions.date = date;\n weatherResults[i] = conditions;\n }\n console.log(\"logged info\", weatherResults);\n UVLog(response, city);\n\n }", "title": "" }, { "docid": "85c15b54d0ddbc7e6259b39d3dff29fc", "score": "0.5141032", "text": "async function getWeather(searchTerm) {\r\n try {\r\n const searchUrl = `${api.baseUrl}${searchTerm}&units=metric&appid=${api.key}`;\r\n const response = await fetch(searchUrl);\r\n const data = await response.json();\r\n console.log(data);\r\n displayWeather(data);\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}", "title": "" }, { "docid": "85030ed43f09004006ffed524117b999", "score": "0.5138204", "text": "async function getWeatherAW(woeid) {\r\n try {\r\n const result = await fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`);\r\n const data = await result.json();\r\n const today = await data.consolidated_weather[0];\r\n console.log(`Temperature on ${today.applicable_date} in the city of: ${data.title} is between: ${today.min_temp} and ${today.max_temp}.`);\r\n } catch(error) {console.log(error)}\r\n \r\n}", "title": "" }, { "docid": "253c8876c20694317b40b9868761c7b5", "score": "0.5106076", "text": "function showWeatherForecast(weather) {\r\n\r\n var weatherForecast = \"\";\r\n var atrib = weather.results.forecast[0];\r\n\r\n //Subtraio 3 do resultado para gerar apenas 6 previsoes a partir do segundo registro(i = 1).\r\n for (var i = 1; i < weather.results.forecast.length - 3; i++) {\r\n\r\n atrib = weather.results.forecast[i];\r\n\r\n //Previsão para os proximos dias\r\n weatherForecast += atrib.weekday +\r\n \" \" + atrib.date +\r\n \" \" + getWeatherEmoji(atrib.condition) +\r\n \"-\\tMax: \" + atrib.max +\r\n \"-\\tMin: \" + atrib.min +\r\n \"\\nDescrição: \" + atrib.description +\r\n \"\\n\\n\";\r\n }\r\n return weatherForecast;\r\n }", "title": "" }, { "docid": "7806769fa2888dc159f93072ab8c2ae0", "score": "0.5094451", "text": "normalizeData(weathers) {\n const result = weathers.map((weather) => ({\n minTemp: parseFloat(weather.min_temp),\n maxTemp: parseFloat(weather.max_temp),\n dayName: this.getDayName(weather.applicable_date),\n iconUrl: `${this.baseUrl}${this.endPoints.icon}${weather.weather_state_abbr}.svg`,\n id: weather.id,\n }))\n return result\n }", "title": "" }, { "docid": "2e2e0b11603993564cafc6bf0e6a6b0b", "score": "0.50857", "text": "function getResults(query) {\r\n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`)\r\n .then(weather => {\r\n return weather.json();\r\n }).then(displayResults);\r\n}", "title": "" }, { "docid": "b279f1bb7335121f15bd40781f8c0c4d", "score": "0.50764346", "text": "function printStatistic(retired) {\n\n // Generate statistics in the streams's log file\n stream.log().info(\"Item Statistics:\");\n\n // Get and log the statistic data (items with summarized quantity in descending order)\n retired.group(\"ITEMNO\").sum(\"QTY\").sort(\"QTY\").reverse().forEach(function (message) {\n stream.log().info(message.property(\"ITEMNO\").value().toString() + \" = \" + message.property(\"QTY\").value().toString());\n });\n}", "title": "" }, { "docid": "6576aabcad3592422f81a8c2e0b655bc", "score": "0.5039698", "text": "function getWeather(request, response) {\r\n WeatherResult.lookup({\r\n tableName: WeatherResult.tableName,\r\n id: request.query.data.id,\r\n cacheMiss: function () {\r\n\r\n const url = `https://api.darksky.net/forecast/${process.env.WEATHER_API_KEY}/${request.query.data.latitude},${request.query.data.longitude}`;\r\n\r\n superagent.get(url)\r\n .then(result => {\r\n const weatherSummary = result.body.daily.data.map(day => {\r\n const dailySumary = new WeatherResult(day);\r\n dailySumary.save(request.query.data.id);\r\n return dailySumary;\r\n });\r\n console.log(weatherSummary[0]);\r\n response.send(weatherSummary);\r\n })\r\n .catch(error => processError(error, response));\r\n },\r\n cacheHit: function (resultsArray) {\r\n let ageOfData = (Date.now() - resultsArray[0].created_at) / (1000 * 60);\r\n if (ageOfData > 30) {\r\n deleteByLocationId(\r\n WeatherResult.tableName,\r\n request.query.data.id\r\n );\r\n } else {\r\n response.send(resultsArray);\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "dbd287a13bed3c7bdff014520fbb919a", "score": "0.50260305", "text": "* show(){\n \treturn yield Database\n .table('histories')\n .select('location', 'ip_address', 'trace', 'activities')\n .where({id:2})\n }", "title": "" }, { "docid": "87d87d431cc941d751bea0d060abb8fb", "score": "0.50226945", "text": "function gatherData(weatherInformation) {\n // sorts weather information into used categories\n\n const city = weatherInformation.name;\n const temperature = weatherInformation.main.temp;\n const feelsLike = weatherInformation.main.feels_like;\n const tempMax = weatherInformation.main.temp_max;\n const tempMin = weatherInformation.main.temp_min;\n const humidityPercent = weatherInformation.main.humidity;\n const report = weatherInformation.weather[0].description;\n const iconInfo = weatherInformation.weather[0].icon;\n\n const weatherData = new Weather(\n city,\n temperature,\n feelsLike,\n tempMax,\n tempMin,\n humidityPercent,\n report,\n iconInfo,\n );\n changeTempUnits(weatherData);\n\n // identifies units selected on toggle and displays by units\n\n const units = document.getElementById('check').checked;\n displayWeather(weatherData, units);\n}", "title": "" }, { "docid": "543d0f38f7a3fa354f0ea6a677a9485f", "score": "0.50208145", "text": "function displayWeatherTwo(object) {\n\tconsole.log(\"-------\");\n\tconsole.log(LeTemps.length, \" \", object.currently.summary);\n\tLeTemps[LeTemps.length] = object.currently.summary;\n}", "title": "" }, { "docid": "25a1deeed39f98c7149198b949b28ebc", "score": "0.50204057", "text": "async function getWeatherAW(woeid) {\n const res = await fetch(\n `https://crossorigin.me/https://www.metaweather.com/api/location/${woeid}/`\n );\n try {\n const data = await res.json();\n const today = data.consolidated_weather[0];\n console.log(\n `Temeperatures in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`\n );\n } catch (err) {\n alert(err);\n }\n return data;\n}", "title": "" }, { "docid": "03329027ff4884fd6c9bbf30e888262f", "score": "0.5019281", "text": "function getWeather() {\n // Ignore the user if they haven't clicked and/or haven't said excuse me yet\n if (!started || !attention) {\n return;\n }\n // Ask the API for the JSON data about the current weather\n // tell it to call our gotWeatherData function when it's loaded\n loadJSON(METAWEATHER_API_URL, gotWeatherData);\n\n // Play for time...\n responsiveVoice.speak(`Let's see...`, VOICE_NAME, VOICE_PARAMS);\n}", "title": "" }, { "docid": "46e1d185dc00bff000d98c35beda9efc", "score": "0.5017782", "text": "function getUvIndex() {\n queryUVIndexURL = `https://api.openweathermap.org/data/2.5/uvi?appid=${APIKey}&lat=${lattitude}&lon=${longitude}`;\n}", "title": "" }, { "docid": "90a66e7560e39df590932f7f9069b3bf", "score": "0.50138044", "text": "get webinfos() {\n return _telemetry_js__WEBPACK_IMPORTED_MODULE_11__[\"tag\"].configure(Object(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableCollection\"])(this, \"webinfos\"), \"w.webinfos\");\n }", "title": "" }, { "docid": "75e3f88346229f4c728a184bf92c0136", "score": "0.50109375", "text": "static getStats () {\n return catalogueCache.getStats();\n }", "title": "" }, { "docid": "e43340bac0d3c4658e731c1d95410af9", "score": "0.5008139", "text": "function getData( cityName ) {\n var key = 'fb5f4c0b40f1db9cb2d39540974f5684';\n fetch('https://api.openweathermap.org/data/2.5/forecast?q=' + cityName+ '&units=metric&appid=' + key)\n .then(function(resp) { return resp.json() }) // Convert data to json\n .then(function(data) {\n console.log(data['list']);\n\n\n let averageTemp = array => Math.floor((array.reduce((a,b) => a + b, 0) / array.length)) + '&#176';\n\n let allTemp = [];\n let beschrijving = [];\n\n for (let i = 0; i < 40; i++) {\n allTemp.push(data.list[i].main.temp);\n beschrijving.push(data.list[i].weather[0].description);\n\n }\n console.log(beschrijving);\n console.log(allTemp);\n\n//elke dag bereken per 8 getallen in de array\n let day1= allTemp.slice(0,8);\n let day2= allTemp.slice(8,16);\n let day3= allTemp.slice(16,24);\n let day4= allTemp.slice(24,32);\n let day5= allTemp.slice(32,40);\n\n\n let descrip1 = beschrijving.slice(0,8);\n let descrip2 = beschrijving.slice(8,16);\n let descrip3 = beschrijving.slice(16,24);\n let descrip4 = beschrijving.slice(24,32);\n let descrip5 = beschrijving.slice(32,40);\n\n\n\n\n function geefWeer(beschrijvingWeer){\n\n var cnts = beschrijvingWeer.reduce( function (obj, val) {\n obj[val] = (obj[val] || 0) + 1;\n return obj;\n }, {} );\n //Use the keys of the object to get all the values of the array\n //and sort those keys by their counts\n var sorted = Object.keys(cnts).sort( function(a,b) {\n return cnts[b] - cnts[a];\n });\n\n return sorted[0];\n }\n\n let beschrijvingWeer1 = geefWeer(descrip1);\n let beschrijvingWeer2 = geefWeer(descrip2);\n let beschrijvingWeer3 = geefWeer(descrip3);\n let beschrijvingWeer4 = geefWeer(descrip4);\n let beschrijvingWeer5 = geefWeer(descrip5);\n\n // better to use for loop for everything!!!\n //work on that later!!\n\n document.getElementById(\"dayOne\").innerHTML = averageTemp(day1);\n document.getElementById(\"dayTwo\").innerHTML = averageTemp(day2);\n document.getElementById(\"dayThree\").innerHTML = averageTemp(day3);\n document.getElementById(\"dayFour\").innerHTML = averageTemp(day4);\n document.getElementById(\"dayFive\").innerHTML = averageTemp(day5);\n\n\n document.getElementById(\"description1\").innerHTML = beschrijvingWeer1;\n document.getElementById(\"description2\").innerHTML = beschrijvingWeer2;\n document.getElementById(\"description3\").innerHTML = beschrijvingWeer3;\n document.getElementById(\"description4\").innerHTML = beschrijvingWeer4;\n document.getElementById(\"description5\").innerHTML = beschrijvingWeer5;\n\n\n console.log(averageTemp(day1));\n\n\n var d = new Date();\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n weekday[7] = \"Sunday\";\n\n var n = weekday[d.getDay()];\n console.log(n);\n\n document.getElementById(\"daydate1\").innerHTML = weekday[d.getDay()];\n document.getElementById(\"daydate2\").innerHTML = weekday[d.getDay()+1];\n document.getElementById(\"daydate3\").innerHTML = weekday[d.getDay()+2];\n document.getElementById(\"daydate4\").innerHTML = weekday[d.getDay()+3];\n document.getElementById(\"daydate5\").innerHTML = weekday[d.getDay()+4];\n\n /*\n // found on stackoverflow and trying to implement the code\n\n var allDays= ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n var d = new Date(data.list[0].dt * 1000); // to get the DateTime.\n var dayName = allDays[d.getDay()]; // It will give day index, and based on index we can get day name from the array.\n console.log(dayName)\n\n\n\n\n var wf = \"\";\n wf += \"<h2>\" + data.city.name + \"</h2>\"; // City (displays once)\n $.each(data.list, function(index, val) {\n wf += \"<p>\" // Opening paragraph tag\n wf += \"<b>Day \" + index + \"</b>: \" // Day\n wf += \"<b>DateTime \" + new Date(val.dt*1000).toISOString() + \"</b>: \" // DateTime\n wf += val.main.temp + \"&degC\" // Temperature\n wf += \"<span> \" + val.weather[0].description + \"</span>\"; // Description\n wf += \"<img src='https://openweathermap.org/img/w/\" + val.weather[0].icon + \".png'>\" // Icon\n wf += \"</p>\" // Closing paragraph tag\n });\n $(\"#showWeatherForcast\").html(wf);\n\n */\n\n\n })\n .catch(function() {\n // catch any errors\n });\n\n\n\n}", "title": "" }, { "docid": "71c17361eda64893e7931508b9717d2b", "score": "0.49966896", "text": "function getWeatherDOM(){\n weather.getWeather()\n .then(results => {\n console.log(results);\n })\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "80235bb2ba5515065c7c801b5d19d267", "score": "0.49881014", "text": "function whatsTrending () {\n 'use strict';\n\n var bearer = TwitterTokens.findOne( { \n date_created : { \n $exists : true \n } \n }, { \n sort: { \n date_created : 1 \n } \n } )\n\n HTTP.call(\n 'GET',\n _$.Twitter.urls.trends,\n {\n 'headers' : {\n 'Authorization' : 'Bearer ' + bearer.access_token\n }\n }, function ( error, result ) {\n if ( ! error ) {\n var trends = JSON.parse( result.content )\n\n for ( var index in trends[0].trends ) {\n var insert = trends[0].trends[index]\n insert.date_created = Date.now()\n TwitterTrends.upsert( { name : insert.name }, { $set : {\n name : insert.name,\n query : insert.query,\n url : insert.url,\n date_created : Date.now() \n } } )\n \n\n }\n\n } else {\n Logger.insert ( error )\n }\n } )\n}", "title": "" }, { "docid": "dfccfbab3d9c6716e911a162cee0ae5c", "score": "0.49846816", "text": "function getWeather() {\n weather\n .getWeather()\n .then((results) => {\n ui.paint(results);\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "0cb8a354b931a577f12224e98fb5ca5d", "score": "0.49842906", "text": "get statWeeklyEstate() {\n return \"api/v1/statistics/weeklyEstate\";\n }", "title": "" }, { "docid": "a705cd2ec0ca4b131a55595e4abef9cf", "score": "0.49819344", "text": "function metrics(filter) {\n const debug = (0, debug_1.default)(\"tabletcommand-logger:middleware/metrics\");\n function defaultFilter(pathIn) {\n const uuidRegex = /[-a-f\\d]{36}/i;\n const mongoIdRegex = /[a-f\\d]{24}/i;\n let path = pathIn;\n if (uuidRegex.exec(path) || mongoIdRegex.exec(path)) {\n const parts = path.split(\".\");\n const cleanParts = parts.filter(function (part) {\n const isUUID = uuidRegex.exec(part);\n const isMongoId = mongoIdRegex.exec(part);\n return !(isUUID || isMongoId);\n });\n path = cleanParts.join(\".\");\n }\n if (path !== pathIn) {\n debug(`Cleaned up path: ${path}.`);\n }\n return path;\n }\n function setStatsDKey(req, hostname, env) {\n let method = req.method || \"unknown_method\";\n method = method.toLowerCase();\n const defaultBase = \"http://localhost\";\n const urlItem = new url_1.URL(req.url, defaultBase);\n let path = urlItem.pathname.toLowerCase();\n path = path.replace(/\\//g, \" \").trim().replace(/\\s/g, \".\");\n let filterFunc = defaultFilter;\n if (lodash_1.default.isFunction(filter)) {\n filterFunc = filter;\n }\n const filteredPath = filterFunc(path);\n req.statsdKey = [\n hostname,\n env,\n \"http\",\n method,\n filteredPath\n ].join(\".\");\n debug(`req.statsdKey: ${req.statsdKey}`);\n }\n function statsd() {\n return function statsdFunc(req, res, next) {\n const hostname = process.env.NODE_STATSD_PREFIX || os_1.default.hostname();\n const env = process.env.NODE_ENV || \"production\";\n setStatsDKey(req, hostname, env);\n monitorRequest(req, res);\n return next();\n };\n }\n return {\n defaultFilter,\n setStatsDKey,\n statsd,\n };\n}", "title": "" }, { "docid": "02c0c97cd0c1bf1d3ad6e0b4d368a35d", "score": "0.49706227", "text": "function printHits() {\n printHitsPerCountry()\n printHitsPerAddress()\n printHitsPerISP()\n printHitsPerCity()\n printHitsPerReserve()\n}", "title": "" }, { "docid": "0337a74804054928adc0925778684b01", "score": "0.49641395", "text": "function gotData2(humanitarian) {\n dataTypeHum = humanitarian.data[j].primary_type; //The index variabel J randomies the natural disaster.\n inCountries = humanitarian.data[j].operation[0].label; //This is country information of where the disaster happened\n\n //This boolean tells the word-processing function that the API data is ready for manipulation.\n humRdy = true;\n}", "title": "" }, { "docid": "c712956b4b3520803c9c8894ad068b30", "score": "0.49622992", "text": "function getData1() {\n return statistics.infected;\n}", "title": "" }, { "docid": "d60f0cf8f8d99bc567966e91cf665664", "score": "0.49564368", "text": "weight() { return this._coffs[15]; }", "title": "" }, { "docid": "e2f3c75b1df75e8df06fb1f3cb647712", "score": "0.4942391", "text": "function getData3() {\n return statistics.avgInfected;\n}", "title": "" }, { "docid": "9fe45c38b0e1b88625b2679bb196cfb6", "score": "0.49376735", "text": "function getWetherData(cityName) {\n const apiKey = '98062c4f5a1da34f50763d62f0d1d006';//api key for open-weather-map website\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${cityName}&appid=${apiKey}`)\n .then(res => {\n return res.json()\n })\n .then(data => {\n display(data);\n })\n .catch(err => {\n getId('city-name').innerText = `The ${cityName} City not Fount!`;\n getId('city-temp').innerText = '';\n getId('city-weather').innerText = '';\n getId('weather-icon').src = '';\n })\n}", "title": "" }, { "docid": "4e9e1a85b74df3f7336abf70cfc89d98", "score": "0.49288848", "text": "async function getWeatherAW(woeid) {\n try {\n const result = await fetch(\n `http://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}`\n );\n const data = await result.json();\n const tomorrow = data.consolidated_weather[1];\n console.log(\n `Temperatures tomorrow in ${\n data.title\n } stay between ${tomorrow.min_temp.toFixed(\n 2\n )} and ${tomorrow.max_temp.toFixed(2)}.`\n );\n return data;\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "eb1cd22021a34890632e9845ddedf2d2", "score": "0.49155322", "text": "function getWeatherStations () {\n var layerURL = 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/palm_springs_wind_turbines/FeatureServer/0'\n var queryTask = new QueryTask({\n url: layerURL\n })\n\n var query = new Query()\n query.returnGeometry = true\n query.outFields = ['tower_h', 'blade_l', 'POINT_Z']\n query.where = 'tower_h > 0'\n query.outSpatialReference = inputSR\n\n return queryTask.execute(query)\n .then(function (results) {\n return results.features\n })\n }", "title": "" }, { "docid": "36f176dfa53372c02276305b16951ad3", "score": "0.49073967", "text": "function displayResults (weather) {\n \n // Get City Element from DOM\n let city = document.querySelector('.location .city');\n // Assign Value for City from Data \n city.innerText = `${weather.name}, ${weather.sys.country}`;\n\n // Retrieve Present Date Value\n let now = new Date();\n // Get Date Element from DOM\n let date = document.querySelector('.location .date');\n // Call dateBuilder Function to Generate Current Date\n date.innerText = dateBuilder(now);\n\n // Get Temp Element\n let temp = document.querySelector('.current .temp');\n // Display Temp Data and append 'ºC'\n temp.innerHTML = `${Math.round(weather.main.temp).toFixed(0)}<span>°c</span>`\n \n // Get Weather Element\n let weather_el = document.querySelector('.current .weather');\n // Display Weather Data (Sunny, Cloudy etc.)\n weather_el.innerText = weather.weather[0].main;\n\n // Get Hi-Low Element\n let hilow = document.querySelector('.hi-low');\n // Display Hi-Low Data and append 'ºC'\n hilow.innerText = `${Math.round(weather.main.temp_min)}°c / ${Math.round(weather.main.temp_max)}°c`;\n}", "title": "" }, { "docid": "318193d02262ac58661514f8ddcbb39d", "score": "0.49063584", "text": "function showWeatherInformation(info) {\n const temperature = document.getElementById(\"temperature\");\n const wind = document.getElementById(\"wind\");\n const humidity = document.getElementById(\"humidity\");\n const uvIndex = document.getElementById(\"uvIndex\");\n const unit = units == \"imperial\" ? \"F\" : \"C\";\n\n formatUVIndex(info.current.uvi);\n\n temperature.textContent = `Temperature: ${info.current.temp} ${unit}`;\n wind.textContent = `Wind: ${info.current.wind_speed} ${\n unit === \"F\" ? \"MPH\" : \"KMH\"\n }`;\n humidity.textContent = `Humidity: ${info.current.humidity}%`;\n uvIndex.innerHTML = formatUVIndex(info.current.uvi);\n\n showDailyForecast(info.daily);\n}", "title": "" }, { "docid": "25eee2b0d91e1e497a89360d10c02006", "score": "0.49015498", "text": "function getWeather(query){\n fetch(`https://api.openweathermap.org/data/2.5/weather?q=${query}&appid=${key}`)\n .then(response => response.json())\n .then(displayWeather)\n}", "title": "" }, { "docid": "8cc8c87facc0657ffb0708fb845bbb7d", "score": "0.48895124", "text": "function getWeather(location) {\n let query = encodeURIComponent( weatherQuery.replace('@LOCATION@',location) );\n let url = `${yqlURL}&q=${query}`;\n console.log('About to fetch weather: ', url);\n return fetch( url )\n .then( d => d.json() )\n .then( d => {\n return d;\n } )\n .catch( e => {\n console.error('We received an error and stuff: %s', e.stack );\n } )\n}", "title": "" }, { "docid": "f92004547fd13f40b077e1045ed64bc7", "score": "0.488625", "text": "function getBasicSystemInfo() {\n currentTheaters = new Array(4).fill(sampleTheater);\n currentMovies = new Array(4).fill(sampleMovie);\n currentOrders = new Array(4).fill(sampleOrder);\n currentOrderCount = 100;\n allTheaters = [\n {\n id: 1,\n name: \"Nigamon Nguyen Van Cu\"\n },\n {\n id: 2,\n name: \"Nigamon Quang Trung\"\n },\n {\n id: 3,\n name: \"Nigamon Nguyen Van Qua\"\n }\n ];\n lastLoginDate = new Date(\"2019/04/02\");\n}", "title": "" }, { "docid": "f3271d271e90b07a1ee3c5dae63e66af", "score": "0.48845792", "text": "function findView() {\n getMetrics(\"000\");\n }", "title": "" }, { "docid": "7e595fb3727c9be9fbb5b31d558cd281", "score": "0.48750022", "text": "stats() {\n\t var stats = {};\n\t for (var queryName in this._queries) {\n\t stats[queryName] = this._queries[queryName].stats();\n\t }\n\t return stats;\n\t }", "title": "" }, { "docid": "3ca80276bd09b7ab10259a5cd09a8579", "score": "0.48598883", "text": "renderBrief(locationData) {\n\n let locationName = locationData.city.name;\n let locationId = locationData.city.id;\n\n // array to map forecast at noon for each location\n const forecastArr = locationData.list.filter( function(item, index) {\n let time = item.dt_txt.slice(11);\n const noon = \"12:00:00\"\n if (time === noon) {\n return locationData.list[index];\n }\n });\n\n function displayIcon(weatherId) {\n if (weatherId >= 200 && weatherId < 300) {\n return ( <i className=\"wi wi-day-thunderstorm\"></i> );\n } else if (weatherId >= 300 && weatherId < 400) {\n return ( <i className=\"wi wi-day-sprinkle\"></i> );\n } else if (weatherId >= 500 && weatherId < 600) {\n return ( <i className=\"wi wi-rain\"></i> );\n } else if (weatherId >= 600 && weatherId < 700) {\n return ( <i className=\"wi wi-day-snow\"></i> );\n } else if (weatherId >= 700 && weatherId < 800) {\n return ( <i className=\"wi wi-day-fog\"></i> );\n } else if (weatherId === 800 || (weatherId >= 951 && weatherId <= 953)) {\n return ( <i className=\"wi wi-day-sunny\"></i> );\n } else if (weatherId >= 800 && weatherId < 810) {\n return ( <i className=\"wi wi-cloudy\"></i> );\n } else if (weatherId >= 900 && weatherId < 910) {\n return ( <i className=\"wi wi-storm-warning\"></i> );\n } else if (weatherId >= 954 && weatherId <= 959) {\n return ( <i className=\"wi wi-strong-wind\"></i> );\n } else if (weatherId >= 960 && weatherId < 962) {\n return ( <i className=\"wi wi-thunderstorm\"></i> );\n } else if (weatherId === 962) {\n return ( <i className=\"wi wi-hurricane\"></i> );\n }\n }\n\n // converting timestamp to weekday\n function weekDayFunction (date) {\n const weekDay = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n let dateNo = new Date(date.slice(0, 10));\n return weekDay[dateNo.getDay()];\n }\n \n function weekDateFunction (date) {\n let day = date.slice(8,10);\n let month = date.slice(5, 7);\n return (day + \"/\" + month);\n }\n \n function nameShorten (name) {\n if (name.length > 11) {\n let rename = name.slice(0, 11);\n return rename + \"...\";\n } else return name;\n }\n\n return (\n <div key={locationId} className=\"briefItem\">\n <div className=\"cityName\">\n <div>\n {nameShorten(locationName)}\n </div>\n </div>\n <button\n value={locationId}\n className=\"btn btn-danger btn-xs\"\n onClick={this.handleClick}\n >X</button>\n {forecastArr.map(function(day){\n return (\n <div key={day.dt_txt} className=\"forecastItem\">\n <div className=\"dayDate\">\n {weekDayFunction(day.dt_txt)}\n </div>\n <div className=\"dateDate\">\n {weekDateFunction(day.dt_txt)}\n </div>\n <div className=\"icon\">\n {displayIcon(day.weather[0].id)}\n </div>\n <div className=\"temp\">\n {Math.round(day.main.temp)} &#8451;\n </div>\n <div className=\"des\"> \n {day.weather[0].description}\n </div>\n </div>\n );\n })}\n </div>\n );\n }", "title": "" }, { "docid": "ffb43d5d91fc3e0e379359a761745740", "score": "0.48570508", "text": "function getInfo(){}", "title": "" }, { "docid": "f761e856cc7cb0cd2b9f1af2290b7a9f", "score": "0.4852139", "text": "function displayResults(weather){\nlet city = document.querySelector('.location .city');\ncity.innerHTML = `${weather.name}, ${weather.sys.country}`;\n\nlet now = new Date();\nlet date =document.querySelector('.location .date');\ndate.innerHTML = lib.dateBuilder(now); \n}", "title": "" }, { "docid": "ddd1257a2868da727887757292833672", "score": "0.4851534", "text": "function dailyForecastMetric(response) {\n let key = \"1e900e7a532291ddab0851fd797f7887\";\n let dailyForcastUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${response.lat}&lon=${response.lon}&exclude=minutely&appid=${key}&units=metric`;\n axios.get(dailyForcastUrl).then(displayForecast);\n\n feellikeunit = document.querySelector(\".feel-unit\");\n feellikeunit.innerHTML = `°C`;\n}", "title": "" }, { "docid": "5ecc776615452eba28a4aec0de3d4afd", "score": "0.48408818", "text": "function getPopularDestinations(city) {\n const popularDestQuery = 'http://www-uat.tictactrip.eu/api/cities/popular/from/' + city + '/5'\n callAPI(popularDestQuery);\n}", "title": "" }, { "docid": "78ae3cde700f3316d2cc03ba11c550cf", "score": "0.48389816", "text": "function getWeatherAPIs(location){\n var city = location[0];\n var countryCode = location[1];\n getCurrentWeather(city, countryCode);\n getForecast(city, countryCode);\n}", "title": "" }, { "docid": "a791955e3f6a08e9e998c89e70611d5c", "score": "0.48345166", "text": "stats() {\n var stats = {};\n for (var queryName in this._queries) {\n stats[queryName] = this._queries[queryName].stats();\n }\n return stats;\n }", "title": "" }, { "docid": "d05cdd77ea7027c649a59bdc7d1248a5", "score": "0.48282537", "text": "function getData2() {\n return statistics.customers;\n}", "title": "" }, { "docid": "8f99a29476ff7b8b4ce16c19db316e70", "score": "0.48160702", "text": "function getApiDataMetric(inputCity) {\n let apiKey = \"10a81d6318c2a72a6e26b0c6227d2fa9\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${inputCity}&appid=${apiKey}&units=metric`; // the inputCity.value is the city user types in\n axios.get(apiUrl).then(showTemperature);\n}", "title": "" }, { "docid": "d85e2795341da347126c5606da26639b", "score": "0.4807645", "text": "async getMeteoInformations(location) {\n if (location) {\n const {coords: {latitude, longitude}} = location;\n const lat = Math.floor(latitude);\n const lon = Math.floor(longitude);\n\n console.log(location);\n\n const response = await requestGet('weather', `lat=${lat}&lon=${lon}`);\n if (response) {\n this.setInformations(response);\n\n }\n }\n }", "title": "" }, { "docid": "ba2815bfcb8705f94ce242703ce625d7", "score": "0.48061338", "text": "function getWeather(woeid) {\n // envia uma pedido com as informações do clima do woeid escolhido\n weatherUi.insertAdjacentHTML('afterbegin', loader);\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\n .then(data => {\n\n data.json()\n .then(weatherData => {\n dataTreatment(weatherData)\n // console.log(weatherData); \n\n })\n });\n}", "title": "" }, { "docid": "dd9198efcaa9002dc68797e905ff6f8e", "score": "0.48055786", "text": "get towers () {\n if (this._cache.towers !== undefined) {\n return this._cache.towers;\n }\n this._cache.towers = this.recall(STRUCTURE_TOWER);\n if (this._cache.towers.length > 1) {\n this._cache.towers.sort((a, b) => a.energy - b.energy);\n }\n return this._cache.towers;\n }", "title": "" }, { "docid": "fe744617b4749a2751911c89f8700e70", "score": "0.4803921", "text": "function getWeather () {\r\n const darkskyData = require('./data/darksky.json');\r\n console.log('does darksky work', darkskyData);\r\n const weatherSummaries = darkskyData.daily.data.map(day => new Weather(day));\r\n console.log(weatherSummaries);\r\n return weatherSummaries;\r\n\r\n // darkskyData.daily.data.forEach(day => {\r\n // weatherSummaries.push(new Weather(day));\r\n // });\r\n // return weatherSummaries;\r\n}", "title": "" }, { "docid": "60444e710166ecd2a7fc930467fd8440", "score": "0.48007774", "text": "function showLondonWeather(event) {\n let city = \"london\";\n getWeatherData(city); \n}", "title": "" }, { "docid": "30d9cb69d06ce6efc6a27b97298a817c", "score": "0.48003486", "text": "render() {\n return (\n <div>\n {/* {this.weatherQuery()} */}\n </div>\n );\n }", "title": "" }, { "docid": "442d628a00f7b3ec325232c6e3f05754", "score": "0.47957894", "text": "function showCurrentTemperature(city, unit) {\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=${unit}&appid=${apiKey}`;\n\n axios.get(apiUrl).then(showTemperature);\n}", "title": "" }, { "docid": "8041111eb0d3c7019ebf18d90b3da2ff", "score": "0.47890443", "text": "function getTrending(){\r\n const url = `https://api.themoviedb.org/3/trending/movie/week?api_key=${tmdbApi}`\r\n fetch(url)\r\n .then(response => response.json())\r\n .then(responseJson => displaySearch(responseJson))\r\n .catch(err => {\r\n $('.ul-results').text(`Something went wrong: ${err.message}`)\r\n });\r\n}", "title": "" }, { "docid": "085ed98d72d305a72411cd8b940794ac", "score": "0.47876644", "text": "renderForecastedWeather() {\n if (this.props.forecast.daily && this.props.location) {\n const data = this.props.forecast.daily.data.slice(0, 5);\n const { city, country } = this.props.location;\n return data.map(weather => (\n <div className=\"forecast-list-item\" key={weather.time}>\n <ForecastHeader weather={weather} />\n <ForecastContent maxTemp={weather.temperatureMax} minTemp={weather.temperatureMin} />\n <ForecastFooter city={city} country={country} />\n </div>\n ));\n }\n }", "title": "" }, { "docid": "eaf47bf464baa716f0a2ac1adf0a29fd", "score": "0.47851723", "text": "function displayResults(locations) {\n\n\t\t//Assigning variable to raw weather description\n\t\tconst currentTemp = locations.main.temp\n\t\tconst rawDescription = locations.weather[0].description\n\n\t\t//Assigning variable converted weather description to proper case string\n\t\tconst weatherDescription = rawDescription.toLowerCase().split(' ').map((s) => s.charAt(0).toUpperCase() + s.substring(1)).join(' ')\n\n\t\t//Updating HTML with city weather information\n\t\tconst htmlRow = (\n\t\t\t`\n\t\t\t<h3>${locations.name}</h3>\n\t\t\t<p class=\"current-temp\"><img class=\"weather-icon\" src=\"http://openweathermap.org/img/wn/${locations.weather[0].icon}.png\" />Current Temperature: ${Math.floor(locations.main.temp)}&#8457;</p>\n\t\t\t<p>Weather Description: ${weatherDescription}</p>\n\t\t\t<p>Min. Temperature: ${Math.floor(locations.main.temp_min)}&#8457;</p>\n\t\t\t<p>Max. Temperature: ${Math.floor(locations.main.temp_max)}&#8457;</p>\n\t\t\t`\n\t\t)\n\n\t\t$('.weather-results').append(htmlRow)\n\n\t\t//Calling temperature color function\n\t\ttempColor(currentTemp)\n\t}", "title": "" }, { "docid": "e2b15268906725675c15cef473597184", "score": "0.4785047", "text": "function searchWeather(request, response) {\r\n const lat = request.query.data.latitude;\r\n const long = request.query.data.longitude;\r\n const url = `https://api.darksky.net/forecast/${process.env.WEATHER_API_KEY}/${lat},${long}`;\r\n\r\n const locationID = request.query.data.id;\r\n // database of information\r\n dbQuery('location_id', locationID, 'weathers', url, noWeather)\r\n .then(weatherData => {\r\n response.send(weatherData);\r\n })\r\n .catch(e => {\r\n responseError(e);\r\n });\r\n}", "title": "" }, { "docid": "d858c2c8a5b1c7efaf37907ceaa5fb3a", "score": "0.4783698", "text": "function getMetricStatistics(awskey, secret, host, namespace, op) {\n var qs = baseQS( awskey\n , 'GetMetricStatistics'\n , ISODateString(new Date())\n , namespace)\n\n // TODO throw if missing values\n\n qs.MetricName = op.name\n qs.StartTime = op.start\n qs.EndTime = op.end\n qs.Unit = op.unit\n qs.Period = op.period // in sec, must be multiple of 60\n\n op.statistics.forEach(function addStat(stat, i) {\n // Statistics are not zero indexed\n i += 1\n qs['Statistics.member.' + i] = stat\n })\n\n if (op.dimensions) {\n Object.keys(op.dimensions)\n .forEach(function addDimensions(key, i) {\n // Dimensions are not 0 indexed\n i += 1\n qs['Dimensions.member.' + i\n + '.Name'] = key\n qs['Dimensions.member.' + i\n + '.Value'] = op.dimensions[key]\n })\n }\n\n qs.Signature = signature('GET', host, qs, secret)\n\n return qs\n}", "title": "" }, { "docid": "27b356c37f4a50039bec833bc5cbedc2", "score": "0.47806528", "text": "async index ({ request }) {\n const { latitude, longitude } = request.all()\n\n const washes = Wash.query()\n .nearBy(latitude, longitude, 10)\n .fetch()\n\n return washes\n }", "title": "" }, { "docid": "48e94e618ae728e0dc24ab75972ef78e", "score": "0.4777085", "text": "function smhiWeather(e,a,t){\n// Function for finding the object contaning the\n// weather information for current hour and return\n// it to the variable weatherNow.\nfunction s(e,a,t){var i=[];for(var r in e)e.hasOwnProperty(r)&&(\"object\"==_typeof(e[r])?i=i.concat(s(e[r],a,t)):r==a&&e[a]==t&&i.push(e));return i}var i=fullDate(a),r=s(e.timeSeries,\"validTime\",i),c=e.timeSeries.indexOf(r[0]),n=(function(a){for(var t=e.timeSeries,s=c+1,i=c+2,r=c+3,n=c+4,o=c+5,h=c+6,m=c+7,g=c+8,l=c+9,d=c+10,u=void 0,b=0,p=(new Date).getHours(),v=c;v<c+10||10==c;v++){if(u=t[v].parameters[18].values[0],b++,0==p||1==p||2==p||3==p||4==p||22==p||23==p)\n// Night\nswitch(u){case 1:u='<div>Klart</div><img class=\"forecast-icon\" src=\"images/weathericons/moon-b.png\"/>';break;case 2:u='<div>Mest klart</div><img class=\"forecast-icon\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/>';break;case 3:u='<div>Växlande molnighet</div><img class=\"forecast-icon\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/>';break;case 4:u='<div>Halvklart</div><img class=\"forecast-icon\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/>';break;case 5:u='<div>Målnigt</div><img class=\"forecast-icon\" src=\"images/weathericons/cloud-b.png\"/>';break;case 6:u='<div>Mulet</div><img class=\"forecast-icon\" src=\"images/weathericons/overcast-b.png\"/>';break;case 7:u='<div>Dimma</div><img class=\"forecast-icon\" src=\"images/weathericons/fog-b.png\"/>';break;case 8:u='<div>Regnskurar</div><img class=\"forecast-icon\" src=\"images/weathericons/rain-b.png\"/>';break;case 9:u='<div>Åskskurar</div><img class=\"forecast-icon\" src=\"images/weathericons/thunder-b.png\"/>';break;case 10:u='<div>Byar av snöblandat regn</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 11:u='<div>Snöbyar</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 12:u='<div>Regn</div><img class=\"forecast-icon\" src=\"images/weathericons/rain-b.png\"/>';break;case 13:u='<div>Åska</div><img class=\"forecast-icon\" src=\"images/weathericons/thunder-b.png\"/>';break;case 14:u='<div>Snöblandat regn</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 15:u='<div>Snöfall</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>'}else\n// Day\nswitch(u){case 1:u='<div>Klart</div><img class=\"forecast-icon\" src=\"images/weathericons/sun-b.png\"/>';break;case 2:u='<div>Mest klart</div><img class=\"forecast-icon\" src=\"images/weathericons/nearly-clear-sky-b.png\"/>';break;case 3:u='<div>Växlande molnighet</div><img class=\"forecast-icon\" src=\"images/weathericons/cloud-b.png\"/>';break;case 4:u='<div>Halvklart</div><img class=\"forecast-icon\" src=\"images/weathericons/slightly-cloudy-b.png\"/>';break;case 5:u='<div>Målnigt</div><img class=\"forecast-icon\" src=\"images/weathericons/cloud-b.png\"/>';break;case 6:u='<div>Mulet</div><img class=\"forecast-icon\" src=\"images/weathericons/overcast-b.png\"/>';break;case 7:u='<div>Dimma</div><img class=\"forecast-icon\" src=\"images/weathericons/fog-b.png\"/>';break;case 8:u='<div>Regnskurar</div><img class=\"forecast-icon\" src=\"images/weathericons/rain-b.png\"/>';break;case 9:u='<div>Åskskurar</div><img class=\"forecast-icon\" src=\"images/weathericons/thunder-b.png\"/>';break;case 10:u='<div>Byar av snöblandat regn</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 11:u='<div>Snöbyar</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 12:u='<div>Regn</div><img class=\"forecast-icon\" src=\"images/weathericons/rain-b.png\"/>';break;case 13:u='<div>Åska</div><img class=\"forecast-icon\" src=\"images/weathericons/thunder-b.png\"/>';break;case 14:u='<div>Snöblandat regn</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>';break;case 15:u='<div>Snöfall</div><img class=\"forecast-icon\" src=\"images/weathericons/snow-b.png\"/>'}// End else\n$(\".forecast-weather-\"+b).html(u)}// End for loop\n$(\".forecast-time-1\").html(t[s].validTime.slice(11,16)),$(\".forecast-temp-1\").html(Math.round(t[s].parameters[1].values[0])+\"°\"),$(\".forecast-time-2\").html(t[i].validTime.slice(11,16)),$(\".forecast-temp-2\").html(Math.round(t[i].parameters[1].values[0])+\"°\"),$(\".forecast-time-3\").html(t[r].validTime.slice(11,16)),$(\".forecast-temp-3\").html(Math.round(t[r].parameters[1].values[0])+\"°\"),$(\".forecast-time-4\").html(t[n].validTime.slice(11,16)),$(\".forecast-temp-4\").html(Math.round(t[n].parameters[1].values[0])+\"°\"),$(\".forecast-time-5\").html(t[o].validTime.slice(11,16)),$(\".forecast-temp-5\").html(Math.round(t[o].parameters[1].values[0])+\"°\"),$(\".forecast-time-6\").html(t[h].validTime.slice(11,16)),$(\".forecast-temp-6\").html(Math.round(t[h].parameters[1].values[0])+\"°\"),$(\".forecast-time-7\").html(t[m].validTime.slice(11,16)),$(\".forecast-temp-7\").html(Math.round(t[m].parameters[1].values[0])+\"°\"),$(\".forecast-time-8\").html(t[g].validTime.slice(11,16)),$(\".forecast-temp-8\").html(Math.round(t[g].parameters[1].values[0])+\"°\"),$(\".forecast-time-9\").html(t[l].validTime.slice(11,16)),$(\".forecast-temp-9\").html(Math.round(t[l].parameters[1].values[0])+\"°\"),$(\".forecast-time-10\").html(t[d].validTime.slice(11,16)),$(\".forecast-temp-10\").html(Math.round(t[d].parameters[1].values[0])+\"°\")}(t),r[0].parameters[18].values[0]),o=(new Date).getHours();\n// If it's night it displays different icons in the switch statement\nif(0==o||1==o||2==o||3==o||4==o||22==o||23==o)\n// Night\nswitch(n){case 1:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/moon-b.png\"/><h3 id=\"theWeather\">Klart</h3>');break;case 2:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/><h3 id=\"theWeather\">Mest klart</h3>');break;case 3:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/><h3 id=\"theWeather\">Växlande molnighet</h3>');break;case 4:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-night-b.png\"/><h3 id=\"theWeather\">Halvklart</h3>');break;case 5:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-b.png\"/><h3 id=\"theWeather\">Målnigt</h3>');break;case 6:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/overcast-b.png\"/><h3 id=\"theWeather\">Mulet</h3>');break;case 7:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/fog-b.png\"/><h3 id=\"theWeather\">Dimma</h3>');break;case 8:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/rain-b.png\"/><h3 id=\"theWeather\">Regnskurar</h3>');break;case 9:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/thunder-b.png\"/><h3 id=\"theWeather\">Åskskurar</h3>');break;case 10:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Byar av snöblandat regn</h3>');break;case 11:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöbyar</h3>');break;case 12:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/rain-b.png\"/><h3 id=\"theWeather\">Regn</h3>');break;case 13:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/thunder-b.png\"/><h3 id=\"theWeather\">Åska</h3>');break;case 14:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöblandat regn</h3>');break;case 15:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöfall</h3>')}else\n// Day\nswitch(n){case 1:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/sun-b.png\"/><h3 id=\"theWeather\">Klart</h3>');break;case 2:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/nearly-clear-sky-b.png\"/><h3 id=\"theWeather\">Mest klart</h3>');break;case 3:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/nearly-clear-sky-b.png\"/><h3 id=\"theWeather\">Växlande molnighet</h3>');break;case 4:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-b.png\"/><h3 id=\"theWeather\">Halvklart</h3>');break;case 5:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/slightly-cloudy-b.png\"/><h3 id=\"theWeather\">Målnigt</h3>');break;case 6:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/overcast-b.png\"/><h3 id=\"theWeather\">Mulet</h3>');break;case 7:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/fog-b.png\"/><h3 id=\"theWeather\">Dimma</h3>');break;case 8:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/rain-b.png\"/><h3 id=\"theWeather\">Regnskurar</h3>');break;case 9:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/thunder-b.png\"/><h3 id=\"theWeather\">Åskskurar</h3>');break;case 10:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Byar av snöblandat regn</h3>');break;case 11:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöbyar</h3>');break;case 12:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/rain-b.png\"/><h3 id=\"theWeather\">Regn</h3>');break;case 13:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/thunder-b.png\"/><h3 id=\"theWeather\">Åska</h3>');break;case 14:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöblandat regn</h3>');break;case 15:$(\"#theDiv\").html('<img id=\"theImg\" src=\"images/weathericons/snow-b.png\"/><h3 id=\"theWeather\">Snöfall</h3>')}// End else\nreturn $(\"#temp-now\").html(\" \"+Math.round(r[0].parameters[1].values[0])+\"°\")+$(\"#weather-wind\").html(\"Vindhastighet: \"+r[0].parameters[11].values[0]+\" \"+r[0].parameters[11].unit)+$(\"#weather-pressure\").html(\"Lufttryck: \"+r[0].parameters[0].values[0]+\" \"+r[0].parameters[0].unit)+$(\"#symbol\").html(\"Symbol: \"+r[0].parameters[18].values[0])}// End smhiWeather", "title": "" }, { "docid": "80f9d6b62d9c7d72a4be9a33bbfac35e", "score": "0.47738522", "text": "function showLiveElevations() {\n\tvar viewHeater = new Heater(atlas.map);\n\n\tviewHeater.addLocationsInView();\n\t\n\tviewHeater.recursiveElevGetter(0);\n}", "title": "" }, { "docid": "8ac713a43065db593457d26cafaa228e", "score": "0.47735834", "text": "function getFarenheits(result){\n // Your code goes here\n temps = [];\n for (var i=0; i<result.hourly_forecast.length; i++) {\n temps.push(result.hourly_forecast[i].temp.english);\n }\n return temps;\n}", "title": "" }, { "docid": "d0a67b7a1bc47186f489d925544c135a", "score": "0.47649807", "text": "function getCityWeek() {\n\t\tif (this.status != 200) {\n\t\t\terror(this.status, this.responseText);\n\t\t} else if (this.status == 200) {\n\t\t\tvar data = JSON.parse(this.responseText);\n\t\t\tdocument.getElementById(\"weatherimage\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"weektemps\").innerHTML = \"\";\n\t\t\tfor (var i = 0; i < data.weather.length; i++) {\n\t\t\t\tvar imageBlock = document.createElement(\"td\");\n\t\t\t\tvar image = document.createElement(\"img\");\n\t\t\t\timage.src = \"https://openweathermap.org/img/w/\" + data.weather[i].icon + \".png\";\n\t\t\t\timageBlock.appendChild(image);\n\t\t\t\tdocument.getElementById(\"weatherimage\").appendChild(imageBlock);\n\t\t\t\tvar temp = document.createElement(\"td\");\n\t\t\t\ttemp.innerHTML = Math.round(data.weather[i].temperature) + \"&#176;\";\n\t\t\t\tdocument.getElementById(\"weektemps\").appendChild(temp);\n\t\t\t}\n\t\t\tchangeVisible(true);\n\t\t}\n\t\tloaders(false);\n\t}", "title": "" }, { "docid": "89f1fab67783f5166a51037c89822dcf", "score": "0.4761417", "text": "function showWeather(city) {\n\tfetch('https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=e58f5d3306895d50f6392ff5f57595de&units=metric')\n\t\t.then(response => response.json())\n\t\t.then(weatherData => renderWeather(weatherData));\n}", "title": "" }, { "docid": "3d38dac44e34cca095e1375f699c564b", "score": "0.47562292", "text": "function getWeather() {\n $.ajax({url: \"https://api.wunderground.com/api/\" + weatherKey + \"/geolookup/q/\" + userLat + \",\" + userLong + \".json\", method: \"GET\"}).done(function(response) {\n $.ajax({url: \"https://api.wunderground.com/api/\" + weatherKey + \"/conditions/q/\" + response.location.state + \"/\" + response.location.city + \".json\", method: \"GET\"}).done(function(response) {\n weather = response.current_observation.weather;\n currentWeather = response.current_observation.temperature_string;\n humidity = response.current_observation.relative_humidity;\n });\n });\n}", "title": "" }, { "docid": "941a40ea413ded40319919d2f411453c", "score": "0.47518563", "text": "function getWeather(query) {\n const url = `https://api.darksky.net/forecast/${process.env.DARKSKY_API_KEY}/${query.latitude},${query.longitude}`;\n return superagent.get(url)\n .then(data => {\n let weather = data.body;\n return weather.daily.data.map((day) => {\n return new Weather(day);\n });\n });\n}", "title": "" }, { "docid": "75fd38960e0d6ce32b0cd6b98c55389f", "score": "0.47488767", "text": "function _getWeatherData( search ) {\n return $.get(\n WEATHER_API.url_base + WEATHER_API.version + WEATHER_API.endpoint,\n { q: search }\n );\n } // _getWeatherData", "title": "" }, { "docid": "1591a61fb1353327906f77cdc5c77e26", "score": "0.47486058", "text": "async getWeatherByDevice() {\n try {\n this.changeStateProgress(true);\n var WeatherStatusResponse = await HMSAwarenessCaptureModule.getWeatherByDevice();\n this.changeStateProgress(false);\n alert(JSON.stringify(WeatherStatusResponse));\n } catch (e) {\n this.changeStateProgress(false);\n alert(JSON.stringify(e));\n }\n }", "title": "" }, { "docid": "d2afc7912b578ef4c71bfa47d31ea691", "score": "0.4744628", "text": "function displayWeatherInfo() {\n\t\tvar queryURL_Current =\n\t\t\t'https://api.openweathermap.org/data/2.5/weather?q=' +\n\t\t\tinputLoc +\n\t\t\t'&units=imperial&appid=' +\n\t\t\tapiKey;\n\t\t$.ajax({\n\t\t\turl: queryURL_Current,\n\t\t\tmethod: 'GET'\n\t\t}).then(function (responseCurrent) {\n\t\t\tvar cityName = responseCurrent.name;\n\t\t\tvar icon = responseCurrent.weather[0].icon;\n\t\t\tvar iconUrl = 'http://openweathermap.org/img/w/' + icon + '.png';\n\t\t\tvar temp = Math.floor(responseCurrent.main.temp);\n\t\t\tvar Humidity = responseCurrent.main.humidity;\n\t\t\tvar windSpeed = Math.floor(responseCurrent.wind.speed);\n\t\t\t$('#currentConditions1').append(\"<h4 id='h4CityName'>\" + cityName);\n\t\t\t$('#h4CityName').append(\"<img id='wicon' src='' alt='Weather Icon'>\");\n\t\t\t$('#wicon').attr('src', iconUrl);\n\t\t\t$('#currentConditions1').append('<h5>' + time);\n\t\t\t$('#currentConditions1').append('<p>Temperature: ' + temp + '&#8457;');\n\t\t\t$('#currentConditions1').append('<p>Humidity: ' + Humidity + '%');\n\t\t\t$('#currentConditions1').append('<p>Wind Speed: ' + windSpeed + ' MPH');\n\t\t});\n\t}", "title": "" }, { "docid": "b1d92a19bd3462623dc82d111fb81e98", "score": "0.47431764", "text": "async getWeather(loc){\r\n const resp = await fetch(`https://api.openweathermap.org/data/2.5/find?q=${loc.city},${loc.country}&units=metric&appid=${this.appId}`);\r\n const respData = await resp.json();\r\n return respData;\r\n }", "title": "" }, { "docid": "c28ec7e45db2f8279463a338b649f56b", "score": "0.4742665", "text": "function getResults() {\n $http.get('//api.openweathermap.org/data/2.5/weather?q=' + vm.city + ',us&APPID=d1c49eebfc9bbde32c1a506c3f1817db').then(function(result) {\n vm.result = result;\n });\n }", "title": "" }, { "docid": "fe2e29cedd3cd317bc416f1f0ab24416", "score": "0.47425288", "text": "function getCurrentWeather(searchValue) {\n var queryUrl =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n searchValue +\n \"&units=imperial&appid=\" +\n apiKey;\n\n fetch(queryUrl)\n .then(function (res) {\n return res.json();\n })\n .then(function (data) {\n console.log(data);\n\n // Query Selectors and span created\n var cityName = document.querySelector(\"#city-name\");\n var temp = document.querySelector(\"#temp\");\n var wind = document.querySelector(\"#wind\");\n var humidity = document.querySelector(\"#humidity\");\n var statusEl = document.createElement(\"span\");\n\n //Created to use for eather conditions based off dictionary\n var descriptionKey = data.weather[0].main.toLowerCase();\n var descriptionValueClass = weatherKeys[descriptionKey];\n\n //set the inital values of the current weather display\n cityName.innerHTML = \"\";\n statusEl.innerHTML = \"\";\n temp.innerHTML = \"Temp: \";\n wind.innerHTML = \"Wind: \";\n humidity.innerHTML = \"Humidity: \";\n\n statusEl.innerHTML =\n \" \" + '<i class=\"' + descriptionValueClass + '\"></i>';\n\n //Append current weather data to the page\n cityName.append(data.name + \" \" + \"(\" + today + \")\");\n cityName.append(statusEl);\n temp.append(data.main.temp + \"\\u00B0F\");\n wind.append(data.wind.speed + \" MPH\");\n humidity.append(data.main.humidity + \"%\");\n });\n\n //Send the search value to the getUVIndex function\n getUvIndex(searchValue);\n}", "title": "" }, { "docid": "45284b346178bbef4be144cf42a587b3", "score": "0.47405526", "text": "function getWeather(callback) {\n\tvar request = require(\"request\");\n\trequest.get(\"https://www.metaweather.com/api/location/4118/\", function(error, response) {\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(response.body);\n\t\t\tvar data = JSON.parse(response.body);\n\t\t\tvar weather = data.consolidated_weather[0];\n\t\t\tcallback(\n\t\t\t\t`Currently the forecast is ${weather.weather_state_name} with winds blowing ${\n\t\t\t\t\tweather.wind_direction_compass\n\t\t\t\t} at ${Math.round(weather.wind_speed)} km/h... Currently it is ${Math.round(\n\t\t\t\t\tweather.the_temp\n\t\t\t\t)}℃ with a high of ${Math.round(weather.max_temp)}℃ and a low of ${Math.round(weather.min_temp)}℃.`\n\t\t\t);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "29d671a93cc25f61a982415066c4d052", "score": "0.4733188", "text": "async getWeather(query) {\n\t\t\tconst API_URL =\n\t\t\t\t'https://api.openweathermap.org/data/2.5/weather?units=metric';\n\t\t\tconst { data } = await this.fetchData(API_URL, query);\n\t\t\treturn {\n\t\t\t\tdescription: data.weather[0].description,\n\t\t\t\ttemperature: Math.round(data.main.temp),\n\t\t\t\tlocation: data.sys.country\n\t\t\t\t\t? `${data.name}, ${data.sys.country}`\n\t\t\t\t\t: data.name,\n\t\t\t\twind: data.wind.speed,\n\t\t\t\thumidity: data.main.humidity,\n\t\t\t\tfeels_like: Math.round(data.main.feels_like),\n\t\t\t\tsunrise: [\n\t\t\t\t\tmoment.unix(data.sys.sunrise).format('kk:mm'),\n\t\t\t\t\tdata.sys.sunrise\n\t\t\t\t],\n\t\t\t\tsunset: [\n\t\t\t\t\tmoment.unix(data.sys.sunset).format('kk:mm'),\n\t\t\t\t\tdata.sys.sunset\n\t\t\t\t],\n\t\t\t\ttype: this.getWeatherType(data.weather[0].id)\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "125013c298e3e8b01e980996cec8531e", "score": "0.47327104", "text": "function allDataLoaded() {\n // For now we just print it out\n console.log(tarot);\n console.log(zodiac);\n}", "title": "" }, { "docid": "64b4ad63f8316b94f1811aa3bf836dd4", "score": "0.47287625", "text": "function extractForecast(result) {\n $('#weather-info').html(result['forecast']);\n}", "title": "" }, { "docid": "30bfc18b89f318a5f5d4c820469b6e19", "score": "0.47272095", "text": "function getTrendings() {\n\t\tconst url = `https://api.themoviedb.org/3/trending/all/day?api_key=${searchOptions.key}`;\n\t\tfetch(url)\n\t\t.then((response) => response.json())\n\t\t//return result\n\t\t.then((response) =>{setTrendings(response.results);\n\t\t//console.log(response)\n\t\t})\n\t\t.catch(console.error);\n\t\t}", "title": "" }, { "docid": "ce6a549e0b92f49ffd60766178a429a9", "score": "0.47269237", "text": "hits(wasp) {\n\n }", "title": "" }, { "docid": "444db411c25e292e90a704cbdf2f3eb2", "score": "0.47248405", "text": "function smartQueryWf()\r\n{ \r\n log(\"Smart query weather information.\");\r\n\r\n var lastQueryTime, currTime, wfJSONObj;\r\n\r\n lastQueryTime = GM_getValue(\"lastQueryTime\", 0);\r\n currTime = (new Date()).getTime() / 1000;\r\n\r\n var deltaTime = currTime - lastQueryTime;\r\n\r\n _wfJSONObj = JSON.parse(GM_getValue(\"wfJSONObj\", \"{}\"));\r\n\r\n var cityIndex = _wfJSONObj.cityIndex;\r\n\r\n if (typeof cityIndex == \"undefined\" || cityIndex == -1)\r\n cityIndex = 0;\r\n\r\n var city = conf.user.citys[cityIndex];\r\n\r\n /*\r\n * In order to avoid frequent queries, we set an interval to update weather\r\n * information.\r\n *\r\n * If the delta time is less than the interval, we consider to fetch the\r\n * weather information from cache(local storage) first, except for the following \r\n * special cases:\r\n * a. local storage is empty or incomplete.\r\n * b. the city is changed from last time.\r\n * c. switch to auto detect mode without update.\r\n */\r\n if (deltaTime < conf.user.interval * 3600) {\r\n log(\"Delta time \" + deltaTime + \" is less than 3600 * 2.5.\");\r\n\r\n if (typeof _wfJSONObj.city != \"undefined\") {\r\n log(\"Found last city \" + _wfJSONObj.city + \", check...\");\r\n /* Check the found information */\r\n if (conf.user.autoDetect ? _wfJSONObj.ip : (city == _wfJSONObj.city)) {\r\n log(\"The weather information is up to date.\");\r\n display();\r\n return;\r\n } else\r\n log(\"The weather information is outdated.\");\r\n } else \r\n log(\"You maybe run this script first time.\");\r\n }\r\n\r\n /* Otherwise, query weather by one method */\r\n if (conf.user.autoDetect)\r\n queryWfByIP();\r\n else\r\n queryWfByCityForce(city);\r\n}", "title": "" }, { "docid": "e36d2b931035be8d11182f2218e0f795", "score": "0.4721715", "text": "function getWeatherInfo(){\n console.log('WeatherComp:getWeatherInfo');\n\n const wCity = 'Bhubaneswar';\n //const appConfig = props.appConfig;\n //const wURL = appConfig.api.weather.wURL+'&q='+ wCity +'&units=metric';\n const wURL = props.weatherConfig.wURL+'&q='+ wCity +'&units=metric';\n \n //fetch(wURL).then(function(){}).catch(function(){});\n fetch(wURL).then(function(result){\n //console.log(result);\n console.log('Result Status = '+result.status);\n console.log('Status Info = '+result.statusText);\n console.log('Result Type = '+result.type);\n result.json().then(function(jResult){\n //console.log(jResult);\n if(jResult.cod===401){ \n console.log('Details : '+jResult.message) \n }else{\n console.log(jResult);\n console.log('==================== '+ wCity +' ==============');\n console.log('Temperature='+jResult.main.temp,'Humidity='+jResult.main.humidity);\n console.log('===============================================');\n }\n });\n }).catch(function(error){\n console.log('Error!');\n console.log(error);\n //console.log('Error Details: '+error.message);\n });\n }", "title": "" }, { "docid": "7b1f96ec171d49f264b3803250a844f0", "score": "0.47215796", "text": "function getAPIdata19() {\n\n\tvar url = \"https://api.openweathermap.org/data/2.5/weather\";\n\tvar apiKey =\"b0c8dafa512a0134e90df6ece3c2b7a2\";\n\tvar city = \"Mount%20Baker,us\";\n\n\t// construct request\n\tvar request = url + \"?\" + \"appid=\" + apiKey + \"&\" + \"q=\" + city;\n\t\n\t// get current weather\n\tfetch(request)\n\t\n\t// parse to JSON format\n\t.then(function(response) {\n\t\tif(!response.ok) { //als het niet klopt: (uitroepteken staat voor niet)\n\t\t\tthrow Error(response.statusText); //als je een fout hebt gemaakt, dan 'gooi' je hem naar catch\n\t\t}\n\t\treturn response.json(); //hij maakt er json van als er geen fout is gegooid naar catch\n\t})\n\t\n\t// render weather per day\n\t.then(function(response) { //als het allemaal goed is gegaan, voer dit dan uit\n\t\t// render weatherCondition\n\t\tonAPISucces19(response);\t\n\t})\n\t\n\t// catch error\n\t.catch(function (error) { //als je de fout gevangen hebt, dan moet je dit gaan uitvoeren\n\t\tonAPIError19(error);\n\t});\n}", "title": "" }, { "docid": "c2ae5a61d29da7872188a94cdb813923", "score": "0.47209087", "text": "function displayResult (marker, infowindow) {\n if(request.readyState == 4) {\n var xml = request.responseXML.documentElement;\n var temperature = xml.getElementsByTagName(\"temperature\");\n var windSpeed = xml.getElementsByTagName(\"windSpeed\");\n var clouds = xml.getElementsByTagName(\"clouds\");\n\n infowindow.setContent(infowindow.getContent()+\"<br> Temperature: \"+temperature[0].textContent+\", WindSpeed: \"+windSpeed[0].textContent+\", Clouds: \"+clouds[0].textContent);\n infowindow.open(map, marker);\n\n var history = document.getElementById(\"history\");\n displayText(history, infowindow);\n }\n }", "title": "" }, { "docid": "8d3d1fe1444d6343a60e245f33ae40db", "score": "0.47194657", "text": "function displayWeather() {\n var content = '';\n for (var i = 0; i < destinations.length; i++) {\n for (var j = 0; j < 7; j++) {\n content = '';\n content +=\n '<div>' + destinations[i].weather.data[j].temp + '&#176; C' + '</div>';\n content +=\n \"<img src = 'https://www.weatherbit.io/static/img/icons/\" +\n destinations[i].weather.data[j].weather.icon +\n \".png' alt='icon' width='30' height='30'>\";\n $('#dest' + (weatherCount - 1) + ' .weather #day' + (j + 1)).html(\n content\n );\n }\n weatherCount++;\n }\n}", "title": "" }, { "docid": "27b5851246e4482875d3acd8caf30e8d", "score": "0.47163945", "text": "function getInfo(cityName, area) {\r\n let url = `http://worldtimeapi.org/api/timezone/${area}/${cityName}`;\r\n let request = new XMLHttpRequest();\r\n request.open(\"GET\", url);\r\n request.send();\r\n request.onload = function () {\r\n if (request.status >= 200 && request.status < 400) {\r\n let data = JSON.parse(request.responseText);\r\n let h = data.datetime[11] + data.datetime[12];\r\n let min = data.datetime[14] + data.datetime[15];\r\n let infoConteiner = document.querySelector(\"#\" + cityName + \"Time\");\r\n infoConteiner.className = \"time\";\r\n infoConteiner.innerHTML = h + \":\" + min;\r\n } else {\r\n infoConteiner.innerHTML = \"connection error\";\r\n };\r\n request.onprogress = function (event) {\r\n let loadList = document.createElement(\"div\");\r\n loadList.class = \"load\";\r\n loadList.innerHTML = `Loaded: ${event.loaded} from ${event.total}`;\r\n document.body.append(loadList);\r\n };\r\n\r\n };\r\n}", "title": "" }, { "docid": "66b2fdc0b16e5da80a5687c01ec19c16", "score": "0.47153836", "text": "function getWeatherData(){\n\treturn {\n\t\tlocations: [\n\t\t\t{\n\t\t\t\tname: 'Portland',\n\t\t\t\tforecastUrl: 'http://www.wunderground.com/US/OR/Portland.html',\n\t\t\t\ticonUrl: 'http://icons-ak.wxug.com/i/c/k/cloudy.gif',\n\t\t\t\tweather: 'Overcast',\n\t\t\t\ttemp: '54.1 F (12.4 C)'\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Bend',\n\t\t\t\tforecastUrl: 'http://www.wunderground.com/US/OR/Bend.html',\n\t\t\t\ticonUrl: 'http://icons-ak.wxug.com/i/c/k/partlycloudy.gif',\n\t\t\t\tweather: 'Partly Cloudy',\n\t\t\t\ttemp: '55.0 F (12.8 C)'\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Manzanita',\n\t\t\t\tforecastUrl: 'http://www.wunderground.com/US/OR/Manzanita.html',\n\t\t\t\ticonUrl: 'http://icons-ak.wxug.com/i/c/k/rain.gif',\n\t\t\t\tweather: 'Light Rain',\n\t\t\t\ttemp: '55.0 F (12.8 C)'\n\t\t\t}\n\t\t]\n\t};\n}", "title": "" }, { "docid": "7e35e2e0ea825366143eb4b75cdb121d", "score": "0.47152314", "text": "metainfo() {\n return {\n flakesPerSecond: {\n type: \"range\",\n min: 0,\n max: 200\n },\n snowColor: {\n type: \"color\"\n }\n };\n }", "title": "" }, { "docid": "860f4b20edad778db6351f85edb6af53", "score": "0.47150785", "text": "function getWeatherDataByWOEID(){\n weather_data = weatherAPI.getWeatherByLocation(vmw.weather.woeid);\n \n weather_data\n .then(function(data){\n // Uncomment this to view the weather metadata\n logger.debug(\"Weather data for \", data.data.title, \": \", data.data);\n\n vmw.weather_loaded = true;\n vmw.city_name = data.data.title;\n vmw.today_weather_data = data.data.consolidated_weather[0];\n vmw.today_weather_data.weather_state_abbr = \"state-\"+vmw.today_weather_data.weather_state_abbr;\n })\n .catch(function(error){\n vmw.weather_loaded = false;\n logger.error(\"Could not get weather data for \", vmw.weather.city_name, \". Error: \", error);\n });\n }", "title": "" } ]
0308fcfd0bb011047b0be4f73ed0bfeb
this runs before the "render and return ( ... ) " runs. We use it to get data from the backend about the faculty member
[ { "docid": "b5fa6d97b97dd7f5d1b4a1066bd93e35", "score": "0.54753983", "text": "componentWillMount() {\n console.log(this.props.match.params.id);\n axios.get(`/api/faculty/${this.props.match.params.id}`)\n .then((response) => {\n this.setState({ profInfo: response.data });\n })\n .catch((error) => {\n Utils.handleTokenError(error);\n });\n\n axios.get(`/api/role/${sessionStorage.getItem('token_id')}`)\n .then((response) => {\n // if they don't have a role or it's just not showing up for some reason, go to home page\n // remove this line if you want anybody to be able to view opportunity page\n if (!response || response.data === 'none' || !response.data) {\n alert('You must be signed in to view this.');\n window.location.href = '/';\n } else {\n this.setState({ role: response.data });\n }\n })\n .catch((error) => {\n Utils.handleTokenError(error);\n });\n }", "title": "" } ]
[ { "docid": "009839b5e4e248fc86f07006e08ca6ac", "score": "0.6450624", "text": "viewSpecificMember(request, response) {\n const userId = request.params.id;\n logger.info('id is ' + userId);\n if (goalStore.getGoalList(userId)) {\n sort.sortDateTimeNewToOld(goalStore.getGoalList(userId).goals);\n goalHelpers.setGoalStatusChecks(userId);\n }\n\n const viewData = {\n title: 'Trainer Members',\n user: memberStore.getMemberById(userId),\n isTrainer: accounts.userIsTrainer(request),\n allTrainers: trainerStore.getAllTrainers(),\n assessmentlist: assessmentStore.getAssessmentList(userId),\n stats: analytics.generateMemberStats(memberStore.getMemberById(userId)),\n goals: goalStore.getGoalList(userId),\n bookings: sort.sortDateTimeOldToNew(bookingStore.getAllUserBookings(userId)),\n allClasses: classStore.getAllNonHiddenClasses(),\n allRoutines: fitnessStore.getAllProgrammes(),\n };\n if (accounts.userIsTrainer(request)) {\n response.render('dashboard', viewData);\n } else {\n response.redirect('back');\n }\n }", "title": "" }, { "docid": "f84bf0cb04b439550fb45c2068e4eb86", "score": "0.6323001", "text": "function getFacultyNames()\n{\n\n\t$.ajax({\n\t\ttype:\"POST\",\n\t\turl:\"getSubjectFaculty\",\n\t\tdata:$('#timetableForm').serialize(),\n\t\tsuccess:function(response)\n\t\t{\n\t\t\tfacultSubjectnames=JSON.parse(response);\n\t\t\tif(facultSubjectnames.length==0)\n\t\t\t\t{\n\t\t\t\t$(\"#faculty-body\").empty();\n\t\t\t\t\n\t\t\t\tcustomDialogMessageFrame(\"No Records Exists in the table\",\"Notice\");\n\t\t\t\t$( '.faculty-table' ).hide()\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t$( '.faculty-table' ).show();\n\t\t\t\tdisplayFacultyTable();\n\t\t\t\n\t\t\t\t}\n\t\t\t//alert(response);\n\t\t},\n\t\terror:function(e)\n\t\t{\n\t\t\tconsole.log(\"inside the ajax error\");\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "e81700110fd9121d9e18875e35657b19", "score": "0.6019454", "text": "function renderWithUser(user) {\n // Set uid to be the users uid by default\n uid = user.uid;\n // Database query to check if user has admin permissions\n firebase.firestore().collection(\"moderators\").doc(firebase.auth().currentUser.uid).get().then(doc => {\n // Check if moderator=true for the user and if session storage contains a uid\n if (doc.data().moderator && sessionStorage.getItem(\"uid\") != null) {\n // Use the uid set in session storage by the admin button to edit the desired profile\n adminEdit = true;\n uid = sessionStorage.getItem(\"uid\");\n // change the profile page title when admin is editing another profile\n if (document.title == \"Global NL - Member Profile\") { // check the page to prevent the title from changing on DBTable too\n document.title = \"Global NL - Member Profile (Admin Edit)\"\n }\n }\n })\n // Catch error caused by the doc not existing in moderators collection\n .catch(error => {\n console.log(\"User does not have admin permissions, reverting to edit user profile\");\n })\n // create references with the set uid\n .finally(() => {\n memberDocRef = firebase\n .firestore()\n .collection(\"members\")\n .doc(uid);\n privateDocRef = firebase\n .firestore()\n .collection(\"private_data\")\n .doc(uid);\n $(\"#mainPage\").show();\n //$(\"#display_name\").val(user.displayName); \n if (navigator.userAgent.indexOf('gonative') > -1) {\n if (getUrlParameter('profileURL')) { // user has already returned from linkedin profile so do nothing\n ;\n } else { // show LinkedIn Modal for the mobile app for users who have never provided their info upon signing in\n memberDocRef\n .get()\n .then(doc => {\n if (!doc.exists) {\n console.log(\"User does not exist in database\");\n gnl.auth.logout();\n } else {\n if (!doc.data().date_updated || doc.data().date_updated == \"-1\") { \n $('#LImodalMobileApp').show(); \n }\n }\n })\n .catch(err => {\n console.log(\"Error getting document\", err);\n });\n }\n }\n initApp();\n });\n}", "title": "" }, { "docid": "9e7330af4a8fc7a3c3c36941d6e37510", "score": "0.59665495", "text": "function populateUserData() {\n displayLessonData();\n}", "title": "" }, { "docid": "33c4d0d7aa766f3df909fd4f501f1e19", "score": "0.5962099", "text": "showCollaborations(req, res, next) {\n userQueries.getUser(req.user.id, (err, result) => {\n console.log(result);\n let user = result['user'];\n let collaborations = result['collaborations'];\n if (err || user == null) {\n res.redirect(404, '/');\n } else {\n res.render('users/collaborations', { user, collaborations });\n }\n });\n }", "title": "" }, { "docid": "7a0b62f7e477335fd2c663b43b295f43", "score": "0.5957769", "text": "listAllMembers(request, response) {\n logger.info('trainer member view rendering');\n const viewData = {\n title: 'Trainer Members',\n user: accounts.getCurrentUser(request),\n isTrainer: accounts.userIsTrainer(request),\n allTrainers: trainerStore.getAllTrainers(),\n allMembers: memberStore.getAllMembers(),\n allClasses: classStore.getAllNonHiddenClasses(),\n allRoutines: fitnessStore.getAllProgrammes(),\n };\n if (accounts.userIsTrainer(request)) {\n response.render('trainerMembers', viewData);\n } else {\n response.redirect('back');\n }\n }", "title": "" }, { "docid": "d0e398870cbf38aa273e91778533d204", "score": "0.58763397", "text": "function loadData(currentUser){\n var userId = firebase.auth().currentUser.uid;\n var dbUserInfo = firebase.database().ref().child('/user/' + userId);\n dbUserInfo.on(\"value\", function(snapshot){\n var username = snapshot.val().userLastName;\n typeName = username;\n if (typeName != \"\") {\n $('typeName').html(typeName);\n }\n $('#profile-name').html(username);\n $('#profile-email').html(snapshot.val().email);\n });\n }", "title": "" }, { "docid": "d8d7f7a441c9e1e044fdf6aeafba2694", "score": "0.5855997", "text": "loadLabMembers () {\n let { group_id } = this.state\n getGroupMembers({ group_id }).then(r => console.log('members', r))\n // let { lab_id, admins_raw } = this.state\n // getLabMembers(lab_id).then(r => {\n // this.addMembers(r.data.faculty)\n // this.addMembers(r.data.students)\n // this.state.admin_access = this.currentUserHasPermissions(admins_raw)\n // })\n }", "title": "" }, { "docid": "1d83d428766914fd8ba4c5d89320b63f", "score": "0.58552504", "text": "index(request, response) {\n logger.info(\"trainerboard member rendering\");\n \n // Retrieve the current user selected from the trainer dashboard.\n const currentUser = userStore.getUserById(request.params.id);\n \n // Sort the assessments by date decreasing before sending to the memberDashboard view.\n let assessments = assessmentStore.getUserAssessments(request.params.id);\n assessments.sort(function(a, b) {\n let dateA = new Date(a.dateTime), dateB = new Date(b.dateTime);\n return dateB - dateA;\n }); \n \n // Retieve the users goals to calculate counts of each goal status\n let openCount = 0; let missedCount = 0; let achievedCount = 0;\n let goalStatus;\n let goals = goalStore.getUserGoals(request.params.id);\n for (let t = 0; t < goals.length; t++) {\n goalStatus = analytics.calcGoalStatus(goals[t], assessments);\n if (goalStatus === \"Open\") {\n openCount ++;\n } else if (goalStatus === \"Missed\") {\n missedCount++; \n } else {\n achievedCount++;\n }\n }\n \n // The latest weight will be the [0] assessment or the startingWeight if no assessments yet.\n let latestWeight = currentUser.startingWeight;\n if (assessments.length > 0) {\n latestWeight = assessments[0].weight;\n }\n \n // Calculate the BMI data for the Analytics section of the page\n let calculatedBMI = analytics.calculateBMI(request.params.id);\n calculatedBMI = Math.round(calculatedBMI * 100.0 ) / 100.0;\n const calculatedBMICategory = analytics.calculateBMICategory(calculatedBMI);\n \n // Create a new array of memberIds and the associated array of assessments.\n const memberAssessments = {\n memberId: request.params.id,\n assessments: assessments\n };\n\n // Create an data object to be passed to the member dashboard view and render the view. \n const viewData = {\n title: \"Member Assessment Dashboard\",\n user: currentUser,\n memberAssessments: memberAssessments,\n calculatedBMI: calculatedBMI,\n bmiCategory: calculatedBMICategory,\n idealWeightIndicator: analytics.checkIdealWeight(\n currentUser.id,\n latestWeight\n ),\n openCount: openCount,\n missedCount: missedCount,\n achievedCount: achievedCount\n };\n logger.info(\"about to render\", memberAssessments);\n response.render(\"memberdashboard\", viewData);\n }", "title": "" }, { "docid": "9a2ecf2f416edffbbd266a1be589fc1b", "score": "0.5843194", "text": "function getMembers(reviewmonth, clientID) {\n $.ajax({\n url: '/AgencyUser/GetMembers',\n datatype: 'json',\n type: 'post',\n data: { ReviewMonth: reviewmonth, ClientId: clientID },\n success: function (data) {\n if (data.membersList !== null && data.membersList.length > 0) {\n var membersDiv = $('.membrslist');\n var appdendDiv = '';\n $('.append-members').html('');\n var presentCount = 0;\n var contributor = 0;\n var membersCount = data.membersList.length;\n var report_members = '';\n $.each(data.membersList, function (i, element) {\n membersDiv.children('div').find('.member-content-desc > p').html(element.FullName);\n membersDiv.children('div').find('.member-survey-3d').attr('user-id', element.UserId);\n membersDiv.children('div').find('.member-survey-3d').attr('role-id', element.RoleId);\n membersDiv.children('div').find('.bar-color-common').css('background-color', element.UserColor);\n if (element.IsPresent) {\n if (isEmpty && !IsValidMonth) {\n membersDiv.children('div').find('.member-survey-3d').attr('isPresent', false);\n membersDiv.children('div').find('.member-survey-3d').attr('isEdit', false);\n membersDiv.children('div').find('.member-survey-3d').children('.tick-3d').addClass('hidden');\n }\n else {\n membersDiv.children('div').find('.member-survey-3d').attr('isPresent', element.IsPresent);\n membersDiv.children('div').find('.member-survey-3d').attr('isEdit', element.IsEdit);\n membersDiv.children('div').find('.member-survey-3d').children('.tick-3d').removeClass('hidden');\n presentCount += 1;\n }\n\n report_members += '<li class=\"present\">' + element.FullName + '</li>';\n }\n else {\n membersDiv.children('div').find('.member-survey-3d').attr('isPresent', false);\n membersDiv.children('div').find('.member-survey-3d').attr('isEdit', element.IsEdit);\n membersDiv.children('div').find('.member-survey-3d').children('.tick-3d').addClass('hidden');\n report_members += (element.IsContributor) ? '<li class=\"contributor\">' + element.FullName + '</li>' : '<li class=\"absent\">' + element.FullName + '</li>';\n\n }\n appdendDiv += membersDiv.html();\n });\n\n $('.append-members').html(appdendDiv);\n $('.append-members').find('.member-survey-3d').addClass('check-attendance');\n $('.members-count').html(membersCount);\n\n contributor = (data.contributorCount === null) ? 0 : data.contributorCount;\n $('.member-contributor').html(contributor);\n $('.members-present').html(presentCount);\n\n $('.report-modal-clientname').html($('.client-active').children('p').html());\n $('.report-modal-month').html($('.month-active').children('div').children('h2').html().toUpperCase());\n $('.report-modal-hostname').html(HostUserName);\n $('.report-modal-devmembers').html(report_members);\n\n\n $('.report-modal-presentcount').html(presentCount);\n $('.dev-mem-count').html('(' + membersCount + ')');\n $('.report-modal-contributorcount').html(contributor);\n $('.report-modal-status').html('Closed');\n\n if (isHost) {\n $('.members-block').removeClass('hidden');\n $('html, body').animate({\n scrollTop: $(\".members-block\").offset().top\n }, 1000);\n $('.nano1').nanoScroller();\n $('.nano2').nanoScroller();\n }\n\n\n }\n\n\n }\n });\n }", "title": "" }, { "docid": "65bcf5ae8a3bfca931b10e7c1b453c32", "score": "0.58295125", "text": "render() {\n if (!this.profileExists()) {\n return this.showProfileForm();\n } else {\n return this.showProfile();\n }\n }", "title": "" }, { "docid": "4ff3cc8f15860c755acf2ddef6c7b656", "score": "0.5820498", "text": "function get(req, res) {\n\n // Gather request parameters\n const userId = parseInt(req.params['userId'], 10);\n const userRoles = req.session.fdb_roles; // Page needs to know the user's role\n\n // Don't let user tamper with URL.\n if (!checkDashboardRequest(req)) {\n return res.redirect(req.app.locals.APP_URL + 'badRequest');\n }\n \n // Lookup user object from faculty list cache.\n // If the user ID is invalid, something is really wrong.\n const userEnrollment = canvasCache.getFaculty().find( e => e.user.id === userId);\n if (!userEnrollment) {\n return res.redirect(req.app.locals.APP_URL + 'badRequest');\n }\n const user = userEnrollment.user;\n\n // Loop through term configuration files\n const allUserTerms = []; // Initialize array containing one element for each semester\n for (let semester of dashSemesters.getAll()) {\n const userTerms = buildTermCourses(userId, semester.terms_config);\n if (userTerms.length > 0) {\n allUserTerms.push(\n {\n \"year\": semester.year,\n \"season\": semester.season,\n \"use_for\": semester.use_for,\n \"term_courses\": userTerms\n });\n }\n // allUserTerms.push(buildTermCourses(userId, semester.terms_config));\n }\n\n // /**\n // * Initialize array containing faculty user's term courses.\n // * We should end up with one array item for each\n // * term course the faculty user is enrolled in.\n // */\n // const terms = appConfig.getTerms();\n // const facultyEnrollments = canvasCache.getFaculty();\n // var userTerms = [];\n\n // for (let term of terms) {\n\n // // If faculty user is enrolled in term course, \n // // add an object for the term to the userTerms collection.\n // const courseEnrollments = facultyEnrollments.filter(\n // e => (e.user_id === userId) && (e.course_id === term.course_id)\n // );\n \n // if (courseEnrollments.length > 0) {\n // const courseEnrollment = courseEnrollments[0];\n // const termObject = {\n // course_section_id: courseEnrollment.course_section_id\n // };\n // // Throw in configuration data for the term\n // Object.assign(termObject, term);\n\n // userTerms.push( termObject );\n // }\n // }\n\n // // If the enrollmentList is empty, we probably got an invalid\n // // userId, so we can stop the proceedings right now.\n // if (userTerms.length <= 0) {\n // const s = `No enrollment data found for user ID ${userId}. User might not be in any of the courses configured for the dashboard.`;\n // return res.render('dash/facultyDashErr', { 'err': s } );\n // }\n \n // // We'll need the user's user object to display user info.\n // const enrollments = facultyEnrollments.filter( e => e.user_id === userId);\n // const user = enrollments[0].user;\n\n // for(let term of userTerms) {\n\n // /**\n // * Gather the students in each of the user's sections.\n // */\n // const sectionEnrollments = canvasCache.getCourseEnrollments(term.course_id);\n // const studentEnrollments = sectionEnrollments.filter(\n // e => (e.course_section_id === term.course_section_id) && (e.type === \"StudentEnrollment\")\n // );\n \n // // We just want the students' user objects\n // const cachedStudents = studentEnrollments.map( e => e.user);\n\n // // We're going to add properties to these student objects,\n // // so use copies of them, so we don't sully the cached versions.\n // var students = cachedStudents.map( e => Object.assign( {}, e));\n\n // // Populate current enrollment object, which represents a section,\n // // with students in the section. A section may have no students.\n // term.students = students;\n\n // // Canvas does't return a sorted student list\n\n // function compareStudents(a, b) {\n // // Helper function for sorting an enrollee list.\n // var nameA = a.sortable_name;\n // var nameB = b.sortable_name;\n // if (nameA < nameB) {\n // return -1;\n // }\n // if (nameA > nameB) {\n // return 1;\n // }\n // return 0; // names must be equal\n // }\n // term.students.sort(compareStudents);\n\n // /**\n // * For each course, populate a dashboard modules collection containing assignment & quiz\n // * data for each course the faculty teaches.\n // */\n // term.modules = canvasCache.getDashboardModules(term.course_id);\n\n // /**\n // * For each course, populate with the grade module, which is assumed to be the\n // * final module in the Canvas course.\n // * 09.10.2019 tps Bug fix. Don't pick a module that is unpublished. Assume there is \n // * at least 1 published module.\n // */\n // const courseModules = canvasCache.getCourseModules(term.course_id);\n // // term.grade_module = courseModules[courseModules.length - 1];\n // let lastModule = null;\n // for (let i = courseModules.length - 1; i >= 0; --i) {\n // if (courseModules[i].published) {\n // lastModule = courseModules[i];\n // break;\n // }\n // }\n // term.grade_module = lastModule;\n\n // } // End loop through faculty member's terms.\n\n \n // Prepare to deliver data to the page template.\n const params = {\n userRoles: userRoles,\n user: user,\n semesters: allUserTerms,\n addConfig: appConfig.getAdds(),\n sessionData: req.session\n }\n return res.render('dash/facultyRestoredDash', params);\n // return res.render('dev/work', params);\n}", "title": "" }, { "docid": "2cc4f29370e0cf6e6132f1fbb0adb811", "score": "0.58102334", "text": "function loadUserData(milestoneData, milestone, college, department, program, type) {\n if (college == \"\") {\n fetch(url + '/getAllUsers')\n .then(response => response.json())\n .then(data => loadGraph(data['data']['recordset'], milestoneData, milestone, \"NAU\", type));\n }\n else if (department == \"\") {\n fetch(url + '/getUsersByCollege/' + college)\n .then(response => response.json())\n .then(data => loadGraph(data['data']['recordset'], milestoneData, milestone, college, type));\n }\n else if (program == \"\") {\n fetch(url + '/getUsersByDepartment/' + department)\n .then(response => response.json())\n .then(data => loadGraph(data['data']['recordset'], milestoneData, milestone, department, type));\n }\n else {\n fetch(url + '/getUsersByProgram/' + program)\n .then(response => response.json())\n .then(data => loadGraph(data['data']['recordset'], milestoneData, milestone, program, type));\n }\n}", "title": "" }, { "docid": "f4d11a388d7ba63aa62981eda9ddfca9", "score": "0.57783127", "text": "function renderUser() {\n event.preventDefault();\n introQuiz.style.display = \"none\";\n timeEl.style.display = \"none\";\n highscore.style.display = \"block\";\n\n for (let k = 0; k < record.length; k++) {\n // Get user name and score\n let quizTaker = record[k].name;\n let scoreTaker = record[k].score;\n\n // Create list of quiz takers\n let li = document.createElement(\"li\");\n li.textContent = quizTaker + \" = \" + scoreTaker;\n userList.appendChild(li);\n }\n}", "title": "" }, { "docid": "ccfadbce863d5b9c065cc3beda079b0c", "score": "0.57560927", "text": "function getpersondata(){\n var html = \"\";\n if (assistants.scope.current === 'eid' && myForm.id_feld){\n var stg = \"\";\n stg = myForm.id_feld.AcademicTitle;\n html = \"<tr><strong><td>Titel </td><td>\" + stg + \"</td></strong></tr>\";\n stg = \"\";\n stg = myForm.id_feld.FamilyNames;\n html += \"<tr><strong><td>Name </td><td>\" + stg + \"</td></strong></tr>\"\n stg = \"\";\n stg = myForm.id_feld.GivenNames;\n html += \"<tr><strong><td>Vorname </td><td>\" + stg + \"</td></strong></tr>\"\n stg = \"\";\n stg = myForm.id_feld.BirthName;\n html += \"<tr><strong><td>Geburtsname </td><td>\" + stg + \"</td></strong></tr>\"\n stg = \"\";\n stg = myForm.id_feld.DateOfBirth;\n html += \"<tr><strong><td>Geburtsdatum </td><td>\" + stg + \"</td></strong></tr>\"\n stg = \"\";\n stg = myForm.id_feld.PlaceOfBirth;\n html += \"<tr><strong><td>Geburtsort </td><td>\" + stg + \"</td></strong></tr>\"\n }\n return html;\n}", "title": "" }, { "docid": "dfd2113d253b06db492c4146889bf3db", "score": "0.5734481", "text": "function renderUserCollege(data, res){\n\n\tvar location = data.location;\n\n\tif (location != null) {\n\t\tvar api_key = \"TVS524kLUADDEEUcZl0PFHtEbVISmZCAGeT6buGi\";\n\t\tvar results = \"&_fields=school.name,school.school_url,school.city,school.state\";\n\t\tvar query = \"https://api.data.gov/ed/collegescorecard/v1/schools.json?_zip=\"+location+\"&_distance=100mi&api_key=\"+ api_key + results;\n\n\t\t// API to get College Data\n\t\trequest(query, function (error, response, body) {\n\t\t \t// Display only top 5 colleges\n\t\t \tvar length = 5;\n\t\t\tif (JSON.parse(body).results.length < 5) {\n\t\t \t\tlength = JSON.parse(body).results.length;\n\t\t \t}\n\t\t \tvar collegeResults = JSON.parse(body).results;\n\t\t \tvar collegeArr = [];\n\t\t \tfor (var i=0; i < length; i++) {\n\t\t \t\tvar collegeObj = {\n\t\t\t \t\tname: collegeResults[i][\"school.name\"],\n\t\t\t \t\turl: collegeResults[i][\"school.school_url\"],\n\t\t\t \t\tcity: collegeResults[i][\"school.city\"],\n\t\t\t \t\tstate: collegeResults[i][\"school.state\"],\n\t\t\t \t};\n\t\t \t\tcollegeArr.push(collegeObj);\n\t \t\t}\n\n\t\t\tuserObj[\"college\"] = collegeArr;\n\t \t\tres.render('user', userObj);\n\t\t}); // request\n\t} else {\n\t\tres.render('user', userObj);\n\t} // location\n}", "title": "" }, { "docid": "22db864c95272cbe27b59dbe0a9bc478", "score": "0.5696425", "text": "function getFacArea(faArea){\n\tmyXhr('get',{path:'/research/byFaculty/username='+$(faArea).attr('data-facuArea')},null).done(function(json){\n\t\tvar x=\"\";\n\n\t\tfor(i in json.citations){\n\t\t\tx += '<p>'+json.citations[i]+'</p>';\n\t\t}\n\t\t\n\t\tssi_modal.show({\n\t\t\ttitle:json.facultyName,\n\t\t\tcontent: x,\n\t\t});\n\t});\t\n}", "title": "" }, { "docid": "59a3e9a72febec501cf8bcca4cfb7b0b", "score": "0.5678565", "text": "function requestStaffDetail() {\n //If the api is all fine and is happy with what was sent.\n if (http.readyState === 4 && http.status === 200) {\n var staffDetail = JSON.parse(http.responseText);\n if (staffDetail !== null) {\n displayStaffDetail(staffDetail);\n } else {\n hideStaffDetail();\n }\n }\n}", "title": "" }, { "docid": "f8ddc3ce065b63e0fbfc7821eed4b177", "score": "0.56774485", "text": "function getFacOrStaff(which, where){\n getData('get', {path:'/people/' + which}, where).done(function(min){\n var isMobile = window.matchMedia(\"only screen and (max-width: 760px)\").matches;\n var course = [];\n $('#' + where).append('<div class=\"'+where+'-wrapper\"></div>');\n $.each(min, function(i, item){\n var count = 1;\n $.each(item, function(k, stuff){\n $('.'+where+'-wrapper').append('<span class=\"fac-staff-children\" data-uname='+stuff.username+'><a href=\"#ex1\" rel=\"modal:open\">'+ stuff.name + '</a></span>'); \n count++;\n });\n });\n $('#'+where+' span').on('click', function(){\n if(which === 'faculty'){\n whichFacOrStaff = min.faculty;\n }\n else{\n whichFacOrStaff = min.staff;\n }\n var who = getAttributesByName(whichFacOrStaff, 'username', $(this).attr('data-uname'));\n $('.modal').html($('<div><img src=\"'+who.imagePath+'\" alt=\"faculty/staff image\"/>'));\n $.each(who, function(index, item){\n if(!item == null || !item == ' ' && index != 'imagePath'){\n if(index == 'website'){\n $('.modal').append('<p><span class=\"caps\">'+index + ':</span> <a href=\"' +item+'\" target=\"_blank\">'+item+'</a></p>');\n }\n else if(index == 'email'){\n $('.modal').append('<p><span class=\"caps\">'+index + ':</span> <a href=\"mailto:'+item+'\">'+item+'<a></p>');\n }\n else{\n $('.modal').append('<p><span class=\"caps\">'+index + ':</span> ' +item+'</p>');\n }\n \n }\n });\n $('.modal').append($('</div>'));\n if(isMobile){\n $('.modal').css({width:'90%'});\n }\n else{\n $('.modal').css({width:'30%'});\n }\n });\n //end of people/faculty/\n });\n}", "title": "" }, { "docid": "98b366c378fac4e2a760577be5fb8782", "score": "0.56568503", "text": "async getUserData() {\n var url = 'http://localhost:80//junior-workers/api/get-view-user-data.php';\n var data = {\n \"email\": this.state.email\n };\n try {\n var response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n });\n if(response.status !== 200) {\n console.error(\"Unable to get user's data\");\n var temp = <Redirect to=\"/search\" />;\n this.setState({redirect: temp});\n }\n else if (response.status === 200) {\n var json = await response.json();\n this.setState({data : json});\n\n // if the user is logged in show the navbar too.\n if(this.state.jwt !== null && this.state.jwt !== \"\") {\n var tmp = <Navbar selectedLink=\"nothing\" role={this.state.role} />\n this.setState({\n navbar: tmp\n });\n }\n }\n } catch (error) {\n console.error('Error:', error);\n }\n }", "title": "" }, { "docid": "98379d7a789298c4e6079d753d2c0f2a", "score": "0.56510514", "text": "getUser() {\n this.mapFormToUser(this.personalInfoForm);\n this.mapFormToUser(this.addressForm, \"address\");\n if (this.isProfessional) {\n this.mapFormToUser(this.professionalForm);\n }\n else {\n this.getInsuranceCarriers();\n }\n }", "title": "" }, { "docid": "9b1c636c9b7b10c9ead36a24b505f24b", "score": "0.5632881", "text": "async viewUserDetails() {\n this.wait(\".loader\");\n //getUserDetails\n const data = await this.getUserDetails();\n\n //getprofilePicture\n this.getprofilePicture(this.getParam(\"id\"));\n\n this._qs(\n \".name\"\n ).innerHTML = `${data.userData.firstName} ${data.userData.lastName}`;\n\n this._qs(\n \".email\"\n ).innerHTML = `<a href=\"mailto:${data.userData.email}\">${data.userData.email}<a>`;\n this._qs(\n \".mobile\"\n ).innerHTML = `<a href=\"callto:${data.userData.mobile}\">${data.userData.mobile}</a>`;\n\n switch (data.userData.status) {\n case \"0\":\n this._qs(\".status\").innerHTML = \"🔴 Unconfirmed\";\n break;\n case \"1\":\n this._qs(\".status\").innerHTML = \"🟢 Confirmed\";\n break;\n default:\n this._qs(\".status\").innerHTML = \"⭕ invalid\";\n break;\n }\n\n let index = 1;\n data.ownPropertyData.forEach((item) => {\n this._qs(\"#own-properties\").innerHTML += `\n <div class=\"row collapsible-row\">\n <span class=\"column\"><a id=\"${\n item._id\n }\">${index++}</a></span>\n <span class=\"column\">${item.title}</span>\n <span class=\"column\">${item.created}</span>\n </div>\n `;\n });\n this.unwait(\".loader\");\n }", "title": "" }, { "docid": "bbc4139844a6588cf49dce742839a142", "score": "0.5630145", "text": "function loadStudentData (username) {\n\n \n}", "title": "" }, { "docid": "646b0ad40b0f45f38bb454e71cb0a61c", "score": "0.5584226", "text": "function ensureAdminOrFaculty(req, res, next) {\n if(!req.decoded.college_id ) {\n res.json({\n success : false,\n message : 'Please login.'\n })\n } else {\n User.findOne({ college_id : req.decoded.college_id }).select('permission').lean().exec(function (err, user) {\n if(err) {\n res.json({\n success : false,\n message : 'Something went wrong!'\n })\n } else {\n if(!user) {\n res.json({\n success : false,\n message : 'User not found.'\n })\n } else {\n if(user.permission === 'admin' || user.permission === 'faculty-coordinator') {\n next();\n } else {\n res.json({\n success : false,\n message : 'Insufficient Permission. Only Faculty Coordinator is allowed.'\n })\n }\n }\n }\n });\n }\n}", "title": "" }, { "docid": "ee012cea4dcdba92e1cd5eacbd5a957f", "score": "0.5576626", "text": "function getStudentName() {\n $.ajax({\n url: BASE_URL + STUDENTS_BYREGISTEREDCOURSE + registeredId + \"/users/people \",\n type: \"GET\",\n dataType: \"json\",\n success: function(result) {\n console.log(result);\n title.html(\"Notas de \" + result.user.person.name + \" \" + result.user.person.surname);\n },\n error: function(error) {\n showError(error.responseText);\n }\n });\n}", "title": "" }, { "docid": "307acca016a2fdbba0a1f2f38c9202e4", "score": "0.5575181", "text": "function _fetchCampContactPersonDetails() {\n $.get('/camps_contact_person/' + contact_person_id, function(res) {\n $('span.contact_person_name').text([res.user.first_name, res.user.last_name].join(' '));\n $('span.contact_person_phone').text(res.user.cell_phone);\n $('span.contact_person_email').text(res.user.email);\n });\n}", "title": "" }, { "docid": "139b0f79d98c3cd085e2861c4c035ef7", "score": "0.5575149", "text": "function getUser() {\n\n\t\t$.get(\"/api/user\", function(data) {\n\n\n\t\t\tif (data.firstName && data.lastName) {\n\n\t\t\t\tappendDropdown(data.firstName + \" \" + data.lastName);\n\n\t\t\t} else if (data.firstName && !data.lastName){\n\n\t\t\t\tappendDropdown(data.firstName);\n\n\t\t\t} else if (!data.firstName && data.lastName){\n\n\t\t\t\tappendDropdown(data.lastName);\n\n\t\t\t} else {\n\n\t\t\t\tappendDropdown(data.email)\n\n\t\t\t}\n\n\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "4eea43975b819a690160040e3a7ec892", "score": "0.5572267", "text": "function handleStudentPageData() {\n console.log(\"handleStudentPageData()\");\n var uid = firebase.auth().currentUser.uid;\n firebase.database().ref('users/' + uid).once('value').then(function (snapshot) {\n var username = snapshot.val().username;\n console.log(\"handleStudentPageData(): username: \" + username);\n\n document.getElementById('greeting').innerHTML = \"<h2>Hi \" + username + \"!</h2>\";\n\n //$(\"#job-card-dyn\").show();\n\n });\n}", "title": "" }, { "docid": "449aa337b6b2045e185fa4bd2b8b4562", "score": "0.5571558", "text": "function get_patients(){\n\n fetch(`/doctors/patients`)\n .then(response => response.json())\n .then(data => {\n \n //update header and call function to display current patients\n document.querySelector(\"#selected\").innerHTML = \"Current Patients List\";\n display_patients(data);\n })\n .catch(error => {\n console.log(\"Error\", error);\n });\n }", "title": "" }, { "docid": "eeba7e00d5f4f26e34a56ad37c23a542", "score": "0.55646586", "text": "function getFac(dom){\n\t\tmyXhr('get',{path:'/people/faculty/username='+$(dom).attr('data-username')},null).done(function(json){\n\t\t\tconsole.log(json);\n\n\t\t\t\n\t\t\tvar img = '<p><img src=\"'+json.imagePath+'\" style=\"float:left; margin-right:15px\"/>';\n\t\t\tvar text = '<p>Office: '+json.office+'</p><p>Phone: '+json.phone+'</p><p>Email: '+json.email+'</p><p>Tagline: '+json.tagline+'</p><p>Interest Area: '+json.interestArea+'</p><p>Website: '+json.website+'</p><p>Twitter: '+json.twitter+'</p><p>Facebook: '+json.facebook+'<p>';\n\t\t\t$.dialog({\n\t\t\t\t\ttitle:json.name+\", \"+json.title+'<hr>',\n\t\t\t\t\tcontent: img +text,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t});\n\t\t});\n}", "title": "" }, { "docid": "10206cb2e9b5add94b3a321cbbaf2e21", "score": "0.55528677", "text": "renderCourseOwner() {\n const { context } = this.props;\n\n if (context.authenticatedUser) {\n if (this.state.course.length && this.state.course[0].userId === context.authenticatedUser.userId) {\n return `By ${context.authenticatedUser.firstName} ${context.authenticatedUser.lastName}`;\n }\n }\n }", "title": "" }, { "docid": "160c44788c6bef18c0d191c05ec38e57", "score": "0.55519694", "text": "function forum_profile(){\n document.getElementById(\"container\").innerHTML=\"\";\n document.getElementById(\"container\").classList=\"container_2\";\n var str='<div class=\"forum_top\" id = forum_top>Profile & Upcoming</div>'\n document.getElementById(\"container\").innerHTML=str;\n\n var str='<div class=\"forum_top_2\" id = forum_top_2 >~~~ This is your detailed information ~~~</div>'\n document.getElementById(\"container\").innerHTML+=str;\n\n var str='<div class=\"forum_per\" id = forum_per> </div>'\n document.getElementById(\"container\").innerHTML+=str;\n\n const path = 'personal_info/happy';\n const headers={\n 'Accept': 'application/json',\n 'Content-Type':'application/json',\n 'Authorization':'Token '+author_JSON,\n };\n const method = 'GET';\n api.makeAPIRequest(path,{\n method,headers,})\n .then(function(res){\n //console.log(res);\n \n var str_00=`<div class=\"personal_info_0\" id=personal_info_0> </div>`;\n document.getElementById(\"forum_per\").innerHTML+=str_00;\n\n var str=`<div class=\"forum_per_line\" id = forum_per_zid>&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"far fa-id-card\"></i> Z-ID: ${res[\"Students\"][0][\"ID\"]} </div>`;\n document.getElementById(\"personal_info_0\").innerHTML+=str;\n \n var str=`<div class=\"forum_per_line\" id = forum_per_Name>&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fas fa-file-signature\"></i> Name: ${res[\"Students\"][0][\"Name\"]} </div>`\n document.getElementById(\"personal_info_0\").innerHTML+=str;\n \n var str=`<div class=\"forum_per_line\" id = forum_per_Gender>&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fas fa-venus\"></i> Gender: ${res[\"Students\"][0][\"Gender\"]} </div>`\n document.getElementById(\"personal_info_0\").innerHTML+=str;\n \n var str=`<div class=\"forum_per_line\" id = forum_per_Birthday>&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fas fa-birthday-cake\"></i> Birthday: ${res[\"Students\"][0][\"Birthday\"]} </div>`\n document.getElementById(\"personal_info_0\").innerHTML+=str;\n \n var str=`<div class=\"forum_per_line\" id = forum_per_Email> &nbsp;&nbsp;&nbsp;&nbsp;<i class=\"far fa-envelope-open\"></i>Email: ${res[\"Students\"][0][\"Email\"]} </div>`\n document.getElementById(\"personal_info_0\").innerHTML+=str;\n \n var str_01=`<div class=\"personal_info_1\" id=personal_info_1> </div>`;\n document.getElementById(\"forum_per\").innerHTML+=str_01;\n \n\n var str=`<div class=\"forum_per_line\" id = forum_per_Course> &nbsp;&nbsp;&nbsp;&nbsp;<i class=\"fas fa-graduation-cap\"></i>Courses: </div>`\n document.getElementById(\"personal_info_1\").innerHTML+=str;\n\n\n for(var i=0; i<res[\"Students_type\"].length;i++){\n if (`${res[\"Students_type\"][i][\"Type\"]}`==1){\n var str=`<div class=\"forum_per_line\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${res[\"Students_type\"][i][\"Course\"]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Tutor]</div> `\n }else{\n var str=`<div class=\"forum_per_line\" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${res[\"Students_type\"][i][\"Course\"]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Student]</div> `\n }\n document.getElementById(\"personal_info_1\").innerHTML+=str;\n }\n \n var str_02=`<div class=\"personal_info_1\" id=personal_info_2> </div>`;\n document.getElementById(\"forum_per\").innerHTML+=str_02;\n\n var str=`<div class=\"forum_per_line\" id = forum_per_Course> &nbsp;&nbsp;&nbsp;&nbsp;<i class=\"far fa-bell\"></i>Upcoming: </div>`\n document.getElementById(\"personal_info_2\").innerHTML+=str;\n\n\n for(var i=0;i<res[\"Students_upcoming\"].length;i++){\n var str_time=`${timestamp(res[\"Students_upcoming\"][i][\"Time\"])}`;\n var str_body = `${res[\"Students_upcoming\"][i][\"Detail\"]}`\n var str=`<div class=forum_per_line id=forum_upcoming_box>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${str_time}&nbsp;&nbsp;&nbsp;------&nbsp;&nbsp;&nbsp;${str_body} </div>`;\n document.getElementById(\"personal_info_2\").innerHTML+=str;\n } \n \n })\n}", "title": "" }, { "docid": "d4d00db58e34bfdcd883bb937f498727", "score": "0.5549561", "text": "showStaff() {\n\t\t// Ensure no locally-cached data is present in staff table before populating\n\t\t$(this.tableSelector).find(\"tbody\").empty();\n\n\t\t// Column to fill tickets number into\n\t\tlet ticketsColumnIndex = $(this.tableSelector).find(\"tr\").first()\n\t\t\t\t.children(\"[data-slug=\\\"tickets.assigned\\\"]\").index();\n\n\t\t// Temporary array to hold staff IDs still awaiting ticket counts\n\t\tlet staffForTickets = [];\n\n\t\t// Put each staff member on table\n\t\tlet staff = this.staffManager.staff;\n\n\t\t// Add each staff member to a new row in the table\n\t\tfor (let employee of staff) {\n\t\t\tlet $tableRow = this.appendTableRow(employee);\n\t\t\tstaffForTickets.push(employee.id);\n\t\t}\n\n\t\t// Hide splash screen if there is at least 1 staff member in view\n\t\tthis.updateSplashScreen();\n\n\t\t// Get assigned ticket counts asynchronously\n\t\t(async(ids) => {\n\t\t\t// Get number of assigned tickets and fill column\n\t\t\tlet $rows = $(this.tableSelector).find(\"tbody\").children(\"tr\");\n\t\t\tlet tickets = this.ticketManager.getTicketsAssignedToStaffIds(ids);\n\n\t\t\t$rows.each((i, el) => {\n\t\t\t\tel.children[ticketsColumnIndex].textContent = tickets[i + 1] ? (tickets[i + 1].length || 0) : 0;\n\t\t\t});\n\t\t})(staffForTickets);\n\t}", "title": "" }, { "docid": "3b33f433a94b3d3b0857aade76667ee3", "score": "0.55279756", "text": "function studentInfo() {\n firebase.auth().onAuthStateChanged(function (user) {\n let dbref = db.collection(\"users/\").doc(user.uid);\n\n dbref.get()\n .then(snap => {\n let education = snap.data().education;\n let grade = snap.data().grade;\n\n if (education != \"\" && education != undefined) {\n $(\"#education\").show();\n $(\"#education\").text(\"Education Level: \" + education);\n }\n if (grade != \"\" && grade != undefined) {\n $(\"#grade\").show();\n $(\"#grade\").text(\"Grade Level: \" + grade);\n }\n })\n })\n}", "title": "" }, { "docid": "581a3f4d0535b7d42991a61e8afdfb88", "score": "0.5515951", "text": "getDataStudent() {\n let token = this.props.userData;\n if (token != \"\") {\n sessionStorage.setItem(\"token\", JSON.stringify(token));\n fetch(paths.PATH_BASE + services.MOODLEJSON + autentication.WSTOKEN + token + wsfunction.DATA_USER)\n .then(response => response.json())\n .then(studentData => this.getInfoUser(studentData))\n .catch(error => console.log(\"Error: \", error))\n }\n }", "title": "" }, { "docid": "cc8b11f02c62a0931279405de9fb1167", "score": "0.5508941", "text": "function getUserName() {\n $.get(\"/api/user_data\").then(data => {\n $(\".member-name\").text(data.name);\n // $(\".member-id\").text(`Your ID is ${data.id}`);\n $(\".member-id\").attr(\"value\", data.id);\n });\n }", "title": "" }, { "docid": "bf4ed26167b98a07c60720e0bafad244", "score": "0.5504502", "text": "async loadUserData() {\n let res = await fetch(this.props.source)\n if (res.status === 200) {\n let userData = await res.json();\n this.setState({userData, visibleUserData: userData})\n }\n }", "title": "" }, { "docid": "b57c9afd7033f7deb703119d4fe99c5c", "score": "0.54752934", "text": "fetchData(){ \n // const username = localStorage.getItem('user');\n let route = `patientrecords/doctor?q=${'aminu'}`;\n let success_callback = (data) => this.setState({ patientrecords: data })\n let error_callback = error => this.setState({error})\n _fetchData({ route, success_callback, error_callback })\n }", "title": "" }, { "docid": "232c7fa5779a0b94c48303afba213529", "score": "0.5471741", "text": "function renderUsers(){\r\n inputSearch();\r\n\r\n // Filter users\r\n const filteredUser = allUsers.filter(user => {\r\n const lowName = user.name.toLowerCase();\r\n const lowInputName = inputUser.value.toLowerCase();\r\n return lowName.includes(lowInputName);\r\n })\r\n\r\n // Order by ascending letters\r\n filteredUser.sort((a,b) => {\r\n return a.name.localeCompare(b.name)\r\n })\r\n\r\n // Show information on HTML\r\n let UsersHTML = '<div>';\r\n filteredUser.forEach(user => {\r\n const { name, picture, dob, gender } = user;\r\n const UserHTML = `\r\n <div class='info'>\r\n <img class='pic' src=\"${picture}\" alt=\"${name}\">\r\n <span class = 'content'>${name}, ${dob}, ${gender}</span>\r\n </div> \r\n </div> \r\n `;\r\n\r\n UsersHTML += UserHTML;\r\n });\r\n UsersHTML += '</div>';\r\n tabUsers.innerHTML = UsersHTML;\r\n countUsers.innerHTML = filteredUser.length;\r\n \r\n renderStatistics(filteredUser);\r\n}", "title": "" }, { "docid": "acea68320ea8364a3d23216ee588c54e", "score": "0.5465423", "text": "function getProfileData() {\n console.log('something else happened')\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "title": "" }, { "docid": "29674bd5d7249dc8c7d74c7934528360", "score": "0.5464341", "text": "function UserDetails({ usersData }) {\n const { userId } = useParams();\n const currentUser = usersData.find((user) => user.id == userId); // the current user to be displayed in detail whose user id is = userId(from URL)\n const myStyle = { fontWeight: \"bold\" };\n return (\n <>\n {currentUser ? (\n <div className=\"container mt-5\">\n <ul className=\"list-group\">\n <li className=\"list-group-item active\">\n <Link to=\"/userDataWebApp/\">\n <span className=\"mr-5\" style={{ color: \"white\" }}>\n <i className=\"fas fa-arrow-left\"></i>\n </span>\n </Link>\n <span>\n {\" \"}\n Details:{\" \"}\n <span style={myStyle}>\n {currentUser.first_name} {currentUser.last_name}\n </span>\n </span>\n </li>\n <li className=\"list-group-item\">\n First Name: <span style={myStyle}>{currentUser.first_name}</span>\n </li>\n <li className=\"list-group-item\">\n Last Name: <span style={myStyle}>{currentUser.last_name}</span>{\" \"}\n </li>\n <li className=\"list-group-item\">\n Company Name:{\" \"}\n <span style={myStyle}>{currentUser.company_name}</span>\n </li>\n <li className=\"list-group-item\">\n City: <span style={myStyle}>{currentUser.city}</span>\n </li>\n <li className=\"list-group-item\">\n State: <span style={myStyle}>{currentUser.state}</span>\n </li>\n <li className=\"list-group-item\">\n Zip: <span style={myStyle}>{currentUser.zip}</span>\n </li>\n\n <li className=\"list-group-item\">\n Email: <span style={myStyle}>{currentUser.email}</span>{\" \"}\n </li>\n <li className=\"list-group-item\">\n Web:{\" \"}\n <span style={myStyle}>\n <a href={currentUser.web} target=\"_blank\">\n {\" \"}\n {currentUser.web}\n </a>\n </span>\n </li>\n <li className=\"list-group-item\">\n Age: <span style={myStyle}> {currentUser.age}</span>\n </li>\n </ul>\n </div>\n ) : (\n <h1></h1>\n )}\n </>\n );\n}", "title": "" }, { "docid": "19015cc25e955519e080d5e3c5929e65", "score": "0.5462576", "text": "function getUserData(user){\n \n \n if(user.subjects != undefined){\n console.log(user.subjects);\n subject_data = user.subjects;\n }\n}", "title": "" }, { "docid": "afefdb09bbeabbb2fa2b7cf566172248", "score": "0.54597324", "text": "function user(request, response) {\n // if ure == \"/....\"\n const username = request.url.replace(\"/\", \"\")\n if (username.length > 0) {\n response.statusCode = 200\n response.setHeader(...commonHeaders)\n view(`header`, {}, response)\n\n //get json from Treehouse\n const studentProfile = new Profile(username)\n //on end\n studentProfile.on(\"end\", (profileJSON) => {\n //show profile\n\n // Store needed values\n const values = {\n avatarUrl: profileJSON.gravatar_url,\n username: profileJSON.profile_name,\n badges: profileJSON.badges.length,\n javascriptPoints: profileJSON.points.JavaScript\n }\n\n // simple response\n\n view(`profile`, values, response)\n view(`footer`, {}, response)\n response.end()\n })\n\n //on \"error\"\n studentProfile.on(\"error\", (error) => {\n //show error\n view(`error`, { errorMessage: error.message }, response)\n view(`search`, {}, response)\n view(`footer`, {}, response)\n response.end()\n })\n }\n}", "title": "" }, { "docid": "01266fa317aa5efcb6db8e58bef760bb", "score": "0.54514956", "text": "function onLoadFacility(result){\n if (!result.error) {\n\tpopulateFacilitiesTable(result);\n\tgetInstruments();\n\tpopulateModalitiesTable();\n\t// Built the form for selecting facilities\n\tvar template = \"<form onsubmit='return false' id='facility_form'><select name='facility_name' onchange='displayInstruments();'><option>all</option>{{#facilities}}<option>{{name}}</option>{{/facilities}}</select><select name='modality_name' onchange='displayInstruments();'><option>all</option>{{#modalities}}<option>{{name}}</option>{{/modalities}}</select></form>\"\n\tvar div = document.getElementById('facility_div');\n\tvar facilities = new Object();\n\tfacilities.facilities = facilities_table;\n\tfacilities.modalities = modalities_table;\n\tdiv.innerHTML = Mustache.to_html(template, facilities);\n }\n}", "title": "" }, { "docid": "e8de25c77a1b67156c9bd24e780645f5", "score": "0.5437332", "text": "function getInstructors() {\n instance\n .get(\"instructor/featured/\", {\n headers: {\n \"auth-token\": `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InNoYW5ld2FzYWhtZWRAZ21haWwuY29tIiwicGFzc3dvcmQiOiJQb3RhdG83MjYiLCJpYXQiOjE1OTU4NjA3MzYsImV4cCI6MTU5NTg2NDMzNn0.IRPW-1hioz4LZABZrmtYakjmDwORfKnzIWkwK3DzAXc`,\n },\n })\n .then((res) => {\n const instructorList = res.data;\n setInstructorList(instructorList);\n console.log(\"instructor list fetched in home: \" + instructorList);\n });\n }", "title": "" }, { "docid": "5c2477243dde694755e8911b8277f0ba", "score": "0.54314315", "text": "function GetPeople() {\n curentPage = this.value;\n let data = JSON.parse(localStorage.getItem(`people/?page=${this.value}`));\n if (data === null) Request(`people/?page=${this.value}`, CreatePeoplesTable);\n else {\n CreatePeoplesTable(data);\n }\n}", "title": "" }, { "docid": "e41712353c239592db95cdafff432545", "score": "0.54300624", "text": "function getFaculty(index, numCols, cells) {\n var individualFaculty = {};\n\n individualFaculty.firstName = getCell(index, cells);\n individualFaculty.lastName = getCell(++index, cells);\n individualFaculty.phone = getCell(++index, cells);\n individualFaculty.room = getCell(++index, cells);\n individualFaculty.dept = getCell(++index, cells);\n individualFaculty.position = getCell(++index, cells);\n individualFaculty.image = getCell(++index, cells);\n\n\n return individualFaculty;\n }", "title": "" }, { "docid": "5f54bf969d0a1b9bf4f6fd441519f1a0", "score": "0.5412763", "text": "function getEducation() {\n setLoading(true);\n ref.collection('education').onSnapshot((querySnapshot) => {\n const items = [];\n querySnapshot.forEach((doc) => {\n items.push({\n heading: doc.data().degree,\n description: doc.data().school,\n status: 'sample',\n statusIcon: <CheckRoundedIcon />,\n link: false,\n }\n );\n });\n setEducationDetails(items);\n setLoading(false);\n });\n }", "title": "" }, { "docid": "209a5ded9f1cede7b7e636b607cc1924", "score": "0.54122794", "text": "async processHome(req,res,next){\n let allCategory = await categoryService.getAllCategory();\n let dataClassOne = await classService.getAllClassByCourseIdSecond(subjects[0]);\n //Thử nghiệm trong th ít dữ liệu\n let dataClassTwo = await classService.getAllClassByCourseIdSecond(subjects[1]);\n //Thử nghiệm trong th ít dữ liệu\n let dataClassThree = await classService.getAllClassByCourseIdSecond(subjects[2]);\n\n let courseDataOne = await courseService.getCourseById2(subjects[0]);\n let courseDataTwo = await courseService.getCourseById2(subjects[1]);\n let courseDataThree = await courseService.getCourseById2(subjects[2]);\n\n for(let j =0 ; j<dataClassOne.length ; j++){\n let infoTeacher = await classService.getTeacherInfoByClassId(dataClassOne[j].id);\n dataClassOne[j].infoTeacher = infoTeacher;\n }\n for(let j =0 ; j<dataClassTwo.length ; j++){\n let infoTeacher = await classService.getTeacherInfoByClassId(dataClassTwo[j].id);\n dataClassTwo[j].infoTeacher = infoTeacher;\n }\n for(let j =0 ; j<dataClassThree.length ; j++){\n let infoTeacher = await classService.getTeacherInfoByClassId(dataClassThree[j].id);\n dataClassThree[j].infoTeacher = infoTeacher;\n }\n\n res.render('userHome',{layout:'backend',dataClassOne:dataClassOne,allCategory:allCategory,dataClassTwo:dataClassTwo,dataClassThree:dataClassThree,courseDataOne:courseDataOne,courseDataTwo:courseDataTwo,courseDataThree:courseDataThree});\n }", "title": "" }, { "docid": "41d8368bc3c3bb7c6e6331ce97cea0dc", "score": "0.5406335", "text": "function fetchData() {\n showWork();\n showEducation();\n showProjects();\n}", "title": "" }, { "docid": "2baa26906a3133fa163314e88faeda74", "score": "0.5406186", "text": "function user(request, response) {\n\n const renderer = new Renderer(response);\n\n const pathname = url.parse(request.url).pathname;\n const username = pathname.replace(/^\\/+/, \"/\").split(\"/\")[1];\n\n if (username && username.length && request.method === 'GET') {\n response.statusCode = 200;\n response.setHeader('Content-Type', 'text/html');\n\n const studentProfile = new Profile(username);\n studentProfile.on(\"end\", function(json) {\n\n // show profile\n var values = {\n avatarUrl: json.gravatar_url,\n username: json.profile_name,\n badges: json.badges.length,\n javascriptPoints: json.points.JavaScript\n };\n\n renderer.render('profile', values);\n });\n\n studentProfile.on(\"error\", function(err) {\n const values = {\n errorMessage: err.message\n };\n renderer.render(['error', 'search'], values);\n });\n }\n }", "title": "" }, { "docid": "cff6f93033e205282081c97c26f16fe0", "score": "0.54031926", "text": "function showProfileInfo() {\n document.getElementById(\"userImage\").src = userDataItem.profileImage;\n document.getElementById(\"myFirstName\").innerHTML = userDataItem.firstName;\n document.getElementById(\"myLastName\").innerHTML = userDataItem.lastName;\n document.getElementById(\"myDob\").innerHTML = userDataItem.dateOfBirth;\n document.getElementById(\"myGender\").innerHTML = userDataItem.gender;\n document.getElementById(\"myPhone\").innerHTML = userDataItem.phoneNumber;\n document.getElementById(\"myEmail\").innerHTML = userDataItem.email;\n document.getElementById(\"myLinkedin\").innerHTML = userDataItem.linkedin;\n document.getElementById(\"myFieldMajor\").innerHTML = userDataItem.fieldMajor;\n\n\n switch (userDataItem.educational) {\n case \"sd\":\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"School Degree(10th)\";\n break;\n case \"hsd\":\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"High School Degree(12th)\";\n break;\n case \"bd\":\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"Bachelor's Degree\";\n break;\n case \"md\":\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"Master's Degree\";\n break;\n case \"dd\":\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"Doctorate Degree\";\n break;\n default:\n // code block\n document.getElementById(\"myHighestDegree\").innerHTML = \"Nothing\";\n }\n\n switch (userDataItem.employmentStatus) {\n case \"e\":\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Employed\";\n break;\n case \"se\":\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Self Employed\";\n break;\n case \"s\":\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Student\";\n break;\n case \"r\":\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Retired\";\n break;\n case \"o\":\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Other\";\n break;\n default:\n // code block\n document.getElementById(\"myEmployment\").innerHTML = \"Not available\";\n }\n document.getElementById(\"containerss\").style.display = \"none\";\n document.getElementById(\"overlay\").style.display = \"none\";\n\n\n}", "title": "" }, { "docid": "d753e452ca122294fe22764a638815f6", "score": "0.54003173", "text": "function loadUserData() {\n const userData = JSON.parse(this.responseText);\n\n if (userData == null) {\n return;\n }\n addMessage(\"Info\", `Logged in as ${userData.name}`);\n window.sessionStorage.setItem(\"userData\", userData);\n //visibilityOfCreateForms(userData.role == \"admin\" ? \"none\" : \"block\");\n GetElement(\"#user_selector\").style.display = userData.role == \"admin\" ? \"inline-block\" : \"none\";\n hideUserData();\n\n const userDataE = GetElement(\"#user_data\");\n userDataE.textContent = null;\n userDataE.setAttribute(\"userId\", userData.id);\n\n let roleE = CreateElement(\"label\");\n roleE.className = \"role\";\n roleE.style.display = \"block\";\n roleE.textContent = userData.role;\n userDataE.appendChild(roleE);\n\n let usernameE = CreateElement(\"label\");\n usernameE.className = \"username\";\n usernameE.style.display = \"block\";\n usernameE.textContent = userData.name;\n userDataE.appendChild(usernameE);\n\n let coinsE = CreateElement(\"i\");\n coinsE.setAttribute(\"id\", \"gold_counter\");\n coinsE.className = \"fas fa-coins\";\n coinsE.style.color = \"#ffd800\"\n coinsE.style.display = \"block\";\n coinsE.textContent = \" 0\";\n userDataE.appendChild(coinsE);\n\n updateGoldCounter();\n}", "title": "" }, { "docid": "407d5951a020ebacea23b7766024cf0c", "score": "0.5399438", "text": "renderUserContent() {\n // If user is logged in, auth will not be null\n if (this.props.auth) {\n // Render first name\n // FIXME this looks gross\n return <div className='card blue accent-4 white-text'>\n <div className='card-content'>\n <div className='chip blue lighten-2 white-text right'><Greeting name={ this.props.auth.firstName } /></div>\n <p className='flow-text center-align'><h4>Survey Dashboard</h4></p>\n </div>\n </div>\n }\n }", "title": "" }, { "docid": "25a4107801d08f20fa852daea5588269", "score": "0.5394734", "text": "function loadEmployees() {\n return filterState.map(user => {\n return <Card key={user.login.uuid}\n picture={user.picture.large}\n alt={user.name.first + \" \" + user.name.last}\n firstName={user.name.first}\n lastName={user.name.last}\n // order=\"\"\n by={user.name.last}\n email={user.email}\n dob={user.dob.date}\n />\n })\n }", "title": "" }, { "docid": "3a246a4413c26359eee615cac7af354b", "score": "0.53841054", "text": "function _renderMemberList() {\r\n // Set title\r\n memberListe.innerHTML = \"<span class='membersListTitle'> Members:</span>\";\r\n\r\n // Get local storage\r\n let member = getLocalStorage(\"member\");\r\n\r\n // Render existing members from local storage\r\n for (var i = 0; i < member.length; i++) {\r\n memberListe.innerHTML += `<li class=\"list\">${member[i].name} <span onclick=\"deleteMemberOrGroup(event, 'member')\" class=\"delete\"> &emsp; X </span></li>`;\r\n\r\n }\r\n}", "title": "" }, { "docid": "de1734d6f61aa7611c10c05897631c65", "score": "0.53800774", "text": "getUsers() {\n const { userSession } = this.state;\n if(userSession.isUserSignedIn()){\n const userData = userSession.loadUserData();\n this.setState({\n userData\n })\n }\n // fetch(\"http://localhost:3000/api/v1/users\").then(res => res.json()).then(users => {\n // console.log(users)\n // if (userSession.isUserSignedIn()) {\n // const userData = userSession.loadUserData();\n\n // this.setState({\n // userData\n // });\n\n // let currentUser = users.find(\n // user => user.username === userData.username\n // );\n\n // if (currentUser) {\n // this.setState({ users, currentUser });\n // } else {\n // this.createUser(userData.username);\n // }\n // }\n // });\n }", "title": "" }, { "docid": "4c82d60ff3693a75fc7117102de83f14", "score": "0.53795606", "text": "function getDetails()\n {\n var username = $(\"#user\").html();\n parseAuthorities;\n\n userDetails = $.ajax({\n url : \"./getUser.php\",\n type : \"POST\",\n data : {\n username : username\n },\n async : false\n }).done(function(user)\n {\n // Update fields\n $(_.keys(user)).each(function()\n {\n if ($(\"#\" + this).attr(\"type\") == \"checkbox\")\n {\n $(\"#\" + this).prop(\"checked\", user[this] === 'true');\n } else if ($(\"#\" + this).is(\"table\"))\n {\n parseAuthorities(user);\n } else\n {\n if (this != \"password\")\n {\n $(\"#\" + this).val(user[this]);\n console.log(\"UPDATED \" + this);\n }\n }\n });\n }).responseJSON;\n }", "title": "" }, { "docid": "481dd9335167546fa554179e3b3837ba", "score": "0.53783625", "text": "function getMember(MemberId, TeamId) {\n // Pull team details under a teamId\n $.getJSON(`/api/teams/${TeamId}/members/${MemberId}`, function(data) {\n member = data;\n })\n .done(function() {\n // upon successful AJAX call perform the below\n //Populate DOM with values and set attribute accordingly\n loadMemb(member);\n setDispMembAttr();\n })\n .fail(function() {\n // upon failure response, send message to user\n errorMsg = \"Failure to get data for Member details, please retry\"\n $(\"#errorMsgId\").html(errorMsg);\n $(\"#errorMsgId\").addClass(\"badInput\");\n });\n}", "title": "" }, { "docid": "b4ef64f72ce542bd254b1416ece2dcef", "score": "0.537788", "text": "function showEducation()\n {\n var id= $stateParams.empId;\n $http.get( '/getAllEducation/' + id )\n .success( function ( response )\n { \n $scope.educational = response; \n });\n\n var userId= $stateParams.userId;\n $http.get( '/getAllEducation/' + userId )\n .success( function ( response )\n { \n $scope.profEducational = response; \n });\n }", "title": "" }, { "docid": "f9dfd62d16d8775b4964a40dc934b570", "score": "0.5373136", "text": "function PatientInfo() {\r\n const profile = useSelector((state) => state.auth.user);\r\n const [user, setUser] = useState({\r\n fullname: '',\r\n dob: '',\r\n country: '',\r\n address: '',\r\n email: '',\r\n phone: '',\r\n state: '',\r\n gender: '',\r\n });\r\n const [loading, toggle] = useState(false);\r\n const dispatch = useDispatch();\r\n const handleSubmit = () => {\r\n toggle(true);\r\n dispatch(submitBasicInfo(user, () => toggle(false)));\r\n };\r\n\r\n useEffect(\r\n () => {\r\n setUser(profile);\r\n },\r\n [profile],\r\n );\r\n\r\n const onInputChange = (key, value) => {\r\n setUser((prev) => ({ ...prev, [key]: value }));\r\n };\r\n\r\n return (\r\n <Card className=\"p-2 mb-2\">\r\n <h6 className=\"font-weight-bold\">Basic Profile Information</h6>\r\n\r\n <Avatar src={require('../../../images/avatar.png')} size={80} />\r\n <FormGroup row>\r\n <div className=\"col-md-6\">\r\n <span className=\"\">Full Name </span>\r\n <input\r\n onChange={(e) => onInputChange('fullname', e.target.value)}\r\n className=\"form-control\"\r\n type=\"text\"\r\n value={user.fullname}\r\n disabled\r\n />\r\n </div>\r\n <div className=\"col-md-6\">\r\n <span className=\"\">Email: </span>\r\n <input\r\n onChange={(e) => onInputChange('email', e.target.value)}\r\n className=\"form-control\"\r\n type=\"email\"\r\n value={user.email}\r\n disabled\r\n />\r\n </div>\r\n </FormGroup>\r\n <FormGroup row>\r\n <div className=\"col-md-6\">\r\n <span className=\"\">Phone: </span>\r\n <input\r\n onChange={(e) => onInputChange('phone', e.target.value)}\r\n className=\"form-control\"\r\n type=\"tel\"\r\n value={user.phone}\r\n />\r\n </div>\r\n\r\n <div className=\"col-md-6\">\r\n <span className=\"\">Address (Location):</span>\r\n <input\r\n onChange={(e) => onInputChange('address', e.target.value)}\r\n className=\"form-control\"\r\n type=\"address\"\r\n value={user.address}\r\n />\r\n </div>\r\n </FormGroup>\r\n <FormGroup row className=\"mb-0\">\r\n <div className=\"col-md-6 col-lg-6\">\r\n <span className=\"\">Gender </span>\r\n <input\r\n onChange={(e) => onInputChange('gender', e.target.value)}\r\n className=\"form-control\"\r\n type=\"gender\"\r\n value={user.gender}\r\n />\r\n </div>\r\n {/* {JSON.stringify(profile)} */}\r\n <InputGroup\r\n label=\"Date of Birth\"\r\n type=\"date\"\r\n onChange={(e) => onInputChange('dob', e.target.value)}\r\n value={user.dob}\r\n // editable={!(user.dob || user.dob === '')}\r\n container=\"col-md-6 col-lg-6\"\r\n />\r\n </FormGroup>\r\n <FormGroup row className=\"mt-0\">\r\n <div className=\"col-md-6\">\r\n <span className=\"\">State</span>\r\n <input\r\n onChange={(e) => onInputChange('state', e.target.value)}\r\n className=\"form-control\"\r\n type=\"text\"\r\n value={user.state}\r\n />\r\n </div>{' '}\r\n <div className=\"col-md-6\">\r\n <span className=\"\">Country</span>\r\n <input\r\n onChange={(e) => onInputChange('country', e.target.value)}\r\n className=\"form-control\"\r\n type=\"text\"\r\n value={user.country}\r\n />\r\n </div>\r\n </FormGroup>\r\n\r\n <div className=\"d-flex flex-row justify-content-center\">\r\n <Button color=\"primary\" className=\"m-2\" onClick={handleSubmit}>\r\n {loading ? (\r\n 'Loading...'\r\n ) : (\r\n <>\r\n <MdUpdate size={20} className=\"mr-1\" />\r\n Update Profile\r\n </>\r\n )}\r\n </Button>\r\n </div>\r\n </Card>\r\n );\r\n}", "title": "" }, { "docid": "a46fb033a74cab1289e099fc19e3ffd2", "score": "0.536882", "text": "function findMemberByName() {\n const name = document.querySelector(\"#schoolDetailForm [name=name]\").value || null;\n\n return axios\n .get(`/member?name=${name}`)\n .then(response => response.data)\n .catch(e => console.error(e));\n}", "title": "" }, { "docid": "ce4d02af40001a7b2e9088cb552fe428", "score": "0.5364875", "text": "function getUsers() {\n // Runs function to get all the users from database\n User.getUsers().then(function(data) {\n // Check if able to get data from database\n if (data.data.success) {\n // Check which permissions the logged in user has\n if (data.data.police_permission === 'main' || data.data.police_permission === 'station') {\n app.police_users = data.data.police_users; // Assign users from database to variable\n app.loading = false; // Stop loading icon\n app.accessDenied = false; // Show table\n // Check if logged in user is an admin or moderator\n\n if (data.data.police_permission === 'main') {\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.stationAccess = true;\n app.mainAccess = true;\n app.userAccess = false;\n app.Agno = true;\n app.Aguilar = true;\n app.Alcala = true;\n app.Anda = true;\n app.Asingan = true;\n app.Balungao = true;\n app.Bani = true;\n app.Basista = true;\n app.Bautista = true;\n app.Bayambang = true;\n app.Binalonan = true;\n app.Binmaley = true;\n app.Bolinao = true;\n app.Bugallon = true;\n app.Burgos = true;\n app.Calasiao = true;\n app.Dasol = true;\n app.Infanta = true;\n app.Labrador = true;\n app.Laoac = true;\n app.Lingayen = true;\n app.Mabini = true;\n app.Malasiqui = true;\n app.Manaoag = true;\n app.Mangaldan = true;\n app.Mangatarem = true;\n app.Mapandan = true;\n app.Natividad = true;\n app.Pozorrubio = true;\n app.Rosales = true;\n app.SanFabian = true;\n app.SanJacinto = true;\n app.SanManuel = true;\n app.SanNicolas = true;\n app.SanQuintin = true;\n app.SantaBarbara = true;\n app.SantaMaria = true;\n app.Sison = true;\n app.Sual = true;\n app.Tayug = true;\n app.Umingan = true;\n app.Urbiztondo = true;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.disabledOption = true;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Agno') {\n app.disabledOption = true;\n app.Agno = true;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Aguilar') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = true;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Alcala') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = true;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Anda') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = true;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Asingan') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = true;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Balungao') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = true;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Bani') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = true;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Basista') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = true;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Bautista') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = true;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Bayambang') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = true;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Binalonan') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = true;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Binmaley') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = true;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Bolinao') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = true;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Bugallon') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = true;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Burgos') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = true;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Calasiao') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = true;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Dasol') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = true;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Infanta') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = true;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Labrador') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = true;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Laoac') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = true;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Lingayen') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = true;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Mabini') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = true;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Malasiqui') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = true;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Manaoag') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = true;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Mangaldan') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = true;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Mangatarem') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = true;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Mapandan') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = true;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Natividad') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = true;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Pozorrubio') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = true;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Rosales') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = true;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'San Fabian') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = true;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'San Jacinto') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = true;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'San Manuel') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = true;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'San Nicolas') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = true;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'San Quintin') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = true;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Santa Barbara') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = true;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Santa Maria') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = true;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Sison') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = true;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n }else if (data.data.police_permission === 'station' && data.data.police_station === 'Sual') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = true;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Tayug') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = true;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Umingan') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = true;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Urbiztondo') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = true;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n } else if (data.data.police_permission === 'station' && data.data.police_station === 'Villasis') {\n app.disabledOption = true;\n app.Agno = false;\n app.Aguilar = false;\n app.Alcala = false;\n app.Anda = false;\n app.Asingan = false;\n app.Balungao = false;\n app.Bani = false;\n app.Basista = false;\n app.Bautista = false;\n app.Bayambang = false;\n app.Binalonan = false;\n app.Binmaley = false;\n app.Bolinao = false;\n app.Bugallon = false;\n app.Burgos = false;\n app.Calasiao = false;\n app.Dasol = false;\n app.Infanta = false;\n app.Labrador = false;\n app.Laoac = false;\n app.Lingayen = false;\n app.Mabini = false;\n app.Malasiqui = false;\n app.Manaoag = false;\n app.Mangaldan = false;\n app.Mangatarem = false;\n app.Mapandan = false;\n app.Natividad = false;\n app.Pozorrubio = false;\n app.Rosales = false;\n app.SanFabian = false;\n app.SanJacinto = false;\n app.SanManuel = false;\n app.SanNicolas = false;\n app.SanQuintin = false;\n app.SantaBarbara = false;\n app.SantaMaria = false;\n app.Sison = false;\n app.Sual = false;\n app.Tayug = false;\n app.Umingan = false;\n app.Urbiztondo = false;\n app.Villasis = false;\n app.editAccess = true; // Show edit button\n app.deleteUserAccess = true; // Show delete button\n app.permissionAccess = true;\n app.userAccess = true;\n app.stationAccess = false;\n }\n } else {\n app.errorMsg = 'Insufficient Permissions'; // Reject edit and delete options\n app.loading = false; // Stop loading icon\n }\n } else {\n app.errorMsg = data.data.message; // Set error message\n app.loading = false; // Stop loading icon\n }\n });\n }", "title": "" }, { "docid": "562cc72406c840f58b2dce634a3cded9", "score": "0.53625315", "text": "function getTeamMembDetails(MemberId, team) {\n\n $(\"#contentDiv\").empty();\n $(\"#contentDiv\")\n .append($(\"<section/>\")\n .attr(\"id\", \"membSection\")\n .append($(\"<h2/>\")\n .attr(\"class\", \"font-italic\")\n .html(\"Member Profile\"))\n .append($(\"<form/>\")\n .attr(\"id\", \"editMembForm\")\n .attr(\"action\", \"#\")\n .attr(\"target\", \"_self\")\n .attr(\"method\", \"GET\")\n )\n )\n //display the team name to user as reference during addition of member\n let inputDiv = getInputDiv(\"teamname\", \"Team Name\", \"\", \"text\");\n $(\"#editMembForm\").append(inputDiv);\n $(\"#teamname\").val(team.TeamName);\n $(\"#teamname\").attr(\"readonly\", true);\n //Generate all inputDiv dynamically for registering a team\n inputDiv = getInputDiv(\"memberid\", \"Member Id\", \"\", \"Number\");\n $(\"#editMembForm\").append(inputDiv);\n $(\"#memberid\").attr(\"readonly\", true);\n inputDiv = getInputDiv(\"membername\", \"Member Name\", \"Enter Member Name\", \"text\");\n $(\"#editMembForm\").append(inputDiv);\n inputDiv = getInputDiv(\"email\", \"Member Email\", \"Enter Member Email\", \"email\");\n $(\"#editMembForm\").append(inputDiv);\n inputDiv = getInputDiv(\"phone\", \"Member Phone No\", \"Enter Member Phone No\", \"text\");\n $(\"#editMembForm\").append(inputDiv);\n inputDiv = getInputDiv(\"contactname\", \"Contact Name\", \"Enter Contact Name\", \"text\");\n $(\"#editMembForm\").append(inputDiv);\n inputDiv = getInputDiv(\"age\", \"Age\", \"Enter Member Age\", \"number\");\n $(\"#editMembForm\").append(inputDiv);\n // Gender selection radio box\n $(\"#editMembForm\").append($(\"<div>\")\n .attr(\"class\", \"row form-check form-check-inline col-md-8 ml-2 mt-1\")\n .append($(\"<div/>\")\n .attr(\"class\", \"offset-md-6\"))\n .append($(\"<div/>\")\n .attr(\"id\", \"maleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"gender\")\n .attr(\"id\", \"male\")\n .val(\"Male\")\n .attr(\"type\", \"radio\")\n .attr(\"checked\", true))\n .append($(\"<label/>\")\n .attr(\"class\", \" form-check-label\")\n .attr(\"for\", \"male\")\n .html(\"Male\")))\n .append($(\"<div/>\")\n .attr(\"id\", \"femaleDiv\")\n .append($(\"<input/>\")\n .attr(\"class\", \"form-check-input ml-4\")\n .attr(\"name\", \"gender\")\n .attr(\"id\", \"female\")\n .val(\"Female\")\n .attr(\"type\", \"radio\"))\n .append($(\"<label/>\")\n .attr(\"class\", \"form-check-label\")\n .attr(\"for\", \"female\")\n .html(\"Female\"))))\n // Button for action on members \n $(\"#editMembForm\").append($(\"<div/>\")\n .attr(\"class\", \"row offset-md-4 col-md-8\")\n .attr(\"id\", \"dispMembDiv\")\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .attr(\"type\", \"button\")\n .html(\"Edit\")\n .on(\"click\", function(e) {\n e.preventDefault();\n //Clear prior informational message\n $(\"#errorMsgId\").empty();\n getEditMemb(MemberId, team);\n })))\n // button to reset the member registration form\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-danger\")\n .attr(\"data-toggle\", \"modal\")\n .attr(\"data-target\", \"#unRegisterMemberDiv\")\n .attr(\"type\", \"button\")\n .html(\"Delete\")\n .on(\"click\", function(e) {\n e.preventDefault();\n //Clear prior informational message\n $(\"#errorMsgId\").empty();\n delMemb(MemberId, team);\n })\n ))\n // button to go back to team details page on cancel \n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .html(\"Go back\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n getTeamDetail(team.TeamId);\n }))))\n\n $(\"#editMembForm\").append($(\"<div/>\")\n .attr(\"class\", \"row offset-md-4 col-md-8\")\n .attr(\"id\", \"editMembDiv\")\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .attr(\"type\", \"button\")\n .html(\"Save\")\n .on(\"click\", function(e) {\n //Clear prior informational message\n $(\"#errorMsgId\").empty();\n e.preventDefault();\n subEditMembForm(MemberId, team);\n })))\n // button to reset the member registration form\n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-danger\")\n .attr(\"type\", \"button\")\n .html(\"Reset\")\n .on(\"click\", function(e) {\n //Clear prior informational message\n $(\"#errorMsgId\").empty();\n e.preventDefault();\n loadMemb(member);\n })\n ))\n // button to go back to team details page on cancel \n .append($(\"<div/>\")\n .attr(\"class\", \"mt-3 col-md-2\")\n .append($(\"<button/>\")\n .attr(\"class\", \"btn btn-sm btn-block btn-primary btn-info\")\n .html(\"Cancel\")\n .on(\"click\", function(e) {\n e.preventDefault();\n // clear any informational message\n $(\"#errorMsgId\").empty();\n getTeamMembDetails(MemberId, team);\n }))))\n //Get member details from server to populate values for above team member template\n getMember(MemberId, team.TeamId);\n}", "title": "" }, { "docid": "4ba688bb616c274f1a7b9cd41c4b9a7d", "score": "0.53584194", "text": "function requestStaffList() {\n //If the api is all fine.\n if (http.readyState === 4 && http.status === 200) {\n //Parse the response text as staffList\n var staffList = JSON.parse(http.responseText);\n if (staffList !== null) {\n //Call displayStaffList\n displayStaffList(staffList);\n } else {\n hideStaffList();\n }\n }\n //Wont handle an error here as it should've happened already if there was one.\n}", "title": "" }, { "docid": "62900d1b10d8cded9b7e15de4d507c59", "score": "0.5356593", "text": "function showPetInfo() {\n\n //ajax calling user data from apiRoutes\n $.get(\"/profile/user\", function(data) {\n var dataString = JSON.stringify(data);\n var first = capitalizeFirstLetter(data.first_name);\n var last = capitalizeFirstLetter(data.last_name)\n //this will capture the first letter of the last name to show on profile (i.e. Jessica G.)\n var lastInitial = capitalizeFirstLetter(data.last_name[0] + \".\");\n $(\"#bulletinUser\").text(first + ' ' + lastInitial);\n $(\"#bulletinUserCity\").text(data.locality + \", \" + data.administrative_area_level_1);\n });\n\n }", "title": "" }, { "docid": "215501c2acefdbc7d887db693990be5a", "score": "0.5348649", "text": "render() {\n // console.log(this.props);\n const { userData, deptMapping } = this.props;\n return (\n <div className=\"user-block\">\n <h5>{userData.name}</h5>\n {/* Each row - contains Subject(Dept) and sub category */}\n {/* we are sending all depts and selected subject and dept mapping (sub depts - m1,m2,etc) */}\n {userData.subjects.map(subject => <EachRow key={subject} allDept={userData.subjects} selectedDept={subject} deptCategories={deptMapping} />)}\n </div>\n );\n }", "title": "" }, { "docid": "1ba31d80468d454f12e27c010c82248d", "score": "0.53389573", "text": "function getUser() {\n $.ajax({\n url: \"api/students/5\",\n type: \"GET\"\n }).then(function (res) {\n console.log(res);\n $(\"#lastName\").val(res.lastname);\n $(\"#firstName\").val(res.firstname);\n $(\"#email\").val(res.email);\n $(\"#phone\").val(res.phone);\n $(\"#schoolName\").val(res.school_name);\n $(\"#startDate\").val(res.program_start);\n $(\"#endDate\").val(res.program_end);\n $(\"#edLvl\").val(res.ed_level);\n $(\"#termType\").val(res.qt_sem);\n $(\"#cipCode\").val(res.cip_code_one);\n });\n}", "title": "" }, { "docid": "eb840bf1b109531ba86a61012378e0e2", "score": "0.53338027", "text": "function ViewDoctorProfile(doctorID) {\n var url = baseURL + `Doctor/GetDoctorProfile?doctorId=${doctorID}`;\n $.ajax({\n url: url,\n type: \"GET\",\n datatype: \"application/json\",\n contentType: \"application/json; charset=utf-8\",\n data: \"\",\n beforeSend: function () {\n // $.LoadingOverlay(\"show\");\n },\n success: function (data, textStatus, xhr) {\n var ViewDoctorProfileTemplate = $(\"#doctorProfile-template\").html();\n $(\"#slideDocProfile\").html(\n Mustache.to_html(ViewDoctorProfileTemplate, data)\n );\n viewHistory();\n },\n error: function (xhr, textStatus, err) {\n console.log(\"error\");\n if (xhr.status == \"500\" && xhr.statusText == \"InternalServerError\")\n console.log(xhr.statusText);\n else console.log(xhr.statusText);\n },\n complete: function (data) {\n // Hide Loading\n $.LoadingOverlay(\"hide\");\n },\n });\n}", "title": "" }, { "docid": "682daacd96c63c0be8438718006933e1", "score": "0.53332657", "text": "function getSportParticipants(sport_id, sport) {\r\n Materialize.toast('Fetching Participants Details', 2000);\r\n var csrf_token = getCookie('csrftoken');\r\n var data = {\r\n \"sport_id\": sport_id,\r\n \"csrfmiddlewaretoken\": csrf_token\r\n };\r\n var data_send = JSON.stringify(data);\r\n var ajaxRequest = new XMLHttpRequest();\r\n var url = 'https://api.myjson.com/bins/1ggsw3';\r\n ajaxRequest.open(\"GET\", url, true);\r\n ajaxRequest.setRequestHeader(\"Content-type\", \"application/json\");\r\n //ajaxRequest.setRequestHeader(\"X-CSRFToken\", csrf_token);\r\n ajaxRequest.onreadystatechange = function() {\r\n if (ajaxRequest.readyState === 4 && ajaxRequest.status === 200) {\r\n var participantsDetails = JSON.parse(ajaxRequest.responseText);\r\n if (participantsDetails.error != null) {\r\n triggerError(participantsDetails.error)\r\n } else {\r\n // Use the Participants Details fetched below.\r\n var people = participantsDetails;\r\n // A function to get the list of people who have been enrolled in the sport of sport_id and store in an array;\r\n for(var x in people) {\r\n if(sport_id!=people[x].captain) {\r\n if (sport.parentElement.children[3].getAttribute('id')=='list') {\r\n sport.parentElement.children[3].innerHTML+=\"<li class='people'>\"+people[x].name+\"<span class='edit-name-icon badge black-text' onclick='editname(\"+sport_id+\",\\\"\"+people[x].name+\"\\\")'><i class='material-icons'>edit</i></span></li>\";\r\n } else {\r\n sport.parentElement.children[4].innerHTML+=\"<li class='people'>\"+people[x].name+\"<span class='edit-name-icon badge black-text' onclick='editname(\"+sport_id+\",\\\"\"+people[x].name+\"\\\")'><i class='material-icons'>edit</i></span></li>\";\r\n }\r\n }\r\n else {\r\n if (sport.parentElement.children[3].getAttribute('id')=='list') {\r\n sport.parentElement.children[3].innerHTML+=\"<li class='people'>\"+people[x].name+\"</li>\";\r\n } else {\r\n sport.parentElement.children[4].innerHTML+=\"<li class='people'>\"+people[x].name+\"</li>\";\r\n }\r\n }\r\n }\r\n Materialize.toast('Updated!', 2000);\r\n }\r\n } else if (ajaxRequest.readyState === 4 && ajaxRequest.status != 200) {\r\n Materialize.toast('Error Fetching Details!', 2000);\r\n }\r\n }\r\n ajaxRequest.send(data_send);\r\n}", "title": "" }, { "docid": "b1b7daf37d88133e95c57f79efa640b0", "score": "0.5333174", "text": "function screenRequest(req, res, userId, sectionId, next) {\n // Callback signature: (req, res)\n // User must be authorized by Web app to view anything.\n switch (req.session.userAuthMethod) {\n case 'dev':\n // Developers are allowed to see everything.\n process.nextTick(next, req, res);\n break;\n case 'lti':\n // LTI users can only see Canvas data for themselves.\n var ltiUserId = parseInt(req.session.custom_canvas_user_id);\n if (userId && (userId != ltiUserId)) {\n return badRequest(req, res);\n }\n\n // TODO: Secure sectionID\n // // LTI users can only see Canvas data for sections they teach.\n // if (sectionId) {\n // canvasEntities.getFacultyList(req, (err, json) => {\n // if (err) return res.render('dash/facultyDashErr', { 'err': err } );\n //\n // if (!json.find(\n // e => (e.user_id === ltiUserId) && (e.course_section_id === sectionId))) {\n // return badRequest(req, res);\n // }\n // return badRequest(req, res);\n // }); // end getFacultyList callback\n //\n // // If we got this far, it's ok to render the page for the user.\n // return process.nextTick(next, req, res);\n //\n // } // end if sectionId\n\n // If we got this far, it's ok to render the page for the user.\n process.nextTick(next, req, res);\n break;\n default:\n // Unauthrorized users shouldn't see any data.\n badRequest(req, res);\n break;\n } // end switch\n}", "title": "" }, { "docid": "1d4ee0a06b8e36572ada6cc2f5927e6e", "score": "0.5329816", "text": "static enroleUser(userData) {\n let dataToSend = \"courseId=\" + userData.course.courseId + \"&courseName=\";\n dataToSend = dataToSend + userData.course.courseName + \"&emailId=\";\n dataToSend = dataToSend + userData.emailId;\n let url = \"http://localhost:3000/course/rest/enroleUser\";\n return AjaxRequest.getDataFromApi(url, dataToSend);\n }", "title": "" }, { "docid": "9354a7b65e64262bb0c84274341aa459", "score": "0.53263277", "text": "function initializeEstateAndMembers() {\n authService.getEstateFromID(estateID).then((res) => {\n let tempEstate = new Estate();\n tempEstate.state = {\n id: res.data.id,\n name: res.data.username,\n status: res.data.status,\n members: res.data.users,\n };\n let initMembers = [];\n\n for (let i = 0; i < tempEstate.state.members.length; i++) {\n let tempUser = new User();\n tempUser.state = {\n id: res.data.users[i].id,\n name: res.data.users[i].username,\n email: res.data.users[i].email,\n };\n if (tempUser.state.name != localStorage.getItem('userName')) {\n initMembers.push(tempUser);\n }\n }\n let newMembers = members.concat(initMembers);\n setMembers(newMembers);\n\n setEstateName(res.data.name);\n setIsLoading(false);\n });\n }", "title": "" }, { "docid": "539b7c43900eaf0e7373d2026ffc1caf", "score": "0.53200346", "text": "function myProfile() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n // User is signed in.\n var db = firebase.firestore();\n var docRef = db.collection(\"Users\").doc(user.uid);\n docRef.get().then(function(doc) {\n if(doc && doc.exists) {\n const myData = doc.data();\n const name = myData.name;\n const age = myData.age;\n const gender = myData.gender;\n const description = myData.description;\n document.getElementById(\"userName\").innerHTML = name;\n document.getElementById(\"age\").innerHTML = age;\n document.getElementById(\"gender\").innerHTML = gender;\n document.getElementById(\"description\").innerHTML = description;\n \n }\n }).catch(function(error) {\n console.log(\"Got an error: \",error);\n });\n } else {\n console.log(\"no user found!\")\n }\n\n })\n}", "title": "" }, { "docid": "3eb2c28473186500d0e7f4be5460d9a7", "score": "0.53188676", "text": "loadResources () {\n // Show modal loading animation\n appMethods.setIsLoading(true);\n \n // Get the members list and sort it alphabetically.\n ajax.getMembers().then((members) => {\n this.membersSorted = members.sort((a, b) => {\n const aLower = a.name.toLowerCase(),\n bLower = b.name.toLowerCase();\n \n if (aLower > bLower) {\n return 1;\n } else if (bLower > aLower) {\n return -1;\n }\n \n return 0;\n });\n \n this.members = this.membersSorted;\n \n // Hide modal loading animation\n appMethods.setIsLoading(false);\n });\n }", "title": "" }, { "docid": "0251fc14930e35ce0a1e1fcf0d45b92c", "score": "0.5318294", "text": "async componentDidMount() {\r\n const userData = await this.DBHandler.getDBUserData()\r\n\r\n const familyid = userData.family;\r\n\r\n const membersData = (await this.APIHandler.getFamilyMembers(familyid)).data;\r\n // set to family database data loaded from backend\r\n this.setState({\r\n familyid: familyid,\r\n userData: membersData,\r\n isLoading: false\r\n })\r\n }", "title": "" }, { "docid": "d9f5495a0c86d538f79817e8029e292c", "score": "0.5316085", "text": "function getPersonalData(loader) {\n var url = \"https://www.xn--90aodoeldy.kz/mobile_api/pageInit/account.php\";\n\n $$.ajax({\n dataType: 'json',\n url: url,\n beforeSend: function(xhr) {\n bankaKZ.showIndicator();\n },\n complete: function(resp) {\n bankaKZ.hideIndicator();\n if ((resp.status == 200) && (networkState !== Connection.NONE)) {\n var data = JSON.parse(resp.response);\n mainView.router.load({\n reload: loader,\n template: Template7.templates.personalTemplate,\n context: data\n });\n } else {\n noConnection();\n }\n },\n error: function(xhr) {\n console.log(\"Error on ajax call \" + xhr);\n if (devMode) alert(JSON.parse(xhr));\n }\n });\n}", "title": "" }, { "docid": "5574fb3ffc68864f0baf514d88955a3d", "score": "0.5313836", "text": "function tutorInfo() {\n firebase.auth().onAuthStateChanged(function (user) {\n let dbref = db.collection(\"users/\").doc(user.uid);\n\n dbref.get()\n .then(snap => {\n let eduComplete = snap.data().educationcompleted;\n\n if (eduComplete != \"\" && eduComplete != undefined) {\n $(\"#educomplete\").show();\n $(\"#educomplete\").text(\"Education Completed: \" + eduComplete);\n }\n })\n })\n}", "title": "" }, { "docid": "ffb6dab994cbf1770dcdd2b11f8a6057", "score": "0.53128827", "text": "function init() {\n currentUser = null;\n\n UserService.getCurrentUser()\n .then(function(response){\n currentUser = response.data;\n\n if(currentUser == null)\n {\n $location.path(\"/home\");\n }\n\n else{\n\n FormService.findAllFormsForUser(currentUser._id)\n .then(function(response){\n vm.forms = response.data;\n });\n }\n });\n\n }", "title": "" }, { "docid": "22e9981a9e0089a01762ba08719c9d68", "score": "0.5309554", "text": "function handleDataSet(data) {\n // select our user elements and load the content\n let userSection = document.querySelector(\".user-section\"),\n userTemplate = document.querySelector(\"#user-template\").content;\n debugger;\n\n for (let user in data) {\n debugger;\n //make a copy of our template here and then populate the children(text element)\n //the static data from the Team object\n let currentUser = userTemplate.cloneNode(true),\n currentUserText = currentUser.querySelector('.user').children;\n\n currentUserText[1].src = `images/${data[user].avatar}.jpg`;\n currentUserText[2].textContent = data[user].name;\n currentUserText[3].textContent = data[user].role;\n currentUserText[4].textContent = data[user].nickname;\n\n //add this new user to the view\n \n userSection.appendChild(currentUser);\n }\n console.log(data);\n }", "title": "" }, { "docid": "9f1a850a01eed150ab9bd920dd14cbab", "score": "0.53093743", "text": "displayUsersPage(req, res) {\n // Fetch all users from the DB\n accountRepository\n .findAllUsers()\n .then(users => {\n res.render('supervisor/users', {\n layout: 'supervisorDashboard',\n users\n });\n })\n .catch(error => {\n res.render('shared/error', {\n errorMessage: error.message\n });\n });\n }", "title": "" }, { "docid": "0b59893421df35e5813f28124c030653", "score": "0.53070295", "text": "function getFBdataFromAPI(fbData) {\n const req = new XMLHttpRequest();\n let url = \"https://api.appworks-school.tw/api/1.0/user/signin\";\n req.open(\"POST\", url, true);\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n // console.log(fbData);\n req.send(JSON.stringify(fbData));\n req.onreadystatechange = () => {\n if (req.readyState === 4 && req.status === 200) {\n loading();\n const dataOutput = JSON.parse(req.responseText).data.user;\n memberData.picture = dataOutput.picture;\n memberData.name = dataOutput.name;\n memberData.email = dataOutput.email;\n // console.log(dataOutput);\n // console.log(memberData);\n renderMember();\n FBdataGet();\n // window.location = `./thankyou.html?number=${orderNumber}`;\n } else if (req.status === 400) {\n // console.log(cartTotal);\n alert(\"Bad Request\");\n }\n };\n}", "title": "" }, { "docid": "78fcc9aa492edbeeda21374d0ac65481", "score": "0.5305974", "text": "function fetchData() {\n return $mmaModQuiz.getQuizById(courseId, quizId).then(function(quizData) {\n quiz = quizData;\n $scope.quiz = quiz;\n\n return fetchAttempt();\n }).catch(function(message) {\n return $mmaModQuizHelper.showError(message, 'mma.mod_quiz.errorgetattempt');\n });\n }", "title": "" }, { "docid": "3a466b601113bc9c1c9fb3c1fd779621", "score": "0.5304554", "text": "async showProfile(req,res,next){\n let province='';\n let district='';\n let detailAddress='';\n let iduser = req.cookies.iduser;\n let checkUser = await userService.getUserInfoById(iduser);\n console.log(checkUser);\n \n \n if(checkUser.address)\n {\n let address = JSON.parse(checkUser.address);\n \n province = address.province;\n district = address.district;\n detailAddress = address.detailAddress\n }\n \n res.render('userProfile',{layout:'backend',checkUser:checkUser,province:province,district:district,detailAddress:detailAddress});\n }", "title": "" }, { "docid": "a50e22ebd29ea37f3e5ee84bb1d34f61", "score": "0.53043544", "text": "function loadMembers () {\n User.get_members('room_id='+$rootScope.root_room.id).success(function(data){ \n $rootScope.root_room_members = data.user;\n $rootScope.run ++;\n });\n }", "title": "" }, { "docid": "cfec70c16c34c27d03e9a5dbe28c00b0", "score": "0.53020334", "text": "async function loadProfileData() {\n try {\n var users = await getUserDetailsByEmail(userSessionEntity.email);\n } catch (e) {\n console.log(e);\n }\n //prepopulate the profile fields from data pulled from the table \n $(\"#userImg\").attr(\"src\", users[0].imageUrl);\n $(\"#userName\").val(users[0].name);\n $(\"#userNameLabel\").addClass(\"active\")\n $(\"#emailinput\").val(users[0].email);\n $(\"#emailinputLabel\").addClass(\"active\")\n if (users[0].phone !== null || users[0].phone !== undefined) {\n $(\"#phoneNum\").val(users[0].phone);\n $(\"#phoneNumLabel\").addClass(\"active\")\n\n }\n $(\"#mobileNotification\").attr(\"checked\", users[0].receiveTextNotification);\n }", "title": "" }, { "docid": "b602829a38e5d88fa19c73445138a6c6", "score": "0.52954084", "text": "function perfilDietician(request, response) {\n var user = firebase.auth().currentUser;\n if (user) {\n getEstadoDietista(user.uid);\n\n response.status(200);\n var userId = user.uid;\n db.ref('Dietician/' + userId).once('value', (snapshot) => {\n const data = snapshot.val();\n return response.render('./dieticianViews/perfilDietician', { dietician: data, dieticianId: userId });\n })\n\n }\n else {\n return response.redirect('../noLoggedView');\n }\n\n\n\n}", "title": "" }, { "docid": "08dcf3f0fa504a9efa2a743017450f20", "score": "0.52818626", "text": "function displayUserData(){\r\n let user = getUserFromCurrentSession()\r\n document.getElementById('user-name-span').innerHTML = user.name\r\n document.getElementById('user-email-span').innerHTML = user.email\r\n document.getElementById('user-tel-span').innerHTML = user.tel\r\n document.getElementById('user-birthday-span').innerHTML = user.birthday\r\n document.getElementById('user-cpf-span').innerHTML = user.cpf\r\n document.getElementById('user-address-span').innerHTML = user.address\r\n document.getElementById('user-cep-span').innerHTML = user.cep\r\n document.getElementById('user-city-span').innerHTML = user.city\r\n document.getElementById('user-state-span').innerHTML = user.state\r\n document.getElementById('user-base-span').innerHTML = user.base\r\n document.getElementById('profile-img-user').src = user.img_path\r\n \r\n}", "title": "" }, { "docid": "55e7e805bcdb6f794d0f13bc22e90f7a", "score": "0.5277038", "text": "function getData(chamber) {\n var chamber;\n fetch(\"https://api.propublica.org/congress/v1/113/\" + chamber + \"/members.json\", {\n method: \"GET\",\n headers: {\n 'X-API-Key': 'gpxI5jMm6JWOG7WlInZOFyaKP1wTYions6uW86Dd'\n }\n }).then(function (response) {\n return response.json();\n }).then(function (json) {\n members = json.results[0].members;\n num_results = json.results[0].num_results;\n countMembers();\n votedByParty();\n forHtmlTable(statistics, \"glanceTable\");\n ascArray();\n descArray()\n createTables();\n ajaxloader.style.display = 'none';\n }).catch(function (error) {\n console.log(\"something went wrong\");\n })\n}", "title": "" }, { "docid": "46970c26b0ed70bc1736e35f16ea3811", "score": "0.527647", "text": "function fetchPresentations(){\n\t\t$('#sectionPresentations').find('.ajax').fadeIn();\n\t\t$('#sectionPresentationsDeleted').find('.ajax').fadeIn();\n\t\t// Presentations (array)\n\t\t$.when(RELAY.userPresentationsXHR()).done(function (presentations) {\n\t\t\t// Store presentations (even if empty) in USER obj.\n\t\t\tUSER.accountPresentationsStore(presentations);\n\t\t\t// Update views pertaining to content\n\t\t\tupdatePresentationTables();\n\t\t});\n\t}", "title": "" }, { "docid": "5b8d16b7f56bd331468dd672182a240a", "score": "0.5275526", "text": "function getPacientes(request, response) {\n var user = firebase.auth().currentUser;\n if (user) {\n getEstadoDietista(user.uid);\n var dieticianId = user.uid;\n if (estadoDietista) {\n db.ref('Patient').orderByChild('dieticianId').equalTo(dieticianId).on('value', function (snapshot) {\n const data = snapshot.val();\n return response.render('./dieticianViews/manejarPacientes', { patient: data });\n })\n }\n else {\n return response.render('./dieticianViews/noStatusDietician');\n }\n }\n else {\n return response.redirect('../noLoggedView');\n }\n}", "title": "" }, { "docid": "1bc91561d33c1761edfe553559945ba0", "score": "0.52733415", "text": "getUsers(there) {\n let that = there;\n there.props.callRest('GET', 'users', '', function() {\n if (this.readyState === XMLHttpRequest.DONE) {\n try{\n let newUsers = JSON.parse(this.responseText);\n store.dispatch({type: 'update_users', newUsers: newUsers});\n if (Array.isArray(newUsers)) {\n that.setState({display: 'none'});\n }\n else {\n alert('login failed');\n }\n }\n catch(err){\n alert('login failed!');\n that.setState({display: 'flex'});\n }\n }\n });\n }", "title": "" }, { "docid": "c08956e236e3de54ca0d51990a618423", "score": "0.52691925", "text": "render(){\n\t\t \n\t\t return (\n\t\t \n\t\t <div>\n\t\t <div className=\"Header\">\n\t\t\n\t\t </div>\n\t\t <div className=\"Board\">\n\t\t <div className=\"LesPatients\">\n\t\t <ListPatient data={this.state.data}/>\n\t\t </div>\n\t\t <div>\n\t\t<AffichageUtilisateur utilisateur={this.state.data[0]} />\n\t\t</div>\n\t\t </div>\n\t\t </div>\n\t\t \n\t\t );\n\t\t \n\t\t \n\t }", "title": "" }, { "docid": "7eb6fe3a668f5ee31d44ed0cef8355c5", "score": "0.52670884", "text": "async function getPersons() {\n showLoader();\n let response = await fetch('https://headlesscms.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=3');\n let data = await response.json();\n _familyMembers = data;\n appendPersons(_familyMembers);\n showLoader(false);\n}", "title": "" }, { "docid": "be061a567554aaad9b91cecfbe4ca3bd", "score": "0.5266335", "text": "render() {\n return(\n <div>\n {\n (loading)?\n <span>Loading Members</span>:\n (members.length)?\n members.map((user, i) =>\n <Member key={i} />\n ):\n <span>0 members loaded...</span>\n }\n {(error) ? <p>Error loading members: error</p> : \"\"}\n </div>\n )\n}", "title": "" }, { "docid": "ffaf011871d9a2e797dcf9876abcfeb5", "score": "0.5266036", "text": "function getUserData() {\n const loginUserName = document.getElementById('loginUser');\n const loginUserTextName = loginUserName.value;\n userName.innerText = loginUserTextName;\n home.classList.remove('animate__fadeOutLeft');\n login.classList.add('d-none');\n home.classList.remove('d-none');\n // getChartData(chartEndpoint);\n getChartData(chartEndpoint);\n fillUsersPlayList(musicStore, [userPlaylists, sideMenuMobile]);\n setTimeout(() => {\n showToaster(loginUserTextName);\n }, 200);\n}", "title": "" }, { "docid": "c7172b89a134dab3edf43a18682f5375", "score": "0.52646565", "text": "function getDataStudents(){\n fetch(\"http://tabithabjorkman.com/bifrost_t/json/students.php\")\n .then(res => res.json())\n .then(showStudent);\n}", "title": "" }, { "docid": "360a006eb743351fbae65ba16c5724ac", "score": "0.5263949", "text": "async _loadFacilitiesView() {\n const template = await Templates.instantiateTemplate(\"assets/html/templates/pages/campaign-planner-page.html\", \"template-campaign-planner-facilities-view\");\n\n template.querySelector(\"facility-planner\").addEventListener(\"facilityChanged\", this._onFacilityChanged.bind(this));\n\n this._populateFacilitiesData(template);\n\n return template;\n }", "title": "" }, { "docid": "57ec7f82a9b2c22661d89d5601bc87e4", "score": "0.52558845", "text": "function loadUserInformation(req, res, next) {\n var geo = (req.session ? req.session.geo : false) || (req.cookies ? req.cookies.geo : undefined);\n res.locals = {\n user: req.user,\n is_feca: req.user ? req.user.is_feca : false,\n geo: geo\n };\n\n //setCrossOrigin(req, res, next);\n next('route');\n}", "title": "" }, { "docid": "740a01ff8b6e83fdf9ef8415a6a5e387", "score": "0.5255465", "text": "function loadData() {\n \t\twindow.alert('Welcome! Fetching your information.... ');\n \t\tFB.api('/me', function(response) {\n\t \n \t\t$(\"#userid\").html(response.id);\n \t\t$(\"#name\").html(response.name);\n \t\t$(\"#link\").html(response.link);\n \t\t$(\"#username\").html(response.username);\n \t\t\n \t\tfoto = 'https://graph.facebook.com/' + response.username + '/picture?type=large';\n \t\t\n\t\t\t$(\"#profile_thumb\").attr({\n\t\t\t\tsrc: foto,\n\t\t\t\tborder: '0'\n\t\t\t});\n \t});\n\t\t}", "title": "" } ]
7ba94d4e7249ec61c244fc1552a261a1
returns the selected value from a radio list or nothing
[ { "docid": "26c69ac59850892b878b5cd81db383fb", "score": "0.720663", "text": "function getRadioSelected(FieldName) {\n\t\tif (FieldName.length > 0) {\n\t\t\tfor (var i = 0; i < FieldName.length; i++) {\n\t\t\t\tif (FieldName[i].disabled == false && FieldName[i].checked == true)\n\t\t\t\t\treturn FieldName[i].value;\n\t\t\t}\n\t\t} else\n\t\tif (FieldName.disabled == false && FieldName.checked == true)\n\t\t\treturn FieldName.value;\n\t\treturn null;\n\t}", "title": "" } ]
[ { "docid": "b146284189401f16e2c4ac75dab93ce7", "score": "0.80582696", "text": "function getSelectedRadio(){\n\t\tvar radios = document.forms[0].condition;\n\t\tfor (var i=0; i<radios.length; i++){\n\t\t\tif(radios[i].checked){\n\t\t\t\tvar conditionValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t\treturn conditionValue;\n\t}", "title": "" }, { "docid": "d0798869979aaee942f0a5f53ee7e61d", "score": "0.793425", "text": "function getRadioValue(){\n var inputs = document.getElementsByName(\"choice\");\n for (var i = 0; i < inputs.length; i++) {\n if(inputs[i].checked){\n return inputs[i].value;\n }\n }\n }", "title": "" }, { "docid": "c9a74195645c03db107e8b98fc2d3800", "score": "0.78918725", "text": "function getSelectedRadio(){\n\t\tvar radios = document.forms[0].sex;\n\t\tfor(var i=0; i<radios.length; i++){\n\t\t\tif(radios[i].checked){\n\t\t\t\tsexValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9b5d2d6c2079d9abfd893c0cb3f6d29b", "score": "0.7873602", "text": "function getSelectedRadio() {\n\t\tvar radios = document.forms[0].attend; \n\t\tfor(var i=0; i<radios.length; i++) {;\n\t\t\tif(radios[i].checked) {\n\t\t\t\tattendValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7a0732bcf48309bd2b9f5139963352d7", "score": "0.78610724", "text": "function findRadioValue(){\n\t\tvar selection = $(\"itemForm\").sLocation;\n\t\tfor (var i=0; i<selection.length; i++){\n\t\t\tif(selection[i].checked){\n\t\t\t\tselectionValue = selection[i].value;\n\t\t\t};\n\t\t};\n\t\treturn selection\n\t}", "title": "" }, { "docid": "3b6526d4fa5028632c0766940d15b26a", "score": "0.76665896", "text": "function getSelectedRadio(){\n var radios = document.forms[0].taskType;\n for (var i=0; i<radios.length; i++){\n if(radios[i].checked){\n taskValue = radios[i].value;\n }\n }\n }", "title": "" }, { "docid": "a37688afc4464635924e0417fc24046a", "score": "0.76509184", "text": "function getRadioSelectedValue(ctrl)\r\n{\r\n for(i=0;i<ctrl.length;i++)\r\n if(ctrl[i].checked)\r\n return ctrl[i].value;\r\n}", "title": "" }, { "docid": "9ee7b380703846615244a1952ee8f6d8", "score": "0.75198084", "text": "function GetRadioButtonListCheckedValue(ctl)\n{\n\tvar oRadio=document.getElementById(ctl);\n\tvar oRadioButtons=oRadio.getElementsByTagName(\"input\");\n\tfor(var i=0;i<oRadioButtons.length;i++)\n\t{\n\t\tif(oRadioButtons[i].type==\"radio\" && oRadioButtons[i].checked)\n\t\t{\n\t\t\treturn oRadioButtons[i].value;\n\t\t}\n\t}\n\t\n\treturn \"\";\n}", "title": "" }, { "docid": "6070e00dcdd707a5b39efa6ea6bec69d", "score": "0.75022584", "text": "function getSelectedRadio() {\n var radios = document.forms[0].school;\n for (var i=0; i < radios.length; i++){\n if (radios[i].checked) {\n schoolValue = radios[i].value;\n }\n }\n }", "title": "" }, { "docid": "3fb30e27677b7bc590f9c84f01664c72", "score": "0.74914783", "text": "function getSelectedRadioValue(pvStrFormName,pvStrFieldName)\r\n{\r\n\tvar objField = document.forms[pvStrFormName].elements[pvStrFieldName];\r\n\r\n\tif(objField.length){\r\n\t\tfor(var i = 1; i <= objField.length ; i++)\r\n\t\t\tif(objField[i - 1].checked == true){\r\n\t\t\t\treturn objField[i-1].value;\r\n\t\t\t}\r\n\t} else {\r\n\t\tif(objField.checked == true){\r\n\t\t\treturn objField.value;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "c229faf4599cce7025e614317c2e3ac0", "score": "0.74762404", "text": "function getRadioValue(){\n var button = document.forms[0].model;\n for(var i=0; i<button.length; i++){\n if(button[i].checked){\n modelValue = button[i].value;\n }\n }\n }", "title": "" }, { "docid": "04636432e89b0b2dcca41b6c41e4328b", "score": "0.7474312", "text": "function getSelectedRadio(){\t\t\t\n var radios = document.forms[0].haveit;\t\t\t\t\t //initialized the form to the radios\n for(var i=0; i<radios.length; i++){\t\t\t\t\t //loops the form radio set called haveit\n if(radios[i].checked){ //checks to see which value is checked\n haveitValue = radios[i].value;\n }\n }\n }", "title": "" }, { "docid": "2fcc63cefc63359f2e90c58665fa3a5b", "score": "0.7449894", "text": "function getSelectedRadio(){\n\t\tvar radios = document.forms[1].rush;\n\t\tfor (var i =0; i < radios.length; i++){\n\t\t\tif (radios[i].checked){\n\t\t\t\trushValue = radios[i].value;\n\t\t\t};\n\t\t;}\n\t}", "title": "" }, { "docid": "24ccafb97b32314aff97459d8cda5afe", "score": "0.74460137", "text": "function radiobuttonlistSelectValue(id)\n{\n id = \"#\" + id;\n\n var val = \"\";\n $(id).find(\"input\").each(function()\n {\n if (this.checked) val = $(this).val();\n });\n\n return val;\n}", "title": "" }, { "docid": "1af417bb9f123680343478684c0b886f", "score": "0.74040574", "text": "function getRadioValue(){\r\n let radioValue;\r\n radioInputs.forEach(e =>{\r\n if(e.checked){\r\n radioValue = e.value;\r\n }\r\n })\r\n return radioValue;\r\n}", "title": "" }, { "docid": "b1bf72c1d636e0a9906bcd587fe599fe", "score": "0.73482645", "text": "function getRadioVal(form, name) {\n const selectedValue = form.elements[name].value;\n \n return selectedValue;\n}", "title": "" }, { "docid": "37f5f02587834115b74d240d8dd034d1", "score": "0.7322443", "text": "function jsFn_getRadioChecked(obj){\n\tif(obj.length){//have more one\n\t\tfor(var i=0; i < obj.length ; i++){\n\t\t\tif(obj[i].checked)\treturn obj[i].value;\n\t\t}//for\n\t}else{//have one\n\t\tif(obj.checked)\treturn obj.value;\n\t}//if\n\treturn \"\";\n}//fn", "title": "" }, { "docid": "92ea5f4ee461e5620620fdb01cc71e67", "score": "0.7300856", "text": "function getRadioButtonValue (theField)\n{ for (var i = 0; i < theField.length; i++)\n { if (theField[i].checked) {\n return theField[i].value\n }\n }\n return false\n}", "title": "" }, { "docid": "50ac72e509a95341ce5a12448e6cfa77", "score": "0.7269797", "text": "function getSelected(){\n var radioNewUsed = document.forms[0].condition;\n for(var i = 0; i<radioNewUsed.length; i++){\n if(radioNewUsed[i].checked){\n purchaseType = radioNewUsed[i].value;\n }\n }\n }", "title": "" }, { "docid": "b8d8fefcdcd89fa97480eb963afcd5ae", "score": "0.7246907", "text": "function getRadioSelected(FieldName) {\n\tif (FieldName.length > 0) {\n\t\tfor (var i = 0; i < FieldName.length; i++) {\n\t\t\tif (FieldName[i].disabled == false && FieldName[i].checked == true)\n\t\t\t\treturn FieldName[i].value;\n\t\t}\n\t} else\n\tif (FieldName.disabled == false && FieldName.checked == true)\n\t\treturn FieldName.value;\n\treturn null;\n}", "title": "" }, { "docid": "790ceee0989ce99359ae943bd64f0c9e", "score": "0.72464293", "text": "function getRadioValue(radioButtons) {\r\n\tfor (var i=0; i < radioButtons.length; i++)\r\n\t{\r\n\t\tif(radioButtons[i].checked) {\r\n\t\t\treturn radioButtons[i].value;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "817f863d388fc32230ac15f640ca0c21", "score": "0.72428906", "text": "function getRadioValue() {\n let radioValue;\n radioInputs.forEach((radioInput) => {\n if (radioInput.checked) {\n radioValue = radioInput.value;\n }\n });\n return radioValue;\n}", "title": "" }, { "docid": "9e3110c5017edb2a190cfbda1fb324e0", "score": "0.7228008", "text": "getRadioVal(form, name) {\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n \n // loop through list of radio buttons\n for (var i=0, len=radios.length; i<len; i++) {\n if ( radios[i].checked ) { // radio checked?\n val = radios[i].value; // if it is, hold its value in val\n break; // and break out of for loop\n }\n }\n return val; // return value of checked radio or undefined if none checked\n }", "title": "" }, { "docid": "3b4101ef19563e54aa679fed9f03e50e", "score": "0.72259074", "text": "function radioStat() {\n for (var i = 0; i < radios.length; i++) { \n if (radios[i].checked) {\n radioSelected = (radios[i].value);\n }\n }\n}", "title": "" }, { "docid": "d289d8f6336883fe4935ab7e0deb8eaa", "score": "0.7206433", "text": "function getRadioValue(radio) {\n\tvar value = '';\n\tradio.forEach(el=> {\n\t\tif (el.checked) {\n\t\t\tvalue = el.value;\n\t\t\treturn\n\t\t}\n\t});\n\treturn value\n}", "title": "" }, { "docid": "0a8da1615884c7b1362ff6675194e9f8", "score": "0.717509", "text": "function getFilterRadioValue () {\n\n return getSelectedRadioValue('filter-radio');\n\n}", "title": "" }, { "docid": "8a897d22cc4bf9b2b9241b8383dacb30", "score": "0.7168775", "text": "function valRadioButton(btn) {\r\n\t\r\n var cnt = -1;\r\n\tfor (var i=btn.length-1; i > -1; i--) {\r\n if (btn[i].checked) {cnt = i; i = -1;}\r\n }\r\n if (cnt > -1) return btn[cnt].value;\r\n else return null;\r\n}", "title": "" }, { "docid": "0e003490be67eee30b8cc2a3a93fb10b", "score": "0.7159914", "text": "function getRadioVal(form, name) {\n\t var val;\n\t // get list of radio buttons with specified name\n\t var radios = form.elements[name];\n\t \n\t // loop through list of radio buttons\n\t for (var i=0, len=radios.length; i<len; i++) {\n\t if ( radios[i].checked ) { // radio checked?\n\t val = radios[i].value; // if so, hold its value in val\n\t break; // and break out of for loop\n\t }\n\t }\n\t return val; // return value of checked radio or undefined if none checked\n\t}", "title": "" }, { "docid": "02e309da471180e1b7eef5f1122a0a34", "score": "0.7106446", "text": "get value() {\n this._update();\n\n const element = this._list.find(e => e._localName === \"input\" && e.type === \"radio\" && e.checked);\n if (element === undefined) {\n return \"\";\n }\n\n if (!element.hasAttributeNS(null, \"value\")) {\n return \"on\";\n }\n\n return element.getAttributeNS(null, \"value\");\n }", "title": "" }, { "docid": "9f2e5f389ea24244a057f2ceab324567", "score": "0.710123", "text": "function getRadioVal(name) {\n\tvar radios = getName(name);\n\tfor (var i = 0; i < radios.length; i++) {\n\t\tif (radios[i].checked) {\n\t\t\treturn radios[i].value;\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "518303bf4be826049b79f6a3107152a6", "score": "0.7070072", "text": "function getRadioValue() {\n var elements = document.getElementsByName('filter'); \n for(i = 0; i < elements.length; i++) { \n if(elements[i].checked) {\n return elements[i].value;\n }\n } \n}", "title": "" }, { "docid": "908213636f099e485317f9de86699511", "score": "0.70612955", "text": "function getRadioButtonVal(divName){\r\n\tvar value = $('#'+divName+' .ez-selected input').val();\r\n\tif (value == undefined){ value == null; } /* NULL O VACIO?*/\r\n\treturn value;\r\n}", "title": "" }, { "docid": "fb836f6c3d6ca19063ae85e96b7730f5", "score": "0.70428205", "text": "function radioGroupValue(name) {\n var selectedRadioButton = document.querySelector('input[name=\"' + name + '\"]:checked');\n\n if (selectedRadioButton == null) {\n return null; // No button is selected, so cannot return a value\n }\n\n return selectedRadioButton.value;\n}", "title": "" }, { "docid": "644fcbd81f03a8253df9048ab0d93e2a", "score": "0.7037383", "text": "function getRadioValue(name) {\n var options = document.getElementsByName(name);\n for (var i=0; i < options.length; i++) {\n if (options[i].checked) {\n return options[i].value;\n }\n }\n}", "title": "" }, { "docid": "9de772c1e2cefaa0ec9d90965b11c7ee", "score": "0.70315087", "text": "function getRadioValue(theRadioGroup) {\n var elements = document.getElementsByName(theRadioGroup);\n for (var i = 0, l = elements.length; i < l; i++) {\n if (elements[i].checked) {\n return elements[i].value;\n }\n }\n }", "title": "" }, { "docid": "f036dd94654de4027423c2dd047b2ee7", "score": "0.698969", "text": "function getRadioValue(name){\n\t\n\tvar objRadio = document.getElementsByName(name);\n\tif(objRadio){\n\t\tfor( var i = 0; i < objRadio.length; i++ ){\n\t\t\tvar optRadio = objRadio[i];\n\t\t\tif(optRadio.checked){\n\t\t\t\treturn optRadio.value;\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "2ab0875426c8de605dcdb0d00c22b80d", "score": "0.6973235", "text": "function getCheckedRadioValue(radioGroupName) {\n var i, rads = document.getElementsByName(radioGroupName);\n for (i = 0; i < rads.length; i += 1) {\n if (rads[i].checked) {\n return rads[i].value;\n }\n }\n\n return null; // or undefined, or your preferred default for none checked\n }", "title": "" }, { "docid": "5b24623c8360d55ea4773822e38a94eb", "score": "0.69643754", "text": "function getRadioValue( radioName )\r\n{\r\n\tresult = null;\r\n\tjQuery.each( jQuery( \"input[type=radio][name=\" + radioName + \"]\") , function( i, item )\r\n\t{\t\t\r\n\t\tif ( item.checked )\r\n\t\t{\r\n\t\t\tresult = item.value;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn result;\r\n}", "title": "" }, { "docid": "378620089a239c85327adedc49bc335d", "score": "0.6959204", "text": "function getRadioCheckedValue(formNum, radio_name)\n{\n var oRadio = document.forms[formNum].elements[radio_name];\n for(var i = 0; i < oRadio.length; i++)\n {\n if(oRadio[i].checked)\n {\n return oRadio[i].value;\n }\n }\n return '';\n}", "title": "" }, { "docid": "478f8df453b04c9f23472bf71b3fa9dd", "score": "0.6928624", "text": "function getCurrentlyPressedRadioButton() {\n //goes through the radio buttons and gets the one thats pressed\n const topping_radio_buttons = document.querySelectorAll('input[name=\"topping\"]');\n let selectedValue;\n for (const topping_button of topping_radio_buttons) {\n if (topping_button.checked) {\n selectedValue = topping_button.id;\n break;\n }\n }\n return selectedValue;\n }", "title": "" }, { "docid": "d94f1bb96230f89a20c2a9d705fb8a5d", "score": "0.69172144", "text": "function getRadioVal(form, name) {\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n\n // loop through list of radio buttons\n for (var i=0, len=radios.length; i<len; i++) {\n if ( radios[i].checked ) { // radio checked?\n val = radios[i].value; // if so, hold its value in val\n break; // and break out of for loop\n }\n }\n return val; // return value of checked radio or undefined if none checked\n}", "title": "" }, { "docid": "d94f1bb96230f89a20c2a9d705fb8a5d", "score": "0.69172144", "text": "function getRadioVal(form, name) {\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n\n // loop through list of radio buttons\n for (var i=0, len=radios.length; i<len; i++) {\n if ( radios[i].checked ) { // radio checked?\n val = radios[i].value; // if so, hold its value in val\n break; // and break out of for loop\n }\n }\n return val; // return value of checked radio or undefined if none checked\n}", "title": "" }, { "docid": "08d15e707abd3f07b5d8ef6a10a509f9", "score": "0.6911536", "text": "function $tSelectedRadio() {\n var radios = document.forms[0].importance;\n for(var i=0; i<radios.length; i++){\n if (radios[i].checked){\n importanceValue = radios[i].value;\n }\n }\n }", "title": "" }, { "docid": "28e0446850ac17d7108de31374b86ed6", "score": "0.6895212", "text": "function getRadioValue(form, name) {\n let val;\n const radios = form.elements[name];\n for (let x = 0; x < radios.length; x++) {\n if ( radios[x].checked ) {\n val = radios[x].value;\n break;\n }\n }\n console.log('VALUE: ', val);\n return val;\n}", "title": "" }, { "docid": "9c34605d66b2a89ea891aa3513ec4955", "score": "0.6859906", "text": "function getRadioButton( name ) {\n\tvar radios = document.getElementsByName( name );\n\tfor (var i = 0, length = radios.length; i < length; i++) {\n\t if (radios[i].checked) {\n\t return( radios[i].value )\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e41e31f02fb7d7e8473a489d2932b5e6", "score": "0.68571454", "text": "function getCheckedRadioButton( radio ) {\r\n\tlen = ( typeof(radio) == 'object' ? radio.length : 0 );\r\n if( len )\r\n for ( i = 0; i < len; i++ ) {\r\n option = radio[i];\r\n if (option.checked)\r\n return option;\r\n }\r\n else\r\n return radio;\r\n}", "title": "" }, { "docid": "537a15b8c41bbf208019b2688f9aa44e", "score": "0.6855898", "text": "radioCheck() {\n// loop through all the radio buttons and return the checked radio value\n for(var i = 0, length = ui.radios.length; i < length; i++) {\n if(this.ui.radios[i].checked) {\n return ui.radios[i].value;\n }\n }\n return true;\n }", "title": "" }, { "docid": "41eba7c5d9ab94a31846c6774aff7595", "score": "0.6853908", "text": "function getRadioVal(form, name) {\n console.log(\"In getRadioVal\");\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n \n // loop through list of radio buttons and store the active names\n for (var i=0, len=radios.length; i<len; i++) {\n if ( radios[i].checked ) {\n val = radios[i].id;\n break;\n }\n }\n return val;\n}", "title": "" }, { "docid": "86c6b798cf84a7e9dd6bd9b30e96a1c9", "score": "0.68456846", "text": "function getAnswer() {//get the user's answer from the radio btu she selected.\r\n var tempChoiceValue = null;\r\n for (var j = 0; j < radiobtn.length; j++) {\r\n if (radiobtn[j].checked) {\r\n tempChoiceValue = radiobtn[j].value;\r\n }\r\n radiobtn[j].checked = false;//clear all the btns ready for next question to display.\r\n }\r\n return tempChoiceValue;\r\n }", "title": "" }, { "docid": "fb601161a91e7a2c27dcc11910c6271e", "score": "0.68138397", "text": "function getCheckedValue(radioObj) {\n if (!radioObj)\n return \"\";\n var radioLength = radioObj.length;\n if (radioLength == undefined)\n if (radioObj.checked)\n return radioObj.value;\n else\n return \"\";\n for (var i = 0; i < radioLength; i++) {\n if (radioObj[i].checked) {\n return radioObj[i].value;\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "821a5d41976a28b1ef42930b9e494ef8", "score": "0.68086815", "text": "function getRadioVal(form, name) {\n let val;\n let radios = form.elements[name];\n\n for (let i = 0, len = radios.length; i < len; i++) {\n if (radios[i].checked) {\n val = radios[i].value;\n break;\n }\n }\n return val;\n}", "title": "" }, { "docid": "743e76ba04a30de9613bf3a0ee33dbdc", "score": "0.6790296", "text": "function getCheckedValue(radioObj) {\n var i;\n if(!radioObj) { return \"\"; }\n var radioLength = radioObj.length;\n if(radioLength === undefined) {\n if(radioObj.checked) { return radioObj.value; }\n else { return \"\"; }\n }\n for(i=0; i<radioLength; i++) {\n if(radioObj[i].checked) {\n return radioObj[i].value;\n }\n }\n return \"\";\n }", "title": "" }, { "docid": "6747c95873ffc0b30c9ce63c34ee1c1c", "score": "0.67620134", "text": "function getRadioCheckedValue(radioObj) {\n\t\tif(!radioObj)\n\t\t\treturn \"\";\n\t\tvar radioLength = radioObj.length;\n\t\tif(radioLength == undefined)\n\t\t\tif(radioObj.checked)\n\t\t\t\treturn radioObj.value;\n\t\t\telse\n\t\t\t\treturn \"\";\n\t\tfor(var i = 0; i < radioLength; i++) {\n\t\t\tif(radioObj[i].checked) {\n\t\t\t\treturn radioObj[i].value;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "title": "" }, { "docid": "39bf106ee3dda885bcfd4bab1609ec01", "score": "0.6752792", "text": "function getCheckedValue(radioObj) {\n var i;\n if(!radioObj) { return \"\"; }\n var radioLength = radioObj.length;\n if(radioLength === undefined) {\n if(radioObj.checked) { return radioObj.value; }\n else { return \"\"; }\n }\n for(i=0; i<radioLength; i++) {\n if(radioObj[i].checked) { return radioObj[i].value; }\n }\n return \"\";\n}", "title": "" }, { "docid": "4fa60120f248f6b1b3c603c400b6fb90", "score": "0.6745738", "text": "function getCheckedValue(radioObj) {\r\n\tif(!radioObj)\r\n\t\t\treturn \"\";\r\n\tvar radioLength = radioObj.length;\r\n\tif(!isset(radioLength)) {\r\n\t\tif(radioObj.checked)\r\n\t\t\treturn radioObj.value;\r\n\t\telse\r\n\t\t\treturn \"\";\r\n\t}\r\n\tfor(var i = 0; i < radioLength; i++) {\r\n\t\tif(radioObj[i].checked) {\r\n\t\t\treturn radioObj[i].value;\r\n\t\t}\r\n\t}\r\n\treturn \"\";\r\n}", "title": "" }, { "docid": "02694502795f5533a513e21ef28d8ef3", "score": "0.6744731", "text": "function selectRadio(){\n radioSeleccionadoEdit();\n if((valor=='Vacaciones')){ //aqui por favor\n $(\"#Tipo\").val(data[0].Tipo).checked;\n if(valor=='Enfermedad'){\n $(\"#Tipo\").val(data[0].Tipo).checked;\n }\n if(valor=='Permiso Especial'){\n $(\"#Tipo\").val(data[0].Tipo).checked;\n }\n }\n console.log(valor);\n \n }", "title": "" }, { "docid": "8870852bacd4b0b0394a2e4cf809e771", "score": "0.6742982", "text": "function findRadioChecked(title){\n var value = \"\"\n if (document.getElementById(title+\"_yes\").checked) {\n\tvalue = document.getElementById(title+\"_yes\").value;\n }else{\n\tvalue = document.getElementById(title+\"_no\").value;\n }\n return value;\n}", "title": "" }, { "docid": "e7d0d8fa3617276d20be78a2716ed0a5", "score": "0.6734924", "text": "function checkedRadio(radioObj){\n if(!radioObj)\n return \"\";\n var radioLength = radioObj.length;\n if(radioLength == undefined)\n if(radioObj.checked)\n return radioObj.value;\n else\n return \"\";\n for(var i = 0; i < radioLength; i++) {\n if(radioObj[i].checked) {\n return radioObj[i].value;\n }\n }\n return \"\";\n /*for each (var i in r){if(i.checked)return i.value;}return \"\"; //funcion mas corta que funciona en firefox pero no chrome*/\n}", "title": "" }, { "docid": "a9f7f79871e36208c43e55010240848d", "score": "0.6714981", "text": "function getValueRadio (name) {\n\tvar groupRadio = document.getElementsByName(name);\n\n\tvar checked = false;\n\tvar i = 0;\n\n\twhile (!checked && i < groupRadio.length) {\n\n\t\tif (groupRadio[i].checked) {\n\t\t\tchecked = true;\n\t\t}\n\n\t\ti++;\n\t}\n\n\tif (checked) {\n\t\treturn groupRadio[i-1].value;\n\t}\n\n\telse {\n\t\treturn -1;\n\t}\n\n}", "title": "" }, { "docid": "504ae313fd6454507e6d7f3fcca2b6d4", "score": "0.66899616", "text": "function leerTextoRadio(name) {\n\treturn $('input[name=\"' + name + '\"]:checked').val();\n}", "title": "" }, { "docid": "b7321bcc879e04a4387fa6e74d2d9fc0", "score": "0.6687636", "text": "function getvaluefromyndkradio(name,positive) {\n value = getvaluefromradio(name);\n if (value == positive) {\n return 1;\n }\n if (value == 0) {\n return null;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "b4962621677f5f01fdf11cb33089fb73", "score": "0.6684617", "text": "function getRadio(categoria) {\n var form = document.getElementById(\"cadastro\");\n return form.elements[categoria].value;\n }", "title": "" }, { "docid": "a385a78a485b720525cd4f4ea7a60c6b", "score": "0.668367", "text": "function getValueFromRadioInputs( radioInputs ) {\n\t\tvar radioValue = false,\n\t\t\tl = radioInputs.length;\n\n\t\tfor ( var i = 0; i < l; i++ ) {\n\t\t\tif ( radioInputs[ i ].type === 'hidden' || radioInputs[ i ].checked ) {\n\t\t\t\tradioValue = radioInputs[ i ].value;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn radioValue;\n\t}", "title": "" }, { "docid": "7986896042f7d601a9ef7ed1699a0944", "score": "0.66800994", "text": "function getCheckedValue(radioObj) {\n\tif(!radioObj) { return; }\n\n\tvar radioLength = radioObj.length;\n\tif(radioLength == undefined)\n\t\tif(radioObj.checked)\n\t\t\treturn radioObj.value;\n\t\telse\n\t\t\treturn \"\";\n\tfor(var i = 0; i < radioLength; i++) {\n\t\tif(radioObj[i].checked) {\n\t\t\treturn radioObj[i].value;\n\t\t}\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "2f95eda3f16aefa003ab5ea0a269ff4a", "score": "0.66800535", "text": "function getRadioValue(element) {\n if (!utils_1.isRadio(element.type)) {\n // tslint:disable-next-line: no-console\n console.error(`Attempted to get as radio value but is type ${element.type} and tag of ${element.tagName || 'null'}`);\n return;\n }\n const radios = getElement(element.name, true);\n const checked = radios.find(e => e.checked);\n return (checked && checked.value) || '';\n }", "title": "" }, { "docid": "7019daa65022f18b7db8125b8da5936b", "score": "0.66671526", "text": "get_selected_value() {\n if (this._selection_index !== -1) {\n return this._list.children[this._selection_index].getAttribute(\"data-value\");\n }\n }", "title": "" }, { "docid": "ddb2735ce72c647c5c6bd2911d151e9e", "score": "0.66656524", "text": "function getRadioButton(name) {\n\tvar i, radios = document.getElementsByName(name);\n\tfor (i = 0; i < radios.length; i = i + 1) {\n\t if (radios[i].checked) {\n\t return (radios[i].value);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ddb2735ce72c647c5c6bd2911d151e9e", "score": "0.66656524", "text": "function getRadioButton(name) {\n\tvar i, radios = document.getElementsByName(name);\n\tfor (i = 0; i < radios.length; i = i + 1) {\n\t if (radios[i].checked) {\n\t return (radios[i].value);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3ac93d095323ea047330586b01d1e272", "score": "0.66482604", "text": "function getRadio_1() {\n var radios = document.forms[0].engineSize;\n for(var i = 0; i < radios.length; i++) {\n if (radios[i].checked){\n engineValue = radios[i].value;\n } // End if statement\n } // End loop\n } // End getRadio_1 function for value to remain checked after user has checked this radio button.", "title": "" }, { "docid": "cdc3546af93e8a1600f12055fa142204", "score": "0.6644189", "text": "function getValueRadio(name) {\n var radios = document.getElementsByName(name)\n var len = radios.length;\n for (var i = 0; i < len; i++) {\n if (radios[i].checked) {\n console.log(radios[i].value)\n return (radios[i].value);\n }\n }\n}", "title": "" }, { "docid": "3b3d731962f258c13bf2aeef92b88305", "score": "0.6643234", "text": "function getUserChoice() {\n let tmp = document.getElementsByName(\"choice\");\n\n for(i = 0; i < tmp.length; i++) {\n if(tmp[i].checked) {\n return tmp[i].value;\n }\n }\n}", "title": "" }, { "docid": "cbee14a3fae648c70aff3c3362312b23", "score": "0.66351676", "text": "function getCheckedValue(radioObj) {\n\tif (!radioObj) {\n\t\treturn \"\";\n\t}\n\tvar radioLength = radioObj.length;\n\tif (radioLength == undefined) {\n\t\tif (radioObj.checked) {\n\t\t\treturn radioObj.value;\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}\n\tfor (var i = 0; i < radioLength; i++) {\n\t\tif (radioObj[i].checked) {\n\t\t\treturn radioObj[i].value;\n\t\t}\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "84fc67f8ad0b1fa3dc5645d98b252f6d", "score": "0.6619938", "text": "function getRadioValue(e) {\n if (e.srcElement.value) {\n questionAmount = e.srcElement.value;\n }\n}", "title": "" }, { "docid": "43fd0c9d2b4a3df1dcce656a611d8c7f", "score": "0.6619144", "text": "function getRaidioBtnSelected(radioBtnName) {\n const radioBtns = document.getElementsByName(radioBtnName)\n let radioBtnSelected = null\n // loop over them all\n for (let i = 0; i < radioBtns.length; i++) {\n // And stick the checked ones onto an array...\n if (radioBtns[i].checked) {\n radioBtnSelected = radioBtns[i].value\n break;\n }\n }\n // Return the array if it is non-empty, or null\n return radioBtnSelected\n}", "title": "" }, { "docid": "fd76c408f7451c8e80c173600f47ddf9", "score": "0.66067684", "text": "function getSelectedTemperament() {\n var option = $('#temperamentSelect').find('input:radio:checked').attr(\"id\");\n return systems[option];\n}", "title": "" }, { "docid": "cfe438ea5345f81dccb895cbb258822d", "score": "0.6576444", "text": "function getRadio() {\n var radButton = document.forms[0].coverstyle;\n for (var i=0; i<radButton.length; i++) {\n if (radButton[i].checked) {\n styleValue = radButton[i].value;\n };\n };\n }", "title": "" }, { "docid": "58830c9affc98efb041714434b6d3801", "score": "0.65753096", "text": "function oneSelected(radio) {\n for (var i=0; i<radio.length; i++) {\n if (radio[i].checked) return true\n }\n return false\n }", "title": "" }, { "docid": "40bf94f2296976af8d60f431db16d370", "score": "0.6572119", "text": "function getValue(selected) {\n for (var i = 0; i < selected.length; i++) {\n if (selected[i].checked) {\n return parseInt(selected[i].value, 10);\n }\n }\n}", "title": "" }, { "docid": "c97731f782855034adc51d700dbd1096", "score": "0.6571743", "text": "function getSelectedRadio(pvStrFormName,pvStrFieldName) {\r\n\tvar objField = document.forms[pvStrFormName].elements[pvStrFieldName];\r\n\t// returns the array number of the selected radio button or -1 if no button is selected\r\n\tif (objField[0]) { // if the button group is an array (one button is not an array)\r\n\t\tfor (var i=0; i<objField.length; i++) {\r\n\t\t\t if (objField[i].checked) {\r\n\t\t\treturn i;\r\n\t\t }\r\n\t\t}\r\n\t} else {\r\n\t\tif (objField.checked) { return 0; } // if the one button is checked, return zero\r\n\t}\r\n\t// if we get to this point, no radio button is selected\r\n\treturn -1;\r\n} // Ends the \"getSelectedRadio\" function", "title": "" }, { "docid": "a913c49dabcf83c9e7b78c236a1b4f15", "score": "0.6565366", "text": "function getRadios() {\n\t\tvar setRadios = document.forms[0].any;\n\t\tfor ( var i=0; i<setRadios.length; i++) {\n\t\t\tif(setRadios[i].checked) {\n\t\t\t\tseasonValue = setRadios[i].value;\n\t\t\t}\n\t }\n}", "title": "" }, { "docid": "fef7d03cb3a24f45cfc3ccf19689bd93", "score": "0.65627646", "text": "function getSelected() {\n let answer = undefined;\n\n answerEl.forEach((answerEl) => {\n if (answerEl.checked) {\n answer = answerEl.id;\n }\n });\n return answer;\n}", "title": "" }, { "docid": "13ff894a5e116d73cd41ba0a4125e66d", "score": "0.6560406", "text": "function getSelected() {\n\tconst checked = [];\n\tloopCheckboxes(el => el.checked && checked.push(main.etc.getID(el)));\n\n\t// Postforms will not have an ID, so we remove falsy values\n\treturn main._.compact(checked);\n}", "title": "" }, { "docid": "84a20fe15ecb6be31173c99427980f9d", "score": "0.6534031", "text": "function findRadioBox (genders) {\n /*\n Purpose: Find the radio box selected\n Parameters: list of the radio box element id info stored in a variable\n Returns: the value of the clicked radio box element\n */\n for (i = 0; i < 3; i++) {\n if (genders[i].checked) {\n return genders[i].value;\n }\n }\n}", "title": "" }, { "docid": "6e58927da22e4a41b11dd371e547d419", "score": "0.65292984", "text": "function getReliabilityVal(form, name) {\n // create a variable val\n var val;\n\n // another variable to get a list the radio buttons\n var radios = form.elements[name];\n\n //\n for (var i = 0, len = radios.length; i < len; i++) {\n if (radios[i].checked) {\n // is radio checked (selected)?\n val = radios[i].value; // if yes, then let's go.. hold the value in val\n break; // and get out. we're done.\n }\n }\n\n // call val again\n return val; // return the value of the checked radio button else tell me\n }", "title": "" }, { "docid": "ee41714cac86ceb9481de16fe72f2b1a", "score": "0.6526871", "text": "function getSearchType()\n{\n len = document.searchForm.search_type.length;\t//how many radio buttons there are\n\t\n\tfor (i = 0; i <len; i++) \n\t{\n\t\tif (document.searchForm.search_type[i].checked) \n\t\t{\n\t\t\tchosen = document.searchForm.search_type[i].value;\n\t\t}\n\t}\n\t\n\treturn chosen;\n}", "title": "" }, { "docid": "cccdd5ea3d0c7b38b06e7d2e2183150f", "score": "0.6519632", "text": "function getvaluefromradio(name) { // radio buttons work if they have the same name!\n var radios = document.getElementsByName(name);\n\n for (var i = 0, length = radios.length; i < length; i++) {\n if (radios[i].checked) {\n return parseFloat(radios[i].value);\n // only one radio can be logically checked, don't check the rest\n break;\n }\n }\n return null; // we may get here if no radio is checked\n}", "title": "" }, { "docid": "f73c10b25cbcc6825cefaa2f37539240", "score": "0.649599", "text": "function getDropType() {\n var radios = document.getElementsByName('dropType');\n for (var i = 0, length = radios.length; i < length; i++) {\n if (radios[i].checked) {\n return radios[i].value;\n }\n }\n}", "title": "" }, { "docid": "6f5dbc97f8df43eee11172645f8349a7", "score": "0.6446195", "text": "function readUserInput() {\n if (firstRadio.checked) return firstValue.innerText;\n else if (secondRadio.checked) return secondValue.innerText;\n else if (thirdRadio.checked) return thirdValue.innerText;\n else if (customRadio.checked) return customValue.value;\n}", "title": "" }, { "docid": "47fe6507f41ff5f25a02f06533cbd195", "score": "0.64449537", "text": "function gender() {\n var elem = document.getElementsByName(\"gender\");\n\n for (i = 0; i < elem.length; i++) {\n if (elem[i].checked) {\n return elem[i].value;\n }\n }\n }", "title": "" }, { "docid": "c9e8c2a3dbc22226c325e089344108c7", "score": "0.6444582", "text": "function checkRadioSelected (obj) \n { \n for (i=0, n=obj.length; i<n; i++) \n {\n if (obj[i].checked) \n {\n //var checkvalue = obj[i].value;\n return true;\n break;\n }\n }\n }", "title": "" }, { "docid": "c4926ccca8a0410b5df35c5676c13d89", "score": "0.6439585", "text": "procesarRadio(nodo)\n {\n let valor\n nodo.forEach((item) => {\n if (item.checked)\n {\n valor = item.value\n }\n //console.log(item.checked, item.value)\n })\n\n return valor\n }", "title": "" }, { "docid": "6d7f3059cf2094d44b947c677d04b865", "score": "0.6427812", "text": "function getValue($el) {\n return $el.is('[type=\"checkbox\"]') ? $el.prop('checked') :\n $el.is('[type=\"radio\"]') ? !!$('[name=\"' + $el.attr('name') + '\"]:checked').length :\n $.trim($el.val())\n }", "title": "" }, { "docid": "54574f891bbf5240c3dc477ba760383a", "score": "0.6427731", "text": "getValue() {\n return this._input.checked;\n }", "title": "" }, { "docid": "54574f891bbf5240c3dc477ba760383a", "score": "0.6427731", "text": "getValue() {\n return this._input.checked;\n }", "title": "" }, { "docid": "96ac878aea2fd4a91dc19d73cb43df4d", "score": "0.6412355", "text": "function getRadioValue() {\n if (radioValue === 'isbn') {\n // Remove hypens from numbers (per API call for ISBN numbers).\n let cleanSearchTerm = searchTerm.replace(/-/g, \"\");\n searchTerm = 'isbn:' + cleanSearchTerm;\n searchBookIsbn();\n } else if (radioValue === 'author') {\n searchByPerson();\n } else {\n searchByTitle();\n }\n}", "title": "" }, { "docid": "018ff46936e32607f4396b68e9ac3170", "score": "0.64001447", "text": "function getRadio(x) {\n var response = \"no response\"\n // if a response exists...\n if ($(\"[name='\" + x + \"']:checked\").val()) {\n\n // check to see if it is other.. if so, grab the other text input\n if ($(\"[name='\" + x + \"']:checked\").val() == \"Other\") {\n var temp = $(\"#\" + x + \"-other\").val() ? $(\"#\" + x + \"-other\").val() : \"no response\"\n response = \"other: \" + temp\n } else {\n response = $(\"[name='\" + x + \"']:checked\").val()\n }\n\n }\n\n return response\n\n}", "title": "" }, { "docid": "51337ba33173a6f63599a910ab0d9d5a", "score": "0.63942754", "text": "function getFieldValue(selector){\n\t\tif (selector.indexOf(\":radio\") != -1){\n\t\t\tselector += \":checked\";\n\t\t}\n\t\treturn $(selector).val();\n\t}", "title": "" }, { "docid": "0c831fc6b6e1379d9bfa45ac09c1a283", "score": "0.6392555", "text": "function getCheckedRadio(objField){\n\t// is there any input-tag in the document named row, \n\t// e.g. is there any radiobuttons named row?\n\tvar checkedValue = \"\";\n\tif(objField){\n\t\t// if radio buttons has a length it's an array, ...\n\t\tif (!isNaN(objField.length)){\n\t\t\tfor (var i = 0; i < objField.length; i++) {\n\t\t\t\tif (objField[i].checked){\n\t\t\t\t\tcheckedValue = objField[i].value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// ... else it's a variable (only one radiobutton named row has been made)\n\t\telse{\n\t\t\tif (objField.checked){\n\t\t\t\t//radio button is checked\t\t\n\t\t\t\tcheckedValue = objField.value;\n\t\t\t}\n\t\t}\n\t}\n\treturn checkedValue;\n}", "title": "" }, { "docid": "21bb9492856f697f82d0102d36ad79d3", "score": "0.63906944", "text": "function get_selected_classifier() {\n // Dataset radio buttons\n let name = \"\"\n let rlist = document.getElementsByName(\"sel-cl\");\n for (let i = 0, length = rlist.length; i < length; i++) {\n if (rlist[i].checked) {\n name = rlist[i].value;\n break;\n }\n }\n return name;\n}", "title": "" } ]
baf1897d82883e666d957a06b697adc8
Update the title based on the attributes of the child widget.
[ { "docid": "842ffdd59fdbe09c036df3789bc2d23f", "score": "0.7193198", "text": "_updateTitle() {\n if (this._changeGuard) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n this.title.label = content.title.label;\n this.title.mnemonic = content.title.mnemonic;\n this.title.iconClass = content.title.iconClass;\n this.title.iconLabel = content.title.iconLabel;\n this.title.caption = content.title.caption;\n this.title.className = content.title.className;\n this.title.dataset = content.title.dataset;\n this._changeGuard = false;\n }", "title": "" } ]
[ { "docid": "d41c72e2e5b7b807a752eb2c1c7638ad", "score": "0.7058635", "text": "function updateTitleComponent() {\n if (self.titleComponent) {\n self.titleComponent.generate(self.exportSizes.selectedOption, showToast, true);\n }\n }", "title": "" }, { "docid": "30892bd59b3f1ca4322b6fe3819cf812", "score": "0.6970297", "text": "_updateTitle() {\n Private.updateTitle(this, this._connected, this._executed);\n }", "title": "" }, { "docid": "eccca584c84bc799944785f94e5daae1", "score": "0.69483435", "text": "updateTitle() {\n this.title.text = this.window.title;\n }", "title": "" }, { "docid": "036cbb3158fbcff35cd4e44080b7b364", "score": "0.69153947", "text": "_updateContentTitle() {\n if (this._changeGuard) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n content.title.label = this.title.label;\n content.title.mnemonic = this.title.mnemonic;\n content.title.iconClass = this.title.iconClass;\n content.title.iconLabel = this.title.iconLabel;\n content.title.caption = this.title.caption;\n content.title.className = this.title.className;\n content.title.dataset = this.title.dataset;\n this._changeGuard = false;\n }", "title": "" }, { "docid": "e455e9640902c3e17a12d291d79d9f42", "score": "0.6726739", "text": "function updateTitle() {\n // Grab the link and its text...\n var link = $(this),\n text = link.text();\n // ... and format its title attribute\n link.attr('title', breadcrumbs(link) + ' > ' + text);\n }", "title": "" }, { "docid": "b457af1a004008980cf79343d3884e5c", "score": "0.6638683", "text": "updateTitle(snapshot) {\n const title = this.buildTitle(snapshot);\n if (title !== undefined) {\n this.title.setTitle(title);\n }\n }", "title": "" }, { "docid": "ddb55debd720205f22313b892912acf7", "score": "0.6515065", "text": "_onTitleChanged() {\n this.title.label = coreutils_1.PathExt.basename(this.context.localPath);\n }", "title": "" }, { "docid": "ddb55debd720205f22313b892912acf7", "score": "0.6515065", "text": "_onTitleChanged() {\n this.title.label = coreutils_1.PathExt.basename(this.context.localPath);\n }", "title": "" }, { "docid": "d876dbc425fd2950406ec09f4cafa1cf", "score": "0.643436", "text": "parseTitleProp(newValue) {\n if (newValue)\n this.innerTitle = newValue;\n }", "title": "" }, { "docid": "df36dc85b186aa7460a1ca031eaaae17", "score": "0.63866186", "text": "_updateTitle() {\n let ttl = '';\n if (this._curPage) {\n ttl = this._curPage.title()\n }\n document.title = this._rootArea.title(ttl);\n }", "title": "" }, { "docid": "2177c1719d0add592c4eb50fae4cf3b7", "score": "0.6361321", "text": "setTitle(title) { this.setParam(C.TITLE, title); }", "title": "" }, { "docid": "d20fce6b7f4bf7212bab621598effb4b", "score": "0.6282202", "text": "function setTitle(){\n var cntdownIdValue = Number(this.parentElement.getAttribute(\"id\").replace(\"cntdown-\",\"\"));\n cntdowns[cntdownIdValue].title = this.value;\n}", "title": "" }, { "docid": "a7c1ac6043a8cefd601e88162b896ce9", "score": "0.6226344", "text": "function handleTitle(evt) {\n setTitle(evt.target.value);\n }", "title": "" }, { "docid": "427cf8fa0ce9cb53c0e31fa7f9f2811e", "score": "0.62254053", "text": "function changeTitle() {\n\tif (title.hasChildNodes(document.getElementById(\"title\"))) {\n\t\ttitle.textContent = '';\n\t\ttitle.appendChild(austinTitle);\n\t}\n\telse if (title.hasChildNodes(document.getElementById(\"title\"))) {\n\t\ttitle.removeChild(document.getElementById(\"patricksTitle\"));\n\t\ttitle.appendChild(austinTitle);\n\t}\n}", "title": "" }, { "docid": "ce5ff456453e9959b6997d08541f8700", "score": "0.62081486", "text": "function updateTitleText(newTitle) {\n var cap = newTitle + \" : AudioHub\";\n document.getElementsByTagName(\"title\")[0].innerHTML = cap;\n document.getElementById(\"captionbar-title\").innerHTML = cap;\n}", "title": "" }, { "docid": "e17acf0d05ed3380b34264b62df5022b", "score": "0.6198605", "text": "function setTitle(title){\r\n\t\t\t\tthis.title = title;\r\n\t\t\t\t//listen_tree(this);\r\n\t\t\t}", "title": "" }, { "docid": "86e09043c8f8608c3754bfe2c89b51b6", "score": "0.61796755", "text": "onUpdateTitle(event){\n event.preventDefault();\n let { shadowPage, onUpdateShadowPage } = this.props;\n let newPage = Object.assign({},\n shadowPage,\n {'title': event.target.value });\n onUpdateShadowPage(newPage);\n }", "title": "" }, { "docid": "97f66853abd6edf7c510c9bd9d7ada55", "score": "0.6116138", "text": "function card_title_change() {\n\tlet deck = g_decks[g_ui.deckIdx];\n\tlet card = deck.cards[g_ui.cardIdx];\n\tif (card) {\n\t\tcard.title = $('#card-title').val();\n\t\tif (g_ui.cardIdx || g_ui.cardIdx === 0) {\n\t\t\t$('#cards-list')[0].children[g_ui.cardIdx].children[0].innerText = card.title;\n\t\t}\n\t\tcard_render();\n\t}\n}", "title": "" }, { "docid": "caca51fb505f6e15f351aaa8b2d1819c", "score": "0.60719234", "text": "function updateTitle() {\n var pos = d3.mouse(fullMareyForeground.node());\n var x = pos[0];\n var station = stationXScaleInvert[Math.round(xScale.invert(x))];\n if (station) {\n highlightMareyTitle(station);\n }\n }", "title": "" }, { "docid": "fc7aa17fc6d107dbf80d428bb6c9f834", "score": "0.6041338", "text": "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "title": "" }, { "docid": "ea425d4f5f725ece4601bc013dd72212", "score": "0.60330284", "text": "function adjustTitle(title) {\n\t$('#title').val(title);\n}", "title": "" }, { "docid": "52222d7597cd3160958b62a32a2e42fa", "score": "0.60024875", "text": "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "title": "" }, { "docid": "52222d7597cd3160958b62a32a2e42fa", "score": "0.60024875", "text": "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "title": "" }, { "docid": "52222d7597cd3160958b62a32a2e42fa", "score": "0.60024875", "text": "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "title": "" }, { "docid": "20fd3344b3824eeb0b9e756c852778f5", "score": "0.5992663", "text": "updateTitle(event) {\n this.setState({title: event.target.value, titleTyped: true});\n }", "title": "" }, { "docid": "30e290af50d1bae03983cd2491454d94", "score": "0.5980653", "text": "drawTitle() {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('font-size', '20')\n .attr('x', this.width / 2)\n .attr('y', this.titleHeight - this.titleHeight * 0.1)\n .style('text-anchor', 'middle')\n .text(this.chartData.title);\n\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('font-size', '12')\n .attr('x', this.width / 2)\n .attr(\n 'y',\n this.titleHeight -\n this.titleHeight * 0.1 +\n this.subtitleHeight\n )\n .style('text-anchor', 'middle')\n .text(this.chartData.subtitle);\n }", "title": "" }, { "docid": "9200ce18af6b205aee0616ecad126eec", "score": "0.59514993", "text": "function title(elem, value) {\n if (arguments.length == 1) {\n //---- GET value ----\n value = null;\n\n if (vp.utils.isSvgElement(elem)) {\n var title = getTitleChild(elem);\n if (title) {\n value = title.textContent;\n }\n } else if (elem.getAttribute) {\n value = elem.getAttribute(\"title\");\n }\n\n return value;\n } else {\n //---- SET value ----\n var actualValue = value;\n\n if (typeof value === \"function\") {\n actualValue = value(elem.dataItem, elem.dataIndex);\n }\n\n if (vp.utils.isSvgElement(elem)) {\n var title = getTitleChild(elem);\n if (!title) {\n title = vp.dom.createSvg(\"title\");\n elem.appendChild(title);\n }\n\n title.textContent = value;\n //---- seems to work without this, for HTML and SVG, except for IE/SVG ----\n //---- and for IE/SVG, this doesn't help ----\n //---- for native tooltips honoring newline chars ----\n //css(title, \"white-space\", \"pre-wrap\");\n } else {\n elem.setAttribute(\"title\", actualValue);\n }\n }\n }", "title": "" }, { "docid": "6ea5b92a1533f5893e229e6ab9101a50", "score": "0.59465104", "text": "function titleSetter() {\n $(\"header h1\").html(store.quizName);\n}", "title": "" }, { "docid": "8decbecd36af776d314169dd61096d95", "score": "0.5928182", "text": "titleChanged(title) {\n this.setState({\n title,\n });\n }", "title": "" }, { "docid": "c7cf5c91464b3f2894fb1defba11e94a", "score": "0.5923406", "text": "_onTitleChanged(sender) {\n this._setHeader();\n }", "title": "" }, { "docid": "572304675408e7ebd4aeebd05fd065c4", "score": "0.590666", "text": "function di_changeTitleText(uid, txtVal)\n{ \n\tvar titleType = di_jq('#di_vcTitlesList'+uid).val();\n\tif(titleType!=-1) {\n\t\tif(titleType=='Column Chart') titleType=1;\n\t\tif(titleType=='Sub title') titleType=2;\t\t\n\t\tvar chartObj = di_getChartObject(uid);\n\t\tvar titleObj = di_getTitleObj(chartObj, titleType);\n\t\ttitleObj.text = txtVal;\n\t\tdi_setTitleObj(chartObj, titleObj, titleType);\n\t}\n}", "title": "" }, { "docid": "2d60b022d58aebaa62064c74b66fae48", "score": "0.58946013", "text": "function setTitle() {\n if (selectValue == \"Update Charts Below With New Attribute\" || selectValue == \"Choose an Attribute\" || selectValue == \"waste\") {\n selectValue = \"waste\";\n title = \"Food Security\";\n } else if (selectValue == \"schoolOECD\") {\n title = \"Secondary Net Enrollment\";\n } else if (selectValue == \"polity\") {\n title = \"Democracy\";\n } else if (selectValue == \"GINIW\") {\n title = \"Inequality\";\n } else if (selectValue == \"lnyUN\") {\n title = \"GDP Per Capita\";\n }\n\n return title;\n}", "title": "" }, { "docid": "e5a74378d2f04a3799a5710af10c3448", "score": "0.5854244", "text": "handleTitleChange(title) {\n\t\tthis.setState({\n\t\t\tgoalTitle: title\n\t\t});\n\t}", "title": "" }, { "docid": "684f1da5dc165f74791777a2627ba3d6", "score": "0.58514863", "text": "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "title": "" }, { "docid": "55153a9ab79e3dea83139bc4d8ab5a3a", "score": "0.5843757", "text": "function drawTitle()\n\t{\n\t\ttitle = that.add('text', {\n\t\t\ttext: \"Standard(s): TEKS \",\n\t\t\tcolor: style.titleColor,\n\t\t\tfont: style.titleFont,\n\t\t}, {\n\t\t\ttop: that.id + ' top',\n\t\t\tleft: that.id + ' left'\n\t\t});\n\t}", "title": "" }, { "docid": "0ab203300144a17c86ea3afb967d7e42", "score": "0.5841214", "text": "function showTitle() {\n g.selectAll('.count-title')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.openvis-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n\n hideAxis();\n }", "title": "" }, { "docid": "0cfbf5d83353f93ec6e07285fec03c57", "score": "0.5839666", "text": "onSetTitle(newTitle) {\n if (!is.array(newTitle)) {\n newTitle = [newTitle];\n }\n\n this.title = newTitle;\n\n // Also refresh the ogTitle\n this.ogTitle = this.title.slice();\n }", "title": "" }, { "docid": "291c65fc50f56dae648fd636c6da52ff", "score": "0.58393246", "text": "changeTitle(title) {\n console.log('you clicked me!');\n this.title = title\n }", "title": "" }, { "docid": "34b2153a0d48dda165afef24f1160977", "score": "0.58359045", "text": "changeTitle(title) {\n this.setState({ title });\n }", "title": "" }, { "docid": "ff8a8a058c8b68086e9fcfffe49662e8", "score": "0.58222544", "text": "title (titleText) {\n\t\tthis._titles.main = titleText;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "65411c9ad39cf3e5652aa421f63e67a6", "score": "0.58163005", "text": "setTitle(title) {\n // Data assertions\n ow_1.default(title, 'title', Assertions_1.titlePredicate);\n this.title = title ?? undefined;\n return this;\n }", "title": "" }, { "docid": "41bab0fdac4a64387f3c322b4bbca5fa", "score": "0.5811357", "text": "function changeWindowTitle() {\n window.document.title = 'Data Entry #' + getUrlFragment();\n entryHeader = document.getElementById('entry-title').children[0];\n entryHeader.innerHTML = \"Detailansicht ID: \" + getUrlFragment();\n }", "title": "" }, { "docid": "e2904e73594f9891dc6f3d7b1114180e", "score": "0.5810515", "text": "onViewTitleChanged(title) {\n this.viewTitle = title;\n }", "title": "" }, { "docid": "e2904e73594f9891dc6f3d7b1114180e", "score": "0.5810515", "text": "onViewTitleChanged(title) {\n this.viewTitle = title;\n }", "title": "" }, { "docid": "be5fe0e0897b26e9c3a3f101afd33fc7", "score": "0.5808367", "text": "function setTitle(args) {\n var widget = args.gs._widget;\n if (widget._view && widget._view.setTitle) {\n var title = _.isArray(args.a) ? args.a[0] : args.a;\n widget._view.setTitle(title);\n }\n }", "title": "" }, { "docid": "f52590243888ecc2cbfc07344f5a76c6", "score": "0.5808292", "text": "function createTitle(title) {\n group\n .append('text')\n .attr('class', 'title')\n .attr('y', -30)\n .attr('x', (width / 2))\n .text(title);\n}", "title": "" }, { "docid": "07e990511ebec30ebed49121a7b99e36", "score": "0.58077", "text": "function showTitle() {\n g.selectAll('.count-title')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n g.selectAll('.openvis-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n\n hideyAxis();\n hidexAxis();\n\n g.selectAll('.hist')\n .transition()\n .duration(1000)\n .attr('opacity', 0)\n .style('opacity', 0);\n\n g.selectAll('.co2EmissionText1')\n .transition()\n .duration(600)\n .attr('opacity', 0);\n\n g.selectAll('.co2EmissionCount')\n .transition()\n .duration(600)\n .attr('opacity', 0);\n\n g.selectAll('.co2EmissionText2')\n .transition()\n .duration(600)\n .attr('opacity', 0);\n }", "title": "" }, { "docid": "b7ac269ec4b4c69e830be1721acb7da3", "score": "0.57937044", "text": "static set xboxTitleId(value) {}", "title": "" }, { "docid": "c1ca7d04d9eac3a060211f6b14e5dd2b", "score": "0.5785149", "text": "function handleTitleInput(e) {\n setTitle(e.target.value);\n }", "title": "" }, { "docid": "03ee040f0d8eb54f9e26d3822c548391", "score": "0.5781069", "text": "get title() { return this._title; }", "title": "" }, { "docid": "79798bd09f5894b50e5c8401b647962e", "score": "0.57678384", "text": "setTitle(newTitle) {\n if (newTitle !== this.props.model.data.title) {\n this.props.setModelData({ title: newTitle });\n }\n }", "title": "" }, { "docid": "559dd1a3a5bc9a5ad3131b5acb38b045", "score": "0.575618", "text": "setTitle(title) {\n this.data.title = titleValidator.parse(title);\n return this;\n }", "title": "" }, { "docid": "18bc4753c93f2610db76133494e2c95a", "score": "0.5753117", "text": "function addTitle() {\n var dispTitle = getSetting('_mapTitleDisplay');\n\n if (dispTitle !== 'off') {\n var title = '<h3 class=\"pointer\">' + getSetting('_mapTitle') + '</h3>';\n var subtitle = '<h5>' + getSetting('_mapSubtitle') + '</h5>';\n\n if (dispTitle == 'topleft') {\n $('div.leaflet-top').prepend('<div class=\"map-title leaflet-bar leaflet-control leaflet-control-custom\">' + title + subtitle + '</div>');\n } else if (dispTitle == 'topcenter') {\n $('#map').append('<div class=\"div-center\"></div>');\n $('.div-center').append('<div class=\"map-title leaflet-bar leaflet-control leaflet-control-custom\">' + title + subtitle + '</div>');\n }\n\n $('.map-title h3').click(function() { location.reload(); });\n }\n }", "title": "" }, { "docid": "653757f7f48810baf7a97d7df298d731", "score": "0.5751441", "text": "function setDictionaryTitle() {\n console.info('setTitle')\n $('#title').html('Woordenboek instellingen')\n $('#subtitle').html('Voeg hier de ontbrekende woorden toe')\n}", "title": "" }, { "docid": "42fecb233629e184f8319747b5c8b511", "score": "0.5739386", "text": "function title() {\n\t\t\t\tif (document.getElementById('cmn-toggle-0').checked) {\n\t\t\t\t\tmap.addLayer(parent2);\n\t\t\t\t} else {\n\t\t\t\t\tmap.removeLayer(parent2);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "e5661c99a829711b042ae8085de9b855", "score": "0.57384944", "text": "updateText() {\n this.children[1].textContent = this.name;\n }", "title": "" }, { "docid": "c00590b64ffda6f980a7aec4739806a8", "score": "0.57350993", "text": "set title(aValue) {\n this._logService.debug(\"gsDiggStoryDTO.title[set]\");\n this._title = aValue;\n }", "title": "" }, { "docid": "039b008a5d744eb13101144c24d078a7", "score": "0.57230645", "text": "function setButtonsTitle() {\n\n // OnHover will not work for mobile\n // Hence not need for mobile\n if (isMobileDevice) return;\n\n tippy(audioButton, {\n content: \"Turn Off Audio\",\n placement: \"top\",\n });\n tippy(videoButton, {\n content: \"Turn Off Video\",\n placement: \"top\",\n });\n\n tippy(leaveButton, {\n content: \"Leave the call\",\n placement: \"top\"\n })\n\n tippy(moreButton, {\n content: \"More actions\",\n placement: \"top\"\n })\n}", "title": "" }, { "docid": "84df931e7d9de87214c2ad9a2b9f30d3", "score": "0.5718638", "text": "function showTitle () {\r\n\t\tvar title = options.title,\r\n\t\t\ttitleAlign = title.align,\r\n\t\t\tsubtitle = options.subtitle,\r\n\t\t\tsubtitleAlign = subtitle.align,\r\n\t\t\tanchorMap = { // get the anchor relative to the alignment\r\n\t\t\t\tleft: 0,\r\n\t\t\t\tcenter: chartWidth / 2,\r\n\t\t\t\tright: chartWidth\r\n\t\t\t};\r\n\t\t\r\n\t\t\t\r\n\t\t// title\r\n\t\tif (title && title.text) {\r\n\t\t\trenderer.text(\r\n\t\t\t\ttitle.text, \r\n\t\t\t\tanchorMap[titleAlign] + title.x,\r\n\t\t\t\ttitle.y, \r\n\t\t\t\ttitle.style, \r\n\t\t\t\t0,\r\n\t\t\t\ttitleAlign\r\n\t\t\t).attr({\r\n\t\t\t\t'class': 'highcharts-title'\r\n\t\t\t}).add();\r\n\t\t}\r\n\t\t\r\n\t\t// subtitle\r\n\t\tif (subtitle && subtitle.text) {\r\n\t\t\trenderer.text(\r\n\t\t\t\tsubtitle.text, \r\n\t\t\t\tanchorMap[subtitleAlign] + subtitle.x,\r\n\t\t\t\tsubtitle.y, \r\n\t\t\t\tsubtitle.style, \r\n\t\t\t\t0,\r\n\t\t\t\tsubtitleAlign\r\n\t\t\t).attr({\r\n\t\t\t\t'class': 'highcharts-subtitle'\r\n\t\t\t}).add();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "904574899b8c7c2d30a0c1204ab7e643", "score": "0.5718566", "text": "function changeTitleForFancyTree() {\n\t \tvar listOnProcess = data;\n\t \tdo {\n\t \tvar newList = [];\n\t \tlistOnProcess.forEach(d => {\n\t \t\tif (d[childrenCol]) { //if it has children\n\t \t\t\tnewList = newList.concat(d[childrenCol]);\n\t \t\t}\n\t \t\tvar newTitle = \"\";\n\t \t\tvar idVal = \"\", descVal = \"\"\n\t \t\tif (d[idCol]) {\n\t \t\t\tidVal = d[idCol];\n\t \t\t}\n\t \t\tif (d[descCol]) {\n\t \t\t\tdescVal = d[descCol];\n\t \t\t}\n\t \t \tswitch (view) {\n\t\t\t \tcase \"id\":\n\t\t\t \t\tnewTitle = idVal;\n\t\t\t \t\tbreak;\n\t\t\t \tcase \"desc\":\n\t\t\t \t\tnewTitle = descVal;\n\t\t\t \t\tbreak;\n\t\t\t \tcase \"id - desc\":\n\t\t\t \t\tnewTitle = idVal + \" - \" + descVal;\n\t\t\t \t\tbreak;\n\t\t\t \tdefault:\n\t\t\t \t\tnewTitle = idVal;\n\t \t \t}\n\t \t\td.title = newTitle;\n\t \t});\n\t \tlistOnProcess = newList;\n\t \t}\n\t \twhile (listOnProcess.length > 1);\n\t }", "title": "" }, { "docid": "d842c72f1112776c3c4cff5175ef3129", "score": "0.5711794", "text": "setTitle(title) {\n this.options.title = title\n $('#modal-title').text(title)\n\n }", "title": "" }, { "docid": "8e5d4c0c162401d93d7f23ed7af91f10", "score": "0.5710322", "text": "function rewriteTitle()\n {\n if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE)\n return;\n \n var titleDiv = document.getElementById('title-meta');\n \n if(titleDiv == null || titleDiv == undefined)\n return;\n \n var cloneNode = titleDiv.cloneNode(true);\n var firstHeading = YAHOO.util.Dom.getElementsByClassName('firstHeading', 'h1', document.getElementById('content') )[0];\n var node = firstHeading.childNodes[0];\n \n // new, then old!\n firstHeading.replaceChild(cloneNode, node);\n cloneNode.style.display = \"inline\";\n \n var titleAlign = document.getElementById('title-align');\n firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n }", "title": "" }, { "docid": "64da13bfe68a59c53c497abf6455c5f3", "score": "0.57031256", "text": "function changeTitle () {\n $('#bigtit').text('GO GO GO');\n }", "title": "" }, { "docid": "5a2d655aa87fc20788d889dca2b30aaf", "score": "0.5700233", "text": "initializeTitleAndSettings() {\n this.updateSettingsComponent();\n this.cardTitle = <Textarea\n onChange={e => this.stateChanged({\"label\": \"ChangedTitle\", value: e.target.value})}\n noLayout={true}\n disabled={!this.props.editable}\n defaultValue={this.state.title}\n key={this.counter}\n className=\"card-title editable-title\"\n placeholder={\"Report name...\"}/>;\n this.closeIcon = <div\n style={{'width': '100%', 'height': '60px', 'top': '0px', 'right': '0px', 'position': 'absolute'}}\n onClick={e => this.stateChanged({label: 'SettingsSaved'})}>\n <Icon>save</Icon>\n </div>;\n }", "title": "" }, { "docid": "15750245b14e1915517a8935530c1faf", "score": "0.56961054", "text": "function updateTitle(nodo, data) {\n nodo.find(\".Topic-item-title\").html(data);\n}", "title": "" }, { "docid": "5eb5661f3a3f0dd977cf19f65b098bb5", "score": "0.56778634", "text": "function setTitle() {\r\n document.title=document.getElementById(\"main\").contentDocument.querySelector(\"span>a\").innerText + \" - \" + document.getElementById(\"main\").contentDocument.querySelector(\"p.artist\").innerText;\r\n}", "title": "" }, { "docid": "32e3df2c0d31f8b9a361396a8b2f4a9d", "score": "0.56768274", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n}", "title": "" }, { "docid": "01707b3515366a00ca1558ef34fbc60e", "score": "0.56765884", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n \n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n \n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "title": "" }, { "docid": "990f897ae69ab57f65c278c79a21280c", "score": "0.5674332", "text": "function updateTitle(title) {\t\n\tdocument.getElementById(\"intro\").innerHTML = title;\t\n}", "title": "" }, { "docid": "c27e19877f7f13fd72ee5266c579b529", "score": "0.5673585", "text": "buildTitle() {\n let title = document.createElement(\"div\");\n let text = document.createElement(\"p\");\n title.setAttribute(\"class\", \"title \" + \"t\" + (parseInt(this.item.status) + 1));\n title.appendChild(text);\n text.innerHTML = this.item.title;\n\n //indicate that this is new item\n if(this.item.status == -1) {\n let setStateNotification = document.createElement(\"div\");\n setStateNotification.setAttribute(\"class\", \"notification\");\n setStateNotification.innerHTML = \"New!\";\n title.appendChild(setStateNotification);\n }\n\n return title;\n }", "title": "" }, { "docid": "0fc75d061025e40bc4898963e9c8177e", "score": "0.5665498", "text": "createTitle() {\n this.gameTitle = this.add.text(\n this.GAME_WIDTH / 2, this.GAME_HEIGHT / 2,\n '',\n this.titleTextStyle\n ).setAlpha(0);\n }", "title": "" }, { "docid": "a202529f6b634d32e8d443b0329aab7b", "score": "0.5664441", "text": "function UpdateTitleDirective($log) {\n\n return {\n restrict: 'E',\n scope: {\n title: '@'\n },\n link: function(scope, iElem, iAttrs) {\n\n // watch the value and set as needed\n // use document instead of $document as $document doesn't work here\n scope.$watch('title', function (newValue, oldValue) {\n if (typeof newValue !== 'undefined') {\n if(document){\n document.title = newValue;\n }\n }\n });\n }\n };\n }", "title": "" }, { "docid": "7456e2edbb82f8bc0ecb065de18b1960", "score": "0.56570834", "text": "function updateTitle(panel, connected, executed) {\n var session = panel.console.session;\n var caption = (\"Name: \" + session.name + \"\\n\" +\n (\"Directory: \" + coreutils_1.PathExt.dirname(session.path) + \"\\n\") +\n (\"Kernel: \" + session.kernelDisplayName));\n if (connected) {\n caption += \"\\nConnected: \" + coreutils_1.Time.format(connected.toISOString());\n }\n if (executed) {\n caption += \"\\nLast Execution: \" + coreutils_1.Time.format(executed.toISOString());\n }\n panel.title.label = session.name;\n panel.title.caption = caption;\n }", "title": "" }, { "docid": "587b43f4b0525ca92f0a2eb74d38821a", "score": "0.5657066", "text": "function changeTitle(addition) {\n title_content = \"Hackernews - \" + addition\n changeInnerHTML(\"title\", title_content)\n changeInnerHTML(\"title_h2\", title_content)\n}", "title": "" }, { "docid": "2751cc081d325b37ac5812b9a69995ff", "score": "0.56376773", "text": "function updateTitle(titleKey) {\n if (!titleKey && $state.$current.data && $state.$current.data.pageTitle) {\n titleKey = $state.$current.data.pageTitle;\n }\n $translate(titleKey || 'global.title').then(function (title) {\n $window.document.title = title;\n });\n }", "title": "" }, { "docid": "b5da3a228af4d264e21ccc8613205f16", "score": "0.56325406", "text": "function Title(text){\n var t = document.createElement('div');\n t.classList.add('title');\n t.innerText = text;\n\n t.addEventListener('click', toggleParent);\n return t;\n}", "title": "" }, { "docid": "0da59cebf6d3d16b34acf73a10e3ddbb", "score": "0.5619533", "text": "function setupTitle() {\n // Initial params: disable side-scrolling.\n current_mode = 'classic';\n load_level = 0;\n enableFade();\n showTitle();\n startGame();\n disableSidescrolling();\n alignPlayer();\n fadeIn(1000); // Enqueue fade-in request. Fade in after 1s of 'request' being dequeued.\n}", "title": "" }, { "docid": "3ee06f7ecc7635d890a6b2fd9c84d591", "score": "0.5616525", "text": "setTitle(title, suffix = ' - UTS:HELPS Booking System') {\n this.setState({\n title: `${title}${suffix}`\n })\n return this\n }", "title": "" }, { "docid": "2ed0e1e0e2edf4763495360a4b86738b", "score": "0.56134963", "text": "function changeMainTitle(string) {\n document.querySelector(\".title-wrapper span\").innerHTML = string\n}", "title": "" }, { "docid": "9e6595b12045d803e56a7749f4805dee", "score": "0.5611561", "text": "setTitle(title) {\n titlePredicate.parse(title);\n this.data.title = title ?? void 0;\n return this;\n }", "title": "" }, { "docid": "5aebfd51944f62268f71e421749fc85d", "score": "0.56090665", "text": "function setuptitles()\n{\n var logopener=\"----entering setuptitles----\";\n console.log(logopener);\n\n //get the title H1 tags\n var maintitleline1 = document.getElementById(\"maintitleline1\");\n var maintitleline2 = document.getElementById(\"maintitleline2\");\n\n //set them with desired values.\n let titleline1 = \"bari basic tutorial demo app\";\n let titleline2 = \"built using HTML, CSS and JS plus Bootstrap only\";\n\n maintitleline1.innerHTML = titleline1;\n maintitleline2.innerHTML = titleline2;\n\n var logcloser=\"----leaving setuptitles----\";\n console.log(logcloser);\n}", "title": "" }, { "docid": "7d470eda7d19a7c1f9cc6d43f54f08ae", "score": "0.5605561", "text": "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE )\n\t\treturn;\n\tvar titleDiv = document.getElementById('title-meta');\n\n\tif( titleDiv == null )\n\t\treturn;\n\n\tvar cloneNode = titleDiv.cloneNode(true);\n\tvar firstHeading = getFirstHeading();\n\tvar node = firstHeading.childNodes[0];\n\n\t// new, then old!\n\tfirstHeading.replaceChild(cloneNode, node);\n\tcloneNode.style.display = \"inline\";\n\n\tvar titleAlign = document.getElementById('title-align');\n\tfirstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.55963427", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.55963427", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.55963427", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.55963427", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "442cf0eb3532ecafad56d4c5e9b6d807", "score": "0.5587767", "text": "renderTitle() {\n this.plot.append(\"text\")\n .classed(\"diagramTitle\", true)\n .classed(\"diagramSubTitle\", true)\n .text(\"deaths per\")\n .attr(\"x\",this.width/2)\n .attr(\"y\",this.width/2 - (this.width * 0.05))\n .style(\"font-size\",\"2vh\")\n\n this.plot.append(\"text\")\n .classed(\"diagramTitle\", true)\n .text(this.title)\n .attr(\"x\",this.width/2)\n .attr(\"y\",this.width/2 + (this.width * 0.07))\n }", "title": "" }, { "docid": "f97e159eca03458f1c6c29757d3d0322", "score": "0.55794877", "text": "get title() {\n return this.getAttribute('title') || '';\n }", "title": "" }, { "docid": "5ceebc99815462843c39c37ffb82d7f6", "score": "0.5577631", "text": "function updatePreviewTitle(title) {\r\n document.querySelector(\".selected-preview\").childNodes[0].childNodes[1].innerText = title; \r\n}", "title": "" }, { "docid": "e61efb5f7f91f936dacd2162a8ac6dee", "score": "0.5575673", "text": "function updateTitle() {\n $('#title').text(kytmp.getVideoData().title);\n}", "title": "" }, { "docid": "adcb21429874f309d0c4dde5755c4a92", "score": "0.55643225", "text": "set title(title) {\n\t\tthis.window.title = title;\n\t}", "title": "" }, { "docid": "c4fdae04d4709b47327f07bf65a2414f", "score": "0.5550087", "text": "function rewriteTitle()\n{\n if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE)\n return;\n\n var titleDiv = document.getElementById('title-meta');\n\n if(titleDiv == null || titleDiv == undefined)\n return;\n\n var cloneNode = titleDiv.cloneNode(true);\n var firstHeading = getElementsByClass('firstHeading', document.getElementById('content'), 'h1')[0];\n var node = firstHeading.childNodes[0];\n\n // new, then old!\n firstHeading.replaceChild(cloneNode, node);\n cloneNode.style.display = \"inline\";\n\n var titleAlign = document.getElementById('title-align');\n firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue;\n}", "title": "" }, { "docid": "51ef9e9fd9e5857ec0ac1bb3c7c7e22d", "score": "0.5542177", "text": "function setTitle (newTitle) {\r\n if (this.started && !this.ended) {\r\n let scene = new Scene()\r\n if (scene.title == this.title) {\r\n scene.title = newTitle\r\n scene.fullscreen = false\r\n scene.save()\r\n }\r\n }\r\n\r\n return newTitle\r\n}", "title": "" }, { "docid": "50cc8a2d679224d98826a431955444be", "score": "0.5542064", "text": "function Title(options) {\r\n this._label = '';\r\n this._caption = '';\r\n this._mnemonic = -1;\r\n this._iconClass = '';\r\n this._iconLabel = '';\r\n this._className = '';\r\n this._closable = false;\r\n this._changed = new signaling_1.Signal(this);\r\n this.owner = options.owner;\r\n if (options.label !== undefined) {\r\n this._label = options.label;\r\n }\r\n if (options.mnemonic !== undefined) {\r\n this._mnemonic = options.mnemonic;\r\n }\r\n if (options.icon !== undefined) {\r\n this._iconClass = options.icon;\r\n }\r\n if (options.iconClass !== undefined) {\r\n this._iconClass = options.iconClass;\r\n }\r\n if (options.iconLabel !== undefined) {\r\n this._iconLabel = options.iconLabel;\r\n }\r\n if (options.caption !== undefined) {\r\n this._caption = options.caption;\r\n }\r\n if (options.className !== undefined) {\r\n this._className = options.className;\r\n }\r\n if (options.closable !== undefined) {\r\n this._closable = options.closable;\r\n }\r\n this._dataset = options.dataset || {};\r\n }", "title": "" }, { "docid": "50cc8a2d679224d98826a431955444be", "score": "0.5542064", "text": "function Title(options) {\r\n this._label = '';\r\n this._caption = '';\r\n this._mnemonic = -1;\r\n this._iconClass = '';\r\n this._iconLabel = '';\r\n this._className = '';\r\n this._closable = false;\r\n this._changed = new signaling_1.Signal(this);\r\n this.owner = options.owner;\r\n if (options.label !== undefined) {\r\n this._label = options.label;\r\n }\r\n if (options.mnemonic !== undefined) {\r\n this._mnemonic = options.mnemonic;\r\n }\r\n if (options.icon !== undefined) {\r\n this._iconClass = options.icon;\r\n }\r\n if (options.iconClass !== undefined) {\r\n this._iconClass = options.iconClass;\r\n }\r\n if (options.iconLabel !== undefined) {\r\n this._iconLabel = options.iconLabel;\r\n }\r\n if (options.caption !== undefined) {\r\n this._caption = options.caption;\r\n }\r\n if (options.className !== undefined) {\r\n this._className = options.className;\r\n }\r\n if (options.closable !== undefined) {\r\n this._closable = options.closable;\r\n }\r\n this._dataset = options.dataset || {};\r\n }", "title": "" }, { "docid": "50cc8a2d679224d98826a431955444be", "score": "0.5542064", "text": "function Title(options) {\r\n this._label = '';\r\n this._caption = '';\r\n this._mnemonic = -1;\r\n this._iconClass = '';\r\n this._iconLabel = '';\r\n this._className = '';\r\n this._closable = false;\r\n this._changed = new signaling_1.Signal(this);\r\n this.owner = options.owner;\r\n if (options.label !== undefined) {\r\n this._label = options.label;\r\n }\r\n if (options.mnemonic !== undefined) {\r\n this._mnemonic = options.mnemonic;\r\n }\r\n if (options.icon !== undefined) {\r\n this._iconClass = options.icon;\r\n }\r\n if (options.iconClass !== undefined) {\r\n this._iconClass = options.iconClass;\r\n }\r\n if (options.iconLabel !== undefined) {\r\n this._iconLabel = options.iconLabel;\r\n }\r\n if (options.caption !== undefined) {\r\n this._caption = options.caption;\r\n }\r\n if (options.className !== undefined) {\r\n this._className = options.className;\r\n }\r\n if (options.closable !== undefined) {\r\n this._closable = options.closable;\r\n }\r\n this._dataset = options.dataset || {};\r\n }", "title": "" }, { "docid": "874031efb858dde9da9705845a8806ce", "score": "0.5537355", "text": "function updateTitle(panel, connected, executed) {\n let session = panel.console.session;\n let caption = `Name: ${session.name}\\n` +\n `Directory: ${coreutils_1.PathExt.dirname(session.path)}\\n` +\n `Kernel: ${session.kernelDisplayName}`;\n if (connected) {\n caption += `\\nConnected: ${coreutils_1.Time.format(connected.toISOString())}`;\n }\n if (executed) {\n caption += `\\nLast Execution: ${coreutils_1.Time.format(executed.toISOString())}`;\n }\n panel.title.label = session.name || 'Console';\n panel.title.caption = caption;\n }", "title": "" }, { "docid": "1baf375e94f6d0f25d6253f92e96d6ed", "score": "0.55352134", "text": "onSetOgTitle(newTitle) {\n if (!is.array(newTitle)) {\n newTitle = [newTitle];\n }\n\n this.ogTitle = newTitle;\n }", "title": "" }, { "docid": "b590c83b48c2aa4ae33c0909e898d955", "score": "0.55350214", "text": "function update_title(filtered_died, filtered_survived) {\n title_died.text(\n `Died: ${filtered_died.size()} Souls, ${(\n (filtered_died.size() * 100) /\n 1496\n )\n .toFixed(1)\n .toString()}% of Total Victims`\n );\n title_survived.text(\n `Survived: ${filtered_survived.size()} Souls, ${(\n (filtered_survived.size() * 100) /\n 712\n )\n .toFixed(1)\n .toString()}% of Total Survivors`\n );\n }", "title": "" }, { "docid": "4b98339ce5cf02d1e6c60d4f9c0ace0a", "score": "0.5533047", "text": "function set_title_and_get_x (title_index, label, button_width) {\n // first get a pointer to the title element\n var title = elements.titles[title_index];\n // set the max width based on the space left on screen by the button\n var max_width = screen_width - BUTTON_MARGIN_LEFT - button_width - (BUTTON_MARGIN_RIGHT * 2);\n title.style.maxWidth = to_px(max_width);\n // now set the title text content and get the resulting width\n title.textContent = label;\n var width = title.offsetWidth;\n // titles have to be laid out at a minimum to the right of the button with a margin\n var min_x = BUTTON_MARGIN_LEFT + button_width + BUTTON_MARGIN_RIGHT;\n // by default titles are centered\n var x = (screen_width - width) / 2;\n // but in case there is cropping involved, or text would display in front of the button,\n // we position the title to the right of the button,\n if (width > max_width || x < min_x) {\n x = min_x;\n }\n // hand back the resulting position of the title\n return x;\n}", "title": "" } ]
d062b25504644d09fd8b106230cb83bb
create all elements under parent container
[ { "docid": "8fd892cad133f1abf7363a25276f46bf", "score": "0.0", "text": "function createItemElements() {\n // create elements\n let itemElem = document.createElement(\"section\");\n let imageElem = document.createElement(\"div\");\n let infoElem = document.createElement(\"div\");\n let yearElem = document.createElement(\"p\");\n let titleElem = document.createElement(\"p\");\n // let prevBtn = document.createElement(\"button\")\n // let nextBtn = document.createElement(\"button\")\n\n // assign class names to elements\n itemElem.classList.add(\"tl-item\");\n imageElem.classList.add(\"tl-bg\");\n infoElem.classList.add(\"movie-info\");\n yearElem.classList.add(\"movie-year\");\n titleElem.classList.add(\"movie-title\");\n // prevBtn.classList.add(\"arrow-btn\");\n // nextBtn.classList.add(\"arrow-btn\");\n\n // // assign id's to slideshow buttons\n // prevBtn.id = \"prev-btn\";\n // nextBtn.id = \"next-btn\";\n\n // // assign onclick values to slideshow buttons\n // prevBtn.onclick = \"prevSlide();\";\n // nextBtn.onclick = \"nextSlide();\";\n\n // // assign inner HTML values to slideshow buttons\n // prevBtn.innerHTML = \"&#10094;\";\n // nextBtn.innerHTML = \"&#10095;\";\n\n // add mobile response implementation to item\n itemElem.setAttribute(\"onclick\", \"expandView();\");\n\n // attach children nodes\n infoElem.appendChild(yearElem);\n infoElem.appendChild(titleElem);\n itemElem.appendChild(imageElem);\n itemElem.appendChild(infoElem);\n\n return itemElem;\n}", "title": "" } ]
[ { "docid": "33b6a92c53f1b18e290e6734b194419d", "score": "0.67239875", "text": "create_container_tags() {\n\t\tthis.create_editable_textareas();\n\t\tthis.create_example_style_tag();\n }", "title": "" }, { "docid": "49c7b495f91240e2da9ca6a42d10a94d", "score": "0.6692109", "text": "function drawContainer(parent) {\n var div = $(\"<div></div>\");\n div.addClass(\"aom-container\");\n div.attr(\"id\", containerID);\n div.height(configJSON.height);\n parent.append(div);\n return (div);\n }", "title": "" }, { "docid": "be8bf73f5dff1d569c4c114f22c07746", "score": "0.66677594", "text": "addToContainer(){\n if(!this.container.parentNode) \n {\n this.parentContainer.appendChild(this.container);\n }\n }", "title": "" }, { "docid": "8262c9e27ecdff7ae3c35a7de7708b87", "score": "0.6524706", "text": "createHtml($parent) {\n let $container = $(`<div class='container' id='${this.id}'></div>`);\n $container.appendTo($parent);\n\n $(`<div><h3>${this.title}</h3></div>`).appendTo($container);\n let $canvas = $(`<canvas class='border-canvas' width='1' height='${height}'></canvas>`);\n $canvas.appendTo($container);\n this.ctx = $canvas[0].getContext(\"2d\");\n\n $(`\n <div>Neural Network:<br/>\n I: ${this.nn.input_nodes} | H: ${this.nn.hidden_nodes} | O: ${this.nn.output_nodes}<br/>\n Updates needed: <span class='updatesNeeded'>${this.updateCount}</span><br/>\n Times completed: <span class='completed'>${this.completedCount}</span><br/>\n Average: <span class='average'>${this.avgUpdatesNeeded()}</span>\n </div>\n `).appendTo($container);\n }", "title": "" }, { "docid": "8394f30d4e29f3db114db2a7b66fba8c", "score": "0.6518744", "text": "appendAndCreateContainer(type, parent) {\n // type == flex, flexCenter block or gallery / className\n let c = this.p.createDiv()\n c.elt.className = type\n // c.elt.onclick = () => {console.log(\"container clicked\")}\n parent.elt.appendChild(c.elt)\n return c\n }", "title": "" }, { "docid": "6b3699e08a5f506cfa95c12cb168e87b", "score": "0.64371806", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $blockContainer = this.buildBlockContainerElement();\n $componentContainer.append($blockContainer);\n\n $blockContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$flagsElem = this.buildFlagsElement(this._flags);\n $blockContainer.append(this._$flagsElem);\n }", "title": "" }, { "docid": "9e0ad9521e37086b9e4ad755af80ee71", "score": "0.6431792", "text": "function generateContainer() {\n $('#new-containers').append('<div class=\"container yellow\"></div>');\n var $el = $('#new-containers').children().last();\n $el.append('<p>' + counter + '</p>');\n $el.append('<button class=\"change-color\">Change Color</button>');\n $el.append('<button class=\"delete\">Delete</button>');\n }", "title": "" }, { "docid": "b588ee3747bec658c88b32b16277a0dc", "score": "0.637796", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$enumElem = this.buildEnumElement(this._enums);\n $lineContainer.append(this._$enumElem);\n }", "title": "" }, { "docid": "f6d8f9acff4b79a4aa3a8501dc1548fa", "score": "0.6359633", "text": "prepareDOM() {\n\t\tif ( ! parentElement ) {\n\t\t\tparentElement = document.createElement( 'div' );\n\t\t\tdocument.body.appendChild( parentElement );\n\t\t}\n\t\tthis.node = document.createElement( 'div' );\n\t\tparentElement.appendChild( this.node );\n\t}", "title": "" }, { "docid": "aad65e01aa7865421521b573db14be55", "score": "0.63416153", "text": "elementContainer()\n {\n let div = document.createElement('div');\n div.id = 'main-container';\n this.main.appendChild(div);\n }", "title": "" }, { "docid": "dabf86f49aa04dd03b31ed9185b1d8f7", "score": "0.63092595", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $lineContainer.addClass('checkbox-line');\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$inputElem = this.buildCheckboxElement();\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "001e3491da83a3540521787bc5fbc716", "score": "0.62745076", "text": "function createContainer() {\n let divElem = document.createElement('div');\n divElem.setAttribute('class', 'container');\n document.body.appendChild(divElem);\n divElem.appendChild(createTitle());\n divElem.appendChild(createUserList());\n}", "title": "" }, { "docid": "4e92199f45d8cf333ba691c2dae38d37", "score": "0.623444", "text": "function generateAnimalRow(animals, parent) {\n let size = Math.round(parent.getBoundingClientRect().width / animals.length);\n animals.forEach((animal) => {\n let animalDiv = generateAnimal(animal, size);\n parent.append(animalDiv)\n });\n}", "title": "" }, { "docid": "decf9151442c67238df55f131746718e", "score": "0.62061834", "text": "function createElements() {\n var gridCollection, container, progressCircleContainer;\n\n gridCollection = this;\n\n container = util.createElement('div', gridCollection.parent, null, ['gridCollectionContainer']);\n progressCircleContainer =\n util.createElement('div', gridCollection.parent, null, ['progressCircleContainer']);\n progressCircleContainer.style.width = params.GRID.PROGRESS_CIRCLE_CONTAINER_SIDE_LENGTH + 'px';\n progressCircleContainer.style.height = params.GRID.PROGRESS_CIRCLE_CONTAINER_SIDE_LENGTH + 'px';\n\n gridCollection.elements = {\n container: container,\n progressCircleContainer: progressCircleContainer,\n pulseCircle: null,\n svg: null\n };\n\n gridCollection.progressCircle =\n new ProgressCircle(progressCircleContainer,\n params.GRID.PROGRESS_CIRCLE_CONTAINER_SIDE_LENGTH, params.GRID.PROGRESS_CIRCLE_DIAMETER,\n params.GRID.PROGRESS_CIRCLE_DOT_RADIUS, false);\n gridCollection.elements.svg = gridCollection.progressCircle.elements.svg;\n\n createBackgroundPulse.call(gridCollection);\n\n resize.call(gridCollection);\n\n gridCollection.progressCircle.open();\n }", "title": "" }, { "docid": "1e3254449728164fc9bfcda6d3332e1b", "score": "0.6190246", "text": "function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\t\n\t return parent\n\t }", "title": "" }, { "docid": "4e61cae4997be7396babcfbccad7aee9", "score": "0.61794376", "text": "createOuterContainer() {\n const div = document.createElement('div');\n div.classList.add('rest-table-outer-container');\n return div;\n }", "title": "" }, { "docid": "a8486ad2144a463efce3ca2de426d9de", "score": "0.61674917", "text": "function createControlElements(holder) {\n p.container = holder.dom.make('div', k.CLS.container);\n p.reader.listen('monocle:turn', draw);\n p.reader.listen('monocle:stylesheetchange', update);\n p.reader.listen('monocle:resize', update);\n p.reader.listen('monocle:componentchange', function (evt) {\n Monocle.defer(update);\n });\n p.reader.listen('monocle:interactive:on', disable);\n p.reader.listen('monocle:interactive:off', enable);\n p.baseURL = getBaseURL();\n return p.container;\n }", "title": "" }, { "docid": "48fc97548a489685cc1be38dc2706acd", "score": "0.61217064", "text": "function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\n\t return parent\n\t }", "title": "" }, { "docid": "48fc97548a489685cc1be38dc2706acd", "score": "0.61217064", "text": "function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\n\t return parent\n\t }", "title": "" }, { "docid": "48fc97548a489685cc1be38dc2706acd", "score": "0.61217064", "text": "function ins (parent /* child1, child2, ...*/) {\n\t for (var i = 1, n = arguments.length; i < n; i++) {\n\t parent.appendChild(arguments[i])\n\t }\n\n\t return parent\n\t }", "title": "" }, { "docid": "0fb08afebe8982adc6cb1591b954aeab", "score": "0.6089668", "text": "function createUIElements() {\n jQuery('body').append(\n windowDataElement,\n addWindowElement,\n windowDisplayElement.append(dateLabelsElement),\n getDataElement\n );\n }", "title": "" }, { "docid": "e6beec499a729da42619d9452c53e011", "score": "0.60874933", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$inputElem = this.buildInputElement('number', this.propertyDefinition.value);\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "c66c3792b413db8aede664121e106da3", "score": "0.6076834", "text": "_buildDomStructure($parentElem) {\n const self = this;\n\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$inputElem = this.buildInputElement('number', this.propertyDefinition.value);\n this._$inputElem.on('change.integer_comp', e => self._onValueChanged(e));\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "b3ba9c38810f082620dc06c81a00bce6", "score": "0.60739136", "text": "function ins (parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++) {\n parent.appendChild(arguments[i])\n }\n\n return parent\n }", "title": "" }, { "docid": "498aed53d271245e59c8433f0e944f19", "score": "0.60608", "text": "function createElements(parent, tagName, count) {\n var elements = [];\n var parentElem = (parent.element) ? parent.element() : parent;\n if ((tagName.toLowerCase() == \"svg\") || (vp.utils.isSvgDocOrElement(parentElem))) {\n //---- normal SVG container ----\n for (var i = 0; i < count; i++) {\n var elem = document.createElementNS('http://www.w3.org/2000/svg', tagName);\n elements[i] = elem;\n }\n }\n else {\n var tagNameLower = tagName.toLowerCase();\n var element = null;\n if (tagNameLower.startsWith(\"vp.\")) {\n var ctr = eval(tagName);\n if (vp.utils.isFunction(ctr)) {\n for (var i = 0; i < count; i++) {\n //---- create the vuePlot visual control ----\n var obj = ctr.call();\n if (vp.utils.isDefined(obj.tagName)) {\n element = obj;\n }\n else {\n element = obj.domElement;\n }\n elements[i] = element;\n }\n }\n }\n else {\n //---- regular HTML element ----\n for (var i = 0; i < count; i++) {\n element = document.createElement(tagName);\n elements[i] = element;\n }\n }\n }\n return elements;\n }", "title": "" }, { "docid": "34caa579d7f7d2d33fdd6e31fd6c55b5", "score": "0.60596645", "text": "function createDomElements() {\n\t\t\treturn $(container).append(html);\n\t\t}", "title": "" }, { "docid": "e288bd2157aee54e10cfb00a377f5e53", "score": "0.60582536", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$inputElem = this.buildInputElement('text', this.propertyDefinition.value);\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "e288bd2157aee54e10cfb00a377f5e53", "score": "0.60582536", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n this._$inputElem = this.buildInputElement('text', this.propertyDefinition.value);\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "f7ff731d20ff7c5bf87b39db5b4c7679", "score": "0.6046646", "text": "function build_template(container){\n var $child_scope = $scope.$new();\n $child_scope.$digger = container;\n linker($child_scope, function(clone_of_template){\n elems.push(clone_of_template);\n parent.append(clone_of_template);\n })\n }", "title": "" }, { "docid": "3ccc1c268fad6d34653e1a7d910c049f", "score": "0.6040573", "text": "function ins(parent /* child1, child2, ...*/) {\r\n for (var i=1, n=arguments.length; i<n; i++)\r\n parent.appendChild(arguments[i])\r\n\r\n return parent\r\n }", "title": "" }, { "docid": "eb5845a33ac48a1c8cea5961f01b28e9", "score": "0.60302156", "text": "buildBlockContainerElement() {\n return html.makeDivElement('block-container');\n }", "title": "" }, { "docid": "c983d956db06c157099d98d50468a917", "score": "0.6029443", "text": "function ins(parent) {\n for (var i = 1, n = arguments.length; i < n; i++) parent.appendChild(arguments[i]);\n return parent;\n }", "title": "" }, { "docid": "27bdbd668c0e538303dca1b608c14917", "score": "0.60188645", "text": "appendTo(parent) {\n parent.appendChild(this._tableOuterContainer);\n }", "title": "" }, { "docid": "6a288f72b9ceb2ed1966a50dc77ba2ed", "score": "0.601235", "text": "function setupContainer() {\n var container = document.createElement('div');\n container.className = \"bevyup_tagBoard_widget\";\n\n // Dummy \"Go to board\" link here for now.\n var html = \"\\\n<h2 class='counter'></h2>\\\n<ul class='tbw_list'></ul>\";\n container.innerHTML = html;\n return container;\n }", "title": "" }, { "docid": "c1f766879f896aa87bdd9083aa027503", "score": "0.60057807", "text": "preparingItemsContainer() {\n\t\tfor (let i = 0; i < this.wrapperItemsContainer.childNodes.length; i++) {\n\t\t\tif (this.wrapperItemsContainer.childNodes[i].nodeName === \"#text\" ||\n\t\t\t\tthis.wrapperItemsContainer.childNodes[i].nodeName === \"#comment\") {\n\t\t\t\tthis.wrapperItemsContainer.childNodes[i].remove()\n\t\t\t\ti--\n\t\t\t}\n\t\t}\n\n\t\twhile (this.wrapperItemsContainer.firstChild) {\n\t\t\tthis.wrapperItemsContainer.firstChild.style.textAlign = this.getPropertyOfElement(this.wrapperItemsContainer.firstChild, 'textAlign')\n\t\t\tthis.wrapperItemsContainer.firstChild.style.width = '100%'\n\t\t\tlet wrapperItem = document.createElement('div')\n\t\t\twrapperItem.append(this.wrapperItemsContainer.firstChild)\n\t\t\tthis.itemsContainer.append(wrapperItem)\n\t\t}\n\n\t\tthis.wrapperItemsContainer.append(this.itemsContainer)\n\n\t\tthis.itemsContainer.style.overflow = 'hidden'\n\t\tthis.itemsContainer.style.margin = `0px -${this.finalSettings.margin} 0px -${this.finalSettings.margin}`\n\t\tthis.itemsContainer.style.textAlign = 'left'\n\t}", "title": "" }, { "docid": "81d76da3a7b17605d2d3921acf7da983", "score": "0.5999948", "text": "buildUIElements() {\r\n this.node = this.paper.rect(0, 0, this.rect.width, this.rect.height);\r\n }", "title": "" }, { "docid": "68a5ef43fe3ba427b8371fa32ec7f5d5", "score": "0.5999786", "text": "render($parent) {\n\t\tvar $container = $('<div>');\n\t\t$parent.append($container)\n\n\t var $card = $('<div>')\n\t\t$card.css('position', 'relative')\n\t $container.append($card)\n\t\tvar $title = $('<p>')\n\t\t$title.text(this.data['name'])\n\t\t$card.append($title)\n\t\t\n\t\tvar hasChild = this.children.length>0\n\t\tif (hasChild) {\n\t\t\tvar $table = $('<div>')\n\t\t\t$container.append($table)\n\t\t\t$table.css('position', 'relative')\n\t\t\t$table.css('width', '100%')\n\t\t\t$table.css('display', 'table')\n\t\t\tvar $row = $('<div>')\n\t\t\t$table.append($row)\n\t\t\t$row.css('display', 'table-row')\n\t\t\tfor (var i = 0; i < this.children.length; i++) {\n\t\t\t\tvar $childDiv = this.children[i].render($row);\n\t\t\t\t$row.append($childDiv)\n\t\t\t\t$childDiv.css('display','table-cell')\n\t\t\t}\n\t\t\tvar shift = $table.width()/2 + 'px'\n\t\t\tconsole.log('shift card [' + this + '] by ' + shift)\n\t\t\t$card.css('left', shift )\n//\t\t\t$container.css('border', '1px solid red')\n//\t\t\t$table.css('border', '1px solid blue')\n\t\t}\n//\t\tthis.printElement('container ', $container)\n//\t\tthis.printElement('card', $card)\n//\t\tthis.printElement('children table', $table)\n//\t\t\t\n//\t\t$card.css('border', '1px solid green')\n//\t\tconsole.log('node ' + this + ' size ' + $container.width() \n//\t\t\t\t+ 'x' + $container.height()\n//\t\t\t\t+ ' has child?' + hasChild)\n\t\t\n\t\treturn $container\n\t}", "title": "" }, { "docid": "44054878b6aece380476f3179ff47188", "score": "0.5979573", "text": "function enumerateComponents(element, parentContainerElement, parentContainerNode/*, parentContainerOffset*/) {\n if (!element.getAttribute) return;\n var controlType = element.getAttribute('data-control'),\n containerType = !controlType && element.getAttribute('data-container'),\n i, childNodes = element.childNodes,\n c,\n offset,\n width,\n node;\n if (controlType && parentContainerElement) {\n controls.push(element);\n c = $(element);\n offset = c.offset();\n node = {\n self: c, parent: parentContainerNode, type: controlType, children: []//,\n //position: c.css('position'),\n //left: offset.left - parentContainerOffset.left - 1, top: offset.top - parentContainerOffset.top - 1,\n //width: c.width(), outerWidth: c.outerWidth(true), height: c.height(), outerHeight: c.outerHeight(true)\n };\n //node.right = node.left + node.outerWidth - 1;\n //node.bottom = node.top + node.outerHeight - 1;\n controlNodes.push(node);\n parentContainerNode.children.push(node);\n c.data('node', node);\n\n }\n else if (containerType) {\n containers.push(element);\n c = $(element);\n //offset = c.offset();\n //width = c.width();\n node = {\n /*id: containers.length, */self: c, children: [], type: containerType\n //position: c.css('position'),\n //left: Math.round(Math.max(0, offset.left - (parentContainerElement ? parentContainerOffset.left : layoutOffset.left) - 1)),\n //top: Math.round(offset.top - (parentContainerElement ? parentContainerOffset.top : layoutOffset.top)),\n //width: width, height: c.height(), outerHeight: c.outerHeight(true), outerWidth: c.outerWidth(true)\n };\n //node.right = node.left + node.outerWidth - 1;\n //node.bottom = node.top + node.outerHeight - 1;\n c.data('node', node);\n containerNodes.push(node);\n if (parentContainerElement) {\n node.parent = parentContainerNode;\n parentContainerNode.children.push(node);\n }\n else\n rootNodes.push(node);\n }\n\n for (i = 0; i < childNodes.length; i++)\n enumerateComponents(childNodes[i], containerType ? element : parentContainerElement, containerType ? node : parentContainerNode, null/* containerType ? offset : parentContainerOffset*/);\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "4af895d8c3967e59bdff44416d77c975", "score": "0.5979446", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++)\n parent.appendChild(arguments[i])\n\n return parent\n }", "title": "" }, { "docid": "8e33ed80923b1ae826e731ed2f1479bf", "score": "0.59726", "text": "charge(){\n let container=document.createElement('DIV');\n let containerC=document.createElement('DIV'); \n container.id='container';\n containerC.id='containerC';\n container.className='container';\n containerC.className='containerC';\n document.body.append(containerC); \n containerC.append(container); \n }", "title": "" }, { "docid": "3b04d5a022f1beb6910fd4e575c6fd58", "score": "0.59616965", "text": "_render() {\n // Remove old content\n this.sRoot.replaceChildren();\n\n // Apply style\n let styleElement = this.constructor.#templates.querySelector(\"style\").cloneNode(true);\n this.sRoot.appendChild(styleElement);\n\n // Render container\n let containerElement = document.createElement(\"container\");\n containerElement.classList.add(\"container\");\n containerElement.append(...this.childNodes);\n this.sRoot.appendChild(containerElement);\n\n\n // Adapt to current viewport size\n this._updateDisplayMode();\n }", "title": "" }, { "docid": "6ad44fa641f3f1fc4739e4d66b7a9b5f", "score": "0.59440595", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i = 1, n = arguments.length; i < n; i++)\n parent.appendChild(arguments[i]);\n return parent;\n }", "title": "" }, { "docid": "130949550b466ddd2cc6788ec90c6957", "score": "0.592133", "text": "function CreateMainContainers() {\n\n // Header\n let header = document.createElement('header');\n document.body.appendChild(header);\n\n // Header container\n let headerContainer = document.createElement('div');\n headerContainer.className = 'headerContainer';\n header.appendChild(headerContainer);\n\n // Body container\n let bodyContainer = document.createElement('div');\n bodyContainer.className = 'bodyContainer';\n document.body.appendChild(bodyContainer);\n\n // Bootstrap\n let container = document.createElement('div');\n container.className = 'container';\n bodyContainer.appendChild(container);\n\n // Footer\n let footer = document.createElement('div');\n footer.className = 'footer';\n document.body.appendChild(footer);\n}", "title": "" }, { "docid": "d6592d25ae2f8c933cd6a08f18b4d6ef", "score": "0.5914736", "text": "append(parent, ...args) {\n args.forEach(item => parent.appendChild(item));\n }", "title": "" }, { "docid": "b9b8bfb6a40e18a97c64158ea19fba65", "score": "0.59069955", "text": "function divCreater(btnList) {\n for (i = 0; i < btnList.length; i++) {\n let nwDiv = document.createElement('div')\n nwDiv.id = \"div\" + btnList[i]\n nwDiv.className = \"bigdiv\"\n let Lctn = document.getElementsByClassName('main-container')[0]\n Lctn.appendChild(nwDiv)\n }\n}", "title": "" }, { "docid": "0e328b69f2e5fddb96b283d5eb426a10", "score": "0.5905452", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++) {\n parent.appendChild(arguments[i]);\n }\n return parent;\n }", "title": "" }, { "docid": "0e328b69f2e5fddb96b283d5eb426a10", "score": "0.5905452", "text": "function ins(parent /* child1, child2, ...*/) {\n for (var i=1, n=arguments.length; i<n; i++) {\n parent.appendChild(arguments[i]);\n }\n return parent;\n }", "title": "" }, { "docid": "a465108c359c1bc8436a65e990280c5d", "score": "0.5876623", "text": "function createImagesHtml(parent){\n var df = document.createDocumentFragment();\n for(var i = 1; i<13; i++){\n var div = document.createElement(\"div\");\n div.setAttribute(\"class\",\"box-img\");\n var a = document.createElement(\"a\");\n a.setAttribute(\"href\",\"#img\"+i);\n var img = document.createElement(\"img\");\n img.setAttribute(\"src\",\"assets/img/img-\"+i+\".jpg\");\n img.setAttribute(\"class\",\"img-work\");\n var p = document.createElement(\"p\");\n var texto = document.createTextNode(\"Nombre de Proyecto\");\n p.appendChild(texto);\n\n div.appendChild(a);\n a.appendChild(img);\n a.appendChild(p);\n\n df.appendChild(div);\n }\n parent.appendChild(df);\n}", "title": "" }, { "docid": "966110b2b64195535734a4e02b04652a", "score": "0.5867856", "text": "function setChildrenLayout(){\n// lays out children for horizontal or vertical modes\nif(options.mode == 'horizontal' || options.mode == 'vertical'){\n// get the children behind\nvar $prependedChildren = getArraySample($children, 0, options.moveSlideQty, 'backward');\n// add each prepended child to the back of the original element\n$.each($prependedChildren, function(index) {\n$parent.prepend($(this));\n});\n// total number of slides to be hidden after the window\nvar totalNumberAfterWindow = ($children.length + options.moveSlideQty) - 1;\n// number of original slides hidden after the window\nvar pagerExcess = $children.length - options.displaySlideQty;\n// number of slides to append to the original hidden slides\nvar numberToAppend = totalNumberAfterWindow - pagerExcess;\n// get the sample of extra slides to append\nvar $appendedChildren = getArraySample($children, 0, numberToAppend, 'forward');\nif(options.infiniteLoop){\n// add each appended child to the front of the original element\n$.each($appendedChildren, function(index) {\n$parent.append($(this));\n});\n}\n}\n}", "title": "" }, { "docid": "a509759a7890095e7e875daa2f1948e6", "score": "0.58622", "text": "function createContainer() {\n //creating the main div container\n GameContainer = document.createElement(\"div\");\n GameContainer.className = \"game-container\";\n document.body.appendChild(GameContainer);\n\n scoreBoard = createScoreBoard();\n restart = createRestartButton();\n\n GameContainer.appendChild(scoreBoard);\n GameContainer.appendChild(restart);\n }", "title": "" }, { "docid": "4e8462b0f71eb0fe00db3203564525de", "score": "0.58435977", "text": "createInnerContainer() {\n const div = document.createElement('div');\n div.classList.add('rest-table-inner-container');\n\n return div;\n }", "title": "" }, { "docid": "adf745b6c2febce29db2284c7f56027c", "score": "0.58391494", "text": "function createButtonContainer(){\n // Create element\n const buttonContainer = document.createElement(\"DIV\");\n buttonContainer.classList.add('buttonContainer');\n\n // get the main container and append button container\n const containerDiv = document.querySelector('.container');\n containerDiv.append(buttonContainer);\n}", "title": "" }, { "docid": "79f7683fada115c759affa02c26600b0", "score": "0.5837732", "text": "function CreateAppBaseElements() {\n\t\t$('#AppDomotics-DataContainer').empty();\n\t\t$('#AppDomotics-DataContainer').append($('<div>').attr('id', 'AppDomotics-PartAll'));\n\t\t$('#AppDomotics-DataContainer').append($('<div>').addClass('AppDomotics-overlay'));\n\t\tViewOrHideOverlayElement(true);\n\t\t\n\t\t$('#AppDomotics-PartAll').append($('<div>').attr('id', 'AppDomotics-NavPart'));\n\t\t$('#AppDomotics-PartAll').append($('<div>').attr('id', 'AppDomotics-ActPart'));\n\t\t\n\t\tvar NavSPImgSrc=PathToExecuteDirectory+'images/AppDomotics_status.png';\n\t\t$('#AppDomotics-NavPart').append($('<div>').addClass('AppDomotics-sp'));\n\t\t$('#AppDomotics-NavPart .AppDomotics-sp').append($('<ul>'));\n\t\t$('#AppDomotics-NavPart .AppDomotics-sp ul').append($('<li>'));\n\t\t$('#AppDomotics-NavPart .AppDomotics-sp ul li:last').append($('<img>').attr({'src':NavSPImgSrc}));\n\t\t$('#AppDomotics-NavPart .AppDomotics-sp ul li:last').append($('<p>').append(NavigationTxtArr[0]));\t\n\t\t\n\t\t$('#AppDomotics-NavPart').append($('<div>').addClass('AppDomotics-hp'));\n\t\t$('#AppDomotics-NavPart .AppDomotics-hp').append($('<ul>'));\n\t\tvar NavHPElementID='',NavHPImgSrc='';\n\t\tfor(var j in HistoryTxtArr) {\n\t\t\tNavHPElementID=AppDomoticsObjectParams.ObjectsPartID.NavHpID+'_'+((j*1)+1);\n\t\t\tNavHPImgSrc=PathToExecuteDirectory+'images/AppDomotics_history_'+j+'.png';\n\t\t\t\n\t\t\t$('#AppDomotics-NavPart .AppDomotics-hp ul').append($('<li>').attr('id', NavHPElementID));\n\t\t\t$('#AppDomotics-NavPart .AppDomotics-hp ul li:last').append($('<img>').attr({'src':NavHPImgSrc}));\n\t\t\t$('#AppDomotics-NavPart .AppDomotics-hp ul li:last').append($('<p>').append(HistoryTxtArr[j]));\t\n\t\t}\n\t\t\n\t\t$('#AppDomotics-NavPart .AppDomotics-sp ul li').click(function() { \n\t\t\tif(CountStartedRequests == CountFinishedRequests) {\n\t\t\t\tStatusPartChangeStyleSelectedItem();\n\t\t\t\tLogUserInteraction('statusPart', 0, -1);\n\t\t\t\tWhatView=2;\n\t\t\t\t\n\t\t\t\tCountStartedRequests=1;\tCountFinishedRequests=0;\n\t\t\t\tViewOrHideOverlayElement(true);\n\t\t\t\tGetExternalStatusData();\n\t\t\t}\n\t\t});\n\t\t\n\t\t$('#AppDomotics-NavPart .AppDomotics-hp ul li').click(function() { \n\t\t\tif(CountStartedRequests == CountFinishedRequests) {\n\t\t\t\tvar history_part_res = $(this).attr('id').split(\"_\");\n\t\t\t\tif(history_part_res.length == 3) {HistoryDataView = parseInt(history_part_res[2]);}\n\t\t\t\t\n\t\t\t\tHistoryPartChangeStyleSelectedItem();\n\t\t\t\tLogUserInteraction('historyPart', HistoryDataView, -1);\n\t\t\t\tWhatView=1;\n\t\t\t\tHistoryDataLocationView = 1;\n\t\t\t\t\n\t\t\t\tCountStartedRequests=1;\tCountFinishedRequests=0;\n\t\t\t\tViewOrHideOverlayElement(true);\n\t\t\t\tGetExternalHistoryData();\n\t\t\t}\n\t\t});\n\t\t\n\t\tif(WhatView == 1) {\n\t\t\tHistoryPartChangeStyleSelectedItem();\n\t\t\tCountStartedRequests=1; CountFinishedRequests=0;\n\t\t\tGetExternalHistoryData();\n\t\t}\n\t\tif(WhatView == 2) {\n\t\t\tStatusPartChangeStyleSelectedItem();\n\t\t\tCountStartedRequests=1; CountFinishedRequests=0;\n\t\t\tGetExternalStatusData();\n\t\t}\n\t}", "title": "" }, { "docid": "8e1703066c890e67deb40b6c5c3cbc5e", "score": "0.5835627", "text": "function createDiv(){\n\t$('.container').append('<div class=\"gridBox\"> </div>'); \n}", "title": "" }, { "docid": "8e442a0d0c4ac18a91ab9c27bb386452", "score": "0.58149666", "text": "appendAndCreateP(content, parent) {\n let p = this.p.createP(content)\n p.elt.className = \"gameP\"\n\n parent.elt.appendChild(p.elt)\n return p\n }", "title": "" }, { "docid": "e95fe6d60eab01ee7198a39075d221f5", "score": "0.5806735", "text": "_constructContainer (containerNode) {\n // Generate basic DOM for the area with sliders\n const slidersWrapper = html('div', { class: 'cs__sliders' })\n const slidersSvg = svg('svg', { class: 'cs__sliders-gfx', preserveAspectRatio: 'xMidYMid meet' })\n\n const dragHandleSize = Math.ceil(this.globalConfig.thickness / 2)\n const slidersDragHandle = svg('defs', {}, svg('marker', {\n id: `cs-handle${this.uid}`,\n class: 'cs__slider-handle',\n viewBox: `0 0 ${dragHandleSize * 2 + 2} ${dragHandleSize * 2 + 2}`,\n refX: dragHandleSize + 1,\n refY: dragHandleSize + 1,\n markerWidth: dragHandleSize * 2 + 6,\n markerHeight: dragHandleSize * 2 + 6,\n markerUnits: 'userSpaceOnUse'\n }, svg('circle', { cx: dragHandleSize + 1, cy: dragHandleSize + 1, r: dragHandleSize })))\n slidersSvg.appendChild(slidersDragHandle)\n\n const interactiveSurface = html('div', { class: 'cs__sliders-surface' })\n slidersWrapper.appendChild(slidersSvg)\n slidersWrapper.appendChild(interactiveSurface)\n\n // Generate basic DOM for the area with color legend and values\n const infoWrapper = html('ul', { class: 'cs__info' })\n\n // Append all to the container\n const fragments = new DocumentFragment()\n fragments.appendChild(slidersWrapper)\n fragments.appendChild(infoWrapper)\n containerNode.appendChild(fragments)\n\n // Return references to DOM nodes\n return {\n container: containerNode,\n sliders: slidersSvg,\n info: infoWrapper,\n interactiveSurface\n }\n }", "title": "" }, { "docid": "b54c614b3e4e4319c3b1d7ac350bcea9", "score": "0.5786217", "text": "createNewRow(){\r\n let mosaic = this.parent.find('.SWA_MosaicContainer');\r\n let newRow = document.createElement('div');\r\n newRow.setAttribute('style', 'width: 100%; height: 50%;');\r\n newRow.classList.add('row');\r\n mosaic.get(0).appendChild(newRow);\r\n }", "title": "" }, { "docid": "39ad1e72e1c11fd7ddc174e117185a92", "score": "0.5766701", "text": "generateMainStructure() {\n\n // Container for player-top's information\n let $player_top_container = $('<div/>');\n $player_top_container.attr('id', \"player-top-container\")\n .appendTo($(\"body\"));\n\n let $player_top_text = $('<div/>')\n $player_top_text.html(\"Player-top's captures\")\n .attr('id', \"player-top-text\")\n .appendTo($player_top_container);\n\n\n let $player_top_captures = []\n for (let i = 0; i < 4; i++) {\n if (!$player_top_captures[i]) $player_top_captures[i] = []\n for (let j = 0; j < 4; j++) {\n $player_top_captures[i][j] = $('<div/>');\n\n $player_top_captures[i][j].attr('data-i', i)\n .attr('data-j', j)\n .appendTo($player_top_container);\n }\n }\n\n // Container for the chess table\n let $chess_table = $('<div/>');\n $chess_table.attr('id', \"chess-table\")\n .appendTo($(\"body\"))\n\n // Container for player-bottom's information\n let $player_bottom_container = $('<div/>');\n $player_bottom_container.attr('id', \"player-bottom-container\")\n .appendTo($(\"body\"));\n\n let $player_bottom_text = $('<div/>')\n $player_bottom_text.html(\"Player-bottom's captures\")\n .attr('id', \"player-bottom-text\")\n .appendTo($player_bottom_container)\n\n let $player_bottom_captures = []\n for (let i = 0; i < 4; i++) {\n if (!$player_bottom_captures[i]) $player_bottom_captures[i] = []\n for (let j = 0; j < 4; j++) {\n $player_bottom_captures[i][j] = $('<div/>');\n\n $player_bottom_captures[i][j].attr('data-i', i)\n .attr('data-j', j)\n .appendTo($player_bottom_container);\n }\n }\n // Container for buttons\n let $buttons_container = $('<div/>');\n $buttons_container.appendTo($(\"body\"))\n .attr('id', \"buttons-contanier\");\n\n //Start offline game button\n let $start_offline_game_button = $('<span/>');\n $(\"#buttons-contanier\").append($start_offline_game_button);\n $start_offline_game_button.attr('id', \"start-offline-game-button\")\n .text(\"Start OFFLINE game!\")\n\n //Start online game button\n let $start_online_game_button = $('<span/>');\n $(\"#buttons-contanier\").append($start_online_game_button);\n $start_online_game_button.attr('id', \"start-online-game-button\")\n .text(\"Start ONLINE game!\");\n\n let $chess_table_container = $('#chess-table')\n\n // Top container - create\n let $top_container = $('<div/>');\n $top_container.appendTo($chess_table_container)\n .attr('id', \"top-container\")\n\n // Left container - create\n let $left_container = $('<div/>');\n $left_container.appendTo($chess_table_container)\n .attr('id', \"left-container\")\n\n // Right container - create\n let $right_container = $('<div/>');\n $right_container.appendTo($chess_table_container)\n .attr('id', \"right-container\")\n\n // Bottom container - create\n let $bottom_container = $('<div/>');\n $bottom_container.appendTo($chess_table_container)\n .attr('id', \"bottom-container\")\n\n // Table container - create\n let $table_container = $('<div/>');\n $table_container.appendTo($chess_table_container)\n .attr('id', \"table-container\")\n\n let my_github_link = $(\"<a/>\")\n my_github_link.attr('href', \"https://github.com/ioanaj3/JavaScript-training/tree/master/chess-game\")\n .attr('target', \"_blank\")\n .attr('id', \"github-logo\")\n .appendTo($(\"body\"));\n\n let git_logo = $(\"<img/>\");\n git_logo.attr('src', \"icons/GitHub-Mark-64px.png\")\n .appendTo(my_github_link);\n // $(\"#git-logo\").click() \n\n return [$player_top_captures, $player_bottom_captures]\n\n\n }", "title": "" }, { "docid": "ce98452ab99f4b4af00708bffe2812f7", "score": "0.57616055", "text": "function TElementContainerNode() { }", "title": "" }, { "docid": "ce98452ab99f4b4af00708bffe2812f7", "score": "0.57616055", "text": "function TElementContainerNode() { }", "title": "" }, { "docid": "cf7c1840bff485cbac8c83cc033bbbf7", "score": "0.5753771", "text": "buildComponentContainerElement() {\n return html.makeDivElement('component-container');\n }", "title": "" }, { "docid": "39697686c511ebf3cbba6c1734003761", "score": "0.5750959", "text": "createChildren() {\n this.circles = document.getElementsByClassName('js-circle');\n\n return this;\n }", "title": "" }, { "docid": "29bbf1f12f0379f234e9117ae940f1c7", "score": "0.57504493", "text": "function TElementContainerNode() {}", "title": "" }, { "docid": "e264742d354cb984cd6ee6851dd52c4e", "score": "0.5749947", "text": "function createContainerNode (){\n var htmlOutNode = createChildrenNodes();\n var divNode = document.createElement(\"div\");\n addJsonObject(divNode, htmlOutNode);\n return divNode;\n}", "title": "" }, { "docid": "6b30eb1a343397fffc4087e2f7f499eb", "score": "0.5741348", "text": "buildContainers_() {\n const html = htmlFor(this.element_);\n this.domRoot_.appendChild(html`\n <div>\n <svg\n ref=\"svgRoot\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"24 24 72 72\"\n ></svg>\n </div>\n `);\n\n /**\n * There is an extra inner div here for backward compatibility with\n * customizing loaders. The common and documented CSS for customizing\n * loaders includes a style to hide the old three dots via:\n * .my-custom-loader .amp-active > div {\n * display: none;\n * }\n * The extra div mimic a similar DOM.\n */\n this.svgRoot_ = dev().assertElement(htmlRefs(this.domRoot_)['svgRoot']);\n }", "title": "" }, { "docid": "c0beef29b6dd27879e400f6c2391e081", "score": "0.5735342", "text": "function addCland(ev){\n //get parent id\n var parent = $(ev).parent().parent().attr(\"id\");\n // html elements\n var text = '<tr><td><div class=\"form-group\">';\n text += '<input type=\"text\" name=\"crops\" class=\"form-control\" placeholder=\"Crops\" required=\"required\" maxlength=\"20\"></div></td>\\\n <td><button id=\"btn_remove\" class=\"btn btn-danger btn-xa\" >X</button></td>'; \n text += '</tr>';\n // append html to parent container\n $(\"#\"+parent+ \" \"+ \"#clands-container\").append(text);\n}", "title": "" }, { "docid": "0122675804b327494651a340ab42ec1c", "score": "0.57303894", "text": "function creatDivContainer(){\n let newDiv = document.createElement(\"div\");\n newDiv.id=(\"container\");\n bodie.appendChild(newDiv);\n}", "title": "" }, { "docid": "d99df06d1fd3b5ffaa60122140c08f09", "score": "0.5711713", "text": "function makeDiv(className, parent) {\n var div = document.createElement('div')\n if (className) {\n div.className = className\n }\n parent = parent || container\n parent.appendChild(div)\n return div\n }", "title": "" }, { "docid": "d5d1020356ab3b81f4d46b91ba91673d", "score": "0.57044053", "text": "render(container) {\n const {_rootElement} = this;\n return appendNode(container, _rootElement);\n }", "title": "" }, { "docid": "ccabc40e930980ce48586333e7171130", "score": "0.57038194", "text": "function createDivGrid(outerBoxes, innerBoxes) {\n for (let i = 0; i < outerBoxes; i++) {\n var outInnerBox = document.createElement('div');\n outInnerBox.className = \"out-inner-box\";\n\n for (let j = 0; j < innerBoxes; j++) {\n var innerBox = document.createElement('div');\n innerBox.className = \"inner-boxes\";\n outInnerBox.appendChild(innerBox);\n console.log(outInnerBox);\n }\n outerDiv.appendChild(outInnerBox);\n }\n }", "title": "" }, { "docid": "b59c913f31cf4a3e5b24fc61980060fa", "score": "0.5700661", "text": "_appendElementsToParent(sibling) {\n if (typeof sibling === \"undefined\")\n sibling = this.nextSibling;\n\n let cn = this.content.cloneNode(true);\n this._els = [];\n for (let cel of cn.children) {\n cel._kaMb = this._ktId;\n this._els.push(cel);\n }\n\n this.parentElement.insertBefore(cn, sibling);\n\n }", "title": "" }, { "docid": "b65355dab22e73147087c44502982669", "score": "0.5686902", "text": "appendChildToContainer(parentInstance, child) {\n parentInstance.appendChild(child);\n }", "title": "" }, { "docid": "e268c1f26c50b4238ff7de3d6cdddd92", "score": "0.56848526", "text": "function createContainer() {\n $mainDiv = $('<div style=\"height:100%\">');\n //$mainLeftDiv = $('<div class=\"vis-history-mainLeftDiv\">');\n\n $inboxDiv = $('<div class=\"vis-history-inboxDiv\">');\n $relatedInfoDiv = $('<div style=\"display:none\" class=\"vis-history-mainRelatedDiv\">');\n $userInfoDiv = $('<div style=\"display:none\" class=\"vis-history-mainRelatedDiv\">');\n\n //$mainLeftDiv.append($inboxDiv).append($relatedInfoDiv);\n\n //$rightmainDiv = $('<div class=\"vis-history-mainrightDiv\" >');\n\n //$mainDiv.append($mainLeftDiv).append($rightmainDiv);\n\n $historycontentwrap = $('<div class=\"vis-attachhistory-content-wrap\">');\n\n\n $historyleftwrap = $('<div class=\"vis-attachhistory-left-wrap\">');\n\n\n $historytabletop = $('<div class=\"vis-attachhistory-table-top\">');\n\n $visattachhistorysearchwrap = $('<div class=\"vis-attachhistory-search-wrap\">');\n $historysearch = $('<div class=\"vis-attachhistory-search\">').append(' <input placeholder=\"' + VIS.Msg.getMsg(\"Search\") + '\" type=\"text\">').append('<span class=\"vis-attachhistory-search-icon\"></span>');\n $visattachhistorysearchwrap.append('<img class=\"prthistory\" style=\"margin-top:15px;margin-left:40px\" title=\"' + VIS.Msg.getMsg(\"Print\") + '\" src=\"' + VIS.Application.contextUrl + 'Areas/vis/Images/history-print.png\" />').append($historysearch);\n\n\n\n $visattachhistoryrightwrap = $('<div class=\"vis-attachhistory-right-wrap\">');\n\n $visattachhistoryrightwrapNotFound = $('<div class=\"vis-attachhistory-right-wrap\">').hide();\n if (isip == true) {\n $visattachhistoryrightwrapNotFound.append('<label class=\"vis-attachhistory-noRecFoundforIP\" > ' + VIS.Msg.getMsg(\"NoRecordFound\") + ' </label>');\n }\n else {\n $visattachhistoryrightwrapNotFound.append('<label class=\"vis-attachhistory-noRecFound\" > ' + VIS.Msg.getMsg(\"NoRecordFound\") + ' </label>');\n }\n\n\n $visapaneltabcontrol = $('<div class=\"vis-attachhistory-apanel-tabcontrol\">');\n $visattachhistoryappsactionul = $('<ul class=\"vis-attachhistory-appsaction-ul vis-attachhistory-apanel-tabcontrol-ul\">');\n $visattachhistoryappsactionul.append('<li data-type=\"History\" class=\"vis-attachhistory-apanel-tab-selected\" style=\"opacity: 1;\">' + VIS.Msg.getMsg(\"History\") + '</li><li data-type=\"RelatedHistory\" style=\"opacity: 1;\">' + VIS.Msg.getMsg(\"RelatedHistory\") + '</li>');\n\n if (c_BPartner_ID > 0) {\n $visattachhistoryappsactionul.append('<li data-type=\"UserHistory\" style=\"opacity: 1;\">' + VIS.Msg.getMsg(\"UserHistory\") + '</li>');\n }\n\n $historytabletop.append($visapaneltabcontrol.append($visattachhistoryappsactionul));\n $historytablewrap = $('<div class=\"vis-attachhistory-table-wrap\">').append($inboxDiv).append($relatedInfoDiv).append($userInfoDiv).append(ulPagging);\n\n\n\n\n $mainDiv.append($historycontentwrap.append($historyleftwrap.append($historytabletop).append($historytablewrap)));\n $historycontentwrap.append($visattachhistorysearchwrap).append($visattachhistoryrightwrap).append($visattachhistoryrightwrapNotFound);\n\n\n searchTextbox = $visattachhistorysearchwrap.find('input');\n $printBtn = $historysearch.find('.prthistory');\n\n $ulAttach = $('<ul class=\"vis-his-attachs\">');\n\n //$btnSave = $('<div class=\"vis-attachhistory-save-btn\"><a> ' + VIS.Msg.getMsg(\"Save\") + '</a>');\n //$btnSaveAppoint = $('<div class=\"vis-attachhistory-save-btn\"><a> ' + VIS.Msg.getMsg(\"Save\") + '</a>');\n\n $menu = $(\"<ul class='vis-apanel-rb-ul'>\");\n $menu.append('<li style=\"display:none\" data-type=\"R\"><a><span class=\"vis-attachhistory-email-icon vis-attachhistory-reply-icon\"></span>' + VIS.Msg.getMsg('Reply') + '</a></li> <li data-type=\"F\"><a style=\"color: rgb(111, 111, 111); \"><span class=\"vis-attachhistory-email-icon vis-attachhistory-forword-icon\"></span>' + VIS.Msg.getMsg('Forward') + '</a></li>');\n\n\n }", "title": "" }, { "docid": "24aaacdf3b0aabe398c591238111f129", "score": "0.5680884", "text": "createChildren() {\n const navToggles = [];\n\n $(SELECTORS.NAV_TOGGLE).each(function(i) {\n navToggles[i] = new NavToggleView($(this));\n });\n\n return this;\n }", "title": "" }, { "docid": "16edc335a871deb0e353d86bebccef31", "score": "0.5663294", "text": "__addChildrenToParent() {\n if (this.getParentChildrenContainer()) {\n this.getParentChildrenContainer()._addAfter(\n this.getChildrenContainer(),\n this\n );\n }\n }", "title": "" }, { "docid": "e56bfd1de19887d4d48045274afa6826", "score": "0.5663206", "text": "function __createContainer(a,objName)\n\t{\n\t\tvar arrContainer = new Object();\t\t\n\t\tarrContainer.container = document.createElement('div');\t\t\n\t\tarrContainer.container.className = 'PR-popup';\n\t\tarrContainer.titlebar = document.createElement('div');\n\t\tarrContainer.container.appendChild(arrContainer.titlebar);\t\t\n\t\tarrContainer.titlebar.className = 'PR-titlebar';\n\t\tarrContainer.titlebar.appendChild(document.createElement('div'));\n\t\tarrContainer.buttoncntr = document.createElement('span');\n\t\tarrContainer.buttoncntr.className = 'PR-buttonscntr';\n\t\tarrContainer.titlebar.appendChild(arrContainer.buttoncntr);\n\t\tarrContainer.buttoncntr.appendChild(document.createTextNode('Reuse?'));\n\t\tarrContainer.reusechk = document.createElement('input');\n\t\tarrContainer.reusechk.setAttribute(\"type\", \"checkbox\");\n\t\tarrContainer.reusechk.type = 'checkbox';\t\t\n\t\tarrContainer.buttoncntr.appendChild(arrContainer.reusechk);\n\t\tarrContainer.refreshbtn = document.createElement('button');\t\t\n\t\tarrContainer.refreshbtn.appendChild(document.createTextNode('Refresh'));\n\t\tarrContainer.refreshbtn.className = 'PR-btn';\n\t\tarrContainer.buttoncntr.appendChild(arrContainer.refreshbtn);\n\t\tarrContainer.minbtn = document.createElement('button');\n\t\tarrContainer.minbtn.appendChild(document.createTextNode('Min'));\n\t\tarrContainer.minbtn.onclick = function (){arrContainer.content.style.display = 'none';arrContainer.container.style.height = '1.5em';};\n\t\tarrContainer.minbtn.className = 'PR-btn';\n\t\tarrContainer.buttoncntr.appendChild(arrContainer.minbtn);\n\t\tarrContainer.maxbtn = document.createElement('button');\n\t\tarrContainer.maxbtn.appendChild(document.createTextNode('Max'));\n\t\tarrContainer.maxbtn.onclick = function (){arrContainer.content.style.display = 'block';arrContainer.container.style.height = '50%';};\n\t\tarrContainer.maxbtn.className = 'PR-btn';\n\t\tarrContainer.buttoncntr.appendChild(arrContainer.maxbtn);\n\t\tarrContainer.closebtn = document.createElement('button');\n\t\tarrContainer.closebtn.appendChild(document.createTextNode('Close'));\n\t\tarrContainer.buttoncntr.appendChild(arrContainer.closebtn);\n\t\tarrContainer.closebtn.onclick = function () {document.body.removeChild(arrContainer.container);};\n\t\tarrContainer.closebtn.className = 'PR-btn';\n\t\tarrContainer.content = document.createElement('div');\n\t\tarrContainer.content.className ='PR-content';\n\t\tarrContainer.container.appendChild(arrContainer.content);\t\n\t\tarrContainer.content.navbar = document.createElement('div');\n\t\tarrContainer.content.navbar.className = 'PR-navbar';\n\t\tif (arrContainer.content.navbar.style.overflowX && arrContainer.content.navbar.style.whiteSpace){\n\t\t\tarrContainer.content.navbar.style.overflowX = 'auto';\n\t\t\tarrContainer.content.navbar.style.whiteSpace = 'nowrap';\n\t\t}\n\t\telse{\n\t\t\tarrContainer.content.navbar.style.overflow = 'auto';\n\t\t}\n\t\tarrContainer.content.appendChild(arrContainer.content.navbar);\n\t\tarrContainer.refreshbtn.onclick = refreshThis(a, objName, arrContainer);\n\t\tfunction refreshThis(obj, name, container)\n\t\t{\n\t\t\treturn (function(){return obj.print_r(name, true, container);});\n\t\t}\n\t\treturn arrContainer;\n\t}", "title": "" }, { "docid": "01e543cfb12bc5f92b22676c4d479242", "score": "0.56589276", "text": "function TElementContainerNode(){}", "title": "" }, { "docid": "01e543cfb12bc5f92b22676c4d479242", "score": "0.56589276", "text": "function TElementContainerNode(){}", "title": "" }, { "docid": "01e543cfb12bc5f92b22676c4d479242", "score": "0.56589276", "text": "function TElementContainerNode(){}", "title": "" }, { "docid": "01e543cfb12bc5f92b22676c4d479242", "score": "0.56589276", "text": "function TElementContainerNode(){}", "title": "" }, { "docid": "f45e852fe8e8d398d79887f71f095812", "score": "0.5653603", "text": "_buildDomStructure($parentElem) {\n let $componentContainer = this.buildComponentContainerElement();\n $parentElem.append($componentContainer);\n\n let $lineContainer = this.buildLineContainerElement();\n $componentContainer.append($lineContainer);\n\n $lineContainer\n .append(this.buildLabelElement())\n .append(this.buildGlobalImageCheckboxElement());\n\n let localizedString = '';\n if (this.propertyDefinition.type === cred.spec.physicalPropertyType.identifier) {\n localizedString = this._stringLookup.lookupString(this.propertyDefinition.value);\n }\n this._$inputElem = this.buildInputElement('text', localizedString);\n if (this._disable) {\n this._$inputElem.attr({ disabled: true });\n }\n $lineContainer.append(this._$inputElem);\n }", "title": "" }, { "docid": "2637245a5f19adde3d2b369e1e7c4dbe", "score": "0.5651781", "text": "function createDivs(amount) {\n var divWidth = ($containerW / amount);\n var divHeight = ($containerH / amount);\n for (var i = 0; i < amount; i++) {\n for (var j = 0; j < amount; j++) {\n var div = document.createElement(\"div\");\n div.className = i + \".\" + j;\n div.style.width = divWidth + \"px\";\n div.style.height = divHeight + \"px\";\n div.style.background = divBackground;\n div.style.color = divColor;\n document.getElementById(\"container\").appendChild(div);\n }\n }\n clear();\n hover();\n}", "title": "" }, { "docid": "7042815636096186057b92d89a59ca72", "score": "0.5646066", "text": "function prepareContentBlock(content,parent)\r\n{\r\n\tif(content instanceof Array)\r\n\t{\r\n\t\tfor(index in content)\r\n\t\t{\r\n\t\t\tblock = content[index];\r\n\t\t\telement = newElementText(block.type,block.class,block.id,block.text,parent);\r\n\t\t\tprepareContentBlock(block.content,element);\r\n\t\t}\r\n\t}\r\n}", "title": "" } ]
46473df483e6ee104a15b9e410430709
my_onbytarget Callback for target status information. Updates the status display. input:data list coming from pazpar2
[ { "docid": "d84e743b95cb6053c3c4f75c5cf83a69", "score": "0.62492466", "text": "function my_onbytarget(data) {\n\tvar targetDiv = document.getElementById('pz2-targetView');\n\tjQuery(targetDiv).empty();\n\n\tvar table = document.createElement('table');\n\ttargetDiv.appendChild(table);\n\n\tvar caption = document.createElement('caption');\n\ttable.appendChild(caption);\n\tcaption.appendChild(document.createTextNode(localise('Übertragungsstatus')))\n\n\tvar thead = document.createElement('thead');\n\ttable.appendChild(thead);\n\tvar tr = document.createElement('tr');\n\tthead.appendChild(tr);\n\tvar td = document.createElement('th');\n\ttr.appendChild(td);\n\ttd.appendChild(document.createTextNode(localise('Datenbank')));\n\ttd.id = 'pz2-target-name';\n\ttd = document.createElement('th');\n\ttr.appendChild(td);\n\ttd.appendChild(document.createTextNode(localise('Geladen')));\n\ttd.id = 'pz2-target-loaded';\n\ttd = document.createElement('th');\n\ttr.appendChild(td);\n\ttd.appendChild(document.createTextNode(localise('Treffer')));\n\ttd.id = 'pz2-target-hits';\n\ttd = document.createElement('th');\n\ttr.appendChild(td);\n\tjQuery(td).addClass('pz2-target-status');\n\ttd.appendChild(document.createTextNode(localise('Status')));\n\ttd.id = 'pz2-target-status';\n\t\n\tvar tbody = document.createElement('tbody');\n\ttable.appendChild(tbody);\n\n\tfor (var i = 0; i < data.length; i++ ) {\n\t\ttr = document.createElement('tr');\n\t\ttbody.appendChild(tr);\n\t\ttd = document.createElement('th');\n\t\ttr.appendChild(td);\n\t\ttd.appendChild(document.createTextNode(localise(data[i].name, catalogueNames)));\n\t\ttd.title = data[i].id;\n\t\ttd.setAttribute('headers', 'pz2-target-name');\n\t\ttd = document.createElement('td');\n\t\ttr.appendChild(td);\n\t\ttd.appendChild(document.createTextNode(data[i].records));\n\t\ttd.setAttribute('headers', 'pz2-target-loaded');\n\t\ttd = document.createElement('td');\n\t\ttr.appendChild(td);\n\t\tvar hitCount = data[i].hits;\n\t\tif (hitCount == -1) {\n\t\t\thitCount = '?';\n\t\t}\n\t\ttd.appendChild(document.createTextNode(hitCount));\n\t\ttd.setAttribute('headers', 'pz2-target-hits');\n\t\ttd = document.createElement('td');\n\t\ttr.appendChild(td);\n\t\ttd.appendChild(document.createTextNode(localise(data[i].state)));\n\t\tif (data[i].diagnostic != 0) {\n\t\t\ttd.setAttribute('title', localise('Code') + ': ' + data[i].diagnostic);\n\t\t}\n\t\ttd.setAttribute('headers', 'pz2-target-status');\n\n\t\ttargetStatus[data[i].name] = data[i];\n\t}\n\n\tif (my_paz.activeClients === 0) {\n\t\t// Update the facet when no more clients are active, to ensure result\n\t\t// counts and overflow indicators are up to date.\n\t\tupdateFacetLists();\n\t\t// Update result count\n\t\tupdatePagers();\n\t}\n\n}", "title": "" } ]
[ { "docid": "ecc829c1ce3457f11de5cdbd0d27f680", "score": "0.57985187", "text": "handleStatusChange(target){\n console.log(target);\n }", "title": "" }, { "docid": "84c9221dc08e69ef24824a588459e357", "score": "0.5739015", "text": "function my_onstat(data) {\n\t// Display progress bar, with a minimum of 5% progress.\n\tvar progress = (data.clients[0] - data.activeclients[0]) / data.clients[0] * 100;\n\tprogress = Math.max(progress, 5);\n\tvar opacityValue = (progress === 100) ? 0 : 1;\n\tjQuery('.pz2-pager .pz2-progressIndicator').animate({'width': progress + '%', 'opacity': opacityValue}, 'slow');\n\n\t// Update result count\n\tupdatePagers();\n\n\t// Write out status information.\n\tvar statDiv = document.getElementById('pz2-stat');\n\tif (statDiv) {\n\t\tjQuery(statDiv).empty();\n\n\t\tvar heading = document.createElement('h4');\n\t\tstatDiv.appendChild(heading);\n\t\theading.appendChild(document.createTextNode(localise('Status:')));\n\n\t\tvar statusText = localise('Aktive Abfragen:') + ' '\n\t\t\t\t+ data.activeclients + '/' + data.clients + ' – '\n\t\t\t\t+ localise('Geladene Datensätze:') + ' '\n\t\t\t\t+ data.records + '/' + data.hits;\n\t\tstatDiv.appendChild(document.createTextNode(statusText));\n\t}\n}", "title": "" }, { "docid": "eed44bde1a3a0b492a633565ecea892b", "score": "0.5674577", "text": "function updateStatus(data){\n console.log(\"data.status\");\n setStatus(1, data.status);\n}", "title": "" }, { "docid": "6e742287f263aa135574c467f7ac2f44", "score": "0.5482091", "text": "_onComplete() {\t\n\t console.log(\"Confetti._onComplete: \" + this.data.target);\n }", "title": "" }, { "docid": "0f97efd201175290afef61011ac8309f", "score": "0.5471386", "text": "function changeStatus(id, status) {\n callupdateOtifList(id, status);\n}", "title": "" }, { "docid": "c57730170216bc7f522a71800b6a2960", "score": "0.5403742", "text": "function handleOnChange({ target }) {\n const {value, id} = target;\n setTextDiffTab({ ...textDiffTab, [id]: value, statusMessage: \"Ready\" });\n }", "title": "" }, { "docid": "060f667935101116480018897c0e8d81", "score": "0.53971064", "text": "function statusHandler(e) {\n console.log(e.target.id)\n props.changeStatus(e.target.id)\n }", "title": "" }, { "docid": "9bff56bce07744e60663e4b839455313", "score": "0.5391934", "text": "handleStatusChange(event) {\n if (event.detail.status === \"FINISHED\") {\n // this.isModalOpen = false;\n this.startFlow = false; // This variable controls the Flow for adding Objectives\n this.showStage = true; // This shows the Stage Picklist Selector\n this.getUsage(); // This repopulates the variable Area/SD data after the flow\n }\n }", "title": "" }, { "docid": "1ec412fd3c512700632db69d21f7a379", "score": "0.5340629", "text": "function update_on_inspection(status) {\n // Update display\n update_target_status(status, null);\n // Update buttons\n update_capabilities(status);\n }", "title": "" }, { "docid": "bc42835f5b6eca4938c1468bd4ea832f", "score": "0.5329133", "text": "function displayStatusUpdates(data) {\n for (index in data.statusUpdates) {\n $('body').append(\n '<p>' + data.statusUpdates[index].text + '</p>');\n }\n}", "title": "" }, { "docid": "77493633efff647a723d187498a25223", "score": "0.53265786", "text": "function callback(entries, observer) {\n\n entries.forEach(function (entry) {\n\n if ( entry.isIntersecting ) {\n\n displayElement(entry.target) // Do this when the observer see the target \n \n } else {\n\n \n } \n }); // forEach ENDpoint\n\n} // Callback ENDpoint", "title": "" }, { "docid": "942a1b74be5f74f60b0ffdf0c39afd78", "score": "0.5281009", "text": "function userUpdaterCallback(people) {\n\tpeople.forEach(function(person) {\n\t\tif (person.hasStatus == true) {\n\t\t\tupdatePersonStatus(person.id, person.currentStatus);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "464f574ecc62ad92168061c6bbee7629", "score": "0.5255588", "text": "function userStatusesCallback(dlist) {\n\tfor (var i in dlist) {\n\t\tDispositionStats[dlist[i].SetupItemID] = dlist[i].Name;\n\t}\n\tsendToLogs(\"No of Disposition Statuses: \" + Object.keys(DispositionStats).length);\n}", "title": "" }, { "docid": "1f7f91802e02db3f5d36e546bd8d0768", "score": "0.5254175", "text": "onStatus(thingName, stat, clientToken, stateObject) {\n if (stateObject.state.reported === undefined) {\n console.log('Cannot find reported state.'.red);\n } else {\n console.log(\n 'Reported current state: '.gray,\n JSON.stringify(stateObject.state.reported).gray\n );\n }\n }", "title": "" }, { "docid": "02334ef542e9ff1008dba3d092a4f967", "score": "0.5193066", "text": "function onChangeBtn() {\n console.log('changeBtn click');\n let thisTaskId = $(this).data('id');\n let currentStatus = $(this).data('status');\n console.log('current Status:', currentStatus);\n changeStatus(thisTaskId, currentStatus);\n}", "title": "" }, { "docid": "83fa8189dd984dd4cc3ec56c91c24559", "score": "0.51848394", "text": "do_ppc_completed(host_name, slot_name, task_info) {\r\n console.log('do_ppc_completed',host_name,slot_name,task_info);\r\n let node_name = this.make_nn(host_name, slot_name);\r\n let li = document.getElementById(this.make_host_button(host_name,slot_name));\r\n if (li) {\r\n // note we reset node to 'LOADED' status\r\n li.setAttribute('class','ppc_waiting');\r\n this.do_ppc_msg(host_name, slot_name, \"COMPLETED \"+task_info)\r\n // update status flow diagram\r\n this.ppc_status_update(node_name, this.PPC_WAITING);\r\n } else {\r\n console.log('Just received a ppc_completed for unknown node '+host_name+':'+slot_name);\r\n }\r\n }", "title": "" }, { "docid": "3ef2279477772b3e334c6e5f7d94b9eb", "score": "0.5172404", "text": "function displayStatusList() {\r\n users = API.getUsers();\r\n\r\n API.sendChat(\" \");\r\n API.sendChat(\"Automated message: Status list for current people in the room: \");\r\n\r\n for (var i = 0; i < users.length; i++) {\r\n if (API.hasPermission(API.getUser(null).id, API.ROLE.HOST)) {\r\n API.sendChat(\"Automated message: \" + users[i].username + \" is \" + \r\n parseStatus(users[i].status) + \": \" + stMsgMap[users[i].username]);\r\n }\r\n else {\r\n API.sendChat(\"Automated message: \" + users[i].username + \" is \" + \r\n parseStatus(users[i].status));\r\n }\r\n }\r\n \r\n API.sendChat(\" \");\r\n}", "title": "" }, { "docid": "9dd1e2f55bd4c4a38ac54a702adf0271", "score": "0.515279", "text": "function updateAllStatusInformation() {\n $(\"div.status-row-with-guid\").each(function() {\n if ($(this).data('finished') == 'yes') {\n return;\n }\n var guid = $(this).attr('id');\n var info = false;\n if ($(this).data('info') != 'set') {\n info = true;\n }\n updateStatus(guid, info);\n });\n}", "title": "" }, { "docid": "60004e03087c53850277caeb4d5516e9", "score": "0.5115931", "text": "function updateStatus() {\n\tpost('long:status', function(text) {\n\t\taddToConsole(text);\n\t\tupdateStatus();\n\t}, function() {\n\t\tupdateStatus();\n\t});\n}", "title": "" }, { "docid": "3fe55e0eb818db7db2b3fa64b6d54a53", "score": "0.5110715", "text": "function updateCallStatus(status) {\n console.log(status);\n callStatus.text(status);\n}", "title": "" }, { "docid": "a790a928eb8786067e26adad58e37618", "score": "0.5106396", "text": "function reachabilityNotificationProcessor(data){\n\n reachabilityData=data;\n console.log(\"Reachablitliy callback: \", data)\n}", "title": "" }, { "docid": "616fce1633ca546e3bfba97817e4b12c", "score": "0.5104701", "text": "function statusHandler(e){\n setStatus(e.target.value);\n }", "title": "" }, { "docid": "658d31dde19dc05d66f1e3e9bedd3f03", "score": "0.51034594", "text": "function toggleuserstatus_success(to, callback) {\n // Do stuff before callback.\n if (to == 'on') { //arrived on property\n $(\"#arrivebtn\").html($(\"#arrivebtn\").html().replace(\"Arrived\", \"Leaving\"));\n navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions); // update current user's location.\n }\n else { // leaving property.\n $(\"#arrivebtn\").html($(\"#arrivebtn\").html().replace(\"Leaving\", \"Arrived\"));\n }\n $(\"#arrivebtn\").toggleClass('btn-info btn-warning');\n $(\"#arrivebtnicon\").toggleClass('fa-check fa-sign-out-alt');\n\n // Execute callback. (load all active locations into dynamic map)\n callback();\n}", "title": "" }, { "docid": "b359b26a8d1aad1b16089d817e96aa4f", "score": "0.50674886", "text": "ppc_status_update(node_name, status) {\r\n console.log('status_flow_update',node_name,status);\r\n //console.log('current row is',flow_row_status);\r\n let node_index = this.flow_node_index[node_name];\r\n //if (flow_row_status != status)\r\n //{\r\n // status_flow_flush();\r\n // flow_row_status = status;\r\n //}\r\n //console.log('update setting flow_status[',node_index,'] to',status);\r\n this.flow_status[node_index] = status;\r\n }", "title": "" }, { "docid": "ea0bee02083aee96f1bf9d67ad90dc4a", "score": "0.5066776", "text": "updateStatus(event, data) {\n const connected = data.connectionStatus;\n const ok = data.runtimeStatus;\n const msg = {\n __type__: 'StatusLight',\n red: false,\n yellow: false,\n green: false,\n buzzer: false,\n };\n if (connected && ok) {\n if (ok) {\n msg.green = true;\n } else {\n msg.yellow = true;\n }\n } else {\n msg.red = true;\n }\n this.lcmPublish(`StatusLight${this.stationNumber}/StatusLight`, msg);\n }", "title": "" }, { "docid": "fe5fe2ed60c757aa5be5942883a4477d", "score": "0.50613475", "text": "function SetStatusChanged( status ) {}", "title": "" }, { "docid": "bfc185e4ea7a0db9d1f603c92b03f609", "score": "0.50552654", "text": "function tip (target, context, params) {\n let msg = 'bobsuruncle has donated 5$'\n // If there's something to print:\n if (params.length) {\n msg += params.join(' ')\n }\n // Send it back to the correct place:\n sendMessage(target, context, msg)\n\n // Send API call to robot arm\n console.log('robot call ----> start')\n http.get('http://dex.local:8080', (res) => {\n const { statusCode } = res\n console.log('status', statusCode)\n res.on('end', () => console.log('robot call ----> end'))\n }).on('error', (err) => { console.log(\"robot call ----> error: \" + err.message) })\n}", "title": "" }, { "docid": "744ef821ea513c2091f5efb24a011a01", "score": "0.5051658", "text": "function updateStatusBar(hash_name, is_spymaster) {\n updateStatusFirst(hash_name);\n updateRemainingCards(hash_name, is_spymaster);\n}", "title": "" }, { "docid": "40f9358fdf5e089fa293308238661f37", "score": "0.50494397", "text": "_fireStatusEvent(/* Object */ args)\r\n {\r\n if (this.targetHTMLElementId) {\r\n var targetElement = this.targetHtmlElement || (this.targetHTMLElementId ? document.getElementById(this.targetHTMLElementId) : null);\r\n if (targetElement == null)\r\n throw Error(\"TargetElement '\"+this.targetHTMLElementId+\"' not found.\");\r\n if (this.isReady()) {\r\n jQuery(targetElement).addClass(\"statusReady\").removeClass(\"statusNotReady\");\r\n } else if (!this.suppressInitialRendering || this.getStatus() !== this.initializedStatus) {\r\n jQuery(targetElement).addClass(\"statusNotReady\").removeClass(\"statusReady\");\r\n }\r\n }\r\n bcdui.core.DataProvider.prototype._fireStatusEvent.call(this, args);\r\n }", "title": "" }, { "docid": "f096e9549866e314a2263129c630de4d", "score": "0.5046342", "text": "function onData(data) {\n console.log(\"onData\", data);\n}", "title": "" }, { "docid": "93c3ca24e8ba837121125800d410afed", "score": "0.5033866", "text": "function setOnlineStatus(response,callback){\n response.forEach((userObj) => {\n // console.log(userObj)\n let userData = {}\n // check user is active\n if(userObj.status != null){\n let userName = userObj.display_name;\n let status = userObj.status;\n let feed = userObj.url;\n let logo = userObj.logo;\n userData = {\n 'username':userName,\n 'status':status,\n 'feed': feed,\n 'logo':logo\n }\n } else {\n // stop if value is null\n return\n }\n // push to global array\n globalUserChannelData.push(userData)\n })\n // settimeout before calling running displayLogic\n setTimeout(function(){\n callback(displayLogic(globalUserChannelData))\n },0010)\n}", "title": "" }, { "docid": "9863ceb5d938623c6c48ebaa77d23776", "score": "0.5022664", "text": "function updateStatusMessages(status) {\n var state = \"No status information found!\";\n var progress_log = [];\n\n var is_error = false;\n\n switch (status['code']) {\n case \"0\":\n state = \"Your camera profile is in the queue for processing.\";\n $('#' + status['guid'] + ' .main-info .guid').css('border-color', '#888');\n break;\n case \"100\":\n if ('log' in status && status['log'][status['log'].length - 1]['user_message'].includes('error'))\n {\n state = \"Camera profile creation failed\";\n $('#' + status['guid'] + ' .main-info .guid').css('border-color', '#f00');\n is_error = true;\n }\n else\n {\n state = \"Camera profile creation is currently in progress.\";\n $('#' + status['guid'] + ' .main-info .guid').css('border-color', '#ee0');\n }\n break;\n case \"200\":\n state = \"The camera profile creation is finished.\";\n $('#' + status['guid'] + ' .main-info .guid').css('border-color', '#0f0');\n $('#'+ status['guid']).data('finished', 'yes');\n $('#' + status['guid'] + ' .finished-action').show();\n break;\n }\n\n if (is_error)\n {\n $('#' + status['guid'] + ' .main-status').html('<p style=\"background-color: #fcc;\">' + state + '</p>');\n }\n else\n {\n $('#' + status['guid'] + ' .main-status').html('<p>' + state + '</p>');\n }\n \n\n if (status['log']) {\n var i;\n for (i = 0; i < status['log'].length; i++) {\n progress_log.push('<li class=\"level-'+ status['log'][i]['level'] +'\"><span class=\"log-date\">' + status['log'][i]['date'] + '</span> <span class=\"log-message\">' + status['log'][i]['user_message'] + '</span></li>');\n }\n\n $('#' + status['guid'] + ' .log-messages').html('<p>Log information of profile creation:</p><ul class=\"progress-log\">'+ progress_log.join(\"\") +'</ul>');\n }\n}", "title": "" }, { "docid": "d4f204e7c814eb37fe5876ccd8b59f78", "score": "0.5000411", "text": "_userListReceived(userList) {\n LessonActions.userListReceived(userList);\n }", "title": "" }, { "docid": "ff54298b45dd10004781e6b59b6873e6", "score": "0.49905622", "text": "_onChange(){\n\n let ids = this._getTargetIDs();\n\n // Let the world know\n this._mediator.publish('trigger', {\n toggle: this,\n id: this.getId(),\n active: ids.length > 0,\n targets: ids\n });\n\n }", "title": "" }, { "docid": "46e1776eff7aed997b639d4814befdf1", "score": "0.49862868", "text": "_emitStatus() {\n this._onStatus(this._status());\n }", "title": "" }, { "docid": "2f4e4e6fc2972491a0649463fa5220e8", "score": "0.49851888", "text": "function connections_pumpStatus(Status) {\r\n var model = myDiagram.model;\r\n model.startTransaction(\"trans\");\r\n var links = model.linkDataArray;\r\n links.forEach(element => { model.setDataProperty(element, \"pumpStatus\", Status); }); \r\n model.commitTransaction(\"trans\");\r\n}", "title": "" }, { "docid": "c32f4366d0e125c4ef865dd7b7ebc927", "score": "0.49758023", "text": "function handle_status( addr, cmd, status )\n{\n}", "title": "" }, { "docid": "dfab86504c715e44536c76e3f2844b58", "score": "0.4965897", "text": "function changeStatus(id,status) {\n\t$.each(list,function (i,data) {\n\t\tif(data.id == id){\n\t\t\tdata.status = status;\n\t\t}\n\t})\n}", "title": "" }, { "docid": "35826aa4d2558c4878017795abf5469e", "score": "0.49630544", "text": "function updateStatus(guid, get_info) {\n var url = $('body').data('server-url') + '/status.php?guid=' + guid;\n if (get_info == true) {\n url = url + '&info=1';\n }\n\n $.getJSON(url, function(data) {\n if (data['info']) {\n getStatusInformation(data['guid'], data['info']);\n }\n updateStatusMessages(data);\n });\n}", "title": "" }, { "docid": "94b402ec54f24578191abcdfa6fd4fa5", "score": "0.4951105", "text": "updateStatus() {\n return this.sendData(CMD.TAKE_DATA)\n .then(Protocol.parseTakeData)\n .then( (res) => {\n switch(res.workState) {\n case STATE.RUNNING:\n if(this.status.workState != STATE.RUNNING) {\n this.emit('started')\n }\n break;\n\n case STATE.IDLE:\n if(this.status.workState == STATE.RUNNING) {\n this.emit('stopped')\n }\n break;\n\n case STATE.FINISH:\n if(this.status.workState == STATE.RUNNING) {\n this.emit('stopped')\n this.emit('finish')\n }\n break;\n\n case STATE.ERROR:\n const errorMessage = ErrorCodes[res.errorCode]\n if(this.status.workState == STATE.RUNNING) {\n this.emit('stopped')\n }\n if(this.status.workState != STATE.ERROR) {\n this.emit('error', errorMessage)\n }\n break;\n\n default:\n throw new Error('unknown state '+res.workState)\n }\n this.status = res\n this.emit('status', res)\n })\n }", "title": "" }, { "docid": "2576a2a156cffc73317c53e9c4037f38", "score": "0.49470645", "text": "onActionStatus(action) {\n this.emit(Constants.ACTION_STATUS, action);\n }", "title": "" }, { "docid": "dea706a06332507fe9fcc4cff60ff538", "score": "0.4946821", "text": "status(callback, referenceID, optionalParams=null) {\n this.rest.execute(callback, \"GET\", util.format(this.statusResource, referenceID), optionalParams);\n }", "title": "" }, { "docid": "04f9ff7eb35f97fee25405aae2062a08", "score": "0.49425426", "text": "function create_lotSuccessFn(data, status, headers, config) {\r\n console.log('Successful POST to /monitor!');\r\n }", "title": "" }, { "docid": "e3e164b4f10edbcc158e0ca414d3bd39", "score": "0.49252242", "text": "function callback(entries, observer) {\n // The callback will return an array of entries, even if you are only observing a single item\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n scrollToTopBtn.classList.add(\"showBtn\");\n } else {\n scrollToTopBtn.classList.remove(\"showBtn\");\n }\n });\n}", "title": "" }, { "docid": "88119a1bc82df42b3a943af5b7fc803b", "score": "0.49251515", "text": "emitStatusUpdate() {\n this.emit('update', this.status)\n }", "title": "" }, { "docid": "93b04ec4e5b42c55a40ce0451f8aef7f", "score": "0.4923063", "text": "function updateCallStatus(status) {\n callStatus.text(status);\n}", "title": "" }, { "docid": "617ea0fe920aff781cc22d6abcc3bb54", "score": "0.4920813", "text": "function handleCommands(data) {\n \n if( data.dst == piname && data.type == \"request\") {\n\n\n if( data.request == \"on\" ) {\n console.log(\"Turning on light.\");\n\n sendResponse(\"success\", \"Light turned on.\");\n }\n else if ( data.request == \"off\" ) {\n console.log(\"Turning light off.\");\n\n sendResponse(\"success\", \"Light turned off.\");\n }\n else {\n console.log(\"Bad command\");\n }\n\n\n }\n\n\n}", "title": "" }, { "docid": "472079a163285ab8966f71f89df259c6", "score": "0.4919826", "text": "detail(...args) {\n callback(...args);\n }", "title": "" }, { "docid": "3f1e5a917da581b8874680ae860967d2", "score": "0.49101967", "text": "function updateCallStatus(status) {\n callStatus.text(status);\n}", "title": "" }, { "docid": "30d20f4feda7d076809ce6c8eeb2066f", "score": "0.4910181", "text": "function statusChange(s, t) {\r\n for (var j = 0; j < hexEls.length; j++) {\r\n if (selectedHex[j].status === s) {\r\n selectedHex[j].status = t;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0be7ead11eff21e8ea18643e00c4780a", "score": "0.49075356", "text": "function targetSet(event, ui) {\n demini()\n minimize(\"host-connection\")\n var hostAll = $('#host-connection .ui-selected').map(function() {\n return $(this).text();\n }).get();\n var len = hostAll.length;\n var targets = \"\";\n for (var i = 0; i < len; i++) {\n var host = hostAll[i];\n if (data.hasOwnProperty(host)) {\n for (var i in data[host]) {\n if (data[host].hasOwnProperty(i)) {\n targets += createLi(i);\n }\n }\n }\n }\n $('#out').html(\"\");\n $('#firstouttext').attr(\"style\", \"display:hidden\")\n $('#target-connection').html(targets);\n $(\"#target-connection\").selectable(\"refresh\");\n\n }", "title": "" }, { "docid": "f3d6889d83d31206441250fc6e791a2a", "score": "0.49071667", "text": "onData(proto) {\n if (proto.targetChange) {\n logger_1.logger('Watch.onData', this.requestTag, 'Processing target change');\n const change = proto.targetChange;\n const noTargetIds = !change.targetIds || change.targetIds.length === 0;\n if (change.targetChangeType === 'NO_CHANGE') {\n if (noTargetIds && change.readTime && this.current) {\n // This means everything is up-to-date, so emit the current\n // set of docs as a snapshot, if there were changes.\n this.pushSnapshot(timestamp_1.Timestamp.fromProto(change.readTime), change.resumeToken);\n }\n }\n else if (change.targetChangeType === 'ADD') {\n if (WATCH_TARGET_ID !== change.targetIds[0]) {\n this.closeStream(Error('Unexpected target ID sent by server'));\n }\n }\n else if (change.targetChangeType === 'REMOVE') {\n let code = google_gax_1.Status.INTERNAL;\n let message = 'internal error';\n if (change.cause) {\n code = change.cause.code;\n message = change.cause.message;\n }\n // @todo: Surface a .code property on the exception.\n this.closeStream(new Error('Error ' + code + ': ' + message));\n }\n else if (change.targetChangeType === 'RESET') {\n // Whatever changes have happened so far no longer matter.\n this.resetDocs();\n }\n else if (change.targetChangeType === 'CURRENT') {\n this.current = true;\n }\n else {\n this.closeStream(new Error('Unknown target change type: ' + JSON.stringify(change)));\n }\n if (change.resumeToken &&\n this.affectsTarget(change.targetIds, WATCH_TARGET_ID)) {\n this.backoff.reset();\n }\n }\n else if (proto.documentChange) {\n logger_1.logger('Watch.onData', this.requestTag, 'Processing change event');\n // No other targetIds can show up here, but we still need to see\n // if the targetId was in the added list or removed list.\n const targetIds = proto.documentChange.targetIds || [];\n const removedTargetIds = proto.documentChange.removedTargetIds || [];\n let changed = false;\n let removed = false;\n for (let i = 0; i < targetIds.length; i++) {\n if (targetIds[i] === WATCH_TARGET_ID) {\n changed = true;\n }\n }\n for (let i = 0; i < removedTargetIds.length; i++) {\n if (removedTargetIds[i] === WATCH_TARGET_ID) {\n removed = true;\n }\n }\n const document = proto.documentChange.document;\n const name = document.name;\n const relativeName = path_1.QualifiedResourcePath.fromSlashSeparatedString(name)\n .relativeName;\n if (changed) {\n logger_1.logger('Watch.onData', this.requestTag, 'Received document change');\n const ref = this.firestore.doc(relativeName);\n const snapshot = new document_1.DocumentSnapshotBuilder(ref.withConverter(this._converter));\n snapshot.fieldsProto = document.fields || {};\n snapshot.createTime = timestamp_1.Timestamp.fromProto(document.createTime);\n snapshot.updateTime = timestamp_1.Timestamp.fromProto(document.updateTime);\n this.changeMap.set(relativeName, snapshot);\n }\n else if (removed) {\n logger_1.logger('Watch.onData', this.requestTag, 'Received document remove');\n this.changeMap.set(relativeName, REMOVED);\n }\n }\n else if (proto.documentDelete || proto.documentRemove) {\n logger_1.logger('Watch.onData', this.requestTag, 'Processing remove event');\n const name = (proto.documentDelete || proto.documentRemove).document;\n const relativeName = path_1.QualifiedResourcePath.fromSlashSeparatedString(name)\n .relativeName;\n this.changeMap.set(relativeName, REMOVED);\n }\n else if (proto.filter) {\n logger_1.logger('Watch.onData', this.requestTag, 'Processing filter update');\n if (proto.filter.count !== this.currentSize()) {\n // We need to remove all the current results.\n this.resetDocs();\n // The filter didn't match, so re-issue the query.\n this.resetStream();\n }\n }\n else {\n this.closeStream(new Error('Unknown listen response type: ' + JSON.stringify(proto)));\n }\n }", "title": "" }, { "docid": "29fdb8f9205bef5d584c6eba6dcdb59a", "score": "0.4904348", "text": "function updateStatusFct(){\n $.getJSON( $('body').attr('data-status-url') )\n .done(function( json ) {\n $('#status-overview').html(json.body);\n })\n .fail(function( jqxhr, textStatus, error ) {\n const err = textStatus + \", \" + error;\n $('#status-overview').html('<i class=\"fa fa-circle text-red\"></i> ' + err);\n });\n }", "title": "" }, { "docid": "281ba23c5c893f1f0d7227f23d2b6444", "score": "0.49022067", "text": "function checkLightStatus() {\n$inputs = [7,8];\nfor(i=0;i<$inputs.length;i++) {\ngetStatus($inputs[i]);\n}\n}", "title": "" }, { "docid": "cd88ae1e467cae67e580056b0b158ed2", "score": "0.48989797", "text": "function changeListArray(data,status) {\n\n for(let i=0; i < listArray.length; i++){\n\n if(listArray[i].content == data){\n listArray[i].status = status;\n refreshLocal();\n break;\n }\n }\n}", "title": "" }, { "docid": "d9ea0de418a1f7bfff5528989cd44ea9", "score": "0.4898936", "text": "function displayList(lst, updtSrv, where, noinfo) {\n if (where == undefined) {\n where = $(\"#mangalist\");\n }\n if (noinfo == undefined) {\n noinfo = false;\n }\n if (lst != null && lst.length == 0) {\n $(\"<h3>Your manga list is empty</h3>\").appendTo(where);\n } else {\n var hasChanges = false;\n if (lst != null) {\n for (var i = 0; i < lst.length; i++) {\n if (lst[i].length) {\n for (var j = 0; j < lst[i].length; j++) {\n if (lst[i][j].change) {\n hasChanges = true;\n }\n }\n } else {\n if (lst[i].change) {\n hasChanges = true;\n }\n }\n }\n }\n if (hasChanges) {\n if (!noinfo) {\n if (updtSrv) {\n $(\"<h3>These changes will be made on the online list because you have recent changes in your extension list.</h3>\").appendTo(where);\n } else {\n $(\"<h3>These changes will be made on your local list because you server list is more recent.</h3>\").appendTo(where);\n }\n }\n var tb = $(\"<table class=\\\"mgLst\\\"><thead><tr><td class=\\\"checker\\\"><div class=\\\"tip leftstick\\\"><input type=\\\"checkbox\\\" checked=\\\"checked\\\"/><span>Select updates to send to AMR's server and validate to send data.</span></div></td><td class=\\\"title\\\" colspan=\\\"3\\\"><div class=\\\"tip left\\\">Manga Name - Categories - Website - Chapter name<span>Click on the manga name to go read this manga on the corresponding web site (if there are multiple websites for the same manga, click on the website icon). Click on the chapter name to go read the chapter online.</span></div></td><td class=\\\"proghead\\\">Reading Progression</td></tr></thead><tbody></tbody><tfoot><tr><td class=\\\"empty\\\"></td><td colspan=\\\"3\\\" class=\\\"resume\\\"><span class=\\\"title\\\"></span></td><td class=\\\"progression\\\"></td></tr></tfoot></table>\");\n tb.appendTo(where);\n var nbmg = 0;\n var nbchaps = 0;\n var totchap = 0;\n var nbmgdiff = 0;\n for (var i = 0; i < lst.length; i++) {\n nbmgdiff++;\n var stat;\n if (lst[i].length) {\n stat = addMultipleMangas(lst[i], $(tb, \"tbody\"));\n } else {\n stat = addSingleManga(lst[i], $(tb, \"tbody\"));\n }\n //console.log(stat);\n nbmg += stat.nbmg;\n nbchaps += parseInt(stat.nbchap, 10);\n totchap += parseInt(stat.chaptot, 10);\n }\n $(\"tfoot .resume .title\", tb).text(nbmgdiff + \" manga read at \" + nbmg + \" places.\");\n createProgression(nbchaps, totchap, $(\"tfoot\", tb), true);\n \n bindActions();\n } else {\n if (!noinfo) {\n var t = $(\"<div class='nochange'><span>No changes found.</span>&nbsp;<a class=\\\"viewlist button\\\" onclick=\\\"loadList();\\\">Click here to view list</a></div>\");\n $(\".validationamr\").remove();\n t.appendTo(where);\n $(\".viewlist\", t).click(function() {\n $(\".globalamractions\").show();\n $(\".updateamrlist .button\").removeClass(\"disabled\");\n $(\".updateamrlist .button\").click(clickOnUpdate);\n });\n } else {\n var t = $(\"<div class='nochange'><span>No changes found.</span></div>\");\n t.appendTo(where);\n }\n }\n }\n}", "title": "" }, { "docid": "fa53e5206055d3b094e6ffb1ea852273", "score": "0.48988193", "text": "function setStatus(client,data) {\n client.setActivity({\n details: `${data.name} [${data.kernel}]`,\n state: `up ${formatUptime(data.bootTimestamp)}`,\n largeImageKey: data.logo,\n largeImageText: data.text,\n instance: false,\n buttons: require('../buttons.json'),\n })\n}", "title": "" }, { "docid": "3f9aa69db50e3ff94aa931642777accc", "score": "0.48985717", "text": "function change_status(outageid,statusid){\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n webURL: \"/sites/help/outage/\",\n listName: \"{F6F0A3E6-739F-4480-9126-692927FD1E6D}\",\n ID: outageid,\n valuepairs: [[\"Approval\", statusid]],\n completefunc: function(xData, Status) {\n\n //alert(\"List Item successfully Created.\");\n var out = $().SPServices.SPDebugXMLHttpResult({\n node: xData.responseXML\n });\n\n // Message was sent\n if (Status == 'success') {\n window.location.replace(\"approve.outage.html?outageid=\" + outageid);\n }\n // There was an error\n else {\n alert('Save Failed: ' + out);\n }\n }\n });\n\n }", "title": "" }, { "docid": "78fe8035ffdc491844f92dbd96c2eefc", "score": "0.48853162", "text": "function updateStatus(message, pStage, iStage, nStage, newLine, callNext) {\n var formattedMsg = new Date().toLocaleTimeString() + \" \" + \"[\" + iStage + \"/\" + nStage + \"] \" + Math.round(pStage * 100) + \"% \" + message;\n document.getElementById(\"result\").innerHTML = result.completed + formattedMsg;\n\n if (newLine) result.completed += formattedMsg + \"<br />\"; \n if (callNext) setTimeout(callNext, 0);\n}", "title": "" }, { "docid": "7ff0de744bf39d4364a1504bbbc44f30", "score": "0.48798698", "text": "_onHasCompletion (cm, data) {\n onHasCompletion(cm, data);\n }", "title": "" }, { "docid": "b759efe870da3a60fba11e1267ce27b0", "score": "0.48757344", "text": "function handleStatusMsg(data) {\n\tconsole.log('status : ' + data.statusMsg);\n\n\tvar old_msgs = $(\"#old_msgs\");\n\n\t// display the status message\n\told_msgs.append(\"<li id='status_msg'>\" + data.status + \"</li>\");\n}", "title": "" }, { "docid": "6fd302de8951e3b1795105a2bca24442", "score": "0.4871977", "text": "setupStatusTruck() {\n this.truckStatus = this.TruckContainerService.getCurrentStatusTruck();\n if (this.truckStatus.id !== 'inloading') {\n this.previousDangerLevel = this.TruckContainerService.getPreviousDangerLevel();\n }\n this.listButtonChangeStatus = [];\n\n switch(this.truckStatus.id) {\n case 'inloading': \n this.listButtonChangeStatus.push(this.listStatus['indriving']);\n break;\n case 'indriving':\n this.listButtonChangeStatus.push(this.listStatus['onhold']);\n this.listButtonChangeStatus.push(this.listStatus['completed']);\n\n if (angular.isDefined(this.previousDangerLevel) && this.previousDangerLevel === 0) {\n this.listButtonChangeStatus.push(this.listStatus['reload']);\n }\n break;\n case 'onhold':\n this.listButtonChangeStatus.push(this.listStatus['inholding']);\n this.listButtonChangeStatus.push(this.listStatus['completed']);\n break;\n case 'inholding':\n this.listButtonChangeStatus.push(this.listStatus['onhold']);\n this.listButtonChangeStatus.push(this.listStatus['completed']);\n default: \n break;\n }\n }", "title": "" }, { "docid": "6a96830d5303b42ab75690af9cb801b0", "score": "0.48667842", "text": "function onOperationComplete(status, callbackId) {\n const callback = commandCallbacks[callbackId];\n delete commandCallbacks[callbackId];\n if (callback) {\n callback(status);\n }\n update();\n }", "title": "" }, { "docid": "8333f302c39bf22deb071034506fcfe5", "score": "0.48650968", "text": "function changeStatus(response, postData, db, params) {\r\tconsole.log(\"Request handler 'Change Cleaner Status' was called\");\r\tvar id = params['id'];\r\tvar status = params['status'];\r\tdb.query('UPDATE cleaners SET status='+status+' WHERE id='+id, function (error, rows, fields) {\r response.writeHead(200, {\r\t\t\t'Content-Type': 'text/plain'\r });\r\t\t console.log(\"Cleaner ID#\"+id+\" has checked in.\");\r response.end(JSON.stringify(rows));\r });\r}", "title": "" }, { "docid": "622f33abcfd5283dacb6ee26f4744e94", "score": "0.48603308", "text": "function statusGen(ally) {\n // puts HP/MP count into counter boxes\n $(ally.counterFindAllyHP()).text(ally.totalHP);\n $(ally.counterFindAllyMP()).text(ally.totalMP);\n\n // puts name into name slot\n $(ally.nameFindAlly()).text(`${ally.name}`);\n }", "title": "" }, { "docid": "f90d14888e70e803faa118362ec50ed6", "score": "0.48599797", "text": "runHttpStatusCallbacks(status,param){\n console.log(status);\n if(this.callbacks.httpStatus.hasOwnProperty(status)){\n if (typeof this.callbacks.httpStatus.hasOwnProperty(status) === 'function'){\n this.callbacks.httpStatus[status](param);\n }\n }\n this.storedResponse = {};\n }", "title": "" }, { "docid": "56674aa386b3e6e01303c6b59c6597a1", "score": "0.48511088", "text": "function onMessage(evt)\n{\n\tvar jdata = JSON.parse(evt.data);\n\n if (jdata.responsetype == \"status\") // we requested a status or status was pushed, update screen\n {\n console.log(\"scandata status changed\");\n FillSystemTable(jdata);\n }\n else if (jdata.responsetype == \"systemmapchanged\") // scan display changed, rerequest URL\n {\n console.log(\"Informed scan display changed\");\n RequestImage(-1);\n }\n else if (jdata.responsetype == \"scandisplayobjects\") // scan display changed, rerequest URL\n {\n console.log(\"New scandisplay objects received\");\n lastobjectlist = jdata;\n }\n}", "title": "" }, { "docid": "800d1e1189070d4f08a0721d7e1ba754", "score": "0.48510516", "text": "onToggleComplete () {\n const { item } = this.props\n\n Actions.toggleComplete(item)\n }", "title": "" }, { "docid": "62db514e5d32a4df9d989552f979f7d3", "score": "0.48453322", "text": "function ready(){\n $('.change-interview-status').each( function() {\n setListenerOn($(this));\n });\n}", "title": "" }, { "docid": "c31c00442a9435b512fd6a0ce5501603", "score": "0.48338994", "text": "on() {\n this.status = \"on\";\n }", "title": "" }, { "docid": "ebd9564df5f344c79b789d7303c2a74b", "score": "0.48332718", "text": "CheckCompletion(inCompleteRespose){\n if(inCompleteRespose == 1){\n this.props.PushTextDataToObject({isValid: 0, inCompleteRespose: 1});\n } else{\n this.props.PushTextDataToObject({isValid: 0, inCompleteRespose: 0});\n }\n }", "title": "" }, { "docid": "517f477e9081dc53e23e9c0d6da5a26f", "score": "0.48305184", "text": "function checkStatus(event) {\n var el = event.target;\n\n //Adding class of active and pushing el to a container array\n addClassActive(event, el);\n\n}", "title": "" }, { "docid": "caa32d975a806810a1b3b30fc2a3616f", "score": "0.48255134", "text": "function handle_targetlists() {\n dialog.cancel();\n open_popup(\"ProspectLists\", 600, 400, \"\", true, true, {\"call_back_function\": \"set_return_and_save_background2\", \"form_name\": \"DetailView\", \"field_to_name_array\": {\"id\": \"subpanel_id\"}, \"passthru_data\": {\"child_field\": \"delegates\", \"return_url\": \"index.php%3Fmodule%3DFP_events%26action%3DSubPanelViewer%26subpanel%3Ddelegates%26sugar_body_only%3D1\", \"link_field_name\": null, \"module_name\": \"delegates\", \"refresh_page\": 0, \"pop_up_type\": \"target_list\"}}, \"MultiSelect\", true);\n}", "title": "" }, { "docid": "39841881b014258ca5046b1e9daed9fe", "score": "0.48242283", "text": "function gotData(err, data, response){\n console.log(data);\n for(i=0;i<data.statuses.length;i++){\n \n var tweet={\n status: '#MovieNews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com'\n }\n //console.log('#Movienews '+data.statuses[i].text+ ' \\n\\nSOURCE: twitter.com');\n //This posts tweets mentioned in tweet param.\n T.post('statuses/update', tweet,tweeted);\n }\n }", "title": "" }, { "docid": "d87574adbc46a55d284cbc2efa3b8760", "score": "0.48192328", "text": "function status(statusText) {\r\n console.log(statusText);\r\n document.getElementById('status').textContent = statusText;\r\n}", "title": "" }, { "docid": "ac3619a1fa78bda6cc9514d6e45f35bc", "score": "0.48030126", "text": "function onQueryStatusSuccess( oData ) {\n\t\t if ( oData.Status == Enum.Status.Submitted) {\n\t\t \tUtil.info(\"Congratulations, you have submitted successfully!\");\n\t\t } else {\n\t\t \tUtil.info(\"Sorry, you have added to the waiting list because registration exceed maximun limitation!\");\n\t\t }\n\t\t}", "title": "" }, { "docid": "0244db06863d87d5c43944252120dc60", "score": "0.4802668", "text": "function twitterCallback2(twitters) {\r\n var statusHTML = [];\r\n for (var i=0; i<twitters.length; i++){\r\n var username = twitters[i].user.screen_name;\r\n var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function(url) {\r\n return '<a href=\"'+url+'\">'+url+'</a>';\r\n }).replace(/\\B@([_a-z0-9]+)/ig, function(reply) {\r\n return reply.charAt(0)+'<a href=\"http://twitter.com/'+reply.substring(1)+'\">'+reply.substring(1)+'</a>';\r\n });\r\n statusHTML.push('<li><span>'+status+'</span> <a href=\"http://twitter.com/'+username+'/statuses/'+twitters[i].id_str+'\">'+relative_time(twitters[i].created_at)+'</a></li>');\r\n }\r\n document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');\r\n}", "title": "" }, { "docid": "e7a82afc47725d425401f4239dbe9f2d", "score": "0.4802084", "text": "function checkStatus(elem) {\n var id = elem.batch;\n $.get('/mark_picked?id='+id, function(data) {\n $('.mark-picked'+id).html('Batch picked up!');\n console.log('Batch picked up!');\n });\n }", "title": "" }, { "docid": "4b6aabc28c7d707d0df38f1f9f4e5dfb", "score": "0.48003384", "text": "onUpdate() {}", "title": "" }, { "docid": "4b6aabc28c7d707d0df38f1f9f4e5dfb", "score": "0.48003384", "text": "onUpdate() {}", "title": "" }, { "docid": "d710798659435e429ef8116a80257345", "score": "0.47973144", "text": "function StatusUpdate( statusdata ) {\r\n//console.log( \"StatusUpdate()...\" );\r\n\r\n\tfor (var key in statusdata) {\r\n\t\tvar state = statusdata[key];\r\n//console.log( \"-\"+key+\", \"+state.name );\r\n\t\tvar node;\r\n\t\t\r\n\t\t// Create a new node if one does not already exist\r\n\t\tvar name = state.name.trim();\r\n\t\tif( !(name in Nodes) ) {\r\n//console.log( \"==New Node\" );\r\n\t\t\tnode = new Node( name, state.status, 'undefined', state.autohide );\r\n\t\t} else {\r\n\t\t\tnode = Nodes[name];\r\n\t\t}\r\n\t\t\r\n\t\t// Add this new state to the node.\r\n\t\tnode.addState( key, state );\r\n\t\t\r\n\t}\t\r\n\r\n}", "title": "" }, { "docid": "b9a60524fc3d5bd125f22fdc2231dee4", "score": "0.478681", "text": "function changeStatus(e){\n e.preventDefault;\n let index = e.target.dataset.number;\n let status = myLibrary[index].status;\n if (status == \"Read\") { status = \"Unread\";}\n else{ status = \"Read\";}\n myLibrary[index].status = status;\n render(); \n \n}", "title": "" }, { "docid": "7b047fd9b39e6a5d42e139116e08df2c", "score": "0.478671", "text": "function callback(results, status) {\n $(\"#results\").empty();\n $(\"#no-results\").html(\"\");\n $(\"#map\").empty().removeClass(\"shadow\");\n if (results.length === 0) {\n $(\"#no-results\").html(\"<h3>No results found</h3>\");\n return;\n } else {\n results.forEach(function(elem) {\n $(\"#results\").append(\"<li class='shadow'>\" +\n \"<img src='\" + (elem.photos !== undefined ? elem.photos[0].getUrl({'maxWidth': 100, 'maxHeight': 100}) : \"/images/no-img.png\") + \"'>\" +\n \"<span class='location-name'>\" + elem.name + \"</span>\" +\n \"<span class='visitors'>Visitors <span id='\" + elem.id + \"-counter'>0</span></span>\" +\n \"<button class='location-btn btn btn-default \" +\n (user ? \"'\" : \"disabled'\") +\n \"id='\" + elem.id + \"'>\" + \n (user ? \"Click to say I'm going\" : \"Please log in to vote\") + \"</button>\" +\n \"</li>\");\n \n })\n \n $(\".location-btn\").click(function(event) {\n voteButtonHandler(event);\n })\n \n initMap(results)\n updateCounters();\n\n }\n }", "title": "" }, { "docid": "f2e7d02560503686c1763e04508355bd", "score": "0.4782054", "text": "function twitterCallback2(twitters) {\r\n var statusHTML = [];\r\n for (var i=0; i<twitters.length; i++){\r\n var username = twitters[i].user.screen_name;\r\n var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function(url) {\r\n return '<a href=\"'+url+'\">'+url+'</a>';\r\n }).replace(/\\B@([_a-z0-9]+)/ig, function(reply) {\r\n return reply.charAt(0)+'<a href=\"http://twitter.com/'+reply.substring(1)+'\">'+reply.substring(1)+'</a>';\r\n });\r\n statusHTML.push('<li><span>'+status+'</span> <a style=\"font-size:85%\" href=\"http://twitter.com/'+username+'/statuses/'+twitters[i].id+'\">'+relative_time(twitters[i].created_at)+'</a></li>');\r\n }\r\n document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');\r\n}", "title": "" }, { "docid": "f9d1568a54ec586fabb3a8bc9092a80e", "score": "0.47807586", "text": "function readyResponseHandler (data, target) {\n // console.log('response')\n // console.log('==== THIS TARGET IS REEEEEAAADDDDYYY ====')\n // console.log(target)\n\n target._ready_plugin = target._ready_plugin || {}\n target._ready_plugin._is_ready = true\n\n pendingReadyRequests[data.requestID]()\n}", "title": "" }, { "docid": "1b4ea6fb1a2e4a794e248bd3169912ca", "score": "0.47803712", "text": "function vxlNotifier(){\r\n\tthis.targetList = {};\r\n\tthis.sourceList = {};\r\n \r\n}", "title": "" }, { "docid": "d5b7f88e48c3b73db1fb47e77f3f016f", "score": "0.4780324", "text": "function getStatus( data )\n{\n if (data.status == \"0\" ) { \n $(\"<span>\"+data.msg+\"</span>\").csInfo(\"cs-gradient-red\");\n \n } \n else if (data.status == \"1\" ){\n $(\"<span>\"+data.msg+\"</span>\").csInfo(\"cs-gradient-green\");\n \n } \n}", "title": "" }, { "docid": "78f02f1e78357fb2488fcc55c2a0fcb1", "score": "0.4773933", "text": "function readyResponseHandler (data, target) {\n // console.log('response')\n // console.log('==== THIS TARGET IS REEEEEAAADDDDYYY ====')\n // console.log(target)\n\n target._ready_plugin = target._ready_plugin || {};\n target._ready_plugin._is_ready = true;\n\n pendingReadyRequests[data.requestID]();\n }", "title": "" }, { "docid": "20af28cd8f019db3a16ac0c5d32e4f54", "score": "0.47736123", "text": "function optionChanged(sampleID) {\n samples.forEach(patientSample => {\n // if the id in the array matches the Id that was brought in, call bar and bubble\n if (sampleID === patientSample.id) {\n //declare empty array to store the ids and string version of ID\n var otuIDs = [];\n var otuIDstring = [];\n //change all OTU ids to strings to use in bargraph\n for (i = 0; i < patientSample.otu_ids.length; i++) {\n //put OTU in front of the ID and put to string\n var tempID = patientSample.otu_ids[i].toString();\n //push to array\n otuIDs.push(tempID);\n //push with the OTU in front to use later\n otuIDstring.push(\"OTU \" + tempID);\n }\n\n //labels\n var otuLabels = patientSample.otu_labels;\n\n //values\n var sampleValues = patientSample.sample_values;\n //call methods to update methods when the drop down changes\n makeBar(otuIDstring, sampleValues);\n makeBubble(otuIDs, otuLabels, sampleValues);\n }\n })\n\n //another version should make this into a method to be called\n //populate meta data using forEach\n sampleMetadata.forEach(patientMetaData => {\n // if id matches, call the metadatafunction\n if (sampleID === patientMetaData.id.toString()) {\n printMetadata(patientMetaData);\n // console.log(patientMetaData.wfreq);\n makeGauge(patientMetaData.wfreq);\n }\n })\n}", "title": "" }, { "docid": "4cf3f955b6b2115150b35016b7e4afde", "score": "0.47705892", "text": "@wire(getListUi, { objectApiName: '$objectApiName', listViewApiName: '$listViewName' })\n handleRecordsCallback({error, data}){\n if(data){\n this.records = data;\n }else if(error){\n //\n }\n }", "title": "" }, { "docid": "676c1af922fb570636a2bc8d4da502d7", "score": "0.47686017", "text": "function handleStatusUpdate() {\n $('#update-status').on('click', () => {\n\n // Our GET request URL will look like this:\n // /status?order=123\n $.get('/status', {order: 123}, (results) => {\n console.log(`Result from server: ${results}`);\n\n const status = results;\n $('#order-status').html(status);\n\n console.log('Callback function finished');\n });\n\n console.log('GET request sent to server');\n });\n}", "title": "" }, { "docid": "f11d710e6351fbad22aa67d3f042f4cc", "score": "0.47685692", "text": "function update_data(callback) {\n \n callback();\n }", "title": "" }, { "docid": "5eeba9c18775ca0c52342aa915a4b967", "score": "0.47667414", "text": "function listChange() {\n\n\t$('div#existSourceSlideCont div#existSourceList div').each(function(obj) {\n\t\t\n\t\t//the mouse on/mouse out events\n\t\t$(this).hover(\n\t\t\tfunction() {\n\t\t\t\t$(this).attr('class','selected');\n\t\t\t\tthis.style.cursor = \"pointer\";\n\t\t\t},\n\t\t\tfunction() {\n\t\t\t\t$(this).attr('class','notselected');\n\t\t\t}\n\t\t);\n\t\t$(this).click(function() {\n\t\t setExistingCitation(this);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "469ec974a683d3158eb674fed38bcb63", "score": "0.4765282", "text": "newStatusCallback(data) {\n // Get the object\n const status = data.data;\n\n // Get the status information\n axios.get(\"/api/users/\" + status.user)\n .then(userData => {\n const userObj = userData.data.data;\n status.userData = userObj;\n status.isNew = true;\n\n // Update state to contain the new status\n this.setState({\n statuses: [\n status,\n ...this.state.statuses,\n ],\n });\n })\n .catch(err => {\n this.setState({\n error: err,\n });\n });\n }", "title": "" }, { "docid": "393f782726404040bd4ef2e600716efc", "score": "0.47600505", "text": "_onchangeStatus(id,e){\n let complete = e.target.checked ? 1 : 0;\n\n let task = {complete:complete,id:id}\n this.props.changeStatusTask(task)\n }", "title": "" }, { "docid": "36ec9b8c8c69ce5d8bfd0b2b5748d42a", "score": "0.47511035", "text": "setColorAndTitle(status){\n switch(status){\n case 0:\n this.color = '#afafaf';\n this.title = 'Need to send to drop point';\n break\n case 1:\n this.color = '#ffaf30';\n this.title = 'Active';\n break\n case 2:\n this.color = '#81d129';\n this.title = 'Completed';\n break\n }\n }", "title": "" }, { "docid": "a8e2c5554091c746e691487f9fe608a4", "score": "0.475056", "text": "function myFunction(e) {\n\n \n console.log(e.sourceTarget.feature.properties.NAME);\n addState(e.sourceTarget.feature.properties.NAME)\n DrawPieChart(e.sourceTarget.feature.properties.NAME);\n DrawLineChart(e.sourceTarget.feature.properties.NAME);\n }", "title": "" }, { "docid": "1387d3b4ac093233f86e689fdedf64de", "score": "0.47357512", "text": "function updateStatus() {\n\n csInterface.evalScript(\"getStatus()\", \n function(returned) {\n\n if (returned === 'open') {\n isOpen = true;\n } else if (returned === 'triggered') {\n isTriggered = true;\n } else if (returned === 'closed') {\n isOpen = false;\n isTriggered = false;\n }\n });\n}", "title": "" }, { "docid": "843693765d2a9d54f7961935a88f78b9", "score": "0.47292015", "text": "_doOnData(data) {\n\t\tthis.options.onData(data);\n\n\t\tfor (var i = this.callbacks.onData.length - 1; i >= 0; i--) {\n\t\t\tthis.callbacks.onData[i](data);\n\t\t}\n\t}", "title": "" }, { "docid": "14fc94b76f2c6a305257a120ab8c8027", "score": "0.47281864", "text": "totalTask(target01,target02,target03){\n \n setInterval(()=>{\n let done = 0;\n target01.innerHTML = `<h2><i class=\"fas fa-clipboard-check\" aria-hidden=\"true\"></i> :${ids.length}</h2>`;\n \n let status = $$('.status')\n \n status.forEach(element => {\n [...element.classList].includes(\"btn-success\") && done++;\n });\n \n let progressP = parseFloat(((done/ids.length)*100).toFixed(1));\n \n target02.style = `width:${progressP}%`\n \n target03.innerHTML = `${progressP || 0}%`; \n \n \n\n },500);\n\n }", "title": "" } ]
a2fbdc140ac79fd93160a89f63e5d199
Function that is called when the document is ready.
[ { "docid": "521e92a09fc83683f65ee6da3b947ed1", "score": "0.0", "text": "function initializePage() {\n\t//Set listeners\n\tsetTimeout(function() {\n\t\t$('#exit').css('visibility','visible');\n\t},60000);\n\t$(\".choice\").click(checkAnswer);\n\t$(\"#snooze\").click(snoozeSong);\n\t//Get the first question\n\t$.get('/json/puzzles/' + $('#clockName').text(),loadQuestion);\n\n\t//Set audio\n\tvar audio = $(\"#musicPlayer\").get(0);\n\taudio.src = \"\";\n\taudio.src = \"/music/\" + $(\"#musicPlayer\").html();\n\n\taudio.load();\n\n\taudio.play().catch(function() {\n\t\t\n\t});\n\n\n\n}", "title": "" } ]
[ { "docid": "d127cb6153443c6ed0ee67b80ba6a698", "score": "0.80834174", "text": "function ready() {\n}", "title": "" }, { "docid": "9eaf3a57284711f3a9c2ba61ab9bd0ba", "score": "0.785708", "text": "function ready(){\n\n}", "title": "" }, { "docid": "9073455f58442c39bb90f21169b2acf7", "score": "0.78350055", "text": "function qodeOnDocumentReady() {\n\n\t}", "title": "" }, { "docid": "d434fabc1f5cb3c6618bcbc181ed4f9e", "score": "0.77356577", "text": "function documentReady(){\n\n}", "title": "" }, { "docid": "2c51ce89e146f7452fdac57ac550bf53", "score": "0.75174606", "text": "function mkdfOnDocumentReady() {\n mkdfInitAjax();\n }", "title": "" }, { "docid": "0d4f9c06521f749990fe22b29cb2f595", "score": "0.74887055", "text": "function mkdfOnDocumentReady() {\n mkdfHeaderBehaviour();\n mkdfSideArea();\n mkdfSideAreaScroll();\n mkdfFullscreenMenu();\n mkdfInitMobileNavigation();\n mkdfMobileHeaderBehavior();\n mkdfSetDropDownMenuPosition();\n mkdfDropDownMenu();\n mkdfSearch();\n mkdfVerticalMenu().init();\n }", "title": "" }, { "docid": "479a8e3a9c9945fc3d6cf3459a81c55e", "score": "0.74565023", "text": "function edgtfOnDocumentReady() {\n edgtfDashboardInitDatePicker();\n edgtfDashboardUploadImages();\n edgtfDashboardInitGeocomplete();\n edgtfDashboardRemoveMedia();\n edgtfDashboardSelect2();\n edgtfInitColorpicker();\n //edgtfDashboardRepeater();\n edgtfInitIconSelectChange();\n \t edgtfDashboardRepeater.rowRepeater.init();\n \t edgtfDashboardRepeater.rowInnerRepeater.init();\n\t edgtfDashboardInitSortable();\n }", "title": "" }, { "docid": "47e2c95fdf7daa68efc5a09ef40d5aab", "score": "0.74251586", "text": "function run_user_scripts_on_document_ready() {}", "title": "" }, { "docid": "50165912967183097129bb96f74eadac", "score": "0.7411948", "text": "function mkdfOnDocumentReady() {\n mkdfInitQuantityButtons();\n mkdfInitSelect2();\n }", "title": "" }, { "docid": "558c31d4c0c490e324c1af89f243280d", "score": "0.73744744", "text": "function pageReady() {\n legacySupport();\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initLazyLoad();\n initFormElements();\n initFixers();\n }", "title": "" }, { "docid": "4bfde0e36f9d309276baae84c64142bc", "score": "0.73322314", "text": "function mkdfOnDocumentReady() {\n mkdfInitQuantityButtons();\n mkdfInitSelect2();\n\t mkdfInitSingleProductLightbox();\n\t mkdfInitProductExhibition();\n }", "title": "" }, { "docid": "52f60574a23de48d6d0fad4e96d71892", "score": "0.7323792", "text": "function pageReady() {\n initMasks();\n initSelectric();\n initValidations();\n initSlider();\n initPopup();\n }", "title": "" }, { "docid": "c00a6eb878ca6ff8fb76eda6bd42b4a2", "score": "0.7290533", "text": "function onDocumentReady() {\n\tloadGuestbookEntries();\n\tconnectReloadButton();\n\tconnectEntryButton();\n}", "title": "" }, { "docid": "c00a6eb878ca6ff8fb76eda6bd42b4a2", "score": "0.7290533", "text": "function onDocumentReady() {\n\tloadGuestbookEntries();\n\tconnectReloadButton();\n\tconnectEntryButton();\n}", "title": "" }, { "docid": "295fccdb08c39b1b256e1c3ae062f0c0", "score": "0.7251472", "text": "onPageReady () {}", "title": "" }, { "docid": "3365426915689f69baf924a316d97f40", "score": "0.72452027", "text": "function qodefOnDocumentReady() {\n\t qodefInitAlbumReviews();\n qodefInitArtists();\n }", "title": "" }, { "docid": "758f3975927d287dc2278b738044edfb", "score": "0.72415197", "text": "function domReady(){\n setupFaqHandlers()\n setupFaqContent()\n }", "title": "" }, { "docid": "6e066b5d73ea4baad1e7a04bb590aee7", "score": "0.72255296", "text": "docReady() {\n this.cache();\n this.events();\n }", "title": "" }, { "docid": "0f0932d60e2cc9457ac8cf868ef2eaa4", "score": "0.721524", "text": "function qodefOnDocumentReady() {\n qodefCompareHolder();\n qodefCompareHolderScroll();\n qodefHandleAddToCompare();\n }", "title": "" }, { "docid": "cf62a497067c34098e5e5d2ed3b1f78c", "score": "0.7208918", "text": "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "title": "" }, { "docid": "cf62a497067c34098e5e5d2ed3b1f78c", "score": "0.7208918", "text": "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "title": "" }, { "docid": "ab5c79f5da88a4d6e7df04c0fef3a570", "score": "0.7196239", "text": "function readyNow() {\n console.log('document loaded');\n addClickHandlers();\n updateHistory();\n}", "title": "" }, { "docid": "82788a4ea7899f1fba7e94961710ae7a", "score": "0.7147251", "text": "function ready() \n\t{\n\t\t// log( _cn + \"ready\" );\n\n\t\t// Set start time\n\t\t// timer.start = Date.now();\n\t\t// requestRender = true;\n\t\t// animate();\n\n\t\t// Add event listeners\n\t\telement.on( \"mousemove\", handleMouseMove );\n\t\twindow.addEventListener( \"resize\", updateLayout );\n\t}", "title": "" }, { "docid": "79555262ac09e7233dbf6211d8b2b13b", "score": "0.7140304", "text": "function documentReadyFunction() {\r\n $(document).ready(function () {\r\n populateTable(data);\r\n });\r\n}", "title": "" }, { "docid": "98ef90ef795c48c60bd2bae88b88be39", "score": "0.7131061", "text": "onReady(f) {\n window.onload = f;\n }", "title": "" }, { "docid": "0030c72c459f7b3a24b25df1d6471ae0", "score": "0.71307683", "text": "function onInit(){\r\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\r\n }", "title": "" }, { "docid": "edcff3b11b8012477f7e3d6ae3bb06a5", "score": "0.7125792", "text": "function pageReady() {\n initSelectric();\n }", "title": "" }, { "docid": "3f0c4d962bcc33bb444f6546a634ba79", "score": "0.71049094", "text": "function pageReady(){\n legacySupport();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n // initScrollMonitor();\n initMasks();\n // initLazyLoad();\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n\n }", "title": "" }, { "docid": "e46bddee99748fc2e19aae2a2c14e2ae", "score": "0.70942354", "text": "function qodefOnDocumentReady() {\n\t qodefParallaxTitle();\n }", "title": "" }, { "docid": "72f752dc35d7361bc4e6b9d9951d3d1d", "score": "0.70892894", "text": "function qodefOnDocumentReady() {\n qodefInitMobileNavigation();\n qodefInitMobileNavigationScroll();\n qodefMobileHeaderBehavior();\n }", "title": "" }, { "docid": "fbfef9ef2f351b770534cd8ee82f89a3", "score": "0.70551074", "text": "function qodeOnWindowLoad() {\n qodeInitElementorMasonryBlog();\n }", "title": "" }, { "docid": "0d10f96fb0cf23ab085e9dc8fab75c64", "score": "0.70424926", "text": "function pageReady(){\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initTeleport();\n\n revealFooter();\n _window.on('resize', throttle(revealFooter, 100));\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "fc4d7a2d34c166dd5c01e6f8059d0122", "score": "0.70405424", "text": "function mkdfOnDocumentReady() {\n\t\tportfolio.mkdfPortfolioSlider();\n\t}", "title": "" }, { "docid": "947c742863145c910d97a25f9d5b6c28", "score": "0.7025026", "text": "function edgtfOnDocumentReady() {\n edgtfInitPortfolioSlider();\n }", "title": "" }, { "docid": "a275a79599aa50a940c4863c411ebcf8", "score": "0.7015631", "text": "function ready(fn) {\n if (document.readyState != 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "title": "" }, { "docid": "8faf57581357418b1b1ce10fb88295a7", "score": "0.7012643", "text": "function edgtOnDocumentReady() {\n edgtLikes();\n }", "title": "" }, { "docid": "a6607b8288a1805134e57d740b517611", "score": "0.70058674", "text": "function ready(fn) {\n if (document.readyState != \"loading\") {\n fn();\n } else {\n document.addEventListener(\"DOMContentLoaded\", fn);\n }\n }", "title": "" }, { "docid": "543e986679bdeaae544d3038c7e21851", "score": "0.69988966", "text": "function pageReady(){\n legacySupport();\n // updateHeaderActiveClass();\n // initHeaderScroll();\n\n initPopups();\n initSliders();\n // initScrollMonitor();\n initMasks();\n initSelectric();\n initValidations();\n\n // development helper\n // _window.on('resize', function() {\n // \tdebounce(setBreakpoint, 200);\n // });\n\n // AVAILABLE in _components folder\n // copy paste in main.js and initialize here\n // initPerfectScrollbar();\n // initLazyLoad();\n // initTeleport();\n // parseSvg();\n // revealFooter();\n // _window.on('resize', throttle(revealFooter, 100));\n }", "title": "" }, { "docid": "3dcdbe87b86c481bb47797e58de23b47", "score": "0.698689", "text": "function mkdfOnDocumentReady() {\n\t\tmkdfInitCounter();\n\t\tmkdfInitProgressBars();\n\t\tmkdfInitCountdown();\n\t\tmkdfIcon().init();\n\t\tmkdfInitMessages();\n\t\tmkdfInitMessageHeight();\n\t\tmkdfInitTestimonials();\n\t\tmkdfInitCarousels();\n\t\tmkdfInitImageCarousel();\n\t\tmkdfInitPieChart();\n\t\tmkdfInitPieChartDoughnut();\n\t\tmkdfInitTabs();\n\t\tmkdfInitTabIcons();\n\t\tmkdfButton().init();\n\t\tmkdfCustomFontResize();\n\t\tmkdfInitImageGallery();\n\t\tmkdfBlogSlider();\n\t\tmkdfInitAccordions();\n\t\tmkdfShowGoogleMap();\n\t\tmkdfInitPortfolioListMasonry();\n\t\tmkdfInitPortfolioListPinterest();\n\t\tmkdfInitPortfolio();\n\t\tmkdfInitPortfolioMasonryFilter();\n\t\tmkdfInitPortfolioLoadMore();\n\t\tmkdfSlider().init();\n\t\tmkdfSocialIconWidget().init();\n\t\tmkdfProcess().init();\n\t\tmkdfIconWithText();\n\t\tmkdfComparisonPricingTables().init();\n\t\tmkdfProgressBarVertical().init();\n\t\tmkdfIconProgressBar().init();\n\t\temptySpaceResponsive().init();\n\t\tblogCarousel();\n\t\tzoomingSlider();\n\t\tteamSlider();\n\t\tinfoCardSlider();\n\t\thorizontalTimeline().init();\n\t\tsocialFeedCarousel().init();\n\t}", "title": "" }, { "docid": "abd9e216696d9c81029b810dbdbf2834", "score": "0.69809204", "text": "function ready(callback){\n if (document.readyState === \"complete\"){\n callback();\n } else {\n document.addEventListener('DOMContentLoaded', function (){\n\tcallback();\n });\n }\n }", "title": "" }, { "docid": "e0677e0dd53df7e4647e757dd11271ca", "score": "0.69795775", "text": "function qodeOnDocumentReady() {\n\t\tqodeInitPortfolioInteractiveItemShowcase();\n\t\tqodeInitPortfolioInteractiveLinkShowcase();\n\t\tqodeOutlineTextAnimation();\n\t}", "title": "" }, { "docid": "5c3d5e3ed6b4fa5f1cdaa4dc6b287a90", "score": "0.6978038", "text": "function ready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "title": "" }, { "docid": "5c3d5e3ed6b4fa5f1cdaa4dc6b287a90", "score": "0.6978038", "text": "function ready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "title": "" }, { "docid": "e7e98f100144afa87ff8a340888df9c6", "score": "0.6966894", "text": "function pageReady(){\n legacySupport();\n updateHeaderActiveClass();\n initHeaderScroll();\n // benefitsTabFix();\n defaultQuery();\n loadCards();\n\n initSelectric();\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initLazyLoad();\n initPerfectScrollbar();\n initRangeSlider();\n initAutocompleate();\n initSticky();\n initTeleport();\n initValidations();\n initMaps();\n\n hookPrint();\n parseQueryToVal();\n\n positionScrollTop();\n _window.on('resize', debounce(positionScrollTop, 250));\n _window.on('scroll', throttle(showScrollTop, 50));\n\n controlTabsMobileClass();\n _window.on('resize', debounce(controlTabsMobileClass, 250));\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "b8a2a829214a4f242c17bc778587821b", "score": "0.69490254", "text": "function initialize () {\n\t\t\t$( window ).on( 'load scroll resize', updateHandler );\n\t\t\t_this.updated();\n\t\t}", "title": "" }, { "docid": "717c92b02bffefa7c23bb2d1e835a3b4", "score": "0.6945587", "text": "function mkdfOnDocumentReady() {\n mkdfTouchDeviceBodyClass();\n mkdfDisableSmoothScrollForMac();\n mkdfFluidVideo();\n mkdfPreloadBackgrounds();\n mkdfPrettyPhoto();\n mkdfInitElementsAnimations();\n mkdfInitAnchor().init();\n mkdfInitVideoBackground();\n mkdfInitVideoBackgroundSize();\n mkdfSetContentBottomMargin();\n //mkdfSmoothScroll();\n mkdfOwlSlider();\n mkdfInitSelfHostedVideoPlayer();\n mkdfSelfHostedVideoSize();\n mkdfInitBackToTop();\n mkdfBackButtonShowHide();\n mkdfInitCustomMenuDropdown();\n }", "title": "" }, { "docid": "6ca365a2d80bfd92c694d9f4fa0ecafe", "score": "0.6923371", "text": "function edgtfOnDocumentReady() {\n\t\tedgtfIcon().init();\n\t}", "title": "" }, { "docid": "62807aa9ed2077972e1a167352fa777c", "score": "0.6914417", "text": "function ready(fn) {\r\n if (document.readyState != 'loading') {\r\n fn()\r\n } else {\r\n document.addEventListener('DOMContentLoaded', fn)\r\n }\r\n }", "title": "" }, { "docid": "e89b4886ded4eb6efe2d53f54295cd5f", "score": "0.69105214", "text": "function onready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "title": "" }, { "docid": "1bfd31a2abf5ae5afb8df7f61f4dabcb", "score": "0.69101125", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "d48182e8c1bc6a78371d14ba8a70a223", "score": "0.6909274", "text": "function sectionSearchDocumentReady() {\n $('._which_item_to_search_switch[checked]').first().attr('checked', 'checked');\n $('._order_lessons_radio_input[checked]').first().attr('checked', 'checked');\n $('._order_media_elements_radio_input[checked]').first().attr('checked', 'checked');\n $('#filter_search_lessons option[selected]').first().attr('selected', 'selected');\n $('#filter_search_media_elements option[selected]').first().attr('selected', 'selected');\n $('#filter_search_lessons_subject option[selected]').first().attr('selected', 'selected');\n $('#filter_search_lessons_school_level option[selected]').first().attr('selected', 'selected');\n $('#filter_search_lessons').selectbox();\n $('#filter_search_media_elements').selectbox();\n $('#filter_search_lessons_subject').selectbox();\n $('#filter_search_lessons_school_level').selectbox();\n initSearchTagsAutocomplete('#lessons_tag_reader_for_search', 'lesson');\n initSearchTagsAutocomplete('#media_elements_tag_reader_for_search', 'media_element');\n}", "title": "" }, { "docid": "271f3d673568c5dfc9e824d27856d96f", "score": "0.6894412", "text": "function domReady() {\n self._initBindings();\n self._displayAlert();\n }", "title": "" }, { "docid": "49524233552a7d6e92048c5f56cd3639", "score": "0.6889513", "text": "function ready(callback) {\n // in case the document is already rendered\n if (document.readyState !== 'loading') callback();\n // modern browsers\n else if (document.addEventListener) document.addEventListener('DOMContentLoaded', callback);\n // IE <= 8\n else document.attachEvent('onreadystatechange', function () {\n if (document.readyState === 'complete') callback();\n });\n}", "title": "" }, { "docid": "f5c5bbf72c738808a7df55a7edac4652", "score": "0.6877371", "text": "function qodefOnDocumentReady() {\n\t qodefInitDividedHeaderMenu();\n }", "title": "" }, { "docid": "b3153deee6d605d9d05601914031d044", "score": "0.6874643", "text": "function qodeOnWindowLoad() {\n qodeInitElementorMasonryGallery();\n }", "title": "" }, { "docid": "67fb362e6135482216e26f3c1394bf3e", "score": "0.68715614", "text": "function onready(fn)\n{\n if (document.readyState === \"complete\")\n setTimeout(fn,1);\n else\n document.addEventListener(\"DOMContentLoaded\", fn, false);\n}", "title": "" }, { "docid": "2ffe2260a08ce8d1df1dd2fc1c2e540d", "score": "0.68395436", "text": "function onReady() {\n console.log('in onReady');\n $(document).on('click', '#addVote', addVote);\n getSnacks();\n snackVotingDisplay();\n selectionHeader();\n trackCount();\n} // end onReady", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6834976", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6834976", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6834976", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6834976", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6834976", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d5a818163c69e6941ad44ff21a808bba", "score": "0.6834053", "text": "function init_ready(event)\n{}", "title": "" }, { "docid": "258f16216474183a1e0ea03663e2729b", "score": "0.6829436", "text": "function readyHandler() {\r\n\t\t\tif (!event_utils.domLoaded) {\r\n\t\t\t\tevent_utils.domLoaded = true;\r\n\t\t\t\tcallback(event);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "258f16216474183a1e0ea03663e2729b", "score": "0.6829436", "text": "function readyHandler() {\r\n\t\t\tif (!event_utils.domLoaded) {\r\n\t\t\t\tevent_utils.domLoaded = true;\r\n\t\t\t\tcallback(event);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "f8454784df791f7fa213dfbafb0477d2", "score": "0.67753506", "text": "function onDocumentReady()\n\t{\n\t\t// Add classes to <html> for browser/versions\n\t\tvar isIE = (navigator.userAgent.toLowerCase().indexOf(\"msie\") > -1);\n\t\tif (isIE)\n\t\t\t$(\"html\").addClass(\"ie\");\n\n\n\t\t// Start app by creating MainView\n\t\tmainView = new MainView();\n\n\t\t// Resize init\n\t\tonWindowResize();\n\t\t$(window).resize(onWindowResize);\n\t}", "title": "" }, { "docid": "856db91b3e911b7ae5dd245fe2f84331", "score": "0.6768819", "text": "ready(fn) {\n if (document.attachEvent ? document.readyState === \"complete\" : document.readyState !== \"loading\"){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n return true;\n }", "title": "" }, { "docid": "2bf3dcabd819eeef83c28f07808b0900", "score": "0.67506397", "text": "function edgtfOnDocumentReady() {\n edgtfIsTouchDevice();\n edgtfDisableSmoothScrollForMac();\n edgtfFluidVideo();\n edgtfPreloadBackgrounds();\n edgtfPrettyPhoto();\n\t edgtfInitAnchor().init();\n edgtfInitVideoBackground();\n edgtfInitVideoBackgroundSize();\n edgtfSetContentBottomMargin();\n //edgtfSmoothScroll();\n //edgtfOwlSlider();\n\t\tedgtfSlickSlider();\n edgtfInitSelfHostedVideoPlayer();\n edgtfSelfHostedVideoSize();\n edgtfInitBackToTop();\n edgtfBackButtonShowHide();\n }", "title": "" }, { "docid": "33ac0e87ca6aad1d017152fa7aaccbc6", "score": "0.6748192", "text": "function mkdfOnDocumentReady() {\n mkdfParallaxTitle();\n }", "title": "" }, { "docid": "9c81a209cbdbeb379156a209e676be50", "score": "0.6747004", "text": "function readyFn( jQuery ) {\n //Code to run when the document is ready.\n\n //init cookie hint\n initCookieHint();\n\n //set time\n setClock();\n setInterval(setClock,1000);\n\n //set date\n setDate();\n setInterval(setDate,1000);\n\n //set dark mode\n customDarkMode();\n\n //auto reload feeds\n (function(){\n updateAllFeeds();\n setTimeout(arguments.callee, 60*60*1000);\n })();\n}", "title": "" }, { "docid": "a5c485379ee917157bf91dbeb32b198c", "score": "0.6743958", "text": "onready() {}", "title": "" }, { "docid": "87714147e4110f5a90762147eacefe0f", "score": "0.6741842", "text": "function initializePage() {\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n\n }", "title": "" }, { "docid": "c639c16dc6dd318a65023052ba5add51", "score": "0.67322886", "text": "function ready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}", "title": "" }, { "docid": "eed13d935d36714b034204577b3661a1", "score": "0.6714191", "text": "_onReady() {\n this._ready = true;\n }", "title": "" }, { "docid": "07fd64f2d7a3ac3dc3abcf4075cda0f1", "score": "0.6711532", "text": "function domReady () {\r\n\t\t\t// Make sure that the DOM is not already loaded\r\n\t\t\tif( !isReady ) {\r\n\t\t\t\t// Remember that the DOM is ready\r\n\t\t\t\tisReady = true;\r\n\t\t\t\r\n\t\t\t\tif( readyList ) {\r\n\t\t\t\t\tfor( var fn = 0; fn < readyList.length; fn++ ) {\r\n\t\t\t\t\t\treadyList[fn].call ( window, [] );\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treadyList = [];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "6e464e282ff7101ca3afd9ca524565fb", "score": "0.6708251", "text": "function qodeOnDocumentReady() {\n\t\tqodeInitBlogCatReact();\n\t}", "title": "" }, { "docid": "fa2f6feb253580ec63b1d872e46deeb4", "score": "0.6687538", "text": "function ready(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n document.addEventListener('DOMContentLoaded', callback);\n }\n}", "title": "" }, { "docid": "e33c94a8182a29b16d4f485ec4a7fc90", "score": "0.6684935", "text": "function onLoadComplete(){\n ready = true;\n \n}", "title": "" }, { "docid": "03c4a5939bbefd62f16c31e221719a98", "score": "0.66844803", "text": "function qodeOnWindowLoad() {\n qodeInitElementorCardsGallery();\n }", "title": "" }, { "docid": "7e8856bff606ac1e59a75c8c77694b6c", "score": "0.66793823", "text": "function mkdfOnWindowLoad() {\n\t\tsocialFeedMasonry().init();\n\t}", "title": "" }, { "docid": "0398ccb3d9eaa17a0f11933eb2b1956e", "score": "0.6673784", "text": "function onDomReady() {\n console.log('DOM loaded');\n initUI();\n // assuming the initAddLiveLogging is exposed\n // via ADLT namespace. (check shared-assets/scripts.js)\n ADLT.initAddLiveLogging();\n // Initializes the AddLive SDK.\n initializeAddLive();\n }", "title": "" }, { "docid": "0933a43490344f45be9542add98dc895", "score": "0.66686994", "text": "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "title": "" }, { "docid": "63273e87939816dd9b743bcc5d3ab859", "score": "0.66588014", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "title": "" }, { "docid": "33ff8bca76df0a16ada31bfc27c3af12", "score": "0.6655541", "text": "function onLoad() {\r\n }", "title": "" }, { "docid": "20834015f208eb3a9e41b31a1e7288b0", "score": "0.6654217", "text": "onReady() {\n\n }", "title": "" }, { "docid": "1c3006655382aace57bd1c3d178766c8", "score": "0.6640117", "text": "function docReady(fn) {\n if (document.readyState === \"complete\" || document.readyState === \"interactive\") {\n setTimeout(fn, 1);\n } else {\n document.addEventListener(\"DOMContentLoaded\", fn);\n }\n }", "title": "" }, { "docid": "5696fbf31786764cb89102fea2874159", "score": "0.6636481", "text": "function ready(fn) {\n\tif (document.readyState !== 'loading'){\n\t\tfn();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', fn);\n\t}\n}", "title": "" }, { "docid": "72f50bf4fb3e1279663a24e8fa65a2a6", "score": "0.662097", "text": "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "title": "" }, { "docid": "3ef5733c4ea78880c4a134fe97d3c930", "score": "0.6593928", "text": "function onReady() {\n\n\t\t//console.debug( '===== READY =====' );\n\n\t\tready = true;\n\t\tinitModules();\n\t}", "title": "" }, { "docid": "9ba3c7be32227c3fe0bfc816e055e1c6", "score": "0.65861666", "text": "function mkdfOnDocumentReady() {\n mkdfInitUncoveringSections();\n }", "title": "" }, { "docid": "39fb0311da53d55a3c7f5f49002c54e3", "score": "0.6582789", "text": "function ready(fn) {\n if (typeof fn !== 'function') {\n return;\n }\n if (document.readyState === 'complete') {\n return fn();\n }\n document.addEventListener('DOMContentLoaded', fn, false);\n }", "title": "" }, { "docid": "3d49e98cebc870cce0e4b339ef7076ac", "score": "0.6582474", "text": "init() {\n window.Squarespace.AFTER_BODY_LOADED = false;\n window.Squarespace.afterBodyLoad();\n }", "title": "" }, { "docid": "88f69c7332e5cefb3ff625ca4ed850fb", "score": "0.65805024", "text": "function qodeOnWindowLoad() {\n qodeInitElementorInDeviceSlider();\n }", "title": "" }, { "docid": "dca950ac43b73b388df3a3fd863513c1", "score": "0.6568823", "text": "function onDocumentReady() {\n getPicture();\n watchForm();\n}", "title": "" }, { "docid": "4b0de7de8efab59f5a8ef12553e67437", "score": "0.6559807", "text": "function ready() {\r\n if (!readyFired) {\r\n // this must be set to true before we start calling callbacks\r\n readyFired = true;\r\n for (var i = 0; i < readyList.length; i++) {\r\n // if a callback here happens to add new ready handlers,\r\n // the docReady() function will see that it already fired\r\n // and will schedule the callback to run right after\r\n // this event loop finishes so all handlers will still execute\r\n // in order and no new ones will be added to the readyList\r\n // while we are processing the list\r\n readyList[i].fn.call(window, readyList[i].ctx);\r\n }\r\n // allow any closures held by these functions to free\r\n readyList = [];\r\n }\r\n }", "title": "" }, { "docid": "ef5c467fc3af5de5f01e8884f6dd82be", "score": "0.6548641", "text": "function readyJquery() {\n // bind all the events we need for example\n bindEvents();\n // bind all effects we need for example\n bindEffects();\n bindCSS();\n bindHTML();\n bindMISC();\n}", "title": "" }, { "docid": "70f0471ddcbddd4bd50ea1b23f5d78de", "score": "0.65482384", "text": "onReady() {\n }", "title": "" }, { "docid": "3c7bbef398294e57a3624688a46eab80", "score": "0.65449643", "text": "function readyFunction () {\n console.log('DOMContentLoaded'); // aviso la carga\n ajaxPetition(); // ejecuto la peticion de AJAX\n}", "title": "" }, { "docid": "d22c414932951931d7ab6775814ccd02", "score": "0.6542341", "text": "function DocumentInit(){\r\n InitConsole()\r\n ModernBrowserCheck();\r\n console.debug(\"document.ready init completed\"); \r\n}", "title": "" }, { "docid": "075f5ea1d84879445a9a9c68503fff16", "score": "0.65365416", "text": "function ready(fn) {\r\n\tif (document.attachEvent ? document.readyState === \"complete\" : document.readyState !== \"loading\"){\r\n\t\tfn();\r\n\t} else {\r\n\t\tdocument.addEventListener('DOMContentLoaded', fn);\r\n\t}\r\n}", "title": "" }, { "docid": "ae0f0d5edb8e858af2a20589a4eef2fa", "score": "0.653008", "text": "function documentreadyFunction(){\n init(setMessage);\n testMessage();\n }", "title": "" } ]
dfe8aa2972a36d6634bf2c4833aebaf3
onMove is the callback that will be called on every mouse move. onMoveEnd is called on mouse up when movement has ended.
[ { "docid": "893aa1e7a0660a92d66e560b6926d73a", "score": "0.0", "text": "function DOMMouseMoveTracker(\n /*function*/onMove,\n /*function*/onMoveEnd,\n /*DOMElement*/domNode,\n /*boolean*/touchEnabled) {\n _classCallCheck(this, DOMMouseMoveTracker);\n\n this._isDragging = false;\n this._isTouchEnabled = touchEnabled;\n this._animationFrameID = null;\n this._domNode = domNode;\n this._onMove = onMove;\n this._onMoveEnd = onMoveEnd;\n this._onMouseEnd = this._onMouseEnd.bind(this);\n this._onMouseMove = this._onMouseMove.bind(this);\n this._onMouseUp = this._onMouseUp.bind(this);\n this._didMouseMove = this._didMouseMove.bind(this);\n }", "title": "" } ]
[ { "docid": "df198bdbbc15486ebd4bee8df4f86709", "score": "0.6611532", "text": "onMouseMove(event) {\n this.internalMove(event);\n }", "title": "" }, { "docid": "26f48d99c1e65a89a50e5a4166d0805b", "score": "0.65980834", "text": "updateMouseMoveEvents() {\r\n this.updateEventsContainer('mouse-move');\r\n }", "title": "" }, { "docid": "689a917b105c188d1a05904db6838084", "score": "0.6597709", "text": "function trackDrag(onMove, onEnd) {\n function end(event) {\n removeEventListener(\"mousemove\", onMove);\n removeEventListener(\"mouseup\", end);\n if (onEnd)\n onEnd(event);\n }\n addEventListener(\"mousemove\", onMove);\n addEventListener(\"mouseup\", end);\n}", "title": "" }, { "docid": "689a917b105c188d1a05904db6838084", "score": "0.6597709", "text": "function trackDrag(onMove, onEnd) {\n function end(event) {\n removeEventListener(\"mousemove\", onMove);\n removeEventListener(\"mouseup\", end);\n if (onEnd)\n onEnd(event);\n }\n addEventListener(\"mousemove\", onMove);\n addEventListener(\"mouseup\", end);\n}", "title": "" }, { "docid": "527bd3e7cd8c969d5e6872c338fbcab1", "score": "0.6578505", "text": "onMove(callback) {\n this.onMoveArr[this.onMoveArr.length] = callback;\n }", "title": "" }, { "docid": "4811d97f8b1aaf248e88893c4f024944", "score": "0.6531448", "text": "onMouseMove(event) {\n this.internalMove(false, event);\n }", "title": "" }, { "docid": "eabd7e5a93b3b37f37d071e584f0f46e", "score": "0.6433871", "text": "function onMouseMove(event) {\r\n dragHandle.x = event.clientX - offset.x;\r\n dragHandle.y = event.clientY - offset.y;\r\n drawAndUpointDestinationAteFunction();\r\n }", "title": "" }, { "docid": "e3f413ff4aa2f9e0c3af0262a8e2e16a", "score": "0.6389667", "text": "function mouseMoveHandler(e) {\n\n // Chequeamos cuando fue el lastEmit para no emitir mensajes de mas\n if ($.now() - lastEmit > 20) {\n var movement = {\n 'x': e.pageX,\n 'y': e.pageY,\n 'id': id\n }\n socket.emit(\"mousemove\", movement);\n lastEmit = $.now();\n }\n\n }", "title": "" }, { "docid": "c4cdfe8129f1f792fd2c190869bbc751", "score": "0.6375151", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 100;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n\n if (closest) {\n tooltip.html(tooltipMarkup(closest.data.data, state)).style('left', mx + opt.tooltip.offset[0] + 'px').style('top', my + opt.tooltip.offset[1] + 'px').style('opacity', 1);\n\n drawCanvas$1(frontContext, res, opt, false);\n highlightNode(frontContext, opt, closest.data, closest[0], closest[1]);\n } else {\n tooltip.transition().duration(opt.animation.duration.tooltip).style('opacity', 0);\n\n drawCanvas$1(frontContext, res, opt, false);\n }\n }", "title": "" }, { "docid": "3a8fa37f44d064a261c4a85238edac4d", "score": "0.6348201", "text": "onMouseMove([xCoordinate, yCoordinate], event) {}", "title": "" }, { "docid": "79aa0b137ec39ceefdf78a08d5e69af7", "score": "0.63204426", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 100;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n\n if (closest) {\n tooltip.html(tooltipMarkup(closest.data.data, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n\n drawCanvas$2(_frontContext, finalState);\n highlightNode$1(_frontContext, closest.data);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n\n drawCanvas$2(_frontContext, finalState);\n }\n }", "title": "" }, { "docid": "262f0a2f124ca775a22c06be57265701", "score": "0.6303545", "text": "mouseMoveHandler(event) {\n const { clientX, clientY } = event;\n this.commonDrawMoveHandler(clientX, clientY);\n }", "title": "" }, { "docid": "ae092b2ae099aa12c127fe797b67ca48", "score": "0.6263189", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 100;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n if (closest) {\n closest.data.data[getMetric(state).accessor] = closest.data.data[closest.data.key];\n\n tooltip.html(tooltipMarkup(closest.data.data, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n\n highlightLine(_frontContext, res, _options, closest.data);\n highlightNode$4(_frontContext, _options, closest.data.c, closest[0], closest[1]);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n\n drawCanvas$5(_frontContext, res, _options);\n }\n }", "title": "" }, { "docid": "752af524936054d8672de116572defb4", "score": "0.6262582", "text": "function onMove(x, y) {\n\t\tif (mouse.down) {\n\t\t\tviewport.x += mouse.x - x;\n\t\t\tviewport.y += mouse.y - y;\n\t\t\tmouse.x = x;\n\t\t\tmouse.y = y;\n\t\t\tonDraw();\n\t\t}\n\t}", "title": "" }, { "docid": "70ccaef4196582b3bfb5cd09981067ca", "score": "0.62435067", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 40;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n\n if (closest) {\n closest.data.data[getMetric(state).accessor] = closest.data.data[closest.data.key];\n\n tooltip.html(tooltipMarkup(closest.data.data, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n\n highlightArea(_frontContext, res, _options, closest.data);\n highlightNode$2(_frontContext, _options, closest.data.c, closest[0], closest[1]);\n } else {\n drawCanvas$3(_frontContext, res, _options);\n\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n }\n }", "title": "" }, { "docid": "9c34acd7357d27e87cbe87ec1e5d1b43", "score": "0.62339985", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 40;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n\n if (closest) {\n closest.data.data[getMetric(state).accessor] = closest.data.data[closest.data.key];\n tooltip.html(tooltipMarkup(closest.data.data, state)).transition().duration(opt.animation.duration.tooltip).style('left', mx + opt.tooltip.offset[0] + 'px').style('top', my + opt.tooltip.offset[1] + 'px').style('opacity', 1);\n\n drawCanvas$4(frontContext, res, opt);\n highlightNode$3(frontContext, opt, closest.data.c, closest[0], closest[1]);\n } else {\n tooltip.transition().duration(opt.animation.duration.tooltip).style('opacity', 0);\n drawCanvas$4(frontContext, res, opt);\n }\n }", "title": "" }, { "docid": "7d62a85662cbbd95b25336d0e0dd9389", "score": "0.6221032", "text": "function WhenMouseMoved() {}", "title": "" }, { "docid": "6986c5f5ab7c4af530a88ead0f67dd88", "score": "0.61746675", "text": "onModifyMove() {}", "title": "" }, { "docid": "a76feeeeecfaafa7907e3342fa7b23a6", "score": "0.61635077", "text": "function mouseMoveCallback(e) {\n var coordinates = getCoordinates(e);\n \n PIXEL.doAction(coordinates.x, coordinates.y, currentColor);\n e.preventDefault();\n}", "title": "" }, { "docid": "9bc8b8788fd2733b04fe5468dd90e771", "score": "0.611944", "text": "mouseMove(prev, pt) {}", "title": "" }, { "docid": "b36ef1fd65869ad01bcf5a9c55ed85a7", "score": "0.6101058", "text": "function myonmousemovefunction()\n{\n console.log(\"myonmousemovefunction\")\n}", "title": "" }, { "docid": "0c21c586a98bcffb98def99768085bc6", "score": "0.6068731", "text": "function handleMove( e ) {\n let moveOnX =\n Math.abs( currentX - lastX ) > Math.abs( currentY - lastY );\n\n if ( moveOnX && currentX < lastX ) {\n if ( options.moveLeft ) {\n options.moveLeft.call( e.target, e, $currentTargetElement, 'moveLeft' );\n }\n }\n else if ( moveOnX && currentX > lastX ) {\n if ( options.moveRight ) {\n options.moveRight.call( e.target, e, $currentTargetElement, 'moveRight' );\n }\n }\n\n if ( !moveOnX && currentY < lastY ) {\n if ( options.moveUp ) {\n options.moveUp.call( e.target, e, $currentTargetElement, 'moveUp' );\n }\n }\n else if (!moveOnX && currentY > lastY) {\n if ( options.moveDown ) {\n options.moveDown.call( e.target, e, $currentTargetElement, 'moveDown' );\n }\n }\n }", "title": "" }, { "docid": "9c7bfbfc87494e11aacfdab7e1d7f232", "score": "0.60602945", "text": "function mouseMoveHandler() {\n // get the current mouse position\n const [mx, my] = mouse(this);\n const QuadtreeRadius = 100;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n const closest = state._voronoi.find(mx, my, QuadtreeRadius);\n\n if (closest) {\n tooltip\n .html(tooltipMarkup(closest.data.data, state))\n .transition()\n .duration(_options.animation.duration.tooltip)\n .style('left', mx + _options.tooltip.offset[0] + 'px')\n .style('top', my + _options.tooltip.offset[1] + 'px')\n .style('opacity', 1);\n\n drawCanvas(_frontContext, finalState);\n highlightNode(_frontContext, closest.data);\n } else {\n tooltip\n .transition()\n .duration(_options.animation.duration.tooltip)\n .style('opacity', 0);\n\n drawCanvas(_frontContext, finalState);\n }\n }", "title": "" }, { "docid": "9932b860fc2f50f95fb8764a639c20c3", "score": "0.6053895", "text": "function handleMouseMove(event) {\n updatedPositionDelta = {\n x: event.clientX - dragStart.x,\n y: event.clientY - dragStart.y\n };\n setPositionDelta(updatedPositionDelta);\n }", "title": "" }, { "docid": "c39652f22eca17a7197eabfa017a7883", "score": "0.60512316", "text": "function moveHandler (e) {\n\t\t// throttle it\n\t\tif (throttleMs && new Date().getTime() - lastMove < throttleMs) {\n\t\t\t// it is too soon so skip this round\n\t\t\treturn\n\t\t}\n\t\t\n\t\t// we need to get a x and y between -1 and 1 where 0 is the center\n\t\tvar layer\n\t\t\t, pos = mousemoveElem.offset() || {left: 0, top: 0}\n\t\t\t, x = e.pageX - pos.left - mousemoveElem.scrollLeft()\n\t\t\t, y = e.pageY - pos.top - mousemoveElem.scrollTop()\n\t\t\t, xPercent = (x / mousemoveWidth - 0.5) * 2\n\t\t\t, yPercent = (y / mousemoveHeight - 0.5) * 2\n\t\t\n\t\tmove(xPercent, yPercent)\n\t\tlastMove = new Date().getTime()\n\t}", "title": "" }, { "docid": "8c32ae75333f433d7ef105405d494614", "score": "0.6044279", "text": "moved() {\n this.loadDirty();\n\n if (this.moveCallback) {\n this.moveCallback();\n }\n }", "title": "" }, { "docid": "e7b6e0253da322066877922616ba851c", "score": "0.59991366", "text": "mMove(e){\n this.xMouse = e.offsetX;\n this.yMouse = e.offsetY;\n this.inBounds = this.inBoundsCheck(this.xMouse, this.yMouse, this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "93772376de0a7e1112ad4724b9ed6c00", "score": "0.598207", "text": "function mousemove() {\n graph.handleGraphMouseMove(\n d3.event.target,\n graph.component(),\n graph.data(),\n _.globalPubsub);\n }", "title": "" }, { "docid": "48d511c092b4f53e22f2c695aba09f02", "score": "0.5977767", "text": "function move_callback(e) {\n clearTimeout(timeout);\n }", "title": "" }, { "docid": "2f2e1d080c1dabae002bf12a2883aa2b", "score": "0.5965537", "text": "function mouseMoveHandler() {\n // get the current mouse position\n const [mx, my] = mouse(this);\n const QuadtreeRadius = 100;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n const closest = state._voronoi.find(mx, my, QuadtreeRadius);\n if (closest) {\n closest.data.data[getMetric(state).accessor] =\n closest.data.data[closest.data.key];\n\n tooltip\n .html(tooltipMarkup(closest.data.data, state))\n .transition()\n .duration(_options.animation.duration.tooltip)\n .style('left', mx + _options.tooltip.offset[0] + 'px')\n .style('top', my + _options.tooltip.offset[1] + 'px')\n .style('opacity', 1);\n\n highlightLine(_frontContext, res, _options, closest.data);\n highlightNode(\n _frontContext,\n _options,\n closest.data.c,\n closest[0],\n closest[1]\n );\n } else {\n tooltip\n .transition()\n .duration(_options.animation.duration.tooltip)\n .style('opacity', 0);\n\n drawCanvas(_frontContext, res, _options);\n }\n }", "title": "" }, { "docid": "dfd0e039d1996a28e1435824af888ae1", "score": "0.5947651", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var QuadtreeRadius = 30;\n // use the new diagram.find() function to find the Voronoi site\n // closest to the mouse, limited by max distance voronoiRadius\n var closest = state._voronoi.find(mx, my, QuadtreeRadius);\n if (closest) {\n var fadeOpacity = 0.1;\n\n var optCopy = Object.assign({}, _options);\n optCopy.plots.levelColor = transparent(optCopy.plots.levelColor, fadeOpacity);\n optCopy.plots.strokeOpacity = 0;\n\n drawCanvas$7(_frontContext, res.map(function (d) {\n var p = d;\n p.alpha = d.key === closest.data.s ? 0.4 : fadeOpacity;\n\n p.strokeAlpha = d.key === closest.data.s ? 1 : 0;\n\n return p;\n }), optCopy);\n\n highlight(_frontContext, _options, closest.data);\n } else {\n drawCanvas$7(_frontContext, finalState, _options);\n }\n }", "title": "" }, { "docid": "3cdce6402f4f60cc33ecb142bb8d2d24", "score": "0.5915857", "text": "function mousemove_listener(evt) {\n objectMoved = 1;\n var id = dragging.ownerSVGElement.suspendRedraw(1000);\n deltax = evt.clientX + dx - dragging.cx.baseVal.value; \n deltay = evt.clientY + dx - dragging.cy.baseVal.value; \n dragging.moveBy(deltax, deltay, 0);\n dragging.ownerSVGElement.unsuspendRedraw(id);\n node_mouseout_listener(evt);\n}", "title": "" }, { "docid": "a66159b9b8637a867534299b5f223c01", "score": "0.5887129", "text": "function eventMove ( event, data ) {\r\n\r\n\t\t// Fix #498\r\n\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\r\n\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\r\n\t\t// IE9 has .buttons and .which zero on mousemove.\r\n\t\t// Firefox breaks the spec MDN defines.\r\n\t\tif ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\r\n\t\t\treturn eventEnd(event, data);\r\n\t\t}\r\n\r\n\t\t// Check if we are moving up or down\r\n\t\tvar movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\r\n\r\n\t\t// Convert the movement into a percentage of the slider width/height\r\n\t\tvar proposal = (movement * 100) / data.baseSize;\r\n\r\n\t\tmoveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\r\n\t}", "title": "" }, { "docid": "b9458284efe72db65853f5467ec91457", "score": "0.5881261", "text": "function onMouseMove( event ) {\n\t\t\n\t\t// calculate mouse position in normalized device coordinates\n\t\t// (-1 to +1) for both components\n\t\tmouse.x = ( event.clientX / WIDTH ) * 2 - 1;\n\t\tmouse.y = ( event.clientY / HEIGHT ) * 2 - 1;\n\t\t\n\t}", "title": "" }, { "docid": "318f0a11b6f228d5327d22a1a7a68c0c", "score": "0.5879788", "text": "function eventMove ( event, data ) {\n\n\t\t// Fix #498\n\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n\t\t// IE9 has .buttons and .which zero on mousemove.\n\t\t// Firefox breaks the spec MDN defines.\n\t\tif ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\n\t\t\treturn eventEnd(event, data);\n\t\t}\n\n\t\t// Check if we are moving up or down\n\t\tvar movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n\t\t// Convert the movement into a percentage of the slider width/height\n\t\tvar proposal = (movement * 100) / data.baseSize;\n\n\t\tmoveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n\t}", "title": "" }, { "docid": "318f0a11b6f228d5327d22a1a7a68c0c", "score": "0.5879788", "text": "function eventMove ( event, data ) {\n\n\t\t// Fix #498\n\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n\t\t// IE9 has .buttons and .which zero on mousemove.\n\t\t// Firefox breaks the spec MDN defines.\n\t\tif ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\n\t\t\treturn eventEnd(event, data);\n\t\t}\n\n\t\t// Check if we are moving up or down\n\t\tvar movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n\t\t// Convert the movement into a percentage of the slider width/height\n\t\tvar proposal = (movement * 100) / data.baseSize;\n\n\t\tmoveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n\t}", "title": "" }, { "docid": "318f0a11b6f228d5327d22a1a7a68c0c", "score": "0.5879788", "text": "function eventMove ( event, data ) {\n\n\t\t// Fix #498\n\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n\t\t// IE9 has .buttons and .which zero on mousemove.\n\t\t// Firefox breaks the spec MDN defines.\n\t\tif ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\n\t\t\treturn eventEnd(event, data);\n\t\t}\n\n\t\t// Check if we are moving up or down\n\t\tvar movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n\t\t// Convert the movement into a percentage of the slider width/height\n\t\tvar proposal = (movement * 100) / data.baseSize;\n\n\t\tmoveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n\t}", "title": "" }, { "docid": "1185022396e7d0144f9f6d78727a4a2a", "score": "0.5877972", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n // This will return that pixel's color\n\n\n var col = _hiddenContext.getImageData(mx * _canvasScale, my * _canvasScale, 1, 1).data;\n //Our map uses these rgb strings as keys to nodes.\n var colString = 'rgb(' + col[0] + ',' + col[1] + ',' + col[2] + ')';\n var node = colorMap.get(colString);\n\n if (node) {\n tooltip.html(tooltipMarkup(node, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n }\n }", "title": "" }, { "docid": "1185022396e7d0144f9f6d78727a4a2a", "score": "0.5877972", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n // This will return that pixel's color\n\n\n var col = _hiddenContext.getImageData(mx * _canvasScale, my * _canvasScale, 1, 1).data;\n //Our map uses these rgb strings as keys to nodes.\n var colString = 'rgb(' + col[0] + ',' + col[1] + ',' + col[2] + ')';\n var node = colorMap.get(colString);\n\n if (node) {\n tooltip.html(tooltipMarkup(node, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n }\n }", "title": "" }, { "docid": "e5d9808b5196f62caae0dfd367048aae", "score": "0.58749473", "text": "function eventMove ( event, data ) {\n\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "3bd49e236dc45ff18d5d94d2f69fd78f", "score": "0.58685327", "text": "function OnMouseMoveThunk(/*object*/ sender, /*MouseEventArgs*/ e)\r\n { \r\n \tsender.OnMouseMove(e); \r\n }", "title": "" }, { "docid": "42c496bde3619f946ddb433f8936c35c", "score": "0.5844902", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n\n var col = _hiddenContext.getImageData(mx * _canvasScale, my * _canvasScale, 1, 1).data;\n var colString = 'rgb(' + col[0] + ',' + col[1] + ',' + col[2] + ')';\n var node = colorMap.get(colString);\n\n if (node) {\n var html = void 0;\n if (isArray$2(node.data.data)) {\n var n = {};\n n[getDimension(state).accessor] = node.data.label;\n n[getMetric(state).accessor] = sum$1(node.data.data.map(function (d) {\n return d.data;\n }), _getMetricVal);\n html = tooltipMarkup(n, state);\n } else {\n html = tooltipMarkup(node.data.data, state);\n }\n\n tooltip.html(html).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n }\n }", "title": "" }, { "docid": "45df883d9b812dfc3551961d5cae82c0", "score": "0.58342063", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "a5334450de8fb666702283149236c9a7", "score": "0.5818466", "text": "onElementMouseMove(event) {\n // Keep track of the last mouse position in case, due to OSX sloppy focusing,\n // focus is moved into the browser before a mousedown is delivered.\n // The cached mousemove event will provide the correct target in\n // GridNavigation#onGridElementFocus.\n this.mouseMoveEvent = event;\n }", "title": "" }, { "docid": "46881d9e05a88f348d7a9084db4477a6", "score": "0.58073556", "text": "handleMouseMove(mouseMoveEvent){\n this.performAutoScroll(mouseMoveEvent.clientY, mouseMoveEvent.view.innerHeight);\n }", "title": "" }, { "docid": "9af368439b9b8fcb3d513bad67a15392", "score": "0.5807211", "text": "function onPointerMove(e) {\n posx = e.clientX;\n posy = e.clientY;\n }", "title": "" }, { "docid": "c635462214d040f2e05584b2b6977c08", "score": "0.5806318", "text": "function mouseMove(event){\n\tif(!isDrawing){\n\t\treturn\n\t}\n\tdrawing([event.offsetX, event.offsetY])\n}", "title": "" }, { "docid": "bea38e995ead0641a15f6526d4af9ded", "score": "0.5805461", "text": "function eventMove(event, data) {\n\n\t\t\t// Fix #498\n\t\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n\t\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n\t\t\t// IE9 has .buttons and .which zero on mousemove.\n\t\t\t// Firefox breaks the spec MDN defines.\n\t\t\tif (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n\t\t\t\treturn eventEnd(event, data);\n\t\t\t}\n\n\t\t\t// Check if we are moving up or down\n\t\t\tvar movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n\t\t\t// Convert the movement into a percentage of the slider width/height\n\t\t\tvar proposal = movement * 100 / data.baseSize;\n\n\t\t\tmoveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n\t\t}", "title": "" }, { "docid": "5cedb03c74698c3f034577c89267de05", "score": "0.5794936", "text": "function onMouseMove( event )\n{\n requestRender();\n}", "title": "" }, { "docid": "512a8a6259aec8206593f67b47b696c7", "score": "0.5789642", "text": "function onMouseMove(e) {\n mouseX = event.offsetX;\n mouseY = event.offsetY;\n e.preventDefault(); // Prevent the browser from doing its default thing (scroll, zoom)\n if(touchID == 1){\n currentPos =[event.offsetX, event.offsetY];\n movementPos = [currentPos[0] - startPos[0], currentPos[1] - startPos[1]];\n getDirection();\n }\n\n}", "title": "" }, { "docid": "17a1933f166eca3abe14e3b77ea6ea0c", "score": "0.57880557", "text": "subscribeMouseMoveCallbacks() {\n Matter.Events.on(this.mouseConstraint, \"mousedown\", () => {\n console.log(this.mouseConstraint.body);\n if (\n this.mouseConstraint.body &&\n this.mouseConstraint.body.label === this.particleStatus.INFECTED\n ) {\n this.stop = true;\n this.bots.forEach((bot) =>\n Matter.Body.setVelocity(bot, { x: 0, y: 0 })\n );\n }\n });\n\n this.mouseMoveCallbacks.forEach((callback) => {\n Matter.Events.on(this.mouseConstraint, \"mousemove\", () => {\n callback(this.mouse);\n });\n });\n }", "title": "" }, { "docid": "80a064174454f37d7a49ccd1cf5f95cd", "score": "0.57845294", "text": "function move(e){\n // don't move anything until inital movement on 'mouseenter' has finished\n if( animated ) return;\n \n ratio = scrollWidth / containerWidth;\n stripePos = e.pageX - padding - posFromLeft; // the mouse X position, \"normalized\" to the carousel position\n \n if( stripePos < 0)\n stripePos = 0;\n \n pos = stripePos / (containerWidth - padding*2); // calculated position between 0 to 1\n // calculate the percentage of the mouse position within the carousel\n scrollPos = (scrollWidth - containerWidth ) * pos; \n \n el.scrollLeft = scrollPos;\n if( $indicator[0] && scrollPos < (scrollWidth - containerWidth) )\n $indicator[0].style.left = (scrollPos / scrollWidth ) * 100 + '%';\n \n // check if element has reached an edge\n prevMore = el.scrollLeft > 0;\n nextMore = el.scrollLeft < (scrollWidth - containerWidth);\n \n $carousel.toggleClass('left', prevMore);\n $carousel.toggleClass('right', nextMore);\n }", "title": "" }, { "docid": "adad328ed3dd59103faf660d86e80cb7", "score": "0.5781486", "text": "function handleMouseMove(e) {\n var posX = e.clientX;\n var posY = e.clientY;\n\n if(posY < top+excldH && disableAutoScroll == true){\n \n verticalSlideDown();\n /*$(\".scroll-inner-container\").css(\"background-color\", \"yellow\");*/ //those color only for mouse position testing parpous \n }else if(posY > bottom-excldH && disableAutoScroll == true){\n \n verticalSlideUp();\n /*$(\".scroll-inner-container\").css(\"background-color\", \"green\");*/ //those color only for mouse position testing parpous \n }else{\n var div = $('.scroll-inner-container');\n div.stop();\n }\n }", "title": "" }, { "docid": "78054f5f1915c917c473b0b1012969c9", "score": "0.5767078", "text": "function onMouseMove(event) {\n pushEventData(event);\n document.body.removeEventListener(\"mousemove\", onMouseMove, false);\n }", "title": "" }, { "docid": "d470a37dc71d3d3f3a7e7f6b1a2933f6", "score": "0.5764515", "text": "_move(event) {\r\n const previousPointers = this.currentPointers.slice();\r\n const changedPointers = ('changedTouches' in event) ? // Shortcut for 'is touch event'.\r\n Array.from(event.changedTouches).map(t => new Pointer(t)) :\r\n [new Pointer(event)];\r\n const trackedChangedPointers = [];\r\n for (const pointer of changedPointers) {\r\n const index = this.currentPointers.findIndex(p => p.id === pointer.id);\r\n if (index === -1)\r\n continue; // Not a pointer we're tracking\r\n trackedChangedPointers.push(pointer);\r\n this.currentPointers[index] = pointer;\r\n }\r\n if (trackedChangedPointers.length === 0)\r\n return;\r\n this._moveCallback(previousPointers, trackedChangedPointers, event);\r\n }", "title": "" }, { "docid": "a697349524ccef73f22457bc8a3b0f4d", "score": "0.5757321", "text": "function eventMove(event, data) {\r\n // Fix #498\r\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\r\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\r\n // IE9 has .buttons and .which zero on mousemove.\r\n // Firefox breaks the spec MDN defines.\r\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\r\n return eventEnd(event, data);\r\n }\r\n\r\n // Check if we are moving up or down\r\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\r\n\r\n // Convert the movement into a percentage of the slider width/height\r\n var proposal = (movement * 100) / data.baseSize;\r\n\r\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\r\n }", "title": "" }, { "docid": "6cc82621db63bf4bfa40c06b00646657", "score": "0.5755374", "text": "function eventMove(event, data) {\n\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "1f79b8f2f117ab1dd723c3a46792c348", "score": "0.5751046", "text": "onMouseMove(e){\n // don't move anything until inital movement on 'mouseenter' has finished\n if( this.animated ) return\n\n this.ratio = this.scrollWidth / this.containerWidth\n\n // the mouse X position, \"normalized\" to the carousel position\n var stripePos = e.pageX - this.padding - this.posFromLeft\n\n if( stripePos < 0 )\n stripePos = 0\n\n // calculated position between 0 to 1\n this.pos = stripePos / (this.containerWidth - this.padding*2)\n\n // calculate the percentage of the mouse position within the carousel\n this.scrollPos = (this.scrollWidth - this.containerWidth ) * this.pos\n\n this.DOM.wrap.scrollLeft = this.scrollPos\n\n // update scrollbar\n if( this.scrollPos < (this.scrollWidth - this.containerWidth) )\n this.DOM.scope.style.setProperty('--scrollLleft', (this.scrollPos / this.scrollWidth ) * 100 + '%');\n\n // check if element has reached an edge\n this.prevMore = this.DOM.wrap.scrollLeft > 0\n this.nextMore = this.scrollWidth - this.containerWidth - this.DOM.wrap.scrollLeft > 5\n\n this.DOM.scope.setAttribute('data-at',\n (this.prevMore ? 'left ' : ' ')\n + (this.nextMore ? 'right' : '')\n )\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "9d627a4d25337d5619d3052f66e61934", "score": "0.574491", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "276b2cb75afeb7c199dbe7bafde7f315", "score": "0.5740415", "text": "function eventMove(event, data) {\n // Fix #498\n // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\n // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\n // IE9 has .buttons and .which zero on mousemove.\n // Firefox breaks the spec MDN defines.\n if (navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) {\n return eventEnd(event, data);\n }\n // Check if we are moving up or down\n var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);\n // Convert the movement into a percentage of the slider width/height\n var proposal = (movement * 100) / data.baseSize;\n moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);\n }", "title": "" }, { "docid": "f4a148181bccc7dd8950692a911f79a0", "score": "0.57389915", "text": "function moveHandler(e){\n // Called automatically whenever the mouse is moved after a drag event starts\n if (e == null) { e = window.event } // Get event data, if it wasn't passed, get it IE style.\n if ( _dragOK ){ // is our global var set to true? is it ok to move the object?\n _savedTarget.style.left=e.clientX-_dragXoffset+'px'; //OK to move, calculate the offset and move it\n _savedTarget.style.top=e.clientY-_dragYoffset+'px'; // calculate the y offset and move it.\n return false; // return false so browser doesn't try to do anything else.\n } // End _dragOK check\n } // End moveHandler", "title": "" }, { "docid": "3f9ad5d95943f51ea15a0879d55e0f97", "score": "0.57359403", "text": "onElementMouseMove(event) {\n if (this.dragContext) {\n this.updateMove(event.clientX);\n event.preventDefault();\n }\n }", "title": "" }, { "docid": "76349f7b4aae8c9b4bd6f36d809a066c", "score": "0.57332903", "text": "subscribeEvents() {\n\t\tthis.coordinatesAPI.on('mousemove', this.onMouseMove);\n\t}", "title": "" }, { "docid": "68d8cc546513c072fa1006f4b743ad3f", "score": "0.57285744", "text": "function mouseMoveCallback(e) {\n var eventData = e.detail;\n\n _toolCoordinates2.default.setCoords(eventData);\n\n // If we have no tool data for this element, do nothing\n var toolData = (0, _toolState.getToolState)(eventData.element, toolType);\n\n if (toolData === undefined) {\n return;\n }\n\n // We have tool data, search through all data\n // And see if we can activate a handle\n var imageNeedsUpdate = false;\n var coords = eventData.currentPoints.canvas;\n\n for (var i = 0; i < toolData.data.length; i++) {\n // Get the cursor position in image coordinates\n var data = toolData.data[i];\n\n if ((0, _handleActivator2.default)(eventData.element, data.handles, coords) === true) {\n imageNeedsUpdate = true;\n }\n\n if (mouseToolInterface.pointInsideRect(eventData.element, data, coords) && !data.active || !mouseToolInterface.pointInsideRect(eventData.element, data, coords) && data.active) {\n data.active = !data.active;\n imageNeedsUpdate = true;\n }\n }\n\n // Handle activation status changed, redraw the image\n if (imageNeedsUpdate === true) {\n _externalModules2.default.cornerstone.updateImage(eventData.element);\n }\n }", "title": "" }, { "docid": "88de8d3902c607d746bc482bd443029b", "score": "0.5710184", "text": "onMove(_ref) {\n\t var movementX = _ref.movementX,\n\t movementY = _ref.movementY;\n\n\t var node = ReactDOM.findDOMNode(this);\n\t var doc = node.ownerDocument;\n\n\t if (this.props.endPanelControl) {\n\t // For the end panel we need to increase the width/height when the\n\t // movement is towards the left/top.\n\t movementX = -movementX;\n\t movementY = -movementY;\n\t }\n\n\t if (this.state.vert) {\n\t var isRtl = doc.dir === \"rtl\";\n\t if (isRtl) {\n\t // In RTL we need to reverse the movement again -- but only for vertical\n\t // splitters\n\t movementX = -movementX;\n\t }\n\n\t this.setState((state, props) => ({\n\t width: state.width + movementX\n\t }));\n\t } else {\n\t this.setState((state, props) => ({\n\t height: state.height + movementY\n\t }));\n\t }\n\t }", "title": "" }, { "docid": "5b9d68892636c067e27282a6b699c4a2", "score": "0.5709757", "text": "function onMouseMove(e) {\n\n // Update the mouse co-ordinates when moved\n getMousePos(e);\n\n if (mouseDown === 1) {\n updateMouseTrace();\n\n drawLine(ctx, mouseX, mouseY, 8);\n }\n}", "title": "" }, { "docid": "2194620474563d992191b3cb70f92d5f", "score": "0.5707919", "text": "function gestureMove(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);runHandlers('move',ev);}", "title": "" }, { "docid": "2194620474563d992191b3cb70f92d5f", "score": "0.5707919", "text": "function gestureMove(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);runHandlers('move',ev);}", "title": "" }, { "docid": "b4a361730994110c1876155ca834f3d5", "score": "0.57072496", "text": "function mouseMoveCallback(e) {\n var eventData = e.detail;\n\n _toolCoordinates2.default.setCoords(eventData);\n\n // If we have no tool data for this element, do nothing\n var toolData = (0, _toolState.getToolState)(eventData.element, toolType);\n\n if (!toolData) {\n return;\n }\n\n // We have tool data, search through all data\n // And see if we can activate a handle\n var imageNeedsUpdate = false;\n\n for (var i = 0; i < toolData.data.length; i++) {\n // Get the cursor position in canvas coordinates\n var coords = eventData.currentPoints.canvas;\n\n var data = toolData.data[i];\n\n if ((0, _handleActivator2.default)(eventData.element, data.handles, coords) === true) {\n imageNeedsUpdate = true;\n }\n\n if (mouseToolInterface.pointNearTool(eventData.element, data, coords) && !data.active || !mouseToolInterface.pointNearTool(eventData.element, data, coords) && data.active) {\n data.active = !data.active;\n imageNeedsUpdate = true;\n }\n }\n\n // Handle activation status changed, redraw the image\n if (imageNeedsUpdate === true) {\n _externalModules2.default.cornerstone.updateImage(eventData.element);\n }\n }", "title": "" }, { "docid": "2aa52889a419818b48bcb312dfa77d57", "score": "0.57018083", "text": "function onMoveEvent(e) {\n // update position\n updateCoordFromEvent(e);\n // dispatch mouse event to registered object\n if (dispatchEvent(e)) {\n // prevent default action\n return obj._preventDefault(e);\n }\n return true;\n }", "title": "" }, { "docid": "6435c81b7cccb311d042c78693beb323", "score": "0.56814164", "text": "function mouseMove(e) {\n\t\tpmouseX = mouseX;\n\t\tpmouseY = mouseY;\n\t\tmouseX = e.clientX - canvas.offsetLeft;\n\t\tmouseY = e.clientY - canvas.offsetTop;\n\t\tdrawOnCanvas();\n\t}", "title": "" }, { "docid": "a8a333f8ab63eb600c865ed0960dffc6", "score": "0.5679224", "text": "onMouseMove (event) {\n let x = event.offsetX;\n let y = event.offsetY;\n\n this.value.x = ((this.range / this.width) * x) - (this.range - this.max);\n this.value.y = (((this.range / this.height) * y) - (this.range - this.max)) * -1;\n\n // fire 'changed'\n this.trigger('changed', this.value);\n this.overPoint = true;\n }", "title": "" }, { "docid": "f9f5713cdc9e0bfe6ff6d2914d7f7628", "score": "0.5649916", "text": "function mouseMove(e) {\n if (mouseY) {\n pageX = e.targetTouches ? e.targetTouches[0].pageX : e.pageX;\n pageY = e.targetTouches ? e.targetTouches[0].pageY : e.pageY;\n mouseX = pageX - rangeWrapperLeft;\n mouseDy = (pageY - mouseInitialY) * mouseDyFactor;\n newY = currentY + mouseY - pageY;\n if (newY >= rangeMinY && newY <= rangeMaxY) {\n currentY = newY;\n mouseY = pageY;\n } else {\n currentY = newY < rangeMinY ? rangeMinY : rangeMaxY;\n }\n updateValue();\n }\n}", "title": "" }, { "docid": "7dc038d9e3616e54f7c45f5568dadcaf", "score": "0.56428754", "text": "e_mouseMove(e)\n\t{\n\t\tthis.mouseState.lx = this.mouseState.x;\n\t\tthis.mouseState.ly = this.mouseState.y;\n\t\tthis.mouseState.x = e.clientX;\n\t\tthis.mouseState.y = e.clientY;\n\t\tthis.mouseState.dx = this.mouseState.x - this.mouseState.lx;\n\t\tthis.mouseState.dy = this.mouseState.y - this.mouseState.ly;\n\n\t\t// Should probably move this to Update loop\n\t\tthis.GetComponents().forEach(function(component)\n\t\t{\n\t\t\tif(CCUtil.Collides(component._getBoundingBox(), e.clientX, e.clientY))\n\t\t\t{\n\t\t\t\tif(!component.isMouseOver)\n\t\t\t\t\tcomponent._mouseEvent(ComponentEvent.MOUSE_OVER, e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(component.isMouseOver)\n\t\t\t\t\tcomponent._mouseEvent(ComponentEvent.MOUSE_OUT, e);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "cad3f408add73f784c278ff829036e71", "score": "0.5636418", "text": "function on_move(e) {\n\n\t// Get the cardinal bounds.\n\tif( e && e.target && e.target.getBounds ){\n\t var bounds = e.target.getBounds();\n\t if( bounds ){\n\t\tvar north = Math.round(bounds.getNorth() * 1000000);\n\t\tvar south = Math.round(bounds.getSouth() * 1000000);\n\t\tvar west = Math.round(bounds.getWest() * 1000000);\n\t\tvar east = Math.round(bounds.getEast() * 1000000);\n\t\t\n\t\t//console.log(\"Bounds set: \", bounds.toBBoxString());\n\t\tconsole.log(\"Tween x _ long _ n/s: \", south, north);\n\t\tconsole.log(\"Tween y _ lat _ w/e: \", west, east);\n\t\t\n\t\t// Set manager with these bounds filters.\n\t\t// manager.remove_query_filter('geospatial_x');\n\t\t// manager.remove_query_filter('geospatial_y');\n\t\t// manager.add_query_filter('geospatial_x',\n \t\t// \t\t\t '['+ west + ' TO ' + east +']');\n\t\t// manager.add_query_filter('geospatial_y',\n \t\t// \t\t\t '['+ south + ' TO ' + north +']');\n\t\t// TODO/BUG: Manager does not do unquoted stuff, which\n\t\t// is what we need here. Manually add and reset the extra bits.\n\t\tmanager.set_extra(\n\t\t '&fq=geospatial_x:['+ west + ' TO ' + east +']' +\n\t\t\t'&fq=geospatial_y:['+ south + ' TO ' + north +']');\n\n\t\t// Trigger search with new filters.\n\t\tmanager.search();\n\t }\n\t}\n }", "title": "" }, { "docid": "cad3f408add73f784c278ff829036e71", "score": "0.5636418", "text": "function on_move(e) {\n\n\t// Get the cardinal bounds.\n\tif( e && e.target && e.target.getBounds ){\n\t var bounds = e.target.getBounds();\n\t if( bounds ){\n\t\tvar north = Math.round(bounds.getNorth() * 1000000);\n\t\tvar south = Math.round(bounds.getSouth() * 1000000);\n\t\tvar west = Math.round(bounds.getWest() * 1000000);\n\t\tvar east = Math.round(bounds.getEast() * 1000000);\n\t\t\n\t\t//console.log(\"Bounds set: \", bounds.toBBoxString());\n\t\tconsole.log(\"Tween x _ long _ n/s: \", south, north);\n\t\tconsole.log(\"Tween y _ lat _ w/e: \", west, east);\n\t\t\n\t\t// Set manager with these bounds filters.\n\t\t// manager.remove_query_filter('geospatial_x');\n\t\t// manager.remove_query_filter('geospatial_y');\n\t\t// manager.add_query_filter('geospatial_x',\n \t\t// \t\t\t '['+ west + ' TO ' + east +']');\n\t\t// manager.add_query_filter('geospatial_y',\n \t\t// \t\t\t '['+ south + ' TO ' + north +']');\n\t\t// TODO/BUG: Manager does not do unquoted stuff, which\n\t\t// is what we need here. Manually add and reset the extra bits.\n\t\tmanager.set_extra(\n\t\t '&fq=geospatial_x:['+ west + ' TO ' + east +']' +\n\t\t\t'&fq=geospatial_y:['+ south + ' TO ' + north +']');\n\n\t\t// Trigger search with new filters.\n\t\tmanager.search();\n\t }\n\t}\n }", "title": "" }, { "docid": "85206bf9415d06e712b6185c29f6d574", "score": "0.5635933", "text": "mouseMove() {\n this.mousePosition = this.getRandomPosition();\n\n // our move event\n const domEvent = document.createEvent( 'MouseEvent' ); // not 'MouseEvents' according to DOM Level 3 spec\n\n // technically deprecated, but DOM4 event constructors not out yet. people on #whatwg said to use it\n domEvent.initMouseEvent( 'mousemove', true, true, window, 0, // click count\n this.mousePosition.x, this.mousePosition.y, this.mousePosition.x, this.mousePosition.y,\n false, false, false, false,\n 0, // button\n null );\n\n this.display._input.validatePointers();\n this.display._input.mouseMove( this.mousePosition, new EventContext( domEvent ) );\n }", "title": "" }, { "docid": "0e358379de0e1d344b38aea8e4aad419", "score": "0.5630796", "text": "function onMouseMove(offY, e) {\n lastMouseOffY = e.clientY - offY;\n onScroll();\n}", "title": "" }, { "docid": "ea3429962ec31a951ae9b61f50bee75f", "score": "0.56265765", "text": "function mousemove(ev) {\n\tif ( poolcards.separation.moving ) { // Moving separation\n\t\tpoolcards.separation.position = ev.layerY ;\n\t\tpoolcards.main.refresh() ;\n\t\tpoolcards.side.refresh() ;\n\t\tdraw() ;\n\t} else {\n\t\t// Hovering separation\n\t\tvar sh = poolcards.separation.hovered ;\n\t\tpoolcards.separation.hovered = ( ( ev.layerY > poolcards.separation.position - poolcards.separation.offset ) && ( ev.layerY < poolcards.separation.position + poolcards.separation.offset ) ) ;\n\t\tvar redraw = ( poolcards.separation.hovered != sh ) ; // its value changed\n\t\tif ( redraw ) {\n\t\t\tif ( poolcards.separation.hovered ) { // Hover separation\n\t\t\t\tbuild_canvas.style.cursor = 'row-resize' ;\n\t\t\t} else\n\t\t\t\tbuild_canvas.style.cursor = '' ;\n\t\t\tdraw() ;\n\t\t}\n\t\t// Moving over a pool, transmit\n\t\tif ( ev.layerY > poolcards.separation.position )\n\t\t\tvar pool = poolcards.main ;\n\t\telse\n\t\t\tvar pool = poolcards.side ;\n\t\tpool.mousemove(ev) ;\n\t}\n}", "title": "" }, { "docid": "2a3e23e1076abc621c1f8e462d3a05a8", "score": "0.5612394", "text": "onPointerMove(e) {\r\n window.requestAnimationFrame(() => {\r\n const rect = this.parentNode.getClientRects();\r\n const p = new Point2D_1.Point2D(e.clientX - rect[0].left, e.clientY - rect[0].top);\r\n this.show();\r\n this.moveCross(this.crossA, p);\r\n this.movePoint(this.nextPoint, p);\r\n if (this.lastPoint != null) {\r\n this.moveLine(this.nextSegment, this.lastPoint, p);\r\n }\r\n else {\r\n this.moveLine(this.nextSegment, p, p);\r\n }\r\n });\r\n e.preventDefault();\r\n }", "title": "" }, { "docid": "465c7235ee9b54e244c32f518cc339a2", "score": "0.56070614", "text": "_onMouseMove( evt ){\n this._mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;\n this._mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;\n \n this._followInteraction();\n }", "title": "" }, { "docid": "95f2033f193e0603fb6d518926918a19", "score": "0.56061673", "text": "function doCanvasMove( evt )\n{\n\n}", "title": "" }, { "docid": "14290bb926b3caa710101280986d0dce", "score": "0.5604564", "text": "bindMouseMove() {\n return this.content.addEventListener(\"mousemove\", (event) => {\n if (this.dragging && this.listening) {\n event.preventDefault();\n this.drag(event.clientX, event.clientY);\n this.previousMouseX = event.clientX;\n return this.previousMouseY = event.clientY;\n }\n });\n }", "title": "" }, { "docid": "249f3051fa5b3909be9ce14e45f8e52d", "score": "0.56042516", "text": "function onExecutingMove(moveInfo) {\r\n //Due to the nature of the applet, I'm pretty sure nothing should go here\r\n}", "title": "" }, { "docid": "0bf4462cae6371e68371043f6619399f", "score": "0.5598557", "text": "function move ( event, data ) {\r\n\t\r\n\t\t\t// Fix #498\r\n\t\t\t// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).\r\n\t\t\t// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero\r\n\t\t\t// IE9 has .buttons and .which zero on mousemove.\r\n\t\t\t// Firefox breaks the spec MDN defines.\r\n\t\t\tif ( navigator.appVersion.indexOf(\"MSIE 9\") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {\r\n\t\t\t\treturn end(event, data);\r\n\t\t\t}\r\n\t\r\n\t\t\tvar handles = data.handles || scope_Handles, positions, state = false,\r\n\t\t\t\tproposal = ((event.calcPoint - data.start) * 100) / data.baseSize,\r\n\t\t\t\thandleNumber = handles[0] === scope_Handles[0] ? 0 : 1, i;\r\n\t\r\n\t\t\t// Calculate relative positions for the handles.\r\n\t\t\tpositions = getPositions( proposal, data.positions, handles.length > 1);\r\n\t\r\n\t\t\tstate = setHandle ( handles[0], positions[handleNumber], handles.length === 1 );\r\n\t\r\n\t\t\tif ( handles.length > 1 ) {\r\n\t\r\n\t\t\t\tstate = setHandle ( handles[1], positions[handleNumber?0:1], false ) || state;\r\n\t\r\n\t\t\t\tif ( state ) {\r\n\t\t\t\t\t// fire for both handles\r\n\t\t\t\t\tfor ( i = 0; i < data.handles.length; i++ ) {\r\n\t\t\t\t\t\tfireEvent('slide', i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if ( state ) {\r\n\t\t\t\t// Fire for a single handle\r\n\t\t\t\tfireEvent('slide', handleNumber);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "e305dc2c698a50bf7793f7c9bee65810", "score": "0.5594445", "text": "move() {\n\n\t}", "title": "" }, { "docid": "9431de349c0482287fd0dddf774166ab", "score": "0.5590138", "text": "function handleMouseMove(event) {\n mouseX = event.pageX;\n mouseY = event.pageY;\n}", "title": "" }, { "docid": "0007fad2b5bd5ceabe967c457a6c403d", "score": "0.55887496", "text": "onMouseMove(event) {\n\n // Notify view\n this.view.onMouseMove(event)\n\n }", "title": "" }, { "docid": "f22d2256c275de1146a3334ca9119a79", "score": "0.55877334", "text": "function onMove(e) {\r\n if (!isDown && !isPan) {\r\n //do nothing\r\n return\r\n }\r\n\r\n if (isDown && !isPan) {\r\n //run the addTile routine\r\n addTile(e)\r\n }\r\n\r\n if (!isDown && isPan) {\r\n var { startx, starty } = props.startingPoint\r\n //run PAN routine\r\n e.stopPropagation()\r\n // get the current mouse position\r\n mouseXX = parseInt(e.clientX)\r\n mouseYY = parseInt(e.clientY)\r\n\r\n // dx & dy are the distance the mouse has moved since\r\n // the last mousemove event\r\n var deltax = mouseXX - dragx\r\n var deltay = mouseYY - dragy\r\n // reset the vars for next mousemove\r\n dragx = mouseXX\r\n dragy = mouseYY\r\n startx = startx + deltax //netPanningX\r\n starty = starty + deltay //netPanningY\r\n\r\n if (startx && starty) {\r\n props.updateStartingPoint({ startx, starty })\r\n }\r\n\r\n draw()\r\n }\r\n }", "title": "" }, { "docid": "5a50309678b2553e99adc7e118238472", "score": "0.5587116", "text": "function mouseMove(event) {\n mouse.x = event.clientX;\n mouse.y = event.clientY;\n}", "title": "" }, { "docid": "0465b9bd9a91bf9a0ec28f8a1b04a5bf", "score": "0.5586332", "text": "function move ( event, data ) {\r\n\r\n\t\tvar handles = data.handles || $Handles, positions, state = false,\r\n\t\t\tproposal = ((event.calcPoint - data.start) * 100) / baseSize(),\r\n\t\t\th = handles[0][0] !== $Handles[0][0] ? 1 : 0;\r\n\r\n\t\t// Calculate relative positions for the handles.\r\n\t\tpositions = getPositions( proposal, data.positions, handles.length > 1);\r\n\r\n\t\tstate = setHandle ( handles[0], positions[h], handles.length === 1 );\r\n\r\n\t\tif ( handles.length > 1 ) {\r\n\t\t\tstate = setHandle ( handles[1], positions[h?0:1], false ) || state;\r\n\t\t}\r\n\r\n\t\t// Fire the 'slide' event if any handle moved.\r\n\t\tif ( state ) {\r\n\t\t\tfireEvents(['slide']);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a35008c3b4049527465607144314943a", "score": "0.55833644", "text": "function moveHandler(e) {\n\t\t// Move the element to the current mouse position, adjusted by the\n\t\t// position of the scrollbars and the offset of the initial click.\n\t\tnewX = (baseX + (e.clientX - clickX));\n\t\tnewY = (baseY + (e.clientY - clickY));\n\t\telementToDrag.setXY(newX, newY);\n\t\tworkspace.draw();\n\n\t\t// And don't let anyone else see this event.\n\t\te.stopPropagation(); \n\t}", "title": "" }, { "docid": "6e44de441251e4047f079ba1e562a02e", "score": "0.55775034", "text": "function mouseMoveHandler() {\n // get the current mouse position\n var _mouse = mouse(this),\n _mouse2 = slicedToArray(_mouse, 2),\n mx = _mouse2[0],\n my = _mouse2[1];\n // This will return that pixel's color\n\n\n var col = _hiddenContext.getImageData(mx * _canvasScale, my * _canvasScale, 1, 1).data;\n //Our map uses these rgb strings as keys to nodes.\n var colString = 'rgb(' + col[0] + ',' + col[1] + ',' + col[2] + ')';\n var closest = colorMap.get(colString);\n\n if (closest) {\n closest.data[getMetric(state).accessor] = closest.data[closest.key];\n\n tooltip.html(tooltipMarkup(closest.data, state)).transition().duration(_options.animation.duration.tooltip).style('left', mx + _options.tooltip.offset[0] + 'px').style('top', my + _options.tooltip.offset[1] + 'px').style('opacity', 1);\n } else {\n tooltip.transition().duration(_options.animation.duration.tooltip).style('opacity', 0);\n }\n }", "title": "" } ]
2e266a24de4b47a998f209758111251e
Function to only allow acess if authenticated
[ { "docid": "f356a63e75d539769085baf3f0f5f7b4", "score": "0.0", "text": "function ensureAuthenticated(req, res, next) {\n\t\tif (req.isAuthenticated()) { return next(); }\n\t\t// Redirect if not authenticated\n\t\tres.redirect('/account/login');\n}", "title": "" } ]
[ { "docid": "0b0e5a013f1e6edc40e949daf033b9c2", "score": "0.73840946", "text": "function isAuthenticated() {\n return false;\n }", "title": "" }, { "docid": "77e8616e443673d8f033f2e60aeb39bb", "score": "0.7364266", "text": "function isAuthenticated() {}", "title": "" }, { "docid": "ff16da61ccd557c64faf9aa58334d6fa", "score": "0.7312058", "text": "function isAuth() {\n //if user is authorized, return true\n //else return false\n}", "title": "" }, { "docid": "ebbccf0dc44d3423e56759439298d23d", "score": "0.7246503", "text": "function requestAuth() {\n //flag account to be marked as authorized to view restricted content or not\n //\n}", "title": "" }, { "docid": "6a6dff7b0270f4e07b0918044b2e58fe", "score": "0.7218588", "text": "function isAuth(req, res, next){\n\tif (!req.user){\n\t\tres.sendStatus(403);\n\t\treturn;\n\t}\n\tnext()\n}", "title": "" }, { "docid": "19223207a964041eff64a0675ab876d1", "score": "0.71699977", "text": "isAuthenticated() {\n return true;\n }", "title": "" }, { "docid": "c381e0c40e13235611443fa28b95d943", "score": "0.7166499", "text": "function restricted(req, res, next) {\n\n if (req.session && req.session.username) {\n next();\n } else {\n res.status(401).json({ message: 'You shall not pass!' });\n }\n}", "title": "" }, { "docid": "e1fc2e395010122691ff86890d98001f", "score": "0.71561897", "text": "function authorized (req, res, next) {\n if (!req.isAuthenticated()) {\n res.sendStatus(401);\n } else {\n next();\n }\n }", "title": "" }, { "docid": "50f2ec7e5e07ea448de7a6af35e1bae2", "score": "0.71481574", "text": "function prevent(req, res, next) {\n if(!req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/\");\n}", "title": "" }, { "docid": "002530216af4eff60180bf85dce76794", "score": "0.7110593", "text": "function isAuthenticated(req, res, next) {\n if (req.isAuthenticated()) return next();\n res.send(401);\n }", "title": "" }, { "docid": "88d052583851d625fbea34741f380d2b", "score": "0.70968586", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.status(400).json({\n 'message': 'access denied'\n });\n}", "title": "" }, { "docid": "f711df216a7b5c18e6ea5fb6d99f2809", "score": "0.70763105", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.status(400).json({\n 'message': 'Access-denied'\n });\n}", "title": "" }, { "docid": "21798f8a910ae2fe2b2d417cd6ba8192", "score": "0.7060698", "text": "function Void_PreventRoutingIfAdminLoggedIn_Index(\r\n _Object_Request,\r\n _Object_Respond,\r\n _Object_Next\r\n){\r\n if(_Object_Request.isAuthenticated() == true){\r\n _Object_Respond.redirect(String_PageMain);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n return _Object_Next();\r\n}", "title": "" }, { "docid": "78a242b3068d690f35d04b91fbbc9f40", "score": "0.70537716", "text": "function restricted(req, res, next) {\r\n if (req.session && req.session.user) {\r\n next();\r\n } else {\r\n res.status(401).json({\r\n errorMessage: 'Please Login! Provide a valid username and password.',\r\n });\r\n }\r\n}", "title": "" }, { "docid": "080d5d68853ee6f2ea4ab21e2890aa89", "score": "0.7044865", "text": "function checkNotAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return res.redirect(\"/secret\");\n }\n next();\n}", "title": "" }, { "docid": "fda31eb19cabe3226e43c8cdc5647ca3", "score": "0.7025248", "text": "function restrict (req, res, next) {\n try {\n if (req && req.session && req.session.user) {\n next();\n } else {\n res.status(403).json({ message: 'You shall not pass!' });\n }\n } catch (error) {\n res.status(500).json({ message: 'Huh?!' });\n }\n}", "title": "" }, { "docid": "013c7b7aa1a1ba080f09c3d2b8a5e6f7", "score": "0.6988513", "text": "function protected(req, res, next) {\n if (req.session && req.session.username === 'Adrian26') {\n next();\n } else {\n res.status(401).json({ message: 'Incorrect credentials' });\n }\n }", "title": "" }, { "docid": "99ccfc1f6d8d244110eaf4d74e94c9ca", "score": "0.6959182", "text": "function checkAuth(req, res, next) {\n if (req.isAuthenticated()) {\n next();\n } else {\n res.send(401);\n }\n }", "title": "" }, { "docid": "3d74fadaab883f9a587a8886735139c0", "score": "0.6943582", "text": "function ensureAuthenticated(req, res, next) {\n\t \t//console.log(\"in ensureAuth\", req.isAuthenticated());\n \t//console.log(\"session data\", req.session);\n \t//console.log(\"user data\", req.user);\n \t\n //current hack\n //restrict access to authenticated sites by user email domain \n //could also use groups? https://developers.google.com/google-apps/provisioning/#retrieving_all_groups_for_a_member\t\n if (req.isAuthenticated() && req.user.emails[0].value.indexOf(restricted_domain) > -1) { \n \treturn next(); \n }\n res.redirect('/login');\n}", "title": "" }, { "docid": "11ce0236feb7b2d12c81b0b5d2e33e75", "score": "0.6942261", "text": "function checkAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next()\r\n }\r\n res.redirect('/login')\r\n }", "title": "" }, { "docid": "0e8eb242032cb78a934d1e9152545008", "score": "0.69392395", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.sendStatus(401);\n}", "title": "" }, { "docid": "8f1c32f1b96f5fb90399ffd3b8df6eac", "score": "0.6917378", "text": "function allowLoggedIn(req, res, next) {\n\tif (req.session.user_email) {\n\t\tnext();\n\t} else {\n\t\tres.end('Unauthorized');\n\t}\n}", "title": "" }, { "docid": "752a74c3761beb3678f60e69487b473d", "score": "0.69162524", "text": "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n failLogin(req, res)\n }\n}", "title": "" }, { "docid": "2dc2fe86f9467a9137b88cfdf583765d", "score": "0.69139373", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "2dc2fe86f9467a9137b88cfdf583765d", "score": "0.69139373", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "2dc2fe86f9467a9137b88cfdf583765d", "score": "0.69139373", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "6840f18c120edffc8c0362d086b35cce", "score": "0.6911159", "text": "function ensureAuthenticated(req, res, next){\n\tif (req.isAuthenticated()) {\n\t\tnext();\n\t} else {\n\t\tres.send(403);\n\t\t//res.redirect('/login');\n\t}\n}", "title": "" }, { "docid": "b190de1c2c4d1c6ccee28de55f0f30c4", "score": "0.6908301", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n return res.status(401).json('[!] Not authorized');\n}", "title": "" }, { "docid": "bf58d0ca261359ff937fbf499e3166a7", "score": "0.6907952", "text": "function isLoggedInDontCare(req, res, next) {\n //if (req.isAuthenticated())\n return next();\n\n //res.redirect('/');\n}", "title": "" }, { "docid": "7a9dce6de3667e809a43c26f6573610c", "score": "0.69028723", "text": "function checkAuth (req, res, next) {\n\tconsole.log('checkAuth ' + req.url);\n\n\t// don't serve /secure to those not logged in\n\t// you should add to this list, for each and every secure url\n\tif (req.url === '/calendar' && (!req.session || !req.session.authenticated)) {\n\t\tres.render('unauthorised', { status: 403 });\n\t\treturn;\n\t}\n\n\tnext();\n}", "title": "" }, { "docid": "46a22409457e14547885d0df98a0faa6", "score": "0.69008297", "text": "function isLoggedIn(request, response, next){\n if(request.isAuthenticated()){\n return next();\n }\n response.redirect('/');\n \n }", "title": "" }, { "docid": "b99abd11faaae245667b4a1bd8be7817", "score": "0.6893419", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/\");\n}", "title": "" }, { "docid": "69c82eb26607d1e5490d567d985a80ea", "score": "0.68931836", "text": "function checkAuthenticated(req, res, next) {\n if(req.isAuthenticated()) {\n next()\n }\n res.redirect('/login')\n}", "title": "" }, { "docid": "b6ec03afd64f09a2c2d848718a0cdf11", "score": "0.68901503", "text": "function isLoggedIn(req, res) {\r\n if (req.isAuthenticated()){\r\n return true;\r\n } else {\r\n return false\r\n }\r\n}", "title": "" }, { "docid": "f73b013d5e00cb94ec28ad99df48d79d", "score": "0.6884159", "text": "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n req.session.error = 'Access denied!';\n res.redirect('/login');\n }\n}", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "853df840be86497b20ba958302ffa6fc", "score": "0.68779784", "text": "canHandleAuthentication() {\n return false;\n }", "title": "" }, { "docid": "1d64594b702df80af4498eedbe46cad3", "score": "0.68764365", "text": "function isLoggedIn(request, response, next) {\n\tif (!request.isAuthenticated()) {\n\t\t// response.status(401).redirect(\"/login\"); // unauthorized code\n\t\tresponse.sendStatus(401);\n\t} else {\n\t\tnext();\n\t}\n\t// response.redirect(\"/login\");\n}", "title": "" }, { "docid": "829c62de9546aa87842aa86ee92b9c06", "score": "0.68729335", "text": "function isAuthincation(req,res,next){\n\tif(req.isAuthenticated()){\n\t\treturn next();\n\t}\n\telse {\n\t\tres.redirect('/login');\n}\n}", "title": "" }, { "docid": "208650fb1b2048362d21866e271e5a2c", "score": "0.68701833", "text": "function protection(req, res, next) {\n if (req.session && req.session.username) {\n next();\n } else {\n res.status(401).json({\n message: 'Log in or else...'\n });\n }\n}", "title": "" }, { "docid": "96945dec649855aeccd96e47eac31f31", "score": "0.6863082", "text": "function authorization(req, res, next) {\n // Authorization\n if (req.currentUserId != req.params.userId) {\n return res.status(403).send(\"You're not allowed to do that\")\n }\n next();\n}", "title": "" }, { "docid": "8e25c8c190c3eaad13b0b75ae57cd501", "score": "0.68583447", "text": "function isAuth(req, res, next) {\n\t\tif (req.isAuth && req.user.username) {\n\t\t\tnext();\n\t\t} else {\n\t\t\tres.sendStatus(401);\n\t\t}\n\t}", "title": "" }, { "docid": "bb102e7d3bf8ba641c4088305ef33e42", "score": "0.6854281", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()){\n return next();\n }\n }", "title": "" }, { "docid": "851b6b19d4cd2cfd27e3e84e79af1d8b", "score": "0.68452424", "text": "function checkAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) {\n\t\treturn next();\n\t}\n\tres.redirect('/login');\n}", "title": "" }, { "docid": "c94135b86f3d236de4cc4d5cb5af8f54", "score": "0.6843425", "text": "function denyNotLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.status(401).send({ error: \"401\" });\n}", "title": "" }, { "docid": "4e39b1253c679d180733390ac5d69960", "score": "0.6842941", "text": "function isAuthenticated(req, res, next) {\n // console.log(req)\n if(req.user) return next();\n else res.status(401).json({message: 'unauthorized!'});\n}", "title": "" }, { "docid": "7dbc59444daa12bbce6977ffc4e80289", "score": "0.6817786", "text": "function checkAuthenticated(req,res,next) {\n if (req.isAuthenticated()) {\n return res.redirect('/users/profile');\n }\n next();\n}", "title": "" }, { "docid": "1fbd9f9aa67b9438e2b794098ec91dbe", "score": "0.68154", "text": "function checkNotAuthenticated(req, res, next) {\n if(req.isAuthenticated()) {\n return res.redirect('/')\n }\n next()\n}", "title": "" }, { "docid": "0f37921dc1771ffc8ec272d975f37cca", "score": "0.68124074", "text": "function authRequired(request, response, next) {\n if(!request.session.user) {\n response.redirect('/login');\n } else {\n next();\n }\n}", "title": "" }, { "docid": "5e9a78da94108ebd5714cab0fbc08df6", "score": "0.6810254", "text": "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated()){\n return next();\n }\n else{\n console.log('unauthorized access attempt!');\n // if they aren't redirect them to the home page\n // res.redirect('/');\n return res.status(401).json({ success: false, message: 'authentication failed' });\n }\n \n}", "title": "" }, { "docid": "c720506ebe550a5e73fdd737000db230", "score": "0.6807523", "text": "function authenticating() { \r\n if (!Meteoris.Role.userIsInGroup(\"admin\")){\r\n Meteoris.Flash.set(\"danger\", \"403 Unauthenticated\");\r\n FlowRouter.go(\"/\");\r\n }\r\n}", "title": "" }, { "docid": "dcaf837eadbbef65f7a215f0c7c67019", "score": "0.68060887", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n }\n\n res.redirect('/login')\n}", "title": "" }, { "docid": "1bb375b5c8b659d9fbf95c87a66a17f2", "score": "0.6805275", "text": "function isAuthenticated(req,res,next) {\n if(req.user){\n return next();\n }\n else {\n res.status(401).send('please sign in to continue')\n }\n}", "title": "" }, { "docid": "ad4b171f886107fbeb174056408d3a1e", "score": "0.67984873", "text": "function isAuth(req, res, next){\n\t\tif(req.user)\n \t\treturn next();\n \telse\n \t\tres.redirect('/login');\n\t}", "title": "" }, { "docid": "d74d8b3bccb88d5dd7d6c2830f41b8f8", "score": "0.67812365", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.send('noauth');\n}", "title": "" }, { "docid": "61a69c73bcecc9f8fa8d71d8213641db", "score": "0.67786014", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n res.redirect('/user/login');\n}", "title": "" }, { "docid": "516868e54a528f67175f9b7a24836d77", "score": "0.67768663", "text": "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) return next();\n res.send(401);\n}", "title": "" }, { "docid": "81588fbd38c7ad7f990964eaa85bda94", "score": "0.6776795", "text": "function checkNotAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n res.redirect('/account');\n }\n\n next();\n}", "title": "" }, { "docid": "475410fb294ba2578d59bc73f13936dd", "score": "0.67767763", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/api/vendor/login\");\n}", "title": "" }, { "docid": "0d62bc977d2592b81c58270a5c6bdd2c", "score": "0.6769315", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated())\r\n return next();\r\n\r\n res.send('noauth');\r\n}", "title": "" }, { "docid": "0b89327be625dd5a7b49740aa6ed9723", "score": "0.67669725", "text": "function checkNotAuthenticated(req, res, next) {\n\t\tif (req.session.user) {\n\t\t\treturn res.redirect('/profile');\n\t\t}\t\n\t\tnext();\n\t}", "title": "" }, { "docid": "231445a41322cc4e58a2b888b2676fbc", "score": "0.6759891", "text": "function estaAutenticado(req, res, next) {\n if (req.isAuthenticated()) {\n next();\n } else {\n res.status(401).send(\"no esta autenticado\");\n }\n}", "title": "" }, { "docid": "8de5e82d15043b8a5033d86611b6369d", "score": "0.6755234", "text": "function notLoggedIn(request, response, next){\n if(!request.isAuthenticated()){\n return next();\n }\n response.redirect('/');\n }", "title": "" }, { "docid": "d553e3e5bc4b38a6174fcb18f03caa7f", "score": "0.674557", "text": "function protectLogin(req, res, next) {\n\tif (!req.isAuthenticated())\n\t\treturn next();\n\tres.redirect('/members');\n}", "title": "" }, { "docid": "315e4fb4101870b5146e68f0ec2db368", "score": "0.6743832", "text": "function dashboardAuthenticationCheck(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated() && req.user.isadmin)\n return next();\n else if (req.isAuthenticated())\n res.redirect('/');\n else\n res.redirect('/login');\n}", "title": "" }, { "docid": "dead34ea407fecc802949ffd8e38f2be", "score": "0.67331016", "text": "function isLoggedIn(request, response, next) {\n if (request.isAuthenticated()) {\n return next();\n } else {\n response.redirect('/');\n }\n }", "title": "" }, { "docid": "4bd71c0beb6fa05605cd5081a84b8a53", "score": "0.6731421", "text": "function requireAuth(req, res, next)\n{\n //check if the user is Logged index\n if(!req.isAuthenticated())\n {\n return res.redirect('/login');\n }\n next();\n}", "title": "" }, { "docid": "fab894c59e3562da126725a11d5ba38d", "score": "0.67313886", "text": "function restricted(req, res, next) {\n\tconst password = req.headers.authorization;\n\tif(password === 'mellon') {\n\t\tnext();\n\t} \n\telse if (password) {\n\t\tres\n\t\t\t.status(401)\n\t\t\t.json({ err: 'invalid credentials' });\n\t}\n\telse {\n\t\tnext({ err: 'no credentials provided' });\n\t}\n}", "title": "" }, { "docid": "8a6d07f6a0643bdd2ead11848cd28197", "score": "0.6727881", "text": "function checkAuthenticated(req, res, next) {\n\t\tif (req.session.user) {\n\t\t\treturn next();\n\t\t}\t\n\t\tres.redirect('/');\n\t}", "title": "" }, { "docid": "8be23ed755faededa765853c52bc5844", "score": "0.6727232", "text": "function isLoggedInNoRedirect (req, res, next) {\n\n if (req.isAuthenticated()) {\n\n return next()\n }\n else {\n\n res.send('jChat');\n }\n }", "title": "" }, { "docid": "fc8280604e27a9ebbd368532b115abc1", "score": "0.67252296", "text": "function authenticated(request, response, next) {\n\n if ( request.isAuthenticated() ) {\n return next();\n }\n\n response.send(401, \"User not authenticated\");\n}", "title": "" }, { "docid": "590c27f9a1a39a43c5d72b330a6b29dd", "score": "0.6724424", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated()) return next();\n\n // If not authenticated, then redirect to the signin page\n res.redirect(\"/creation\");\n }", "title": "" }, { "docid": "5a0639e50387549f2f72b605f2cf07db", "score": "0.67243093", "text": "function checkAuth(req,res){\n\t\tif(req.isAuthenticated())res.redirect(\"/user\");\n\t\telse res.redirect(\"/login\");\n\t}", "title": "" }, { "docid": "2bdd53e6ef18d13c7db2bc945e4a5fc9", "score": "0.67236656", "text": "function isLoggedIn(req, res, next) {\n\t if (req.isAuthenticated()) return next();\n\t else res.redirect('/signin');\n\t}", "title": "" }, { "docid": "e47df54e38259e53b1968db1e4efa1d7", "score": "0.67210656", "text": "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()){\n return next() // if the users is authenticated, move to the next thing.\n }else{\n res.redirect('/login') //else redirect them to the login page\n }\n }", "title": "" }, { "docid": "80a0d7d49bebfe480ad9ff0398b1b63d", "score": "0.67202145", "text": "function isLoggedIn(req, res, next) {\n if (!req.isAuthenticated())\n res.json(common.getErrorObj(\"unauthorized\"));\n else\n next();\n}", "title": "" }, { "docid": "1e17397940674c1c3ddc9f2756d3acbf", "score": "0.6719915", "text": "function isLoggedIn(req, res, next) {\n req.user ? next() : res.sendStatus(401);\n}", "title": "" }, { "docid": "f35eb3e91e68f4d96dde071191aa5afa", "score": "0.6719913", "text": "function simpleAuthCheck(req, res, next) {\n if (!req.isAuthenticated()) {\n return res.json( { status: 'failure' } );\n } else {\n next();\n }\n}", "title": "" }, { "docid": "aa674e68b6f2b6ceb18a8727ca85a8e7", "score": "0.6719467", "text": "function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n next();\r\n } else {\r\n res.status(401);\r\n res.json({msg: 'Unauthorized'});\r\n }\r\n}", "title": "" } ]
2ff0dba88d6dc0f8ad8fbe27b1cdd61b
checkbox: if checked clicking the map will produce a time series chart
[ { "docid": "1be0ebb88dbc43df6754ffd9a0be2f22", "score": "0.0", "text": "function change_cursor(bool, box) {\n if(bool) Map.style().set({cursor: 'crosshair'});\n else Map.style().set({cursor: 'hand'});\n}", "title": "" } ]
[ { "docid": "5cd64cefa830f3c1ffe7df235565905b", "score": "0.6735279", "text": "function clickTracts() {\n\tvar tractCheckBox = document.getElementById(\"tractToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\ttractCheckBox.checked = false;\n\t}\n\tif (tractCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\ttracts.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#parkTractsSymbology').append(parkTractsSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (tractCheckBox.checked == false) {\n\t\ttracts.removeFrom(map);\n\t\t$('#parkTractsSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "70d1ff8fd49ff2faa8e7b4dfcfd00971", "score": "0.66471463", "text": "function clickStormTide() {\n\tvar stormTideCheckBox = document.getElementById(\"stormTideToggle\");\n\tif (stormTideCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplaySensorGeoJSON(\"stormtide\", \"Storm Tide Sensor\", fev.urls[\"stormtide\" + 'GeoJSONViewURL'] + fev.queryStrings.sensorsQueryString, window[\"stormtide\" + 'MarkerIcon']);\n\t\t//Layers that appear on initial load are assigined a value of 0, and then a value of 1 when the map is first loaded\n\t\t//When they are turned off, they are given a value of 3\n\t\t//Values of 0 or 3 indicate that symbol and name in legend is off \n\t\tif (stormtideStart == 0 || stormtideStart == 3) {\n\t\t\t//Add symbol and layer name to legend\n\t\t\t$('#stormTideSymbology').append(stormTideSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (stormTideCheckBox.checked == false) {\n\t\tstormtide.clearLayers(map);\n\t\t$('#stormTideSymbology').children().remove();\n\t\tstormtideStart = 3;\n\t}\n}", "title": "" }, { "docid": "de5f0e5a285ba00ca2037124f047c7e5", "score": "0.6503496", "text": "function nightMode(){\n if(checkbox.checked){\n initMapNight();\n }\n else {\n initMap();\n }\n }", "title": "" }, { "docid": "4d534d81c1ab732aa2d45d9519361949", "score": "0.6456273", "text": "function clickStreamGage() {\n\tvar streamgageCheckBox = document.getElementById(\"streamGageToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\tstreamgageCheckBox.checked = false;\n\t}\n\tif (streamgageCheckBox.checked == true) {\n\t\t//var bbox = map.getBounds().getSouthWest().lng.toFixed(7) + ',' + map.getBounds().getSouthWest().lat.toFixed(7) + ',' + map.getBounds().getNorthEast().lng.toFixed(7) + ',' + map.getBounds().getNorthEast().lat.toFixed(7);\n\t\t//queryNWISrtGages(bbox);\n\t\t//When checkbox is checked, add layer to map\n\t\tUSGSrtGages.addTo(map);\n\t\t$('#nwisLoadingAlert').show();\n\t\tvar bbox = map.getBounds().getSouthWest().lng.toFixed(7) + ',' + map.getBounds().getSouthWest().lat.toFixed(7) + ',' + map.getBounds().getNorthEast().lng.toFixed(7) + ',' + map.getBounds().getNorthEast().lat.toFixed(7);\n\t\tqueryNWISrtGages(bbox);\n\t\t//Add symbol and layer name to legend\n\t\t$('#streamGageSymbology').append(streamGageSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (streamgageCheckBox.checked == false) {\n\t\tUSGSrtGages.clearLayers(map);\n\t\t$('#streamGageSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "6040a29a7453d3a3f2fbb213532a5f8f", "score": "0.6332044", "text": "function show_chart (coords, map) {\n if(box_inspect.getValue()) { \n // get point from coordinates\n var coord_array = Object.keys(coords).map(function (key) { return coords[key]; });\n var point = ee.Geometry.Point(coord_array);\n // create chart\n options.title = 'SAR backscatter time series at lon: ' + String(coords.lon) + ' lat: ' + coords.lat;\n var chart = ui.Chart.image.series(Sen1_asc_des, point)\n .setOptions(options);\n chart.style().set({width: '900px', height: '280px', position: 'bottom-left',\n padding: '0px', margin: '0px',\n });\n // figure out if click is on bottom or top half of the map\n var center_coords = Map.getCenter();\n var y_center = center_coords.coordinates().get(1);\n var position = (coords.lat > y_center.getInfo()) ? 'bottom-center' : 'top-center';\n // show chart\n var chart_panel = ui.Panel({\n widgets: [chart,\n ui.Button({\n label: 'X',\n style: {position: 'top-right',\n padding: '0px', margin: '0px',\n },\n onClick: function () { Map.remove(chart_panel); },\n }),\n ],\n layout: ui.Panel.Layout.absolute(),\n style: {width: '1000px', height: '300px', position: position,\n padding: '0px', margin: '0px',\n },\n });\n Map.add(chart_panel);\n }\n}", "title": "" }, { "docid": "d3b7e3d4099f81cdcf795eba62f38dc8", "score": "0.63042504", "text": "function clickRainGage() {\n\tvar raingageCheckBox = document.getElementById(\"rainGageToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\traingageCheckBox.checked = false;\n\t}\n\tif (raingageCheckBox.checked == true) {\n\t\t//Add symbol and layer name to legend\n\t\t$('#rainGageSymbology').append(rainGageSymbologyInterior);\n\t\t//var bbox = map.getBounds().getSouthWest().lng.toFixed(7) + ',' + map.getBounds().getSouthWest().lat.toFixed(7) + ',' + map.getBounds().getNorthEast().lng.toFixed(7) + ',' + map.getBounds().getNorthEast().lat.toFixed(7);\n\t\t//queryNWISRainGages(bbox);\n\t\t//When checkbox is checked, add layer to map\n\t\tUSGSRainGages.addTo(map);\n\t\t$('#nwisLoadingAlert').show();\n\t\tvar bbox = map.getBounds().getSouthWest().lng.toFixed(7) + ',' + map.getBounds().getSouthWest().lat.toFixed(7) + ',' + map.getBounds().getNorthEast().lng.toFixed(7) + ',' + map.getBounds().getNorthEast().lat.toFixed(7);\n\t\tqueryNWISRainGages(bbox);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (raingageCheckBox.checked == false) {\n\t\t$('#rainGageSymbology').children().remove();\n\t\tUSGSRainGages.clearLayers(map);\n\t}\n}", "title": "" }, { "docid": "086d524766f40a11222b2bf09dfa6f94", "score": "0.61776924", "text": "function clickDOI() {\n\tvar doiCheckBox = document.getElementById(\"doiToggle\");\n\t//Prevent user from using toggle when zoom is less than 8\n\tif (map.getZoom() < 6) {\n\t\tdoiCheckBox.checked = false;\n\t}\n\tif (doiCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdoiRegions.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#doiSymbology').append(doiSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (doiCheckBox.checked == false) {\n\t\tdoiRegions.removeFrom(map);\n\t\t$('#doiSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "b29b24660857bd74a72939c18cf6cc8f", "score": "0.616774", "text": "function clicked_on_map(pos_in_data){\n chart_obj.setSelection([]);\n highlight_point(pos_in_data);\n}", "title": "" }, { "docid": "a0c8cba4e848ca00d07f750830544696", "score": "0.61607355", "text": "function clickTideCurrent() {\n\tvar tideCurrentCheckBox = document.getElementById(\"tideCurrentToggle\");\n\tif (tideCurrentCheckBox.checked == true) {\n\t\t//Add symbol and layer name to legend\n\t\t$('#tideCurrentSymbology').append(tideCurrentSymbologyInterior);\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplayTidesGeoJSON(\n \"tides\",\n \"NOAA Tides and Currents\",\n \"https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/stations.json\",\n tidesMarkerIcon\n );\n\t\t tides.addTo(map)\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (tideCurrentCheckBox.checked == false) {\n\t\t$('#tideCurrentSymbology').children().remove();\n\t\ttides.clearLayers(map);\n\t}\n}", "title": "" }, { "docid": "082d16adcb938c04d66e26a1e9fd486f", "score": "0.6138536", "text": "function clickMet() {\n\tvar metCheckBox = document.getElementById(\"metToggle\");\n\tif (metCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplaySensorGeoJSON(\"met\", \"Meteorlogical Sensor\", fev.urls[\"met\" + 'GeoJSONViewURL'] + fev.queryStrings.sensorsQueryString, window[\"met\" + 'MarkerIcon']);\n\t\t//Layers that appear on initial load are assigined a value of 0, and then a value of 1 when the map is first loaded\n\t\t//When they are turned off, they are given a value of 3\n\t\t//Values of 0 or 3 indicate that symbol and name in legend is off \n\t\tif (metStart == 0 || metStart == 3) {\n\t\t\t//Add symbol and layer name to legend\n\t\t\t$('#meteorlogicalSymbology').append(meteorlogicalSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (metCheckBox.checked == false) {\n\t\tmet.clearLayers(map);\n\t\t$('#meteorlogicalSymbology').children().remove();\n\t\tmetStart = 3;\n\t}\n}", "title": "" }, { "docid": "230a2bcab0669aff3f631f4e6f25addf", "score": "0.60717237", "text": "function clickPeakLabels() {\n\tvar checkBox = document.getElementById(\"peakCheckbox\");\n\t//Prevent user from using toggle when zoom is less than 8\n\tif (map.getZoom() < 8) {\n\t\tcheckBox.checked = false;\n\t}\n\t//Display peak labels when toggle is on\n\tif (checkBox.checked == true) {\n\t\tpeak.eachLayer(function (myMarker) {\n\t\t\tmyMarker.showLabel();\n\t\t});\n\t\t//Remove peak labels when toggle is off\n\t} else {\n\t\tpeak.eachLayer(function (myMarker) {\n\t\t\tmyMarker.hideLabel();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "2cfc840cac6af535c917b839d31955c6", "score": "0.6046722", "text": "function handleClick(cb){\n\tvar view = new google.visualization.DataView(data, options);\n visibleColumns.length = 0;\n visibleColumns.push(0);\n colorsArray = [];\n\t\n if (document.getElementById('Blue').checked) {\n visibleColumns.push(1);\n colorsArray.push('blue');\n }\n\n if (document.getElementById('Red').checked) {\n visibleColumns.push(2);\n colorsArray.push('red');\n }\n\n if (document.getElementById('Orange').checked) {\n visibleColumns.push(3);\n colorsArray.push('orange');\n }\n\n if (document.getElementById('Green').checked) {\n visibleColumns.push(4);\n colorsArray.push('green');\n }\n\n view.setColumns(visibleColumns);\n chart.draw(view, {\n\t\ttitle:'Colors',\n\t\twidth: 500,\n\t\theight: 400,\n\t\tanimation:{\n\t\t\tduration: 1000,\n\t\t\teasing: 'out',\n\t\t\tstartup: true\n\t\t},\n\t\tcolors: colorsArray,\n\t\tlegend: 'none'\n });\n}", "title": "" }, { "docid": "bf4d5f5a30c4f4979a638045ecc7a971", "score": "0.6013028", "text": "function addLayerToMap3(element) {\n if (element.checked){\n Track_Forecast();\n\t\tforecast_track.addTo(map);\n } else {\n\t\tforecast_track.remove();\n\t};\n\t\n}", "title": "" }, { "docid": "89268be757736f0d8a65a8b4b8df0673", "score": "0.59882104", "text": "function toggleTract() {\n showTractsBoarder = (showTractsBoarder ? false: true);\n \n clearMap();\n drawMap();\n }", "title": "" }, { "docid": "058245a7d3cd2f137b0a09a1a4f42e1b", "score": "0.5987945", "text": "addSatelliteToggle(map) {\n // Adds toggle for satellite view of underlying map\n document.getElementById(\"onoffswitch-satlayer\").onchange = function(e){\n var overlayLayerNames = ['water', 'building', 'landuse_industrial', 'landuse_park',\n 'landuse_overlay_national_park', 'landuse_wood', 'landcover_snow',\n 'landcover_crop', 'landcover_grass', 'landcover_scrub', 'landcover_wood',\n 'hillshade_highlight_bright', 'hillshade_highlight_med',\n 'hillshade_shadow_faint', 'hillshade_shadow_med', 'hillshade_shadow_dark',\n 'hillshade_shadow_extreme'\n ];\n e.preventDefault();\n e.stopPropagation();\n if (this.checked === false) {\n map.hideLayer('satellite');\n for (let i = 0; i < overlayLayerNames.length; i++) {\n map.showLayer(overlayLayerNames[i]);\n }\n } else {\n map.showLayer('satellite');\n for (let i = 0; i < overlayLayerNames.length; i++) {\n map.hideLayer(overlayLayerNames[i]);\n }\n }\n }\n }", "title": "" }, { "docid": "c97705e7e93343548d5ccc87e293512d", "score": "0.5960231", "text": "function initChart() {\n if (!showChart) {\n return;\n }\n\n addTimelineChart(ee.Geometry(Map.getCenter(true)).centroid(10));\n\n Map.onClick(function (coords) {\n coords = ee.Dictionary(coords);\n print('Map clicked: ', coords);\n var newCenter = ee.Geometry.Point([coords.get('lon'), coords.get('lat')]);\n addTimelineChart(newCenter);\n });\n }", "title": "" }, { "docid": "c4d077a72967b3493c44a5ff74882198", "score": "0.59372157", "text": "checkboxFilterSelection() {\n const housingTypeSelection = $('[name=\"housing_type\"]').map(() => [this.checked]);\n this.HousingTypeFilter.setFilter(\n housingTypeSelection[0], // Family\n housingTypeSelection[1], // Senior\n housingTypeSelection[2], // Student (Not Used {default: false})\n );\n\n const affordabilitySelection = $('[name=\"affordability\"]').map(() => [this.checked]);\n this.AffordabilityFilter.setFilter(\n affordabilitySelection[0], // Affordable\n affordabilitySelection[1], // Luxury\n affordabilitySelection[2], // Market Rate\n affordabilitySelection[3], // Market Rate & Affordable\n );\n\n // Draw the map with the updated filters\n this.drawMap();\n }", "title": "" }, { "docid": "0379be9af0ce8dcf53e3b51a766d7acd", "score": "0.59208965", "text": "function pushToChart() {\n if ($(\"input[type=checkbox]:checked\").length === 0) {\n\n }\n else {\n $(\"input[type=checkbox]:checked\").each(function () {\n chartArr.push(this.id.toUpperCase());\n })\n }\n }", "title": "" }, { "docid": "e7132ff1be94dd0c43605939f920ed36", "score": "0.59002", "text": "function ShowMap()\r\r\n{\r\r\n var topoDiv = GetObject('Topo');\r\r\n var trailsDiv = GetObject('Trails');\r\r\n if (topoDiv && trailsDiv)\r\r\n {\r\r\n var topoCheck = GetObject('TopoRadio');\r\r\n var trailsCheck = GetObject('TrailsRadio');\r\r\n var topoTrailsCheck = GetObject('TopoTrailsRadio');\r\r\n if (topoCheck && topoCheck.checked)\r\r\n {\r\r\n topoDiv.style.visibility = \"visible\";\r\r\n trailsDiv.style.visibility = \"hidden\";\r\r\n }\r\r\n else if (trailsCheck && trailsCheck.checked)\r\r\n {\r\r\n topoDiv.style.visibility = \"hidden\";\r\r\n trailsDiv.style.visibility = \"visible\";\r\r\n }\r\r\n else if (topoTrailsCheck && topoTrailsCheck.checked)\r\r\n {\r\r\n topoDiv.style.visibility = \"visible\";\r\r\n trailsDiv.style.visibility = \"visible\";\r\r\n }\r\r\n }\r\r\n}", "title": "" }, { "docid": "f6cbf5a970974c82098cfdad017a1ddf", "score": "0.5879545", "text": "function hitAllPlotCheckboxes(trueOrFalse){\n var checkboxes = $('input[type=\"checkbox\"]').prop('checked', trueOrFalse); \n}", "title": "" }, { "docid": "eabdc950cc3d0bf9768e62afeb5afb74", "score": "0.5869857", "text": "function chartToggleSeries(placeholder) {\n\n\t\tvar datasets = {\n\t\t\t\"usa\": {\n\t\t\t\tlabel: \"USA\",\n\t\t\t\tdata: [[1988, 483994], [1989, 479060], [1990, 457648], [1991, 401949], [1992, 424705], [1993, 402375], [1994, 377867], [1995, 357382], [1996, 337946], [1997, 336185], [1998, 328611], [1999, 329421], [2000, 342172], [2001, 344932], [2002, 387303], [2003, 440813], [2004, 480451], [2005, 504638], [2006, 528692]]\n\t\t\t},\n\t\t\t\"russia\": {\n\t\t\t\tlabel: \"Russia\",\n\t\t\t\tdata: [[1988, 218000], [1989, 203000], [1990, 171000], [1992, 42500], [1993, 37600], [1994, 36600], [1995, 21700], [1996, 19200], [1997, 21300], [1998, 13600], [1999, 14000], [2000, 19100], [2001, 21300], [2002, 23600], [2003, 25100], [2004, 26100], [2005, 31100], [2006, 34700]]\n\t\t\t},\n\t\t\t\"uk\": {\n\t\t\t\tlabel: \"UK\",\n\t\t\t\tdata: [[1988, 62982], [1989, 62027], [1990, 60696], [1991, 62348], [1992, 58560], [1993, 56393], [1994, 54579], [1995, 50818], [1996, 50554], [1997, 48276], [1998, 47691], [1999, 47529], [2000, 47778], [2001, 48760], [2002, 50949], [2003, 57452], [2004, 60234], [2005, 60076], [2006, 59213]]\n\t\t\t},\n\t\t\t\"germany\": {\n\t\t\t\tlabel: \"Germany\",\n\t\t\t\tdata: [[1988, 55627], [1989, 55475], [1990, 58464], [1991, 55134], [1992, 52436], [1993, 47139], [1994, 43962], [1995, 43238], [1996, 42395], [1997, 40854], [1998, 40993], [1999, 41822], [2000, 41147], [2001, 40474], [2002, 40604], [2003, 40044], [2004, 38816], [2005, 38060], [2006, 36984]]\n\t\t\t},\n\t\t\t\"denmark\": {\n\t\t\t\tlabel: \"Denmark\",\n\t\t\t\tdata: [[1988, 3813], [1989, 3719], [1990, 3722], [1991, 3789], [1992, 3720], [1993, 3730], [1994, 3636], [1995, 3598], [1996, 3610], [1997, 3655], [1998, 3695], [1999, 3673], [2000, 3553], [2001, 3774], [2002, 3728], [2003, 3618], [2004, 3638], [2005, 3467], [2006, 3770]]\n\t\t\t},\n\t\t\t\"sweden\": {\n\t\t\t\tlabel: \"Sweden\",\n\t\t\t\tdata: [[1988, 6402], [1989, 6474], [1990, 6605], [1991, 6209], [1992, 6035], [1993, 6020], [1994, 6000], [1995, 6018], [1996, 3958], [1997, 5780], [1998, 5954], [1999, 6178], [2000, 6411], [2001, 5993], [2002, 5833], [2003, 5791], [2004, 5450], [2005, 5521], [2006, 5271]]\n\t\t\t},\n\t\t\t\"norway\": {\n\t\t\t\tlabel: \"Norway\",\n\t\t\t\tdata: [[1988, 4382], [1989, 4498], [1990, 4535], [1991, 4398], [1992, 4766], [1993, 4441], [1994, 4670], [1995, 4217], [1996, 4275], [1997, 4203], [1998, 4482], [1999, 4506], [2000, 4358], [2001, 4385], [2002, 5269], [2003, 5066], [2004, 5194], [2005, 4887], [2006, 4891]]\n\t\t\t}\n\t\t};\n\n\t\t// hard-code color indices to prevent them from shifting as countries are turned on/off\n\t\tvar i = 0;\n\t\t$.each(datasets, function(key, val) {\n\t\t\tval.color = i;\n\t\t\t++i;\n\t\t});\n\n\t\t// insert checkboxes \n\t\tvar choiceContainer = $(\"#choices\");\n\t\t$.each( datasets, function( key, val ) {\n\n\t\t\tchoiceContainer.append(\n\t\t\t\t\"<label class='fancy-checkbox custom-bgcolor-green'><input type='checkbox' name='\" + key + \"' checked='checked' id='id\" + key + \"'><span for='id\" + key + \"'>\" + val.label + \"</span></label>\"\n\t\t\t);\n\t\t});\n\n\t\tchoiceContainer.find(\"input\").click( function() {\n\t\t\tplotAccordingToChoices(placeholder, datasets);\n\t\t});\n\n\t\tplotAccordingToChoices(placeholder, datasets);\n\t}", "title": "" }, { "docid": "a18d97ff47b61babeafa22e1d7eb9169", "score": "0.5841466", "text": "function selectionChange(){\n heatMap.wrangleData();\n heatMap.hideTutorial();\n}", "title": "" }, { "docid": "ad14688603e2647b6fcd24a65b7195aa", "score": "0.5822906", "text": "selectMap() {\n const map = true;\n\n this.setData({\n map: map\n })\n }", "title": "" }, { "docid": "f468b0bc77b7334d67277a21dc0cec4f", "score": "0.58203906", "text": "checkboxUpdate (e){\n e.preventDefault();\n let dataval = this.state.data;\n dataval['has_maps'] = !this.state.has_maps;\n this.setState({data:dataval, has_maps:!this.state.has_maps});\n }", "title": "" }, { "docid": "dc06c62def18fcd7cd2c39ed563b88f4", "score": "0.5808707", "text": "function getRowAndShowMap()\n{\n // Get raw row data\n var rawRow = getCheckedRow();\n // Get parsed row\n var parsedRow = parseRow(rawRow);\n // Get coordinates\n var coordinates = parsedRow[4].split(/\\|/);\n // Get row number\n var num = parsedRow[5];\n\n $(\"#hid_btn\" + num).show();\n \n // Initializing marked map with the set coordinates\n google.maps.event.addDomListener(window, 'load', initializeMarkedMap(coordinates[0],coordinates[1],12,'map2', parsedRow[1]));\n}", "title": "" }, { "docid": "cdda18b69268b776d7a301d0c3353773", "score": "0.5801958", "text": "function clickBounds() {\n\tvar parkBoundsCheckBox = document.getElementById(\"parkBoundsToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\tparkBoundsCheckBox.checked = false;\n\t}\n\tif (parkBoundsCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tbounds.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#parkBoundsSymbology').append(parkBoundsSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (parkBoundsCheckBox.checked == false) {\n\t\tbounds.removeFrom(map);\n\t\t$('#parkBoundsSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "1fb0b5adbdc8216110611753b7ded3d2", "score": "0.5797349", "text": "function clickPeaks() {\n\tvar peaksCheckBox = document.getElementById(\"peaksToggle\");\n\tif (peaksCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplayPeaksGeoJSON(\"peak\", \"Peak Summary\", fev.urls.peaksFilteredGeoJSONViewURL + fev.queryStrings.peaksQueryString, peakMarkerIcon);\n\t\tvar peakvalues = getPeakValues(\"peak\", \"Peak Summary\", fev.urls.peaksFilteredGeoJSONViewURL + fev.queryStrings.peaksQueryString, peakMarkerIcon);\n\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (peaksCheckBox.checked == false) {\n\t\t$('#PeakSummarySymbology').children().remove();\n\t\tpeak.clearLayers();\n\t\tvar peakLabels = document.getElementById(\"peakCheckbox\");\n\t\tpeakLabels.checked = false;\n\t\tpeakStart = 0;\n\t}\n}", "title": "" }, { "docid": "5c958b8e4b43ea9b0bf0d2c7e953abd2", "score": "0.5745075", "text": "function storm_track_visable(onOff){\n if (onOff){\n mymap.addLayer(sat_marker);\n mymap.addLayer(marker);\n mymap.addLayer(polyline);\n }else{\n mymap.removeLayer(sat_marker);\n mymap.removeLayer(marker);\n mymap.removeLayer(polyline);\n }\n}", "title": "" }, { "docid": "5106d1622b58b311c53506ab9502bd97", "score": "0.5739149", "text": "function clicked(d) {\n var x;\n var y;\n var k;\n\n //if one island is clicked...\n if (d && centered !== d) {\n islandFilter.filterBy('island', d.name);\n var centroid = path.centroid(d);\n x = centroid[0] - 25;\n y = centroid[1] + 75;\n k = 2;\n centered = d;\n mapTip.show(d);\n setTimeout(function () {\n mapTip.hide();\n }, 7000);\n\n //if no islands are selected\n } else {\n islandFilter.filterBy('island', 'total');\n x = width / 2;\n y = height / 2;\n k = 1;\n centered = null;\n mapTip.hide(d);\n }\n\n g.selectAll('path').classed('active', centered && function (d) {\n return d === centered;\n });\n\n //adjusts size and projection of map when single island is clicked\n g.transition().duration(750).attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')scale(' + k + ')translate(' + -x + ',' + -y + ')').style('stroke-width', 1.5 / k + 'px');\n }", "title": "" }, { "docid": "e0ee2c123bdb1910e4f107bf622abac9", "score": "0.5733649", "text": "function createMapAndLegend(state, county, fireData, aqiData, selectedYear, selectedMonth, selectedDay) {\n if (radio_val == \"airQuality\") {\n showAqiMap(state, county, fireData, aqiData, selectedYear, selectedMonth, selectedDay)\n button_pressed = 0\n }\n else {\n showFireMap(state, county, fireData, aqiData, selectedYear, selectedMonth, selectedDay)\n button_pressed = 0\n }\n}", "title": "" }, { "docid": "47e2193563165a9a1cb09a737e1fcfc5", "score": "0.5718448", "text": "function clickInterestFWS() {\n\tvar interestFWSCheckBox = document.getElementById(\"interestFWSToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\tinterestFWSCheckBox.checked = false;\n\t}\n\tif (interestFWSCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tint.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#interestFWSSymbology').append(interestFWSSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (interestFWSCheckBox.checked == false) {\n\t\tint.removeFrom(map);\n\t\t$('#interestFWSSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "aa3bac3a8b0f2fc11460f4aa21241aba", "score": "0.571687", "text": "static toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }", "title": "" }, { "docid": "f1e74cfba1fc8db36ee9d44f327d6fca", "score": "0.57104295", "text": "function clickCRMS() {\n\tvar crmsCheckBox = document.getElementById(\"crmsToggle\");\n\tif (crmsCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tcrms.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#crmsSymbology').append(crmsSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (crmsCheckBox.checked == false) {\n\t\tcrms.removeFrom(map);\n\t\t$('#crmsSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "08434e05251b22a7076723a8a40064a7", "score": "0.57031375", "text": "function checkBox_Grasswaterways(options) { //E: Function for checkbox Grasswaterways\r\n var container = document.createElement('DIV'); //first make the outer container\r\n container.className = \"checkboxContainer\";\r\n container.title = options.title;\r\n container.id = options.id1;//'filter';\r\n\r\n var span = document.createElement('SPAN'); //E:It creates the check-box square\r\n span.role = \"checkbox\";\r\n span.className = \"checkboxSpan\";\r\n\r\n var bDiv = document.createElement('DIV'); //E:It creates a blank DIV to draw the \"check\" symbol v.\r\n bDiv.className = \"blankDiv\";\r\n bDiv.id = options.id2;\r\n\r\n var image = document.createElement('IMG'); //E:It creates a tag \"IMG\" with the check symbol v.\r\n image.className = \"blankImg\";\r\n image.src = \"https://maps.gstatic.com/mapfiles/mv/imgs8.png\";\r\n\r\n var label = document.createElement('LABEL'); //E:It creates a tag \"LABEL\" with the name Label.\r\n label.className = \"checkboxLabel\";\r\n label.innerHTML = options.label;\r\n\r\n container.appendChild(label); // If this DOM goes at the end, order of presentation will be switch\r\n bDiv.appendChild(image);\r\n span.appendChild(bDiv);\r\n container.appendChild(span);\r\n\r\n if (bmpArray_asNumbers[4]==0){//E: This condition un-check the box when the conservation practice is not set.\r\n bDiv.style.display = 'none';\r\n }\r\n\r\n //E: This lines draws the check box into the map, as it is called the 'checkBox' function.\r\n google.maps.event.addDomListener(container,'click',function(){\r\n if (bmpArray_asNumbers[4]==0){\r\n alert (\"This option is not available because 'Grasswaterways' was not set\");\r\n } else {\r\n // alert (\"'Grasswaterways' option was SET\");//E: For test. This message is Not needed for users\r\n toggleLayerNew(grassArray, grass);\r\n\r\n // The \"checked\" or \"unchecked\" condition is controlled by using 'css' style here\r\n (document.getElementById(bDiv.id).style.display == 'none') ?\r\n document.getElementById(bDiv.id).style.display = 'block' : document.getElementById(bDiv.id).style.display = 'none';\r\n\r\n //E: This 'if' checks if 'Grasswaterways' checkbox is checked to send info to the tracking function\r\n if (window.getComputedStyle(bDiv).display === \"none\") {\r\n // alert (\"Action: Un-check Grasswaterways check-box\");//E: For test\r\n report('m-clk', 'Un-check Grasswaterways check-box;'); //E: report 'Grasswaterways' un-check\r\n } else {\r\n // alert (\"Action: Check Grasswaterways check-box\");//E: For test\r\n report('m-clk', 'Check Grasswaterways check-box;'); //E: report 'Grasswaterways' un-check\r\n }\r\n }\r\n // options.action(); // option to add some other function\r\n });\r\n return container;\r\n}", "title": "" }, { "docid": "299f16b084c13282f042fc57806f74c2", "score": "0.5701211", "text": "function mostrarMapa() {\n let mapa = document.querySelector('#mapaSede');\n let checkboxMapa = document.querySelector('#checkboxMostrarMapa');\n\n if (checkboxMapa.checked == false) {\n mapa.classList.add('ocultar');\n } else {\n mapa.classList.remove('ocultar');\n }\n}", "title": "" }, { "docid": "369ea976a82fb5468cb6ccf58f5966da", "score": "0.5698448", "text": "function showMarkers() {\n\n\t// Get value of marker radio button that is on\n\ttype = $(\"input[name=showpins]:checked\").val();\n\n\tfor (var i=0; i<markers.length; i++) {\n\n\t\tif (markers[i].type==type) {\n\t\t\tmarkers[i].addTo(map);\n\t\t} else {\n\t\t\tmap.removeLayer(markers[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "84cba2703ea317e48af511e6e9f6d201", "score": "0.56972307", "text": "function resultClick(map, lon, lat) {\n map.setView([lat, lon], 14);\n}", "title": "" }, { "docid": "861381c6efeeaf4f21d2f77074546c04", "score": "0.56932753", "text": "function clicked(d) {\n var x;\n var y;\n var k;\n\n //if one island is clicked...\n if (d && centered !== d) {\n islandFilter.filterBy('island', d.name);\n var centroid = path.centroid(d);\n x = centroid[0] - 25;\n y = centroid[1] + 75;\n k = 2;\n centered = d;\n mapTip.show(d);\n setTimeout(function () {\n mapTip.hide();\n }, 7000);\n\n //if no islands are selected\n } else {\n islandFilter.filterBy('island', 'total');\n x = width / 2;\n y = height / 2;\n k = 1;\n centered = null;\n mapTip.hide(d);\n }\n\n g.selectAll('path')\n .classed('active', centered && function(d) { return d === centered; });\n\n //adjusts size and projection of map when single island is clicked\n g.transition()\n .duration(750)\n .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')scale(' + k + ')translate(' + -x + ',' + -y + ')')\n .style('stroke-width', 1.5 / k + 'px');\n\n }", "title": "" }, { "docid": "cdd72d5ab7e03f14cd2fd27fd8a83e20", "score": "0.5686822", "text": "function lineChartClick(d) {\r\n // set parameters\r\n $(\"#curr-country-code\").val(d.name);\r\n $(\"#curr-year\").val(d.year);\r\n $(\"#selectable2\").val(d.year);\r\n \r\n PushDataToMap(AvailablePercentageSeries, $(\"#selectable\").val(), $(\"#selectable2\").val()); \r\n drawChart(null); \r\n drawLineChart();\r\n}", "title": "" }, { "docid": "5a7ac9cf50816887813747253e9389ca", "score": "0.5678304", "text": "function makeScatterPlot(column_x, column_y, force_size){\n\n\n/*console.log('making scatter mapstate : ' + mapstate)*/\n\n\ndrawAxisBottom()\n\ndrawAxisLeft()\n\nif (force_size){\n\ntransform_all_paths_to_circle(radius_name, column_x, column_y)\n\n}\n\nelse if (mapstate == 0){\n\ntransform_all_paths_to_circle(radius_name, column_x, column_y)\n\n}\n\nelse if (mapstate == 1){\n\nforce_separate_circles_for_scatter(column_x, column_y)\n}\n\nelse if (mapstate == 2){\n\nforce_separate_circles_for_scatter(column_x, column_y)\n}\n\n}", "title": "" }, { "docid": "7cea268e5d58a05106979641d9da6a78", "score": "0.5671568", "text": "function toggleData() {\n console.log(\"Clearing Map...\")\n clearMarkers();\n count = 1;\n heatmap.setMap(null);\n console.log(\"Grabbing Polygons...\")\n if (dCount == 0){\n\n $.clusterData('Amenity_Gi');\n //dataMap.setMap(map);\n //console.log(dataMap.getFeatureById('Belsize'));\n dataMap.setStyle(styleFeature);\n dataMap.addListener('mouseover', $.mouseInWard);\n dataMap.addListener('mouseout', mouseOutWard);\n\n dataMap.setMap(map);\n dCount = 1;\n }\telse\t{\n dataMap.setMap(null);\n dCount = 0;\n }\n}", "title": "" }, { "docid": "eaee2eae5c93ff5ba017750ba7080cbd", "score": "0.56715655", "text": "function showMarkers() {\n setMapOnAll();\n}", "title": "" }, { "docid": "964cc568bb7f2128e2ca25c1e885a0ee", "score": "0.5663163", "text": "function handleMapStationMarkerPopupAqiChartClick(evt, item) {\n var index = item[0][\"_index\"];\n var timestamp = item[0][\"_chart\"].data.datasets[0].measurements[index].timestamp;\n setTimelineTime(timestamp);\n}", "title": "" }, { "docid": "eab11caae9ef58a7fd8cf139717999da", "score": "0.56631136", "text": "function maptoggle(e) {\n // read the value from the slider\n var value = slider.value;\n\n var mapId = \"PERCENT OVER \" + value + \" MIN\";\n\n map.setLayoutProperty('PERCENT OVER 30 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 60 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 90 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 120 MIN', 'visibility', 'none');\n\n map.setLayoutProperty(mapId, 'visibility', 'visible');\n}", "title": "" }, { "docid": "bd11dc0d20149aa4c57ffd909e5015c1", "score": "0.5647661", "text": "function showR(group) {\n map.addOverlay(riveroutline);\n // == check the checkbox ==\n document.getElementById(group+\"box\").checked = true;\n}", "title": "" }, { "docid": "5786d110024de9232f5bcf5b6e775c8b", "score": "0.5644358", "text": "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "title": "" }, { "docid": "5786d110024de9232f5bcf5b6e775c8b", "score": "0.5644358", "text": "function updateRadonVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "title": "" }, { "docid": "43327a1d0415573171badb8d10d2d883", "score": "0.56112516", "text": "function chartMap(data, week) {\n // Draws the map, using weekly data and the given week\n Highcharts.mapChart('map', {\n\n chart: {\n map: 'countries/us/us-all',\n borderWidth: 0\n },\n\n title: {\n text: 'Forecasts for ' + (activeType > 0 ? 'New Weekly' : 'Total') + ' Deaths ' + \n week + (week > 1 ? ' Weeks' : ' Week')\n + ' Ahead ' + dateOfForecast,\n },\n\n exporting: {\n sourceWidth: 600,\n sourceHeight: 500\n },\n\n legend: {\n layout: 'vertical',\n align: 'right',\n borderWidth: 0,\n backgroundColor: 'rgba(255,255,255,0.85)',\n floating: false,\n verticalAlign: 'middle',\n },\n\n mapNavigation: {\n enabled: true\n },\n credits: {\n enabled: false\n }, \n\n colorAxis: {\n min: 1,\n type: 'linear',\n minColor: '#d0d4da',\n maxColor: '#182B49',\n stops: [\n [0, '#d0d4da'],\n [0.67, '#006A96'],\n [1, '#182B49']\n ],\n },\n\n series: [{\n data: data,\n point: {\n events: {\n click: function () {\n selectedState = this.code.slice(3).toUpperCase()\n chartForecastLine((activeType > 0 ? statesFutureInc : statesFutureCum), selectedState);\n chartLineHistorical(\n (activeType > 0 ? statesTruthInc : statesTruthCum),\n (activeType > 0 ? statesFutureInc : statesFutureCum),\n (activeType > 0 ? quantilesInc : quantilesCum),\n q,\n selectedState);\n },\n },\n },\n joinBy: ['hc-key', 'code'],\n dataLabels: {\n enabled: false,\n color: '#FFFFFF',\n format: '{point.name}',\n },\n borderColor: 'black',\n borderWidth: 0.2,\n name: 'Point Estimate',\n tooltip: {\n pointFormat: '{point.name}: {point.value}',\n valueDecimals: 3,\n }\n }]\n });\n}", "title": "" }, { "docid": "f7b94ba5cd5b5277449c4af21e8b4e9e", "score": "0.5610958", "text": "function AcademicPanTo(checkbox) {\n\tif (checkbox.checked) {\n\t\tvar AcademicPanPoint = map.panTo(L.latLng(40.875457942197876, -124.07916337251663), {animate: true, duration: 0.25});\n\t}\n else {\n\t\tmap.removeLayer(AcademicPanPoint);\n }\n}", "title": "" }, { "docid": "a4c1c8cf282c8bcceb7ee17308084492", "score": "0.5606151", "text": "function showAnswerOne(){\n heatMap.showAnswerOne();\n}", "title": "" }, { "docid": "3a786841c9744cec35492b6bf6c632ea", "score": "0.5600898", "text": "function toggleHeatmap(){\n\t\t\t\t\tpressButton($('#crimes'));\n\t\t\t\t\theatmap.setMap(heatmap.getMap() ? null : map);\n\t\t\t\t}", "title": "" }, { "docid": "c9f6e140370fb0a4b514725915863a3d", "score": "0.5586674", "text": "function checkMapState(){\n\n $(\"#slider\").slider( \"option\", \"value\", bingMap.map.getZoom()-1); //Set Slider according to zoom level\n //setTimeout(\"setZooToolBar(bingMap.map.getZoom())\",250);\n \t/*START- added by AN on 21-12-12| To hide Rotaion buttons on city view*/\n\tif (bingMap.map.isRotationEnabled())\n\t\t$(\"#bing-zoom .rotview\").show();\n\telse \n\t\t$(\"#bing-zoom .rotview\").hide();\n\t/*END- added by AN on 21-12-12*/\n\tif (bingMap.map.getZoom() <=4){\n\t\tBingMapZoomOut();\n\t}\n}", "title": "" }, { "docid": "5892b9eb63d9602d7d2f3609b16c5291", "score": "0.55858994", "text": "function checkBox_Wetlands(options) { //E: Function for checkbox No Tillage\r\n var container = document.createElement('DIV'); //first make the outer container\r\n container.className = \"checkboxContainer\";\r\n container.title = options.title;\r\n container.id = options.id1;\r\n\r\n var span = document.createElement('SPAN'); //E:It creates the check-box square\r\n span.role = \"checkbox\";\r\n span.className = \"checkboxSpan\";\r\n\r\n var bDiv = document.createElement('DIV'); //E:It creates a blank DIV to draw the \"check\" symbol v.\r\n bDiv.className = \"blankDiv\";\r\n bDiv.id = options.id2;\r\n\r\n var image = document.createElement('IMG'); //E:It creates a tag \"IMG\" with the check symbol v.\r\n image.className = \"blankImg\";\r\n image.src = \"https://maps.gstatic.com/mapfiles/mv/imgs8.png\";\r\n\r\n var label = document.createElement('LABEL'); //E:It creates a tag \"LABEL\" with the name Label.\r\n label.className = \"checkboxLabel\";\r\n label.innerHTML = options.label;\r\n\r\n container.appendChild(label); // If this DOM goes at the end, order of presentation will be switch\r\n bDiv.appendChild(image);\r\n span.appendChild(bDiv);\r\n container.appendChild(span);\r\n\r\n if (bmpArray_asNumbers[7]==0){//E: This condition un-check the box when the conservation practice is not set.\r\n bDiv.style.display = 'none';\r\n }\r\n\r\n //E: This lines draws the check box into the map, as it is called the 'checkBox' function.\r\n google.maps.event.addDomListener(container,'click',function(){\r\n if (bmpArray_asNumbers[7]==0){\r\n alert (\"This option is not available because 'Wetlands' was not set\");\r\n } else {\r\n // alert (\"'Wetlands' option was SET\");//E: For test. This message is Not needed for users\r\n toggleLayerNew(wetArray, wetlands);//E: toggle between set and unset wetland-features in the map\r\n\r\n // The \"checked\" or \"unchecked\" condition is controlled by using 'css' style here\r\n (document.getElementById(bDiv.id).style.display == 'none') ?\r\n document.getElementById(bDiv.id).style.display = 'block' : document.getElementById(bDiv.id).style.display = 'none';\r\n\r\n //E: This 'if' checks if 'wetland' checkbox is checked to send info to the tracking function\r\n if (window.getComputedStyle(bDiv).display === \"none\") {\r\n // alert (\"Action: Un-check wetlands check-box\");//E: For test\r\n report('m-clk', 'Un-check wetlands check-box;'); //E: report 'wetland' un-check\r\n } else {\r\n // alert (\"Action: Check wetlands check-box\");//E: For test\r\n report('m-clk', 'Check wetlands check-box;'); //E: report 'wetland' un-check\r\n }\r\n }\r\n // options.action(); //E: option to add some other function. Not in use for now\r\n });\r\n return container;\r\n}", "title": "" }, { "docid": "a3c6f499e116cedddc4d4e3b69c6b45e", "score": "0.55773234", "text": "function listenMapClick(){\r\n\tensembleStatMap.on(\"dblclick\", function(e){\r\n\t\tvar lat = e.latlng.lat,\r\n\t\t\tlng = e.latlng.lng;\r\n\t\tif(marker == undefined){\r\n\t\t\tmarker = L.marker([lat,lng]);\r\n\t\t\tmarker.addTo(ensembleStatMap);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmarker.setLatLng([lat,lng]).addTo(ensembleStatMap);\r\n\t\t}\r\n\t\tgetModelSinglePlotData();\r\n\t\tgetPCPData(lat, lng, $(\"#PCPSlider\").val());\r\n\t});\r\n}", "title": "" }, { "docid": "fe952854442e3fb3f006c1c7a31f0265", "score": "0.5565136", "text": "function checkBox_NoTillage(options) { //E: Function for checkbox No Tillage\r\n var container = document.createElement('DIV'); //first make the outer container\r\n container.className = \"checkboxContainer\";\r\n container.title = options.title;\r\n container.id = options.id1;\r\n\r\n var span = document.createElement('SPAN'); //E:It creates the check-box square\r\n span.role = \"checkbox\";\r\n span.className = \"checkboxSpan\";\r\n\r\n var bDiv = document.createElement('DIV'); //E:It creates a blank DIV to draw the \"check\" symbol v.\r\n bDiv.className = \"blankDiv\";\r\n bDiv.id = options.id2;\r\n\r\n var image = document.createElement('IMG'); //E:It creates a tag \"IMG\" with the check symbol v.\r\n image.className = \"blankImg\";\r\n image.src = \"https://maps.gstatic.com/mapfiles/mv/imgs8.png\";\r\n\r\n var label = document.createElement('LABEL'); //E:It creates a tag \"LABEL\" with the name Label.\r\n label.className = \"checkboxLabel\";\r\n label.innerHTML = options.label;\r\n\r\n container.appendChild(label); // If this DOM goes at the end, order of presentation will be switch\r\n bDiv.appendChild(image);\r\n span.appendChild(bDiv);\r\n container.appendChild(span);\r\n\r\n if (bmpArray_asNumbers[5]==0){//E: This condition un-check the box when the conservation practice is not set.\r\n bDiv.style.display = 'none';\r\n }\r\n\r\n //E: This lines draws the check box into the map, as it is clicked the 'checkBox'.\r\n google.maps.event.addDomListener(container,'click',function(){\r\n if (bmpArray_asNumbers[5]==0){\r\n alert (\"This option is not available because 'Conservation-Tillage' was not set\");\r\n } else {\r\n // alert (\"'No-Tillage' option was SET\");//E: For test. This message is Not needed for users\r\n toggleLayerNew(conserveArray, notill); //E: toggle between set and unset NoTillage-features in the map\r\n\r\n // The \"checked\" or \"unchecked\" condition is controlled by using 'css' style\r\n (document.getElementById(bDiv.id).style.display == 'none') ?\r\n document.getElementById(bDiv.id).style.display = 'block' : document.getElementById(bDiv.id).style.display = 'none';\r\n\r\n //E: This 'if' checks if 'No-Tillage' checkbox is checked to send info to the tracking function\r\n if (window.getComputedStyle(bDiv).display === \"none\") {\r\n // alert (\"Action: Un-check wetlands check-box\");//E: For test\r\n report('m-clk', 'Un-check No-Tillage check-box;'); //E: report 'wetland' un-check\r\n } else {\r\n // alert (\"Action: Check wetlands check-box\");//E: For test\r\n report('m-clk', 'Check No-Tillage check-box;'); //E: report 'wetland' un-check\r\n }\r\n }\r\n // options.action(); // option to add some other function\r\n });\r\n return container;\r\n}", "title": "" }, { "docid": "c904b09e72936fe780a2ba9b62c15600", "score": "0.55620617", "text": "function addpt(){\r\n if(this.checked){\r\n city.selectAll(\"text.dot\")\r\n city.selectAll(\".datapt\")\r\n .style(\"opacity\",1);\r\n }\r\n else{\r\n city.selectAll(\"text.dot\")\r\n city.selectAll(\".datapt\")\r\n .style(\"opacity\",0);\r\n city.selectAll(\"text.dot\")\r\n city.selectAll(\".linename\")\r\n .style(\"opacity\",0);\r\n }\r\n }", "title": "" }, { "docid": "303c5eee81a3e011b6d7420b62cb0773", "score": "0.5559651", "text": "function onClickToChangeChart() {\n if (!viewBarChart) {\n setViewBarChart(true);\n } else {\n setViewBarChart(false);\n }\n }", "title": "" }, { "docid": "2c86bdc79fbd6aca788e0cb1742e6b1f", "score": "0.5548617", "text": "function recupBorne(data){\r\n var checkBorne = document.getElementById('irves');\r\n checkBorne.addEventListener(\"click\", function () {\r\n data.forEach(function(data) {\r\n var irves = L.marker(data.geometry.coordinates)\r\n if (checkBorne.checked) {\r\n irves.addTo(map);\r\n } else {\r\n map.removeLayer(irves);\r\n }\r\n\r\n// Permet d'enlever et remettre au drag and drop\r\n map.on('moveend', function(){\r\n if (irves) {\r\n map.removeLayer(irves);\r\n }\r\n document.getElementById(\"irves\").checked = false;\r\n });\r\n\r\n });\r\n })\r\n}", "title": "" }, { "docid": "20bffa47f5c32055c66a9ba2e1f1732d", "score": "0.5547895", "text": "drawOnNextTick() {\n _drawMapOnNextTick = true;\n }", "title": "" }, { "docid": "3467c5589a9ed4094fd82cad57824df6", "score": "0.55272233", "text": "function toggleLayer (){\n var layer;\n layerName = $(this).data(\"layerName\");\n layer = mapOverlays[layerName]\n if(!layer) return;\n\n if ($(this).is(':checked')) {\n map.overlayMapTypes.setAt(map.overlayMapTypes.length, layer);\n } else {\n map.overlayMapTypes.forEach(function(element,index){\n if(element && element.name == layerName){\n map.overlayMapTypes.removeAt(index);\n }\n });\n }\n }", "title": "" }, { "docid": "34e03510f73c07f296e32c7e2e176657", "score": "0.55254924", "text": "function mapToLineChartClick(countryCode){\r\n // set country code\r\n $(\"#curr-country-code\").val(countryCode);\r\n\r\n // draw line chart\r\n drawLineChart();\r\n}", "title": "" }, { "docid": "410949b2abad139295980163664647dd", "score": "0.5525319", "text": "function changeTooltip(event) {\n tooltipsEnabled = event.target.checked\n display()\n}", "title": "" }, { "docid": "192991e2923623b92801719b89869940", "score": "0.55252796", "text": "function togglePassHeatmap() {\n sim_hm_passStart.setMap(sim_hm_passStart.getMap() ? null : map);\n sim_hm_passEnd.setMap(sim_hm_passEnd.getMap() ? null : map); \n}", "title": "" }, { "docid": "1f3f3543f7628fa53afb0beb784350ac", "score": "0.55238575", "text": "function onTimeSeriesRange(event) {\n drawPinMap([]);\n sendPinmapQuery();\n sendPinmapTimeQuery();\n\n $scope.deletePolygonLayers();\n }", "title": "" }, { "docid": "65aa2492127f89aa18e9584055c4f8e8", "score": "0.55209696", "text": "function clickBaro() {\n\tvar baroCheckBox = document.getElementById(\"baroToggle\");\n\tif (baroCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplaySensorGeoJSON(\"baro\", \"Barometric Pressure Sensor\", fev.urls[\"baro\" + 'GeoJSONViewURL'] + fev.queryStrings.sensorsQueryString, window[\"baro\" + 'MarkerIcon']);\n\t\t//Layers that appear on initial load are assigined a value of 0, and then a value of 1 when the map is first loaded\n\t\t//When they are turned off, they are given a value of 3\n\t\t//Values of 0 or 3 indicate that symbol and name in legend is off \n\t\tif (baroStart == 0 || baroStart == 3) {\n\t\t\t//Add symbol and layer name to legend\n\t\t\t$('#barometricSymbology').append(barometricSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (baroCheckBox.checked == false) {\n\t\tbaro.clearLayers(map);\n\t\t$('#barometricSymbology').children().remove();\n\t\tbaroStart = 3;\n\t}\n}", "title": "" }, { "docid": "57763076a1b55b96a44cbb62917ad0f4", "score": "0.551827", "text": "function clickApprovedFWS() {\n\tvar approvedFWSCheckBox = document.getElementById(\"approvedFWSToggle\");\n\t//Prevent user from using toggle when zoom is less than 9\n\tif (map.getZoom() < 9) {\n\t\tapprovedFWSCheckBox.checked = false;\n\t}\n\tif (approvedFWSCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tappr.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\t$('#approvedFWSSymbology').append(approvedFWSSymbologyInterior);\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (approvedFWSCheckBox.checked == false) {\n\t\tappr.removeFrom(map);\n\t\t$('#approvedFWSSymbology').children().remove();\n\t}\n}", "title": "" }, { "docid": "e695835e3b2ef1594c617657e82fee2f", "score": "0.5511105", "text": "function init() {\r\n // Grab a list of coin to the dropdown \r\n var selector = d3.select(\"#selDataset\");\r\n var selectorcheckbox = d3.select(\"#time\");\r\n // Use the list of coin names to populate the select options\r\n top10data.forEach((name) => {\r\n selector\r\n .append(\"option\")\r\n .text(name)\r\n .property(\"value\", name);\r\n /* selectorcheckbox\r\n .append (\"label\")\r\n .text(name)\r\n .append(\"input\")\r\n .text(\"&nbsp;&nbsp;\")\r\n .attr(\"type\", \"checkbox\")\r\n .attr('id',name.toLowerCase())\r\n .attr('value',name.toLowerCase())\r\n .attr('onclick','plotclick()');*/\r\n });\r\n\r\n \r\n \r\n // Use the first coin from the list to build the initial plots\r\n const firstcoin = top10data[0];\r\n //currency value\r\n let curr = d3.select(\"#selDataset1\").property('value');\r\n let time = d3.select(\"#selDataset2\").property('value');\r\n // console.log(time);\r\n buildplot(firstcoin,curr,time);\r\n}", "title": "" }, { "docid": "5a985daafe842fcaea6788693a32d4fc", "score": "0.5509029", "text": "function clickRdg() {\n\tvar rdgCheckBox = document.getElementById(\"rdgToggle\");\n\tif (rdgCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplaySensorGeoJSON(\"rdg\", \"Rapid Deployment Gage\", fev.urls[\"rdg\" + 'GeoJSONViewURL'] + fev.queryStrings.sensorsQueryString, window[\"rdg\" + 'MarkerIcon']);\n\t\t//Layers that appear on initial load are assigined a value of 0, and then a value of 1 when the map is first loaded\n\t\t//When they are turned off, they are given a value of 3\n\t\t//Values of 0 or 3 indicate that symbol and name in legend is off \n\t\tif (rdgStart == 0 || rdgStart == 3) {\n\t\t\t//Add symbol and layer name to legend\n\t\t\t$('#rdgSymbology').append(rdgSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (rdgCheckBox.checked == false) {\n\t\trdg.clearLayers(map);\n\t\t$('#rdgSymbology').children().remove();\n\t\trdgStart = 3;\n\t}\n}", "title": "" }, { "docid": "0e6423513d3ac0003fece4a17d539499", "score": "0.5498125", "text": "function showMarkers() {\n \n setMapOnAll(map);\n \n}", "title": "" }, { "docid": "d4f7e02cc91da71dc72e9b7f678d3944", "score": "0.5496897", "text": "function filterTime(){\n\n //FILTER DOCUMENTS\n //Filter by <1 year\n $('#checkbox-low').click(function(){\n if ($(this).is(':checked')) {\n $('.doc-row[time*=\"low\"]').removeClass(\"hiddenTime\");\n //markerReset(\"\", \"low\");\n } else {\n $('.doc-row[time*=\"low\"]').addClass(\"hiddenTime\");\n //markerFilterTime(\"low\");\n }\n markerFilter(\"\", \"low\");\n });\n\n //Filter by 1-5 year\n $('#checkbox-mid').click(function(){\n if ($(this).is(':checked')) {\n $('.doc-row[time*=\"mid\"]').removeClass(\"hiddenTime\");\n //markerReset(\"\", \"mid\");\n } else {\n $('.doc-row[time*=\"mid\"]').addClass(\"hiddenTime\");\n //markerFilterTime(\"mid\");\n }\n markerFilter(\"\", \"mid\");\n });\n\n //Filter by 5+ year\n $('#checkbox-high').click(function(){\n if ($(this).is(':checked')) {\n $('.doc-row[time*=\"high\"]').removeClass(\"hiddenTime\");\n //markerReset(\"\", \"high\");\n } else {\n $('.doc-row[time*=\"high\"]').addClass(\"hiddenTime\");\n //markerFilterTime(\"high\");\n }\n markerFilter(\"\", \"high\");\n });\n}", "title": "" }, { "docid": "d1708699c5ba2f95695ffd3188f2b560", "score": "0.5496676", "text": "function showMarkers(){\r\n setAllMap(map);\r\n}", "title": "" }, { "docid": "ae6a06f254dac76158c6bf398165c15e", "score": "0.54945934", "text": "function foodshowMarkers() {\n \n foodsetMapOnAll(map);\n \n}", "title": "" }, { "docid": "c89713614b03b15a0d78755297707f3c", "score": "0.5491856", "text": "function showDay() {\r\n show1Orbit = false;\r\n $('#showDay').hide();\r\n $('#showOrbits').show();\r\n $(\".curOrbitCircle\").remove();\r\n plotDayTrace();\r\n }", "title": "" }, { "docid": "93263a57d8956389f5c0122849b20793", "score": "0.54898053", "text": "function handleClickScatterplot(event, d) {\n d3.selectAll(\".labelsBox\")\n .style(\"visibility\", \"visible\");\n \n \n if (chosenCountry1 != d.country && chosenCountry2 != d.country) {\n if (chosenCountryNumber % 2 == 0) {\n chosenCountry1 = d.country;\n document.getElementById(\"dropdown_country1\").value = chosenCountry1;\n saveDropdownYear(false);\n chosenCountryNumber++;\n } else {\n chosenCountry2 = d.country;\n document.getElementById(\"dropdown_country2\").value = chosenCountry2;\n saveDropdownYear(false);\n chosenCountryNumber++;\n }\n }\n \n}", "title": "" }, { "docid": "324ff2700c70ed9428c3b16cc2c1c010", "score": "0.5485559", "text": "function accView() {\n\tmyMap.onChange(drawaccidentData);\n\n}", "title": "" }, { "docid": "ba19eab6956e1cb970a040a51915ae92", "score": "0.54811054", "text": "function toggleDaily(event) {\n\t\t\n var focus = LS.getData('focus-storage'),\n newStorage = {\n 'val': focus.val,\n 'isChecked': !focus.isChecked\n };\n \n\t\tLS.setData('focus-storage', newStorage);\n \n render();\n\t}", "title": "" }, { "docid": "4f61e466c53d6c672bd85a52b2856352", "score": "0.54785454", "text": "function checkAndPlotData() {\n if (locationSelected() && selectedTwo()) {\n requestDataAndPlot();\n }\n }", "title": "" }, { "docid": "11e5dd3f41875aa392655ed34b7e5e88", "score": "0.5477049", "text": "function toggleMarkers(){\n heatmap.setMap(null);\n dataMap.setMap(null);\n dCount = 0;\n if(count == 0){\n clearMarkers();\n count = 1;\n }else{\n setAllMap(map);\n count = 0;\n }\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "5e7efd8d5c75cd6a5f57f236c7ca81f0", "score": "0.5471109", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "713d5b7c9e4497ddd461e1c58fa132e3", "score": "0.5464927", "text": "function clickWaveHeight() {\n\tvar waveHeightCheckBox = document.getElementById(\"waveHeightToggle\");\n\tif (waveHeightCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tdisplaySensorGeoJSON(\"waveheight\", \"Wave Height Sensor\", fev.urls[\"waveheight\" + 'GeoJSONViewURL'] + fev.queryStrings.sensorsQueryString, window[\"waveheight\" + 'MarkerIcon']);\n\t\t//Layers that appear on initial load are assigined a value of 0, and then a value of 1 when the map is first loaded\n\t\t//When they are turned off, they are given a value of 3\n\t\t//Values of 0 or 3 indicate that symbol and name in legend is off \n\t\tif (waveheightStart == 0 || waveheightStart == 3) {\n\t\t\t//Add symbol and layer name to legend\n\t\t\t$('#waveHeightSymbology').append(waveHeightSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (waveHeightCheckBox.checked == false) {\n\t\twaveheight.clearLayers(map);\n\t\t$('#waveHeightSymbology').children().remove();\n\t\twaveheightStart = 3;\n\t}\n}", "title": "" }, { "docid": "522b6eed218c46693a262f5c7e5e0969", "score": "0.5462512", "text": "function clickNOAA() {\n\tvar noaaCheckBox = document.getElementById(\"noaaToggle\");\n\tif (noaaCheckBox.checked == true) {\n\t\t//When checkbox is checked, add layer to map\n\t\tnoaaService.addTo(map);\n\t\t//Add symbol and layer name to legend\n\t\tif (noaaStart == 0 || noaaStart == 3) {\n\t\t\t$('#noaaCycloneSymbology').append(noaaCycloneSymbologyInterior);\n\t\t}\n\t}\n\t//Remove symbol and layer name from legend when box is unchecked\n\tif (noaaCheckBox.checked == false) {\n\t\tnoaaService.removeFrom(map);\n\t\t$('#noaaCycloneSymbology').children().remove();\n\t\tnoaaStart = 3;\n\t}\n}", "title": "" }, { "docid": "ef72ed2656f4a302d48f75a300ecbc9c", "score": "0.5457192", "text": "function toggleStas(){\n\tmap.closeInfoWindow();\n\tcount = 0;\n\tif(this.id ==\"plotStaTrue\"){\n\t\tplotStas = 1;\n\t\tplotStations();\n\t}else{\n\t\tplotStas = 0;\n\t\tfor (var i = 0; i<stamarker.length; i++){\n\t\t\tstamarker[i].remove();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0642efd447a65c99d39350933ce0e165", "score": "0.54566914", "text": "function showMarkers() {\n setMapOnChosen(map);\n setMapOnWished(map);\n setMapOnVisited(map);\n}", "title": "" }, { "docid": "6b5e7893b3e09969f03f4ad88a9a7696", "score": "0.54430205", "text": "function showMap() {\n const stationsGraphRowElem = document.getElementById('stations-graph-row');\n const stationsMapRowElem = document.getElementById('stations-map-row');\n\n // show chart overlay\n if (stationsGraphRowElem) {\n stationsGraphRowElem.classList.remove('d-flex');\n stationsGraphRowElem.classList.add('d-none');\n }\n\n // show map overlay\n if (stationsMapRowElem) {\n stationsMapRowElem.classList.add('d-flex');\n stationsMapRowElem.classList.remove('d-none');\n }\n }", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" }, { "docid": "f4c2ec9623532f10e46f6d8326eaad35", "score": "0.5439746", "text": "function showMarkers() {\n setMapOnAll(map);\n}", "title": "" } ]
37c9787f50ecec3a6583e04f605d43c0
show notification on page
[ { "docid": "5106715627ad3b4768a25c1357f0f74c", "score": "0.64098907", "text": "function showNotification (message) {\n\t// create notification string\n\tvar dialog = $(\"<p dir='ltr'>\" + message + \"</p>\");\n\t// set dialog properties\n\tdialog.dialog({\n\t\tautoOpen:false,\n\t\tmodal: false,\n\t\tcloseOnEscape: false,\n\t\ttitle: '<img src=\"' + black_v + '\" /> Shark-King',\n\t\topen: function(event, ui) { \n\t\t\t//setTimeout(function(){dialog.dialog('close');}, 4000);\n\t\t\t$('.ui-dialog').css('z-index', 6000);\n\t\t\t$('.ui-dialog').css('font-family', 'Arial');\n\t\t\t$('.ui-dialog').css('font-size', '14px');\n\t\t\t$('.ui-dialog').css('text-align', 'left');\n\t\t},\n\t// open dialog\n\t}).dialog('open');\n\t$('.ui-dialog :button').blur();\n}", "title": "" } ]
[ { "docid": "481cc8f90e56c52a3fd3191d724b4f68", "score": "0.7429912", "text": "function show(msg, url) {\n var time = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n var hour = time[1] % 12 || 12; // The prettyprinted hour.\n var period = time[1] < 12 ? 'A.M.' : 'P.M.'; // The period of the day.\n var notification = new Notification(hour + time[2] + ' ' + period, {\n icon: 'icon48.png',\n body: msg\n });\n notification.onclick = function () {\n window.open(url);\n };\n}", "title": "" }, { "docid": "446abdab01d9626709781e226a7741db", "score": "0.7162537", "text": "async showNoticeInPopup() {\n\n let latestNoticeData =\n await globalViewModel.getLastNotification();\n\n let popupMarkup = globalViewModel.convertNoticeToPopupHtml(latestNoticeData);\n\n GlobalView.showMessagePopup(popupMarkup);\n }", "title": "" }, { "docid": "aa3ea2bd1f24678217b342def898ccc2", "score": "0.70297354", "text": "function notify(msg) {\n $('<div></div>')\n .addClass('notification')\n .text(msg)\n .appendTo('#info')\n .fadeIn(1000)\n .delay(2000)\n .fadeOut(500);\n }", "title": "" }, { "docid": "c46a05161fc386294c7938ab813784e5", "score": "0.7024964", "text": "function showNotificationInfo(message, timer, style)\n{\n\treturn showNotification('Info', message, timer, style);\n}//eof function", "title": "" }, { "docid": "b0cf982f20513bdaf3be065b53c11898", "score": "0.70082533", "text": "function notify() {\r\n if (!Notification) {\r\n alert('Desktop notifications not available in your browser. Try Chromium.');\r\n return;\r\n }\r\n new Notification(lastRead, {\r\n icon: 'img/main48.png',\r\n body: 'New Ticket!'\r\n }); \r\n}", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.7002577", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.7002577", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.7002577", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.7002577", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.7002577", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "242c066243ad907f251c653803d06cdf", "score": "0.69686323", "text": "function notification1(){\n\t\t$(\".bell_circle\").css(\"display\", \"flex\");\n\t\talert(\"You got a new notification\");\n\t}", "title": "" }, { "docid": "5c499d0058c3fa14fe4cf1e33a36d918", "score": "0.6961939", "text": "function showNotify(message){\n\t$('#notifyMessage').html( message );\n\t$('#notify').fadeIn('slow').delay(1000).fadeOut('slow');\n\t//$('#notifyMessage').html(\"\");\n}", "title": "" }, { "docid": "4a3e17bfe76a48144385f576b4325890", "score": "0.6960976", "text": "function showNotification(header, content) {\r\n $(\"#notificationHeader\").text(header);\r\n $(\"#notificationBody\").text(content);\r\n messageBanner.showBanner();\r\n messageBanner.toggleExpansion();\r\n }", "title": "" }, { "docid": "7087e66ff45d47458507855b06240ba1", "score": "0.69583374", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "7087e66ff45d47458507855b06240ba1", "score": "0.69583374", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "43abb9fe43395615096ada4ccaea99ae", "score": "0.69489884", "text": "function showNotification(msg){\n if(arguments && arguments[1]){\n notification = arguments[1];\n }\n \n msg.type = \"basic\";\n msg.iconUrl = chrome.runtime.getURL(\"/img/icon128-noborder.png\");\n\n chrome.notifications.create(\"\", msg, function(id){\n // do nothing;\n });\n \n chrome.notifications.onClicked.addListener(function(id){\n trackButton(\"website_click\", notification.track, \"From Notification\");\n window.open(notification.url, \"_blank\");\n });\n}", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.6934795", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.6934795", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.6934795", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "f20afbb5a8146243018682497d885f16", "score": "0.69046867", "text": "function notificar(titulo, mensaje, url)\n{\n var notificacion = new Notification (\n titulo,\n {\n icon : 'static/img/logo.PNG',\n body : mensaje,\n requireInteraction : false\n });\n notificacion.onclick = function()\n {\n window.open(url);\n }\n}", "title": "" }, { "docid": "41ecc84afac8c6b2d93302a09cd670de", "score": "0.68568856", "text": "function showNotification(isSuccess, message, title = 'Notification') {\n if (isSuccess) {\n $.Notify({\n caption: title,\n content: message,\n type: 'success'\n });\n }\n else {\n $.Notify({\n caption: title,\n content: message,\n type: 'alert'\n });\n }\n}", "title": "" }, { "docid": "cb66da0cf5ec2fa436cffc8752cbb6f7", "score": "0.6830739", "text": "function showNotifications () { \n let messageBoard = document.getElementById(\"message-board\");\n messageBoard.className = \"row message-board-main slide-in\";\n Session.set(\"drawerOpen\", true);\n}", "title": "" }, { "docid": "ae7f6cbb95fe742fdb90f85ee4fa0abe", "score": "0.6812398", "text": "function sendNotification(note, type) {\n $('#notification div').fadeIn(FADE_IN_DELAY);\n $('#notification').html(\n '<div class=' + type + '>' + note + '</div>'\n );\n // The notification fades out.\n $('#notification div').fadeOut(FADE_OUT_DELAY);\n}", "title": "" }, { "docid": "225ba681b6967bc280ae4847c7d175f8", "score": "0.68081903", "text": "function showNotification () {\r\n const notification = {\r\n title: 'Fivex',\r\n body: 'Version checks complete',\r\n icon: path.join(__dirname, 'logo.png')\r\n }\r\n\r\n if (Notification.permission === \"granted\") {\r\n showNotification()\r\n } else if (Notification.permission === \"denied\") {\r\n Notification.requestPermission()\r\n }\r\n\r\n app.setAppUserModelId(`Current Version:${version}`);\r\n\r\n new Notification(notification).show()\r\n }", "title": "" }, { "docid": "1d0f969ac14f55a3715d0d32d21fb32c", "score": "0.67808217", "text": "function ShowNotification(title, message, icon){\r\n\r\n // Check if browser support notifications. If not exit\r\n if(! ('Notification' in window) ){\r\n console.log('Web Notification not supported');\r\n return;\r\n }\r\n\r\n // Ask user for permission.\r\n Notification.requestPermission(function(){\r\n // Config notification content and display it.\r\n var notification = new Notification(title,{\r\n body:message,\r\n icon:icon,\r\n dir:'auto'\r\n });\r\n\r\n // Set time before closing notif\r\n setTimeout(function(){\r\n notification.close();\r\n },3000);\r\n });\r\n}", "title": "" }, { "docid": "b7e6070f7c6ecb0ab4377c5a0b0de3c2", "score": "0.67740494", "text": "function _displaynotification(msgtitle, message)\n {\n if(cordova.plugins.notification != null)\n {\n cordova.plugins.notification.local.schedule({\n title: msgtitle,\n text: message,\n foreground: true\n });\n }\n }", "title": "" }, { "docid": "600cedc64c2cc097ab14a01b29744810", "score": "0.67543787", "text": "showNotification(text) {\n const message = new NotificationMessage(text);\n this.Channels.addMessageToChannelWithID(message);\n this.Notifications.send(text);\n }", "title": "" }, { "docid": "53484fbba1b86c0344e020f737260bc7", "score": "0.67470723", "text": "function Notification(){}", "title": "" }, { "docid": "06b5b21e9ae50e9df1a9639e6b513f11", "score": "0.67455566", "text": "notify(text) {\n document.getElementById('notify').innerHTML = text;\n }", "title": "" }, { "docid": "3139cf1ad589a77bee7f1ebdbfbc4d89", "score": "0.6736626", "text": "function showMessageNotify(mensaje, tipo, duracion) {\n $.notify({\t\t\t\t\t\t\t\n message: `<i class=\"fa fa-sun\"></i><strong> ${mensaje}</strong>`\n },{\t\t\t\t\t\t\t\t\n type: tipo,\n delay: duracion,\n z_index: 3000,\n });\n}", "title": "" }, { "docid": "3139cf1ad589a77bee7f1ebdbfbc4d89", "score": "0.6736626", "text": "function showMessageNotify(mensaje, tipo, duracion) {\n $.notify({\t\t\t\t\t\t\t\n message: `<i class=\"fa fa-sun\"></i><strong> ${mensaje}</strong>`\n },{\t\t\t\t\t\t\t\t\n type: tipo,\n delay: duracion,\n z_index: 3000,\n });\n}", "title": "" }, { "docid": "80cc0c9ba1d205518d535e57d79de8aa", "score": "0.6735188", "text": "function showNotification(string, type) {\n\n let notif = createNotification(string, type);\n let notifBox = document.getElementById(\"notification-box\");\n notifBox.appendChild(notif);\n notif.offsetWidth; // trigger reflow so transition plays\n notif.classList.add(\"shown\");\n setTimeout(function() { notif.classList.remove(\"shown\"); }, 2000);\n setTimeout(function() { notif.remove(); }, 2500);\n}", "title": "" }, { "docid": "92c6827b125fa1a05a2d94d94cb6f8ad", "score": "0.66827065", "text": "function notify(title,url) {\n if (!Notification) {\n alert(\"I'm sorry, your browser isn't supported by HWTF Notifier. Please install Google Chrome or Mozilla Firefox and try again.\"); \n return;\n }\n\n if (Notification.permission !== \"granted\")\n Notification.requestPermission();\n else {\n\t\tvar notification = new Notification('New HIT', {\n\t\t\ticon: 'notificationIcon.png',\n\t\t\tbody: title\n\t\t});\n\t\tnotification.onclick = function () {\n\t\t\twindow.open(url); \n\t\t};\n\t\tsetTimeout(notification.close.bind(notification), 10000); \n }\n}", "title": "" }, { "docid": "e6044371ef1b0a0c5190ce2849ddf3a5", "score": "0.66586334", "text": "function mostrarAyuda(msg) {\n $.notify({\n message: msg\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "title": "" }, { "docid": "29d5d1c1901ec6e524e23d64dda3f6d0", "score": "0.6616431", "text": "function notificationClassVisible() {\n $('html').toggleClass('ls-notifications-visible');\n }", "title": "" }, { "docid": "dda7a4bde62d12bbd74a5a3171e9868c", "score": "0.6612641", "text": "function showAlert(msg, titulo,tipo=\"success\") {\n\t$.notify({\n\t\ttitle: titulo,\n\t\tmessage: msg, \n\t},{\n\t\tdelay: 1000,\n\t\ttimer: 1000,\n\t\ttype: tipo,\n\t\tplacement: {\n\t\t\tfrom: \"bottom\"\n\t\t},z_index:2000\n\t\t\n\t});\n}", "title": "" }, { "docid": "5900936185949f167dfceb9859b1a345", "score": "0.65974605", "text": "function showNotice() {\n buildNotice();\n\n // Show the notice with a little timeout\n setTimeout(function(){\n document.documentElement.classList.add(pluginPrefix+'-loaded');\n }, config.timeout);\n }", "title": "" }, { "docid": "a98c42685534bdacc33c46011723c7b1", "score": "0.6593437", "text": "function showNotice(message) {\n\t$('#alert').find('.text').html(message);\n\t$('#notifications').animate({'top' : '0'}, 500).delay(4000).animate({'top' : '-70px'}, 500);\n}", "title": "" }, { "docid": "47fe7dd6adccbcc26bff7e71ead80ff2", "score": "0.6585166", "text": "function _notify(e) {\n var message = e.nick + ': ' + e.message\n , icon = \"http://\" + location.host + \"/images/favicon.ico\"; \n\n // Chrome notifications\n if (webkit) {\n if (window.webkitNotifications.checkPermission() === PERMISSION_ALLOWED) {\n var notif = window.webkitNotifications.createNotification(icon, Talker.client.channel, message);\n\n notif.onclick = function() { window.focus(); this.cancel(); };\n notif.show(); \n setTimeout(function () { notif.close(); }, 2000);\n }\n } else if (prism) {\n window.platform.showNotification(Talker.client.channel, message, args.icon);\n } else if (fluid) {\n fluid.showGrowlNotification({\n title: Talker.client.channel\n , description: message\n , icon: icon\n });\n }\n }", "title": "" }, { "docid": "bb7e73792b85b083257ed4eccf10769c", "score": "0.6584125", "text": "function triggerNotification(event) {\n var notificationBox = $('.notification-box');\n\n $('.notification-text').text(event.message);\n\n if (event.type === 'error') {\n notificationBox.addClass('error');\n } else {\n notificationBox.removeClass('error');\n }\n \n showNotification();\n\n // after interval, hide the notification\n setTimeout(function() {\n hideNotification();\n }, 3000);\n}", "title": "" }, { "docid": "e50a4ac20088729c6e38ceb9f734e379", "score": "0.65826637", "text": "function Notification() {\n return (\n <div>\n <h1>Notification page is being rendered.</h1>\n </div>\n );\n}", "title": "" }, { "docid": "2857ed0e1ce0115ee7871b658aac0a17", "score": "0.65801746", "text": "_showNoTimesNotification() {\n let state, notificationArgs, notification;\n\n state = store.getState();\n\n notificationArgs = { text: \"Нет доступного времени на выбранную дату\" };\n\n notification = new Notification(state.general.notificationContainer, notificationArgs);\n notification.init(3500);\n }", "title": "" }, { "docid": "78a6d6b1257b91a2ebfd54f9c6cf646d", "score": "0.6576525", "text": "function Notify(text){\n var notification = document.getElementById('success-container');\n notification.children[0].innerHTML = text;\n notification.classList.toggle('hidden');\n sleep(2000).then(() => {\n notification.classList.toggle('hidden');\n });\n}", "title": "" }, { "docid": "3afc0f7ca2ba0226088c364011a53d5e", "score": "0.6575328", "text": "function showNotification() {\n // Add class show to the notification conatiner\n notification.classList.add('show');\n // After 2s hide the notofocation\n setTimeout(() => {\n notification.classList.remove('show');\n }, 2000);\n}", "title": "" }, { "docid": "e81299eacb7173bbe5e939b8cbaea653", "score": "0.6561647", "text": "function Notification() {\n\t\n}", "title": "" }, { "docid": "9719d6a5fdd97d0442d9d16066c980b5", "score": "0.6559983", "text": "function simpleshowAMessage() {\n\tc('simpleshowAMessage');\n\t$(\"#copy-notes\").css(\"display\", \"none\");\n\n\tvalue = window.localStorage.getItem(\"text\");\n\tvar text = window.localStorage.getItem(\"value\");\n\t// if(text.split(\" \").length<2)return;\n\n\tchrome.extension.sendRequest({\n\t\tt : \"my\",\n\t\tdomain : window.localStorage.getItem(\"URLS\"),\n\t\ttitle : window.localStorage.getItem(\"title\"),\n\t\tdata : value\n\t}, function(response) {\n\t});\n\n\t$.jGrowl(chrome.i18n.getMessage(\"contents_notes_added_notification\"));\n\n}", "title": "" }, { "docid": "73bdaf3beca241752a88276582ed8d7c", "score": "0.6557408", "text": "function showNotification(message, timeout)\r\n {\r\n //don't want a previously set timeout to prematurely clear this message if notification called in rapid succession\r\n clearTimeout(notificationTimeout);\r\n notification.html(message).css('display', 'block').animate({opacity:1}, 'fast');\r\n\r\n if (timeout == undefined)\r\n timeout = 2000;\r\n\r\n notificationTimeout = setTimeout(function()\r\n {\r\n hideNotification();\r\n }, timeout);\r\n }", "title": "" }, { "docid": "35f5b1e8066d571820b90897644a646b", "score": "0.6543812", "text": "function show(username, message) {\n var time = /(..)(:..)/.exec(new Date()); //The prettyprinted time.\n var hour = time[1] % 12 || 12; //The prettyprinted hour.\n var period = time[1] < 12 ? 'a.m.' : 'p.m.'; //The period of the day.\n new Notification(hour + time[2] + ' ' + period, {\n icon: '../../icons/icon48.png',\n body: \"From: @\" + username + \": '\" + message + \"'\"\n })\n }", "title": "" }, { "docid": "f817905736180bd9102ad54e9b77ecae", "score": "0.65395916", "text": "function showNotification(message, color) {\n var jobcode = document.getElementById(\"job-code\");\n var notificationtag = document.createElement(\"div\");\n notificationtag.innerHTML = message + \"Click me to abolish\";\n notificationtag.className = \"notificationtag\";\n notificationtag.style.background = color;\n notificationtag.addEventListener(\"click\", function () {\n notificationtag.style.display = \"none\";\n });\n document.body.appendChild(notificationtag);\n}", "title": "" }, { "docid": "fed0eb7a5d5d6aabd44b66a953d22410", "score": "0.65365756", "text": "function Notification(type, message) {\n //clear the old timeout\n window.clearTimeout(timeoutID);\n //make a new one. Pretty much restarting the timer.\n timeoutID = window.setTimeout(function(){$(\".notice\").slideUp(250)},5000);\n $(\".notice\").html(viewPartials.notice({type: type, message: message})).slideDown(250);\n}//end Notification", "title": "" }, { "docid": "ad170b0013ba0695607208400230ae27", "score": "0.65324837", "text": "function show() {\n var time = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n var hour = time[1] % 12 || 12; // The prettyprinted hour.\n var period = time[1] < 12 ? 'a.m.' : 'p.m.'; // The period of the day.\n new Notification(hour + time[2] + ' ' + period, {\n icon: 'DT_icon.png',\n body: 'DT TIME!!!'\n });\n}", "title": "" }, { "docid": "af9d57897a2c7c5d5ed6bf5f461cf961", "score": "0.65004295", "text": "function playNextAlert() {\r\n $.notify({\r\n title: '<strong>Queue</strong>',\r\n icon: 'fas fa-list-alt',\r\n message: \" is empty!\"\r\n }, {\r\n type: 'warning',\r\n delay: 400,\r\n animate: {\r\n enter: 'animated fadeInUp',\r\n exit: 'animated fadeOutRight'\r\n },\r\n placement: {\r\n from: \"bottom\",\r\n align: \"right\"\r\n },\r\n offset: 20,\r\n spacing: 10,\r\n z_index: 1031,\r\n });\r\n}", "title": "" }, { "docid": "6e23b4332c48acf4d3ae87700623411e", "score": "0.6495738", "text": "function showAMessage() {\n\tif (oscheck() == false) {\n\n\t\t$.jGrowl(\"Sorry, this functionality is only available on Windows.\");\n\t\treturn false;\n\t}\n\n\tvar r = document.getElementById(\"plugin\").printText(\n\t\t\t\"This is a message sent from the website's javascript...\");\n\n\tvalue = document.getElementById(\"copy-notes\").innerHTML;\n\tif (value.length > 0) {\n\t\t$(\"#copy-notes\").css(\"display\", \"none\");\n\n\t\twindow.localStorage.setItem(\"value\", value);\n\t\tvar text = window.localStorage.getItem(\"value\");\n\t\t// if(text.split(\" \").length<2)return;\n\n\t\tchrome.extension.sendRequest({\n\t\t\tt : \"my\",\n\t\t\tdomain : window.localStorage.getItem(\"URLS\"),\n\t\t\ttitle : window.localStorage.getItem(\"title\"),\n\t\t\tdata : value\n\t\t}, function(response) {\n\t\t});\n\n\t\t$.jGrowl(chrome.i18n.getMessage(\"contents_notes_added_notification\"));\n\n\t} else {\n\t\tsetTimeout(showAMessage, 200);\n\t}\n}", "title": "" }, { "docid": "e27f5f4f08bfbad05a4d239e114cd8a5", "score": "0.64917773", "text": "function syncAlert() {\r\n // Sync notify\r\n $.notify({\r\n title: '<strong>Sync: </strong>',\r\n icon: 'fas fa-users',\r\n message: \" The room is now synced with you\"\r\n }, {\r\n type: 'success',\r\n delay: 400,\r\n animate: {\r\n enter: 'animated fadeInUp',\r\n exit: 'animated fadeOutRight'\r\n },\r\n placement: {\r\n from: \"bottom\",\r\n align: \"right\"\r\n },\r\n offset: 20,\r\n spacing: 10,\r\n z_index: 1031,\r\n })\r\n}", "title": "" }, { "docid": "d99ce5e7f2a3fcff84f2621f9823cb23", "score": "0.6489082", "text": "function showPushed() {\n var currentTime = /(..)(:..)/.exec(new Date()); // The prettyprinted time.\n var scheduleTime = localStorage.time;\n var body = mess = \"\";\n if(localStorage.message != null) {\n body = localStorage.message;\n }\n\n if(scheduleTime == currentTime[0]) {\n mess = localStorage.title;\n body = scheduleTime;\n if(localStorage.url != null) {\n body = localStorage.message;\n }\n\n var myNotificationID = null;\n chrome.notifications.create(\"\", {\n type: \"basic\",\n iconUrl: \"64.png\",\n title: mess,\n message: body,\n contextMessage: body,\n buttons: [{\n title: \"Apply\"\n }]\n }, function(id) {\n myNotificationID = id;\n });\n chrome.notifications.onButtonClicked.addListener(function(notifId, btnIdx) {\n if (notifId === myNotificationID) {\n window.open('http://0103a17e.ngrok.io/thankyou.html');\n }\n });\n chrome.notifications.onClicked.addListener(function(notifId, btnIdx) {\n if (notifId === myNotificationID) {\n window.open(localStorage.url);\n }\n });\n }\n}", "title": "" }, { "docid": "7c8639609df1086999ebcc16ade4b487", "score": "0.64869386", "text": "static notify(message) {\n let title = browser.i18n.getMessage(\"notificationTitle\");\n let content = browser.i18n.getMessage(\"notificationContent\", message);\n browser.notifications.create({\n \"type\": \"basic\",\n \"iconUrl\": browser.extension.getURL(\"theme/icons/fhc-48.png\"),\n \"title\": title,\n \"message\": content\n });\n }", "title": "" }, { "docid": "ad9cfbddbcbc73270119d007127d3153", "score": "0.6472523", "text": "function notify(config){\n $.notify({\n //options\n message: config.message\n }, {\n //settings\n type: config.type || 'notice',\n delay: 1000,\n allow_dismiss: false,\n placement: {\n from: 'bottom',\n align: 'right',\n },\n animate: {\n enter: \"animated fadeInDown\",\n exit: \"animated fadeOutDown\",\n }\n })\n}", "title": "" }, { "docid": "b5f91ecab3fa89406e9e618819eb4452", "score": "0.6470402", "text": "function eNotify(text, link){\n\n\tif(ETICKER.FirstLoad){\n\t\tconsole.log(\"[ETicker] First load notify: \" + text);\n\t\treturn;\n\t}\n\n\tconsole.log(\"[ETicker] Notify: \" + text);\n\n\tif( ETICKER.LOADED + 5000 > Date.now() ){ return; }\n\n\tif (!(\"Notification\" in window)) {\n\t\talert(\"[ETicker] This browser does not support desktop notification\");\n\t}else if (Notification.permission === \"granted\") {\n\t\tvar notification = new Notification(text);\n\n\t\tif(link != undefined){\n\t\t\tnotification.onclick = function(){\n\t\t\t\twindow.open(link);\n\t\t\t}\n\t\t}\n\n\t}else if (Notification.permission !== 'denied') {\n\t\tNotification.requestPermission(function (permission) {\n\t\t\tif (!('permission' in Notification)) {\n\t\t\t\tNotification.permission = permission;\n\t\t\t}\n\t\t\tif (permission === \"granted\") {\n\t\t\t\tvar notification = new Notification(text);\n\n\t\t\t\tif(link != undefined){\n\t\t\t\t\tnotification.onclick = function(){\n\t\t\t\t\t\twindow.open(link);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t}\n\n\tconsole.log(\"[ETicker] \" + text);\n}", "title": "" }, { "docid": "299e1a037f722e31d7c345306e5d5a04", "score": "0.64693445", "text": "function notificationPopup() {\n if (type === \"meditation\")\n chrome.notifications.create(meditationOptions, creationCallback);\n else if (type === \"strength\")\n chrome.notifications.create(strengthOptions,creationCallback());\n else if (type === \"stretch\")\n chrome.notifications.create(stretchOptions,creationCallback());\n else if (type === \"cardio\")\n chrome.notifications.create(cardioOptions,creationCallback());\n\n}", "title": "" }, { "docid": "718be01a52821050e2d4d352e746411f", "score": "0.6466769", "text": "showNotification(notifytitle, notifymessage, notifyvariant) {\n const evt = new ShowToastEvent({\n title: notifytitle,\n message: notifymessage,\n variant: notifyvariant,\n });\n this.dispatchEvent(evt);\n }", "title": "" }, { "docid": "3ff87977796ed5fa211267aaf5825567", "score": "0.64510536", "text": "function notifyMe(name, msg) {\n if (Notification.permission !== \"granted\")\n Notification.requestPermission();\n else {\n var notification = new Notification(name + \"!\", {\n icon: '/Sand-Timer.png',\n body: msg,\n });\n\n notification.onclick = function () {\n // window.open(\"http://stackoverflow.com/a/13328397/1269037\");\n window.focus();\n };\n }\n }", "title": "" }, { "docid": "f828f1ae51e1cdd9792a1c73803352d3", "score": "0.644868", "text": "function success(message) {\n\t\tNotification({templateUrl: \"alert-success.html\", message: message});\n\t}", "title": "" }, { "docid": "76e14d32265198fbf002e9e7335e4663", "score": "0.6448511", "text": "function notifyMessage() {\n $('.notification-message').fadeIn(500, function () {\n $('.notification-message').fadeOut(3000)\n });\n}", "title": "" }, { "docid": "1fc4ea6368029db399715cd6c2e72252", "score": "0.64313143", "text": "function showSimpleNotification(url, title, body) {\n var notificationsMode = datastore.get('settings.notifications.mode') || 'only_when_convore_window_unfocused';\n\n if( notificationsMode === 'always' ) {\n createNotification( url , title , body );\n } else if( notificationsMode === 'only_when_convore_window_unfocused' ) {\n chrome.windows.getCurrent( function( currentWindow ) {\n chrome.tabs.getSelected( currentWindow.id, function(tab) {\n var isFocusedTabConvore = convoreUrlRegex.test( tab.url );\n if( !isFocusedTabConvore ) {\n createNotification( url, title, body);\n }\n });\n });\n } else {\n // The only remaining option is 'never' so it doesn't create a notification.\n }\n\n}", "title": "" }, { "docid": "3513a93703aa89125aa4aa0c0710ffc0", "score": "0.6422667", "text": "maybeShowNotice() {\n if (!settings.get('useTopicSubscription') || settings.get('useTopicSubscription-seenNotice')) {\n return;\n }\n\n OO.ui.alert(\n $('<div>')\n .append(\n $('<img>')\n .attr('width', 512)\n .attr('height', 253)\n .attr('src', '//upload.wikimedia.org/wikipedia/commons/thumb/0/01/Screenshot_of_topic_subscription_prototype.png/512px-Screenshot_of_topic_subscription_prototype.png')\n .addClass('cd-tsnotice-img'),\n wrap(cd.sParse('topicsubscription-notice'), {\n callbacks: {\n 'cd-notification-notificationSettings': () => {\n controller.showSettingsDialog('notifications');\n },\n },\n targetBlank: true,\n tagName: 'div',\n }).addClass('cd-tsnotice-text'),\n )\n .children(),\n { size: 'large' }\n );\n\n settings.saveSettingOnTheFly('useTopicSubscription-seenNotice', true);\n }", "title": "" }, { "docid": "7b6e658e9fbfa7b1f91f862088e535d6", "score": "0.6419999", "text": "function notify(msg) {\n $(\"#msg\").html(msg);\n $(\"#msg\").show().delay(4000).fadeOut();\n}", "title": "" }, { "docid": "8086ce2217cd06595423ea0a5af49916", "score": "0.64110625", "text": "function showMessage(message) {\n // if we show a message like start auto refresh, we want to put back our current address afterwards\n var tempMessage = $('#messages').html();\n\n $('#messages').html(message);\n setTimeout(function() {\n $('#messages').html(tempMessage);\n }, 7 * 1000); // 7 seconds\n }", "title": "" }, { "docid": "634ea85713c02c8ad307cdc2e84114cc", "score": "0.64066195", "text": "function notify(notification) {\n\n if (!wvy.browser.framed) {\n wvy.audio.play(\"#notification-sound\");\n }\n // only in standalone mode for now\n if (window.Notification && !wvy.browser.framed) {\n console.debug(\"notification permission is \" + Notification.permission + \" and context.notify is \" + wvy.settings.notify);\n if (Notification.permission === \"granted\" && wvy.settings.notify) {\n var n = new Notification(wvy.t(\"You have a new notification\"), {\n body: notification.text,\n tag: notification.url,\n // get user thumbnail (as .png since svgs are not supported in browser notifications)\n icon: notification.thumb.replace(\"{options}\", \"96\").replace(\".svg\", \".png\")\n });\n\n n.addEventListener(\"click\", function () {\n location.href = wvy.url.resolve(notification.url);\n window.focus();\n this.close();\n });\n\n //setTimeout(n.close.bind(notification), 10000);\n }\n } else {\n console.debug(wvy.t(\"Browser does not support notifications\"));\n }\n }", "title": "" }, { "docid": "73ba5abeae98e9356b01039bb03f2bf3", "score": "0.6405621", "text": "notify() {\n var duration, durationSec;\n var athis = this;\n\n // wait a bit of time then display\n setTimeout(function() {\n $(\"#passingOverlay\").addClass(\"displayed\");\n $(\"#passingOverlay\").addClass(\"revealed\");\n\n // get the duration regarding the\n // CSS to adapt to the fade out\n duration = $(\"#passingOverlay .message\").css(\"transition-duration\");\n durationSec = /^(.*)s$/.exec(duration)[1];\n\n setTimeout(function() {\n $(\"#passingOverlay\").removeClass(\"revealed\");\n\n setTimeout(function() {\n $(\"#passingOverlay\").removeClass(\"displayed\");\n\n if (athis.afterNotification != null) {\n athis.afterNotification();\n }\n }, 500);\n }, durationSec * 1000);\n }, 50);\n }", "title": "" }, { "docid": "19cf0ceda311f4f83185646ae4e0a2c2", "score": "0.6403288", "text": "function updateNotification() {\n title.html(\n (notificationNumber > 0 ? \"(\" + notificationNumber + \") \" : \"\") +\n `${titleName}`\n );\n}", "title": "" }, { "docid": "a9af398d1c53d51233429467d2535652", "score": "0.63926345", "text": "enableNotification() {\n this.notification = !this.notification;\n //Per far scomparire il popup dopo 4 secondi.\n const notifActive = document.getElementById(\"notif-active\");\n if(this.notification == true) {\n setTimeout(function(){ \n notifActive.classList.remove(\"display-block\")\n }, 4000);\n }\n }", "title": "" }, { "docid": "b1063ef259f6164dd34d593299d81e1b", "score": "0.63909584", "text": "function show_gmail_notification()\n{\n\tvar frameDoc = get_frame();\n\t$(\".UD\", frameDoc).first().css(\"visibility\", \"visible\");\n\t$(\".UB\", frameDoc).first().css(\"visibility\", \"visible\");\n\t$(\".vh\", frameDoc).first().not(\".boomerang\").css(\"visibility\", \"visible\");\n}", "title": "" }, { "docid": "719e6c1729488e3556cb8a1669624d30", "score": "0.6378761", "text": "function flashNotifies() {\n if (document.getElementsByClassName('flash--site-notice').length == 0) {\n ls.hidden = {};\n write(ls);\n }\n for (let i=0; i<document.getElementsByClassName('flash--site-notice').length; i++) {\n let e = document.getElementsByClassName('flash--site-notice')[i];\n let z = md5(e.innerHTML);\n if (fl[z] == '1' || ls.force)\n e.style.display = 'none';\n else {\n e.appendChild(InfernoAddElem('a', {style:{float:'right'}, innerHTML:'[X]', href:'#', events:{\n 'click':() => {\n e.style.display = 'none';\n fl[z] = '1';\n write(ls);\n return false;\n }\n }}, []));\n }\n }\n }", "title": "" }, { "docid": "d3f3a5e3c2e37a78cd5f2e12e7a77cd3", "score": "0.6376748", "text": "function showNotification(title, message) {\n chrome.notifications.create('', {\n type: 'basic',\n iconUrl: '/message-icon-png-14934.png',\n title,\n message,\n requireInteraction: true,\n });\n}", "title": "" }, { "docid": "5e5f4799c475a48628ba6f073f345525", "score": "0.6366027", "text": "function showNotificationDate(date) {\n\t$(\"#notifications\").children(\"#title\").children(\"h2\").html(date);\n}", "title": "" }, { "docid": "a7fa1978e02101ef763194f9ea352e40", "score": "0.636581", "text": "function showNotification() {\r\n notification.classList.add(\"show\");\r\n //Re,oves the popup after sometime\r\n setTimeout(() => {\r\n notification.classList.remove(\"show\");\r\n }, 2000);\r\n}", "title": "" }, { "docid": "83c85f5ce9052f01fd16e1577dd8e31d", "score": "0.6364131", "text": "function showNotification(type, message, timer, style)\n{\n\tif(message)\n\t{\n\t\tif(!type)\n\t\t\ttype = 'Info';\n\t\telse\n\t\t\ttype = initialCap(type);\n\n\t\t//random id\n\t\tvar randId = Math.floor((Math.random()*1000)+1);\n\n\t\t//notification div\n\t\tvar notificationHTML = '<div id=\"notification_'+randId+'\" class=\"notification\" style=\"'+style+'\" onclick=\"closeNotification(\\'notification_'+randId+'\\');\">' +\n\t\t '<div class=\"notification'+type+'\">' +\n\t\t\t'<img class=\"notificationClose\" onclick=\"closeNotification(\\'notification_'+randId+'\\');\" />' +\n\t\t\t'<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%\">' +\n\t\t\t '<tr>' +\n\t\t\t\t'<td class=\"notificationIconInfo\"></td>' +\n\t\t\t\t'<td>'+message+'</td>' +\n\t\t\t '</tr>' +\n\t\t\t'</table>' +\n\t\t '</div>' +\n\t\t'</div>';\n\n\t\t//show notification\n\t\tjQuery(\"body\").append(notificationHTML);\n\n\t\t//if have timer\n\t\tif(timer)\n\t\t{\n\t\t\tsetTimeout(\"closeNotification('notification_\"+randId+\"');\",timer*1000);\n\t\t}//eof if\n\t}//eof if\n\n\treturn 'notification_'+randId;\n}//eof function", "title": "" }, { "docid": "6a70e8ecd1fd0171ff742b6be6807014", "score": "0.635628", "text": "function showAlert() {\n navigator.notification.alert(\n 'Your report is due at 5:00 PM.', \t// message\n\t\t\talertDismissed,\t\t\t\t\t\t// callback\n 'Reminder Dismissed', \t\t\t// title\n 'Dismiss' \t\t\t// buttonName\n );\n }", "title": "" }, { "docid": "1c2f7b814c2c282cc716a1b59bbb2c16", "score": "0.6342835", "text": "function displaySuccess(message) {\n // Display a noty\n var n = noty({\n layout: \"top\",\n theme: \"bootstrapTheme\",\n type: \"success\",\n text: message,\n maxVisible: 1,\n timeout: 2000,\n killer: true,\n buttons: false\n });\n }", "title": "" }, { "docid": "d84c70b62e628ff977dcca2a1bdf8346", "score": "0.6342406", "text": "function current(req, res) {\n return res.send(\"Notifications show\");\n}", "title": "" }, { "docid": "5504d8a5377a5c98910e23189a84484c", "score": "0.6339297", "text": "function messgeShow(msg) {\n api.toast({\n msg: msg,\n duration: 2000,\n location: 'middle'\n });\n}", "title": "" }, { "docid": "dba7a69491933d804706fbe78961583a", "score": "0.6334748", "text": "function setup(){\r\n document.getElementById('notificationVisibility').style.display = 'none';\r\n}", "title": "" }, { "docid": "794fde18118bffcc3f708f6ebeaf7bff", "score": "0.63339967", "text": "function checkNotification(){\n $.ajax({url:\"notification_check.php\", success:function(output){\n $(\"#notification\").html(output);\n }});\n}", "title": "" }, { "docid": "7d7a0c32c80559ed753d5ad1aec51e0a", "score": "0.63276875", "text": "function showIndicator() {\n offlineNotification.innerHTML = 'You are currently offline.';\n offlineNotification.className = 'showOfflineNotification';\n}", "title": "" }, { "docid": "fbb0666c43ce8d2a27b59479a6ca0150", "score": "0.63162893", "text": "function showNotification() {\n notification.classList.add('show');\n\n setTimeout(() => {\n notification.classList.remove('show');\n }, 2000);\n}", "title": "" }, { "docid": "1b9d46ef1eb7333ec0aecef1912a0c53", "score": "0.6312858", "text": "function showNotify(id, where, text) {\n showAlertGeneric(id, \"alert-info\", where, text)\n}", "title": "" }, { "docid": "1e1007e18d270fb08cb59c9ac30fb4c3", "score": "0.6292369", "text": "function success(title, content){\n $.pnotify({\n title: title,\n text: content,\n cornerclass: 'ui-pnotify-sharp',\n type: \"success\",\n history: false,\n addclass: \"custom-notify\",\n }); \n}", "title": "" }, { "docid": "3fcd431968d6642f027f440bcde30f90", "score": "0.6291995", "text": "function showNotification(content) {\n $(\".error\").text(content);\n}", "title": "" }, { "docid": "a1e1ed3de72e0dcdfda98b7e9d59d8c8", "score": "0.6288704", "text": "function showNotification() {\n notification.classList.add('notification-container');\n notification.classList.add('show');\n\n setTimeout(() => {\n notification.classList.remove('notification-container');\n notification.classList.remove('show');\n }, 2000);\n}", "title": "" }, { "docid": "8d8a032072af685608aad9131cff5597", "score": "0.6274606", "text": "static notificationDispature(message) {\r\n const event = new CustomEvent('customnotification', { detail: message });\r\n window.dispatchEvent(event);\r\n }", "title": "" }, { "docid": "347b716451e76949847986d61d1c199f", "score": "0.6270982", "text": "notification(msg, duration) {\n let el = document.createElement('div');\n el.setAttribute(\n 'style',\n `position:fixed; \n top:50px; \n width:100%; \n text-align:center; \n padding:20px; \n background-color:white; \n border:1px solid #888;`\n );\n el.innerHTML = msg;\n setTimeout(function() {\n el.parentNode.removeChild(el);\n }, duration);\n document.body.appendChild(el);\n }", "title": "" }, { "docid": "c70b283e14c1a56bc556448636df5fa4", "score": "0.62672305", "text": "function showHTMLNotification(title, msg, hash) {\n\t\n\tif (window.webkitNotifications) {\n\t\tif (window.webkitNotifications.checkPermission() > 0) {\n\t\t\twindow.webkitNotifications.requestPermission(function(){});\n\t\t} else if (!hasFocus){\n\t\t\n\t\t\tvar popup = window.webkitNotifications.createHTMLNotification('/notify.php?pipe='+ pipeName +'&title=' + title + '&msg=' + msg + '&hash=' + hash);\n\t\t\t\n\t\t\tsetTimeout(function(){popup.cancel();}, 3000);\n\t\t\tpopup.show();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0ef8a4552e83f2c6e993bbb01ea85955", "score": "0.6266543", "text": "function showNotify(title, msg, updateSecCount, icon, tabId) {\n\tvar notifyID = \"WAIT_NOTIFY\";\n\tvar timer = updateSecCount;\n\tvar options = {\n\t\ttype: \"basic\",\n\t\ttitle: title,\n\t\ticonUrl: icon,\n\t\tmessage: msg\n\t}\n\tvar wasUpdatedCb = function(wasUpdated) { console.log(\"DRSS background: showNotify(): updated!\"); };\n\tvar reloadTabFunc = function () {\n\t\toptions.message += \" .\"; timer--;\n\t\tchrome.notifications.update(notifyID, options, wasUpdatedCb);\n\t\tif (timer == 0) {\n\t\t\tclearInterval(intervalID);\n\t\t\tchrome.notifications.clear(notifyID, wasUpdatedCb);\n\t\t\tchrome.tabs.reload(tabId);\n\t\t}\n\t}\n\tchrome.notifications.create(notifyID, options, wasUpdatedCb);\n\tvar intervalID = setInterval(reloadTabFunc, 1000);\t\t\n}", "title": "" }, { "docid": "396015da097aa5c6aeea3d153b8ac47f", "score": "0.6254991", "text": "function notify(msg=\"Request in progress\"){\n // $('#enable_otp_response p').html(\"Request in progress\"); \n $(\"#enable_otp_response p\").html(msg); \n $(\"#enable_otp_response\").show();\n setTimeout(function(){ $(\"#enable_otp_response\").hide(); }, 5000);\n}", "title": "" }, { "docid": "c2b39e99a3d4c6f63fd34e8253757e2b", "score": "0.62379014", "text": "function showNotifications() {\n $('.login').hide();\n $('.notifications').show(200);\n $('.newItem').show(200);\n}", "title": "" }, { "docid": "6ea19cdf1b46166c4bcbbd05e8446f60", "score": "0.6222074", "text": "function jnotice(title, msg)\n{\n\t jNotify(\n\t\t'<i class=\"fa fa-info-circle fa-2x\"></i> &nbsp; <strong>'+title+'</strong><br /><strong>'+msg+'</strong>',\n\t\t{\n\t\t autoHide : true, // added in v2.0\n\t\t clickOverlay : false, // added in v2.0\n\t\t MinWidth : 250,\n\t\t TimeShown : 2000,\n\t\t ShowTimeEffect : 200,\n\t\t HideTimeEffect : 200,\n\t\t LongTrip :20,\n\t\t HorizontalPosition : 'right',\n\t\t VerticalPosition : 'top',\n\t\t ShowOverlay : false,\n \t\tColorOverlay : 'black',\n\t\t OpacityOverlay : 0.3,\n\t\t onClosed : function(){ // added in v2.0\n\t\t \n\t\t },\n\t\t onCompleted : function(){ // added in v2.0\n\t\t \n\t\t }\n\t\t});\n\t \n}", "title": "" }, { "docid": "2a8a47cea18963f6a7d1837ba21b3538", "score": "0.6220159", "text": "function methodToCall(){\n if (document.getElementById(\"openNotifications\").style.display == \"none\") {\n document.getElementById(\"openNotifications\").style.display = \"block\";\n } else {\n document.getElementById(\"openNotifications\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "779214d870fa170214c86f4c2cae3c56", "score": "0.6216578", "text": "function showNotifications(typeBox, message) {\n let box = $('#' + typeBox);\n box.text(message);\n box.show();\n if (typeBox === 'infoBox') {\n setTimeout(() => {\n box.fadeOut();\n\n }, 3000);\n }\n if (typeBox == 'errorBox') {\n box.click(() => {\n box.fadeOut();\n });\n }\n }", "title": "" }, { "docid": "87da6aa5dae8e59a047554207c14e531", "score": "0.6214954", "text": "function showError(error){ // error is an object as well and it has two arguments ( ID, Messgae)\n // notification set \"display:none\" in css, so we need to change it if we get error\n notificationElement.style.display =\"block\";\n // show error message\n notificationElement.innerHTML = `<p>${error.message}</p>` \n}", "title": "" }, { "docid": "6cf8988b53948118b75a9575b74c91ea", "score": "0.6211632", "text": "function showNotification(title, message) {\n\n var notificationId = 'NOTIFICATION_ID_' + title;\n\n var options = {\n type: 'basic',\n title: title,\n message: message,\n iconUrl: 'images/icon48.png'\n };\n\n chrome.notifications.create(notificationId, options, function() {\n // DO NOTHING\n });\n\n // set notification timeout\n setTimeout(function() {\n chrome.notifications.clear(notificationId, function() {\n // DO NOTHING\n });\n },\n 5000\n );\n}", "title": "" } ]
140e7d6a4cd64922886adc097216cb03
Show error message (Invoked by DB response) Input param: None Return value: None
[ { "docid": "5cc14d409df233083830e86c4a89b56b", "score": "0.0", "text": "function showError() {\n message = document.getElementById(\"message\")\n message.className = \"alert alert-warning\";\n message.style.display = \"block\";\n message.innerHTML = \"<strong>Error!</strong> An error occured.\"\n}", "title": "" } ]
[ { "docid": "af5ac4970929f757990dd75b74aa4b6c", "score": "0.7334375", "text": "function showError() {\n console.log(\"error in writing data to the database\")\n}", "title": "" }, { "docid": "9267930b4f1bbcb9221b74e912cd6217", "score": "0.7101571", "text": "function showError() {}", "title": "" }, { "docid": "f435d2e4775ec9a72687bf2641c58bd6", "score": "0.70156556", "text": "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "title": "" }, { "docid": "15ce7fa1f23b784c1f1d0ec5d509f40e", "score": "0.6965831", "text": "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "title": "" }, { "docid": "49bf2d70abfce4c01e441731029acbe7", "score": "0.6820808", "text": "function displayError(ioId, responseObject) {\n Y.log(\"Could not load the databases\", \"error\");\n Y.log(\"Status code message: [0]\".format(responseObject.statusText), \"error\");\n loadingPanel.hide();\n MV.showAlertDialog(\"Could not load collections! Please check if the app server is running. Status Text: [0]\".format(responseObject.statustext), MV.warnIcon);\n }", "title": "" }, { "docid": "8662d9616be51371a354228ae181929a", "score": "0.6785723", "text": "showErrorMessage() {}", "title": "" }, { "docid": "69d3294216955e911e6bac94704b434f", "score": "0.6725612", "text": "function displayMessage(str){\n\tif(str){\n\t\taa.env.setValue(\"ErrorCode\", \"-1\");\n\t\taa.env.setValue(\"ErrorMessage\", str);\n\t}\n}", "title": "" }, { "docid": "30f1e70d1e4fc3fe490b5c10db1253e1", "score": "0.67187387", "text": "function showError(type, text) {}", "title": "" }, { "docid": "7757da29a1a36a6a91922a3d97e6f3ff", "score": "0.667845", "text": "function showError() {\n showStatus('error');\n}", "title": "" }, { "docid": "48a3361aaffeceaa4d867a961d64da26", "score": "0.6668868", "text": "function dberrorhandlerForResponseForStudent(err){\n console.log(\"Response entries for a student DB Error: \"+err.message + \"\\nCode=\"+err.code);\n alert(\"Response entries for for a student DB Error: \"+err.message + \"\\nCode=\"+err.code);\n}", "title": "" }, { "docid": "8ecd8eb24ef540d3b6b1857ade352d5a", "score": "0.6635456", "text": "function errorCB(err) {\n //alert(\"Error processing SQL: \"+err.code);\n \n }", "title": "" }, { "docid": "fc7f444a910f53119fa96eaa697145e5", "score": "0.6513687", "text": "function triggerFail(message){\n\tif(message == undefined){\n\t\tmessage = \"Error retrieving information.\";\n\t}\n\n\t$(\"#output\").html('<h2 style=\"color: #FFB3B3; text-shadow: 1px 1px #130707;\">' + message + '</h2>');\n}", "title": "" }, { "docid": "cfe0d727723298cb1453e2b813aa68e2", "score": "0.647976", "text": "function showErrorMessage(msg) { }", "title": "" }, { "docid": "51c2d18fa747882d6d0127c696ba15cd", "score": "0.6446726", "text": "function errorDB(tx, err) {\n\t\tif (err && err.message) {\n\t\t alert(\"Error processing SQL: \" + err.message);\n\t\t} else {\n\t\t alert(\"Error processing SQL: \" + tx);\n\t\t}\n\t}", "title": "" }, { "docid": "9a87a6e29ae72fc76078aa9ab109f4ef", "score": "0.6437782", "text": "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "title": "" }, { "docid": "67943c1c6651e64652ad025d9bca1890", "score": "0.64110446", "text": "function getInvalidDatabaseResponse(db) {\n return 'Invalid database.';\n}", "title": "" }, { "docid": "3acfc31915160bd7cdeb03145819a752", "score": "0.6365645", "text": "function throwError(error) {\n $('#errorValue').append('No Statement found');\n $('#modalError').modal('show');\n}", "title": "" }, { "docid": "9d3f25341bdd891e6f2c686a4a503268", "score": "0.635299", "text": "function errorCB(err) {\n\talert(\"Error processing SQL: \"+err.code+\" msg: \"+err.message);\n}", "title": "" }, { "docid": "53b14b7bb83c5ff7d58d83db504e2a46", "score": "0.6335331", "text": "function defaultSimpleRequestError(msg) {\n\t$(\"#output\").text(\"Command response: \" + msg);\n}", "title": "" }, { "docid": "8b77c4390e6d109dd5161eebec421d32", "score": "0.6328327", "text": "function errorlogging(err) \r\n{\r\n\talert(\"Error processing SQL: Main err\"+err.code);\r\n}", "title": "" }, { "docid": "1ad5d1f9698ed1a6e7735acc35e08b30", "score": "0.63109815", "text": "function error(){\n return \"Invaild e-mail or password!\";\n }", "title": "" }, { "docid": "20d003f21992ebf8977f79b1f100fb99", "score": "0.63091606", "text": "function onError(err) {\n if (err === null) return;\n try {\n console.trace();\n } catch (e) {}\n console.log(err);\n $(\"#errModal\").find('[thdc-err]').text(err.message);\n $(\"#errModal\").vModal('show');\n throw \"general error\";\n}", "title": "" }, { "docid": "159b53de55fbfb48f3ccb59785b94289", "score": "0.63031507", "text": "function showError() {\r\n console.log(\"There is some error\");\r\n}", "title": "" }, { "docid": "c20d41af8ab2419be37a6bb8e9c6de8a", "score": "0.62853867", "text": "function showErr(err){\n\tconst outputElem = $('#results');\n\tconst errMsg = (\n\t\t\t`<p class=font>No results found.</p>`\n\t\t);\n\toutputElem.html(errMsg);\n}", "title": "" }, { "docid": "559fe83e04199b5019ba1a8176cc5067", "score": "0.6267334", "text": "function showError() {\n console.log(\"There was an error\");\n}", "title": "" }, { "docid": "69ce2a0cff268463ab70917f9fd81dad", "score": "0.62472945", "text": "function displayError(message)\n{\n// display error message, with more technical details if debugMode is true\nalert(\"Error accessing the server! \"+\n(debugMode ? \"\\n\" + message : \"\"));\n}", "title": "" }, { "docid": "62537e427780ad74ae65ad2db15faae1", "score": "0.62445146", "text": "function errorCB(err) {\r\n console.log(\"Error occured while executing SQL: \"+err.code);\r\n }", "title": "" }, { "docid": "58f19cf487cbbd23b319f4247cc08115", "score": "0.6230804", "text": "function showError(err) {\n console.log(err);\n}", "title": "" }, { "docid": "cf32c805c832f3c343981187f657702c", "score": "0.6227256", "text": "function errorCB(err) {\r\n alert(\"Error processing SQL: \"+err.code);\r\n }", "title": "" }, { "docid": "556aabbd179578e35b9077505c13defe", "score": "0.6227227", "text": "function returnErrorText(res, err) {\n let message = (process.env.SHOW_ERROR_DETAIL == 'True') ? err.message : 'An error occurred, please contact your system administrator';\n res.set({ 'Content-Type': 'text/xml' });\n res.status(200).render('ldap_directory/text.ejs', {\n title: 'Error',\n text: message\n });\n}", "title": "" }, { "docid": "0e3af3489e721c363e6cea7e5914a50a", "score": "0.6218529", "text": "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "title": "" }, { "docid": "2ce85fe2462e593c45794671297308ca", "score": "0.6218497", "text": "errorHandler(err) {\n if (!err.name === 'QueryResultError') {\n this.logError(err);\n }\n return Left(err);\n }", "title": "" }, { "docid": "0f62373902ac84cf7208ee768680c1a4", "score": "0.6217762", "text": "function errorCB( err ) {\n\tconsole.log( \"There was an error procesing the sql query.\" );\n}", "title": "" }, { "docid": "b185e06bddb4e0a861e5aeac6f45c590", "score": "0.6214138", "text": "function error(msg) {\n response({ status: 'error', msg: msg });\n }", "title": "" }, { "docid": "2f1985b182b2428265754295c95818ba", "score": "0.621094", "text": "function UndefinedResponseFromDBerror(querySql) {\n\treturn {\n\t\ttable: undefined,\n\t\tcode: 99999,\n\t\troutine: 'undefinedResponseFromDatabase',\n\t\thint: undefined,\n\t\tdetail: 'Query Sent: ' + querySql,\n\t};\n}", "title": "" }, { "docid": "1e6393cd1e246f785e85203e21f46ec1", "score": "0.62037635", "text": "function dbErrorHandler(err) {\r\n// 없앰\r\n}", "title": "" }, { "docid": "b46e51d6c27bca5e0a9a912fd1b690a9", "score": "0.61992514", "text": "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "title": "" }, { "docid": "a156a747b16af676306c32845f488de6", "score": "0.6192587", "text": "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "title": "" }, { "docid": "88db5dc78bb1381d69e83038f4bccba2", "score": "0.6191081", "text": "function error(str, res) {\n\t\talert(str + \":\" + res.error + \" - \" + res.verboseError);\n\t\treset();\n\t}", "title": "" }, { "docid": "d6a74e3a026ad5b83f98eab5dd626242", "score": "0.6175161", "text": "showError(error){\n\t\talert(error||'unknown error has occurred.');\n\t}", "title": "" }, { "docid": "eaa453cffe34475a058227cf1e66f6a9", "score": "0.61634564", "text": "function mostrarError(err){\n console.log('Error', err);\n }", "title": "" }, { "docid": "eaa453cffe34475a058227cf1e66f6a9", "score": "0.61634564", "text": "function mostrarError(err){\n console.log('Error', err);\n }", "title": "" }, { "docid": "0498b640c3ee158eecf29236e46a6fc1", "score": "0.61614084", "text": "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "title": "" }, { "docid": "b85bef2173e14ff5386958a7fbeb1eab", "score": "0.6160895", "text": "function handleErr(err) {\n console.log(\"error \" + err.responseJSON);\n // $(\"#alert .msg\").text(err.responseJSON);\n // $(\"#alert\").fadeIn(500);\n }", "title": "" }, { "docid": "489724525740d4da48569e193a20a266", "score": "0.6158782", "text": "function errorCB(tx, err) {\n\t//alert(\"Error processing SQL: \"+err);\n}", "title": "" }, { "docid": "83d5c308700721cf593af55b1ada588d", "score": "0.61530554", "text": "function displayError(error) {\n console.log(error);\n}", "title": "" }, { "docid": "79ccc27a3ba63b7be148e92dd5c770ca", "score": "0.6152849", "text": "function displayError(errorText) {\r\n // log the msg for the user to see\r\n logError(errorText);\r\n}", "title": "" }, { "docid": "0e19241c48d21e052d28139dbdfc7ab4", "score": "0.61488724", "text": "function errorCB(err) {\n console.log(\"Error processing SQL: \"+err.code);\n}", "title": "" }, { "docid": "bec7d48e261e1ac4d16a3d741a380f7f", "score": "0.6143723", "text": "function defaultError(error)\n{\n msg(\"error \" + error.responseText);\n}", "title": "" }, { "docid": "67dea82afa30de2b3e096a720b94e6dc", "score": "0.6133816", "text": "function genericErrorHandler(res, err) {\n console.error('error running postgres query', err);\n var options = getOptions();\n options.series[0].name = err;\n res.json(options);\n }", "title": "" }, { "docid": "386648fff9411059a4eada73a9864d40", "score": "0.61259073", "text": "function displayOracleErrorMessage(msg, title)\n {\n adf.mf.login.hideBusy();\n alert(msg);\n }", "title": "" }, { "docid": "4c4ab978cf9a567011251771da47d1e2", "score": "0.6115031", "text": "_renderError() {\n return null;\n }", "title": "" }, { "docid": "1572d9659fdf6ea94ed93b0970d3a899", "score": "0.60963196", "text": "function displayAPIError(error) {\n console.log(error)\n}", "title": "" }, { "docid": "25c1a5258110238b668a70b88d7b571e", "score": "0.6094266", "text": "function displayPHPError(error)\r\n{\r\n displayError (\"Error number :\" + error.errno + \"\\r\\n\" +\r\n \"Text :\"+ error.text + \"\\r\\n\" +\r\n \"Location :\" + error.location + \"\\r\\n\" +\r\n \"Line :\" + error.line + + \"\\r\\n\");\r\n}", "title": "" }, { "docid": "5b52a9f4646c1c3a2016e42f07a944ee", "score": "0.60941184", "text": "function onSendErr(err) {\n console.log(err);\n alert('[send msg]:err');\n viewUpdate(10);\n }", "title": "" }, { "docid": "5fc6e8ac482f206b5dc646e013370d47", "score": "0.6090888", "text": "function errorCB(err) {\n alert(\"Error processing SQL: \"+err.code);\n}", "title": "" }, { "docid": "9423bae2faa6fe1290c702f922bbcc30", "score": "0.6087853", "text": "function mostrarError(err){\n console.log('Error', err);\n }", "title": "" }, { "docid": "52e98e2672cc3fcd1d61844af03d4a31", "score": "0.60857344", "text": "async _handleError(err, title) {\n await showErrorMessage(title, err);\n return;\n }", "title": "" }, { "docid": "40eec106da2a9d210fce8a7e6d4b31fa", "score": "0.60806966", "text": "function displayError(message) \r\n{\r\n // display error message, with more technical details if debugMode is true\r\n alert(\"Error accessing the server! \" +\r\n (debugMode ? message : \"\"));\r\n}", "title": "" }, { "docid": "c4ada24fde66ef13458c379fb89d51cd", "score": "0.60754377", "text": "function showDbsError(data) {\n handleAjaxErrors(data, dbsBlockId);\n}", "title": "" }, { "docid": "3995921d70cb506db8f6646263f9a6d0", "score": "0.60707974", "text": "function _detailsFail(err) {\n switch (err.status) {\n case 400:\n //error while getting asset\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 404:\n //no assets found\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 500:\n //server error\n vm.loadingState = 'networkError';\n break;\n default:\n vm.loadingState = 'networkError';\n break;\n }\n }", "title": "" }, { "docid": "d030ff93bd3396155724e15e979e5041", "score": "0.60571444", "text": "function responseError(msg) {\n\treturn {'error': msg};\n}", "title": "" }, { "docid": "94e7149ffc893b7be864d0dfdf8692af", "score": "0.60544294", "text": "function error(message) {\r\n command_1.issue('error', message);\r\n}", "title": "" }, { "docid": "94e7149ffc893b7be864d0dfdf8692af", "score": "0.60544294", "text": "function error(message) {\r\n command_1.issue('error', message);\r\n}", "title": "" }, { "docid": "ed3ac778bfc79a31ad853b27ef4c23e0", "score": "0.604024", "text": "function updateRelationErrorMsg() {\n relationErrorMsg.innerHTML = relationInput.validationMessage;\n}", "title": "" }, { "docid": "c48c747240aa6ffcecf4793d6408fae7", "score": "0.603706", "text": "function errorBD(err) {\n\talert(\"Error \" + err.code + \" procesando SQL: \" + err.message);\n}", "title": "" }, { "docid": "12d53f2300aa5b5ef0e3da0d9718c986", "score": "0.6028714", "text": "function handleError() {\n // TODO handle errors\n // var message = 'Something went wrong...';\n }", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.60267836", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.60267836", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.60267836", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "6effa19ae12fcf9c8eac58562941896e", "score": "0.60267836", "text": "function showErrorDialog(capturedError){return true;}", "title": "" }, { "docid": "f43aff085093cc5cb6c8680fe093914a", "score": "0.6022381", "text": "function realEstateError(response){\n alert(response);\n return;\n}", "title": "" }, { "docid": "f7da130ba5ffeef119369d95e4d0b7d6", "score": "0.6021789", "text": "function showError(_ref3) {\n var title = _ref3.title,\n description = _ref3.description;\n\n _addons[\"default\"].getChannel().emit(_coreEvents[\"default\"].STORY_ERRORED, {\n title: title,\n description: description\n });\n\n showErrorDisplay({\n message: title,\n stack: description\n });\n} // showException is used if we fail to render the story and it is uncaught by the app layer", "title": "" }, { "docid": "cc95c7b6296247acc3bf18020744d446", "score": "0.6019345", "text": "displayError(message) {\n this.error = message;\n }", "title": "" }, { "docid": "8cef99019904cfc8073980b3046c11ae", "score": "0.60105884", "text": "showErrorBox(title, content, detail) {\r\n return this.showMessageBox({\r\n buttons: ['OK'],\r\n message: content,\r\n title,\r\n detail,\r\n type: 'error',\r\n }).then((answer) => {\r\n return;\r\n });\r\n }", "title": "" }, { "docid": "dc14f556b511e8bc2caf9395b45c182d", "score": "0.60000634", "text": "function errorModal(err) {\n modal.style.display = \"block\";\n errorContent.innerHTML = JSON.stringify(err.status) + \" error occured. Please re-enter your city name or choose a different city.\";\n }", "title": "" }, { "docid": "39f67d938367811d97f52fb5d90c2083", "score": "0.59997857", "text": "function errorMessagePullingDataFromAPI(){\n\t\t$errorLoadingAPI.text(\"Error pulling all the data from the API\");\n\t}", "title": "" }, { "docid": "db60ea4b6afeabfc028c14e653ab1f1c", "score": "0.5998383", "text": "function errorHandler(data, errorCode, errorMessage) {\n document.getElementById(\"ErrorMessage\").innerText =\n \"Error occurred while retireving information. \" + errorMessage;\n }", "title": "" }, { "docid": "850c242c6abbf1afc612fca8b0eaa231", "score": "0.5996896", "text": "_displayError(exitCode, code, message) {\n this._outputConfiguration.outputError(`${message}\\n`, this._outputConfiguration.writeErr);\n this._exit(exitCode, code, message);\n }", "title": "" }, { "docid": "850c242c6abbf1afc612fca8b0eaa231", "score": "0.5996896", "text": "_displayError(exitCode, code, message) {\n this._outputConfiguration.outputError(`${message}\\n`, this._outputConfiguration.writeErr);\n this._exit(exitCode, code, message);\n }", "title": "" }, { "docid": "3c66767d8157a2095d0f43bc7877fe21", "score": "0.5994963", "text": "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "title": "" }, { "docid": "32ca320b2a69bbcaf48093f1f4bf2272", "score": "0.599477", "text": "function DisplayError(pMsg) {\n let domainArea = document.getElementById('v-token-results');\n domainArea.innerHTML = '';\n let div = document.createElement('div');\n div.setAttribute('class', 'v-errorText');\n let message = document.createTextNode('ERROR: ' + pMsg);\n div.appendChild(message);\n domainArea.appendChild(div);\n }", "title": "" }, { "docid": "1bf1876dade7a9fd95080e4eef864b6f", "score": "0.59847957", "text": "function cmdCallMsg(res) {\n if (res.result) {\n printMsgAttendant(res.error.data.text, formatTime(res.error.data.date)) \n } else {\n printMsgInfo(res.error.msg, formatTime(res.error.data.date))\n }\n }", "title": "" }, { "docid": "bb471128d7a38b5c0951ed3096d1c09d", "score": "0.5978617", "text": "function showError(str, err) {\n console.log(\"An error occurred while processing configuration:\\n\");\n if (str) console.log(str);\n if (err) console.log(err);\n}", "title": "" }, { "docid": "f31a01301c6920e7c28464e1735f8d1e", "score": "0.5975605", "text": "function adderr(txt) { return !fields.attr(\"required\", false).mbError(txt); }", "title": "" }, { "docid": "feec8d3fa5a82ac5bfb9aadcd60a877b", "score": "0.5972067", "text": "_error(err) {\n this._loading(false);\n if (! err.message) return;\n this.refs['popup'].getWrappedInstance().show(err.message);\n }", "title": "" }, { "docid": "1d17988eb5a3659e1b9f9eac99be2c15", "score": "0.59686065", "text": "function showError(error) {\n return console.error(`API ${error}`)\n}", "title": "" }, { "docid": "7d5011f04e4fe8cfdfabe98f6c88e0c2", "score": "0.5959426", "text": "function errorPage(e) {\r\n if (!empty(e)) {\r\n Logger.error(\"[Error page redirect:\" + e.error + \"] - ***Emarsys error message: \" + e.errorMessage);\r\n }\r\n app.getView().render('subscription/emarsys_error');\r\n}", "title": "" }, { "docid": "169c161b32bca182cae0716650aad3eb", "score": "0.5959395", "text": "_handleError (name, msg) {\n this.view.renderError(name, msg);\n }", "title": "" }, { "docid": "7ee2e0244692ac2be6c8711d7e5ad1f2", "score": "0.5958001", "text": "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "title": "" }, { "docid": "63769ed0918c68119048906f90bc2400", "score": "0.59572995", "text": "function crudError(response) {\n\n if (response.status == 401 || response.status == 403) {\n logIn();\n } else {\n alert(getErrorString(response));\n }\n}", "title": "" }, { "docid": "7570286652c4b9228346a87fefca22f8", "score": "0.5954671", "text": "function errorMsg(msg, error) {\n // errorElement.innerHTML += '<p>' + msg + '</p>';\n console.log(msg);\n if (typeof error !== 'undefined') {\n console.error(error);\n }\n }", "title": "" }, { "docid": "50d4e6c973fc90a749e14710f085d811", "score": "0.595218", "text": "function fallo() {\n return error(\"Reportar fallo\");\n}", "title": "" }, { "docid": "8ece40d2fbd3f058fac989f961600349", "score": "0.59512246", "text": "function callError(info){\n APP.displayError(info);\n }", "title": "" }, { "docid": "d9d6d966627c0e2d1266d6a19b38e665", "score": "0.59349513", "text": "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}", "title": "" }, { "docid": "b1c900e480ec344ee3bd22d2e8a65d54", "score": "0.5931353", "text": "function showErrorDialog(boundary,errorInfo){return true;}", "title": "" }, { "docid": "b1c900e480ec344ee3bd22d2e8a65d54", "score": "0.5931353", "text": "function showErrorDialog(boundary,errorInfo){return true;}", "title": "" }, { "docid": "2234c05d4b1f3e8e8955d5dc6fc48ae5", "score": "0.5928317", "text": "function displayError() {\n Toast.show({\n style: { backgroundColor: \"red\", justifyContent: \"center\" },\n position: \"top\",\n text: \"Record meal(s) failed. Please try again.\",\n textStyle: {\n textAlign: 'center',\n },\n duration: 1500\n });\n }", "title": "" }, { "docid": "7719dc4aa95ee0ca2194ba0487b420b7", "score": "0.5921181", "text": "setErrMsg(event, status, res) {\n let _this = event.data;\n let extra = '';\n if (status === 502) {\n extra = 'bad server response retrieving web table. likely uncaught error on server side. check logs.';\n }\n let msg = `Status ${status} - ${res.statusText}: ${extra}`;\n _this.updateMsg(msg);\n }", "title": "" }, { "docid": "61d06e3135e1fd44f2748228994e7e3a", "score": "0.59174156", "text": "function handleError(transactionInfo) {\n var resultString = \"\";\n\n if (errorField in transactionInfo) {\n resultString += \"Client Transaction ID: \" + transactionInfo[clientTransactionId] + \"<br>\";\n }\n if (transactionId in transactionInfo) {\n resultString += \"Transaction ID: \" + transactionInfo[transactionId] + \"<br>\";\n }\n else {\n resultString += \"Transaction ID: PROCESSED OFFLINE OR NO CARD USED<br>\";\n }\n return resultString;\n}", "title": "" }, { "docid": "46b255c56bf4689f22a45e050bd66d9c", "score": "0.5914992", "text": "function error(err) {\n myAlertOnValium.show({\n type: 'danger',\n title: 'Upload failed',\n content: err || ''\n });\n }", "title": "" } ]
379fa83e242b2feb4c8952ec973a7049
A template to show if the condition expression evaluates to true.
[ { "docid": "1a731d5ade34aaeb263048d71db1496f", "score": "0.0", "text": "set ngIfThen(templateRef) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }", "title": "" } ]
[ { "docid": "76e4d3f8fbc17f8254d920d287160176", "score": "0.67038304", "text": "function testCondition(template, view, condition) {\n return (new Function('return (' + template.root.conditions[condition] + ')')).call(view);\n }", "title": "" }, { "docid": "c20bc72e5f1069245710f8aa1733e0a0", "score": "0.6270218", "text": "function isTrue( value ) {\n\tconsole.log( value + \" is \" + (value ? \"Truthy\" : \"Falsy\" ));\n}", "title": "" }, { "docid": "75f082da5ff1c374ef43e071ff655856", "score": "0.6198841", "text": "function Conditional(props) {\n return (\n <div>\n {\n props.showNumber > 0 &&\n <h3>Showing conditional text: {props.showNumber}</h3>\n }\n </div>\n );\n}", "title": "" }, { "docid": "1f8ae7f160497199289addb872c3b0c1", "score": "0.6097253", "text": "_if(expr, block) {\n let html = \"${\" + expr + \"?\",\n fallback = false,\n match;\n while ((match = block.match(/#else(?:\\s+if\\s*\\((.+)\\))?\\s*:/))) {\n html += \"`\" + block.substring(0, match.index).trim() + \"`:\";\n if (match[1]) html += match[1] + \"?\";\n else fallback = true;\n block = block.substring(match.index + match[0].length);\n }\n return (\n html + \"`\" + block.trim() + \"`\" + (fallback ? \"\" : \":``\") + \"}\"\n );\n }", "title": "" }, { "docid": "8e98ccd5b64921e8a33df80314caed3a", "score": "0.6068995", "text": "function Conditional() {\n return <h1>Some cool stuff about conditional rendering</h1>\n}", "title": "" }, { "docid": "29ccea6dc2d384386fc52e3c9627095b", "score": "0.5958491", "text": "toString() {\n return `ConditionalExpressionNode { lparam = ${this.lparam}, op = Symbol(${AnswerType.getInstance().symbolToComparatorOperator(this.op)}), rparam = ${this.rparam} }`;\n }", "title": "" }, { "docid": "b590127dfc707358f9d971469bb9420c", "score": "0.58937955", "text": "templateIf(cond, ...args) {\n if (isTrue(cond)) this.template(...args);\n }", "title": "" }, { "docid": "9eee8852ef616bb40d08f5f5f0242e66", "score": "0.58214253", "text": "function boolean_true(){\n document.getElementById(\"boolean_true\").innerHTML = 3>1;\n}", "title": "" }, { "docid": "99fa885eba9588919b86283e8572b023", "score": "0.57156557", "text": "function ifstatement(conditions, variableNames) {\n //console.log(conditions);\n if (variableNames.length == 1) {\n return 'if ' + variableNames[0];\n }\n return 'if ' + variableNames[0] + '' + conditions[0] + '' + variableNames[1];\n\n}", "title": "" }, { "docid": "813979afe9cd97c72681a1a0e20ff25c", "score": "0.5669087", "text": "function If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}", "title": "" }, { "docid": "f78d58a962bccba8a5b3cdcbe2a39a20", "score": "0.5567413", "text": "function If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new anonymous_1.default);\n}", "title": "" }, { "docid": "df4a9fd69bc9a44ce13e33484dd3d756", "score": "0.55456465", "text": "function boolean_false(){\n document.getElementById(\"boolean_false\").innerHTML = 1>3;\n}", "title": "" }, { "docid": "393db73db7f90a8bb9e42a28257b37cb", "score": "0.55322033", "text": "function is_conditional_expression(stmt) {\n return is_tagged_list(stmt,\n \"conditional_expression\");\n}", "title": "" }, { "docid": "d9a6164ac661c7dc77df4353af12ff7c", "score": "0.5521083", "text": "function true_Op() {\n document.getElementById(\"Not\").innerHTML= ! (5 > 10);\n}", "title": "" }, { "docid": "191d8ac3a3908c420cab4bc839f57303", "score": "0.5515319", "text": "function make_if()\n{\n\tvar backrefs=this.tpl_content_compiled.match(/{if\\s*(.+?)\\}(.+?)(\\{else\\}(.+?))?\\{\\/if\\}/)\n\tif(!backrefs) return 0\n\tvar whole_match=backrefs[0]\n\tvar condition=backrefs[1]\n\tvar conditional_code=backrefs[2]\n\tvar else_code=\"\"\n\tif(typeof backrefs[3]!=\"undefined\") else_code=backrefs[4]\n\tvar condition_value=0\n\teval('if('+condition+') condition_value=1')\n\tif(condition_value) this.tpl_content_compiled=this.tpl_content_compiled.replace(whole_match,conditional_code)\n\telse\n\tif(else_code!=\"\") this.tpl_content_compiled=this.tpl_content_compiled.replace(whole_match,else_code)\n\telse\n\tthis.tpl_content_compiled=this.tpl_content_compiled.replace(whole_match,'')\n\treturn 1\n}", "title": "" }, { "docid": "4348ed31cd019c496228f8588ea04c8e", "score": "0.543363", "text": "function condition() {\n var begin = '(function () {\\n',\n cons = [],\n rets = [],\n noEnd;\n\n loop(this.body, function (each, index) {\n if (index % 2 === 0) {\n cons.push(each);\n } else {\n rets.push(each);\n }\n });\n loop(cons, function (each, index) {\n if (index === 0 && rets[index]) {\n begin += (' if (' + each.compile() + ') {\\n');\n begin += (' return ' + rets[index].compile() + ';\\n');\n begin += (' }');\n } else if (index !== 0 && rets[index]) {\n begin += (' else if (' + each.compile() + ') {\\n');\n begin += (' return ' + rets[index].compile() + ';\\n');\n begin += (' }');\n } else if (index !== 0 && !rets[index]) {\n begin += (' else {\\n');\n begin += (' return ' + each.compile() + ';\\n');\n begin += (' }\\n');\n } else {\n noEnd = true;\n begin += (' var _cache = ' + each.compile() + ';\\n');\n begin += (' if (_cache) {\\n return _cache;\\n }\\n return false;\\n');\n begin += ('}())');\n }\n });\n if (!noEnd) {\n begin += '\\n return null;\\n}())';\n }\n return begin;\n}", "title": "" }, { "docid": "5694e5e08c4edeea0de147703053a7f2", "score": "0.53956455", "text": "function andT_Function() {\n document.write(5>2 && 10>4);\n}", "title": "" }, { "docid": "4bad4985294c29f9841d0354867095ef", "score": "0.53569305", "text": "function ourTrueOrFalse (isItTrue) {\nif (isItTrue) {\n return \"Yes, it's true\";\n}\nreturn \"No, it's false\";\n}", "title": "" }, { "docid": "5ae227c634d724485a83ea3b3266f4f7", "score": "0.5341544", "text": "toString() {\n let delta = '';\n\n if (isString(this._value)) {\n if (this._value.includes('\\n')) {\n return 'is equal to <text>';\n }\n\n return __jymfony.sprintf('is equal to \\'%s\\'', this._value);\n }\n\n if (0 !== this._delta) {\n delta = __jymfony.sprintf(' with delta <%F>', this._delta);\n }\n\n return __jymfony.sprintf('is equal to %s%s', this.shortenedExport(this._value), delta);\n }", "title": "" }, { "docid": "fa6ef643bab7f5fbc1a3b0cfd62cb20e", "score": "0.53410786", "text": "function and_example(){\n document.getElementById(\"and_example\").innerHTML = (5>2 && 3>1)+ \" - \" + (5>10 && 1>2);\n}", "title": "" }, { "docid": "536e80778d9fbb42fd135bbdae0d10b4", "score": "0.5332766", "text": "function andF_Function() {\n document.write(1>2 && 10>4);\n}", "title": "" }, { "docid": "6ce1c71a541439c78b14a813fb84f37b", "score": "0.5332214", "text": "function cond(condition, specThen) {\n return condition ? specThen : NO_PROPERTY;\n }", "title": "" }, { "docid": "de5960774c6cc0588b954784ef291d9e", "score": "0.53233296", "text": "function twoThingsTrue(expr1, expr2) {\n if (expr1 && expr2) {\n return 'TWO THINGS ARE TRUE: Executing code inside conditional statement';\n }\n return 'Nothing happened';\n}", "title": "" }, { "docid": "9e58f19911a7eaf55cdc3ef909fa5df7", "score": "0.5315625", "text": "function oneThingTrue(expr1, expr2) {\n if (expr1 || expr2) {\n return 'AT LEAST ONE THING IS TRUE: Executing code inside conditional statement';\n }\n return 'Nothing happened';\n}", "title": "" }, { "docid": "ed4865c0d17b368c0b91dfa02f313a39", "score": "0.5311001", "text": "function ifcond(state) {\n if (!state.lineExpressions.length)\n (0, errors_1.throwError)(\"A condition must be passed to an if directive\", state);\n if (state.lineExpressions.length > 1)\n (0, errors_1.throwError)(\"Only a single condition can be passed to an if directive\", state);\n var value = (0, functions_1.runFunction)(state.lineExpressions[0], state);\n if (value === null)\n (0, errors_1.throwError)(\"Could not parse .if condition\", state);\n if (typeof value !== \"number\")\n (0, errors_1.throwError)(\"Condition of if directive must evaluate to a numeric value, saw: \" + value, state);\n if (value) {\n state.ifElseStack.push(conditionals_1.IfElseStateFlags.ExecutingBlock);\n }\n else {\n state.ifElseStack.push(conditionals_1.IfElseStateFlags.AcceptingBlock);\n }\n return true;\n}", "title": "" }, { "docid": "5551d6b5e8a51b4e136759b22f3138c2", "score": "0.52978", "text": "function qweb_add_if(node, condition) {\n if (node.attrs[qweb.prefix + '-if']) {\n condition = _.str.sprintf(\"(%s) and (%s)\", node.attrs[qweb.prefix + '-if'], condition);\n }\n node.attrs[qweb.prefix + '-if'] = condition;\n }", "title": "" }, { "docid": "c0481c1ae97690a4d97cf054bf7870ef", "score": "0.5273162", "text": "function Home() {\n return (\n <div>\n {/* Comment in JSX */}\n <p>Welcome to product store</p>\n <p>number: {10}</p>\n <p> number exp : {10 + 5} </p>\n <p> func call : { add(10, 30)} </p>\n <p>Boolean True {true.toString()} </p>\n <p>Boolean False {false.toString()} </p>\n <p> { \"Hello\" + \"world\" }</p>\n\n {\n /* if condition */\n (10 % 2 == 0) && <p>Even Number</p>\n }\n\n {\n /* if else ternary ? */ \n (9 % 2 == 0) ? <p>Even</p>: <p>Odd</p>\n }\n\n </div>\n )\n}", "title": "" }, { "docid": "e2c2cd8f1fe8b8ad888e15ba7eb6430e", "score": "0.52528256", "text": "function false_Op() {\n document.getElementById(\"Not2\").innerHTML= ! (20 > 10);\n}", "title": "" }, { "docid": "d39d36178de2ee12703a086474a75761", "score": "0.52356535", "text": "function or_example(){\n document.getElementById(\"or_example\").innerHTML = (5<10 || 1>2)+ \" - \" + (5>10 || 1>2);\n}", "title": "" }, { "docid": "58fc3a10aeef8c52e4d3b4e7fdc1f8b4", "score": "0.52246433", "text": "function printTrue() {\n console.log(\"true\");\n }", "title": "" }, { "docid": "015dd650c560c59f53779aa24d54715a", "score": "0.5218319", "text": "function test(condition){\n if(condition){\n return \"yes\"\n }\n else{\n return \"No\" ;\n }\n}", "title": "" }, { "docid": "83525f9d083d241a179e0d5ec4bb45e7", "score": "0.5208399", "text": "enterConditionalExpression(ctx) {\n\t}", "title": "" }, { "docid": "83525f9d083d241a179e0d5ec4bb45e7", "score": "0.5208399", "text": "enterConditionalExpression(ctx) {\n\t}", "title": "" }, { "docid": "4998fb8472b0e0ef99abd611281c5172", "score": "0.5203442", "text": "function eq(value, condition) {\n return value === condition;\n }", "title": "" }, { "docid": "b97a9fe45db9c954e2c79c2eae20d59f", "score": "0.5190691", "text": "function notFunction() {\n document.getElementById(\"Not\").innerHTML = ! (20 > 10);\n}", "title": "" }, { "docid": "833425736719894577709cc6b5e55148", "score": "0.517456", "text": "function ourTrueOrFalse(isItTrue) {\r\n if (isItTrue) {\r\n return \"Yes, it's true\";\r\n }\r\n return \"No, it's false\";\r\n}", "title": "" }, { "docid": "903068205d5bbafdff47a60f7aba8856", "score": "0.5169081", "text": "function show_5(b) /* (b : bool) -> string */ {\n return (b) ? \"True\" : \"False\";\n}", "title": "" }, { "docid": "5135e63639e720b01b9b62ed4f31cbf6", "score": "0.5159944", "text": "function elseSttmt(x) {\r\n if (x <= 10) {\r\n return \"X is less than 10\";\r\n } else {\r\n return \"X is greater than 11\";\r\n }\r\n}", "title": "" }, { "docid": "9477ae60f96c795436cff80901af3515", "score": "0.51590836", "text": "emitIf(signal, boolean_expression) {\n if (boolean_expression) {\n return this.emit(signal);\n }\n return false;\n }", "title": "" }, { "docid": "ad1876c9a5b1d28a9ff3d31b67560779", "score": "0.514184", "text": "presentarse() {\n console.log(`me llamo ${this.name}, tengo ${this.age} y ${this.blonde ? 'Soy rubio' : 'soy moreno'}`);\n }", "title": "" }, { "docid": "ef1d8e09afafb82a0a8757d4eae2ed59", "score": "0.51308435", "text": "function testIfs(testIfsCondition) {\n if(testIfsCondition) {\n return \"This condition was true\";\n }\n //Otherwise\n return \"This condition was false\";\n}", "title": "" }, { "docid": "e8ebfb9c534ef0c0b425b305d601b82c", "score": "0.5115187", "text": "function eq(value,condition) {\n return value === condition;\n }", "title": "" }, { "docid": "26be050c627bfba817acecad95bd6b9e", "score": "0.51098907", "text": "function isTruthy(arg) {\n return (arg ? 'truthy' : 'falsy')\n}", "title": "" }, { "docid": "ea8bee861ddd8c2f2a7c0d386e5c295c", "score": "0.5107033", "text": "function conditionalWriter(conditional, condition){\n condition = correctBoolExprForC(condition);\n switch(conditional.contype){\n case \"if\":\n const newLine = conditional.contype + \" (\" + condition + \"){\";\n return newLine; \n case \"for\":\n return {\"id\": \"error\", \"type\": \"error\", \"error\": \"internal error conditionalWriter - no match - for\"};\n case \"while\":\n const newLine2 = conditional.contype + \" (\" + condition + \"){\";\n return newLine2;\n };\n return {\"id\": \"error\", \"type\": \"error\", \"error\": \"internal error conditionalWriter - no match\"};\n}", "title": "" }, { "docid": "61a3f57ed9ff4d39cfaa627f450ce067", "score": "0.5106525", "text": "function Condition() {\n\n }", "title": "" }, { "docid": "289d8c76b316f2ba3c13774183776eda", "score": "0.5100771", "text": "getWhenTrue() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.whenTrue);\r\n }", "title": "" }, { "docid": "23bc4ba68a1229eb7d8fed7537e20767", "score": "0.5100276", "text": "function visitConditionalExpression(node) {\n // [source]\n // x = a() ? yield : b();\n //\n // [intermediate]\n // .local _a\n // .brfalse whenFalseLabel, (a())\n // .yield resumeLabel\n // .mark resumeLabel\n // _a = %sent%;\n // .br resultLabel\n // .mark whenFalseLabel\n // _a = b();\n // .mark resultLabel\n // x = _a;\n // We only need to perform a specific transformation if a `yield` expression exists\n // in either the `whenTrue` or `whenFalse` branches.\n // A `yield` in the condition will be handled by the normal visitor.\n if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) {\n var whenFalseLabel = defineLabel();\n var resultLabel = defineLabel();\n var resultLocal = declareLocal();\n emitBreakWhenFalse(whenFalseLabel, ts.visitNode(node.condition, visitor, ts.isExpression), /*location*/ node.condition);\n emitAssignment(resultLocal, ts.visitNode(node.whenTrue, visitor, ts.isExpression), /*location*/ node.whenTrue);\n emitBreak(resultLabel);\n markLabel(whenFalseLabel);\n emitAssignment(resultLocal, ts.visitNode(node.whenFalse, visitor, ts.isExpression), /*location*/ node.whenFalse);\n markLabel(resultLabel);\n return resultLocal;\n }\n return ts.visitEachChild(node, visitor, context);\n }", "title": "" }, { "docid": "1c89703ba144a294e420046afa51bb52", "score": "0.51002043", "text": "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"Yes, it's true\";\n }\n return \"No, it's false\";\n}", "title": "" }, { "docid": "b5d58aa763676c5ca74ba4774039765c", "score": "0.5098442", "text": "function resultsTemplate(question) {\n var htmlBlock = '<div>'\n htmlBlock = htmlBlock + question.question + ': ' + isChecked;\n return htmlBlock + \"</div>\";\n }", "title": "" }, { "docid": "0bf2869da971edf858ad4c3a83f91b6f", "score": "0.5088452", "text": "constructor(condition, valueIfTrue, valueIfFalse) {\n super('Fn::If', [condition, valueIfTrue, valueIfFalse]);\n }", "title": "" }, { "docid": "4ae5b585ce23fbb5bd86bf4d5b666aff", "score": "0.50792724", "text": "function RenderComponent({ component, condition }) {\n\treturn condition && <Fragment> {component()}</Fragment>;\n}", "title": "" }, { "docid": "bda22727a6f8501913d618c1a5f940cd", "score": "0.50673103", "text": "function condition(){\n if(isUserValid(true)){\n return \"You may enter\";\n }\n else{\n return \"Access deneid\";\n }\n}", "title": "" }, { "docid": "7eb023274af21260b05a2979189cbd4d", "score": "0.5033766", "text": "@readOnly\n @computed('value')\n /**\n * Text to render for value\n * @param {Boolean|String} value - value\n * @returns {Boolean} text to render\n */\n checked (value) {\n if ([null, undefined].indexOf(value) !== -1) {\n return false\n }\n\n if (typeOf(value) === 'string') {\n return value.toLowerCase() === 'true'\n }\n\n return value\n }", "title": "" }, { "docid": "1cba88dfcb6ae6556f8c920547bcdfcd", "score": "0.50260746", "text": "function greater_Function() {\n document.write(4>2);\n}", "title": "" }, { "docid": "1cf022edfb0520d6fcd799a976aa301f", "score": "0.5017424", "text": "function resultsTemplate(question){\n var htmlBlock = '<div>'\n htmlBlock = htmlBlock + question.question + ': ' + isChecked;\n return htmlBlock + \"</div>\";\n }", "title": "" }, { "docid": "b02e00d98d112f24f2dace95cb10e56e", "score": "0.5007887", "text": "function myTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"Yes, it's true.\"\n }\n return \"No, it's false.\"\n}", "title": "" }, { "docid": "472d4e601c5aac52e089453449cfa813", "score": "0.50015545", "text": "enterConditionalAndExpression(ctx) {\n\t}", "title": "" }, { "docid": "6e06e86f0f27c4f1e16974ee4acc8316", "score": "0.49938828", "text": "enterIfExpression(ctx) {\n\t}", "title": "" }, { "docid": "b2463421de57e803b0fe096a5604e827", "score": "0.49895966", "text": "function reportFalse(cond, ...repr) {\n if (!cond) {\n // tslint:disable-next-line:no-console\n console.error('PROPERTY FAILS ON:', ...repr);\n }\n return cond;\n}", "title": "" }, { "docid": "041243c23ba15edc845f5ae89c3b8976", "score": "0.4986189", "text": "static showIf(obj, condition){\n return this.addClassIf(obj, !condition, 'hidden')\n}", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "df1ffe52310cd40e0b08c0f370d19222", "score": "0.49830115", "text": "set ngIf(condition) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }", "title": "" }, { "docid": "0b1826702a4e65041653fbb1497ddd5b", "score": "0.49785882", "text": "function logTruthiness (val) {\n if (val) {\n console.log(\"Truthy!\");\n } else {\n console.log(\"Falsy.\");\n }\n}", "title": "" }, { "docid": "05d9252614e7b1fb63aa07ab12541c7a", "score": "0.49625403", "text": "function conditionCheck(){\n let condition= $('.label_qConditieAAT').find('input').eq(0).prop('checked');\n let images;\n if(condition===true){\n condition = \"ci\";\n } else{\n condition = \"sq\";\n }\n let conditie;\n\n if(condition == \"sq\"){\n conditie = \"vierkante\";\n }else{\n conditie = \"cirkel\";\n }\n $('#header').append(`<h2 id=\"header-text\"> Ga op de ${conditie} afbeeldingen af </h2>`);\n $('#header-text').css({\"color\": \"#FFF\", \"text-align\": \"center\"});\n return {\n condition: condition,\n }\n}", "title": "" }, { "docid": "0a6ee158ce0f913ccde318e392f2317b", "score": "0.49597174", "text": "function false_Value() {\n\n Q = 10\n S = 12\n document.write( 12 == 10);\n}", "title": "" }, { "docid": "bf9d50e1e3122d1616b14c99159d1703", "score": "0.4940492", "text": "function orF_Function() {\n document.write(1>2 || 10>4);\n}", "title": "" }, { "docid": "b8bb7f1c5ce2692259171a4ff5300691", "score": "0.49363327", "text": "IfStatement() {\n this._eat(\"if\");\n\n this._eat(\"(\");\n const test = this.Expression();\n this._eat(\")\");\n\n const consequent = this.Statement();\n\n const alternate =\n this._lookahead !== null && this._lookahead.type === \"else\"\n ? this._eat(\"else\") && this.Statement()\n : null;\n\n return {\n type: \"IfStatement\",\n test,\n consequent,\n alternate,\n };\n }", "title": "" }, { "docid": "f21ad05ea85e4689cbc4a06c942356c5", "score": "0.4935153", "text": "function formatBoolean(value) {\n return (value === true) ? 1 : 0;\n}", "title": "" }, { "docid": "4808f36f0487e69226f781750bd994e3", "score": "0.49288577", "text": "get condition() {\n return this._condition;\n }", "title": "" }, { "docid": "6a260558ef44278a5e207efae4944be5", "score": "0.49286604", "text": "function writeBreakWhenTrue(label, condition, operationLocation) {\n writeStatement(ts.setEmitFlags(ts.createIf(condition, ts.setEmitFlags(ts.setTextRange(ts.createReturn(ts.createArrayLiteral([\n createInstruction(3 /* Break */),\n createLabel(label)\n ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */));\n }", "title": "" }, { "docid": "e24068ed8d0e193a489f31a56536ad41", "score": "0.4923055", "text": "enterConditionalOrExpression(ctx) {\n\t}", "title": "" }, { "docid": "d69765f29570567d0cf64d7ad7fc9b98", "score": "0.49228588", "text": "function myTrueOrFalse(isItTrue){\n if (isItTrue){\n return \"Yes, it's true\";\n }\n return \"No, it's false\";\n}", "title": "" }, { "docid": "6fc308c0086578375fbd162a4f6b9e47", "score": "0.49197438", "text": "function getConditional(conditional, successScrollNodeIndex, failScrollNodeIndex) {\n var test = (isNaN(conditional)) ? `(${conditional}Troll)`: `(gemsCollected == ${conditional})`;\n\n var command = `if ${test} goto(${successScrollNodeIndex}); else goto(${failScrollNodeIndex})`;\n var tokenIcon = `images/if_${conditional}.png`;\n var className = `if_${conditional}`;\n return {command: command, tokenType: CONDITIONAL, tokenIcon: tokenIcon, className: className};\n}", "title": "" }, { "docid": "e27f6f7e7ffb68e5cc3bc29e6fcf0df3", "score": "0.4918781", "text": "function console_log_boolean(){\n console.log(1>3)\n document.getElementById(\"console_log_boolean\").innerHTML =\"Show the console with F12\";\n}", "title": "" }, { "docid": "efe3b6b77e9fd9a913516ad5db7d081c", "score": "0.4915835", "text": "function trueOrFalse(itIsTrue) {\n if (itIsTrue) {\n return \"Yes, is it True\"\n }\n return \"No, it is False\"\n}", "title": "" }, { "docid": "264d035fc94c4a0ada12ae5b6b635fe9", "score": "0.49104366", "text": "satisfiesCondition(condition) {\r\n return !condition || (!condition.isDisabled() && condition.matches(this.target));\r\n }", "title": "" }, { "docid": "85f68eac1fafe6c8ecfe4e37507fd085", "score": "0.49065337", "text": "function conditionResult(condition, nameCondition) {\n return condition === false\n ? false\n : { condition: nameCondition, result: condition };\n}", "title": "" }, { "docid": "a8f08af43d02b7144093eabbed2036df", "score": "0.49054632", "text": "function getConditional(){\n var ifString = \"\";\n // stack will be used to ensure the parentheses in the conditional statement are balanced\n var stack = new Array();\n // push a 'null' value to represent the bottom of the stack\n stack.push(\"null\");\n\n // pulls out each li element in the queryList\n jQuery.each($(\"#queryList li\"), function(index, item){\n ifString += $(item).text();\n ifString += \" \";\n\n // if the li is a opening bracket it gets pushed to the stack\n if($(item).text() == \"(\")\n {\n stack.push(\"(\");\n }\n else if($(item).text() == \")\")\n {\n // otherwise the top value from the stack is popped, if the popped value is the null at the bottom then it indicates there\n // has been more closing brackets than opening brackets which is a syntax error\n if(stack.pop() == \"null\")\n {\n parensBalanced = false;\n }\n }\n });\n\n // if the stack is at anything other than null then there haven't been enough closing brackets to balance the opening brackets\n if(stack.pop() != \"null\")\n {\n parensBalanced = false;\n }\n return ifString;\n}", "title": "" }, { "docid": "3d7e14ee173d7c6255aaed030b642005", "score": "0.49050766", "text": "function IIF(condition, trueVal, falseVal) {\r\n if (condition) {\r\n return trueVal;\r\n } else {\r\n return falseVal;\r\n }\r\n}", "title": "" }, { "docid": "a5c1910027b26e0284c180ce107fd930", "score": "0.48886853", "text": "function not_example(){\n document.getElementById(\"not_example\").innerHTML = !(2>3) +\" - \"+!(3>2);\n}", "title": "" }, { "docid": "ae1dd3f208822c29084d204d3aac6468", "score": "0.48877302", "text": "function compareFn(args, wantsTruthy) {\n var begin = '(';\n loop(args, function (each, index) {\n if (index !== 0) {\n begin += '&& ';\n }\n begin += (wantsTruthy ? each.compile() : '!' + each.compile());\n });\n begin += ')';\n return begin;\n}", "title": "" }, { "docid": "645d8febb0cde1514187170ae8904cdd", "score": "0.48759678", "text": "function If() {\n \t\t\tdebugMsg(\"ProgramParser : If\");\n \t\t\t\n \t\t\tlexer.next();\n \t\t\tcheck(\"(\");\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\n \t\t\tcheck(\")\");\n \t\t\t\n \t\t\tvar code=CodeBlock();\n \t\t\t\n \t\t\tvar elseCode;\n \t\t\tif (test(\"else\")) {\n \t\t\t\tlexer.next();\n \t\t\t\telseCode=CodeBlock();\n \t\t\t}\n \t\t\treturn new ASTUnaryNode(\"if\",{\"cond\":expr,\"code\":code,\"elseBlock\":elseCode});\n \t\t}", "title": "" }, { "docid": "1caa31755ba0ec90d956990b62ed32aa", "score": "0.48724478", "text": "getCondition() { return 'Content not found' }", "title": "" }, { "docid": "67749516360f295e9b3e2cdaccbde87f", "score": "0.4866047", "text": "get_condValue()\n {\n return this.liveFunc._condValue;\n }", "title": "" }, { "docid": "64a1cac9563fe1f855265db3caf769dd", "score": "0.4864586", "text": "function Conditional(props) {\r\n // if....else Statement\r\n if(props.isLoading)\r\n {\r\n return(\r\n <h1>\r\n Loading.......\r\n </h1>\r\n )\r\n } \r\n else\r\n {\r\n return(\r\n <h2>\r\n Some thing to display\r\n </h2>\r\n )\r\n }\r\n\r\n {/* Ternary Operator */}\r\n\r\n {props.isLoading ? <h1> Hello</h1> : <h3> Hey</h3>}\r\n\r\n}", "title": "" }, { "docid": "790e95caa435b6e9ae7a8031659d2c79", "score": "0.48623186", "text": "function evaluateTruthy() {\n var res = this.evaluate();\n if (res.confident) return !!res.value;\n}", "title": "" }, { "docid": "51fade6fc81b118940916d9374eaa018", "score": "0.4862172", "text": "function orT_Function() {\n document.write(5>2 || 10>4);\n}", "title": "" }, { "docid": "e9ff0119c3968ef8a690e3f990261470", "score": "0.48609337", "text": "elseIf(condition) {\n return this._elseNode(new If(condition))\n }", "title": "" }, { "docid": "80b782e623e7775126db324adf4691d8", "score": "0.48443234", "text": "function createConditional(antecedentLine, consequentLine){\n antecedentChars = getCharacters(antecedentLine);\n consequentChars = getCharacters(consequentLine);\n tokens.length = 0;\n getTokens(antecedentChars);\n antecedentTokens = tokens;\n tokens.length = 0;\n getTokens(consequentChars);\n consequentTokens = tokens;\n tokens.length = 0;\n if (antecedentTokens.includes(\"cond\") || antecedentTokens.includes(\"bicond\")){\n antecedentLine = \"(\" + antecedentLine + \")\";\n }\n if (consequentTokens.includes(\"cond\") || consequentTokens.includes(\"bicond\")){\n antecedentLine = \"(\" + antecedentLine + \")\";\n }\n var conditional = antecedentLine + \" => \" + consequentLine;\n return conditional;\n}", "title": "" }, { "docid": "d9b8fc88174b1efd649e1d1d270a171f", "score": "0.48416337", "text": "function trueFunctionII() {\r\n let text = \"\";\r\n for(var i = 1; i <= 15; i++) {\r\n if(i % 3 == 0 || i % 5 == 0) {\r\n text += i + \", \";\r\n }\r\n }\r\n return \"Function that executes when \" +\r\n \"1 of 2 statements is true : \" + text;\r\n}", "title": "" }, { "docid": "5c07464bfde237782a3deb252d2df71f", "score": "0.4837303", "text": "function questionHtml(answerStatus) {\n let html = '';\n \n if (answerStatus === 'correct') {\n html = `\n <div>\n <section>\n <h2>That is correct!</h2>\n </section>\n <section>\n <div class=\"group\">\n <div class=\"item\">${store.questions[store.questionNumber].image}</div>\n <div class=\"item\">${store.questions[store.questionNumber].caption}</div>\n </div>\n </section>\n </div>\n `;\n }\n else {\n html = `\n <div>\n <section>\n <h2>That is not correct.</h2>\n <p>The correct answer is ${store.questions[store.questionNumber].correctAnswer}.</p>\n </section>\n <section>\n <div class=\"group\">\n <div class=\"item\">${store.questions[store.questionNumber].image}</div>\n <div class=\"item\">${store.questions[store.questionNumber].caption}</div>\n </div> \n </section>\n </div>\n `\n }\n return html;\n }", "title": "" }, { "docid": "d53e34cd89ed37d38e7d92cb9299e990", "score": "0.48328692", "text": "function FocusFlagTemplate(focusFlag) {\n let result = '';\n if (focusFlag) {\n result = '<ff>false</ff>';\n }\n else {\n result = '<ff>false</ff>';\n }\n return result;\n}", "title": "" }, { "docid": "30bbffdfebdf049300675792c4a23f7d", "score": "0.48326328", "text": "get condition () {\n\t\treturn this._condition;\n\t}", "title": "" }, { "docid": "ef39e233e34b431b4f9d2bbebd8da275", "score": "0.48320737", "text": "function evaluateTruthy() {\n\t var res = this.evaluate();\n\t if (res.confident) return !!res.value;\n\t}", "title": "" }, { "docid": "728f1f4c1820c65fdd819db38bd821a2", "score": "0.48292154", "text": "function resultsTemplate(question){\nvar htmlBlock = ('<div>')\nhtmlBlock = htmlBlock + question.question + ': ' + isChecked;\nreturn htmlBlock + \"</div>\";\n}", "title": "" }, { "docid": "c00a84f1321e8cb1e900bad8bababcee", "score": "0.48097512", "text": "showWhen() {\n return true;\n }", "title": "" }, { "docid": "566dcb720f6a09fdc848168c09f02fc8", "score": "0.48089373", "text": "function TF_Function() {\n console.log(4>8);\n}", "title": "" } ]
7145a8eca4d37dfd189bfcfd8351fa21
Load the next page of topics
[ { "docid": "1bd58c161e3d49d2669dbe942326900b", "score": "0.618214", "text": "function loadMoreTopics() {\n // Remove the event listener and create the loading... row.\n document.removeEventListener('scroll', topicListScrollCheck, true);\n $('.grid')\n .append('<tr><td colspan=\"4\" id=\"gy_loading_row\" style=\"text-align: center; padding: 5px 0; font-size: 11px;\">Loading next page... <img src=\"'\n + load_gif + '\" /></td></tr>');\n // AJAX request for the next page. Add each row to the table and reprocess the page. Bring back the event listener\n // at the end and identify the next page.\n $.get(next_page, function (data) {\n var newPage = document.createElement('div');\n newPage.innerHTML = data;\n var newRows = newPage.getElementsByTagName('tr');\n while (newRows.length > 0) {\n $('.grid').append(newRows[0]);\n }\n $('#gy_loading_row').remove();\n processTopicList();\n var next_page_link = $(newPage)\n .find('div.infobar a:contains(\"Next Page\")');\n if (next_page_link.length == 1) {\n next_page = next_page_link.attr('href');\n document.addEventListener('scroll', topicListScrollCheck, true);\n }\n applyStyling();\n });\n}", "title": "" } ]
[ { "docid": "b192c94bc4c5815c178a55184433e50b", "score": "0.7079083", "text": "function nextPageLoad() {\n nextPage.onclick = function() {\n currentPage++;\n this.href=\"?page=\" + currentPage + \"#feed\";\n };\n }", "title": "" }, { "docid": "c62bbcf862dc552b980254793267e86f", "score": "0.705125", "text": "nextPage() {\n if (this.loadedAll || !this.loadNextPage) {\n return;\n }\n\n this.busy = true;\n\n this.loadNextPage(this.currentPage).then(res => {\n if (res.total == 0) {\n this.noPosts = true;\n }\n\n if (res.page == res.pages) {\n this.loadedAll = true;\n }\n\n this.posts = this.posts.concat(res.docs);\n this.currentPage = res.page;\n\n this.onLoad({res});\n })\n .finally(() => this.busy = false);\n }", "title": "" }, { "docid": "687149ed28802b69026b7c952cc7db8c", "score": "0.7040681", "text": "function next(){\n setPage(getNextPage());\n }", "title": "" }, { "docid": "4c901a343376b2f32fca2d52ae69a10c", "score": "0.69920075", "text": "function loadNextPage(){\n\t\t$scope.bestiaryCreaturePager.loadNextPage(loadNextPage);\n\t}", "title": "" }, { "docid": "bc3e76ba3b28876f85d818fbb04a1257", "score": "0.68922275", "text": "function load_next_page(){\n\n\t\tif(loading) return;\n\n\t\tloading = true;\n\n\t\t//Increment the page number to be requested\n\t\tcurrent_page++\n\t\tconsole.log(\"Requesting page: \", current_page)\n\n\t\t//Put the UI into the loading state\n\t\t$(\"#more-button\").hide()\n\t\t$(\"#loading-text\").removeClass(\"hidden\")\n\n\t\t//Ajax request to the same page, but updating the page number\n\t\t$.ajax(\"\", {\n\t\t \tdata: {\n\t\t\t\t//Anything in data ends up in the URL for GET requests\n\t\t\t\tpage: current_page\n\t\t\t},\n\t\t\tsuccess: function(response){\n\n\t\t\t\t//Display the new stories\n\t\t\t\t$(\".stories\").append(response);\n\n\t\t\t\t//Update timestamps\n\t\t\t\tupdate_timestamps();\n\n\t\t\t\t//Remove the loading state from the UI\n\t\t\t\t$(\"#more-button\").show()\n\t\t\t\t$(\"#loading-text\").addClass(\"hidden\")\n\n\t\t\t\tloading = false;\n\n\t\t\t}\n\t\t})\n\n\t\t//Prevent the default action\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "362367e43e8f06cf24951677f0639100", "score": "0.68792534", "text": "function _nextArticle() {\n var nextArticle = App.Data.getNextArticle(params.item.title, params.feedName).then(function (nextArticle) {\n\n if (nextArticle) {\n _refreshPageWithNewArticle(nextArticle);\n }\n else {\n // App.Data.showMessage(\"This is the last article\");\n App.Data.getNextArticle(params.item.title, params.feedName).then(function (nextArticle) {\n if (nextArticle) {\n if (currentPge) {\n currentPge._removeEventListeners();\n }\n _refreshPageWithNewArticle(nextArticle);\n }\n else {\n App.Data.showTipMessage(\"Message\", \"This is the last article\");\n }\n });\n }\n });\n }", "title": "" }, { "docid": "5cf36fe0d9fec9539c0fc2c749b05aca", "score": "0.6876069", "text": "function getNextPage(nextPgTkn){\n $('nav').on('click', '#next', event => {\n getVidSearchFromYtAPI(nextPgToken, currentKeyword,displayYoutubeSearchData);\n });\n}", "title": "" }, { "docid": "6e124522c43f15075f4bff1d44f907de", "score": "0.6827791", "text": "function loadNextPage() {\n\n // Prevent double-clicks\n $button.off('click', loadNextPage);\n\n if(htmlToInsert) {\n\n var $toInsert = $(htmlToInsert);\n $toInsert.hide();\n $insert.children().last().after($toInsert);\n $toInsert.fadeIn(300);\n\n }\n\n var mode = $.url().param('mode');\n if(!mode || mode.trim().length == 0) {\n mode = 'GRID';\n }\n\n var data = {\n 'page': page,\n 'limit': limit,\n 'term': $.url().param('searchinput'),\n 'tagid': $.url().param('tagid'),\n 'mode': mode\n };\n\n var url = location.pathname.replace('.html', '/_jcr_content.searchfragment.json');\n\n $.get(url, data, addResults, 'html');\n }", "title": "" }, { "docid": "9ab448bd9e73701fa2e5213c302ca13a", "score": "0.6820388", "text": "turnToNextPage() {\n this.pages.showNext();\n }", "title": "" }, { "docid": "20a632399afaa58f574b1ab1abc15998", "score": "0.67463017", "text": "static loadNextPage() {\n let varName = DataService.displayedData;\n let newPage = DataService.data[varName].page + 1;\n if (newPage <= DataService.data[varName].totalPages) {\n let tmpData = [];\n ApiService.rReadTableGET(varName, newPage).then((response) => {\n response.json().then((body) => {\n //get response data into tmpData\n for (let i = 0; i < body.results.length; i++) {\n tmpData.push(Object.values(body.results[i]));\n }\n //update DataService.data\n DataService.data[varName].page = newPage;\n TableController.addDataInTable(tmpData);\n //display DataService.data\n });\n });\n }\n }", "title": "" }, { "docid": "ab98812ca59860f8fc57da5075c51896", "score": "0.67231613", "text": "async function loadNextPage () {\n info(\"loading next page\");\n const nextPage = state.currentPage + 1;\n const target = `/giveaways/ajax/${nextPage}/expiry/asc/level/${my.level === 0 ? \"0\" : \"all\"}`;\n const response = await request(target);\n const json = await response.json();\n if (json.status === \"ok\") {\n state.currentPage = json.current_page;\n state.currentDocument = new DOMParser().parseFromString(json.html, \"text/html\");\n }\n }", "title": "" }, { "docid": "80082e2ae235aea7241f4b60d235a041", "score": "0.66246426", "text": "function loadNextPage_votazione() {\n\t\t\t\tloadPage_votazione(per_page, ++page);\n\t\t\t}", "title": "" }, { "docid": "ce10925394b8a19e90e93ea863435f8d", "score": "0.65068525", "text": "next() { this.goto(this.page + 1); }", "title": "" }, { "docid": "8264c441e6fd3fc8d104d951d8b97c2d", "score": "0.6500537", "text": "_showNextPage() {\n\t\tthis._modifyTimestampBy(this._getPageSize());\n\t}", "title": "" }, { "docid": "37b1dc0b222fd1bd5698bf5d04f8af2c", "score": "0.6480804", "text": "function handleLoadMore() {\n props.setPage(1);\n }", "title": "" }, { "docid": "04c89c43dfa393fc3586ede722607f97", "score": "0.64691114", "text": "function getNextPage() {\n\tvar url = \"https://www.googleapis.com/youtube/v3/search\";\n\tvar searchItem = $(\"#title\").val();\n\tvar query = {\n\t\tpart: \"snippet\",\n\t\tq: searchItem,\n\t\tmaxResults: 10,\n\t\tpageToken: nextPageId,\n\t\tkey: \"AIzaSyALEV-N3oFSjwtD-75FR2VtSVmgjeYW28U\"\n\t}\n\t$.getJSON(url, query, callback);\n}", "title": "" }, { "docid": "1658f35860124193623ff1750d2726de", "score": "0.6463545", "text": "function loadMore() {\n let nextPage = page + 1;\n setPage(nextPage);\n getMovies(nextPage, year);\n }", "title": "" }, { "docid": "25317726f5088e904cd7024ae2a0bd58", "score": "0.6430502", "text": "function loadNext() {\r\n if (!loading) {\r\n loading = true;\r\n var link = document.querySelector(\".pagination > strong + a\");\r\n if (link) {\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: link.href,\r\n onload: loadSuccessCallback,\r\n onerror: loadErrorCallback\r\n });\r\n }\r\n\r\n // Reached the last page. Hide the loader.\r\n else {\r\n loader.style.display = 'none';\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6f4b2deb5f10cdc3a015c54a2ab6b049", "score": "0.6416749", "text": "nextPage() {\n if(this.state.page.length) {\n this.getYoutubeResults(\n this.state.page[0].query,\n this.state.page[0].type,\n this.state.page[0].token\n );\n }\n }", "title": "" }, { "docid": "9397dfff118328412880f94f199785d6", "score": "0.6400665", "text": "function loadMoreItems( $nextUrl ){\r\n \r\n if( typeof( $nextUrl ) === 'undefined' )\r\n return false;\r\n \r\n // update our switch to prevent spamming for every scroll event\r\n loadingMoreItems = true;\r\n\r\n // go get our 'next' URL\r\n SpotifyService.getUrl( $nextUrl )\r\n .then(function( response ){\r\n\t\t\t\r\n // append these new items\r\n $scope.artists.items = $scope.artists.items.concat( response.artists.items );\r\n \r\n // save the next set's url (if it exists)\r\n $scope.artists.next = response.artists.next;\r\n \r\n // update loader and re-open for further pagination objects\r\n loadingMoreItems = false;\r\n });\r\n }", "title": "" }, { "docid": "38cce4a7b0585aba8afac875a75eab40", "score": "0.63657653", "text": "function nextPage() {\n // calculate new offset\n offset = offset + pageSize();\n $.bbq.pushState({offset:offset});\n displayPage();\n}", "title": "" }, { "docid": "1c3ac4b3e57fd36569b3d03813769507", "score": "0.6362983", "text": "getNextPage() {\n this.getPage(++this.page);\n }", "title": "" }, { "docid": "13245e70e2a77917fefbbc4d37f95a61", "score": "0.635715", "text": "function loadMorePlaylists( $nextUrl ){\r\n \r\n if( typeof( $nextUrl ) === 'undefined' )\r\n return false;\r\n \r\n // update our switch to prevent spamming for every scroll event\r\n loadingMorePlaylists = true;\r\n\r\n // go get our 'next' URL\r\n SpotifyService.getUrl( $nextUrl )\r\n .then(function( response ){\r\n \r\n // append these new tracks to the main tracklist\r\n $scope.playlists.items = $scope.playlists.items.concat( response.items );\r\n \r\n // save the next set's url (if it exists)\r\n $scope.playlists.next = response.next;\r\n \r\n // update loader and re-open for further pagination objects\r\n loadingMorePlaylists = false;\r\n });\r\n }", "title": "" }, { "docid": "37f42d669b376f8b3da1c67af8b1b61b", "score": "0.6349244", "text": "function nextPage() {\n\n var tempPage = _movies.getCurrentPage;\n var tempNumPages = _movies.getNumPages;\n\n if (tempPage < tempNumPages) {\n _movies.setCurrentPage(tempPage + 1);\n getPage();\n }\n}", "title": "" }, { "docid": "2a84af699edb7040c0e173ccda82473e", "score": "0.63374704", "text": "function load_next_post(){\n\tvar el = jQuery(this);\n\tvar this_url = el.attr('data-url');\n\tvar this_title = el.attr('data-title');\n\tvar check_next_post_id = el.attr('data-nextid');\n\n\tif ( !check_next_post_id ) return;\n\tif ( jQuery( \"article#post-\"+check_next_post_id ).length == 0) {\n\t doAutoLoad();\n\t}\n\telse{\n\t\tconsole.log('already loaded');\n\t}\n}", "title": "" }, { "docid": "7e6c5c59ac8789cf63463594bf92cf45", "score": "0.6334327", "text": "function showNext(){\r\n\tif (CUR_PAGE == MAX_PAGES) {\r\n\t\tCUR_PAGE = 0;\r\n\t} else {\r\n\t\tCUR_PAGE += 1;\r\n\t}\r\n}", "title": "" }, { "docid": "fd77d1acb2b489ecae579250b42fb6be", "score": "0.6326719", "text": "function loadNext() {\r\n const nextKey = currentOption.next;\r\n window.location.hash = \"/\" + nextKey;\r\n}", "title": "" }, { "docid": "fb9d41909c708b6d6f8efe977c36ada0", "score": "0.63254565", "text": "async nextPage() {\n this.start = Math.min(this.getLastStart(), this.start + this.num);\n }", "title": "" }, { "docid": "ea92a20350883996f932bda9c281dbee", "score": "0.630663", "text": "doIt() {\n if (this.next) {\n this.next.doIt();\n }\n\n if (this.nextSubPage) {\n chrome.runtime.sendMessage({\n type: 'page.next',\n //- Get uri -//\n uri: location.href.toString().split(window.location.host)[1]\n });\n }\n }", "title": "" }, { "docid": "37ba709fe867d1c86deb4259330f0ab0", "score": "0.62947613", "text": "function loadNextPage(event)\n {\n event.preventDefault();\n \n currentPage++;\n \n var newurl = window.location.protocol + \"//\" + window.location.host + window.location.pathname + '?page=' + currentPage;\n window.history.pushState({path:newurl},'',newurl);\n \n loadCurrentPage();\n }", "title": "" }, { "docid": "ea6d1d8f266999c36ab71cde9e6a75dd", "score": "0.6289639", "text": "function next(searchInput = undefined){\n if(currrntPage() == lastPageClosure()){\n return;\n }\n\n if(currrntPage() == lastPageClosure() - 1){\n getById('next').disabled = true;\n }\n\n if(currrntPage() == 1){\n getById('previous').disabled = false;\n }\n\n var isFromMyarticle = window.location.hash.toLocaleLowerCase().includes('myarticles');\n\n if(isFromMyarticle){\n getAllArticles(localStorage.getItem('userID'), searchInput, pageNumber = currrntPage(+1));\n }else{\n getAllArticles(undefined, searchInput, pageNumber = currrntPage(+1));\n }\n}", "title": "" }, { "docid": "9dec987aac42cc6acb321267b4471fd8", "score": "0.6272401", "text": "static async getNextPage (e){\n if (this.nextPageAvailable && this.isLoading === false) {\n let url = `https://www.omdbapi.com/?apikey=19bc8d19&s=${this.query.text}&y=${this.query.year}&type=${this.query.type}&page=${this.query.nextPage}`\n this.query.nextPage++\n let data = await this.queryAPI(url)\n \n return data\n }\n }", "title": "" }, { "docid": "66934da6c531ce75b028dc3f7770104c", "score": "0.62611043", "text": "function setNextUrl() {\n\t $button = $element.find('.load-more');\n\t\n\t if (angular.isDefined($button)) {\n\t url = $button.data('url');\n\t }\n\t }", "title": "" }, { "docid": "daba24bb1764dcae823e045310f331df", "score": "0.62477297", "text": "function onSlideChange() {\n direction = $(this).attr(\"data-page\")\n direction == 'next' ? ++CURRENT_PAGE : --CURRENT_PAGE\n if (recommendedArticles.length < MAX_ITEMS || CURRENT_PAGE <= 1) {\n CURRENT_PAGE <= 1 ? CURRENT_PAGE = 1 : CURRENT_PAGE--\n }\n recommendedArticles.fetch({\n data: getUserReadingData(),\n processData: true,\n success: render_to_template\n })\n console.log(CURRENT_PAGE)\n }", "title": "" }, { "docid": "1b905a5dc1b2b5d51b96940df45d2296", "score": "0.6241612", "text": "function getNextPage() {\n setPageNumber(getPageNumber() + 1);\n searchFlickr(false);\n}", "title": "" }, { "docid": "84a63b9cbc731b30ae283dd57a042e9c", "score": "0.62259823", "text": "function next()\n {\n if (page === menus.length-1){\n page = 0;\n }\n else {\n page = page + 1; \n }\n display();\n }", "title": "" }, { "docid": "29f0454984960dcc9ef47264a95e9066", "score": "0.6217161", "text": "function add_next_page(){\n\tduring_pagination = true;\n\tif(!location.href.match(/\\/public_timeline$/)){\n\t\tvar more_url = '';\n\t\tif(document.getElementById(\"more\"))\n\t\t{\n\t\t\tmore_url = document.getElementById(\"more\").href;\n\t\t\tinsert_update(more_url);\n\t\t}\n\t\telse if(document.getElementById(\"search_more\"))\n\t\t{\n\t\t\tvar more_url = document.getElementById(\"search_more\").href;\n\t\t\tvar more_click = document.createEvent('MouseEvents');\n\t\t\tmore_click.initEvent( 'click', true, true );\n\t\t\tdocument.getElementById(\"search_more\").dispatchEvent( more_click );\n\t\t}\n\t\twindow.removeEventListener(\"scroll\", function(){add_scroll_event()}, false);\n\t\tduring_pagination = false;\n\t}\n}", "title": "" }, { "docid": "0792127f31f263155bb35245741fa7af", "score": "0.6212867", "text": "async function loadTopics() {\n // adds button functions to global scope (since this is type module)\n window.loadQuiz = loadQuiz;\n window.loadLesson = loadLesson;\n window.getQuote = getQuote;\n\n // sends request to server to retrieve directory.json\n let url = '/loadDir';\n let response = await fetch(url);\n let directory = await response.json();\n let topics = directory.topics;\n\n // gets template from index.html\n const topicSection = document.querySelector(\"#topicSection\");\n\n // special case for 1st topic only - no quiz available\n addSpecialTopicSection(topics[0]);\n // removes 1st topic as topic section created\n topics.shift();\n\n topics.forEach(addTopicSection);\n}", "title": "" }, { "docid": "c029add05b472218a7c03a0b29f90502", "score": "0.62086886", "text": "function nextPage() {\n pageindex++;\n openPage();\n }", "title": "" }, { "docid": "d21b58b6e5de8c379c0f4caf2dc57798", "score": "0.6197774", "text": "function nextPage(){\n parent.window.loadNextPage();\n }", "title": "" }, { "docid": "12f69763850b26416dad367adebfe93e", "score": "0.6195572", "text": "function loadMore() {\n // fetch the next url\n fetch(nextUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n // update the state\n setListCharacters([...listCharacters, ...data.results]);\n // set the next of the page and object desturing to get the properties\n setNextUrl(data.next);\n });\n }", "title": "" }, { "docid": "36c1253c654083823f55b2fbdbf57c5f", "score": "0.6192132", "text": "goNextPage() {\n this.goPage(this.page + 1);\n }", "title": "" }, { "docid": "6d84dce740b53897b8fc49dc6eed9d17", "score": "0.6177628", "text": "function loadNextQuestion(){\n $('.next').on('click',function(event){\n event.preventDefault();\n if(curIndex === STORE.length){\n loadFinalPage();\n return true;\n }\n else{\n createQuestion();\n $('next').hide();\n }\n });\n}", "title": "" }, { "docid": "6f51ce13261db30859a05da912ce066d", "score": "0.61626494", "text": "function goNext(){\n currentlyActiveContentIndex++;\n if(currentlyActiveContentIndex >= contents.length){\n currentlyActiveContentIndex--;\n }else{\n document.getElementById(contents[currentlyActiveContentIndex]).scrollIntoView();\n window.scrollBy(0,scrollBackOffset);\n }\n}", "title": "" }, { "docid": "5b45f228520ed27e131162bace4e13f6", "score": "0.6161363", "text": "showNext() {\n\t\t\tthis.show(this.currentPage + 1);\n\t\t}", "title": "" }, { "docid": "20ab7e20a077a2ca9385c61f6122d616", "score": "0.6156114", "text": "goNextPage() {\n this.params.offset = this.getNextPageOffset();\n if (!this.settings.steps) {\n this.params.page += 1;\n }\n \n return this.fetchData();\n }", "title": "" }, { "docid": "39d8cfdb4ea30a9d17a40932c862ac84", "score": "0.6153496", "text": "function next_page() {\n if (state.has_next) {\n state.page++;\n state.images_loaded = false;\n load_images();\n }\n }", "title": "" }, { "docid": "414733f13c52f7f496b8039f6211c592", "score": "0.6153237", "text": "next() {\n this.loadJobs(\n this.page * this.perPage\n );\n\n this.page += 1;\n\n this.hasNewEntries = false;\n }", "title": "" }, { "docid": "9298c8158553df0795c44be825edac2a", "score": "0.6132395", "text": "function onNextPage() {\n getNextPage();\n gCurrPage = getCurrentPage();\n renderBooks();\n renderPagination();\n}", "title": "" }, { "docid": "b70854788724b345754783294b601888", "score": "0.6129784", "text": "async next_page() {\n // let s = \"//span[substring(@class,string-length(@class) -string-length('__button-next-icon') +1) = '__button-next-icon']\";\n // const [next_page_link] = await this.page.$x(s, {timeout: 2000});\n\n let next_page_link = await this.page.$('[jsaction=\"pane.paginationSection.nextPage\"] span', {timeout: 10000});\n if (!next_page_link) {\n return false;\n }\n await next_page_link.click();\n\n // because google maps loads all location results dynamically, its hard to check when\n // results have been updated\n // as a quick hack, we will wait until the last title of the last search\n // differs from the last result in the dom\n\n let last_title_last_result = this.results[this.keyword][this.page_num-1].results.slice(-1)[0].title;\n\n this.logger.info(`Waiting until new last serp title differs from: \"${last_title_last_result}\"`);\n\n await this.page.waitForFunction((last_title) => {\n const res = document.querySelectorAll('.section-result .section-result-title span');\n return res[res.length-1].innerHTML !== last_title;\n }, {timeout: 7000}, this.results[this.keyword][this.page_num-1].results.slice(-1)[0].title);\n\n return true;\n }", "title": "" }, { "docid": "18e447fde5d66a22424402ac50e64360", "score": "0.612308", "text": "function handleLoadMore() {\n updatePage((prev) => {\n return {\n ...prev,\n current: page?.next,\n };\n });\n }", "title": "" }, { "docid": "e8d2ce235d765beb026d5612f5ba0e7e", "score": "0.6113234", "text": "function next() {\n currentTop = $(document).scrollTop();\n if (currentTop >= ($('#go_map').position().top - $(window).height())) { //when scoll reach the end of the container\n Scroll.remove({\n obj: scroll_id\n });\n if (opt_.urls.length > url_index) {\n opt_.url = opt_.urls[url_index++];\n loadBatch(opt_);\n }\n }\n }", "title": "" }, { "docid": "5b436e9b8fe2ea7dc856ffd9470d8dbe", "score": "0.61106586", "text": "nextPage() {\n if (this.currentPage < this.totalPages) {\n this.currentPage = this.currentPage + 1;\n this.refresh();\n }\n }", "title": "" }, { "docid": "6c3c8e39b8cb4121d7e35d95abf82827", "score": "0.61064327", "text": "function loadNextQuestion() {\n currentQuestionIndex +=1;\n currentQuestion = questionSet[currentQuestionIndex];\n createQuestionForm();\n}", "title": "" }, { "docid": "55c8edad97835b5f0a95a7266b6884f4", "score": "0.6105423", "text": "function loadMoreTracks( $nextUrl ){\r\n \r\n if( typeof( $nextUrl ) === 'undefined' )\r\n return false;\r\n \r\n // update our switch to prevent spamming for every scroll event\r\n loadingMoreTracks = true; \r\n\r\n // go get our 'next' URL\r\n SpotifyService.getUrl( $nextUrl )\r\n .then(function( response ){\r\n \r\n // append these new tracks to the main tracklist\r\n $scope.tracklist.tracks = $scope.tracklist.tracks.concat( response.items );\r\n \r\n // save the next set's url (if it exists)\r\n $scope.tracklist.next = response.next;\r\n \r\n // update loader and re-open for further pagination objects\r\n loadingMoreTracks = false;\r\n });\r\n }", "title": "" }, { "docid": "5607e0cb9e90484901e17a50fbbb2ffa", "score": "0.6102701", "text": "getNextPage(currentPage) {\n let section = currentPage.section;\n let nextPage = section.add();\n return nextPage;\n }", "title": "" }, { "docid": "cd31a70355d8e0c05566fbad3f618ec5", "score": "0.610269", "text": "function displayTopicsCurrentPage(page) {\n if (!isActiveTabRefr) {\n return;\n }\n\n var topicsArray = [];\n // Obtention de la liste des topics\n if (page == null) {\n topicsArray = getTopics(document, false);\n }\n else {\n // met à jour compteur de connecté quand on affiche une liste rafraichir\n updateNbCo(page);\n topicsArray = getTopics(page, false);\n }\n // on sépare les topics épinglés des topics normaux\n var epingles = topicsArray[0];\n var topicsCurrentPage = topicsArray[1];\n\n // si l'onglet tri et affiche seulement la liste des tendances\n // ou que\n // la liste n'est pas bloquée et que l'onglet courant est trié\n // Trier la liste à afficher par poids en tendance\n if (((areTrendDsp && areTrendSort) && areTopicsSort) ||\n (areTopicsSort && isActiveTabSort)) {\n sortByWeight(topicsCurrentPage);\n }\n\n // Applique la couleur sur les topics\n setCssTopics(topicsCurrentPage);\n\n var ul = document.createElement('ul');\n\n ul.classList.add('topic-list', 'topic-list-admin');\n\n ul.appendChild(topicHead);\n\n // copie les épingles en premier dans la liste qui va être affichée\n var lengthPinned = epingles.length;\n for (var x = 0; x < lengthPinned; x++) {\n jvCake(epingles[x][1].getElementsByClassName('topic-date')[0].getElementsByTagName('span')[0]);\n ul.appendChild(epingles[x][1]);\n }\n // puis copie les topics\n var lengthNotPinned = pageLen - lengthPinned;\n for (var x = 0; x < lengthNotPinned; x++) {\n jvCake(topicsCurrentPage[x][1].getElementsByClassName('topic-date')[0].getElementsByTagName('span')[0]);\n ul.appendChild(topicsCurrentPage[x][1]);\n }\n\n var fragmentUL = document.createDocumentFragment();\n fragmentUL.appendChild(ul.cloneNode(true));\n\n var element = document.getElementsByClassName('topic-list topic-list-admin')[0];\n // Affiche\n element.parentNode.replaceChild(fragmentUL, element);\n\n // Met en place le blocage du rafraichissement des topics lorsque le curseur est sur la nouvelle liste affichée\n var conteneur = document.getElementsByClassName('conteneur-topic-pagi')[0];\n conteneur.addEventListener(\"mouseenter\", function(e) { states.setIsHoverCursor(true); }, false);\n conteneur.addEventListener(\"mouseleave\", function(e) { states.setIsHoverCursor(false); }, false);\n}", "title": "" }, { "docid": "ed50c56fe94121ef7d015591023ca6d5", "score": "0.60975", "text": "function loadMoreTracks( $nextUrl ){\r\n \r\n if( typeof( $nextUrl ) === 'undefined' )\r\n return false;\r\n \r\n // update our switch to prevent spamming for every scroll event\r\n loadingMoreTracks = true;\r\n\r\n // go get our 'next' URL\r\n SpotifyService.getUrl( $nextUrl )\r\n .then(function( response ){\r\n \r\n // append these new tracks to the main tracklist\r\n $scope.tracklist.tracks = $scope.tracklist.tracks.concat( reformatTracks( response.items ) );\r\n \r\n // save the next set's url (if it exists)\r\n $scope.tracklist.next = response.next;\r\n \r\n // update loader and re-open for further pagination objects\r\n loadingMoreTracks = false;\r\n });\r\n }", "title": "" }, { "docid": "e4f717dd9ee413e0debdf214cde252bd", "score": "0.609549", "text": "function _load() {\n var $inner = $e.find('div.jscroll-inner').first(),\n data = $e.data('jscroll');\n\n data.waiting = true;\n $inner.append('<div class=\"jscroll-added\" />')\n .children('.jscroll-added').last()\n .html('<div class=\"jscroll-loading\">' + _options.loadingHtml + '</div>');\n\n return _checkNextHref(data) && $e.animate({scrollTop: $inner.outerHeight()}, 0, function() {\n $inner.find('div.jscroll-added').last().load(data.nextHref, function(r, status, xhr) {\n var $next = $(this).find(_options.nextSelector).first();\n data.waiting = false;\n data.nextHref = _options.contentSelector ? $next.attr('href') + ' ' + _options.contentSelector : $next.attr('href');\n $('.jscroll-next-parent', $e).remove(); // Remove the previous next link now that we have a new one\n if (_options.autoTrigger) {\n _nextWrap($next);\n } else {\n $next.bind('click.jscroll', function() {\n _nextWrap($next);\n _observe();\n return false;\n });\n }\n if (_options.callback) {\n _options.callback.call(this);\n }\n _debug('dir', data);\n });\n });\n }", "title": "" }, { "docid": "21ccd3cf8058752e7081592e8338843d", "score": "0.60950667", "text": "function _next() {\n _redirect({\n before: null,\n after: $scope.after,\n count: (_state.before ? _state.count - 1 : _state.count + conf.reddit.perPage)\n });\n }", "title": "" }, { "docid": "7e26fe0a18081164df96265acbc18e56", "score": "0.6087871", "text": "function nextPage() {\n page = page + 1;\n\n elFilmsList.innerHTML = \"\";\n elLoader.style.display = \"block\";\n const inputValue = elSearchInput.value.trim()\n getData(page, inputValue);\n}", "title": "" }, { "docid": "627e0df2ee0813a5b86a905b1d753a92", "score": "0.60854036", "text": "function olderTopics(){\n async function getTopics(){\n const res = await axios.get(`https://naij-react-backend.herokuapp.com/api/topics?offset=${offset}`);\n console.log(res.data)\n if(res.data.success){\n setLoading(false)\n }\n setTopics((prevTopics)=>{\n return [...prevTopics, ...res.data.details]\n })\n \n setPrevBtnDisabled(false)\n }\n getTopics();\n setOffset(offset + 15)\n }", "title": "" }, { "docid": "e82cc61f05819835ca4bdb5eb4c9b585", "score": "0.60791236", "text": "function displayTopicsQueryMore() {\r\n offsetMore += 10;\r\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=\" + currentSelection + \"&limit=10&offset=\" + offsetMore + \"&api_key=k18J8WsAogUXHfMrNROAFGP7ZnL3OL5x\";\r\n displayTopicsGif(queryURL);\r\n }", "title": "" }, { "docid": "5ec4be52ea64822fa01790a71ea7a3d3", "score": "0.60697854", "text": "loadNext() {\n if (this[makingQueryValue] || this[noMoreItemsValue] || this[queryingProperty]) {\n return;\n }\n this[makingQueryValue] = true;\n this[queryTimeoutValue] = setTimeout(() => {\n this[queryTimeoutValue] = undefined;\n this[makingQueryValue] = false;\n this[loadPage]();\n });\n }", "title": "" }, { "docid": "0acf462504337dc614e86f22be697987", "score": "0.6068783", "text": "getNextPage() {\n let section = this.currentPage.section;\n let nextPage = null;\n let index = section.indexOf(this.currentPage);\n if (index === section.count - 1) {\n nextPage = section.add();\n }\n else {\n nextPage = section.getPages()[index + 1];\n }\n return nextPage;\n }", "title": "" }, { "docid": "0c30ce545bd987b5f2e930d4cf0c8c71", "score": "0.60396427", "text": "loadMore() {\n this.loading = true;\n\n this.loadResults(this.discussions.length)\n .then(this.parseResults.bind(this));\n }", "title": "" }, { "docid": "1acb8be42542ad722db5210badd77513", "score": "0.6033285", "text": "nextPage() {\n this.service.nextPage()\n }", "title": "" }, { "docid": "3eab899fe17e57680c42f12cde3724d7", "score": "0.60303473", "text": "function nextPage() {\n\t\t// show the next page\n\t\tvar next_page = page_index[page_counter];\t\n\t\t$(next_page).css(\"display\", \"block\");\n\t\tconsole.log(\"current Section: \" + next_page);\n\n\t\t// hide all other pages\n\t\tfor (let i = 0; i < index_length; i++) {\n\t\t\tif (page_index[i] == page_index[page_counter]) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$(page_index[i]).css(\"display\", \"none\");\n\t\t\t}\n\t\t}\n\n\t\t// increment the page counter\n\t\tpage_counter += 1;\n\t}", "title": "" }, { "docid": "e7d29157f538bdc73ddd57cee8a1864b", "score": "0.602407", "text": "function nextPage(){\n\tif(numPage<pageNumber){\n\t\tnumPage++;\n\t\tshowPage();\n\t}\n\tcheckNumPage();\n}", "title": "" }, { "docid": "9197eaa6523c26d06220dab99af98d04", "score": "0.60077095", "text": "function loadMore() {\n // fetch the next url\n fetch(nextUrl)\n .then(function (response) {\n return response.json()\n }).then(function (data) {\n // update the state\n setListCharacters([\n ...listCharacters, // old state\n ...data.results\n ])\n // set the next to the next page\n setNextUrl(data.next)\n setPrevUrl(data.previous)\n })\n }", "title": "" }, { "docid": "afd0f7142db06092076a9439db6ed881", "score": "0.60044223", "text": "async nextPage() {\n this.dispatch('ui/startLoading');\n this.dispatch('pagination/nextPage');\n this.dispatch('setLastSearchValue');\n await this.dispatch('items/getItems', this.get());\n this.dispatch('pagination/updateItemCounts', this.get());\n this.dispatch('history/pushState', this.get());\n this.dispatch('ui/stopLoading', this.get());\n }", "title": "" }, { "docid": "467a1be21964108c16127c689bd16dfa", "score": "0.5991433", "text": "function nextPage(tabla, uid, condicion){\n \tvar currentPage = 0;\n \tcurrentPage = document.getElementById(\"currentPage\").value;\n\tAjaxSendRequestPage(currentPage, \"next\", uid, tabla, condicion);\n }", "title": "" }, { "docid": "cb0899aca2b2870caea51eb6d9b5f9b3", "score": "0.59887713", "text": "function nextPage(fileNegocio, targetID) {\r\n loadingGif(targetID);\r\n var RTA = document.getElementById(targetID);\r\n var ajax = new AjaxManager();\r\n ajax.setUrl(\"controlador/negocio/\" + fileNegocio + \"?page=NEXT\");\r\n ajax.executeGet();\r\n ajax.responder(RTA);\r\n}", "title": "" }, { "docid": "5a59664e0b1e582da8d254e932e69c27", "score": "0.59849596", "text": "function next() {\n if (page === menu.length - 1) {\n page = 0;\n }\n else {\n page +=1;\n }\n display();\n}", "title": "" }, { "docid": "b2b8d260507b987e6abcec6b2c9e3235", "score": "0.5984166", "text": "function nextPage() {\n\tif (currPage + 1 < serverReturn.length) {\n\t\t//Remove left bar selection\n\t\t$(\".liSelected\").removeClass(\"liSelected\");\n\t\t\n\t\t//Hide top page\n\t\t$(\"#content\" + currPage).fadeOut(400);\n\t\t\n\t\t//Add new left bar selection\n\t\tcurrPage++;\n\t\t$(\"#li\" + currPage).css(\"display\", \"block\");\n\t\t$(\"#li\"+currPage).addClass(\"liSelected\");\n\t\t\n\t\t//Log and send\n\t\tsendRequest();\n\t}\n}", "title": "" }, { "docid": "1b72a20288ea993818582cb4fb085f86", "score": "0.5977508", "text": "nextPage() {\n const nextPage = parseInt(this.state.pagination.page, 10) + 1;\n this.fetchProducts(nextPage);\n }", "title": "" }, { "docid": "b75a55bde80774c5db714efb81bc9992", "score": "0.5973797", "text": "NextPage() {\n if (this.page >= this.maxpage) return;\n this.page++;\n this.ChangePage();\n }", "title": "" }, { "docid": "339009478b042ece253a1c103fee7f50", "score": "0.5970378", "text": "function scrollToNextPage() {\n card_scroller.scrollBy(card_item_size, 0);\n }", "title": "" }, { "docid": "ae0370d592c6e4af4cb24b967cab4657", "score": "0.596269", "text": "nextPage() {\n console.log(\"forward\");\n if (this.page != 8) {\n this.page += 1;\n this.getData();\n }\n this.pageNumberText.innerHTML = this.page;\n }", "title": "" }, { "docid": "800c1d35e220f753710cf84b40e56649", "score": "0.59563637", "text": "function goNext() {\n if (pageNum >= pdfDoc.numPages)\n return;\n pageNum++;\n renderPage(pageNum);\n }", "title": "" }, { "docid": "9180427aecf022c2f427c9e144096604", "score": "0.59537625", "text": "function nextPage() {\n if (pagination.currentPage < pagination.nums.length) {\n setPagination({\n ...pagination,\n currentPage: pagination.currentPage + 1\n });\n updateCurrentViews(pagination.currentPage + 1, champions.searchResults);\n }\n }", "title": "" }, { "docid": "045a6669ad58248dd6c0bd39398f9488", "score": "0.59531856", "text": "function nextURL() {\n jurl = loadPages.next();\n console.log('');\n if (!jurl.done) {\n Page.navigate({url: jurl.value.url})\n } else {\n protocol.close();\n chrome.kill();\n }\n}", "title": "" }, { "docid": "00fc777fa99f58cc4ccc0a81abc97b16", "score": "0.59529513", "text": "handleNextPage() {\n const { page } = this.props;\n // Note: data for Griddle needs to be zero-indexed, so don't add 1 to this\n this.handleSetPage(page);\n }", "title": "" }, { "docid": "3627bd9c997eec591937a34302f25377", "score": "0.59510386", "text": "function nextPage() {\n\tconsole.log('Next Page function');\n\n\t$.ajax({\n\t\ttype : 'POST',\n\t\turl : 'next',\n\t\tdata : {\n\t\t\t'action' : 'next',\n\t\t},\n\t\tsuccess : function(data) {\n\t\t\tconsole.log('Done');\n\n\t\t}\n\t}\n\n\t);\n}", "title": "" }, { "docid": "827dffa9580853bae64facd74f2a7e8c", "score": "0.5948103", "text": "nextPage () {\n this.goToPage(this.pagination.current + 1);\n }", "title": "" }, { "docid": "08190a0116b9d1fab401ee51d9bce447", "score": "0.59370166", "text": "nextPage()\n {\n if ((this.currentPage + 1) < this.pages)\n {\n this.changePage(1);\n }\n }", "title": "" }, { "docid": "bfb0b8e7ea9181cd195ea07d9a463932", "score": "0.5936209", "text": "loadMore() {\n this.isLoadingMore = true;\n\n app.store\n .find(this.hasMore.replace(app.forum.attribute(\"apiUrl\"), \"\"))\n .then((data) => {\n data.map((article) => this.posts.push(article));\n\n // Update hasmore button\n this.hasMore =\n data.payload.links && data.payload.links.next\n ? data.payload.links.next\n : null;\n })\n .catch(() => {})\n .then(() => {\n this.isLoadingMore = false;\n m.redraw();\n });\n }", "title": "" }, { "docid": "388643b2fa8db40f22342e3ff95e0650", "score": "0.5921946", "text": "function nextPage() {\n if (page < totalPages) {\n page++;\n pagination(data);\n }\n}", "title": "" }, { "docid": "938adb4ed9757469c14fed6cbbe75da5", "score": "0.5918891", "text": "function gotoNextPage() {\n setCurrentPageUrl(nextPage)\n }", "title": "" }, { "docid": "1b03abfa88268c2f352f17327c233cef", "score": "0.5913787", "text": "function loadMore(){\n\t\t\t\t\t\tsearch($scope.query, $scope.videoMeta.nextPageToken);\n\t\t\t\t\t}", "title": "" }, { "docid": "8be2c93f7c073b844634bb6e3b7d2c5d", "score": "0.59108555", "text": "function nextPage() {\n\t\t// go to new page\n\t\tdocument.location.hash = getNextPage();\n\t}", "title": "" }, { "docid": "39dc380068f5594e1014c84927fa0a59", "score": "0.5900211", "text": "function next (n) {\n debug('[INIT] loading feed #' + n)\n var storage = self._storage(''+n)\n var st = storage('key')\n st.read(0, 4, function (err) {\n if (err) return cb()\n var feed = self._hypercore(storage, self._opts)\n feed.ready(function () {\n readStringFromStorage(storage('localname'), function (err, name) {\n if (!err && name) {\n self._addFeed(feed, name)\n } else {\n self._addFeed(feed, String(n))\n }\n next(n+1)\n })\n })\n })\n }", "title": "" }, { "docid": "aa9810b0227b58d7a5930a7b16ca0f8f", "score": "0.5899801", "text": "function loadNext() {\n \t// Prevent (redundantly) loading images if we're already loading them,\n \t// and prevent us from entering an infinite loop\n \tif (loadingImages || nextLink == url) {\n \t return false;\n \t}else{\n\t// We are now loading images!\n\tloadingImages = true;\n\n\tLoadResults();\n\tnextLink = url;\n\n // Aaaaaand we're done loading.\n loadingImages = false;\n}\n \n}", "title": "" }, { "docid": "d1767cc9f194748534c1fb2649a798aa", "score": "0.5892734", "text": "function loadMoreAlbums( $nextUrl ){\r\n \r\n if( typeof( $nextUrl ) === 'undefined' )\r\n return false;\r\n \r\n // update our switch to prevent spamming for every scroll event\r\n loadingMoreAlbums = true;\r\n\r\n // go get our 'next' URL\r\n SpotifyService.getUrl( $nextUrl )\r\n .then(function( response ){\r\n \r\n // append these new tracks to the main tracklist\r\n $scope.albums.items = $scope.albums.items.concat( response.items );\r\n \r\n // save the next set's url (if it exists)\r\n $scope.albums.next = response.next;\r\n \r\n // update loader and re-open for further pagination objects\r\n loadingMoreAlbums = false;\r\n });\r\n }", "title": "" }, { "docid": "eb69cf64e90d0074f37697856a085e30", "score": "0.58860224", "text": "function moveToNext() {\n slideOut($page3);\n page4Load();\n }", "title": "" }, { "docid": "9ca7a31aa5e23708c8cbe777efe4fed0", "score": "0.5884754", "text": "function nextPage() {\n $scope.page++;\n if ($scope.page > 100) {\n $scope.page = 1;\n }\n updateTableUser();\n }", "title": "" }, { "docid": "5869e95b1c26225f26d40c8a0dc3e97b", "score": "0.5872319", "text": "loadMoreMovies() {\n if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {\n if (!this.state.lastPage) {\n this.state.currentPageNumber = this.state.currentPageNumber + 1;\n this.getMovies(this.state.currentSearchTerm, this.state.currentPageNumber);\n }\n }\n }", "title": "" }, { "docid": "4e9114b886aae7aee9e63fd84ddd2888", "score": "0.5866182", "text": "function nextPage() {\n let userID = playerSearch.value;\n currentPage += 1;\n const nPages = Math.ceil(yourItemsArray.length / pageSize);\n if (currentPage > nPages) {\n currentPage = 1;\n }\n loadPage(searchcriteria, userID);\n}", "title": "" }, { "docid": "d42666e3f934354106b19e87401c3669", "score": "0.5860125", "text": "function nextPage() {\n const data = document.querySelector(\"#next\");\n const shown = document.querySelector(\"#shown-select\");\n data.addEventListener(\"click\", (event) => {\n event.preventDefault();\n const newstart = document.querySelector(\"#current\").getAttribute(\"value\");\n const start = parseInt(newstart) * parseInt(shown.value);\n clearNavTable();\n listUsers(start, parseInt(shown.value) + start - 1);\n });\n}", "title": "" }, { "docid": "a55047a8d62388b2b64ca4193a04adf9", "score": "0.585947", "text": "nextPage(e) {\n e.preventDefault();\n if (!this.changingPage) {\n if (this.page < this.pages) {\n this.changePage(e, this.page + this.numberPageShow);\n }\n }\n }", "title": "" } ]
a5413b686dd593651e50f605bc75ea59
Update an existing user.
[ { "docid": "e61819a8274c5d5271b35cdc12c8427c", "score": "0.6710848", "text": "function updateUser(axios, username, request) {\n return restAuthPut(axios, \"users/\" + username, request);\n}", "title": "" } ]
[ { "docid": "5c931da0af38df32e8b3458813c6685d", "score": "0.7988292", "text": "function updateUser() {\n const updatedUser = {\n username: $usernameFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n\n $usernameFld.val(\"\");\n $firstNameFld.val(\"\");\n $lastNameFld.val(\"\");\n $roleFld.val(\"\");\n $passwordFld.val(\"\");\n\n userService.updateUser(currUserId, updatedUser)\n .then(response =>\n findAllUsers());\n }", "title": "" }, { "docid": "7cd9f1e8e777edb62974c62e4d5d4265", "score": "0.7925275", "text": "function updateUser() {\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "title": "" }, { "docid": "f3342602c04284ae9f8110a85cee42fc", "score": "0.79045695", "text": "updateUser(token, id, email, newEmail, username, password) {\r\n return this._call('put', `user/${id}`, { email, newEmail, username, password }, token)\r\n }", "title": "" }, { "docid": "7ee87af469ab4a336d5e69c7f6383a66", "score": "0.7690376", "text": "function updateUser(req, res) {\n var id = req.params.userId;\n var newUser = req.body;\n\n userModel\n .updateUser(id, newUser)\n .then(\n function(stats) {\n console.log(stats);\n res.send(200);\n },\n function(error) {\n res.statusCode(404).send(error);\n }\n );\n }", "title": "" }, { "docid": "e3d7787d09353709b94a43b6507d0db3", "score": "0.75951433", "text": "function updateUser() {\n\t\t$newUsername = $('#new-username').val();\n\t\t$newPassword = $('#new-password').val();\n\t\t$newFirstName = $('#new-firstname').val();\n\t\t$newLastName = $('#new-lastname').val() ;\n\t\t$userRole = $('#roleFld').val() ;\n\t\tvar updatedUser = new User(\n\t\t\t\t$newUsername,\n\t\t\t\t$newPassword,\n\t\t\t\t$newFirstName,\n\t\t\t\t$newLastName,\n\t\t\t\t$userRole,\n\t\t\t\tnull, null, null\n\t\t);\n\t\tvar userId = $updateBtn.attr('userId');\n\t\tuserService.updateUser(userId, updatedUser)\n\t\t.then(refreshForm)\n\t\t.then(findAllUsers);\n\t}", "title": "" }, { "docid": "653d973b203f0a52bda0708330f45b17", "score": "0.75844216", "text": "function updateUser(request, response) {\r\n var userId = request.params.id;\r\n var update = request.body;\r\n delete update.password;\r\n\r\n if (userId != request.user.sub) {\r\n return response.status(500).send({\r\n message: 'No tienes permiso para actualizar el usuario'\r\n });\r\n }\r\n\r\n User.findByIdAndUpdate(userId, update, { new: true }, (error, userUpdated) => {\r\n if (error) {\r\n response.status(500).send({\r\n message: 'Error al actualizar el usuario'\r\n });\r\n } else {\r\n if (!userUpdated) {\r\n response.status(404).send({\r\n message: 'No se ha podido actualizar el usuario'\r\n });\r\n } else {\r\n response.status(200).send({ user: userUpdated });\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3dc97805d23ab3c6d04e8dd96087f619", "score": "0.7538662", "text": "async update(req, res) {\n const user = await this._user(req);\n try {\n user.set(req.body);\n\n let fields = ['provider', 'uid', 'username', 'email', 'displayName', 'accessToken', 'refreshToken'];\n if (user.id !== req.user.id) {\n fields = [...fields, 'role'];\n }\n\n await user.save({ fields });\n await req.flash('info', '更新しました');\n res.redirect(`/admin/users/${req.params.user}`);\n } catch (err) {\n if (err instanceof ValidationError) {\n res.render('admin/users/edit', { user, err });\n } else {\n throw err;\n }\n }\n }", "title": "" }, { "docid": "b2a028ff00aa2ba52044de5320c2d831", "score": "0.7446599", "text": "function updateUser(req, res) {\n User.findOneAndUpdate(\n { _id: req.params.UserId },\n req.body,\n { new: true },\n (err, User) => {\n if (err) {\n res.send(err);\n }\n res.json(User);\n }\n );\n}", "title": "" }, { "docid": "28be4ff8b9a883e75856ba7986790256", "score": "0.744286", "text": "update(id, user) {}", "title": "" }, { "docid": "5ab1c043fc5cda7d5262bcdcd439ae60", "score": "0.7376388", "text": "function updateUser(userId, username, password, email, openId, facebookId, googleId, cb) {\n\t\t// generate a salt\n\t\tbcrypt.genSalt(SALT_WORK_FACTOR, function(err, salt) {\n\t\t\tif (err) { logger.error(err); return cb(err, null); }\n\n\t\t\t// hash the password using our new salt\n\t\t\tbcrypt.hash(password, salt, function(err, hash) {\n\t\t\t\tif (err) { logger.error(err); return cb(err, null); }\n\n\t\t\t\tmodelUser.findByIdAndUpdate(userId, {username: username, password: hash, email: email, openId: openId, facebookId: facebookId, googleId: googleId, email: email}, { upsert: true, multi: false }, function (err, numberAffected, raw) {\n\t\t\t\t\tif (err) { logger.error(err); return cb(err, raw); }\n\t\t\t\t\telse { return cb(err, 'ok'); }\n\t\t\t\t});\n\t\t\t});\n\t\t});\t\n\t}", "title": "" }, { "docid": "b149b7d8410ba2231149f59387565e64", "score": "0.73382926", "text": "function api_updateuser(ctx, newuser) {\r\n newuser.a = 'up';\r\n\r\n res = api_req([newuser], ctx);\r\n}", "title": "" }, { "docid": "39e301659b08a85b3fd940fe67e4bf82", "score": "0.7337063", "text": "async updateUser () {\n\t\t// clear the mustSetPassword flag\n\t\tconst op = {\n\t\t\t$unset: {\n\t\t\t\tmustSetPassword: true\n\t\t\t}\n\t\t};\n\n\t\t// clear any provider info associated with slack or msteams,\n\t\t// the sharing model will require authenticating against a new app\n\t\tif (this.user.get('clearProviderInfo')) {\n\t\t\tthis.clearProviderInfo(op);\n\t\t}\n\n\t\tthis.userUpdateOp = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "title": "" }, { "docid": "2ea45b9de6a64926af157ae00ae3ac8d", "score": "0.7322162", "text": "async update_user(data) {\n if (!data) return false;\n\n return await this.endpoint.update_user(data);\n }", "title": "" }, { "docid": "df378442e8beb80a40adcf5f779e8517", "score": "0.7308272", "text": "static async updateUser(req, res, next) {\n const { id } = req.params;\n const { email, username } = req.body;\n try {\n const result = await User.findByIdAndUpdate(id, { email, username }, { new: true });\n res.status(200).json({ message: \"User has been updated\", data: result });\n } catch (err) {\n next(err);\n }\n }", "title": "" }, { "docid": "d8d8101a083e76b2d1ab1b35be8bb624", "score": "0.7299377", "text": "function updateUser(req, res) {\n User.findById(req.params.id, (err, user) => {\n if (err) {\n apiLogger.error(formatApiLogMessage(`Error finding user '${req.params.id}': ${err}`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.ERROR).json({ message: CONSTANTS.RESPONSE_MESSAGES.INTERNAL_ERROR_MESSAGE });\n }\n\n if (user) {\n Object.assign(user, req.body);\n user.save((err) => {\n if (err) {\n apiLogger.error(formatApiLogMessage(`Error updating user '${req.params.id}': ${err}`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.ERROR).json({ message: CONSTANTS.RESPONSE_MESSAGES.INTERNAL_ERROR_MESSAGE });\n }\n\n apiLogger.info(formatApiLogMessage(`user ${req.params.id} updated successfully`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.OK).json({ message: CONSTANTS.RESPONSE_MESSAGES.SUCCESS });\n });\n }\n else {\n apiLogger.info(formatApiLogMessage(`Could not find user '${req.params.id}'`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.OK).json({\n message: CONSTANTS.RESPONSE_MESSAGES.DATA_NOT_FOUND,\n errors: [ CONSTANTS.ERRORS.DATA_NOT_FOUND ]\n });\n }\n });\n}", "title": "" }, { "docid": "89f03710604e24ffaea60b44c2ea2919", "score": "0.72890973", "text": "function updateUser() {\n if (selectedId['selected'] == true) {\n let usern = $('#usernameFld').val();\n let pswd = $('#passwordFld').val();\n let fname = $('#firstNameFld').val();\n let lname = $('#lastNameFld').val();\n let role = $('#roleFld').val();\n let update = new User(selectedId['id'], usern, pswd, fname, lname, role);\n\n userService.updateUser(update, function (registeredUsers) {\n renderUsers(registeredUsers);\n deleteUser();\n findUserById();\n });\n ClearFormFields();\n }\n }", "title": "" }, { "docid": "e1eac743ec8b1cf17b30767bf2fbdc7f", "score": "0.7282861", "text": "function updateUser(userId, user, callback) {\n return fetch(self.url + \"/\" + userId, {\n method: \"put\",\n body: JSON.stringify(user),\n headers: {\n \"content-type\": \"application/json\"\n }\n }).then(function(response) {\n return response.json();\n });\n }", "title": "" }, { "docid": "e8bcd73935499ddc63753236fbd03656", "score": "0.725576", "text": "updateUser(userId, data, cb) {\n this.request('PUT', '/api/users/' + userId, data, cb)\n }", "title": "" }, { "docid": "f08fbef1c45b467d501b9b71e94968b0", "score": "0.7194081", "text": "function updateUser(req, res) {\n let uid = req.swagger.params.uid.value;\n let user = req.swagger.params.user.value;\n let oid = new mongo.ObjectID(uid);\n user.updated = new Date();\n if (!_.isNil(user.password)) {\n user.password = crypto.createHash('sha256').update(user.password).digest('hex');\n }\n\n let queryUpdate = new Promise((resolve, reject) => {\n const db = req.app.locals.db;\n db.collection('users').findOneAndUpdate({_id: oid},\n {$set: user},\n {returnOriginal: false}, (err, r) => {\n if (err) {\n return reject(err);\n }\n resolve(r);\n });\n });\n\n queryUpdate.then((r) => {\n if (r.lastErrorObject.n === 1) {\n res.json(r.value);\n } else if (r.value === null) {\n res.status(404).json({'message': 'User not found'});\n }\n }).catch((error) => {\n if (error.code === 11000) {\n res.status(409).json({'message': 'Duplicate email'});\n }\n winston.error(error.message);\n res.status(500).json({'code': error.code, 'message': error.message});\n });\n}", "title": "" }, { "docid": "c88e7125444382f224143daba3d8321e", "score": "0.71852875", "text": "function updateUser(req, res){\n\tvar user_id = req.params.id;\n\tvar update = req.body;\n\n\t// Removing password property\n\tdelete update.password;\n\n\tif(user_id != req.user.sub){\n\t\treturn res.status(500).send({message: 'You are unavailable to update this user'});\n\t}\n\n\tUser.findOne({nick: { $regex : new RegExp(update.nick, \"i\") }},(err, bad_user) => {\n\t\tif(err) return res.status(500).send({message: 'Error by checking nick'});\n\t\tif(bad_user){\n\t\t\tif(bad_user._id != user_id){\n\t\t\t\treturn res.status(200).send({message: 'There are an user with nick '+bad_user.nick+' register in already'});\n\t\t\t}\n\t\t}\n\t\t\n\t\tUser.findByIdAndUpdate(user_id, update, {new:true}, (err, userUpdated) => { // con new indicamos que userUpdated sea el usuario actualizado, sino de devuelve el original\n\t\t\tif(err) return res.status(500).send({message: 'Error in the request'});\n\t\t\tif(!userUpdated) return res.status(404).send({message: 'User has not updated'});\n\n\t\t\treturn res.status(200).send({user: userUpdated});\n\t\t});\n\t});\t\n}", "title": "" }, { "docid": "31ce73f186544c994746055c4d8799d7", "score": "0.7175619", "text": "function updateUser(user, idmUser, access_token, callback) {\n // Leave existing fields untouched.\n var newUser = user;\n\n // Change the fields to be updated.\n newUser.FirstName = idmUser.FirstName;\n newUser.MiddleName = idmUser.MiddleName;\n newUser.LastName = idmUser.LastName;\n newUser.ExternalEmail = idmUser.ExternalEmail;\n\n // Send the update.\n var url = process.env.HOST_URL\n + '/d2l/api/lp/1.10/users/' + user.UserId;\n console.log('PUT ' + url);\n request\n .put(url)\n .set('Authorization', `Bearer ${access_token}`)\n .send(newUser)\n .end(function(err, result) {\n callback(err, result.body);\n });\n}", "title": "" }, { "docid": "b60d4fe234535f968ab300e86bb421b5", "score": "0.71406937", "text": "function update(id, user) {\n return db('users')\n .where('id', Number(id))\n .update(user);\n}", "title": "" }, { "docid": "9956a9a34a7ef2fb7d3b1f54d19c4850", "score": "0.71327716", "text": "function updateUser(user) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/users\",\n data: user\n }).then(getUsers);\n }", "title": "" }, { "docid": "087fe1f6196c998da394af617ec899e6", "score": "0.7126564", "text": "updateUser(email, newUser) {\n StudyBuddyDB.updateUser(email, newUser);\n }", "title": "" }, { "docid": "f4a2143c352d0641fc7c0feb95f9e01c", "score": "0.710088", "text": "async update(req, res) {\n try {\n const user = await User.findByPk(req.userId);\n if (!user) {\n return res.status(400).json({\n errors: ['User not found!'],\n });\n }\n const updatedUser = await user.update(req.body);\n\n return res.json(updatedUser);\n } catch (error) {\n return res.status(400).json({ errors: error.errors.map((err) => err.message) });\n }\n }", "title": "" }, { "docid": "6f9d1c42c9b8caf7216297665c514c72", "score": "0.7092179", "text": "function updateUser(req, response) {\n const { username } = req.params;\n const { name, email, phone} = req.body;\n // Mandatory Fields\n if (!name || !email || !phone)\n return response.status(401).json({ error: 'Username, password, or email field are blank' });\n\n if (username) {\n repo.updateUser(username, name, phone, email, (err, res) => {\n err\n ? response.status(500).json({ error: \"Internal Server Error, try again\" })\n : response.status(200).json({ status: \"success\" })\n })\n }\n else {\n response.status(401).json({ status: \"unauthorized\" });\n }\n}", "title": "" }, { "docid": "f483f2fe7822083e0fc4056b0477916d", "score": "0.7051773", "text": "function updateUser(user) {\n return {\n type: 'UPDATE_USER',\n user:user\n }\n}", "title": "" }, { "docid": "7070d08db58628e15978b2fadd02624e", "score": "0.7031184", "text": "function updateUser(userId, newUser) {\n // console.log(newUser);\n return $http.put(\"/api/user/\"+userId, newUser);\n }", "title": "" }, { "docid": "88c5054ea043297e5e2645cf12e0b635", "score": "0.7026073", "text": "function updateUser(userId, user){\n delete user.username;\n delete user.password;\n if (typeof user.roles === 'string') {\n user.roles = user.roles.split(',');\n }\n return userModel.update({\n _id : userId\n }, {$set: user});\n }", "title": "" }, { "docid": "df0786f76e4bfc3d0fdaa97a64ce4b43", "score": "0.7021195", "text": "function updateUser (req, res) {\n var userId = req.params.id\n var update = req.body\n\n // Borrar propiedad PASSWORD\n delete update.password\n\n if (userId !== req.user.sub) {\n return res.status(500).send({message: 'No tienes permiso para actualizar los datos del usuario'})\n }\n\n User.find({ $or: [\n {email: update.email.toLowerCase()},\n {nick: update.nick.toLowerCase()}\n ]}).exec((err, users) => {\n var user_isset = false\n users.forEach((user) => {\n if (user && users._id !== userId) user_isset = true\n })\n if (user_isset) return res.status(404).send({message: 'Los datos ya están en uso'})\n\n User.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdated) => {\n if (err) return res.status(500).send({message: 'Error en la petición'})\n if (!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'})\n\n return res.status(200).send({user: userUpdated})\n })\n })\n\n User.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdated) => {\n if (err) return res.status(500).send({message: 'Error en la petición'})\n\n if (!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'})\n\n return res.status(200).send({user: userUpdated})\n })\n}", "title": "" }, { "docid": "cec1cec7ef02da1ea6aaf228fb935331", "score": "0.7019332", "text": "async updateProfile(id,user){\n return User.findByIdAndUpdate(id,user,{new: true})\n }", "title": "" }, { "docid": "15afbae148e7da50e8b4b9543e5b6f32", "score": "0.70174646", "text": "function updateProfile() {\n\n var user = new User(\n null,\n null,\n $firstNameFld.val(),\n $lastNameFld.val(),\n $emailFld.val(),\n $phoneFld.val(),\n $dobFld.val(),\n $roleFld.val()\n )\n\n userService.updateProfile(user).then(function () {\n getProfile()\n $editSuccess.show()\n hideAlert($editSuccess)\n })\n }", "title": "" }, { "docid": "4cfa5b38588d62da81207695c5705b96", "score": "0.70145315", "text": "function update(req, res) {\n User.findById(req.params.id)\n .then(function(user) {\n if (!user) res.send(\"user not found\");\n else return user.updateAttributes(req.body);\n })\n .then(function(user) {\n res.json(user);\n });\n}", "title": "" }, { "docid": "926344dab96d91d04fefeb5d30451bf4", "score": "0.70029366", "text": "function update (user) {\n return knex(USERS_TABLE)\n .where('authId', user.authId)\n .update({\n profile: user.oauthProfile,\n name: user.displayName,\n email: user.email,\n updated_at: new Date()\n }, 'id').then(([id]) => getById(id))\n}", "title": "" }, { "docid": "373a71c3c175bb6f88ad93c276bd4619", "score": "0.70011866", "text": "function updateUser(req, res) {\n console.log(`LLEGAS A UPDATE?`);\n\n let userId = req.params.id;\n let update = req.body;\n\n bcrypt.hash(update.password, null, null, (err, hash) => {\n update.password = hash;\n\n Usuario.findByIdAndUpdate(userId, update, {\n new: true\n }, (err, userUpdate) => {\n if (err) return res.status(500).send({\n message: `Error en la petición`\n });\n if (!userUpdate) return res.status(404).send({\n message: `No se ha podido actualizadar el usuario`\n });\n\n return res.status(200).send({\n usuario: userUpdate\n });\n });\n });\n\n}", "title": "" }, { "docid": "6b4f376e2300baf383a12d14f3af29b8", "score": "0.69972515", "text": "function editUser(req, res){\n\n var newvalues = { $set: {\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n mobileNumber: req.body.mobileNumber,\n email: req.body.email,\n role: req.body.role\n } }; \n\n User.findByIdAndUpdate({ _id: req.body.id }, newvalues, function(err, data){\n if(err) return res.status(501).json(err);\n else return res.status(201).json(data);\n })\n}", "title": "" }, { "docid": "bd941c63d361e6ccdf244fdc23ce6cd3", "score": "0.69889385", "text": "function updateDetails() {\n user.username = vm.username;\n user.password = vm.password;\n user.firstName = vm.firstname;\n user.lastName = vm.lastname;\n user.email = vm.email;\n user.locations = vm.userLocations;\n\n var userId = user._id;\n\n delete user._id;\n\n UserService.updateUser(userId, user)\n .then(function(response) {\n $rootScope.currentUser = response.data;\n user = response.data;\n });\n }", "title": "" }, { "docid": "b2cdff4748e09c4d0311d2cf80402cbf", "score": "0.6976523", "text": "updateUser(req, res) {\n User.findOneAndUpdate({ _id: req.params.id }, req.body, { new: true })\n .then((updatedUser) => res.json(updatedUser))\n .catch((err) => res.json(err));\n }", "title": "" }, { "docid": "fe633d4673a7a795d6315329bfc0b6f6", "score": "0.6965019", "text": "function updateUser() {\n // fields to update\n delete userParam.oldPassword;\n delete userParam.confirmPassword;\n var set = _.omit(userParam,'_id');\n \n // update password if it was entered\n if (userParam.password) {\n set.hash = bcrypt.hashSync(userParam.password, 10);\n }\n delete set.password;\n \n db.users.update({_id: mongo.helper.toObjectID(_id)}, {$set: set}, function(err){\n if(err) {\n deferred.reject(err);\n }\n deferred.resolve();\n });\n }", "title": "" }, { "docid": "9bd02ae98472a7f622590dc7be915aff", "score": "0.6959389", "text": "function serviceUpdateUser(req, resp) {\n\t\tlogger.info(\"<Service> UpdateUser.\");\n\t\tvar userData = parseRequest(req, ['userId', 'username', 'password', 'email', 'openId', 'facebookId', 'googleId']);\n\t\tif (!userData.password) { error(10, resp, 'Password required'); return; }\n\t\twriteHeaders(resp);\n\t\tupdateUser(userData.userId, userData.username, userData.password, userData.email, userData.openId, userData.facebookId, userData.googleId, function(err, status) {\n\t\t\tif (err) error(2, resp);\n\t\t\telse resp.end(JSON.stringify({ status: status })); \n\t\t});\n\t}", "title": "" }, { "docid": "10a0ab40a65597790bb72b6616da8ca6", "score": "0.69475615", "text": "updateUser(userId, editedUserData) {\n return this.createQueryBuilder()\n .update(User_entity_1.User)\n .set(editedUserData)\n .where(\"id = :id\", { id: userId })\n .execute();\n }", "title": "" }, { "docid": "5a2cccb3b040daca4a854c05e9425ff5", "score": "0.6946557", "text": "static updateUser(user) {\n realm.write(() => {\n let user = realm.create('User', user, true);\n });\n }", "title": "" }, { "docid": "98312bc8044e662d182ba4e6a043789a", "score": "0.69375324", "text": "function updateUser() {\n \n console.log(\"Update button clicked!\");\n \n // If user is logged in\n if (firebase.auth().currentUser) {\n var user = firebase.auth().currentUser;\n console.log(user);\n \n // Create object for this user's data\n var newUser = {displayName: user.displayName, photoURL: user.photoURL, favLanguage: favLanguageInput.value};\n \n // Get ref to the current user\n var userIdRef = firebase.database().ref(user.uid);\n \n // Create or update newUser object in Firebase dB, and then run our function named finishUpdatingProfile\n userIdRef.set(newUser, finishUpdatingProfile);\n \n }\n}", "title": "" }, { "docid": "2013f141eff4a14d7665342b2a01b16d", "score": "0.69283795", "text": "function updateUser(req, res)\n {\n var id2 = req.params[\"userId\"];\n var user = req.body;\n console.log(id2);\n model.updateUser(id2,user)\n .then(function(response){\n res.status(200).send(\"\");\n }, function(err){\n res.status(400).send(err);\n });\n }", "title": "" }, { "docid": "7d42d70d033aefc698d5c7697063dfbe", "score": "0.6923268", "text": "function updateUser(event) {\n event.preventDefault();\n\n const id = refs.updateUserInputId.value;\n\n const updatedUser = {\n name: refs.updateUserInputName.value,\n age: refs.updateUserInputAge.value\n }\n\n fetch(`https://test-users-api.herokuapp.com/users/${id}`, {\n method: \"PUT\",\n body: JSON.stringify(updatedUser),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n })\n .then(response => {\n if (response.ok) return response.json();\n })\n .then(() => alert(\"Success!\"))\n .catch(error => console.log(error));\n\n refs.updateUserForm.reset();\n}", "title": "" }, { "docid": "96fb96308480262d895f1c2ecced891a", "score": "0.68664056", "text": "updateUser({ params, body }, res) {\n\t\tUser.findOneAndUpdate({ _id: params.id }, body, {\n\t\t\tnew: true,\n\t\t\trunValidators: true,\n\t\t})\n\t\t\t.then((dbUserData) => {\n\t\t\t\tif (!dbUserData) {\n\t\t\t\t\tres.status(404).json({ message: \"No user found with this id\" });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tres.status(200).json(dbUserData);\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tconsole.log(err);\n\t\t\t\tres.status(400).json(err);\n\t\t\t});\n\t}", "title": "" }, { "docid": "8210dac3e81a45cc51742e79b24e19eb", "score": "0.68624413", "text": "function updateUser(idx, field, value) {\n\tvar model = userinfo[idx].model;\n\tvar xml = Node(\"userDesc\", Node(\"username\", model.username),\n\t\t\tfield == \"password\" ? Node(\"password\", value) : undefined,\n\t\t\tfield == \"localUserId\" ? Node(\"localUserId\", value)\n\t\t\t\t\t: model.localUserId == undefined ? undefined : Node(\n\t\t\t\t\t\t\t\"localUserId\", model.localUserId), Node(\"enabled\",\n\t\t\t\t\tfield == \"enabled\" ? value : model.enabled), Node(\"admin\",\n\t\t\t\t\tfield == \"admin\" ? value : model.admin));\n\tputXML(userinfo[idx].url, xml, function() {\n\t\trefreshUsers();\n\t});\n}", "title": "" }, { "docid": "1e7b9afcc74a2a5ed7b6c5618ac4826a", "score": "0.68600386", "text": "function updateUser(userId, user) {\n return User.update(\n { _id: userId },\n { $set:\n {\n firstName: user.firstName,\n lastName: user.lastName,\n email: user.email,\n phone: user.phone,\n photoUrl: user.photoUrl,\n biography: user.biography,\n dateUpdated: Date.now()\n }\n }\n );\n }", "title": "" }, { "docid": "b5b839191ea183069b37b2edbe90947e", "score": "0.6847026", "text": "function updateUser(req, res){\n //recojo el id del usuario a actualizar\n var userId = req.params.id;\n //con el body recoje los datos del usuario a actualizar\n //body porque viene por metodo post o put\n var update = req.body;\n console.log(update);\n //borrar la propiedad password para actualizar en otra funct\n delete update.password;\n \n //verificacion del usuario si no es el id correcto retorna\n if(userId != req.user.sub){\n return res.status(500).send({\n message: 'no tiene permisos de actualizacion'});\n }\n //la funcion findByIdAndUpdate de mongoose permite actulizar un id \n // en parametro {new:true}=> (esto es un json que permite diferentes \n // opciones )\n // se pasan las opciones para que \n // devuelva el objeto actualizado y no el original, si no se \n // coloca devuelve el obejto sin atualizar\n //update son los datos que se van actualizar\n User.findByIdAndUpdate(userId, update, {new:true}, \n //la function de calba obtiene un posible error o un usuario actualizado\n (err, userUpdated) =>{\n if (err) return res.status(500).send({\n message: 'error en peticion'});\n \n if(!userUpdated) return res.status(404).send({\n message: 'no se ha podido actualizar el usuario'});\n //devuelve el objeto antes de actualizar\n return res.status(200).send({\n user: userUpdated});\n });\n}", "title": "" }, { "docid": "665b5eb8f06c92c7f20a653de90940d2", "score": "0.6839911", "text": "function updateUser(req, res) {\n\n if (req.body._id) {\n delete req.body._id;\n }\n\n entity.findById(req.params.id, USER_FIELDS, function (err, item) {\n if (err) {\n return handleError(res, { message: err.message });\n }\n\n if (!item) {\n return res.send(404);\n }\n\n checkUserName(req, res, item).then(\n ok => {\n //username is ok so continue\n\n //encode the password - only if we get one from the request\n if (_.isEmpty(req.body.password)) {\n delete req.body.password;\n } else {\n req.body.password = bcrypt.hashSync(req.body.password, 10);\n }\n \n var updated = _.merge(item, req.body);\n updated.save(function (err) {\n if (err) {\n return handleError(res, { message: err.message });\n }\n return res.status(200).json(item);\n });\n },\n err => {\n return handleError(res, { message: err.message });\n }\n );\n \n });\n}", "title": "" }, { "docid": "3b6c0556a303792e89497dac02e13e93", "score": "0.6836194", "text": "async updatedUser(username, body) {\n\t\tif (!username || username == '') {\n\t\t\tthrow new Error('Updated user requires [username] parameter');\n\t\t}\n\t\tif (!body || body == '') {\n\t\t\tthrow new Error('Updated user requires [body] parameter');\n\t\t}\n\n\n\t\tconst request = new Request(this.basePath + `/user/${username}`,\n\t\t\t{\n\t\t\t\theaders: headers,\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tcredentials: 'include',\n\t\t\t\tbody: JSON.stringify(body)\n\t\t\t});\n\n\t\treturn await fetch(request).then(response => response.json());\n\t}", "title": "" }, { "docid": "302c724f433685d6441fac22e483a904", "score": "0.6832005", "text": "function updateUser(userId, user) {\n return $http.put(\"/api/assignment/admin/user/\" + userId, user);\n }", "title": "" }, { "docid": "df4f85e7a03d4c9332ffaedb4bbdc390", "score": "0.68258125", "text": "async function updateUser (userId, body) {\n return updateDemoUsers({id: userId}, body)\n}", "title": "" }, { "docid": "0d0c370919df2cf21dae6c89cc0d603e", "score": "0.6824709", "text": "function updateUser(callback, req){\n Users.findOneAndUpdate({u_id:req.user.u_id},\n {f_name:req.body.f_name, \n l_name:req.body.l_name, \n email:req.body.email}).exec(callback)\n}", "title": "" }, { "docid": "8f8c5a3067de5e99c8f59e2073f3d477", "score": "0.6785945", "text": "updateUser(req, res){\n user.findByIdAndUpdate(req.user._id, req.body, function(err, userdata){\n if(err) return res.send({\n success : false,\n message : err.message\n })\n\n user.findById(userdata._id, function(err, data){\n if(err) return res.send({\n success : false,\n message : err.message\n })\n\n return res.send({\n success : true,\n message : \"User Updated!\",\n userdata : data\n })\n })\n })\n }", "title": "" }, { "docid": "be71a7f7e2b14486b8f9c10586be9645", "score": "0.6782865", "text": "function updateUser(req, res) {\r\n var userId = req.params.id;\r\n var update = req.body;\r\n\r\n // borrar propiedad password\r\n //delete update.password;\r\n\r\n if(update.password.length < 40) \r\n \tupdate.password = bcrypt.hashSync(update.password);\r\n \r\n\r\n User.find({\r\n $or: [\r\n { email: update.email },\r\n { login: update.login }\r\n ]\r\n }).exec((err, users) => {\r\n var user_isset = false;\r\n\r\n users.forEach((user) => {\r\n if (user && user._id != userId)\r\n user_isset = true;\r\n });\r\n\r\n if(user_isset)\r\n return res.status(404).send({ message: 'Los datos ya estan en uso' });\r\n\r\n // Si son iguales, buscamos y actualizamos ({new:true} devuelve el usuario actualizado, false el original)\r\n User.findByIdAndUpdate(userId, update, { new: true, useFindAndModify: false }, (err, userUpdated) => {\r\n\r\n if (err)// Si hay error\r\n return res.status(500).send({ message: 'Error en la peticion' });\r\n if (!userUpdated)// Si no se ha podido actualizar el usuario\r\n return res.status(404).send({ message: 'No se ha podido actualizar el usuario' });\r\n\r\n return res.status(200).send({ message: userUpdated }); // Devolvemos el usuario\r\n });\r\n });\r\n\r\n}", "title": "" }, { "docid": "67e03aa5c27157108cf285ce516e4c23", "score": "0.6775719", "text": "function updateUser() {\r\n let user = firebase.auth().currentUser;\r\n\r\n // update auth user\r\n user.updateProfile({\r\n displayName: document.querySelector('#name').value\r\n });\r\n\r\n // update database user\r\n userRef.doc(currentUser.uid).set({\r\n img: document.querySelector('#imagePreview').src,\r\n birthdate: document.querySelector('#birthdate').value\r\n }, {\r\n merge: true\r\n });\r\n}", "title": "" }, { "docid": "8e82049894e964faddcfcff3bd51606d", "score": "0.67276454", "text": "async function updateUser(ctx) {\n let id = ctx.params.id;\n const body = ctx.request.body;\n let result = await model.update(body,id);\n if (result) {\n ctx.status = 201;\n ctx.body = {result}\n }\n\n}", "title": "" }, { "docid": "fbb5e121a2591a6858cab842098d2e23", "score": "0.6725036", "text": "updateUser(_id, email, newEmail, username, password) {\n\n return Promise.resolve()\n .then(() => {\n validate({ _id, email, newEmail, username, password })\n\n return User.findOne({ _id })\n })\n .then(user => {\n if (!user) throw Error('user does not exists')\n\n if (user.username !== username || user.password !== password) throw Error('username and/or password wrong')\n\n //return User.updateOne({ id }, { $set: { name, surname, email, username: newUsername, password: newPassword } }) // NOTE $set also works here, but it can be simplified as following statement\n return User.updateOne({ _id }, { email: newEmail, username, password })\n })\n }", "title": "" }, { "docid": "ce79438a2a4b391bbdf8a89bfe558006", "score": "0.6724456", "text": "function updateUser(){ ctrl.user = Data.user.get() }", "title": "" }, { "docid": "101c580915d00600942bf385e8b7c575", "score": "0.67183167", "text": "updateUser({ params, body }, res) {\n\t\tUser.findOneAndUpdate({ _id: params.id }, body, { new: true })\n\t\t\t.then((dbUserData) => {\n\t\t\t\tif (!dbUserData) {\n\t\t\t\t\tres.status(404).json({ message: 'no user found with this id' });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tres.json(dbUserData);\n\t\t\t})\n\t\t\t.catch((err) => res.status(400).json(err));\n\t}", "title": "" }, { "docid": "14e0466be2a6090c882869c84c19b2f0", "score": "0.6701521", "text": "async function updateExistingUser() {\n try {\n await fetch(url + 'user', {\n method: 'PUT',\n mode: 'cors',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(this.user)\n });\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "0b228a82b7b0a425fec7fb701351def9", "score": "0.67001885", "text": "async update(user) {\n if (!user.id || !user.username || !user.email) {\n return {\n status: false,\n reason: 'userid, username and email must be provided when updating user information',\n };\n }\n try {\n const query = await db.query(`\n UPDATE \"user\"\n SET username = $2, email = $3, fname = $4, lname = $5, role = $6, active = $7\n WHERE id = $1\n RETURNING *;\n `, [\n user.id,\n user.username,\n user.email,\n user.fname || '',\n user.lname || '',\n user.role || 'user',\n user.active || true\n ]);\n\n return (query.rowCount !== 0) ?\n { status: true, data: query.rows[0], } :\n { status: false, reason: 'failed to update user', };\n } catch(err) {\n return {\n status: false,\n reason: 'an exception was thrown when creating the API key',\n error: err,\n }\n }\n }", "title": "" }, { "docid": "dbadfb3f3250b9a053ef7b44dae077a3", "score": "0.6695824", "text": "async update(req, res) {\n await User.findOneAndUpdate({\n _id: req.params.id\n }, {\n name: req.body.name,\n email: req.body.email,\n password: req.body.password,\n })\n const user = await User.findById(req.params.id).exec()\n res.json({ data: user })\n }", "title": "" }, { "docid": "24ac99e123fc3584fde293eb72b9618a", "score": "0.6695621", "text": "function updateUser(){\n sqlite.update('users', {first_name: req.body.first_name,\n last_name: req.body.last_name,email: req.body.email},\n {email: req.session.user}, function(resp){\n if(res[0] == 'error'){\n sqlite.close();\n console.log('error');\n res.status(400).send('Error: Unable To Edit User Please Try Again Later');\n }else{\n sqlite.close();\n console.log('success');\n req.session.user = req.body.email;\n req.session.save();\n res.send('success');\n }\n });\n }", "title": "" }, { "docid": "33ceca2eb8b723c15cdb2d5a6ecab708", "score": "0.66880566", "text": "function putAuthUser(req, res) {\n var query;\n var update;\n\n // Check if the user is actually logged in. We should try to update info\n // for an anonymous user.\n if (!(req.user && req.user.data)) {\n res.status(401).send('Not authenticated');\n\n return;\n }\n\n // For right now, we do not allow the user to change their username if it\n // has been set before.\n if (req.user.username) {\n res.status(422).send(\n 'You cannot change the user name of a registered user.');\n return;\n }\n\n // Setup and execute an update query.\n query = {\n provider: req.user.data.provider,\n idWithProvider: req.user.data.idWithProvider\n };\n update = {\n username: req.body.username\n };\n\n providerAccounts.update(query, update).exec()\n .then(function () {\n\n // Now we need to update user's data in the session. The simplest way\n // to do that is to first get the current user's data.\n return oauth.getUserFromProfile(providerAccounts, req.user.data)\n .then(function (userRecord) {\n if (!userRecord) {\n throw new Error('Could not get user record.');\n }\n // Once we have the userRecord, we try to update the session.\n if (authConfig.maintenance === 'cookie') {\n req.login(userRecord, function (error) {\n if (error) {\n throw error;\n } else {\n res.status(200).send(userRecord);\n }\n });\n } else {\n // generate a new token\n var secrets = config.getConfig('secrets');\n var currentToken = req.headers.authorization.replace(\n 'Bearer ', '');\n var decodedToken = jwt.decode(currentToken);\n\n var expiresInMinutes = 60;\n decodedToken.data.username = userRecord.data.username;\n var newToken = generateToken(decodedToken.data,\n expiresInMinutes,\n secrets.authTokenSecret);\n\n userRecord.meta = userRecord.meta || {};\n userRecord.meta.token = newToken;\n userRecord.meta.expires = getExpirationTime(\n expiresInMinutes);\n\n log.debug('getNewToken requested with: ', currentToken);\n log.debug('token decoded as :', decodedToken);\n\n\n res.status(200).send(userRecord);\n }\n });\n })\n .then(null, util.makeErrorResponder(res));\n }", "title": "" }, { "docid": "cbe77f77c41b4c3c63c0aeac4f04ef6b", "score": "0.6668952", "text": "static async updateUser(\n id,\n body){\n try {\n \n const updatedUser = await users.updateOne(\n {user_id: id},\n { $set: body}\n );\n return updatedUser;\n } catch (e) {\n return { error: e };\n }\n }", "title": "" }, { "docid": "0609edbad0dbf2e9835c687bb680a2fb", "score": "0.6663171", "text": "function editUser(req, res) {\n\t\t//Validate input parameters\n\t\treq.checkBody('fname', 'Not a string.').isAlpha();\n\t\treq.checkBody('lname', 'Not a string.').isAlpha();\n\t\treq.checkBody('email', 'Not an email.').isEmail();\n\t\treq.checkBody('newEmail', 'Not an email.').isEmail();\n\n\t\tvar errors = req.validationErrors();\n\n\t\t//Handle errors with validating input if needed\n\t\tif (errors) {\n\t\t\treturn res.status(406).json({\n\t\t\t\tsuccess: false,\n\t\t\t\tmessage: 'Could not validate input fields',\n\t\t\t\terrors: errors\n\t\t\t});\n\t\t}else {\n\t\t\tvar fname = req.body.fname;\n\t\t\tvar lname = req.body.lname;\n\t\t\tvar email = req.body.email;\n\t\t\tvar newEmail = req.body.newEmail;\n\n\t\t\t//Call the query function to update a user in the database (update all the attributes)\n\t\t\tquery.editUser(fname, lname, email, newEmail, function(err, result) {\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\treturn res.status(200).json({\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\tuser: result\n\t\t\t\t});\n\t\t\t});\n\t\t\t//Rescope the token for the user with the new email\n\t\t\trescopeToken(newEmail);\t\t\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "a355c41bc250e3d3233dfbfc5e5ad31f", "score": "0.6662227", "text": "function update(username, updatedUser) {\n var deferred = q.defer();\n delete updatedUser._id;\n\n UserModel.findByIdAndUpdate(username, { $set: updatedUser }, { new: true },\n function(err, user) {\n if(err) {\n deferred.reject(err);\n } else {\n deferred.resolve(user);\n }\n }\n );\n\n return deferred.promise;\n }", "title": "" }, { "docid": "c237a6f74745fc42d61ff6ef273dfd4c", "score": "0.6645393", "text": "_updateUser(user, cb) {\n const _id = typeof user._id === 'string' ? new ObjectID(user._id) : user._id;\n this.GetDb((err, db) => {\n const query = { _id };\n const set = _.omit(user, ['_id']);\n Update.updateOne(db, 'user', query, set, updateUserError => cb(updateUserError, user));\n });\n }", "title": "" }, { "docid": "16fe938337534586868696ed76d36ff2", "score": "0.6644012", "text": "function usersEdit(req, res, next) {\n User\n .findById(req.params.id)\n .then(user => {\n if (user.id === req.currentUser.id) {\n user = Object.assign(user, req.body);\n user.save();\n return res.json(user);\n } else {\n return res.json({ message: 'Unauthorized' });\n }\n })\n .catch(err => next(err));\n}", "title": "" }, { "docid": "4d34097db4817c7ddc7ec6ba8a148b4c", "score": "0.66377604", "text": "static async update(\n username,\n password,\n first_name,\n last_name,\n email,\n photo_url,\n is_admin\n ) {\n let hashedPassword = await bcrypt.hash(password, BCRYPT_WORK_ROUNDS);\n\n let queryObj = sqlForPartialUpdate(\n 'users',\n {\n username,\n password: hashedPassword,\n first_name,\n last_name,\n email,\n photo_url,\n is_admin\n },\n 'username',\n username\n );\n\n const result = await db.query(queryObj.query, queryObj.values);\n\n if (result.rows.length > 0) {\n return result.rows[0];\n } else {\n let err = new Error('Unable to find user');\n err.status = 404;\n throw err;\n }\n }", "title": "" }, { "docid": "8f127cbeffd10e9b7ee513b17367099d", "score": "0.6628006", "text": "function updateUser(userId, updatedUser){\n var deferred = q.defer();\n UserModel.update(\n {_id: userId},\n {firstName: updatedUser.firstName,\n lastName: updatedUser.lastName,\n username: updatedUser.username,\n password: updatedUser.password,\n emails: updatedUser.emails,\n phones: updatedUser.phones},\n function(err, doc){\n if (!err){\n deferred.resolve(doc);\n } else {\n deferred.reject(err);\n }\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "9959762250cf802aa30296194fb0b8f5", "score": "0.6620465", "text": "updateUser({\n params,\n body\n }, res) {\n User.findOneAndUpdate({\n _id: params.id\n }, body, {\n new: true\n })\n .then((dbUserData) => {\n if (!dbUserData) {\n res.status(404).json({\n message: 'No user found with this id!'\n });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "488a860fc26a6449dc348f7a10afde9c", "score": "0.6612852", "text": "updateProfile (req, res) {\n const body = req.body\n\n Models.User.findOneAndUpdate(\n { _id: body.userId },\n { $set: { ...body.data } },\n { useFindAndModify: false },\n err => res.json({ success: !err, newUserData: body.data })\n )\n }", "title": "" }, { "docid": "a68546a284c7e66834a7147c62316cf5", "score": "0.6604268", "text": "async update(req, res) {\n const { id, name, email, role } = req.body;\n\n if (isNaN(id)) {\n res.status(400).json({ error: 'ID deve ser um número.' });\n } else if (role && isNaN(role)) {\n res.status(400).json({ error: 'Role deve ser um número.' });\n } else {\n const result = await User.updateUser(id, name, email, role);\n\n if (result === true) res.sendStatus(200);\n else if (result === false)\n res.status(400).json({ error: 'E-mail já cadastrado.' });\n else if (result === undefined)\n res.status(404).json({ error: 'Nenhum usuário correspondente ao ID.' });\n else if (result === null)\n res.status(500).json({ error: 'Erro ao atualizar o usuário' });\n }\n }", "title": "" }, { "docid": "8c2a0390171f2fb58bced281dcfcdfc9", "score": "0.6594002", "text": "async updateUser(newUser) {\n return new Promise(async (resolve, reject) => {\n const { zprn, firstName, lastName, password, department, role } = newUser;\n try {\n const user = await User.findOne({ zprn: zprn });\n if (user == null) {\n return reject(new Error(\"BAD_REQUEST\", \"No user found\"));\n } else {\n user.firstName = firstName != undefined ? firstName : user.firstName;\n user.lastName = lastName != undefined ? lastName : user.lastName;\n user.password = password != undefined ? password : user.password;\n user.department =\n department != undefined ? department : user.department;\n user.role = role != undefined ? role : user.role;\n const result = await user.save();\n return resolve(result);\n }\n } catch (error) {\n return reject(error);\n }\n });\n }", "title": "" }, { "docid": "2707a4daa02994e3e10f23949ff09d71", "score": "0.6588949", "text": "function updateUser(user) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/users\",\n data: user\n })\n .then(function () {\n window.location.href = \"/\";\n });\n }", "title": "" }, { "docid": "ef3a36d4274642c23e193298cab83745", "score": "0.6588289", "text": "function updateUser(userId) {\n return {\n type: USER_P_UPDATE,\n userId,\n };\n}", "title": "" }, { "docid": "7892ae82c307695a2d7eaf7afe5c6ffb", "score": "0.6587922", "text": "function updateUser() {\n \n console.log(\"Update button clicked!\");\n \n // Create variable as shorter name for currently logged in user\n let currentUser = firebase.auth().currentUser;\n \n // If current user exists (user is now logged in), display their info and update the page accordingly\n if (currentUser) {\n \n // Create object for this user's data\n // (pulling values from input boxes and from Firebase user object)\n let newUserData = {\n displayName: displayNameElem.value,\n email: emailElem.value,\n photoURL: user.photoURL,\n favLanguage: favLanguageInput.value\n };\n \n // Save a reference object that represents the current user's location in our database\n let userIdRef = firebase.database().ref(\"users/\" + currentUser.uid);\n \n // Create or update this user's data in Firebase, and then\n // after that happens, run our function named finishUpdatingProfile\n userIdRef.set(newUserData, finishUpdatingProfile);\n \n }\n}", "title": "" }, { "docid": "7dbe451af4be07819e8b357f303b95b1", "score": "0.6587747", "text": "update(req, res) {\n const id = req.params.userId;\n UserProfile_1.default.findOneAndUpdate({ id }, req.body)\n .then((data) => {\n res.status(200).json({ data });\n })\n .catch((error) => {\n res.status(500).json({ error });\n });\n }", "title": "" }, { "docid": "c6a347150d83de2e838f5d8b584c8d94", "score": "0.6579359", "text": "function updateUser (auth, id, data) {\n let req = updateUserRequest('PUT', auth, id)\n req.data = JSON.stringify(data)\n return $.ajax(req)\n}", "title": "" }, { "docid": "2b7447c6d7e03bc9a95a839573b495fe", "score": "0.65762967", "text": "function update(req, res) {\n\tUser.findOneAndUpdate({email: req.params.email}, {name: req.body.name}, function(err, user) {\n\t\tif (err) throw err\n\t\tres.json(user)\n\t})\n}", "title": "" }, { "docid": "35001024501e4ff70eace7db38af905c", "score": "0.6564637", "text": "function updateUserById(id,username,password,email,age,school){\n return UserModel.updateOne({\n _id : id\n },{\n username : username,\n password : password,\n email : email,\n age : age,\n school : school\n })\n}", "title": "" }, { "docid": "b09f1a80edd5d17a1a59e8ffc9411145", "score": "0.6563816", "text": "function updateAuthenticatedUser(req, res) {\n /*\n find user by username provided in auth token, so that regular\n users can only update their own data\n */\n User.findOne({username: res.locals.username}, (err, user) => {\n if (err) {\n apiLogger.error(formatApiLogMessage(`Error finding user '${res.locals.username}': ${err}`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.ERROR).json({ message: CONSTANTS.RESPONSE_MESSAGES.INTERNAL_ERROR_MESSAGE });\n }\n\n if (user) {\n if(req.body.password) {\n if(!bcrypt.compareSync(req.body.currentPassword, user.password)) {\n apiLogger.info(formatApiLogMessage(`Invalid current password provided for password update for ${res.locals.username}`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.OK).json({\n message: CONSTANTS.RESPONSE_MESSAGES.INVALID_PASSWORD,\n errors: [ CONSTANTS.ERRORS.INVALID_PASSWORD ]\n });\n }\n else {\n delete req.body.currentPassword;\n }\n }\n\n Object.assign(user, req.body);\n user.save((err) => {\n if (err) {\n apiLogger.error(formatApiLogMessage(`Error updating user '${req.params.id}': ${err}`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.ERROR).json({ message: CONSTANTS.RESPONSE_MESSAGES.INTERNAL_ERROR_MESSAGE });\n }\n\n apiLogger.info(formatApiLogMessage(`user ${req.params.id} updated successfully`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.OK).json({ message: CONSTANTS.RESPONSE_MESSAGES.SUCCESS });\n });\n }\n else {\n apiLogger.info(formatApiLogMessage(`Could not find user '${req.params.id}'`, req));\n return res.status(CONSTANTS.HTTP_STATUS_CODES.OK).json({\n message: CONSTANTS.RESPONSE_MESSAGES.DATA_NOT_FOUND,\n errors: [ CONSTANTS.ERRORS.DATA_NOT_FOUND ]\n });\n }\n });\n}", "title": "" }, { "docid": "2e174fd0fcbc3ddf52d6402a020a8e4f", "score": "0.65625364", "text": "function updateUser(user) {\n const usernameTextArea = document.getElementById('usertextarea');\n const editUser = {\n method: 'PATCH',\n headers:\n {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Credentials': false,\n },\n body: JSON.stringify({\n id: user.id,\n name: usernameTextArea.value,\n }),\n };\n fetch(`http://127.0.0.1:3000/users/${user.id}`, editUser);\n // TODO - Fix user in list not updating until hard refresh of browser window\n fetchUsers();\n}", "title": "" }, { "docid": "3af8120d16f0f29de5e53c68359851e8", "score": "0.65481085", "text": "function updateUser(id, updatedUser) \n\t{\n\t\tvar deferred = q.defer();\n\t\t// update a user that matches the given id\n\t\tUserModel.update(\n\t\t\t{ _id : id},\n\t\t\t{\n\t\t\t\t// Update the user's name, username, password, and email\n\t\t\t\tfirstName: updatedUser.firstName,\n\t\t\t\tlastName: updatedUser.lastName,\n\t\t\t\tusername: updatedUser.username,\n\t\t\t\tpassword: updatedUser.password,\n\t\t\t\temail: updatedUser.email \n\t\t\t}, \n\t\t\tfunction(err, result)\n\t\t\t{\n\t\t\t\t// return the list of users\n\t\t\t\tUserModel.find(function(err, results)\n\t\t\t\t{\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn deferred.promise;\n\t}", "title": "" }, { "docid": "8d0bb95d99881b75bb8b9cf01cbd264f", "score": "0.6538608", "text": "function updateUser(user){\n user.firstName = $('#firstNameFld').val();\n user.lastName = $('#lastNameFld').val();\n user.username = $('#usernameFld').val();\n user.password = $('#passwordFld').val();\n user.role = $('#roleFld').val();\n user.email = $('#emailFld').val();\n user.phone = $('#phoneFld').val();\n user.dateOfBirth = $('#dateOfBirthFld').val();\n userService.updateUser(user, user.id, findAllUsers);\n alert('updated user');\n $('#firstNameFld').val('');\n $('#lastNameFld').val('');\n $('#usernameFld').val('');\n $('#passwordFld').val('');\n $('#roleFld').val('');\n $('#emailFld').val('');\n $('#phoenFld').val('');\n $('#dateOfBirthFld').val('');\n $('#updateUser').hide();\n $('#createUser').show();\n }", "title": "" }, { "docid": "275301a8a003c3aca3a099cf644b0da0", "score": "0.65372", "text": "async function updateUser(req, res) {\n return serviceUser.updateUser(req, res);\n}", "title": "" }, { "docid": "b14148c71536cd9ecf20593d55385b43", "score": "0.6527519", "text": "function updateUser(userId) {\n 'use strict';\n\n getUserData(userId);\n getUserRights(userId);\n}", "title": "" }, { "docid": "e38351d4b68f4beeb70ac3bea34409b3", "score": "0.6526501", "text": "function updateUser(params) {\n utils.requestStart()\n\n return $http({\n method: 'PUT',\n url: '/api/users/' + params.user_id,\n params: params\n }).then(function(data, status) {\n //replace the user profile photo if invalid\n utils.replaceInvalidImages(data.data, 'profile_photo_url')\n user = data.data\n return data.data\n })\n }", "title": "" }, { "docid": "d988ceeb12d6ebdae095eba5a27415b4", "score": "0.6503398", "text": "async updateUser(data) {\r\n\t\tconst { id } = this.props.match.params;\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: true,\r\n\t\t});\r\n\r\n\t\tthis.config.headers.Authorization = `Bearer ${this.state.token}`;\r\n\r\n\t\tconst response = await api.put(`/users/${id}?delay=2`, { data }, this.config)\r\n\t\t\t.then(resp => resp.data);\r\n\r\n\t\tthis.setState({ isLoading: false });\r\n\r\n\t\tif (response.updatedAt)\r\n\t\t\talert(\"User updated successfully\\n\\nFirst name: \" + response.data.first_name + \"\\nLast name: \" + response.data.last_name);\r\n\t\telse\r\n\t\t\talert(\"Error: Couldn't update user at this time. API may be down.\");\r\n\t}", "title": "" }, { "docid": "0cd5f3e3a2a6e078b1afdd64d3e5f868", "score": "0.6493919", "text": "function updateUser(email, password, first, last, address, address2, city, state, zip, phone, secQuestion, secAnswer) {\n console.log(\"the PUT was attempted\")\n console.log(JSON.stringify(userId));\n $.ajax({\n type:\"PUT\",\n url: \"/api/users/\" + userId,\n data: {\n email: email,\n password: password,\n first:first,\n last:last,\n address:address,\n address2:address2,\n city:city,\n state:state,\n zip:zip,\n phone:phone,\n secQuestion:secQuestion,\n secAnswer:secAnswer\n },\n datatype: 'application/json',\n success: function(result) {\n console.log(result);\n window.location.replace(result);\n },\n error: handleLoginErr\n });\n }", "title": "" }, { "docid": "3931c95832bc29cacde249ffd17d714b", "score": "0.6485925", "text": "async function updateCurrent(req, res, next) {\n const { _id } = req.user;\n const {\n first_name,\n last_name,\n nickname,\n bio,\n gender,\n age,\n location\n } = req.body;\n\n const updates = {\n first_name: first_name || req.user.first_name,\n last_name: last_name || req.user.last_name,\n nickname: nickname || req.user.nickname,\n bio: bio || req.user.bio,\n gender: gender || req.user.gender,\n age: age || req.user.age,\n location: location || req.user.location\n };\n\n try {\n const updatedUser = await UserModel.findByIdAndUpdate(_id, updates, {\n new: true\n });\n\n if (!updatedUser) {\n return next(new HTTPError(500, \"Unable to update profile\"));\n }\n\n res.status(200).json(updatedUser);\n } catch (error) {\n return next(new HTTPError(500, error.message));\n }\n}", "title": "" }, { "docid": "d283594507421fbb0f9a2e5009426c05", "score": "0.6473258", "text": "async updateAccount(event) {\n event.preventDefault();\n let updatedUser = {\n creatorId: 'test',\n username: this.state.username,\n name: this.state.name,\n password: this.state.password,\n location: this.state.location,\n bio: this.state.bio,\n pictureURL: this.state.pictureURL\n };\n try {\n const response = await axios.put(`${SERVICE_URL}/newUserRegistration/`, updatedUser);\n UserProfile.setUserObject(updatedUser);\n return \"updated!\";\n } catch(e) {\n alert('Encountered an error editing your profile.');\n return {};\n }\n }", "title": "" }, { "docid": "63d2512bf9af1ed037b1569cdf157a6e", "score": "0.6467352", "text": "function updateUser(userName, userData, SuccessCallback, ErrorCallback) {\n\tupdateUsers(userData, SuccessCallback, ErrorCallback, userName);\n}", "title": "" }, { "docid": "482f646609be84851fc11c182d322c06", "score": "0.6465173", "text": "function updateUserPassword(userId, password, cb) {\n\t\t// generate a salt\n\t\tbcrypt.genSalt(SALT_WORK_FACTOR, function(err, salt) {\n\t\t\tif (err) { logger.error(err); return cb(err, null); }\n\n\t\t\t// hash the password using our new salt\n\t\t\tbcrypt.hash(password, salt, function(err, hash) {\n\t\t\t\tif (err) { logger.error(err); return cb(err, null); }\n\n\t\t\t\tmodelUser.findByIdAndUpdate(userId, {password: hash}, { upsert: true, multi: false }, function (err, numberAffected, raw) {\n\t\t\t\t\tif (err) { logger.error(err); return cb(err, raw); }\n\t\t\t\t\telse { return cb(err, 'ok'); }\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "bc98288a685a16b8426a976a937487b9", "score": "0.6450961", "text": "function updateUserAcademic(req, res){\n var userId= req.params.id;\n var update= {identidad:req.body.identidad, idescuela:req.body.idescuela};\n\n\n User.findOneAndUpdate({_id:userId}, update,{new:true}, (err, userUpdated) =>{\n if(err) return res.status(505).send({message:'No tienes permiso para actualizar los datos del usuario',status:0});\n if(!userUpdated) return res.status(404).send({message:'No se ha podido actualizar el usuario',status:0});\n\n return res.status(200).send({user:userUpdated , status:1});\n });\n}", "title": "" }, { "docid": "a48263d90f5e6f9299dc2c734104f249", "score": "0.64362127", "text": "function Update() {\n User.updateOne(\n {_id: '5fd6193a98b98a0dc884804b'},\n {name: 'king kong'},\n err => {\n if (err) console.log(err);\n else console.log('successfully updated');\n }\n );\n}", "title": "" }, { "docid": "22b5feffc22982fc091af64cf9b56ccd", "score": "0.6435487", "text": "function updateUser(userid, email, forename, surname) {\n var user = readUser(userid);\n if (user.success) {\n // found the user, try to amend it\n if (typeof email == 'undefined' && typeof forename == 'undefined' && typeof surname == 'undefined') {\n data.success = false;\n data.user = \"nothing to update\";\n return data;\n } else {\n // at least one field need updating\n if (typeof email != 'undefined') {\n // update email field\n users[userid].email = email;\n }\n if (typeof forename != 'undefined') {\n // update forename field\n users[userid].forename = forename;\n }\n if (typeof surname != 'undefined') {\n // update surname field\n users[userid].surname = surname;\n }\n }\n }\n return readUser(userid);\n}", "title": "" } ]
ee72c22fd4d53c1f33802d87d53d7b29
Scale for the map view
[ { "docid": "ff369db84a20370323eaefc927312892", "score": "0.0", "text": "function scaleSelection_map(input, min, max){\n let scaleBubbles = d3.scaleLinear()\n .domain([min,max])\n .range([6,35]);\n\n return scaleBubbles(input);\n }", "title": "" } ]
[ { "docid": "9025e26e22036e2a73ee9efbaef5c682", "score": "0.81226563", "text": "setScale(scale) {\r\n const self = this;\r\n let result = scale * .0254 / self.getDpi(Cfg.screenSize);\r\n if (window.devicePixelRatio) {\r\n result = result / window.devicePixelRatio;\r\n }\r\n if (self.metersPerDegree) {\r\n result = result / self.metersPerDegree;\r\n }\r\n self.map.wrap.setResolution(result);\r\n return result;\r\n }", "title": "" }, { "docid": "1be04a83184ae99b3498efc4562f72ff", "score": "0.7921835", "text": "function map_scale(){\n var w = $(window).width();\n if (w > 1530) {\n scale = 0.67;\n } else if (w > 1115) {\n scale = 0.5;\n } else {\n scale = 0.33;\n }\n return scale;\n}", "title": "" }, { "docid": "913cfc9737bb07f4593bf866a06ca046", "score": "0.77295816", "text": "function scaleMap(){\n //caculate the map size\n var aRatio = levelPlan[0].length / levelPlan.length;\n var cWidth = document.documentElement.clientWidth; \n var cHeight = document.documentElement.clientHeight;\n var cRatio = cWidth / cHeight;\n\n if(aRatio > cRatio){\n scale = cWidth / levelPlan[0].length;\n }else{\n scale = cHeight / levelPlan.length;\n }\n\n var scaleRatio = scale / baseScale;\n document.body.style.fontSize = Math.floor(16 * scaleRatio) + \"px\";\n}", "title": "" }, { "docid": "989f48552e420255a462f78d973a2e0d", "score": "0.74979216", "text": "function setScale(scale) {\n var currentScale = scale;\n MapConfig.projection.scale(currentScale);\n\n}", "title": "" }, { "docid": "9fec9d056a8741f25fa7ab3bb24b9dfa", "score": "0.7392794", "text": "function MapScale( latitude, levelOfDetail, screenDpi)\n\t{\n\t\treturn GroundResolution(latitude, levelOfDetail) * screenDpi / 0.0254;\n\t}", "title": "" }, { "docid": "0ad2b623d7d761bab17568e114148400", "score": "0.7148747", "text": "_zoomIn(){\n // Go up by 10%, or to the nearest 10%, depending what the current level is.\n // E.g. 105% => 110%; and 120% => 130%\n if(Math.ceil(this._canvas.scale / .1) * .1 === this._canvas.scale){\n this._canvas.scale += .1;\n }\n else{\n this._canvas.scale = Math.ceil(this._canvas.scale / .1) * .1;\n }\n\n this._updateZoomAmt();\n }", "title": "" }, { "docid": "9b3c3dd0023274ddb6cf7611ec15a96d", "score": "0.7143392", "text": "function setViewScale() {\n var scaleX = viewWidthCurrent / viewWidth;\n var scaleY = viewHeightCurrent / viewHeight;\n viewHeightCurrent = viewHeight;\n viewWidthCurrent = viewWidth;\n getCanvas().scaleCanvas({scaleX: scaleX, scaleY: scaleY, x: viewX, y: viewY});\n}", "title": "" }, { "docid": "d58a020fd1ef68062f4ff0bb35da3dde", "score": "0.7130118", "text": "function sizeChange() {\n let container = document.getElementById(\"world_map\");\n d3.select(\"#map_container\").attr(\"height\", container.clientWidth * 0.450);\n d3.select(\"#map\")\n .attr(\"transform\", \"scale(\" + (container.clientWidth / 1010) + \")\");\n}", "title": "" }, { "docid": "5ee6d7ae8d61af32bbc10dd27d0b0bd8", "score": "0.7112468", "text": "scale() {\n this.p.scale(this._scaleFactor);\n }", "title": "" }, { "docid": "5ee6d7ae8d61af32bbc10dd27d0b0bd8", "score": "0.7112468", "text": "scale() {\n this.p.scale(this._scaleFactor);\n }", "title": "" }, { "docid": "cc8a434b190d42abfc695ef145195ce6", "score": "0.7107324", "text": "function sizeChange() {\n d3.select('g')\n .attr('transform', 'scale(' + $('.map-demo').width() / 900 + ')');\n\n $('svg').height($('.map-demo').width() * 0.618);\n}", "title": "" }, { "docid": "f88f6886a64e94c2abca05ca34e2eb53", "score": "0.7089169", "text": "function resize() {\n\n var mapratio= parseInt(d3.select(tag_id).style('width'));\n\n if (width > 8*height) {\n mapratio = width /5;\n } else if (width > 6*height) {\n mapratio = width /4;\n } else if(width>4*height){\n mapratio = width /3;\n } else if(width> 2*height){\n mapratio = width/2;\n } else if(width >= height){\n mapratio = width;\n }\n\n projection.scale([mapratio]).translate([width/2,height/2]);\n }", "title": "" }, { "docid": "7d74da9901c3b8ecbc6fc1f037620f76", "score": "0.69779664", "text": "function gScale(sx,sy,sz) {\r\n modelViewMatrix = mult(modelViewMatrix,scale(sx,sy,sz)) ;\r\n}", "title": "" }, { "docid": "d26935cf55876d2ba07d3cb771db434c", "score": "0.69046813", "text": "onTransformScaling() {\n const scale = this.getClosestScaleToFitExtentFeature();\n this.setScale(scale);\n }", "title": "" }, { "docid": "03a9974d8f69a0b1fbaeecefb718c455", "score": "0.6885546", "text": "function adjustScale() {\n\t$(\"#content\").width(originalContentWidth * scale);\n\t$(\"#hoverHelp\").width(originalMapWidth * scale);\n\t$(\"#map\").width(originalMapWidth * scale);\n\t$(\"#map\").height(originalMapHeight * scale);\n\t$(\"#scalingGroup\").attr(\"transform\", \"scale(\" + scale + \")\");\n}", "title": "" }, { "docid": "8acba17e02a5cbdf71bcc044dd3f286c", "score": "0.6859095", "text": "setZoomScale(scale_zoom){\n this.scale_zoom = scale_zoom;\n }", "title": "" }, { "docid": "200e270b6bf7570daf39608cbab7af88", "score": "0.6858743", "text": "function setMapSize(){\n\tvar w = 750;\n\tvar h = 520;\n\tvar ratio = w/h;\n\tvar wEcran = document.body.clientWidth;\n\tvar hEcran = document.body.clientHeight;\n\tif(wEcran < ratio * hEcran){\n\t\tnewW = wEcran;\n\t\tnewH = wEcran/ratio;\n\t}\n\telse{\n\t\tnewW = hEcran * ratio;\n\t\tnewH = hEcran;\n\t}\n\tdocument.getElementById(\"map-svg\").style.width = newW;\n\tdocument.getElementById(\"map-svg\").style.height = newH;\n}", "title": "" }, { "docid": "e912789378f0cfebbad9b653fb3235d7", "score": "0.68124264", "text": "function zoom() {\n map_svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n}", "title": "" }, { "docid": "7d2a914ac008fc8f469acea240673ae2", "score": "0.680916", "text": "scale() {\n return {\n x: this.size.width / this.maxValues.x,\n y: this.size.height / this.maxValues.y,\n };\n }", "title": "" }, { "docid": "ac21ad31822feffcc607a86f839306a4", "score": "0.6803716", "text": "function resize() {\n map_width = sky_map.width();\n map_height = sky_map.height();\n font_height = map_height / 25;\n axis_size.x = map_width / 20;\n var x = sky_map.css('font-size', font_height).measureText({\n text: '888888'\n });\n if (x.width > axis_size.x) {\n font_height = font_height * axis_size.x / x.width;\n x = sky_map.css('font-size', font_height).measureText({\n text: '888888'\n });\n }\n axis_size.x = x.width;\n axis_size.y = x.height * 5 / 4;\n font_height = x.height;\n }", "title": "" }, { "docid": "bb7af811f89e18dae64e1156ad4804e5", "score": "0.67379385", "text": "function getNewScale(zoom) {\n if(zoom >= 0 && zoom <= 8)\n return new google.maps.Size(2, 2);\n else if(zoom >=9 & zoom <=14)\n return new google.maps.Size(5, 5);\n else\n return new google.maps.Size(7, 7);\n}", "title": "" }, { "docid": "0326f39923512e0dc45d8f118068b4f5", "score": "0.6736376", "text": "function map_scaler(geojson) {\n\tvar path_bounds = path.bounds(geojson),\n\t\t\t\t\t\tscale = 1/ Math.max(\n\t\t\t\t\t\t\t(path_bounds[1][0] - path_bounds[0][0]) / w,\n\t\t\t\t\t\t\t(path_bounds[1][1] - path_bounds[0][1]) / h\n\t\t\t\t\t\t);\n\tvar feature_bounds = d3.geoBounds(geojson),\n\t\t\t\t\t\t\tcenter = [\n\t\t\t\t\t\t\t\t(feature_bounds[1][0] + feature_bounds[0][0]) / 2,\n\t\t\t\t\t\t\t\t(feature_bounds[1][1] + feature_bounds[0][1]) / 2\n\t\t\t\t\t\t\t];\n\treturn {\n\t\t'scale' : scale,\n\t\t'center': center\n\t};\n\n}", "title": "" }, { "docid": "9cb5b43764a0be03957ebc01970e8dbf", "score": "0.67315", "text": "function zoom(event) {\n event.preventDefault();\n \n scale += event.deltaY * -0.01;\n \n // Restrict scale\n scale = Math.min(Math.max(.15, scale), 4);\n \n // Apply scale transform\n el.style.transform = `scale(${scale})`;\n}", "title": "" }, { "docid": "ab31e1b9beffcd7acc505cc13b0bf329", "score": "0.6711388", "text": "function setCurrentScale() {\n\t\tFloorPlanService.currentScale = $(FloorPlanService.panzoomSelector).panzoom(\"getMatrix\")[0];\n\t}", "title": "" }, { "docid": "e5a0c5db07c3d4e9662cac75c0bfa532", "score": "0.66933393", "text": "function zoomIt() {\n if (d3.event) {\n state.scale = d3.event.transform.k; //----- scale --> state\n projections[state.projection].scale(state.scale);\n if (state.projection == 'mercator') containPan(); // keep translate within boundaries\n updateMap();\n }\n }", "title": "" }, { "docid": "adca4906dffceb556847bb589cdbb6d2", "score": "0.6689005", "text": "function getScale(bounds) {\n\t return Math.min(\n\t scale0 * geoWidth / (bounds[1][0] - bounds[0][0]),\n\t scale0 * geoHeight / (bounds[1][1] - bounds[0][1])\n\t );\n\t }", "title": "" }, { "docid": "300984ff6084377d4cc54157e5c6d0ba", "score": "0.6680984", "text": "function zoomed () {\n // Get the height and width\n height = el.clientHeight\n width = el.clientWidth\n\n // Set the map tile size\n tile.size([width, height])\n\n // Get the current display bounds\n var bounds = display.llBounds()\n\n // Project the bounds based on the current projection\n var psw = projection(bounds[0])\n var pne = projection(bounds[1])\n\n // Based the new scale and translation vector off the current one\n var scale = projection.scale() * 2 * Math.PI\n var translate = projection.translate()\n\n var dx = pne[0] - psw[0]\n var dy = pne[1] - psw[1]\n\n scale = scale * (1 / Math.max(dx / width, dy / height))\n projection\n .translate([width / 2, height / 2])\n .scale(scale / 2 / Math.PI)\n\n // Reproject the bounds based on the new scale and translation vector\n psw = projection(bounds[0])\n pne = projection(bounds[1])\n var x = (psw[0] + pne[0]) / 2\n var y = (psw[1] + pne[1]) / 2\n translate = [width - x, height - y]\n\n // Update the Geo tiles\n tile\n .scale(scale)\n .translate(translate)\n\n // Get the new set of tiles and render\n renderTiles(tile())\n }", "title": "" }, { "docid": "dc0eb9314609ee49fcf5064cc2096598", "score": "0.6680188", "text": "function setSizes() {\n if (!currentMap) return;\n\n const viewMaxWidth = canvasElement.width - dpi(40);\n const viewMaxHeight = canvasElement.height - dpi(40);\n const tileWidth = Math.floor(viewMaxWidth / currentMap.cols);\n const tileHeight = Math.floor(viewMaxHeight / currentMap.rows);\n\n tileSize = Math.min(tileWidth, tileHeight);\n viewWidth = tileSize * currentMap.cols;\n viewHeight = tileSize * currentMap.rows;\n viewX = (canvasElement.width - viewWidth) / 2;\n viewY = (canvasElement.height - viewHeight) / 2;\n}", "title": "" }, { "docid": "e56f750d07bac5a4cd7fbdf9fbf40e2c", "score": "0.66741025", "text": "updateScale() {\n this.scale = Math.min(1.*height/treeHeight, 1.*width/(rightBound-leftBound));\n this.x = width/2. - (rightBound+leftBound)/2.*this.scale;\n this.y = 0;\n }", "title": "" }, { "docid": "03a27bb062105c5351b446877b216dab", "score": "0.6671211", "text": "function sizeMap(idMap) {\n if ($(\"#\" + idMap).width() > 460) {\n initzoom = 5.75;\n $(\"#\" + idMap).height(500);\n } else {\n initzoom = 5;\n $(\"#\" + idMap).height(370);\n }\n\n ;\n}", "title": "" }, { "docid": "649151f3065c1567a21d15a8d9a812e2", "score": "0.6657411", "text": "function zoom(event) {\n event.preventDefault();\n\n scale += event.deltaY * -0.01;\n\n // Restrict scale\n scale = Math.min(Math.max(0.125, scale), 3);\n\n // Apply scale transform\n el.style.transform = `scale(${scale})`;\n}", "title": "" }, { "docid": "701388183d213c958bffe4686e8cbb4d", "score": "0.6645494", "text": "function initScale() {\n var map = RAMP.map,\n scaleDiv = domConstruct.create(\"div\", {\n id: \"scaleDiv\",\n class: \"esriScalebarLabel\"\n }),\n currentScale,\n scaleLabelText;\n\n $(scaleDiv).html(\"<span>\" + i18n.t('map.scale') + \"</span><br><span id='scaleLabel'><span/>\");\n currentScale = number.format(map.getScale());\n scaleLabelText = \"1 : \" + currentScale;\n\n domConstruct.place(scaleDiv, query(\".esriScalebarRuler\")[0], \"before\");\n domConstruct.empty('scaleLabel');\n $(\"#scaleLabel\").text(scaleLabelText);\n\n // Change the css class of the scale bar so it shows up against\n // the map\n topic.subscribe(EventManager.BasemapSelector.BASEMAP_CHANGED, function (attr) {\n $(\".esriScalebar > div\").removeClass().addClass(attr.cssStyle);\n });\n }", "title": "" }, { "docid": "b8a4d64e781eb4f1368c2c4be975a4e0", "score": "0.66298145", "text": "zoom(zoomFactor) {\n let self = this;\n this.zoomFactor = zoomFactor;\n this.pointSprites.forEach(function(val/*, indx, array*/) {\n val.scale = {\n x: val.pointSize/(zoomFactor * self.spriteDrawingScale),\n y: val.pointSize/(zoomFactor * self.spriteDrawingScale)\n };\n });\n }", "title": "" }, { "docid": "e7e4edc4692716acb6b17ef35ef2048b", "score": "0.6624969", "text": "function zoomCamera() {\n\tvar factor;\n\n\tif ( state === STATE.ZOOM ) {\n\t\tfactor = touchZoomDistanceEnd / touchZoomDistanceStart;\n\t\ttouchZoomDistanceStart = touchZoomDistanceEnd;\n\t\tmap.scale.x *= factor;\n\t\tmap.scale.y *= factor;\n\t\tmap.scale.z *= factor;\n\t} else {\n\t\tfactor = 1.0 + (zoomEnd.y - zoomStart.y) * zoomSpeed;\n\n\t\tif ( factor !== 1.0 && factor > 0.0 ) {\n\t\t\tmap.scale.x *=factor;\n\t\t\tmap.scale.y *= factor;\n\t\t\tmap.scale.z *= factor;\n\t\t\tif ( staticMoving ) {\n\t\t\t\tzoomStart.copy( zoomEnd );\n\t\t\t} else {\n\t\t\t\tzoomStart.y += ( zoomEnd.y - zoomStart.y ) * this.dynamicDampingFactor;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c541b6a60ed67c47e25151688c45619e", "score": "0.66245484", "text": "_zoomOut(){\n // Go down by 10%, or to the nearest 10%, depending what the current level is.\n // E.g. 105% => 100%; and 120% => 110%\n if(Math.floor(this._canvas.scale / .1) * .1 === this._canvas.scale){\n this._canvas.scale = Math.max(0.1, this._canvas.scale - 0.1);\n }\n else{\n this._canvas.scale = Math.floor(this._canvas.scale / .1) * .1;\n }\n\n this._updateZoomAmt();\n }", "title": "" }, { "docid": "5ae75e476dcc276b85cef22ed2cf3afe", "score": "0.65999305", "text": "function radiusScale(r) {\n return r*Math.pow(2, (map.getZoom()/2));\n}", "title": "" }, { "docid": "7ec9816100cb11bd00f6b1c005eb90fc", "score": "0.6593872", "text": "get scale() { return this._scale; }", "title": "" }, { "docid": "7ec9816100cb11bd00f6b1c005eb90fc", "score": "0.6593872", "text": "get scale() { return this._scale; }", "title": "" }, { "docid": "c45c74d09c337828a82dff7a7a4b2aa9", "score": "0.65845805", "text": "function Map(props) {\n return (\n\n <div\n style={{\n position: 'relative',\n top: '20',\n left: '0',\n width: '1600px', // =====NEW \n height: '840px', // =====NEW \n // transform: scale(0.5, 0.5),\n // backgroundColor: 'green',\n border: '4px solid white',\n }}\n >\n {\n props.tiles.map(row => <MapRow tiles={row} />)\n }\n\n </div>\n\n )\n}", "title": "" }, { "docid": "e4abae5d749b3e9232c6545ce9c0e3e2", "score": "0.6581111", "text": "function images_update_zoom(e) {\n\tvar dir = e.deltaY > 0 ? 1 : -1;\n\tzoom = Math.max(0, Math.min(1, zoom - (dir * ZOOM_SPEED)));\n\timages_update_all();\n\n\tscale = zoom * ZOOM_SCALE;\n\tworld.style[\"left\"] = (-scale * 100 / 2) + \"%\";\n\tworld.style[\"top\"] = (-scale * 100 / 2) + \"%\";\n\tworld.style[\"width\"] = ((1 + scale) * 100) + \"%\";\n\tworld.style[\"height\"] = ((1 + scale) * 100) + \"%\";\n}", "title": "" }, { "docid": "5ac366784a70aadb69b8d1799c8bf558", "score": "0.65744305", "text": "function addScaleBox(){\n\tscale = L.control.scale().addTo(map);\n}", "title": "" }, { "docid": "52462af3fcc887dfec2f591678f97c61", "score": "0.6552676", "text": "setCustomMapZoom(value) {\n this.map.setZoom(value);\n }", "title": "" }, { "docid": "de96b3464f1baf2835ad5cd808f1aa7f", "score": "0.6551955", "text": "function scale_fun(e)\n {\n //getting physical and screen coordinates of the point\n var p_screen = get_mouse_pos(e);\n var p_physical = instance.screen_to_physical(p_screen);\n\n //check for detail so Opera uses that instead of wheelDelta\n var delta = e.wheelDelta ? e.wheelDelta : -e.detail * 120;\n var d_scale = delta / 1000;\n var new_scale = scale_processor(cur_scale, d_scale);\n cur_scale = new_scale;\n x0 = p_screen.x - p_physical.x * new_scale.x;\n y0 = p_screen.y + p_physical.y * new_scale.y;\n instance.draw();\n }", "title": "" }, { "docid": "7eec6f199af7470a7f5423a2ccdb5743", "score": "0.6549343", "text": "get scale() {\n\t\treturn {\n\t\t\tx: this.dimens.x/this.width,\n\t\t\ty: this.dimens.y/this.height,\n\t\t};\n\t}", "title": "" }, { "docid": "da1467a48f43c0d73de40da78a28e136", "score": "0.65241635", "text": "function scaleSize_map(input){ \n let my_scaleSize_map = d3.scalePow() \n .exponent(.2) // Smaller = bigger\n .domain([1, d3.max(dataset_updated.map(d => d.Speakers))])\n .range([1,30])\n .nice()\n return my_scaleSize_map(input)\n }", "title": "" }, { "docid": "c2c3940750ba05be82b343f9975db617", "score": "0.65198284", "text": "function zoom() {\n scale = d3.event.scale;\n d3.event.translate[0]+=svg_position.x0*d3.event.scale;\n d3.event.translate[1]+=svg_position.y0*d3.event.scale;\n svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n chart();\n }", "title": "" }, { "docid": "09e8b56e11077e1d7bf08e9ebb3c0a62", "score": "0.6519096", "text": "getZoomMult(){\n return this.state.distance * this.scale_zoom;\n }", "title": "" }, { "docid": "5475045219a72b8465338c8d5a8e1977", "score": "0.64904416", "text": "function zoomed() {\n graphContainer.attr(\"transform\", \"translate(\" + viewCenter.x + \",\" + viewCenter.y + \")scale(\" + viewZoom + \")\");\n menuG.selectAll('g.contextmenu-slice').attr('transform', 'scale(' + 1 / viewZoom + ')');\n }", "title": "" }, { "docid": "3db34b1161361015bd97ff2f441bbcc3", "score": "0.6486069", "text": "function redraw_map(old_scale){\n\t\n\t\t// stash away some values for later\n\t\tvar viewport = $('#walk_map_frame');\n\t\tvar old_view_height = viewport.height();\n\t\tvar old_view_width = viewport.width();\n\t\tvar offset_x = viewport.scrollLeft();\n\t\tvar offset_y = viewport.scrollTop();\n\t\t\n\t\t// rescale the image\n\t\tvar map = $('#walk_map_image img');\n\t\tvar widthStr = String(Math.round(m_scale * m_image_width)) + \"px\";\n\t\tvar heightStr = String(Math.round(m_scale * m_image_height)) + \"px\";\n\t\tmap.css(\"width\", widthStr);\n\t\tmap.css(\"height\", heightStr);\n\t\t\n\t\t// keep the image centered if we can\n\t\tif (old_scale) {\n\t\t\tvar new_view_height = viewport.height();\n\t\t\tvar new_view_width = viewport.width();\n\t\t\tvar center_x = (offset_x + old_view_width/2)/old_scale;\n\t\t\tvar center_y = (offset_y + old_view_height/2)/old_scale;\n\t\t\t\n\t\t\tvar new_offset_x = (m_scale*center_x) - new_view_width/2;\n\t\t\tvar new_offset_y = (m_scale*center_y) - new_view_height/2;\n\t\t\t\n\t\t\tif (new_offset_x > 0) {\n\t\t\t\tviewport.scrollLeft(new_offset_x);\n\t\t\t}\n\t\t\t\n\t\t\tif (new_offset_y > 0) {\n\t\t\t\tviewport.scrollTop(new_offset_y);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// rescale the route overlay if it exists\n\t\tvar route = $('#walk_map_route_overlay img');\n\t\tif (route) {\n\t\t\troute.css(\"width\", widthStr);\n\t\t\troute.css(\"height\", heightStr);\n\t\t}\n\t\t\n\t\t// place the POIs appropriately.\n\t\tredraw_POIs();\n\t\t\n\t\tcontrol_enable(\"scale_down\", m_scale > m_scale_min);\n\t\tcontrol_enable(\"scale_up\", m_scale < SCALE_MAX);\n\t}", "title": "" }, { "docid": "79070c1a045cebd5817d376d6a0be7d4", "score": "0.6480156", "text": "zoom(level) {\n this.dynamics.zoom.setValue(level);\n }", "title": "" }, { "docid": "a21ed24a4e2728d490ef4ca22b8305b7", "score": "0.64752865", "text": "function setScale() {\n MiddleLaneMesh.scale.set( scale, scale, scale );\n LeftLaneMesh.scale.set( scale, scale, scale );\n RightLaneMesh.scale.set(scale, scale, scale);\n}", "title": "" }, { "docid": "7a931b3bee3fe602c9bdd99c46664220", "score": "0.64740103", "text": "function zoom() {\n svgGroup.attr(\"transform\",\n `translate(${d3.event.translate})scale(${d3.event.scale})`);\n renderScaleBar(d3.event.scale)\n }", "title": "" }, { "docid": "6063d56c464b39850b9355e9e9980bb2", "score": "0.64710623", "text": "function resizeMap(d, properties) {\n g.transition()\n .duration(250)\n .attr(\"transform\", \"translate(\" + o.width / 2 + \",\" + o.height / 2 + \")scale(\" + k + \")translate(\" + -x + \",\" + -y + \")\");\n o.eventHandlers.onRescale(g, k, l);\n }", "title": "" }, { "docid": "adab0142c46d6358f465f00f35065d00", "score": "0.6469437", "text": "function setMapWidth()\n {\n }", "title": "" }, { "docid": "974c90ab5da216bc0e4c6fc20ae4f67b", "score": "0.64668506", "text": "get scale() { return (this.myscale.x + this.myscale.y)/2;}", "title": "" }, { "docid": "27cbbf92dd13b24dde31fa2ad982f9ee", "score": "0.64667255", "text": "function zoomIn() {\n\tscale += 0.2; // Uvecavamo tekuci zoom nivo za 0.2.\n\tsetScale(); // Kako smo promenili vrednost \"scale\" promenljive, potrebno je pozvati \"setScale\" da bi se ta nova vrednost integrisala u CSS.\n}", "title": "" }, { "docid": "27b9bf8b6f3b680d54e5b57596e9ee8f", "score": "0.6448592", "text": "updateZoom(zoom) {\n // Zoom ranges from 0 - 100, so scales from 1x - 2x\n this.setState({\n scale: 1 + (zoom * 0.01),\n });\n }", "title": "" }, { "docid": "513b98608491283a348c5f1139e85781", "score": "0.6435074", "text": "function zoomZoom() {\n var transform = d3.event.transform;\n scaleFactor = transform.k\n \n mapFeatures.attr('transform',transform)\n\t.style('stroke-width', 0.5/scaleFactor);\n \n mapSchools.attr('transform',transform);\n \n mapVoronoi.attr('transform',transform)\n\t.style('stroke-width',0.5/scaleFactor);\n \n mapSchools.selectAll('circle')\n\t.attr('r',function(){return closeScale(this,1)});\n\n mapSimilar.attr('transform',transform)\n\t.style('stroke-width',0.5/scaleFactor);\n}", "title": "" }, { "docid": "696472c816950215cfd33b055051870a", "score": "0.64331365", "text": "set scale(newscale)\n\t{\n\t\tthis.myscale.x = newscale;\n\t\tthis.myscale.y = newscale;\n\n\t\tthis.container.style.transform = \"scale(\" + newscale + \",\" + newscale + \")\";\n \n\t\t//get width and height metrics\n\t\tthis.size.x = this.container.getBoundingClientRect().width;\n this.size.y = this.container.getBoundingClientRect().height;\n\n\t\t//adjust z order based on scale\n\t\tthis.container.style.zIndex = (100 * newscale).toString();\n\t}", "title": "" }, { "docid": "516354f50101c8e21bb1767811e5ad89", "score": "0.64014345", "text": "function zoom() {\n if (eventService.getUIMode() == \"manipulate\")\n {\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update positions\n }\n }", "title": "" }, { "docid": "a3596f6318623717bcc0e3ff9b580a78", "score": "0.64005524", "text": "function zoomOut()\n{\n\tscale *= 2;\n\tdraw();\n}", "title": "" }, { "docid": "c231bd18a19dab47a46e917a1eac7782", "score": "0.6397959", "text": "function zoomed() {\n d3.select(\"#mapa-shape\").style(\"stroke-width\", 1.5 / d3.event.scale + \"px\");\n d3.select(\"#mapa-shape\").attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "249911515cb8a1f277898faaed1263be", "score": "0.6397927", "text": "function zoom_in () {\n this.zoom_by(1.5)\n}", "title": "" }, { "docid": "e9fa81a03fe40cd1e2e353e382afbf5f", "score": "0.63949347", "text": "zoom_fac() {\n \n }", "title": "" }, { "docid": "367ff8ee25b911477b601e8944b93618", "score": "0.6393651", "text": "function changeStrokeScale(){\n AnnotationsService.changeStrokeScale(vm.strokeScale);\n }", "title": "" }, { "docid": "013c1db0acfca21c0f746b58c2257658", "score": "0.6393631", "text": "function gScale(sx,sy,sz) {\n modelMatrix = mult(modelMatrix,scale(sx,sy,sz)) ;\n}", "title": "" }, { "docid": "66da616425a5fb9f0650e97c04d28230", "score": "0.63745546", "text": "function scale() {\n\t\t\t\t$timeout(function() {\n\t\t\t\t\tsvgContainer.select('g').attr('transform', \n\t\t\t\t\t\t\"scale(\"+\n\t\t\t\t\t\t\t(scaleWidth ? (parent.width()/scope.width) : '1')+\n\t\t\t\t\t\t\",\"+\n\t\t\t\t\t\t\t(scaleHeight ? (parent.height()/scope.height) : '1')+\n\t\t\t\t\t\t\")\"\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "15e8b69fe13b60489e923cb382583b4a", "score": "0.6368388", "text": "scaleBounds() {\n var zoom = this.magnificationToZoom(this._magnification);\n var factor = Math.pow(2, zoom - this.areaElement.maxZoom);\n var scaleWidth = Math.round(factor * this.areaElement.width);\n var scaleHeight = Math.round(factor * this.areaElement.height);\n return {width: scaleWidth, height: scaleHeight};\n }", "title": "" }, { "docid": "ad1ec12165ad4018ec10552d9f2e5bca", "score": "0.63595736", "text": "function getScale({ width, height, zoomMargin }) {\n const scaleX = window.innerWidth / (width + zoomMargin)\n const scaleY = window.innerHeight / (height + zoomMargin)\n return Math.min(scaleX, scaleY)\n}", "title": "" }, { "docid": "2df933721d05972f373a6fe32d51e98d", "score": "0.63499093", "text": "function onChangeScale(value) {\n scale = value;\n }", "title": "" }, { "docid": "6cf5a98bd611a4c45fe2d0b13a3f7235", "score": "0.6348694", "text": "function zoomMap() {\n for (var i = 0; i < mapData.length; i++) {\n mapData[i].attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }\n}", "title": "" }, { "docid": "74c0b06910a0dbe20aa7a2479ca857a3", "score": "0.6345878", "text": "function zoomToCountry(e) {\n myMap.fitBounds(e.target.getBounds());\n }", "title": "" }, { "docid": "b561432fb996ad32c03a4b979456ad9f", "score": "0.63405454", "text": "scale(scale) {\n return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);\n }", "title": "" }, { "docid": "91d10614522f0bdc4567898e48e56850", "score": "0.63353807", "text": "function updateZoom(){\n size = [100, 200, 400][zoomLevel - 1];\n setMarkers();\n updateMapCenter();\n $mapcanvas.css({ '-webkit-transform': '' });\n // Now that the viewport has changed, load any new tiles we need.\n loadVisibleTiles();\n $('.map-tile').each(function(){\n setTile($(this), false);\n });\n }", "title": "" }, { "docid": "a8bc5d6e360cdee4668f0de73071537c", "score": "0.6329112", "text": "function change_scale_position(val) {\n switch(val) {\n case \"BOTTOM\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.BOTTOM}});\n break;\n case \"BOTTOM_LEFT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.BOTTOM_LEFT}});\n break;\n case \"BOTTOM_RIGHT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.BOTTOM_RIGHT}});\n break;\n case \"TOP\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.TOP}});\n break;\n case \"TOP_LEFT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.TOP_LEFT}});\n break;\n case \"TOP_RIGHT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT}});\n break;\n case \"LEFT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.LEFT}});\n break;\n case \"RIGHT\":\n map.setOptions({scaleControlOptions:{position:google.maps.ControlPosition.RIGHT}});\n break;\n }\n }", "title": "" }, { "docid": "4a8bdf9312368fbfcd469ffe6f124aed", "score": "0.6328933", "text": "function scaledMarker(magnitude) {\n return magnitude * 4;\n }", "title": "" }, { "docid": "5e9ba72ce5fc70300fdec99286448d27", "score": "0.63211584", "text": "_onChange() {\n\t\tthis.scale = this._steps[this._step];\n\t\t\n\t\tdocument.getElementById('zoomValue').innerText = Math.round(this.scale * 100) + '%';\n\t\tdocument.getElementById('graph').setAttribute('transform', 'scale(' + this.scale + ')');\n\n\t\t// TODO: zoom to mouse position / center\n\n\t\tapp.redrawEdges();\n\t}", "title": "" }, { "docid": "1aa28fbd9f3df2f2916718406bf5eb78", "score": "0.63139963", "text": "function zoom() {\n scaleFactor = d3.event.scale;\n translation = d3.event.translate;\n tick(); //update position\n }", "title": "" }, { "docid": "9a5312fd282095ce49a05d6d7aa113a8", "score": "0.6308129", "text": "set forceScale(value) {}", "title": "" }, { "docid": "84064dc5a5fbd6c2aeca22994885ae2f", "score": "0.6307076", "text": "function referenceScaleFactor() {\n\t\t//var h = ProjectionFactory.halfCentralMeridianLengthOfSmallScaleProjection(proj);\n\t\tvar graticuleHeight = 2 * 1.5;\n\t\t// FIXME ProjectionFactory.HALF_SMALL_SCALE_GRATICULE_HEIGHT;\n\t\tvar vScale = canvas.height / graticuleHeight;\n\t\treturn vScale;\n\t}", "title": "" }, { "docid": "2182ad3b75f33cedce7f078041c250d5", "score": "0.63070166", "text": "function resizeMapParameters(d) {\n centroid = path.centroid(d);\n var bounds = path.bounds(d);\n var newWidth = 2 * Math.max(Math.abs(centroid[0] - bounds[0][0]), Math.abs(centroid[0] - bounds[1][0]));\n var newHeight = 2 * Math.max(Math.abs(centroid[1] - bounds[0][1]), Math.abs(centroid[1] - bounds[1][1]));\n k = lvl().smoothScaleMultiple(Math.min(o.width / (newWidth * 1.0), o.height / (newHeight * 1.0)), o.scale);\n x = centroid[0];\n y = centroid[1];\n centered = d;\n }", "title": "" }, { "docid": "a1ee56f1014501f27144bbcaa133b232", "score": "0.63067067", "text": "getScaledDimensions() {\n\t\treturn {\n\t\t\tw: this.#renderer.domElement.clientWidth / this.#zoom.value, \n\t\t\th: this.#renderer.domElement.clientHeight / this.#zoom.value\n\t\t};\n\t}", "title": "" }, { "docid": "16031756599bfe60d682280b63585b1e", "score": "0.6294965", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "0ab269a98d785e41d8740c613b304806", "score": "0.6290128", "text": "setPanScale(scale_pan){\n this.scale_pan = scale_pan;\n }", "title": "" }, { "docid": "40d2c5eb95c9eff77ec7fbc31c284f67", "score": "0.62826115", "text": "function mScale() {\n scale(...[...arguments]);\n mPage.scale(...[...arguments]);\n}", "title": "" }, { "docid": "2f30a6cf3a8742e3b312982420a88767", "score": "0.6280633", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "e0e5a98b13bb6c74cb5c80599b723297", "score": "0.62780684", "text": "function movemap() {\r\n var t = d3.event.translate;\r\n var s = Math.pow(d3.event.scale,1);\r\n// var s = Math.pow(d3.event.scale,1);\r\n// var zscale = Math.sqrt(s);\r\n var h = height / 4;\r\n\t\r\n//\tt[0] = \r\n \r\n// t[0] = Math.min(width / height * (s - 1), Math.max(width * (1 - s), t[0]));\r\n// t[1] = Math.min(h * (s - 1) + h * s, Math.max(height * (1 - s) - h * s, t[1]));\r\n \r\n//\t new_translate[0] = zoom_cp[0] - (zoom_cp[0] - prev_translate[0]) * new_scale / prev_scale;\r\n// new_translate[1] = zoom_cp[1] - (zoom_cp[1] - prev_translate[1]) * new_scale / prev_scale;\r\n\t\r\n// zoommap.translate(t);\r\n// g.attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\r\n //g2.attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\r\n\r\n//\t t[0] = Math.min(width / height * (s - 1), Math.max(width * (1 - s), t[0]));\r\n// t[1] = Math.min(h * (s - 1) + h * s, Math.max(height * (1 - s) - h * s, t[1]));\r\n \r\n// zoommap.translate(t);\r\n mapg0.attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\r\n\t\r\n // adjust the country-region border stroke width based on zoom level\r\n\t\r\n/*\t\r\n\tif (document.getElementById('drawregbordercheck').checked == true) {\r\n\tmapg0.selectAll(\".subunit2\").style(\"stroke\", \"white\");\r\n\tmapg0.selectAll(\".subunit2\").style(\"stroke-width\", bordersize_reg );\r\n\t}\r\n\telse {\r\n\tmapg0.selectAll(\".subunit2\").data(topojson.feature(nuts, nuts.objects.subunits).features)\r\n\t .attr('stroke', function(d){\r\n\t\t return getcolor(coldata[d.id]);\r\n\t\t })\r\n\t .attr('stroke-width', bordersize_reg )\r\n\t .attr(\"class\", \"test\");\r\n\t}\r\n*/\t\r\n\t\r\n\t\r\n\r\n\t\r\n\t\r\n\t\r\n// mapg0.selectAll(\".ctrext2\").style(\"stroke-width\", bordersize_ctrext / Math.sqrt(s));\r\n// mapg0.selectAll(\".ctr2\").style(\"stroke-width\", bordersize_ctr / Math.sqrt(s));\r\n\r\n\tvar element = document.getElementById(\"translate\");\r\n\telement.value = \"translate(\" + t + \")scale(\" + s + \")\";\r\n\r\n}", "title": "" }, { "docid": "b6b8bdc3ed303414d0328a51b9e399a9", "score": "0.62756914", "text": "function changeScale(value) {\n\tvar adjuster = $(\".fixed-container\");\n\tif(navigator.userAgent.indexOf(\"Firefox\") == -1) {\n//\t\tadjuster.css(\"zoom\", value);\n\t\tadjuster.css(\"transform\", \"scale(\" + value + \")\");\n\t\tadjuster.css(\"transform-origin\", \"top center\");\n\t} else {\n// Disable for Firefox, since it doesn't get the actual resolution when the display is not at 100%.\n\t\tconsole.log(\"Skipping Firefox! \" + value);\n//\t\tadjuster.css(\"transform\", \"scale(\" + value + \")\");\n//\t\tadjuster.css(\"transform-origin\", \"top center\");\n\t}\n}", "title": "" }, { "docid": "567a5e5b14e37c8ef530c4cb1dcdb667", "score": "0.6274268", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "567a5e5b14e37c8ef530c4cb1dcdb667", "score": "0.6274268", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "d9889c02637f5a16246d39765b0a3767", "score": "0.62708306", "text": "function setUpMapSize(){\r\n graphic_map.style.height = mapSize * cellSize + 40 + 'px';\r\n graphic_map.style.width = mapSize * cellSize + 40 + 'px';\r\n}", "title": "" }, { "docid": "c4a20d1c3e0d8368c95c38ff53d28d6a", "score": "0.6267957", "text": "function setScale() {\n\tmainImage.style.transform = \"scale(\" + scale + \")\";\n}", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.62647754", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.62647754", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "788b4d2e79a96fdd9e1b58a394771c2e", "score": "0.62647754", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "d918a1faec4a7c56cd888c9f8fb586c2", "score": "0.6263537", "text": "function mobileView(){\n if ($(window).width() < 650) {\n map.setZoom(9.4);\n }\n else {\n map.setZoom(10);\n }\n}", "title": "" }, { "docid": "8e7bcfd5a70c5e2e855a6299790977f1", "score": "0.6256253", "text": "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "ae519e9ea5dae911d047b8d235297b04", "score": "0.6251602", "text": "function initiateZoom() {\n // Define a \"minzoom\" whereby the \"Countries\" is as small possible without leaving white space at top/bottom or sides\n minZoom = Math.max($(\"#map-holder\").width() / w, $(\"#map-holder\").height() / h);\n // set max zoom to a suitable factor of this value\n maxZoom = 20 * minZoom;\n // set extent of zoom to chosen values\n // set translate extent so that panning can't cause map to move out of viewport\n zoom\n .scaleExtent([minZoom, maxZoom])\n .translateExtent([\n [0, 0],\n [w, h]\n ]);\n // define X and Y offset for centre of map to be shown in centre of holder\n midX = ($(\"#map-holder\").width() - 1.5 * w) / 4;\n midY = ($(\"#map-holder\").height() - 1.5 * h) / 4;\n // change zoom transform to min zoom and centre offsets\n svg.call(zoom.transform, d3.zoomIdentity.translate(midX, midY).scale(1.5));\n}", "title": "" }, { "docid": "245c93381c4b32438abc417f5c616a45", "score": "0.62506485", "text": "function SetZoom() {\n $Elements.Scale.css({\n \"-webkit-transform\":\"scale(\"+CurZoom+\")\",\n \"-webkit-transform-origin\": \"0% 0%\",\n \"-moz-transform\":\"scale(\"+CurZoom+\")\",\n \"-moz-transform-origin\": \"0% 0%\",\n \"-ms-transform\":\"scale(\"+CurZoom+\")\",\n \"-ms-transform-origin\": \"0% 0%\",\n \"-o-transform\":\"scale(\"+CurZoom+\")\",\n \"-o-transform-origin\": \"0% 0%\",\n \"transform\":\"scale(\"+CurZoom+\")\",\n \"transform-origin\": \"0% 0%\",\n \"-ms-filter\": \"progid:DXImageTransform.Microsoft.Matrix(M11=\"+CurZoom+\", M12=0, M21=0, M22=\"+CurZoom+\", SizingMethod='auto expand')\"\n });\n jsPlumb.setZoom(CurZoom);\n $Elements.ZoomValue.html(CurZoom * 100 + '%');\n }", "title": "" }, { "docid": "0fdd61e00955680aa036c49eeac46798", "score": "0.6244412", "text": "set scale(s) {\n this.setAttribute('scale', s);\n }", "title": "" }, { "docid": "0fdd61e00955680aa036c49eeac46798", "score": "0.6244412", "text": "set scale(s) {\n this.setAttribute('scale', s);\n }", "title": "" } ]
b2de4e81425d338b975ed428e01ae26e
Verifies a user mention is in the correct format
[ { "docid": "e5e57319a80e1d9b3951b6d4f616e808", "score": "0.78220075", "text": "function CheckMentionFormat(mention) \n{\n\tif (mention.substring(0,2) != '<@' || mention.charAt(mention.length - 1) != '>') {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "title": "" } ]
[ { "docid": "a57c68f8350db58a2703bb5653e09caf", "score": "0.58399874", "text": "checkAuthorEmail(text) {\n text = text || this.state.answers.authorEmail;\n\n const re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+@[-_a-z0-9]+\\.[-_a-z0-9]+$/;\n return !re.test(text.toLowerCase());\n }", "title": "" }, { "docid": "b4c51e6f27c14e04a1192a6d4445cb69", "score": "0.57025063", "text": "function checkUserName(username) {\n if (username.length < 6) {\n return \"Username too short, must be in between 6 and 31 characters\";\n }\n else if (username.length > 31) {\n return \"Username too long, must be in between 6 and 31 characters\";\n }\n let regex = '[a-zA-Z0-9_]';\n let found = username.match(regex);\n if (found) {\n return \"valid\";\n }\n else {\n return \"Username can only contain alphanumeric characters and _\";\n }\n}", "title": "" }, { "docid": "1eb7dd78042e1f19e2711da17756a84d", "score": "0.5664814", "text": "static mentions(x) {\n\t\ttry {\n\t\t\tlet mentions = x.match(/<@!?\\d+>/g) || [];\n\t\t\treturn /@[here|everyone]/.test(x) || mentions.length > 3;\n\t\t} catch (e) { return false; }\n\t}", "title": "" }, { "docid": "b739fb6c532b11566fe203ff1fc64ac9", "score": "0.56498957", "text": "function verifyName() {\n const regex = /^[A-Za-z][A-Za-z0-9]{2,29}$/ ;\n\t// /^[a-zA-Z][a-zA-Z]+\\d*(?!\\s)[a-zA-Z]+\\d*$/;\n\n if (nickname.value.search(regex) != 0) {\n nickname.classList.remove(\"input-success\");\n nickname.classList.add(\"input-error\");\n return false;\n }else {\n nickname.classList.remove(\"input-error\");\n nickname.classList.add(\"input-success\");\n return true;\n }\n}", "title": "" }, { "docid": "b3561a9eae104f18c1dda18ff6bbb5e4", "score": "0.56080663", "text": "function isReal(s) {\n var upperStr = s.replace(/[A-Z]/g, '');\n var upper = s.length - upperStr.length;\n\n var lowerStr = upperStr.replace(/[a-z]/g, '');\n var lower = upperStr.length - lowerStr.length;\n\n var nonWord = lowerStr.length;\n\n // if the ratio of uppercase to lowercase letters is greater that .25, fail the message\n if ((upper / lower) > ratioUppercaseToLowercase) {\n // console.log(upper + ' / ' + lower + ' / ' + nonWord + ' ratio is ' + upper / lower);\n filteredSpamCount += 1;\n updateCounter(\"filter-spam-counter\", filteredSpamCount);\n return false;\n }\n\n // if the percentage of non-word characters is larger than 25% then fail the message\n if ((nonWord / s.length) > percentNonWordCharactersAllowed) {\n // console.log(upper + ' / ' + lower + ' / ' + nonWord + ' percentage is ' + nonWord / s.length);\n filteredSpamCount += 1;\n updateCounter(\"filter-spam-counter\", filteredSpamCount);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "1ef95ed8d182f3e595b32a292c8dc86f", "score": "0.56029963", "text": "function isUserSpecial(string) {\n var special = !string.includes(\"!\") && !string.includes(\"#\") && !string.includes(\"$\");\n if (special) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"User Id cannot contain special characters !, #, or $.\"\n };\n };\n }", "title": "" }, { "docid": "d40cee80d251d044578493d6dfc6216b", "score": "0.5571012", "text": "function IsValid(sUserInput)\n{\n var regexp = /[\\.\\w\\-\\\\s]$/gi;\n return regexp.test(sUserInput);\n}", "title": "" }, { "docid": "4d842343b43d5954241dd5e4b44e239d", "score": "0.55695575", "text": "function isValidMessage (displayName, messageText) {\n if (typeof displayName !== 'string' || \n displayName.includes('\\n', 0) ||\n displayName.length > 25) {\n return false;\n }\n\n if (typeof messageText !== 'string') {\n return false;\n }\n\n const numNewLines = messageText.split('\\n').length;\n return numNewLines <= 5 && messageText.length <= 300; \n}", "title": "" }, { "docid": "b79260190dc311e2b85f510bdef52720", "score": "0.556117", "text": "function validateUser(user) {\n // Returns true if it matches correct format.\n user = /^[a-z0-9]+$/i.test(user);\n return user;\n}", "title": "" }, { "docid": "02832df1a3acb8c8a0508e061b7c5f3c", "score": "0.55492073", "text": "function isUserGuessCorrect(userGuess) {\n\tif ( hangmanWord.indexOf(userGuess) !== -1 ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "2615d65ed06c548d92b6fef8f59b56e2", "score": "0.55481505", "text": "validate(value){\n return value.length >2; // can do .length > 4 - value.includes('@') &&s\n }", "title": "" }, { "docid": "9ae2b6e39281c3814af193fd61c87562", "score": "0.55395985", "text": "function validateUserSurname() {\n\n // check if it is empty\n if (cognomeUtente == \"\") {\n return true;\n }\n\n // check if it contains numbers\n for (let i = 0; i < cognomeUtente.length; i++) {\n if ( !isNaN(cognomeUtente[i]) ) {\n return true;\n }\n }\n\n // check if it includes invalid characters\n const invalidCharacters = [\"!\", \"”\", \"#\", \"$\", \"%\", \"&\", \"(\", \")\", \"*\", \"+\", \",\", \"-\", \".\", \"/\", \":\", \";\", \"<\", \">\", \"=\", \"?\", \"@\", \"[\", \"^\", \"]\", \"_\", \"|\", \"{\", \"~\", \"}\", \"\\\\\"];\n for (let i = 0; i < invalidCharacters.length; i++) {\n if (cognomeUtente.includes(invalidCharacters[i])) {\n return true;\n } \n }\n\n // reurn false if the input is valid\n return false;\n}", "title": "" }, { "docid": "448fcd9e56538d374cc90c34014af218", "score": "0.5523506", "text": "function validEntry(userEntry) {\n return userEntry.title.trim() !== \"\" &&\n userEntry.body.trim() !== \"\";\n}", "title": "" }, { "docid": "1363cece568362357578bc9101b0edab", "score": "0.55179286", "text": "function isUserSpecial(string) {\n var special = !string.includes(\"!\") && !string.includes(\"#\") && !string.includes(\"$\");\n if (special) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"User Id cannot contain special characters !, #, or $.\"\n };\n };\n}", "title": "" }, { "docid": "fc423f98f4fdab446eefd1c966a0044a", "score": "0.55157477", "text": "function validateUsername(username) {\n return /^[0-9a-zA-Z_.-]+$/.test(username);\n}", "title": "" }, { "docid": "a2ee55d4ba6eac2e2e7658d1c73f4921", "score": "0.5515618", "text": "function validateUserName(username) {\n\t\tlet regEx = /^[a-zA-Z0-9]+$/;\n\t\treturn regEx.test(username);\n\t}", "title": "" }, { "docid": "447d7cf1e4fbd7bbb3f5032d63f12f60", "score": "0.5504688", "text": "function isValidUsername(username) {\n if (typeof username !== 'string') {\n return false;\n }\n\n if (username.length < 1) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "a65135e652be61f5f4f8d31ad79854de", "score": "0.5496024", "text": "function usernameIsValid(name) {\n return name.length > 1 && name.match(/^[a-zA-Z]+[a-zA-Z_]*$/) !== null;\n}", "title": "" }, { "docid": "8bf7d636bd4eb2c6f57efe7ee5808d89", "score": "0.5495276", "text": "function isAValidMessage(message){\n while (message.length > 0) {\n let num = parseInt(message);\n message = message.slice((num + \"\").length);\n let str = message.slice(0, num), regex = RegExp('^[a-zA-Z]{' + num + '}$')\n if (!regex.test(str)) return false;\n message = message.slice(num);\n }\n return true;\n}", "title": "" }, { "docid": "a9d4d5750b4e607f2bd4fd6de03efcfd", "score": "0.54842633", "text": "validate(token) {\n return /\\w{2,}/.test(token);\n }", "title": "" }, { "docid": "33b2d45bcd4258d6bac6522adb30d822", "score": "0.54802936", "text": "function checkValidUser() {\n\t\tif (userData.includes(toUpperFirst(userNameInput))) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tcreateErrorMessage.invalid();\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "134d9daaff36efd81de184812c9b3301", "score": "0.5477638", "text": "function getIdFromMention(mention){\n\n //Role parse.\n if(mention.startsWith('<@&') && mention.endsWith('>')){\n mention = mention.slice(3,-1);\n \n //@here @everyone parse.\n if(mention.startsWith('!')){\n mention = mention.slice(1);\n }\n return mention;\n }\n return null;\n}", "title": "" }, { "docid": "3d3fc520d90c83ff3c50945559501796", "score": "0.5475137", "text": "function validateUserName(uName){\n if(uName.length == 10)\n {\n \treturn true;\n }\n else\n {\n \treturn false;\n }\n}", "title": "" }, { "docid": "aeec5235014ce062ca2ca161b466d7ac", "score": "0.547454", "text": "function GetIDFromMention(userMention)\n{\n\tvar id;\n\tuserMention = userMention.replace('!', ''); //check if they are using a nickame\n id = userMention.substring(2, userMention.length - 1);\n\treturn id;\n}", "title": "" }, { "docid": "697ad333598fd34a668f080aa29bd499", "score": "0.54525775", "text": "function is_spam(msg) {\n\tif (/bigfollows\\s*.\\s*com/i.test(msg)) return true;\n\n\treturn /become famous/i.test(msg) && /buy/i.test(msg);\n}", "title": "" }, { "docid": "5e360e68e279bbb737b38487c56c17ce", "score": "0.5449513", "text": "function validUsername(username) {\n var login = username.trim(); // remove spaces\n return login !== '' && login.search(/ /) < 0;\n}", "title": "" }, { "docid": "f250c90fcc17e68c8eb6fcb29f53be94", "score": "0.5440399", "text": "function checkUserName(x) {\n let username = document.getElementById(\"usertext\").value;\n if (\n username == null ||\n (username.length < 8 && username.length > 15) ||\n username.indexOf(\" \") != -1\n ) {\n alert(\"invalid username\");\n return false;\n } else return true;\n}", "title": "" }, { "docid": "d9f3b8369bb9e221c58ba2a266a9443b", "score": "0.5439099", "text": "function valida_correo(correo) {\n\t\t if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(correo)){\n\t\t\t\n\t\t return (true)\n\t\t } else {\n\t\t \n\t\t return (false);\n\t\t }\n\t\t }", "title": "" }, { "docid": "bcad75937dc160bb35fd13357bf306fd", "score": "0.54368734", "text": "function validate(userStringRepresentation) {\n //check to see if userStringRepresentation is only letters\n if (userStringRepresentation.indexOf(0) >= 0 || userStringRepresentation.indexOf(1) >= 0 || userStringRepresentation.indexOf(2) >= 0 || userStringRepresentation.indexOf(3) >= 0 || userStringRepresentation.indexOf(4) >= 0 || userStringRepresentation.indexOf(5) >= 0 || userStringRepresentation.indexOf(6) >= 0 || userStringRepresentation.indexOf(7) >= 0 || userStringRepresentation.indexOf(8) >= 0 || userStringRepresentation.indexOf(9) >= 0) {\n alert(\"Please enter only phrases containing letters. Try again.\");\n invalidEntryFlag = false;\n } else {\n invalidEntryFlag = true;\n }\n}", "title": "" }, { "docid": "b90d29e89dca3fe97e5b9a87a18da24c", "score": "0.54349905", "text": "function checkemaill(inputtxt){if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(inputtxt)){return (true)} return (false);}", "title": "" }, { "docid": "daccd06fe9ddc37f2d8f6498a991f00a", "score": "0.5415097", "text": "function validateUsername(username){\n let validUsername = /^[a-zA-Z0-9]{5,20}$/;\n return validUsername.test(username);\n}", "title": "" }, { "docid": "f4ba804d7ca9805aac841fddb51ee030", "score": "0.5405498", "text": "function validateUsername(form, whichInput) {\n const usernameInput = form.find('input[name=\"username\"]');\n if (usernameInput.val().length < 4) {\n showIssues(form, whichInput, i18n.userShort);\n return false;\n } else if (usernameInput.val().length > 15) {\n showIssues(form, whichInput, i18n.userLong);\n return false;\n }\n ErrorPopup.remove(form, whichInput);\n return true;\n}", "title": "" }, { "docid": "64f9eb396145048827f5a50e435e1115", "score": "0.5403973", "text": "function validateUsername() {\n // New pattern for names\n var usernamePattern = new RegExp(\"^([-_!&*()']*[a-zA-Z0-9]+[-_!&*()']*)+$\");\n // Return its comparision result and show the errors\n if (usernamePattern.test(username.value)) {\n return true;\n } else {\n alert(\"Username invalid! Please just use letters, numbers and -_!&*()'\");\n usernameError.innerHTML(\"Please just use letters, numbers and -_!&*()'\");\n return false;\n }\n}", "title": "" }, { "docid": "22c5fe9ed0917d6a4f13537853badd38", "score": "0.54010916", "text": "function isUserEmailMPA(value) {\n\t// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/\n\treturn /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i.test(value);\n}", "title": "" }, { "docid": "81b9ce7fdac3fbc86e10725dee2c499a", "score": "0.5400219", "text": "function validateTweet(tweet) {\n var containsSC = new RegExp(/\\/soundcloud.com\\/([a-zA-Z0-9_-])+\\/([a-zA-Z0-9_-])+/);\n if(!tweet.entities || !tweet.entities.urls[0]) return false;\n return containsSC.test(tweet.entities.urls[0].expanded_url);\n}", "title": "" }, { "docid": "3c323d0c2f6b4cd7f285f626f7cbf0c3", "score": "0.53919905", "text": "function CheckUsername(Value){\n\tif(/^[a-zA-Z0-9]*$/.test(Value) == false) {\n alert('Your username cannot have complex characters, such as quotation marks.');\n\treturn false\n}\nreturn true\n}", "title": "" }, { "docid": "f64de4510ce2ec12210e2ea2330cc8ed", "score": "0.5391915", "text": "function verUser(elem) {\n if (/^[^\\s]+$/.test(elem.value)){\n setValid(elem);\n } else if (/\\s/.test(elem.value)){\n setInvalid(elem, \" (no spaces)\");\n } else {\n setInvalid(elem);\n }\n}", "title": "" }, { "docid": "a55dcec91f228ea802762000341c2063", "score": "0.5390063", "text": "function validateUsername(username, message) {\n\t//Validates that a username meets\n\t//the following criteria:\n\t//1. Must be at least 8 characters long\n\t//2. First character must be A-Z or a-z\n\t//3. Must contain at least one digit (0-9)\n\t//Function returns \"true\" if all criteria\n\t//is met, \"false\" if any criteria not met.\n\n\tvar char1;\n\tvar hasNumber;\n\n\t//Check username length:\n\tif (username.length < 8) {\n\t\tmessage.valueOf =\n\t\t\t\"User name must be at least 8 characters\";\n\t\treturn false;\n\t}\n\n\t//Check first character:\n\tchar1 = username.substr(0, 1).toUpperCase();\n\tif (!(char1 >= \"A\" && char1 <= \"Z\")) {\n\t\tmessage.valueOf =\n\t\t\t\"First character must be A-Z or a-z\";\n\t\treturn false;\n\t}\n\n\t//Check for at least one digit/numeral:\n\thasNumber = /\\d/;\n\tif (!(hasNumber.test(username))) {\n\t\tmessage.valueOf =\n\t\t\t\"User name must contain \" +\n\t\t\t\"at least one numeral\";\n\t\treturn false;\n\t}\n\n\t//Alternate version\n\t/*var anyDigits = false;\n\t while (!(anyDigits)) {\n\t for (var i = 1; i < username.length; i++)\n\t {\n\t char1 = username.substr(i, 1);\n\t if (char1 >= \"0\" && char1 <= \"9\")\n\t {\n\t anyDigits = true;\n\t break; //exit for loop, found one!\n\t }//end if\n\t }//end for\n\t if (!(anyDigits)) {\n\t return false;\n\t }\n\t }//end while*/\n\n\t//Otherwise, all criteria met:\n\treturn true;\n} //end function", "title": "" }, { "docid": "429381bd69d247d476f4ca930aebfd10", "score": "0.53897184", "text": "function valida_correo(correo) {\r\n\t\t if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(correo)){\r\n\t\t\t\r\n\t\t return (true)\r\n\t\t } else {\r\n\t\t \r\n\t\t return (false);\r\n\t\t }\r\n\t\t }", "title": "" }, { "docid": "3e3870072496776a695923992f382822", "score": "0.53895086", "text": "function is_user(element){\r\n\t\tvar userExp = /[a-zA-Z][a-zA-z0-9]/;\r\n\t\tif(element.value.match(userExp) && element.value!=\"\" && element.value != null && element.value.lenth!=0){\r\n\t\t\telement.style.background=\"#FFFFFF\";\r\n\t\t}else{\r\n\t\t\t//bien bao loi\r\n\t\t\telement.style.background=\"#FF99AF\";\r\n\t\t\t\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "74b37e698ca51465e9575be880fcd185", "score": "0.5387901", "text": "function isUsername(username) {\n var regEx = /^[a-zA-Z0-9-_]+$/;\n return regEx.test(username);\n }", "title": "" }, { "docid": "75301b3286333657141b9098675eb211", "score": "0.53823674", "text": "function validateUserNameForLogin(control, message, showMessage)\n{\n var pattern = /([\\\"\\*\\>\\<\\?\\:\\|]+)|([ ]+$)|([\\.]?[\\.]+$)/;\n return validateValue(control, pattern, message, showMessage);\n}", "title": "" }, { "docid": "0b619f981a97ee947e98051fd7e0a43a", "score": "0.537852", "text": "function checkUsername(string) {\n if (string.match(/^[0-9a-zA-Z]+$/)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9016ca8d3f6bad880d7e6a9b249566bc", "score": "0.5371348", "text": "function validateUserNameForCreate(control, message, showMessage)\n{\n var pattern = /([\\\"\\*\\\\\\>\\<\\?\\:\\|]+)|([ ]+$)|([\\.]?[\\.]+$)/;\n return validateValue(control, pattern, message, showMessage);\n}", "title": "" }, { "docid": "ea72c81a918f780165da1c1f2bfb0a49", "score": "0.53690976", "text": "function checkUser(str) {\n var code, i, len;\n\n code = str.charCodeAt(0);\n if (!(code > 64 && code < 91) && !(code > 96 && code < 123)) {\n return false;\n }\n\n for (i = 1, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8a1ad0109445e55e1e146d3aba606dc3", "score": "0.5361465", "text": "function checkUserName(username){\n function check_spaces(username){\n for(var i=0;i<username.length;i++){\n if (username[i]==\" \"){\n return false\n }\n }\n return true\n }\n function special_characters(username){\n for(var c=0;c<username.length;c++){\n if ((username[c]<='Z' && username[c]>='A') || (username[c]<'z' && usernmae[c]>='a')){\n continue; \n }\n return false\n }\n return true\n​\n }\n result1=check_spaces(username)\n result2=special_characters(username)\n \n if (username.length>=8 && username.length<=15 && result1 && result2){\n return true\n }\n else{\n return false\n }\n}", "title": "" }, { "docid": "d5c65435a456a0b94d6c390b66f4a8d4", "score": "0.53534836", "text": "function check_spam() {\n\tvar prev = '';\n\tvar matchcount = 0;\n\tif (out.length > 100) {\n\t\treturn true;\n\t}\n\tfor (var i in out) {\n\t\tif (prev == out[i].message) matchcount++\n\t\telse matchcount = 0;\n\t\tif (matchcount > 2) return true;\n\t\tprev = out[i].message;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "a4c54266585c2f7e308654096a928c14", "score": "0.5352383", "text": "function CodelandUsernameValidation(str) {\n const regex = /[a-zA-Z]/g;\n const regex2 = /[a-zA-Z0-9_]/g;\n\n if (\n str.length > 4 &&\n str.length < 25 &&\n str[str.length - 1] !== '_' &&\n regex.test(str[0]) &&\n regex2.test(str)\n )\n return true;\n\n return false;\n}", "title": "" }, { "docid": "c3069860e4c7930dae75e08f8dc59c23", "score": "0.53362507", "text": "function test_username(username) {\r\n\tif(typeof username == 'undefined')\r\n\t\treturn \"No username was provided.\";\r\n\r\n\tvar regex = /^([A-z0-9]|_|-|\\.){3,30}$/;\r\n\tif(!regex.test(username)) {\r\n\t\treturn \"Invalid username.\";\r\n\t}\r\n\r\n\treturn '';\r\n}", "title": "" }, { "docid": "b8d66a99a8929f2028163dabe3f63a07", "score": "0.53228515", "text": "function userCheck(username)\n{\n\tvar check = false;\n\n\tvar emailsArray = username.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n\tif (emailsArray != null && emailsArray.length) {\n\t\tcheck = true;\n\t}\n\telse {\n\t\tmsg += \"\\nUsername should look like [email protected] | \";\n\t}\n\n\treturn check;\n}", "title": "" }, { "docid": "5244d7b53e7657a0c802400bb676d4ab", "score": "0.5319594", "text": "validate() {\n\t\treturn Utils.bytesToLetters(this.buffer.slice(0, 4)) === 'MThd';\n\t}", "title": "" }, { "docid": "f2924bb314c652d256ceb82097517975", "score": "0.5316421", "text": "function userLenValid(user) {\r\n var ret = 0;\r\n\r\n if (isString(user) == true)\r\n {\r\n if (user.length >= 6)\r\n { //if the length of 'user' is at least 6 then return true\r\n ret = 1;\r\n }\r\n else {\r\n ret = 0;\r\n }\r\n }\r\n else {\r\n ret = -1;\r\n }\r\n\r\n return ret;\r\n}", "title": "" }, { "docid": "13fbb34587fc327e1237d70457c56877", "score": "0.53029567", "text": "function isCharbefDotAfSign() {\n var firstI = getMail().indexOf('@');\n var lastI = getMail().lastIndexOf('.');\n var i = 0;\n var count = 0;\n for (i = firstI; i < lastI; i++) {\n if (getMail()[i] >= 'a' && getMail()[i] <= 'z' || getMail()[i] >= 'A' && getMail()[i] <= 'Z') {\n count++;\n }\n }\n if (count > 0) {\n notErrMail();\n return true;\n } else {\n errMail(\"You have to put letters after the '@'\");\n return false;\n }\n}", "title": "" }, { "docid": "75ef0e036f4292bc8c764cbaf5292438", "score": "0.529405", "text": "function validateUsername(username) {\n var re = /^[a-zA-Z0-9]+$/;\n return re.test(username);\n }", "title": "" }, { "docid": "e8cbd272b649a9e7cad5f1ae05299e74", "score": "0.52661026", "text": "function isGuessValid(userGuess) {\n\tif (underScore.indexOf(userGuess) === -1 && \n\t\tlettersGuessed.indexOf(userGuess) === -1)\n\t{\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "f22728156b0b2e9bf5e726dedcca045d", "score": "0.5265899", "text": "async function mention(event) {\n var params = {\n status: \"Tweeted from API TEST\",\n }; // this is the param variable which will have key and value\n var message = event.text; // takes in the message\n var cmd = parser.parse(message);\n var screenName = \"\" + event.user.screen_name + \"\";\n if (screenName === \"MarcelpierreS\") {\n onAdminCommand(event,cmd);\n } else{\n onMention(event);\n }\n}", "title": "" }, { "docid": "b10cbfb9928710da701eb2707fdf9cb5", "score": "0.52645344", "text": "function isValidName(userName) \n {\n return regexName.test(userName);\n }", "title": "" }, { "docid": "fd4050cf05088180a0948a218fee6849", "score": "0.5249596", "text": "function isSignUpUserValid(userName){\r\n\tuserName = $.trim(userName); \r\n\tvar nameReg = /^[\\w\\.]{4,32}$/;\r\n\treturn nameReg.test(userName);\r\n}", "title": "" }, { "docid": "218eee31ad3dd4c6a44bf55a69489bd4", "score": "0.5240844", "text": "function checkIfFullNameIsCorrect(){\n if(new String(fullName.value).length < 1 ){\n // show error\n fullName.classList.add(\"border-danger\")\n fullNameHelp.innerText = \"Full Name is Invalid\";\n return false;\n }else{\n // remove error\n if(fullName.classList.contains(\"border-danger\")){\n fullName.classList.remove(\"border-danger\")\n }\n fullNameHelp.innerText = null;\n return true;\n }\n}", "title": "" }, { "docid": "e44b4f77a967ba250752ce212bd35e2b", "score": "0.5238322", "text": "asciiSpamCheck(message) {\n return (\n _.get(message.match(/[^\\x20-\\x7F]/g), 'length', 0) > this.asciiArtThreshold ||\n _.get(message.match(/[\\x21-\\x2F\\x3A-\\x40]/g), 'length', 0) > this.asciiPunctuationCount\n );\n }", "title": "" }, { "docid": "557d9a9d023a3d6d03147303ab19d0b2", "score": "0.52379185", "text": "function checkPasswordFormat(password, format) {\n return format.test(password)\n}", "title": "" }, { "docid": "d8df2a2b9ed473aa080521cd9b42be1f", "score": "0.5234965", "text": "function lookForBadChars(userInput, tagName) {\n if (tagName != \"Units\") {\n if (/[^a-zA-Z0-9_\\s\\-\\.]/g.test(userInput.trim())) { // garbage characters entered\n return \"Please enter a legitimate value for \" + tagName\n + \" (allowed: a-zA-Z0-9 _-.):\";\n } else {\n return null;\n }\n }\n}", "title": "" }, { "docid": "bd68c4dd48cc9b3bbd1ba7909d52f631", "score": "0.52302814", "text": "function is_username_valid(username){\n\n // first checking for null input\n if(username == \"\"){\n\n alert(\"Please provide your username!\");\n return false;\n }else{\n\n // checking if the username contains at least 2 characters\n if(strlen(username) > 1){\n\n // checking if the username is valid or not\n for(var i=0; i<username.length; i++){\n\n if((username[i] >= 'A' && username[i] <= 'Z') || (username[i] >= 'a' && username[i] <= 'z') ||\n (username[i] >= 0 && username[i] <= 9) || (username[i] == \".\") || (username[i] == \"-\")\n || (username[i] == \" \")){\n\n return true;\n }else{\n\n alert(\"Username can contain only alpha numeric characters, period(.), dash(-) or underscore(_) only.\");\n return false;\n }\n }\n }else{\n\n alert(\"Username should be atleast 2 characters.\");\n return false;\n }\n }\n}", "title": "" }, { "docid": "5ccc795716a8f478683800e7349dd801", "score": "0.52288604", "text": "formatMessageMentions(text) {\n if (text === null || typeof text === 'undefined') {\n return '';\n }\n\n let formattedText = text;\n // find user mentions\n const userMentions = text.match(/<@U[a-zA-Z0-9]+>/g);\n if (userMentions !== null) {\n userMentions\n .map(match => match.substr(2, match.length - 3))\n .forEach((userId) => {\n let username;\n let modifier;\n if (userId === app.currentUser.id) {\n username = app.currentUser.name;\n modifier = 'yellow-fg';\n } else {\n const user = app.users.find(potentialUser => potentialUser.id === userId);\n username = typeof user === 'undefined' ? UNKNOWN_USER_NAME : user.name;\n modifier = 'underline';\n }\n\n formattedText = text.replace(\n new RegExp(`<@${userId}>`, 'g'),\n `{${modifier}}@${username}{/${modifier}}`\n );\n });\n }\n\n // find special words\n return formattedText.replace(\n /<!channel>/g,\n '{yellow-fg}@channel{/yellow-fg}'\n );\n }", "title": "" }, { "docid": "ddd8a3a3a80709269c88467db46fe38d", "score": "0.5223281", "text": "function isUserLength(string) {\n if (string.length >= 6) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"User Id is not at least 6 characters.\"\n };\n };\n }", "title": "" }, { "docid": "a076959f93620064be38c7582c154cdd", "score": "0.5216627", "text": "function validateUserName(userName){\n\tvar filter = /^[A-Za-z0-9_]+$/;\n\treturn filter.test(userName);\n}", "title": "" }, { "docid": "6ad2a0b19919bf747de6018f20150385", "score": "0.52138126", "text": "function createUserMention(message) {\n let user = message.address.user;\n let text = \"<at>\" + user.name + \"</at>\";\n let entity = {\n type: \"mention\",\n mentioned: user,\n entity: text,\n text: text,\n };\n return entity;\n}", "title": "" }, { "docid": "0a2dd76ee870abe60073cac62ed038e4", "score": "0.52081114", "text": "function doesFriendExist(ageInText, ageInNumber) {\n if (isNaN(ageInNumber))\n return ageInNumber;\n else if (isNaN(ageInText))\n return ageInText;\n }", "title": "" }, { "docid": "e709190a7da3c2a6473fb927210aae57", "score": "0.5205192", "text": "function usernamevalid()\r\n{\r\n var username = document.querySelector(\"#usernamef2\").value;\r\n var notlongenough = \"<p> - Username must be at least 6 characters long </p>\";\r\n var usernamelong = username.length;\r\n\r\n if (usernamelong < 6)\r\n {\r\n printErrors(notlongenough);\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "6b505dcd60694ca2bcec659d3fc8a883", "score": "0.52035636", "text": "function isValidUsername(username) {\n const re = /^(?!.*__.*)(?!.*\\.\\..*)[a-z0-9]{6,16}$/;\n return re.test(username) === true;\n}", "title": "" }, { "docid": "ada69479142f1ff52d5323db7b617d91", "score": "0.5202246", "text": "function isValidUsername(username) {\n\n if (username.length > 24) return false;\n\n for (let char of username) {\n if (!isValidUsernameChar(char)) return false;\n }\n\n return true;\n\n}", "title": "" }, { "docid": "51aac9f6909fe69a6fa88fe14f50abd2", "score": "0.5182314", "text": "function validateUserName(name){\n\t$scope.userNameNoWhiteSpace = !REQUIRED_PATTERNS[3].test(name);\n\t$scope.userForm.name.$invalid = !$scope.userNameNoWhiteSpace ;\n\tconsole.log( $scope.userNameNoWhiteSpace );\n\treturn $scope.userForm.name.$invalid;\n }", "title": "" }, { "docid": "51aac9f6909fe69a6fa88fe14f50abd2", "score": "0.5182314", "text": "function validateUserName(name){\n\t$scope.userNameNoWhiteSpace = !REQUIRED_PATTERNS[3].test(name);\n\t$scope.userForm.name.$invalid = !$scope.userNameNoWhiteSpace ;\n\tconsole.log( $scope.userNameNoWhiteSpace );\n\treturn $scope.userForm.name.$invalid;\n }", "title": "" }, { "docid": "f3dbf3a2abdceb005819d6629007924d", "score": "0.5179982", "text": "function validEmailAddress(sentence){\n let hasEmail = EMAIL_REGEX.test(sentence);\n return hasEmail;\n}", "title": "" }, { "docid": "7d65a4bc133aa4a7e9fd81e528188450", "score": "0.5179632", "text": "function isUserTalk(line){\n\t\t\tvar colon = getColonPos(line);\n\t\t\tvar common = getCommonPos(line);\n\t\t\tif(colon>=0 && colon<MAX_NAME_LENGTH && (common==-1 || common>colon))\treturn true;\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "7d65a4bc133aa4a7e9fd81e528188450", "score": "0.5179632", "text": "function isUserTalk(line){\n\t\t\tvar colon = getColonPos(line);\n\t\t\tvar common = getCommonPos(line);\n\t\t\tif(colon>=0 && colon<MAX_NAME_LENGTH && (common==-1 || common>colon))\treturn true;\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "e106052fa9338e639e345e9a0984833e", "score": "0.51745075", "text": "function isvalidUsername(str) {\n var valid_map = ['admin', 'editor', 'web02'];\n return valid_map.indexOf(str.trim()) >= 0;\n}", "title": "" }, { "docid": "fee73d16e3fcbb1c091e1489cbb7f0d1", "score": "0.51662695", "text": "function isValidUserID (id) {\n var re = /[a-zA-Z0-9]/;\n for (var i = 0; i < id.length; i++) {\n if (!re.test(id.substring(i, i+1))) {\n return false;\n }\n }\n if (id.length < 1 || id.length > 50) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "d294ec243dab095db0c89b63af2fe727", "score": "0.51641375", "text": "function checkUsername(guildMember) {\n getBannedWords().then(bannedWords => {\n\n bannedWords.forEach(word => {\n\n if (guildMember.displayName.toLowerCase().includes(word.toLowerCase())) {\n handleBlockedName(guildMember);\n }\n })\n }).catch(err => {\n logging.error('Error retrieving banned words, Error: ' + err.message);\n logging.debug('Error stack trace: ' + err.stack);\n })\n}", "title": "" }, { "docid": "ef31db1356e871b58910170cfab56a5d", "score": "0.51605487", "text": "function fullNameValidation(fullname) {\n if(fullname.match(/^[a-zA-Z ]+$/))\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "dd28bbb6d7f53fd13d85fc4a055947d7", "score": "0.51495034", "text": "function nameMention(user, options = { styleString: \"`\" }) {\n\tlet name = user.username;\n\treturn `${surround(name, options.styleString)}`;\n}", "title": "" }, { "docid": "605b694024e8e267a2d648c7523c1dd1", "score": "0.51463896", "text": "function accidentalCharsAgo(charsAgo){\n if(charsAgo == '^' || charsAgo == '_' || charsAgo == '='){\n return true;\n }else {\n return false;\n }\n }", "title": "" }, { "docid": "387e86f8f23be3be40c04bc1d0885d7a", "score": "0.51434803", "text": "isInputTextMatch(inputText, nick) {\n const regex = new RegExp(`^${inputText}`, \"i\");\n return regex.test(nick)\n }", "title": "" }, { "docid": "dcfbb8e3f83ba09f37e1418c2f612615", "score": "0.51379675", "text": "function validation_validateUsername(username)\r\n{\r\n\t\r\n\tif(username.length>4)\r\n\t{\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "d02ed666a4f7b5c43e18fea1c2bd87d7", "score": "0.5136961", "text": "validate(value){\n if(value.toLowerCase().includes(\"password\")) //password can'nt contain word \"password\"\n {\n throw new Error(\"password can'nt contain the word 'password'\")\n }\n }", "title": "" }, { "docid": "db4bf3a1fb62ff168d09d9fdf192e02b", "score": "0.5135774", "text": "function username(uname) \n{ \n\tvar letters = /^[a-zA-Z0-9_-]+@[A-Za-z]+\\.[a-zA-Z]{2,}$/g; \n\tif(uname.value.match(letters)) \n\t{ \n\t\treturn true; \n\t}\n\telse if(uname.value == null || uname.value == \"\")\n\t{\n\t\talert('Email is required'); \n\t\tuname.focus(); \n\t\treturn false; \t\n\t}\n\telse \n\t{ \n\t\talert('You Have entered Invalid Email Address!'); \n\t\tuname.focus(); \n\t\treturn false; \n\t} \n}", "title": "" }, { "docid": "8862de94e6cd67711a27774cfa165a78", "score": "0.512846", "text": "checkAuthorName(text) {\n text = text || this.state.answers.authorName;\n return !text;\n }", "title": "" }, { "docid": "dcb92a2cb26f5949d368c37bfc0a1805", "score": "0.51198494", "text": "function checkTagUser(message, cb) {\n if (!((message.text && message.text.match(/{username}/)) || (message.html && message.html.match(/{username}/)))) {\n cb()\n return\n }\n ref.cache.getUser(message.userid, function(err, user, meta) {\n if (err) console.error('messages.controllers.js::addMessage - getUser err', err)\n if (message.text && message.text.match(/{username}/)) {\n message.text = message.text.replace(new RegExp('{username}', 'g'), user.username)\n }\n if (message.html && message.html.match(/{username}/)) {\n message.html = message.html.replace(new RegExp('{username}', 'g'), user.username)\n }\n cb()\n })\n }", "title": "" }, { "docid": "5fdce224dd36af010cd4205d15c4edd0", "score": "0.5118037", "text": "function isCharbefSign() {\n var lastI = getMail().indexOf('@');\n var i = 0;\n var count = 0;\n for (i = 0; i < lastI; i++) {\n if (getMail()[i] >= 'a' && getMail()[i] <= 'z' || getMail()[i] >= 'A' && getMail()[i] <= 'Z') {\n count++;\n }\n }\n if (count > 0) {\n notErrMail();\n return true;\n } else {\n errMail(\"You have to put letters before the '@'\");\n return false;\n }\n}", "title": "" }, { "docid": "ae472f00ce10b982a885d1017c38e714", "score": "0.511623", "text": "function isValidMew(mew) {\n return (\n mew.name &&\n mew.name.toString().trim() !== \"\" && mew.name.toString().trim().length <= 50 &&\n mew.content &&\n mew.content.toString().trim() !== \"\" && mew.content.toString().trim().length <= 140\n );\n}", "title": "" }, { "docid": "5c3bf8a6fa9eafd335f62d8ac1088d70", "score": "0.511363", "text": "function is_mail_autolink(data) {\n\t\tvar i = 0, nb = 0;\n\n\t\t/* address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@' */\n\t\tfor (i = 0; i < data.length; ++i) {\n\t\t\tif (isalnum(data[i]))\n\t\t\t\tcontinue;\n\n\t\t\tswitch (data[i]) {\n\t\t\t\tcase '@':\n\t\t\t\t\tnb++;\n\n\t\t\t\tcase '-':\n\t\t\t\tcase '.':\n\t\t\t\tcase '_':\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '>':\n\t\t\t\t\treturn (nb == 1) ? i + 1 : 0;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "title": "" }, { "docid": "f681d7200f03832ca06ab4a623ea9773", "score": "0.51122344", "text": "function containsSymbol(userId) {\n if (!userId.includes(\"!\") && !userId.includes(\"#\") && !userId.includes(\"$\")) {\n return { valid: true };\n }\n else {\n return { valid: false, reason: \"Those characters are not valid for the user ID\"};\n }\n}", "title": "" }, { "docid": "d00c97a6891753c964016672d0ff8927", "score": "0.5111956", "text": "static cleanContent (str, message) {\n return str\n .replace(/@(everyone|here)/g, '@\\u200b$1')\n .replace(/<@!?[0-9]+>/g, input => {\n const id = input.replace(/<|!|>|@/g, '')\n if (message.channel.type === 'dm' || message.channel.type === 'group') {\n const user = message.client.users.get(id)\n return user ? `@${user.username}` : input\n }\n\n const member = message.channel.guild.members.get(id)\n if (member) {\n return `@${member.displayName}`\n } else {\n const user = message.client.users.get(id)\n return user ? `@${user.username}` : input\n }\n })\n .replace(/<#[0-9]+>/g, input => {\n const channel = message.client.channels.get(input.replace(/<|#|>/g, ''))\n return channel ? `#${channel.name}` : input\n })\n .replace(/<@&[0-9]+>/g, input => {\n if (message.channel.type === 'dm' || message.channel.type === 'group') return input\n const role = message.guild.roles.get(input.replace(/<|@|>|&/g, ''))\n return role ? `@${role.name}` : input\n })\n }", "title": "" }, { "docid": "f1bf02359afbfba0bf68621dd9e36f41", "score": "0.5110629", "text": "function checkUserName(uname, mx, my) {\n var uid_name=uname.value.length\n if(uid_name==0)\n {\n alert(\"Username should not be empty/ length be between \" + mx + \" to \" + my)\n\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "d3d74332d1f7349ba471ef15bf449175", "score": "0.51021725", "text": "function validateGuid(str, doNotThrow) {\n var trimmed = trim(str, \"both\", \"{\", \"}\");\n if (guidRegex.test(trimmed)) {\n return doNotThrow ? [true, trimmed] : trimmed;\n } else if (doNotThrow) {\n return [false, \"00000000-0000-0000-0000-000000000000\"];\n }\n throw new Error(\"Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\");\n}", "title": "" }, { "docid": "eda8668762127f5801fc67b194213502", "score": "0.50821126", "text": "function github(string) {\n if (!notEmpty(string)) {\n return \"GitHub user name cannot be empty\";\n } else if (!githubRegex.test(string)) {\n return \"GitHub user name must be valid\";\n }\n return true;\n}", "title": "" }, { "docid": "a0aa3aac9bf0baf53490335d9a2795a4", "score": "0.5081511", "text": "function isMessageId(str) {\n if (!new RegExp(`^[0-9a-f]{${str.length}}$`).test(str) || str.length !== 64) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "1e2ec58f53ee7fab51f887848c391e2c", "score": "0.5080856", "text": "function valida_username(){\n var input = document.getElementById('username').value;\n //var patt = new RegExp(\"/^[A-Za-z0-9_-]$/\"); //{5,18}\n var sol = /^[A-Za-z0-9_-]+$/.test(input);\n if(!sol){\n document.getElementById('username_err').innerHTML = \"Username non valido. Caratteri ammessi lettere, numeri, trattino e underscore.\";\n return false;\n }\n else{\n var n = input.length;\n if(n==0){\n document.getElementById('username_err').innerHTML = \"Username obbligatorio\";\n return false;\n }\n else if(n > 18){\n document.getElementById('username_err').innerHTML = \"Username al massimo di 18 caratteri\";// NON QUI!!!!!\n return false;\n }\n else if(n < 5){\n document.getElementById('username_err').innerHTML = \"Username minimo di 5 caratteri\";\n return false;\n }\n else{\n document.getElementById('username_err').innerHTML = '';\n return true;\n }\n }\n}", "title": "" }, { "docid": "9828728b57044db7a6ae84fd9ed27cc9", "score": "0.5080359", "text": "function cleanNickname(nickname) {\n\tvar clean;\n\tif (clean = nickname.match(/\\/([\\s\\S]+)/)) {\n\t\tclean = clean[1];\n\t}\n\telse {\n\t\treturn false;\n\t}\n\tif (clean.match(/\\W/)) {\n\t\treturn false;\n\t}\n\treturn clean;\n}", "title": "" }, { "docid": "a87790e665824a8c929b252510983e8e", "score": "0.5080212", "text": "function checkAuthorisedName()\r\n {\r\n $authorisedName = $('#return-authorized-name-input').val();\r\n\r\n if ($repairAuthorisedNameRegex.test($authorisedName) == false)\r\n {\r\n $errorMessagesArray.push(\"Authorised Name - Must Letters and spaces only. Maxmium of 25 characters.\");\r\n $('#return-authorized-name-input').css('background-color', '#ffaeb0');\r\n }\r\n else\r\n {\r\n $('#return-authorized-name-input').css('background-color', 'white');\r\n }\r\n }", "title": "" } ]
a01b14cc37f7d6ca7c3a4e1ff4b574cb
Initializes DPT for peer discovery
[ { "docid": "e3ed85f342f31b397b9f8fdf77d4ffbe", "score": "0.71939135", "text": "initDpt () {\n this.dpt = new devp2p.DPT(this.key, {\n refreshInterval: this.refreshInterval,\n endpoint: {\n address: '0.0.0.0',\n udpPort: null,\n tcpPort: null\n }\n })\n\n this.dpt.on('error', e => this.error(e))\n\n if (this.port) {\n this.dpt.bind(this.port, '0.0.0.0')\n }\n }", "title": "" } ]
[ { "docid": "f9b0a2b7668588e6b513a6277966afa3", "score": "0.6630207", "text": "async [INITIALIZE_PNP] ({ state, commit, dispatch }) {\n // clear reference to any pre-existing and potentially corrupt peer instance\n // in order to force a new peer instance creation\n state.peer = undefined\n await dispatch(PNP_SERVICE_CONNECT)\n }", "title": "" }, { "docid": "cdfea2a60ec83a9f1fd1d60dc58c23e9", "score": "0.63928044", "text": "function initialize() {\n // Create own peer object with connection to shared PeerJS server\n peer = new Peer(null, {\n debug: 2\n });\n\n peer.on('open', function (id) {\n // Workaround for peer.reconnect deleting previous id\n if (peer.id === null) {\n console.log('Received null id from peer open');\n peer.id = lastPeerId;\n } else {\n lastPeerId = peer.id;\n }\n\n console.log('ID: ' + peer.id);\n joinToHost();\n });\n peer.on('connection', function (c) {\n // Disallow incoming connections\n c.on('open', function () {\n c.send(\"Sender does not accept incoming connections\");\n setTimeout(function () {\n c.close();\n }, 500);\n });\n });\n peer.on('disconnected', function () {\n console.log('Connection lost. Please reconnect');\n\n // Workaround for peer.reconnect deleting previous id\n peer.id = lastPeerId;\n peer._lastServerId = lastPeerId;\n peer.reconnect();\n });\n peer.on('close', function () {\n conn = null;\n console.log('Connection destroyed');\n });\n peer.on('error', function (err) {\n console.log(err);\n alert('' + err);\n });\n\n document.querySelector(\"#presentButton\").addEventListener(\"click\", () => {\n signal(selectInputs(\"present\"));\n });\n\n document.querySelector(\"#voteButton\").addEventListener(\"click\", () => {\n signal(selectInputs(\"vote\"));\n });\n }", "title": "" }, { "docid": "e411de0ef22921af47d71853e04c8d30", "score": "0.5979386", "text": "function initialize() {\r\n // Create own peer object with connection to shared PeerJS server\r\n peer = new Peer(null, {\r\n debug: 2\r\n });\r\n\r\n peer.on('open', function (id) {\r\n // Workaround for peer.reconnect deleting previous id\r\n if (peer.id === null) {\r\n console.log('Received null id from peer open');\r\n peer.id = lastPeerId;\r\n } else {\r\n lastPeerId = peer.id;\r\n }\r\n document.getElementById('connecting').innerHTML = '';\r\n join();\r\n console.log('ID: ' + peer.id);\r\n });\r\n peer.on('connection', function (c) {\r\n // Disallow incoming connections\r\n c.on('open', function() {\r\n c.send(\"Sender does not accept incoming connections\");\r\n setTimeout(function() { c.close(); }, 500);\r\n });\r\n });\r\n peer.on('disconnected', function () {\r\n connStatus.innerHTML = \"Connection lost. Please reconnect\";\r\n console.log('Connection lost. Please reconnect');\r\n\r\n // Workaround for peer.reconnect deleting previous id\r\n peer.id = lastPeerId;\r\n peer._lastServerId = lastPeerId;\r\n peer.reconnect();\r\n });\r\n peer.on('close', function() {\r\n conn = null;\r\n connStatus.innerHTML = \"Connection destroyed. Please refresh\";\r\n console.log('Connection destroyed');\r\n });\r\n peer.on('error', function (err) {\r\n console.log(err);\r\n alert('' + err);\r\n });\r\n }", "title": "" }, { "docid": "6a1eeaaad421fec5dbcf37d5f51a6b89", "score": "0.5894525", "text": "async init() {\n this.initPromise = new Promise((resolve, reject) => {\n this._source_id = Math.floor(Math.random() * 0xffffffff);\n let netif_list = getNetworkInterfaces();\n if (!netif_list || netif_list.length === 0) {\n reject(new Error('No available network interface was found.'));\n return;\n }\n this._netif_list = netif_list;\n // Set up a UDP tranceiver\n // this._udp = mDgram.createSocket({ type: 'udp4', reuseAddr: true });\n this._udp = mDgram.createSocket({ type: 'udp4' }); // , reuseAddr: true });\t// Not sure about reuse\n this._udp.on('error', (error) => {\n reject(error);\n });\n this._udp.once('listening', () => {\n resolve(null);\n });\n this._udp.on('message', (buf, rinfo) => { this._receivePacket(buf, rinfo); });\n // this._udp.bind({ port: this._UDP_PORT });\n this._udp.bind();\n });\n this.initializing = false; // We now have the promise object\n return this.initPromise;\n }", "title": "" }, { "docid": "b3b69611dc016b0e3a79a91b34d7bd2d", "score": "0.58409214", "text": "function preparePeerConnection() {\n if (global.peerConnection != null)\n error_('creating peer connection, but we already have one.');\n\n global.peerConnection = createPeerConnection(STUN_SERVER,\n $('data-channel-type-rtp').checked);\n print_('ok-peerconnection-created');\n}", "title": "" }, { "docid": "bbabc10fc85f02ddb9abbcc516844b3b", "score": "0.58396655", "text": "function setupDiscovery() {\n findDiscoveryEnvironment()\n .then(environment => createDiscoveryEnvironment(environment))\n .then(environment => findDiscoveryCollection(environment))\n .then(params => getDiscoveryConfig(params))\n .then(params => createDiscoveryCollection(params))\n .then(params => loadDiscoveryCollection(params))\n .then(params => discoveryIsReady(params))\n .catch(handleSetupError);\n}", "title": "" }, { "docid": "3f3af50d627c08e07b3c14dbadb6a904", "score": "0.58311814", "text": "init() {\n\t\tdebug = this.debug;\n\t\tlog = this.log;\n\n\t\tthis.initFeedbacks();\n\t\tthis.initWS();\n\t\tthis.setVariables();\n\t\tthis.initPresets();\n\t}", "title": "" }, { "docid": "63fdc84df31e18dbe7f3d131f19f3011", "score": "0.5808571", "text": "_init() {\n this._initLogging();\n GlodaDatastore._init(this._nounIDToDef);\n this._initAttributes();\n this._initMyIdentities();\n }", "title": "" }, { "docid": "61f4c8926751c5d9b30e1fef86a75d3b", "score": "0.5688522", "text": "static initFromDiscovery(discoveryNode) {\n const offerCreatedEvents = discoveryNode.data.events.filter(event => event.event === 'OfferCreated')\n\n if (offerCreatedEvents.length === 0)\n throw new Error('Can not find OfferCreated event required to create an Offer object')\n\n return new Offer({\n id: discoveryNode.id,\n listingId: discoveryNode.listing.id,\n status: discoveryNode.status,\n createdAt: discoveryNode.data.createdAt,\n buyer: discoveryNode.buyer.walletAddress,\n events: discoveryNode.data.events,\n refund: discoveryNode.data.refund,\n totalPrice: discoveryNode.data.totalPrice,\n unitsPurchased: discoveryNode.data.unitsPurchased,\n blockInfo: {\n blockNumber: offerCreatedEvents[0].blockNumber,\n logIndex: offerCreatedEvents[0].logIndex\n },\n schemaId: discoveryNode.data.schemaId,\n listingType: discoveryNode.data.listingType,\n ipfs: discoveryNode.data.ipfs\n })\n }", "title": "" }, { "docid": "ad5d888fb285f26e8e5a36c0c6a801a1", "score": "0.5659858", "text": "_onPeer(peer) {\n this.discoveryMap.set(peer.id, {\n port: peer.port,\n address: peer.host,\n connected: false\n })\n // peer.host // remote address\n // peer.port // remote port\n // peer.id // peerId\n // peer.retries // the number of times tried to connect to this peer\n }", "title": "" }, { "docid": "4247d60073f7da8bf0e9c06d409fbc67", "score": "0.5654515", "text": "initRlpx () {\n this.rlpx = new devp2p.RLPx(this.key, {\n dpt: this.dpt,\n maxPeers: this.maxPeers,\n capabilities: RlpxPeer.capabilities(this.protocols),\n remoteClientIdFilter: this.clientFilter,\n listenPort: this.port\n })\n\n this.rlpx.on('peer:added', async (rlpxPeer) => {\n const peer = new RlpxPeer({\n id: rlpxPeer.getId().toString('hex'),\n host: rlpxPeer._socket.remoteAddress,\n port: rlpxPeer._socket.remotePort,\n protocols: Array.from(this.protocols),\n inbound: !!rlpxPeer._socket.server\n })\n try {\n await peer.accept(rlpxPeer, this)\n this.peers.set(peer.id, peer)\n this.logger.debug(`Peer connected: ${peer}`)\n this.emit('connected', peer)\n } catch (error) {\n this.error(error)\n }\n })\n\n this.rlpx.on('peer:removed', (rlpxPeer, reason) => {\n const id = rlpxPeer.getId().toString('hex')\n const peer = this.peers.get(id)\n if (peer) {\n this.peers.delete(peer.id)\n this.logger.debug(`Peer disconnected (${rlpxPeer.getDisconnectPrefix(reason)}): ${peer}`)\n this.emit('disconnected', peer)\n }\n })\n\n this.rlpx.on('peer:error', (rlpxPeer, error) => {\n const peerId = rlpxPeer && rlpxPeer.getId()\n if (!peerId) {\n return this.error(error)\n }\n const id = peerId.toString('hex')\n const peer = this.peers.get(id)\n this.error(error, peer)\n })\n\n this.rlpx.on('error', e => this.error(e))\n\n this.rlpx.on('listening', () => {\n this.emit('listening', {\n transport: this.name,\n url: `enode://${this.rlpx._id.toString('hex')}@[::]:${this.port}`\n })\n })\n\n if (this.port) {\n this.rlpx.listen(this.port, '0.0.0.0')\n }\n }", "title": "" }, { "docid": "22131159cbf15ca378bfb4ea198a17f8", "score": "0.5652524", "text": "async _initialize() {\n\t\tthis._services.forEach((service) => {\n\t\t\tconst serviceName = service.constructor.name;\n\t\t\tconst descriptor = service.descriptor();\n\t\t\tthis._server.addService(descriptor[serviceName].service, service.implementation());\n\t\t});\n\t}", "title": "" }, { "docid": "fca935d4886322807da59f99e250a602", "score": "0.5631358", "text": "constructor (opts : DiscoveryOptions = {}) : void {\n const {\n address = \"discovery.thethings.network:1900\",\n insecure = false,\n certificate,\n } = opts\n\n const credentials =\n insecure\n ? grpc.credentials.createInsecure()\n : grpc.credentials.createSsl(certificate && new Buffer(certificate))\n\n this.client = new discovery.DiscoveryClient(address, credentials)\n }", "title": "" }, { "docid": "ef1f929d4b2d7df8cbd29202101a35b0", "score": "0.55891836", "text": "constructor() { \n \n TunnelOption.initialize(this);\n }", "title": "" }, { "docid": "85b584719e1ee93ccfcc0ea979a8222c", "score": "0.55418706", "text": "function init(){\n\n\t\tvar _params = {\n\t\t\tmongoose:_mongoose,\n\t\t\tvalidate:_validate,\n\t\t\tfs:_fs,\n\t\t\temails:_eMails,\n\t\t\tload:_InitLoad,\n\t\t\tapp:_app,\n\t\t\texpress:_express,\n\t\t\tdebug:Debug.debug\n\t\t};\n\n\t\tvar _loader = require('./load.js')(_params);\n\t\t_Ya = _loader.init();\n\t\t_Ya.deph = _params;\n\n\t\tconnect();\n\t}", "title": "" }, { "docid": "d05b64bff69e5e14642151a90712166c", "score": "0.55354303", "text": "async init() {\n this.initSocket();\n await this.initUserDevices();\n this.addNewDeviceEventHandler();\n }", "title": "" }, { "docid": "560627829287c56a7df247b4da796be1", "score": "0.55059063", "text": "constructor() {\r\n this._resolveFunc = null;\r\n this._rejectFunc = null;\r\n this._webRtcStarted = false;\r\n this._roomName = 'WebRTCHelper';\r\n this._listener = null;\r\n this._isCaller = false;\r\n this._debug = false;\r\n this._uuid = '';\r\n this._peerConnectionConfig = {\r\n 'iceServers': [\r\n { 'urls': 'stun:stun.stunprotocol.org:3478' },\r\n { 'urls': 'stun:stun.l.google.com:19302' },\r\n ]\r\n };\r\n this._dataChannelOptions = {\r\n // ordered: false, // do not guarantee order\r\n // maxPacketLifeTime: 3000, // in milliseconds\r\n };\r\n this._uuid = this._createUUID();\r\n }", "title": "" }, { "docid": "a61c509efde82cbd635b7176a88fbf3e", "score": "0.54994744", "text": "function _init() {\n function find(name, camelCaseName) {\n if (camelCaseName === void 0) { camelCaseName = name.slice(0, 1).toUpperCase() + name.slice(1); }\n var node = document.currentScript || document.querySelector(\"script[data-phovea-\" + name + \"]\");\n if (!node) {\n return undefined;\n }\n return node.dataset['phovea' + camelCaseName];\n }\n var config = {};\n if ('true' === find('offline')) {\n config.offline = true;\n }\n var v;\n if ((v = find('server-url', 'ServerUrl')) !== undefined) {\n config.server_url = v;\n }\n if ((v = find('server-json-suffix', 'ServerJsonSuffix')) !== undefined) {\n config.server_json_suffix = v;\n }\n //init myself\n init(config);\n}", "title": "" }, { "docid": "a61c509efde82cbd635b7176a88fbf3e", "score": "0.54994744", "text": "function _init() {\n function find(name, camelCaseName) {\n if (camelCaseName === void 0) { camelCaseName = name.slice(0, 1).toUpperCase() + name.slice(1); }\n var node = document.currentScript || document.querySelector(\"script[data-phovea-\" + name + \"]\");\n if (!node) {\n return undefined;\n }\n return node.dataset['phovea' + camelCaseName];\n }\n var config = {};\n if ('true' === find('offline')) {\n config.offline = true;\n }\n var v;\n if ((v = find('server-url', 'ServerUrl')) !== undefined) {\n config.server_url = v;\n }\n if ((v = find('server-json-suffix', 'ServerJsonSuffix')) !== undefined) {\n config.server_json_suffix = v;\n }\n //init myself\n init(config);\n}", "title": "" }, { "docid": "a61c509efde82cbd635b7176a88fbf3e", "score": "0.54994744", "text": "function _init() {\n function find(name, camelCaseName) {\n if (camelCaseName === void 0) { camelCaseName = name.slice(0, 1).toUpperCase() + name.slice(1); }\n var node = document.currentScript || document.querySelector(\"script[data-phovea-\" + name + \"]\");\n if (!node) {\n return undefined;\n }\n return node.dataset['phovea' + camelCaseName];\n }\n var config = {};\n if ('true' === find('offline')) {\n config.offline = true;\n }\n var v;\n if ((v = find('server-url', 'ServerUrl')) !== undefined) {\n config.server_url = v;\n }\n if ((v = find('server-json-suffix', 'ServerJsonSuffix')) !== undefined) {\n config.server_json_suffix = v;\n }\n //init myself\n init(config);\n}", "title": "" }, { "docid": "bcf982fb69937995f7c5638bb1128865", "score": "0.5443442", "text": "function initialize() {\n const log = _logs.logManager.getLogger('WebRTC');\n\n const browserDetails = (0, _utils.getBrowserDetails)();\n if (browserDetails.version) {\n log.debug(`Browser details: ${browserDetails.browser}, version ${browserDetails.version}.`);\n } else {\n log.debug('Browser details: Not supported by webRTC adapter.');\n }\n\n const deviceManager = new _deviceManager2.default();\n const trackManager = new _trackManager2.default();\n const mediaManager = new _mediaManager2.default({ trackManager });\n const peerManager = new _peerManager2.default({ trackManager });\n const sessionManager = new _sessionManager2.default({\n peerManager,\n mediaManager,\n trackManager\n });\n const webrtcManager = new _webrtcManager2.default();\n\n return {\n models: {\n Track: _track2.default,\n Media: _media2.default,\n Peer: _Peer2.default\n },\n // TODO: Make naming consistent.\n managers: {\n devices: deviceManager,\n media: mediaManager,\n peerManager: peerManager,\n sessionManager,\n track: trackManager,\n // Give access to the Log Manager.\n // TODO: Don't include it under managers. It's here now because of\n // ProxyStack annoyingness.\n logs: _logs.logManager,\n webrtcManager\n },\n sdp: {\n pipeline: _pipeline2.default,\n handlers: sdpHandlers\n },\n // Export this on the webRTC stack for backwards compatibility.\n getBrowserDetails: _utils.getBrowserDetails\n };\n}", "title": "" }, { "docid": "51d2e65fcfd3b1490fa76be41a819480", "score": "0.54187226", "text": "async init() {\n const defaultOrganization = this.connectorConfiguration.getOrganizations()[0];\n const tlsInfo = this.connectorConfiguration.isMutualTLS() ? 'mutual'\n : ((await this.connectorConfiguration.getConnectionProfileDefinitionForOrganization(defaultOrganization)).isTLSEnabled() ? 'server' : 'none');\n logger.info(`Fabric-Gateway SDK version: ${this.fabricGatewayVersion.toString()} for Peer-Gateway connector; TLS based on ${defaultOrganization}: ${tlsInfo}`);\n }", "title": "" }, { "docid": "bc4f9ddb5e128e7c4948f19ab04cd724", "score": "0.5385704", "text": "initialize() {\n this.listenTo(this.owner, {\n [converter_1.Converter.EVENT_RESOLVE]: this.onResolve,\n }, undefined, -200);\n }", "title": "" }, { "docid": "4b7ac4176fce92a0596bc88ea8fa9294", "score": "0.5384797", "text": "function init() {\n // Connection test indicator\n war(str['testing']);\n // Get IP\n getFetch(ipUrl).then((res) => {\n // Check get IP success\n if (res.status !== 200) {\n errCon();\n return;\n }\n return res.text();\n }).then((text) => {\n // Assign server IP\n ip = `${text.trim()}:38080`;\n // Contact server to test connection\n time();\n }).catch(errCon);\n}", "title": "" }, { "docid": "a47971f38c04e90d6653e86fcd6b1b81", "score": "0.5383809", "text": "init() {\n if (typeof this.initPromise != \"undefined\") return this.initPromise;\n this.startConnection = Date.now();\n this.initPromise = _testConnectionLoop.call(this).then(\n id => {\n let option =\n \"http://\" +\n id +\n \":\" +\n this.spinalPassword +\n \"@\" +\n this.spinalHost +\n \":\" +\n this.spinalPort +\n \"/\";\n this.conn = spinalCore.connect(option);\n return this.conn;\n },\n err => {\n this.initPromise = undefined;\n throw err;\n }\n );\n return this.initPromise;\n }", "title": "" }, { "docid": "b3f754f21b59537cfe64e11a623c300f", "score": "0.5378674", "text": "init() {\n this.initService();\n }", "title": "" }, { "docid": "edde65da53c29e04cdf25851a4ecba9a", "score": "0.5371697", "text": "async init () {\r\n await this._getAvailableDevices();\r\n }", "title": "" }, { "docid": "0eedbb6b2a22031764661e5fc6cb661a", "score": "0.5362558", "text": "async initPolkadotRPC() {\n this.api = new ApiPromise({\n provider: new WsProvider(\n this.network.rpc_url || this.network.public_rpc_url\n )\n })\n this.store.polkadotRPC = this.api\n this.store.polkadotRPCOpened = Date.now()\n await this.api.isReady\n console.log('Polkadot initialized')\n }", "title": "" }, { "docid": "e312a51be665b3b6168690b81b093433", "score": "0.53514856", "text": "async init() {\n this._listenEvents();\n await this._createConnection();\n }", "title": "" }, { "docid": "9b7f16cd3693995e2a1305a55e329dbd", "score": "0.5346855", "text": "start () {\n this.on('peer', peer => {\n let newpeer = false\n if (!this.peers[peer.id]) {\n newpeer = true\n this.peers[peer.id] = {}\n this.responseWaiting[peer.id] = {}\n }\n\n peer.on('connect', () => {\n /**\n * Multiple data channels to one peer is possible\n * The `peer` object actually refers to a peer with a data channel. Even though it may have same `id` (peerID) property, the data channel will be different. Different trackers giving the same \"peer\" will give the `peer` object with different channels.\n * We will store all channels as backups in case any one of them fails\n * A peer is removed if all data channels become unavailable\n */\n this.peers[peer.id][peer.channelName] = peer\n\n if (newpeer) {\n this.emit('peerconnect', peer)\n }\n })\n\n peer.on('data', data => {\n this.emit('data', peer, data)\n\n data = data.toString()\n\n debug('got a message from ' + peer.id)\n\n if (data[0] === JSON_MESSAGE_IDENTIFIER) {\n try {\n data = JSON.parse(data.slice(1))\n\n // A respond function\n peer.respond = this._peerRespond(peer, data.id)\n\n let msg = this._chunkHandler(data)\n\n // msg fully retrieved\n if (msg !== false) {\n if (data.o) {\n msg = JSON.parse(msg)\n }\n\n /**\n * If there's someone waiting for a response, call them\n */\n if (this.responseWaiting[peer.id][data.id]) {\n this.responseWaiting[peer.id][data.id]([peer, msg])\n delete this.responseWaiting[peer.id][data.id]\n } else {\n this.emit('msg', peer, msg)\n }\n this._destroyChunks(data.id)\n }\n } catch (e) {\n console.log(e)\n }\n }\n })\n\n peer.on('error', err => {\n this._removePeer(peer)\n debug('Error in connection : ' + err)\n })\n\n peer.on('close', () => {\n this._removePeer(peer)\n debug('Connection closed with ' + peer.id)\n })\n })\n\n // Tracker responded to the announce request\n this.on('update', response => {\n const tracker = this.trackers[this.announceURLs.indexOf(response.announce)]\n\n this.emit(\n 'trackerconnect',\n tracker,\n this.getTrackerStats()\n )\n })\n\n // Errors in tracker connection\n this.on('warning', err => {\n this.emit(\n 'trackerwarning',\n err,\n this.getTrackerStats()\n )\n })\n\n this._fetchPeers()\n }", "title": "" }, { "docid": "429e61f30c5dbb5c9f22b6d9fb859040", "score": "0.5343495", "text": "function initClient() {\n // RTCPeerConnection(servers) anyways same as lc;\n // Locally run so no servers\n rc = new RTCPeerConnection();\n // console Created remote peer conn. WHATEVER\n\n rc.onicecandidate = (event) => {\n if (event.candidate) {\n //send to host\n //SEE DESCRIPTION IN HOST_SIGNALLING\n //showOnConfigBox(event.candidate);\n } else {\n //No candidate.. Yo want me to dance??\n }\n };\n\n rc.ondatachannel = (event) => {\n // if other party ANYONE creates dataChannel\n // This is found only\n rdc = event.channel;\n rdc.onopen = (e) => {\n enableSending();\n declaration(\"Hey, You can message officially now!!!\");\n };\n rdc.onclose = (e) => {\n disableSending();\n declaration(\"Fuck, where did it go wrong or did you close it??\");\n };\n rdc.onmessage = (e) => {\n console.log(e.data);\n //when message is received put in document\n }\n //Below is tha official code but we want simplicity\n /*event.channel.onopen = (e) => {\n declaration(\"Data Channel is officially open\");\n rdc = e.channel;\n //Data channel fully opened and ready for exchange\n enableSending();\n };*/\n };\n}", "title": "" }, { "docid": "5e29bdd74b55af7b1419086987f69a0d", "score": "0.5335659", "text": "setup() {\n\t\tconsole.log(\"delay setup\");\n\t\tthis.createNodes();\n\t\tthis.connectNodes();\n\t\tthis.linktoParams();\n\t}", "title": "" }, { "docid": "30a71a2da4ee6daefcb0d503ef5c41ac", "score": "0.5329571", "text": "init() {\n // bind events\n this.bindEvents();\n // setup stripe\n this.setupStripe();\n }", "title": "" }, { "docid": "4d4affd44da2d604ed5ebcc006b30ba5", "score": "0.53035486", "text": "function init( createOffer, partnerName ) {\n pc[partnerName] = new RTCPeerConnection( h.getIceServer() ); //making peer connection\n\n if ( screen && screen.getTracks().length ) {\n screen.getTracks().forEach( ( track ) => {\n pc[partnerName].addTrack( track, screen );//should trigger negotiationneeded event\n } );\n }\n\n else if ( myStream ) {\n myStream.getTracks().forEach( ( track ) => {\n pc[partnerName].addTrack( track, myStream );//should trigger negotiationneeded event\n } );\n }\n\n else {\n h.getUserFullMedia().then( ( stream ) => {\n //save my stream\n myStream = stream;\n\n stream.getTracks().forEach( ( track ) => {\n pc[partnerName].addTrack( track, stream );//should trigger negotiationneeded event\n } );\n\n h.setLocalStream( stream );\n } ).catch( ( e ) => {\n console.error( `stream error: ${ e }` );\n } );\n }\n\n //create offer\n if ( createOffer ) {\n pc[partnerName].onnegotiationneeded = async (e) => {\n console.log('nego starts')\n \n\n let offer = await pc[partnerName].createOffer();\n\n await pc[partnerName].setLocalDescription( offer );\n\n socket.emit( 'sdp', { description: pc[partnerName].localDescription, to: partnerName, sender: socketId } );\n };\n }\n\n //send ice candidate to partnerNames\n pc[partnerName].onicecandidate = ( { candidate } ) => {\n socket.emit( 'ice candidates', { candidate: candidate, to: partnerName, sender: socketId } );\n };\n\n const shareOptionLabelOnHTMLAudio =\"Audio Sharing is <span style='color:green;'>ON</span>\"\n const shareOptionLabelOffHTMLAudio = \"Audio Sharing is <span style='color:red;'>OFF</span>\"\n // Audio check\n const handleCheckAudio = (e) => {\n e.preventDefault();\n const isChecked = e.target.checked;\n let shareOptionLabel = e.target.nextSibling;\n const selectedPeerConn = pc[e.target.value];\n let audioSender = selectedPeerConn.getSenders().find(sender => sender.track?.kind==='audio' || sender.dtmf !== null) // I assume audio senders have dtmf property\n if(isChecked){ //Turning on the audio share\n shareOptionLabel.innerHTML = shareOptionLabelOnHTMLAudio;\n audioSender.replaceTrack(myStream.getAudioTracks()[0]);\n }else{ //Turning off the audio share\n shareOptionLabel.innerHTML = shareOptionLabelOffHTMLAudio;\n audioSender.replaceTrack(null);\n\n }\n \n\n }\n\n const shareOptionLabelOnHTML =\"Video Sharing is <span style='color:green'>ON</span>\"\n const shareOptionLabelOffHTML = \"Video Sharing is <span style='color:red'>OFF</span>\"\n //this function handles peer connection stream when user click video sharing option\n const handleCheckVideo = (e)=>{\n e.preventDefault();\n let isChecked = e.target.checked;\n let shareOptionLabel = e.target.nextSibling;\n const selectedPeerConn = pc[e.target.value];\n let videoSender = selectedPeerConn.getSenders().find(sender => sender.track?.kind==='video' || sender.dtmf === null) // I assume that video senders have dtmf property\n \n \n\n \n \n if(isChecked){ //Turning on the video share\n shareOptionLabel.innerHTML = shareOptionLabelOnHTML;\n videoSender.replaceTrack(myStream.getVideoTracks()[0]);\n socket.emit('videoSharing',{status:'on',to:e.target.value,sender:socketId,test:myStream.getVideoTracks()[0],room}); \n\n }else{ //Turning off the video share\n shareOptionLabel.innerHTML = shareOptionLabelOffHTML;\n videoSender.replaceTrack(null);\n socket.emit('videoSharing',{status:'off',to:e.target.value,sender:socketId,room});\n\n }\n\n }\n\n //add\n pc[partnerName].ontrack = ( e ) => {\n\n console.log('on track')\n let str = e.streams[0];\n pcMediaStreams[partnerName] = str;\n const audioStreamOnly = new MediaStream(str.getAudioTracks());\n const videoPlaceHolderImg='image/videoImage.png';\n \n\n //setting the main video\n if ( document.getElementById( `host` ) ) {\n if(partnerName === hostId){ //if connected pc is the host show it on the main video\n document.getElementById( `host` ).querySelector('video').srcObject = e.streams[0];\n mainUserEle.value = partnerName;\n console.log('yes host')\n }else{\n console.log('no host')\n }\n }\n\n if ( document.getElementById( `${ partnerName }-video` ) ) {\n if(partnerName===hostId){ //If the partner is the host, show there screen on a card\n document.getElementById( `${ partnerName }-video` ).srcObject = str\n }else{ //\n document.getElementById( `${ partnerName }-video` ).srcObject = audioStreamOnly;\n document.getElementById( `${ partnerName }-video` ).poster = videoPlaceHolderImg;\n }\n \n }\n\n else {\n //video elem\n let newVid = document.createElement( 'video' );\n newVid.id = `${ partnerName }-video`;\n newVid.autoplay = true;\n newVid.className = 'remote-video';\n if(partnerName===hostId){ //If the partner is the host, show there screen on a card\n newVid.srcObject = str\n }else{\n newVid.srcObject = audioStreamOnly;\n newVid.poster = videoPlaceHolderImg;\n }\n\n let newVidDiv = document.createElement('div');\n\n newVidDiv.classList.add('vid-div'); //vid-div contains video and control panel\n\n //video controls elements\n let controlDiv = document.createElement( 'div' );\n controlDiv.className = 'remote-video-controls';\n controlDiv.innerHTML = `<i class=\"fa fa-microphone text-white pr-3 mute-remote-mic\" title=\"Mute\"></i>\n <i class=\"fa fa-expand text-white expand-remote-video\" title=\"Expand\"></i>`;\n\n\n //==========================================================================================================\n //Share Options\n //==========================================================================================================\n\n\n\n let peerNameLabel = document.createElement('label');\n peerNameLabel.className = \"user-name\";\n peerNameLabel.innerHTML = partnerName===hostId ? `<h1>${pcUsernames[partnerName]} (HOST)</h1>`: `<h1>${pcUsernames[partnerName]}</h1>`;\n peerNameLabel.style=\"display:block\";\n let shareOptionControl = document.createElement('div');\n let shareOptionControlAudio = document.createElement('div');\n\n shareOptionControl.classList.add('share-option-control');\n shareOptionControlAudio.classList.add('share-option-control-audio');\n\n let videoShareOption = document.createElement('input');\n videoShareOption.type=\"checkbox\";\n\n if(socketId === hostId) //if the user is host, leave the video sharing is checked intially\n videoShareOption.checked= true;\n else\n videoShareOption.checked= false;\n videoShareOption.value = partnerName;\n videoShareOption.style= \"transform: scale(2);margin-left:2em; margin-right:1em;\";\n videoShareOption.addEventListener('change',handleCheckVideo);\n\n let audioShareOption = document.createElement('input');\n audioShareOption.type=\"checkbox\";\n audioShareOption.checked= true;\n audioShareOption.value = partnerName;\n audioShareOption.style= \"transform: scale(2);margin-left:2em; margin-right:1em;\";\n audioShareOption.addEventListener('change',handleCheckAudio);\n\n let shareOptionLabel = document.createElement('label');\n shareOptionLabel.innerHTML = videoShareOption.checked? shareOptionLabelOnHTML : shareOptionLabelOffHTML\n\n let shareOptionLabelAudio = document.createElement('label');\n shareOptionLabelAudio.innerHTML = audioShareOption.checked ? shareOptionLabelOnHTMLAudio : shareOptionLabelOffHTMLAudio\n\n\n let setMainBtn = document.createElement('button');\n setMainBtn.innerHTML = 'pin to main';\n setMainBtn.addEventListener('click',(btnEvent)=>{\n h.setMainStream(e.streams[0]);\n })\n\n shareOptionControl.appendChild(peerNameLabel);\n shareOptionControl.appendChild(videoShareOption);\n shareOptionControl.appendChild(shareOptionLabel)\n \n\n shareOptionControlAudio.appendChild(audioShareOption);\n shareOptionControlAudio.appendChild(shareOptionLabelAudio)\n\n \n\n //create a new div for card\n let cardDiv = document.createElement( 'div' );\n cardDiv.className = 'card card-sm';\n cardDiv.id = partnerName;\n\n newVidDiv.appendChild(newVid);\n newVidDiv.appendChild(controlDiv);\n cardDiv.appendChild(newVidDiv)\n cardDiv.appendChild(shareOptionControl);\n cardDiv.appendChild(shareOptionControlAudio);\n cardDiv.appendChild(setMainBtn);\n\n\n //==========================================================================================================\n\n\n //put div in main-section elem\n document.getElementById( 'videos' ).appendChild( cardDiv );\n\n h.adjustVideoElemSize();\n }\n };\n\n\n\n pc[partnerName].onconnectionstatechange = ( d ) => {\n switch ( pc[partnerName].iceConnectionState ) {\n case 'disconnected':\n case 'failed':\n h.closeVideo( partnerName );\n break;\n\n case 'closed':\n h.closeVideo( partnerName );\n break;\n }\n };\n\n\n\n\n pc[partnerName].onsignalingstatechange = ( d ) => {\n switch ( pc[partnerName].signalingState ) {\n case 'closed':\n console.log( \"Signalling state is 'closed'\" );\n h.closeVideo( partnerName );\n break;\n }\n };\n }", "title": "" }, { "docid": "d6fe1dca973bce08982bba11aff1774f", "score": "0.5294479", "text": "function DNSserviceDiscovery() {\n this.serviceState = false;\n if (false) {} else if (TunnelService.hasCertificates()) {\n this.port = config.get('ports.https');\n } else {\n this.port = config.get('ports.http');\n }\n this.localDomain = config.get(\n 'settings.defaults.domain.localControl.mdnsServiceDomain');\n this.localName = config.get(\n 'settings.defaults.domain.localControl.mdnsServiceName');\n this.protocol = config.get(\n 'settings.defaults.domain.localControl.mdnsTxt.protocol');\n this.power = config.get(\n 'settings.defaults.domain.localControl.mdnsTxt.power');\n this.description = config.get(\n 'settings.defaults.domain.localControl.mdnsTxt.desc');\n const txt = {desc: this.description,\n protocols: this.protocol,\n power: this.power};\n const options = {name: this.localName, host: this.localDomain, txt};\n\n this.handleError = (e) => {\n console.debug(`mDNS error: ${e}`);\n setTimeout(() => {\n if (this.serviceState) {\n this.dnssdHandle.start();\n }\n }, 10000);\n };\n\n // Initialize our object and make sure it's not started on object creation.\n this.dnssdHandle =\n dnssd.Advertisement(dnssd.tcp('http'), this.port, options);\n this.dnssdHandle.on('error', this.handleError);\n this.dnssdHandle.stop();\n}", "title": "" }, { "docid": "11bd2f5b602ac95267212176e84bf26d", "score": "0.5293707", "text": "initialize() {\n this.rtc = new this.wrtc.RTCPeerConnection(this.RTCSettings);\n this.makeDataChannel();\n this.rtc.createOffer(desc => {\n this.rtc.setLocalDescription(desc, () => {}, this.handleErr);\n }, this.handleErr);\n this.rtc.onicecandidate = c => {\n if (c.candidate == null) {\n this.sendOffer();\n }\n }\n this.rtc.oniceconnectionstatechange = () => {\n if (this.rtc.iceConnectionState == \"disconnected\") {\n this.emit('disconnect')\n }\n if (this.rtc.iceConnectionState == \"failed\" || this.rtc.iceConnectionState == \"closed\") {\n this.emit('disconnect')\n }\n }\n\n //for chaining methods\n return this;\n }", "title": "" }, { "docid": "48131254e604eff93fa205186599f03f", "score": "0.5293639", "text": "async init() {\n this.protoroot = await protobuf.load(`${__dirname}/protobuf/sync.proto`);\n this.socket = new Subscriber();\n this.socket.connect(this.remoteNodeAddress);\n this.socket.subscribe();\n this.heartbeatTimer = setInterval(\n () => this.checkHeartbeat(),\n this.heartbeatDelay\n );\n\n this.listen();\n }", "title": "" }, { "docid": "a05532090fff37226103dac2251794c8", "score": "0.529183", "text": "function setupPeer() {\n\n console.log(\"Setting up Peer\");\n /**\n * An RTCConfiguration may look like this:\n *\n * { \"iceServers\": [ { urls: \"stun:stun.example.org\", },\n * { url: \"stun:stun.example.org\", }, // deprecated version\n * { urls: [\"turn:turn1.x.org\", \"turn:turn2.x.org\"],\n * username:\"jib\", credential:\"mypass\"} ] }\n *\n * This function normalizes the structure of the input for rtcConfig.iceServers for us,\n * so we test well-formed stun/turn urls before passing along to C++.\n * msg - Error message to detail which array-entry failed, if any.\n */\n\n \n\n // create the peer connection\n pc = new RTCPeerConnection(CONFIG);\n\n // connect audio / video\n pc.addEventListener(\"track\", function(evt) {\n console.log(\"got track event: \", evt);\n if (evt.track.kind == \"video\") {\n _video.srcObject = evt.streams[0];\n } else {\n _audio.srcObject = evt.streams[0];\n }\n });\n\n pc.onconnectionstatechange = function(evt){\n console.log(\"WTC Connection State Change:\", evt);\n console.log(\"Connection State: \", pc.connectionState);\n peerConnectionStateTxt.textContent = pc.connectionState;\n if (pc.connectionState === 'connected'){\n rtcConnectionProgress.classList.remove('is-active');\n }\n }\n\n pc.oniceconnectionstatechange = function(evt){\n console.log(\"ICE Connection State Change:\", evt);\n iceConnectionStateTxt.textContent = pc.iceConnectionState;\n }\n\n pc.onicegatheringstatechange = function(evt){\n console.log(\"Ice Gathering State Change: \", evt);\n iceGatheringStateTxt.textContent = pc.iceGatheringState;\n }\n\n pc.onsignalingstatechange = function(evt){\n console.log(\"Peer Signal State Change: \", evt);\n signalStateTxt.textContent = pc.signalingState;\n }\n\n // data channel\n //{ordered: false, maxRetransmits:0, maxPacketLifetime:500} // Unordered, 500ms lifetime, no retransmissions\n const dataChannelParameters = {ordered: true};\n // generic ping pong connection channel\n /*\n dc = pc.createDataChannel(\"chat\", dataChannelParameters);\n dc.onclose = function() {\n clearInterval(dcInterval);\n dataChannelLog.textContent += \"- close\\n\";\n };\n dc.onopen = function() {\n dataChannelLog.textContent += \"- open\\n\";\n dcInterval = setInterval(function() {\n const message = \"ping \" + current_stamp();\n dataChannelLog.textContent += \"> \" + message + \"\\n\";\n dc.send(message);\n }, 1000);\n };\n dc.onmessage = function(evt) {\n console.log(evt);\n dataChannelLog.textContent += \"< \" + evt.data + \"\\n\";\n\n if (evt.data.substring(0, 4) === \"pong\") {\n const elapsed_ms = current_stamp() - parseInt(evt.data.substring(5), 10);\n dataChannelLog.textContent += \" RTT \" + elapsed_ms + \" ms\\n\";\n }\n };\n */\n\n //create a data channel to send gamepad inputs to connected robot\n gpdc = pc.createDataChannel(\"gamepad\", dataChannelParameters);\n gpdc.onclose = function() {\n console.log(\"closed gamepad channel\");\n clearInterval(gpdcInterval);\n };\n gpdc.onopen = function() {\n console.log(\"opened gamepad channel\");\n gpdcInterval = setInterval(function() {\n let message = {};\n if (gp !== null && gp !== undefined) {\n message = JSON.stringify({\n id: gp.id,\n state: gp.state,\n ts: gp.timestamp\n });\n }\n else if(joystick !== null && joystick !== undefined){\n message = JSON.stringify({\n id: 'VirtualJoystick',\n state: joystick.state,\n ts: Date.now()\n });\n }\n \n dataChannelLog.textContent += \"> \" + message + \"\\n\"; \n if(gpdc.readyState === 'open'){\n gpdc.send(message);\n }\n\n }, GAMEPAD_SEND_RATE);\n };\n gpdc.onmessage = function(evt) {\n console.log(evt);\n // not really taking in messages from other peer yet, but can be implemented\n dataChannelLog.textContent += \"< \" + evt.data + \"\\n\";\n };\n\n console.log(\"RTCPeerConnection object was created\");\n console.log(pc);\n\n //setup ice handling\n //when the browser finds an ice candidate we send it to another peer\n pc.onicecandidate = function(event) {\n if (event.candidate) {\n send({\n type: \"candidate\",\n candidate: event.candidate\n });\n }\n };\n}", "title": "" }, { "docid": "7b13bac0108227713ba6987bd03e7cb7", "score": "0.5290575", "text": "constructor() {\n\n this._connect();\n }", "title": "" }, { "docid": "30a6d86cc7192ac755543ff3a0fa3ce6", "score": "0.5289609", "text": "async init() {\n await super.init()\n const { clientId, clientSecret, discovery } = this.config\n const issuer = await Issuer.discover(discovery)\n this.client = new issuer.Client({ client_id: clientId, client_secret: clientSecret })\n this.userMappings.push(...this.vendorMappings)\n }", "title": "" }, { "docid": "9f3cdaa7ef68db725866eb4c910b7c04", "score": "0.52744764", "text": "initiateConnection() {\n var offerOptions = {\n offerToReceiveAudio: 1,\n offerToReceiveVideo: 1,\n }\n\n this.peerConnection.createOffer(this.onCreateOfferSuccess.bind(this), this.onCreateSessionDescriptionError.bind(this), offerOptions)\n }", "title": "" }, { "docid": "5e856cc7facb390eb3023b53f47751e3", "score": "0.5269003", "text": "async onReady() {\r\n\t\t// Initialize your adapter here\r\n\r\n\t\t// The adapters config (in the instance object everything under the attribute \"native\") is accessible via\r\n\t\t// this.config:\r\n\t\tthis.log.info(\"config option1: \" + this.config.option1);\r\n\t\tthis.log.info(\"config option2: \" + this.config.option2);\r\n\t\tthis.log.info(\"config optionIPAddr: \" + this.config.optionIPAddr);\r\n\t\tthis.log.info(\"Hi there!\");\r\n\r\n\r\n\t\tconst servient = new Servient();\r\n\t\tservient.addClientFactory(new HttpClientFactory(null));\r\n\t\tconst WoTHelpers = new Helpers(servient);\r\n\r\n\r\n\r\n\t\t/*\r\n\t\tFor every state in the system there has to be also an object of type state\r\n\t\tHere a simple template for a boolean variable named \"testVariable\"\r\n\t\tBecause every adapter instance uses its own unique namespace variable names can't collide with other adapters variables\r\n\t\t*/\r\n\t\t// await this.setObjectNotExistsAsync(\"testVariable\", {\r\n\t\t// \ttype: \"state\",\r\n\t\t// \tcommon: {\r\n\t\t// \t\tname: \"testVariable\",\r\n\t\t// \t\ttype: \"boolean\",\r\n\t\t// \t\trole: \"indicator\",\r\n\t\t// \t\tread: true,\r\n\t\t// \t\twrite: true,\r\n\t\t// \t},\r\n\t\t// \tnative: {},\r\n\t\t// });\r\n\r\n\r\n\t\tawait this.createDevice(\"plantDevice\");\r\n\t\tawait this.createChannel(\"plantDevice\", \"plantSensorChannel\");\r\n\t\tawait this.createChannel(\"plantDevice\", \"plantActionChannel\");\r\n\t\tawait this.createChannel(\"plantDevice\", \"plantEventChannel\");\r\n\r\n\t\t// this.createState(\"plantDevice\", \"plantSensorChannel\", \"testState\", {\r\n\t\t// \tname: \"testState\",\r\n\t\t// \ttype: \"string\",\r\n\t\t// \trole: \"indicator\",\r\n\t\t// \tread: true,\r\n\t\t// \twrite: true,\r\n\t\t// });\r\n\r\n\t\tWoTHelpers.fetch(\"http://\" + this.config.optionIPAddr + \"/\").then(async (td) => {\r\n\t\t\ttry {\r\n\t\t\t\tservient.start().then(async (WoT) => {\r\n\t\t\t\t\t// Then from here on you can consume the thing\r\n\t\t\t\t\tthis.thing = await WoT.consume(td);\r\n\r\n\t\t\t\t\tawait this.createThingProperties(this.thing);\r\n\t\t\t\t\tthis.updateThingPropertiesInterval = setInterval(() => this.updateThingProperties(this.thing) , 10000);\r\n\r\n\t\t\t\t\tawait this.createThingActions(this.thing);\r\n\t\t\t\t\tawait this.subscribeThingEvents(this.thing);\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tcatch (err) {\r\n\t\t\t\tthis.log.error(\"Script error:\" + err);\r\n\t\t\t}\r\n\t\t}).catch((err) => { this.log.error(\"Fetch error:\" + err); });\r\n\r\n\t/*\r\n\t\t// In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.\r\n\t\tthis.subscribeStates(\"testVariable\");\r\n\t\t// You can also add a subscription for multiple states. The following line watches all states starting with \"lights.\"\r\n\t\t// this.subscribeStates(\"lights.*\");\r\n\t\t// Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system:\r\n\t\t// this.subscribeStates(\"*\");\r\n\r\n\t\t//\tsetState examples\r\n\t\t//\tyou will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd)\r\n\r\n\t\t// the variable testVariable is set to true as command (ack=false)\r\n\t\tawait this.setStateAsync(\"testVariable\", true);\r\n\r\n\t\t// same thing, but the value is flagged \"ack\"\r\n\t\t// ack should be always set to true if the value is received from or acknowledged from the target system\r\n\t\tawait this.setStateAsync(\"testVariable\", { val: true, ack: true });\r\n\r\n\t\t// same thing, but the state is deleted after 30s (getState will return null afterwards)\r\n\t\tawait this.setStateAsync(\"testVariable\", { val: true, ack: true, expire: 30 });\r\n\r\n\t\t// examples for the checkPassword/checkGroup functions\r\n\t\tlet result = await this.checkPasswordAsync(\"admin\", \"iobroker\");\r\n\t\tthis.log.info(\"check user admin pw iobroker: \" + result);\r\n\r\n\t\tresult = await this.checkGroupAsync(\"admin\", \"admin\");\r\n\t\tthis.log.info(\"check group user admin group admin: \" + result);\r\n\t*/\r\n\t}", "title": "" }, { "docid": "b21e35d3b8d9f959a1ba0a6b9511bd9a", "score": "0.52607244", "text": "constructor(ctx) {\n this.log = ctx.logger;\n this.emitter = ctx.emitter;\n this.kademliaUtilities = ctx.kademliaUtilities;\n this.notifyError = ctx.notifyError;\n\n kadence.constants.T_RESPONSETIMEOUT = parseInt(config.request_timeout, 10);\n if (parseInt(config.test_network, 10)) {\n this.log.warn('Node is running in test mode, difficulties are reduced');\n process.env.kadence_TestNetworkEnabled = config.test_network;\n kadence.constants.SOLUTION_DIFFICULTY = kadence.constants.TESTNET_DIFFICULTY;\n kadence.constants.IDENTITY_DIFFICULTY = kadence.constants.TESTNET_DIFFICULTY;\n }\n this.index = parseInt(config.child_derivation_index, 10);\n\n // Initialize private extended key\n utilities.createPrivateExtendedKey(kadence);\n }", "title": "" }, { "docid": "17579ab1303777bac5129d66bfbdd9c4", "score": "0.52479786", "text": "initSocket() {\n this._sender = dgram.createSocket('udp4');\n this._sender.unref();\n\n this._sender.on('error', () => {\n this._sender = null;\n this.initSocket();\n });\n }", "title": "" }, { "docid": "641cdf785fa30556be485a0cfc417c1c", "score": "0.52462137", "text": "async function initialize() {\n\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = async function ($evt) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n let res = JSON.parse(xhr.responseText);\n console.log(\"response: \", res.v.iceServers);\n peer = new Peer(null, {\n host: 'mypeer1505.herokuapp.com',\n path: '/',\n secure: true,\n config: res.v.iceServers,\n // debug: 2\n });\n\n\n peer.on('open', function (id) {\n // Workaround for peer.reconnect deleting previous id\n if (peer.id === null) {\n console.log('Received null id from peer open');\n peer.id = lastPeerId;\n } else {\n lastPeerId = peer.id;\n }\n\n console.log('ID: ' + peer.id);\n });\n peer.on('disconnected', function () {\n status.innerHTML = \"Connection lost. Please reconnect\";\n console.log('Connection lost. Please reconnect');\n\n // Workaround for peer.reconnect deleting previous id\n peer.id = lastPeerId;\n peer._lastServerId = lastPeerId;\n peer.reconnect();\n });\n peer.on('close', function () {\n conn = null;\n status.innerHTML = \"Connection destroyed. Please refresh\";\n console.log('Connection destroyed');\n });\n peer.on('error', function (err) {\n console.log(err);\n alert('' + err);\n });\n\n\n }\n }\n xhr.open(\"PUT\", \"https://global.xirsys.net/_turn/PeerJSDemo\", true);\n xhr.setRequestHeader(\"Authorization\", \"Basic \" + btoa(\n \"longly151:90ea43f6-dac5-11e9-8a2d-0242ac110007\"));\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify({\n \"format\": \"urls\"\n }));\n // Create own peer object with connection to shared PeerJS server\n\n\n // peer = new Peer(null, {\n // host: 'localhost',\n // port: 3000,\n // path: '/',\n // // secure: true,\n // debug: 2\n // });\n\n }", "title": "" }, { "docid": "bd9f780cca2e4872449026518099df0f", "score": "0.5242227", "text": "constructor() { \n \n Connect.initialize(this);\n }", "title": "" }, { "docid": "3b88d84a976f5ddf1b72b9088a56e41b", "score": "0.52389646", "text": "function init() {\n\n // When Cordovia is loaded and talking to the device, initialize it\n navigator.bootstrap.addConstructor(function() {\n attachListeners();\n });\n }", "title": "" }, { "docid": "cfce32dbd5c54797d433cecebcb9b506", "score": "0.5238515", "text": "function init(){\n _loadTrackingParams();\n }", "title": "" }, { "docid": "cfce32dbd5c54797d433cecebcb9b506", "score": "0.5238515", "text": "function init(){\n _loadTrackingParams();\n }", "title": "" }, { "docid": "279dc416e0fc42a4b03087b9559145ae", "score": "0.5237654", "text": "function createPeerClientObject() {\n var startTime = window.performance.now();\n state.peerConnection = new PeerConnectionClient();\n}", "title": "" }, { "docid": "80038eb28b2ddadb6e0a27342821abca", "score": "0.5230299", "text": "function initialize() {\n // Initialize destination settings.\n destinationSettings.setSetting('recentDestinations', []);\n destinationSettings.appKioskMode = false;\n destinationSettings.init(\n '' /* printerName */, false, isDriveMounted,\n '' /* serializedDefaultDestinationSelectionRulesStr */,\n [] /* accounts */, true /* syncAvailable */);\n destinationSettings.state = State.READY;\n destinationSettings.disabled = false;\n }", "title": "" }, { "docid": "6e81b27e5cdb2b96e546b8fbe5ff9d0c", "score": "0.5226378", "text": "_fetchPeers () {\n for (const key in this.announceURLs) {\n this.trackers[key] = new WebSocketTracker(this, this.announceURLs[key])\n this.trackers[key].announce(this._defaultAnnounceOpts())\n }\n }", "title": "" }, { "docid": "2ba045ff8df2b5bdbb951cee5dbce78a", "score": "0.521597", "text": "function initOffer() {\n\t if (!pc) {\n\t return;\n\t }\n\n\t if (that.state.receiveOnly) {\n\t makeOptionsReceiveOnly(offerOptions);\n\t }\n\n\t if (that.state.sendOnly) {\n\t makeOptionsSendOnly(offerOptions);\n\t }\n\n\t log.info('creating offer', offerOptions);\n\n\t pc.createOffer(function saveOfferAndSend(oSession) {\n\t oSession.type = 'offer';\n\t if (!pc) {\n\t return;\n\t }\n\t log.debug('setting and sending offer', oSession);\n\t that.report.sdpsSent.push(oSession);\n\n\t pc.setLocalDescription(oSession, function successHandler(p) {\n\t oSession.type = 'offer';\n\t signalOffer({\n\t call: that.call,\n\t sessionDescription: oSession,\n\t onSuccess: function () {\n\t that.state.sentSDP = true;\n\t localCandidatesFSM.dispatch('ready');\n\t },\n\t onError: function (err) {\n\t log.error('offer could not be sent', err);\n\t that.call.hangup({signal: false});\n\t }\n\t });\n\t }, function errorHandler(p) {\n\t var errorMessage = 'Error calling setLocalDescription on offer I created.';\n\t var err = new Error(errorMessage);\n\t log.error(errorMessage, p);\n\t /**\n\t * This event is fired on errors that occur during call setup or media negotiation.\n\t * @event respoke.Call#error\n\t * @type {respoke.Event}\n\t * @property {string} reason - A human readable description about the error.\n\t * @property {respoke.Call} target\n\t * @property {string} name - the event name.\n\t */\n\t that.call.fire('error', {\n\t message: err.message\n\t });\n\t });\n\t }, function errorHandler(e) {\n\t log.error('createOffer failed', e);\n\t }, offerOptions);\n\t }", "title": "" }, { "docid": "a30997826440347b9c051accc26599a0", "score": "0.52004075", "text": "function init() {\n\n for (var i = 0; i < 16; i++) {\n var output = new Uint8Array([REPORT_DIGITAL | i, 0x01]);\n device.send(output.buffer);\n }\n\n queryCapabilities();\n\n // TEMPORARY WORKAROUND\n // Since _deviceRemoved is not used with Serial devices\n // ping device regularly to check connection\n pinger = setInterval(function() {\n if (pinging) {\n if (++pingCount > 6) {\n clearInterval(pinger);\n pinger = null;\n connected = false;\n if (device) device.close();\n device = null;\n return;\n }\n } else {\n if (!device) {\n clearInterval(pinger);\n pinger = null;\n return;\n }\n queryFirmware();\n pinging = true;\n }\n }, 1000); //100\n }", "title": "" }, { "docid": "670fa53c1cb2d9a5e5827fde088e202a", "score": "0.51911175", "text": "function settupPeerConnection(){\n\tvar servers = null;\n\n\t// settup local peer connection\n\tapp.localPeerConnection = new RTCPeerConnection(servers);\n\tapp.localPeerConnection.onicecandidate = gotLocalIceCandidate;\n\n\t// settup remote peer connection\n\tapp.remotePeerConnection = new RTCPeerConnection(servers);\n\tapp.remotePeerConnection.onicecandidate = gotRemoteIceCandidate;\n\tapp.remotePeerConnection.onaddstream = gotRemoteStream;\n\n\t// add the local stream to our local peer connection and create the offer\n\tapp.localPeerConnection.addStream(app.localStream);\n\tapp.localPeerConnection.createOffer(gotLocalDescription,errorCallback);\n}", "title": "" }, { "docid": "cb66852c5bdc97f32379ddb751c44b73", "score": "0.5186468", "text": "initialize() {\n this.dataloader = new DataLoader((keys) => this.loadKeys(keys));\n this.existsDataloader = new DataLoader((keys) =>\n this.checkForExistence(keys)\n );\n }", "title": "" }, { "docid": "9eba5baee17c7b3c6de465a8ff2fcbe8", "score": "0.5182266", "text": "initialise() {\n this.prepareDecks();\n this.keys = { red: false, blue: false, yellow: false };\n this.amber = 0;\n this.turn = 1;\n this.readyToStart = false;\n this.opponent = this.game.getOtherPlayer(this);\n }", "title": "" }, { "docid": "f8ceca5d75149d272b25b62b8628aeab", "score": "0.51817983", "text": "init() {\n this._super(...arguments);\n\n if (this.get('bridgeIp') === null) {\n $.ajax('https://www.meethue.com/api/nupnp', {\n timeout: 30000\n })\n .done((result, status) => {\n let bridgeFindStatus = 'fail';\n\n if (status === 'success' && result.length === 1) {\n this.set('bridgeIp', result[0].internalipaddress);\n this.get('storage').set('huegasm.bridgeIp', result[0].internalipaddress);\n bridgeFindStatus = 'success';\n } else if (result.length > 1) {\n let multipleBridgeIps = this.get('multipleBridgeIps');\n\n result.forEach(function (item) {\n multipleBridgeIps.pushObject(item.internalipaddress);\n });\n\n bridgeFindStatus = 'multiple';\n } else {\n bridgeFindStatus = 'fail';\n }\n\n this.set('bridgeFindStatus', bridgeFindStatus);\n })\n .fail(() => {\n this.set('bridgeFindStatus', 'fail');\n });\n }\n }", "title": "" }, { "docid": "51929806bf92ed1346deebd498a69f70", "score": "0.5178592", "text": "teleopInit() {}", "title": "" }, { "docid": "5567df690dfa3d27ffe13dac4d5be4a3", "score": "0.51681954", "text": "init() {\n this.detectWallet();\n }", "title": "" }, { "docid": "e6e0331960671103a3b8b185830f35d5", "score": "0.51612586", "text": "async initServices () {\n // Initialize private IPFS gateway counters\n this.redis.set('ipfsGatewayReqs', 0)\n this.redis.set('ipfsStandaloneReqs', 0)\n\n await this.blacklistManager.init()\n\n if (!config.get('isUserMetadataNode')) {\n this.libs = await initAudiusLibs()\n\n this.snapbackSM = new SnapbackSM(this.libs)\n await this.snapbackSM.init()\n }\n\n this.monitoringQueue.start()\n }", "title": "" }, { "docid": "075e50b59eba9fe1811f74d8f2337614", "score": "0.5158053", "text": "function MakePeer(){\n console.log('tes33333')\n client.gotAnswer = false\n var peer = InitPeer('init')\n peer.on(('signal'), function(data){\n if (!client.gotAnswer){\n socket.emit('Offer', data)\n }\n })\n client.peer = peer\n }", "title": "" }, { "docid": "185b1e9aba54c25b1feddb830105ce27", "score": "0.51561296", "text": "function Discovery() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n (0, _classCallCheck3.default)(this, Discovery);\n var _opts$address = opts.address,\n address = _opts$address === undefined ? \"discovery.thethings.network:1900\" : _opts$address,\n _opts$insecure = opts.insecure,\n insecure = _opts$insecure === undefined ? false : _opts$insecure,\n certificate = opts.certificate;\n\n\n var credentials = insecure ? _grpc2.default.credentials.createInsecure() : _grpc2.default.credentials.createSsl(certificate && new Buffer(certificate));\n\n this.client = new _discovery_grpc_pb2.default.DiscoveryClient(address, credentials);\n }", "title": "" }, { "docid": "53a3a69ffd8dcac69bc982639ab45e61", "score": "0.51498735", "text": "constructor(pnp) {\n this.pnp = new PortablePnPApi_PortablePnPApi(pnp);\n }", "title": "" }, { "docid": "607ac247d5e956162bd6205055619708", "score": "0.5140401", "text": "async onReady() {\n // Initialize your adapter here\n try {\n // The adapters config (in the instance object everything under the attribute \"native\") is accessible via\n this.log.debug(\"config: \" + this.config);\n //Setup state objects for Schwoerer parameters\n for (const [func, attributes] of Object.entries(parameters_1.VentCubeParameters)) {\n //Potentially skip parameters marked as \"advanced\"\n if ((attributes.category == \"advanced\") && (!this.config.advancedfunctions))\n continue;\n await this.setupStates(attributes, func);\n }\n // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above.\n this.subscribeStates(\"parameters.*\");\n this.log.info(\"Starting connector\");\n this.connector = new Connector_1.Connector(this, this.config.server, this.config.port, this.config.advancedfunctions, this.config.interval, this.config.reconnectattempts, this.config.reconnectdelayms, this.config.requesttimeoutms);\n this.connector.initializeSocket();\n this.log.debug(\"Connecting\");\n this.connector.connect();\n }\n catch (error) {\n this.log.error(error.message);\n Promise.reject(error.message);\n }\n }", "title": "" }, { "docid": "e8b6e9106da456ab4f9284430f0a412e", "score": "0.5135741", "text": "function init () {\n init_protocol();\n\n just_for_testing();\n\n !options.disableGlobalHotkeys && init_global_hotkeys();\n console.info('[INIT] done');\n}", "title": "" }, { "docid": "02c451db7f670af66bd25552959594ef", "score": "0.5127288", "text": "function initPeerConnections(clientId, screenStream) {\n\n const peer = createPeerConnections(clientId);\n\n peer.video.addStream(screenStream);\n\n peer.video.createOffer()\n .then(handleSessionDescription.bind(peer, 'video'))\n .catch(log)\n\n peers.push(peer);\n log('Peer added, peers: ', peers);\n}", "title": "" }, { "docid": "7b17ef594ac37116555dd47cde18d84d", "score": "0.5119036", "text": "function init () {\n // *** PRIVATE ***\n\n var inPort,\n inUUID,\n inMessageType,\n inApplicationInfo,\n inActionInfo,\n websocket = null;\n\n var events = ELGEvents.eventEmitter();\n var logger = SDDebug.logger();\n\n function showVars () {\n debugLog('---- showVars');\n debugLog('- port', inPort);\n debugLog('- uuid', inUUID);\n debugLog('- messagetype', inMessageType);\n debugLog('- info', inApplicationInfo);\n debugLog('- inActionInfo', inActionInfo);\n debugLog('----< showVars');\n }\n\n function connect (args) {\n inPort = args[0];\n inUUID = args[1];\n inMessageType = args[2];\n inApplicationInfo = Utils.parseJson(args[3]);\n inActionInfo = args[4] !== 'undefined' ? Utils.parseJson(args[4]) : args[4];\n\n /** Debug variables */\n if (debug) {\n showVars();\n }\n\n const lang = Utils.getProp(inApplicationInfo,'application.language', false);\n if (lang) {\n loadLocalization(lang, inMessageType === 'registerPropertyInspector' ? '../' : './', function() {\n events.emit('localizationLoaded', {language:lang});\n });\n };\n\n /** restrict the API to what's possible\n * within Plugin or Property Inspector\n * <unused for now>\n */\n // $SD.api = SDApi[inMessageType];\n\n if (websocket) {\n websocket.close();\n websocket = null;\n };\n\n websocket = new WebSocket('ws://localhost:' + inPort);\n\n websocket.onopen = function () {\n var json = {\n event: inMessageType,\n uuid: inUUID\n };\n\n // console.log('***************', inMessageType + \" websocket:onopen\", inUUID, json);\n\n websocket.sendJSON(json);\n $SD.uuid = inUUID;\n $SD.actionInfo = inActionInfo;\n $SD.applicationInfo = inApplicationInfo;\n $SD.messageType = inMessageType;\n $SD.connection = websocket;\n\n instance.emit('connected', {\n connection: websocket,\n port: inPort,\n uuid: inUUID,\n actionInfo: inActionInfo,\n applicationInfo: inApplicationInfo,\n messageType: inMessageType\n });\n };\n\n websocket.onerror = function (evt) {\n console.warn('WEBOCKET ERROR', evt, evt.data);\n };\n\n websocket.onclose = function (evt) {\n // Websocket is closed\n var reason = WEBSOCKETERROR(evt);\n console.warn(\n '[STREAMDECK]***** WEBOCKET CLOSED **** reason:',\n reason\n );\n };\n\n websocket.onmessage = function (evt) {\n var jsonObj = Utils.parseJson(evt.data),\n m;\n\n // console.log('[STREAMDECK] websocket.onmessage ... ', jsonObj.event, jsonObj);\n\n if (!jsonObj.hasOwnProperty('action')) {\n m = jsonObj.event;\n // console.log('%c%s', 'color: white; background: red; font-size: 12px;', '[common.js]onmessage:', m);\n } else {\n switch (inMessageType) {\n case 'registerPlugin':\n m = jsonObj['action'] + '.' + jsonObj['event'];\n break;\n case 'registerPropertyInspector':\n m = 'sendToPropertyInspector';\n break;\n default:\n console.log('%c%s', 'color: white; background: red; font-size: 12px;', '[STREAMDECK] websocket.onmessage +++++++++ PROBLEM ++++++++');\n console.warn('UNREGISTERED MESSAGETYPE:', inMessageType);\n }\n }\n\n if (m && m !== '')\n events.emit(m, jsonObj);\n };\n\n instance.connection = websocket;\n }\n\n return {\n // *** PUBLIC ***\n\n uuid: inUUID,\n on: events.on,\n emit: events.emit,\n connection: websocket,\n connect: connect,\n api: null,\n logger: logger\n };\n }", "title": "" }, { "docid": "1a42bd35060237513293e37a9d76cfcf", "score": "0.51156497", "text": "function init() {\n\n const p1 = getNodeSpecsP(apiV1Url)\n const p2 = getServiceSpecsP(apiV1Url)\n const p3 = getPodSpecsP(apiV1Url)\n const p4 = getIngressSpecsP(apiV1Beta1Url)\n\n Promise.all([p1, p2, p3, p4])\n .then(([nodeList, serviceList, podList, ingressList]) => {\n\n const dotGraphString = k8sDotGraph.makeDotGraph({nodeList, serviceList, podList, ingressList})\n const svgString = generateSvg(dotGraphString)\n\n const graph = document.getElementById(graphId)\n graph.innerHTML = svgString\n\n const svgElement = graph.firstElementChild\n svgElement.setAttribute('id', 'k8sSvg')\n\n allowSvgSave(svgString)\n allowDotSave(dotGraphString)\n })\n .catch((err) => {\n const errDiv = document.getElementById(errorId)\n errDiv.innerHTML = err\n })\n}", "title": "" }, { "docid": "df9f2ec10a63714630083b386d9cc886", "score": "0.5115292", "text": "function _init() {\n \n }", "title": "" }, { "docid": "148126edce4682f16ef26fc724a794eb", "score": "0.5113532", "text": "createPeerConnection() {\n try {\n pc = new RTCPeerConnection(configuration);\n pc.onicecandidate = this.handleIceCandidate;\n pc.onaddstream = this.handleRemoteStreamAdded;\n pc.onremovestream = this.handleRemoteStreamRemoved;\n console.log('Peer connection established');\n } catch (event) {\n console.log(`Failed to create peer connection, exception: ${event.message}`);\n }\n }", "title": "" }, { "docid": "1f74270d0fe07706225de9af764c4353", "score": "0.5104112", "text": "async onInit() {\n\t\tthis.settings = await this.getSettings();\n\t\tconst { id } = this.getData();\n\t\tthis.log(`device init: ${this.getName()} id: ${id}`);\n\t\tHomey\n\t\t\t.on(`log_${id.split('_')[1]}`, (info) => {\n\t\t\t\tconst { logs } = JSON.parse(info);\n\t\t\t\t// console.log(logs[0]);\n\t\t\t\tthis.updateInfo(logs)\n\t\t\t\t\t.catch(this.log);\n\t\t\t\t// console.log(util.inspect(knownDevices, true, 4, true));\n\t\t\t});\n\t\tsetHasLogAnalyzer(id)\n\t\t\t.catch(this.error);\n\t\t// this.lastLog = {};\n\t\tconst contact = (Homey.env && Homey.env.CONTACT) ? Homey.env.CONTACT : this.settings.contact;\n\t\tthis.ipIntel = new GetIPIntel({ contact });\n\t\tthis.detections = [];\n\t\tthis.registerFlowCards();\n\t}", "title": "" }, { "docid": "cbfcbcfcfdeee301d01b57529b398f96", "score": "0.509348", "text": "async init() {\n // start the socket connections etc\n await this.api.init();\n }", "title": "" }, { "docid": "60d703c7e09d2ff6a3414ab5e06d97a7", "score": "0.5090002", "text": "function init () {\n console.log('Init protocol !!')\n\n /**\n * Instruction when a protocol called the application.\n * NOTE: So we can do something like 'joystream://<info_hash>'\n */\n protocol.registerStringProtocol('joystreamclassic', protocolCallback, protocolError)\n}", "title": "" }, { "docid": "b520510ca96541c5d7bf33cef6b365e5", "score": "0.50892013", "text": "initialize() {\n registerDependencies();\n initializeRouter();\n }", "title": "" }, { "docid": "b050772bf5cb0cd6548ff827a20a494e", "score": "0.50882304", "text": "start() {\n this.on( 'requestPeers', data => this.handleRequestPeers( data ) );\n }", "title": "" }, { "docid": "95f65325018cd92c5262aed05c214e0d", "score": "0.50880814", "text": "InitializeFields() {\n this.Name = tp.NextName('Broker');\n this.QueryNames = [];\n this.SelectList = [];\n\n this.tblBrowser = null;\n this.SelectList = null;\n this.DataSet = new tp.DataSet();\n\n this.fInitialized = false;\n this.IsListBroker = false;\n this.IsMasterBroker = true;\n this.State = tp.DataMode.None;\n this.EntityId = 0;\n this.GuidOids = true;\n }", "title": "" }, { "docid": "859890fd8235240f52fe702197265b45", "score": "0.50849295", "text": "init() {\n // Initialize plugins.\n this.pluginManager.pluginList.forEach(function (plugin) {\n plugin.initialize();\n });\n // Initialize data manger\n this.eventManager.dispatchEvent(new Event(\"preInit\"));\n this.blockTypes = [];\n this.blockTraits = [];\n this.biomeTypes = [];\n this.serverMap = new Map();\n this.state = GlobalStates.LOADING;\n this.eventManager.dispatchEvent(new Event(\"postInit\"));\n }", "title": "" }, { "docid": "19399182169842ebd67bf55226e7e091", "score": "0.5083435", "text": "init() {\n\t\tvar that = this;\n\t\tthis.initializeTodoDBConnector().then(function (response) {\n\t\t\tconsole.log(response);\n\t\t\tthat.initializeTodoIdCollection().then(function (response) {\n\t\t\t\tconsole.log(response);\n\t\t\t}).catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t\t}).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t});\n\t}", "title": "" }, { "docid": "a46b81df522aae07e25698fcdb5e4fa5", "score": "0.5081202", "text": "function createDtmfSenderOnPeerConnection() {\n if (global.peerConnection == null)\n error_('Tried to create DTMF sender, but have no peer connection.');\n\n createDtmfSender(global.peerConnection);\n print_('ok-dtmfsender-created');\n}", "title": "" }, { "docid": "d43344a2c700cf4598169de53a3739df", "score": "0.50808203", "text": "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._credentialResolver = new pip_services3_components_node_2.CredentialResolver();\n this._timeout = 30000;\n this._retries = 3;\n this._client = null;\n }", "title": "" }, { "docid": "467e55b84eb1bc62671015112a209c8a", "score": "0.50770205", "text": "function generatePeerConnection() {\n var pc_config = {\"iceServers\": [{\"url\": \"stun:stun.l.google.com:19302\"}]};\n try{\n pc = new RTCPeerConnection(pc_config);\n pc.onicecandidate = onIceCandidate;\n pc.onconnecting = onSessionConnecting;\n pc.onopen = onSessionOpened;\n pc.onaddstream = onAddStream;\n pc.onremovestream = onRemoveStream;\n console.log(\"new peerConnection!\");\n }\n catch (e) {\n console.log(e, \"generatePeerConnection error\");\n }\n}", "title": "" }, { "docid": "12e6d6009d8134e249ecb24c4dc0878b", "score": "0.50727814", "text": "function start() {\n if (!node) {\n const options = {\n libp2p: {\n modules: {\n connProtector: new Protector(swarmKeyBuffer)\n },\n\t\tconfig: {\n\t\t dht: {\n\t\t enabled: false\n\t\t }\n\t\t}\n\t },\n config: {\n\t Bootstrap: [\n '/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',\n '/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',\n '/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',\n '/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',\n '/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/QmaGGSUqoFpv6wuqvNKNBsxDParVuGgV3n3iPs2eVWeSN4',\n '/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmRYw68MzD4jPvner913mLWBdFfpPfNUx8SRFjiUCJNA4f',\n '/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'\n ],\n\t\tAddresses: {\n Swarm: [\n '/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',\n '/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',\n '/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',\n '/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',\n '/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/QmaGGSUqoFpv6wuqvNKNBsxDParVuGgV3n3iPs2eVWeSN4',\n '/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmRYw68MzD4jPvner913mLWBdFfpPfNUx8SRFjiUCJNA4f',\n '/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'\n ]\n }\n }\n }\n node = new IPFS(options)\n node.once('start', () => {\n node.id()\n .then((id) => {\n info = id\n subscribeToHealthChannel()\n updateView('ready', node)\n onSuccess('Node is ready.')\n setInterval(refreshPeerList, 10000)\n setInterval(sendFileList, 10000)\n })\n .catch((error) => onError(error))\n })\n }\n}", "title": "" }, { "docid": "824eb0de4a171503726b7b46f4c20949", "score": "0.5055771", "text": "function InitPeer(type) {\n let peer = new Peer({ initiator: (type == 'init') ? true : false, stream: stream, trickle: false })\n peer.on('stream', function (stream) {\n CreateVideo(stream)\n })\n //This isn't working in chrome; works perfectly in firefox.\n // peer.on('close', function () {\n // document.getElementById(\"peerVideo\").remove();\n // peer.destroy()\n // })\n peer.on('data', function (data) {\n let decodedData = new TextDecoder('utf-8').decode(data)\n let peervideo = document.querySelector('#peerVideo')\n peervideo.style.filter = decodedData\n })\n return peer\n }", "title": "" }, { "docid": "9da92c762502d196d10e735886eab67e", "score": "0.5054672", "text": "async initialize() { \n\t // TODO : Support for Mongo Authentication ???\n await super.initialize(false); \n }", "title": "" }, { "docid": "58367f35785df0192ba2891bbe12488d", "score": "0.5054325", "text": "function discover(waitForCount, callback) {\n var listenAddress='0.0.0.0';\n var listenPort=30000;\n var probePort=30050;\n var probeAddress='255.255.255.255';\n var probeAttempts=10;\n var probeInterval=500;\n var probeData = new Buffer.from('DAIKIN_UDP/common/basic_info');\n var probeTimeout;\n \n\n var discoveredDevices = {};\n\n var udpSocket = udp.createSocket({type:\"udp4\", reuseAddr:true});\n\n udpSocket.on('error', function (err) {\n if (debug) console.log('ERROR udpSocket: ' + err);\n });\n\n udpSocket.bind(listenPort, listenAddress, function() {\n udpSocket.addMembership('224.0.0.1');\n udpSocket.setBroadcast(true);\n });\n\n udpSocket.on(\"message\", function (message, remote) {\n if (debug) console.log(remote.address + ':' + remote.port +' - ' + message);\n discoveredDevices[remote.address] = message.toString();\n if (Object.keys(discoveredDevices).length >= waitForCount) {\n finalizeDiscovery();\n }\n });\n\n udpSocket.on('listening', function() {\n sendProbes(probeAttempts);\n });\n\n function sendProbes(attemptsLeft) {\n probeTimeout = null;\n if (attemptsLeft > 0) {\n if (debug) console.log('Send UDP discovery package ' + attemptsLeft);\n udpSocket.send(probeData, 0, probeData.length, probePort, probeAddress);\n probeTimeout = setTimeout(sendProbes, probeInterval, --attemptsLeft);\n }\n else {\n finalizeDiscovery();\n }\n }\n\n function finalizeDiscovery() {\n if (probeTimeout) {\n clearTimeout(probeTimeout);\n probeTimeout = null;\n }\n udpSocket.close();\n if (debug) console.log('Discovery finished with ' + Object.keys(discoveredDevices).length + ' devices found');\n callback(discoveredDevices);\n }\n}", "title": "" }, { "docid": "12bc2fe950832255c20d506813d56e5b", "score": "0.5050606", "text": "async setUp () {\n var IPToASN = require('ip-to-asn')\n this.whois = new IPToASN()\n this.pcapParser.on('ipv4Packet', this.countIPv4Address.bind(this))\n }", "title": "" }, { "docid": "1d4d7039bdbe963c0233297bc87e955e", "score": "0.50447744", "text": "async initialize() {\n for (let key of configuration.getOrgs()) {\n let client = new hfc();\n let cryptoSuite = hfc.newCryptoSuite();\n\n var store = await hfc.newDefaultKeyValueStore({\n path: configuration.getKeyStoreForOrg(configuration.getOrgName(key))\n });\n\n client.setStateStore(store);\n\n await cryptoSuite.setCryptoKeyStore(\n hfc.newCryptoKeyStore({\n path: configuration.getKeyStoreForOrg(configuration.getOrg(key).name)\n })\n );\n client.setCryptoSuite(cryptoSuite);\n\n this.clients[key] = client;\n //For each client setup a admin user as signining identity\n await this.setAdminForClient(key, client);\n\n this.setupPeers(key, client, false);\n }\n\n await this.setChannels();\n }", "title": "" }, { "docid": "6b7747e760a3add354ecd2f4c028a92b", "score": "0.50431895", "text": "constructor() {\n this.initializeDriveInfo();\n }", "title": "" }, { "docid": "9aa1281d2d3f450415ea17f7c9e99670", "score": "0.50394446", "text": "setup() {\n this.stream = createClient({\n server: Endpoints.EPIC_PROD_ENV,\n transports: {\n websocket: `wss://${Endpoints.XMPP_SERVER}`,\n bosh: false,\n },\n\n credentials: {\n jid: `${this.client.authenticator.accountId}@${Endpoints.EPIC_PROD_ENV}`,\n host: Endpoints.EPIC_PROD_ENV,\n username: this.client.authenticator.accountId,\n password: this.client.authenticator.accessToken,\n },\n\n resource: this.resource, // to make it seen online INSIDE the game.\n });\n\n this.stream.enableKeepAlive({\n interval: 60,\n });\n }", "title": "" }, { "docid": "6f7c11fdf58b417f2b8a9bd9e8cf5f11", "score": "0.5039174", "text": "function MakePeer() {\n client.gotAnswer = false\n let peer = InitPeer('init')\n peer.on('signal', function (data) {\n if (!client.gotAnswer) {\n socket.emit('Offer', data)\n }\n })\n client.peer = peer\n }", "title": "" }, { "docid": "e52226db5ca4f671ef226917a73f8169", "score": "0.50385255", "text": "function init() {\r\n o3djs.util.makeClients(initStep2);\r\n}", "title": "" }, { "docid": "8d3998018c085d700478afc13a2653f1", "score": "0.503087", "text": "initializeController(_self) {\n let callback = function() {\n _self.togglePort();\n _self.toggleSpeed();\n _self.toggleNodeDpid();\n _self.toggleNodeName();\n _self.toggleNodeOFVersion();\n _self.toggleNodeVendor();\n _self.toggleNodeHardware();\n _self.toggleNodeSofware();\n };\n\n sdntopology.callSdntraceGetTopology(callback);\n }", "title": "" }, { "docid": "a110c9d4d4d6500297247fb4541b480f", "score": "0.5028575", "text": "constructor() { \n \n SpotFleetRequestConfig.initialize(this);\n }", "title": "" }, { "docid": "11c37ab86f47963e0dbc21a28ed16939", "score": "0.5027963", "text": "init(port, storage, callback) {\n this.initComplex({ port: port, storage: storage }, callback);\n }", "title": "" }, { "docid": "197c1af369829135f35f480be93ad08e", "score": "0.5024735", "text": "initialise() {\n this.prepareDecks();\n this.initConflictDeck();\n this.initDynastyDeck();\n\n this.fate = 0;\n this.honor = 0;\n this.readyToStart = false;\n this.limitedPlayed = 0;\n this.maxLimited = 1;\n }", "title": "" }, { "docid": "a4caa9bd06046ce21bed54d81f9660e2", "score": "0.50244844", "text": "async function setup () {\n try {\n // Get config parameters\n cfg = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'conf/config.json')))\n console.log('Read the JSON config file')\n\n // Get the connection profile\n profile = JSON.parse(fs.readFileSync(path.resolve(__dirname, cfg.connection_profile)))\n\n // Create a new file system wallet for managing identities\n const walletPath = path.resolve(__dirname, cfg.wallet_location)\n wallet = await Wallets.newFileSystemWallet(walletPath)\n console.log(`Wallet path: ${walletPath}`)\n\n // Enroll an admin, if configured (recommended for dev/test only)\n if (cfg.enroll_admin === 'true') {\n console.log(`Enrolling admin user: ${cfg.admin_name}`)\n await enrollAdmin()\n }\n\n // Register a user, if configured (recommended for dev/test only)\n if (cfg.register_user === 'true') {\n console.log(`Registering user: ${cfg.user_name}`)\n await registerUser()\n }\n\n // Add NATS subscribers, if configured\n if (cfg.use_nats === 'true') {\n console.log(`Configuring NATS subscribers`)\n await subscribe()\n }\n\n // Make sure we have a registered user\n const identity = await wallet.get(cfg.user_name)\n if (!identity) {\n console.log(`An identity for the user ${cfg.user_name} does not exist in the wallet`)\n process.exit(1)\n }\n\n // Create a new gateway for connecting to our peer node\n const use_disc = process.env.INITIALIZE_WITH_DISCOVERY || cfg.use_discovery\n const as_local = process.env.DISCOVERY_AS_LOCALHOST || cfg.as_local_host\n const enabled = true ? use_disc === 'true' : false\n const asLocalhost = true ? as_local === 'true' : false\n console.log(`Discovery enabled = ${enabled} asLocalhost = ${asLocalhost}`)\n const gateway = new Gateway()\n await gateway.connect(profile, { wallet, identity: cfg.user_name, discovery: { enabled, asLocalhost } })\n\n // Get the network (channel) our contract is deployed to\n const network = await gateway.getNetwork(cfg.channel)\n\n // Get the contract from the network\n contract = network.getContract(cfg.contract)\n console.log('Connected to the blockchain')\n } catch (error) {\n console.error(`Failed to set up the fabric client: ${error}`)\n process.exit(1)\n }\n}", "title": "" }, { "docid": "5367485727eee8127a419ed8335de972", "score": "0.5014176", "text": "initTL() {}", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.5010842", "text": "init() {\n }", "title": "" }, { "docid": "4a4d0ef823753269e449a9408c03014d", "score": "0.5010842", "text": "init() {\n }", "title": "" } ]
dbbf45d5db66639c1d52ab1e447b9883
Get "field" reference for Vega
[ { "docid": "69a4715f8af1d75f8ccf4eba46929c51", "score": "0.59496874", "text": "vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return Object(_channeldef__WEBPACK_IMPORTED_MODULE_1__[\"vgField\"])(fieldDef, opt);\n }", "title": "" } ]
[ { "docid": "edc2b063d2befd7678dc94c840e5913e", "score": "0.64821285", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n var k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_3__[\"field\"])(_.$field, _.$name));\n}", "title": "" }, { "docid": "edc2b063d2befd7678dc94c840e5913e", "score": "0.64821285", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n var k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_3__[\"field\"])(_.$field, _.$name));\n}", "title": "" }, { "docid": "edc2b063d2befd7678dc94c840e5913e", "score": "0.64821285", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n var k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_3__[\"field\"])(_.$field, _.$name));\n}", "title": "" }, { "docid": "f604ebdc444d5f4fa6a7256b82281789", "score": "0.64705056", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n var k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = vegaUtil.field(_.$field, _.$name));\n }", "title": "" }, { "docid": "663c7bd067a6a5b422fef3bdc622e648", "score": "0.6363353", "text": "function getFieldReference(typeInfo) {\n return {\n kind: 'Field',\n schema: typeInfo.schema,\n field: typeInfo.fieldDef,\n type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType\n };\n}", "title": "" }, { "docid": "317e606110250bf87a24822022f04842", "score": "0.6355525", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"field\"])(_.$field, _.$name, ctx.expr.codegen));\n}", "title": "" }, { "docid": "4924de097d1c49c759de39b3f553ba30", "score": "0.63363427", "text": "function getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = vegaUtil.field(_.$field, _.$name, ctx.expr.codegen));\n }", "title": "" }, { "docid": "4b889707264df53fd53e70b13a426fb5", "score": "0.6215589", "text": "getValue() {\n const doc = this.context.doc || {}\n return get(doc, this.getFieldName())\n }", "title": "" }, { "docid": "9c442532d5c02265e87b62573c2c6917", "score": "0.620535", "text": "function _field_to_facet_field(field){\n\treturn 'f.' + field + '.facet.limit';\n }", "title": "" }, { "docid": "9c442532d5c02265e87b62573c2c6917", "score": "0.620535", "text": "function _field_to_facet_field(field){\n\treturn 'f.' + field + '.facet.limit';\n }", "title": "" }, { "docid": "9c442532d5c02265e87b62573c2c6917", "score": "0.620535", "text": "function _field_to_facet_field(field){\n\treturn 'f.' + field + '.facet.limit';\n }", "title": "" }, { "docid": "9c442532d5c02265e87b62573c2c6917", "score": "0.620535", "text": "function _field_to_facet_field(field){\n\treturn 'f.' + field + '.facet.limit';\n }", "title": "" }, { "docid": "3e94bd41ea8f1a7079208cbcef5ed95d", "score": "0.61641", "text": "vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return Object(_fielddef__WEBPACK_IMPORTED_MODULE_4__[\"vgField\"])(fieldDef, opt);\n }", "title": "" }, { "docid": "c4afb5fa2a02811e6f861a0859a3f785", "score": "0.61512387", "text": "function vgField(fieldDef, opt = {}) {\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n if (isCount(fieldDef)) {\n field = 'count_*';\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else if (Object(_bin__WEBPACK_IMPORTED_MODULE_3__[\"isBinning\"])(fieldDef.bin)) {\n fn = Object(_bin__WEBPACK_IMPORTED_MODULE_3__[\"binToString\"])(fieldDef.bin);\n suffix = (opt.binSuffix || '') + (opt.suffix || '');\n }\n else if (fieldDef.aggregate) {\n fn = String(fieldDef.aggregate);\n }\n else if (fieldDef.timeUnit) {\n fn = String(fieldDef.timeUnit);\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return field;\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return Object(_util__WEBPACK_IMPORTED_MODULE_10__[\"flatAccessWithDatum\"])(field, opt.expr);\n }\n else {\n // We flattened all fields so paths should have become dot.\n return Object(_util__WEBPACK_IMPORTED_MODULE_10__[\"replacePathInField\"])(field);\n }\n}", "title": "" }, { "docid": "8136a90cc50fdf39f6989aee14540902", "score": "0.60679793", "text": "function vgField(fieldDef, opt = {}) {\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = Object(_util__WEBPACK_IMPORTED_MODULE_10__[\"internalField\"])('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (Object(_bin__WEBPACK_IMPORTED_MODULE_3__[\"isBinning\"])(bin)) {\n fn = Object(_bin__WEBPACK_IMPORTED_MODULE_3__[\"binToString\"])(bin);\n suffix = (opt.binSuffix || '') + (opt.suffix || '');\n }\n else if (aggregate) {\n if (Object(_aggregate__WEBPACK_IMPORTED_MODULE_2__[\"isArgmaxDef\"])(aggregate)) {\n argAccessor = `.${field}`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (Object(_aggregate__WEBPACK_IMPORTED_MODULE_2__[\"isArgminDef\"])(aggregate)) {\n argAccessor = `.${field}`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = String(timeUnit);\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return field;\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return Object(_util__WEBPACK_IMPORTED_MODULE_10__[\"flatAccessWithDatum\"])(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return Object(_util__WEBPACK_IMPORTED_MODULE_10__[\"replacePathInField\"])(field) + argAccessor;\n }\n}", "title": "" }, { "docid": "55b2fac13d3b9940db50b60a2a7aba0a", "score": "0.60573655", "text": "getField() {\n return this.field;\n }", "title": "" }, { "docid": "f8943ac558adf06f5d5e7123153c9151", "score": "0.6041809", "text": "get field() {\n return field\n }", "title": "" }, { "docid": "f4765f40612672709d0b832946e01fac", "score": "0.6006263", "text": "function getField (node) {\n return node.getField();\n}", "title": "" }, { "docid": "a74f31074e2c220f57f2ce3e5ddea741", "score": "0.6004521", "text": "function vgField(fieldDef, opt) {\n if (opt === void 0) { opt = {}; }\n var field = fieldDef.field;\n var prefix = opt.prefix;\n var suffix = opt.suffix;\n if (isCount(fieldDef)) {\n field = 'count_*';\n }\n else {\n var fn = void 0;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else if (bin_1.isBinning(fieldDef.bin)) {\n fn = bin_1.binToString(fieldDef.bin);\n suffix = opt.binSuffix || '';\n }\n else if (fieldDef.aggregate) {\n fn = String(fieldDef.aggregate);\n }\n else if (fieldDef.timeUnit) {\n fn = String(fieldDef.timeUnit);\n }\n }\n if (fn) {\n field = field ? fn + \"_\" + field : fn;\n }\n }\n if (suffix) {\n field = field + \"_\" + suffix;\n }\n if (prefix) {\n field = prefix + \"_\" + field;\n }\n if (opt.forAs) {\n return field;\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return util_1.flatAccessWithDatum(field, opt.expr);\n }\n else {\n // We flattened all fields so paths should have become dot.\n return util_1.replacePathInField(field);\n }\n}", "title": "" }, { "docid": "e68118aaf2eb63c85dd1c664dcd20122", "score": "0.595677", "text": "vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return Object(_channeldef__WEBPACK_IMPORTED_MODULE_3__[\"vgField\"])(fieldDef, opt);\n }", "title": "" }, { "docid": "109b80581fc34047f7a495732d87a154", "score": "0.5947344", "text": "function vgField(fieldDef, opt = {}) {\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = internalField('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (isBinning(bin)) {\n fn = binToString(bin);\n suffix = (opt.binSuffix || '') + (opt.suffix || '');\n }\n else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = `.${field}`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (isArgminDef(aggregate)) {\n argAccessor = `.${field}`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = String(timeUnit);\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return field;\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n }", "title": "" }, { "docid": "2a4fb2dae929b4db8818cd3c0855d6b5", "score": "0.5932924", "text": "function getField$1(_,ctx){if(!_.$field)return null;var k='f:'+_.$field+'_'+_.$name;return ctx.fn[k]||(ctx.fn[k]=field(_.$field,_.$name));}", "title": "" }, { "docid": "f8b1b38181b05ee41c4c2c45269276b3", "score": "0.5929787", "text": "vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n\n if (!fieldDef) {\n return undefined;\n }\n\n return vgField(fieldDef, opt);\n }", "title": "" }, { "docid": "8d6d91bdc8b9ed4322181e7ba8372652", "score": "0.582078", "text": "vgField(channel, opt = {}) {\n const fieldDef = this.fieldDef(channel);\n if (!fieldDef) {\n return undefined;\n }\n return vgField(fieldDef, opt);\n }", "title": "" }, { "docid": "ea3698a17ffe169fb794a6ea67f91502", "score": "0.58092886", "text": "function getFieldFromDomain(domain) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(domain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(domain.field)) {\n return domain.field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefUnionedDomain\"])(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(nonUnionDomain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n _log__WEBPACK_IMPORTED_MODULE_6__[\"warn\"](_log__WEBPACK_IMPORTED_MODULE_6__[\"message\"].FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_6__[\"warn\"](_log__WEBPACK_IMPORTED_MODULE_6__[\"message\"].FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isFieldRefUnionDomain\"])(domain)) {\n _log__WEBPACK_IMPORTED_MODULE_6__[\"warn\"](_log__WEBPACK_IMPORTED_MODULE_6__[\"message\"].FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(field) ? field : undefined;\n }\n return undefined;\n}", "title": "" }, { "docid": "538863e80ae38b37ba9d12cc94f343f0", "score": "0.5799175", "text": "function getFacetLabel(fieldName) {\n var lookup = {\n \"state\":\"State or Territory\",\n \"synonym.decade\":\"occurrence_year\",\n \"location_id\":\"Location ID\",\n \"event_id\":\"Event ID\",\n \"elevation_d_rng\":\"Elevation (in metres)\",\n \"min_elevation_d_rng\":\"Minimum elevation (in metres)\",\n \"cl1048\":\"IBRA 7 Regions\",\n \"cl21\":\"IMCRA Regions\",\n \"raw_identification_qualifier\":\"Raw identification qualifier\",\n \"original_name_usage\":\"Original name usage\",\n \"cl2079\":\"capad 2014 terrestrial\",\n \"cl2078\":\"capad 2014 marine\",\n \"cl925\":\"Estuary habitat mapping\",\n \"cl901\":\"Directory of Important Wetlands\",\n \"cl958\":\"Commonwealth Electoral Boundaries\",\n \"cl1049\":\"IBRA 7 Subregions\",\n \"cl1085\":\"Koppen Climate Classification (All Classes)\",\n \"cl678\":\"Land use\",\n \"cl991\":\"Geomorphology of the Australian Margin and adjacent seafloor\",\n \"cl916\":\"NRM Regions\",\n \"cl935\":\"RAMSAR wetland regions\",\n \"cl1057\":\"River Regions\",\n \"cl2013\":\"ASGS Australian States and Territories\",\n \"cl927\":\"States including coastal waters\",\n \"cl923\":\"Surface Geology of Australia\",\n \"cl619\":\"Vegetation - condition\",\n \"cl1076\":\"IGBP Land Cover vegetation classification scheme (2011)\",\n \"cl918\":\"National Dynamic Land Cover\",\n \"occurrence_decade_i\":\"Year (by decade)\",\n \"data_resource_uid\":\"Data resource\",\n \"data_resource\":\"Data resource\",\n \"dataset_name\":\"Dataset name\",\n \"species_list_uid\":\"Species lists\",\n \"institution_uid\":\"Institution\"\n };\n\n return (ALA.OccurrenceMapUtils && ALA.OccurrenceMapUtils.formatFacetName && ALA.OccurrenceMapUtils.formatFacetName( fieldName, lookup)) || \"Unknown\";\n }", "title": "" }, { "docid": "d0d871e785fe77e63a12ee4e3a3af7d3", "score": "0.57889116", "text": "function getField$1(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name, ctx.expr.codegen));\n }", "title": "" }, { "docid": "9778ca94eb18ad162fa2cd48f37181c5", "score": "0.5699944", "text": "function getFieldFromDomain(domain) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(domain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(domain.field)) {\n return domain.field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefUnionedDomain\"])(domain)) {\n var field = void 0;\n for (var _i = 0, _a = domain.fields; _i < _a.length; _i++) {\n var nonUnionDomain = _a[_i];\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(nonUnionDomain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.');\n return field;\n }\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect.');\n return field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isFieldRefUnionDomain\"])(domain)) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.');\n var field = domain.fields[0];\n return Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(field) ? field : undefined;\n }\n return undefined;\n}", "title": "" }, { "docid": "a0d13ad1ccc71f7fdd33bda13a31e1cc", "score": "0.5673814", "text": "get GetFieldMatx(){\n return this.field;\n }", "title": "" }, { "docid": "fcaee10205af36d3f208516f52307f4f", "score": "0.5665677", "text": "function getFieldFromDomain(domain) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(domain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(domain.field)) {\n return domain.field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefUnionedDomain\"])(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(nonUnionDomain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.');\n return field;\n }\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect.');\n return field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isFieldRefUnionDomain\"])(domain)) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.');\n const field = domain.fields[0];\n return Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(field) ? field : undefined;\n }\n return undefined;\n}", "title": "" }, { "docid": "fcaee10205af36d3f208516f52307f4f", "score": "0.5665677", "text": "function getFieldFromDomain(domain) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(domain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(domain.field)) {\n return domain.field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefUnionedDomain\"])(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isDataRefDomain\"])(nonUnionDomain) && Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.');\n return field;\n }\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect.');\n return field;\n }\n else if (Object(_vega_schema__WEBPACK_IMPORTED_MODULE_11__[\"isFieldRefUnionDomain\"])(domain)) {\n _log__WEBPACK_IMPORTED_MODULE_7__[\"warn\"]('Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.');\n const field = domain.fields[0];\n return Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(field) ? field : undefined;\n }\n return undefined;\n}", "title": "" }, { "docid": "23f27740eee26c0ab9df0b1c36340c87", "score": "0.56068856", "text": "function quby_getField(fieldVal, obj, name) {\n if (fieldVal === undefined) {\n quby.runtime.fieldNotFoundError(obj, name);\n }\n return fieldVal;\n}", "title": "" }, { "docid": "221457a422e8237234431586f3577b92", "score": "0.5598751", "text": "getFieldId(fieldName) { return this.formId + '_' + fieldName; }", "title": "" }, { "docid": "7daedd4e005a4830689bfdd4f7dd8056", "score": "0.55676585", "text": "function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n } else if (isDataRefUnionedDomain(domain)) {\n let field;\n\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n } else if (field !== nonUnionDomain.field) {\n warn(FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n\n warn(FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n } else if (isFieldRefUnionDomain(domain)) {\n warn(FACETED_INDEPENDENT_SAME_SOURCE);\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n\n return undefined;\n }", "title": "" }, { "docid": "1fad7f5fd4892cae41505efb216f0a75", "score": "0.5554419", "text": "function vgField(fieldDef, opt = {}) {\n var _a, _b, _c;\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n if (isCount(fieldDef)) {\n field = Object(_util__WEBPACK_IMPORTED_MODULE_15__[\"internalField\"])('count');\n }\n else {\n let fn;\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n }\n else {\n const { bin, aggregate, timeUnit } = fieldDef;\n if (Object(_bin__WEBPACK_IMPORTED_MODULE_2__[\"isBinning\"])(bin)) {\n fn = Object(_bin__WEBPACK_IMPORTED_MODULE_2__[\"binToString\"])(bin);\n suffix = ((_a = opt.binSuffix) !== null && _a !== void 0 ? _a : '') + ((_b = opt.suffix) !== null && _b !== void 0 ? _b : '');\n }\n else if (aggregate) {\n if (Object(_aggregate__WEBPACK_IMPORTED_MODULE_1__[\"isArgmaxDef\"])(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmax_${aggregate.argmax}`;\n }\n else if (Object(_aggregate__WEBPACK_IMPORTED_MODULE_1__[\"isArgminDef\"])(aggregate)) {\n argAccessor = `[\"${field}\"]`;\n field = `argmin_${aggregate.argmin}`;\n }\n else {\n fn = String(aggregate);\n }\n }\n else if (timeUnit) {\n fn = Object(_timeunit__WEBPACK_IMPORTED_MODULE_13__[\"timeUnitToString\"])(timeUnit);\n suffix = ((!Object(_util__WEBPACK_IMPORTED_MODULE_15__[\"contains\"])(['range', 'mid'], opt.binSuffix) && opt.binSuffix) || '') + ((_c = opt.suffix) !== null && _c !== void 0 ? _c : '');\n }\n }\n }\n if (fn) {\n field = field ? `${fn}_${field}` : fn;\n }\n }\n if (suffix) {\n field = `${field}_${suffix}`;\n }\n if (prefix) {\n field = `${prefix}_${field}`;\n }\n if (opt.forAs) {\n return Object(_util__WEBPACK_IMPORTED_MODULE_15__[\"removePathFromField\"])(field);\n }\n else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return Object(_util__WEBPACK_IMPORTED_MODULE_15__[\"flatAccessWithDatum\"])(field, opt.expr) + argAccessor;\n }\n else {\n // We flattened all fields so paths should have become dot.\n return Object(_util__WEBPACK_IMPORTED_MODULE_15__[\"replacePathInField\"])(field) + argAccessor;\n }\n}", "title": "" }, { "docid": "a891ac03a2e6b3c44878f972c6a8d572", "score": "0.5552572", "text": "function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n }\n else if (isDataRefUnionedDomain(domain)) {\n let field;\n for (const nonUnionDomain of domain.fields) {\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n }\n else if (field !== nonUnionDomain.field) {\n warn('Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.');\n return field;\n }\n }\n }\n warn('Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect.');\n return field;\n }\n else if (isFieldRefUnionDomain(domain)) {\n warn('Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.');\n const field = domain.fields[0];\n return isString(field) ? field : undefined;\n }\n return undefined;\n }", "title": "" }, { "docid": "dcbca7bd86cf23684b5e4b10b85fe805", "score": "0.55474097", "text": "function t(e){const t=e.fields,r=e.records,n=t.some((e=>\"oid\"===e.name.toLowerCase()))?\"OBJECTID\":\"OID\",i=[{name:n,type:\"esriFieldTypeOID\",alias:\"OID\"}].concat(t.map((e=>({name:e.name,type:\"esriFieldType\"+e.typeName,alias:e.name})))),s=i.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[n]=o++,l=1;l<s.length;l++)t[s[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:\"\",fields:i,features:a}}", "title": "" }, { "docid": "fbecc2ea1498543cac6b77ed335309bc", "score": "0.5532707", "text": "function getField(gr, name) {\n\t\tvar f = {};\n\t\tf.field = name;\n\t\tf.displayValue = gr.getDisplayValue(name);\n\t\tf.value = gr.getValue(name);\n\t\t\n\t\tvar ge = gr.getElement(name);\n\t\tif (ge == null)\n\t\t\treturn f;\n\n\t\tf.type = ge.getED().getInternalType();\n\t\tf.label = ge.getLabel();\n\t\treturn f;\n\t}", "title": "" }, { "docid": "fbecc2ea1498543cac6b77ed335309bc", "score": "0.5532707", "text": "function getField(gr, name) {\n\t\tvar f = {};\n\t\tf.field = name;\n\t\tf.displayValue = gr.getDisplayValue(name);\n\t\tf.value = gr.getValue(name);\n\t\t\n\t\tvar ge = gr.getElement(name);\n\t\tif (ge == null)\n\t\t\treturn f;\n\n\t\tf.type = ge.getED().getInternalType();\n\t\tf.label = ge.getLabel();\n\t\treturn f;\n\t}", "title": "" }, { "docid": "b59d740c8c70aeb06cf07628f096ff52", "score": "0.55144", "text": "function vgField(fieldDef, opt = {}) {\n let field = fieldDef.field;\n const prefix = opt.prefix;\n let suffix = opt.suffix;\n let argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n\n if (isCount(fieldDef)) {\n field = internalField('count');\n } else {\n let fn;\n\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n } else {\n const {\n bin,\n aggregate,\n timeUnit\n } = fieldDef;\n\n if (isBinning(bin)) {\n var _opt$binSuffix, _opt$suffix;\n\n fn = binToString(bin);\n suffix = ((_opt$binSuffix = opt.binSuffix) !== null && _opt$binSuffix !== void 0 ? _opt$binSuffix : '') + ((_opt$suffix = opt.suffix) !== null && _opt$suffix !== void 0 ? _opt$suffix : '');\n } else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmax_\".concat(aggregate.argmax);\n } else if (isArgminDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmin_\".concat(aggregate.argmin);\n } else {\n fn = String(aggregate);\n }\n } else if (timeUnit) {\n var _opt$suffix2;\n\n fn = timeUnitToString(timeUnit);\n suffix = (!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix || '') + ((_opt$suffix2 = opt.suffix) !== null && _opt$suffix2 !== void 0 ? _opt$suffix2 : '');\n }\n }\n }\n\n if (fn) {\n field = field ? \"\".concat(fn, \"_\").concat(field) : fn;\n }\n }\n\n if (suffix) {\n field = \"\".concat(field, \"_\").concat(suffix);\n }\n\n if (prefix) {\n field = \"\".concat(prefix, \"_\").concat(field);\n }\n\n if (opt.forAs) {\n return removePathFromField(field);\n } else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n } else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n }", "title": "" }, { "docid": "f159698240099317e24dabb3ca4ea623", "score": "0.55037355", "text": "field(name: string): ?$Field {\n let index = this.descriptor.findIndex((d) => d.name === name)\n if (inBounds(this.tuple, index)) {\n let {name, type} = this.descriptor[index]\n let value = this.tuple[index]\n return brim.field({name, type, value})\n } else {\n return null\n }\n }", "title": "" }, { "docid": "161bcc419269ed98b883bb9289dc0bfc", "score": "0.5493549", "text": "function vgField(fieldDef) {\n var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var field = fieldDef.field;\n var prefix = opt.prefix;\n var suffix = opt.suffix;\n var argAccessor = ''; // for accessing argmin/argmax field at the end without getting escaped\n\n if (isCount(fieldDef)) {\n field = internalField('count');\n } else {\n var fn;\n\n if (!opt.nofn) {\n if (isOpFieldDef(fieldDef)) {\n fn = fieldDef.op;\n } else {\n var bin = fieldDef.bin,\n aggregate = fieldDef.aggregate,\n timeUnit = fieldDef.timeUnit;\n\n if (isBinning(bin)) {\n var _opt$binSuffix, _opt$suffix;\n\n fn = binToString(bin);\n suffix = ((_opt$binSuffix = opt.binSuffix) !== null && _opt$binSuffix !== void 0 ? _opt$binSuffix : '') + ((_opt$suffix = opt.suffix) !== null && _opt$suffix !== void 0 ? _opt$suffix : '');\n } else if (aggregate) {\n if (isArgmaxDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmax_\".concat(aggregate.argmax);\n } else if (isArgminDef(aggregate)) {\n argAccessor = \"[\\\"\".concat(field, \"\\\"]\");\n field = \"argmin_\".concat(aggregate.argmin);\n } else {\n fn = String(aggregate);\n }\n } else if (timeUnit) {\n var _opt$suffix2;\n\n fn = timeUnitToString(timeUnit);\n suffix = (!contains(['range', 'mid'], opt.binSuffix) && opt.binSuffix || '') + ((_opt$suffix2 = opt.suffix) !== null && _opt$suffix2 !== void 0 ? _opt$suffix2 : '');\n }\n }\n }\n\n if (fn) {\n field = field ? \"\".concat(fn, \"_\").concat(field) : fn;\n }\n }\n\n if (suffix) {\n field = \"\".concat(field, \"_\").concat(suffix);\n }\n\n if (prefix) {\n field = \"\".concat(prefix, \"_\").concat(field);\n }\n\n if (opt.forAs) {\n return removePathFromField(field);\n } else if (opt.expr) {\n // Expression to access flattened field. No need to escape dots.\n return flatAccessWithDatum(field, opt.expr) + argAccessor;\n } else {\n // We flattened all fields so paths should have become dot.\n return replacePathInField(field) + argAccessor;\n }\n }", "title": "" }, { "docid": "189f5e718377c433a75a76a3ac30dfdb", "score": "0.5457317", "text": "get lookupFieldApiName() {\n if (this.objectApiName === DATA_IMPORT.objectApiName) {\n if (this.targetFieldApiName === ACCOUNT1_IMPORTED.fieldApiName) {\n return ACCOUNT_ID.fieldApiName;\n } else if (this.targetFieldApiName === CONTACT1_IMPORTED.fieldApiName) {\n return PRIMARY_CONTACT.fieldApiName;\n }\n }\n return this.targetFieldApiName;\n }", "title": "" }, { "docid": "5879e9356bad275f1d4c57a52f3e9bc4", "score": "0.54560626", "text": "resolveField (fieldName, data) {\n let field = this.fields[fieldName];\n\n if (typeof field === 'undefined') {\n return undefined;\n }\n\n if (typeof field.value === 'function') {\n return field.value(data);\n }\n\n return data[field.value];\n }", "title": "" }, { "docid": "e6b06cc07ebd69b71ea00e02583c561e", "score": "0.541252", "text": "getField(fieldName) {\n const fields = this.getFields();\n\n if (!fields[fieldName]) {\n throw new Error(`Cannot get field '${fieldName}' from input type '${this.getTypeName()}'. Field does not exist.`);\n }\n\n return fields[fieldName];\n }", "title": "" }, { "docid": "ed3e1d08061af085a7beb168303808b0", "score": "0.5396312", "text": "_constainsFieldRef(field)\n\t{\n\t\tlet contains_dot = field.indexOf(\".\") >=0;\n\t\tif(!contains_dot)\n\t\t\treturn false;\n\n\t\tlet first_field = field.split(\".\")[0];\n\n\t\tfor(let f in this.populate )\n\t\t\tif( first_field == f )\n\t\t\t\treturn f;\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c0a166cb973bbcc35b34104c61f561da", "score": "0.5389766", "text": "getField(object, id)\n\t{\n\t\tlet field;\n\t\tconst robot = Designer.getInstance().robot;\n\t\tconst component = Designer.getInstance().component;\n\t\tconst tpl = robot? robot.getTemplate() : null;\n\n\t\tswitch (object)\n\t\t{\n\t\t\tcase 'Document':\n\t\t\t\tfor (let i = 0; i < this.#fields.length; ++i)\n\t\t\t\t{\n\t\t\t\t\tif (id === this.#fields[i].Id)\n\t\t\t\t\t{\n\t\t\t\t\t\tfield = this.#fields[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Template':\n\t\t\t\tif (tpl && component && component.triggerManager)\n\t\t\t\t{\n\t\t\t\t\tfield = component.triggerManager.getReturnProperty(tpl.getStatusId(), id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Constant':\n\t\t\t\tif (tpl)\n\t\t\t\t{\n\t\t\t\t\tfield = tpl.getConstant(id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GlobalConst':\n\t\t\t\tif (component)\n\t\t\t\t{\n\t\t\t\t\tfield = component.getConstant(id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GlobalVar':\n\t\t\t\tif (component)\n\t\t\t\t{\n\t\t\t\t\tfield = component.getGVariable(id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tvar foundRobot = tpl? tpl.getRobotById(object) : null;\n\t\t\t\tif (foundRobot)\n\t\t\t\t{\n\t\t\t\t\tfield = foundRobot.getReturnProperty(id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn field || {\n\t\t\tId: id,\n\t\t\tObjectId: object,\n\t\t\tName: id,\n\t\t\tType: 'string',\n\t\t\tExpression: id,\n\t\t\tSystemExpression: '{='+object+':'+id+'}'\n\t\t};\n\t}", "title": "" }, { "docid": "97a5971fbcbf0431cd0cca847f1c5908", "score": "0.5389513", "text": "deduceFieldLabel(template, invertedScopeFieldPaths, fieldkey) {\n const key = invertedScopeFieldPaths[`details.${fieldkey}`].replace(/\\.fieldName$/, '')\n const fieldDescriptionObject = _.get(template, key)\n\n return fieldDescriptionObject.summaryTitle || fieldDescriptionObject.title\n }", "title": "" }, { "docid": "b81d9310099dbac4e95e9a99ec78e3df", "score": "0.5388043", "text": "getFields(objCollector, field) {\n if (objCollector[field]) {\n return objCollector[field];\n }\n return null;\n }", "title": "" }, { "docid": "7c36321f8ee1d46a7efc767174c1418d", "score": "0.53837717", "text": "getFieldClass() {\n return \"mutt-field mutt-field-object\"\n }", "title": "" }, { "docid": "5075618ee0ecbe42f22f52a3b8ea37dd", "score": "0.53787756", "text": "getFieldName() {\n return this.props.fieldName\n }", "title": "" }, { "docid": "8a132da1473b972b86b602d4815203de", "score": "0.53714824", "text": "field(v) {\n if (typeof v === 'string') {\n this.fieldName = v;\n }\n return this;\n }", "title": "" }, { "docid": "2c361ba7984bdf61bb26ebd7b425567e", "score": "0.5358412", "text": "get(field) {\n return this.db[this.id][field];\n }", "title": "" }, { "docid": "ffc5e24337d7359b4ccbe606164b2390", "score": "0.5356273", "text": "function getField(field, row) {\n\t\tvar item = row.ref;\n\n\t\tswitch (field) {\n\t\t\tcase 'title':\n\t\t\t\treturn Zotero.Items.getSortTitle(item.getDisplayTitle());\n\n\t\t\tcase 'hasAttachment':\n\t\t\t\tif (item.isFileAttachment()) {\n\t\t\t\t\tvar state = item.fileExistsCached() ? 1 : -1;\n\t\t\t\t} else\n\t\t\t\tif (item.isRegularItem()) {\n\t\t\t\t\tvar state = item.getBestAttachmentStateCached();\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t// Make sort order present, missing, empty when ascending\n\t\t\t\tif (state === 1) {\n\t\t\t\t\tstate = 2;\n\t\t\t\t} else\n\t\t\t\tif (state === -1) {\n\t\t\t\t\tstate = 1;\n\t\t\t\t}\n\t\t\t\treturn state;\n\n\t\t\tcase 'numNotes':\n\t\t\t\treturn row.numNotes(false, true) || 0;\n\n\t\t\t// Use unformatted part of date strings (YYYY-MM-DD) for sorting\n\t\t\tcase 'date':\n\t\t\t\tvar val = row.ref.getField('date', true, true);\n\t\t\t\tif (val) {\n\t\t\t\t\tval = val.substr(0, 10);\n\t\t\t\t\tif (val.indexOf('0000') == 0) {\n\t\t\t\t\t\tval = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn val;\n\n\t\t\tcase 'year':\n\t\t\t\tvar val = row.ref.getField('date', true, true);\n\t\t\t\tif (val) {\n\t\t\t\t\tval = val.substr(0, 4);\n\t\t\t\t\tif (val == '0000') {\n\t\t\t\t\t\tval = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn val;\n\n\t\t\tdefault:\n\t\t\t\treturn row.ref.getField(field, false, true);}\n\n\t}", "title": "" }, { "docid": "df8cde15449cf736c46b25bf26811d93", "score": "0.5348879", "text": "function fieldId(field) {\n return 'field-' + field.randomId;\n}", "title": "" }, { "docid": "c678cb5fb97b8523ce79a07612ba89cd", "score": "0.53381324", "text": "function getFieldFromDomain(domain) {\n if (isDataRefDomain(domain) && isString(domain.field)) {\n return domain.field;\n } else if (isDataRefUnionedDomain(domain)) {\n var field;\n\n var _iterator6 = _createForOfIteratorHelper(domain.fields),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var nonUnionDomain = _step6.value;\n\n if (isDataRefDomain(nonUnionDomain) && isString(nonUnionDomain.field)) {\n if (!field) {\n field = nonUnionDomain.field;\n } else if (field !== nonUnionDomain.field) {\n warn(FACETED_INDEPENDENT_DIFFERENT_SOURCES);\n return field;\n }\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n warn(FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES);\n return field;\n } else if (isFieldRefUnionDomain(domain)) {\n warn(FACETED_INDEPENDENT_SAME_SOURCE);\n var _field = domain.fields[0];\n return isString(_field) ? _field : undefined;\n }\n\n return undefined;\n }", "title": "" }, { "docid": "f60989ef095a66fc39f3a7456ea3cf91", "score": "0.5333641", "text": "get(field) {\n if( this.information.hasOwnProperty(field) ) {\n return inis.information[field];\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "378ccfd96a2775216fce1cdf24bf3e38", "score": "0.5302938", "text": "static get Fields() {\n return {\n \"vt\": {\n title: \"Threshold Voltage\",\n description: \"Threshold voltage\",\n units: \"Volts\",\n symbol: \"V\",\n default_value: 1.5,\n data_type: parseFloat,\n range: [-Infinity, Infinity]\n },\n \"pnp\": {\n title: \"Polarity\",\n description: \"Current multiplier\",\n default_value: 1,\n data_type: Math.sign,\n field_type: \"select\",\n select_values: { \"N-Channel\": -1, \"P-Channel\": 1 }\n }\n };\n }", "title": "" }, { "docid": "49af9d9c1296ffab3d81a41eb3c7de0e", "score": "0.529964", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"a\" /* SchemaMetaFieldDef */].name && schema.getQueryType() === parentType) {\n return __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"a\" /* SchemaMetaFieldDef */];\n } else if (fieldName === __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"c\" /* TypeMetaFieldDef */].name && schema.getQueryType() === parentType) {\n return __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"c\" /* TypeMetaFieldDef */];\n } else if (fieldName === __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"d\" /* TypeNameMetaFieldDef */].name) {\n return __WEBPACK_IMPORTED_MODULE_14__type_introspection__[\"d\" /* TypeNameMetaFieldDef */];\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "35d4631644e9aa2b1a467df9078a6c21", "score": "0.5299342", "text": "field_name(k) {\n var names = this._field_names();\n for (let par = this.parent_rtd; par; par = par.parent_rtd) {\n names = par._field_names() + names;\n }\n return names[k];\n }", "title": "" }, { "docid": "4548460de75a574af1877b2b07a50e02", "score": "0.5286505", "text": "function getFieldDef(schema, type, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.SchemaMetaFieldDef;\n }\n if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.TypeMetaFieldDef;\n }\n if (fieldName === _introspection.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) {\n return _introspection.TypeNameMetaFieldDef;\n }\n if (type.getFields && typeof type.getFields === 'function') {\n return type.getFields()[fieldName];\n }\n\n return null;\n}", "title": "" }, { "docid": "4548460de75a574af1877b2b07a50e02", "score": "0.5286505", "text": "function getFieldDef(schema, type, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.SchemaMetaFieldDef;\n }\n if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.TypeMetaFieldDef;\n }\n if (fieldName === _introspection.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) {\n return _introspection.TypeNameMetaFieldDef;\n }\n if (type.getFields && typeof type.getFields === 'function') {\n return type.getFields()[fieldName];\n }\n\n return null;\n}", "title": "" }, { "docid": "361ca936979d52fc55522400d5f9c2df", "score": "0.5278422", "text": "static get Fields() {\n\t return {\n\t \"vt\": {\n\t data_type: parseFloat,\n\t name: \"Threshold Voltage\",\n\t description: \"Threshold voltage\",\n\t units: \"Volts\",\n\t symbol: \"V\",\n\t default_value: 1.5,\n\t range: [-Infinity, Infinity]\n\t },\n\t \"pnp\": {\n\t name: \"Polarity\",\n\t description: \"Current multiplier\",\n\t default_value: 1,\n\t data_type: Math.sign,\n\t field_type: \"select\",\n\t select_values: { \"N-Channel\": -1, \"P-Channel\": 1 }\n\t }\n\t };\n\t }", "title": "" }, { "docid": "cb6e3f25eb1af04ec5ad229cf3086ad6", "score": "0.52767944", "text": "function getReference(){\n\t\treturn this.reference;\n\t}", "title": "" }, { "docid": "cbb6f1079010eda7f71795ee016e0f56", "score": "0.525068", "text": "function getFieldDef(schema, type, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.SchemaMetaFieldDef;\n }\n if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.TypeMetaFieldDef;\n }\n if (fieldName === _introspection.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) {\n return _introspection.TypeNameMetaFieldDef;\n }\n if (type.getFields) {\n return type.getFields()[fieldName];\n }\n}", "title": "" }, { "docid": "cbb6f1079010eda7f71795ee016e0f56", "score": "0.525068", "text": "function getFieldDef(schema, type, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.SchemaMetaFieldDef;\n }\n if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === type) {\n return _introspection.TypeMetaFieldDef;\n }\n if (fieldName === _introspection.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) {\n return _introspection.TypeNameMetaFieldDef;\n }\n if (type.getFields) {\n return type.getFields()[fieldName];\n }\n}", "title": "" }, { "docid": "7d89afa54949ee790e9bde42cfe31bd0", "score": "0.52364284", "text": "findField(path) {\n if (path.constructor !== Array) {\n path = path.split(\",\");\n } else {\n path = path.slice(0); // clone array\n }\n\n let n = this.fields;\n for (; path.length > 1; path.shift()) {\n n = n[path[0]].fields;\n }\n\n return n[path[0]];\n }", "title": "" }, { "docid": "590dd83960d18289ce717eaa9b03cae0", "score": "0.52363473", "text": "function getFieldName(field){\r\n var res=['[',DATA_FIELD];\r\n //[data-field]\r\n if(field !== undefined){\r\n //[data-field=\"field\"]\r\n res=res.concat(['=','\"',field,'\"']);\r\n }\r\n //\r\n res.push(']');\r\n \r\n return res.join('');\r\n }", "title": "" }, { "docid": "ef1190ab3500e4a9faf4555767bcf373", "score": "0.5216826", "text": "function getReference(member) {\n if (member && member.entity) {\n return member.entity.reference;\n }\n console.warn('api.resolvePatients.getReference: unknown reference type in:', list, member);\n }", "title": "" }, { "docid": "1ec7e4e0bb42f087d966b56f6de4a5c6", "score": "0.5215265", "text": "function Fay$$readRef(ref,x){\n return ref.value;\n}", "title": "" }, { "docid": "363ee3f380a2f53209b968b8e80b2cd8", "score": "0.5210737", "text": "function vivified (field) {\n if (field.vivify == 'descend') {\n return vivified(field.fields[0])\n }\n return field.vivify\n}", "title": "" }, { "docid": "c35ec8fcd2b6a261e6e09b8175eb6f84", "score": "0.51883286", "text": "function getOwnDefinition(type, field) {\n return type.hasOwnProperty(field) ? type[field] : null;\n }", "title": "" }, { "docid": "6347294fa188bee07b64049767f9019f", "score": "0.51840156", "text": "function accrFieldInfo(prop) {\n return 'formObject.' + index + '.'+prop\n }", "title": "" }, { "docid": "58d1abdf6f45407a3e84dfc95b46acda", "score": "0.5183137", "text": "function getFieldValue(field, root, tip) {\n return field[0] === '/' ? utils_1.lodash.get(root, field.slice(1)) : tip[field];\n}", "title": "" }, { "docid": "8f785f5986b2495ed73401635ad6852d", "score": "0.5180342", "text": "getFieldLabels() {\n return {\n \"name\":t(\"Name\"),\n \"roleId\": t(\"ID\")\n }\n }", "title": "" }, { "docid": "7b73b80d7a503bd396f9de3486d9bdee", "score": "0.51597345", "text": "static asFieldName (path) {\n const parts = path.split('.')\n return parts[0] + parts.slice(1).map(elem => `[${elem}]`).join('')\n }", "title": "" }, { "docid": "00df384b62f6d6645e602ca29eeffd48", "score": "0.5159045", "text": "getColumnSource(fieldName) {\n let column = this.state.columns.filter(c => (c.field === fieldName))[0];\n return column.source;\n }", "title": "" }, { "docid": "cb35f69bf08ab18e1702017c2e065400", "score": "0.5157324", "text": "getFieldType(fieldSchema) {\n return \"field-\" + fieldSchema.type;\n }", "title": "" }, { "docid": "3ce4d9b8902a221c94b73833896b3c46", "score": "0.5149834", "text": "function getFieldDef(schema, parentType, fieldName) {\n\t if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n\t return _introspection.SchemaMetaFieldDef;\n\t } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n\t return _introspection.TypeMetaFieldDef;\n\t } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) {\n\t return _introspection.TypeNameMetaFieldDef;\n\t }\n\t return parentType.getFields()[fieldName];\n\t}", "title": "" }, { "docid": "9a5f35f2ba3b576957b99920ce8b4fc3", "score": "0.51420903", "text": "function getVehicleSearchFields() { \n\n return {\n _id: 0, VEHICLE_NUMBER: { $literal: \"1111\" }, MAKER: \"$_id.MAKER\", MODEL: \"$_id.MODEL\", YEAR: \"$_id.YEAR\",\n ENGINE: \"$_id.ENGINE\", ENGINE_TYPE: \"$_id.ENGINE_TYPE\", GEAR: \"$_id.GEAR\", DAILY_PRICE: \"$_id.DAILY_PRICE\", \n FUEL_TYPE: \"$_id.FUEL_TYPE\", DOORS: \"$_id.DOORS\", AIR_COND: \"$_id.AIR_COND\", CAR_CATEGORY: \"$_id.CAR_CATEGORY\",\n PIC_PATH: \"$_id.PIC_PATH\", PIC_PATH_2: \"$_id.PIC_PATH_2\",\n };\n}", "title": "" }, { "docid": "7764dd696848faf38d696c568f2c404e", "score": "0.5123435", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"SchemaMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"SchemaMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeNameMetaFieldDef\"].name) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeNameMetaFieldDef\"];\n }\n\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "7764dd696848faf38d696c568f2c404e", "score": "0.5123435", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"SchemaMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"SchemaMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeNameMetaFieldDef\"].name) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_16__[\"TypeNameMetaFieldDef\"];\n }\n\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "714245a117f2fca753b7a26fbbb4353b", "score": "0.51168025", "text": "function getField(fields, field, def) {\n return (fields[field] !== undefined) ? fields[field] : def;\n}", "title": "" }, { "docid": "67a4ac2d773b10d528cf9a169f54e607", "score": "0.51163477", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"SchemaMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"SchemaMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeNameMetaFieldDef\"].name) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeNameMetaFieldDef\"];\n }\n\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "48873ebd1487ba1ef0bd68f2084d8329", "score": "0.5113032", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"SchemaMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"SchemaMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeMetaFieldDef\"].name && schema.getQueryType() === parentType) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeMetaFieldDef\"];\n } else if (fieldName === _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeNameMetaFieldDef\"].name) {\n return _type_introspection__WEBPACK_IMPORTED_MODULE_14__[\"TypeNameMetaFieldDef\"];\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "1e6a0e1d0b4d2c561044919320626678", "score": "0.5112986", "text": "function get(target, field) {\n var pathArray = splitNested(field);\n var result = void 0;\n try {\n result = pathArray.reduce(function (curr, path) {\n return curr[path];\n }, target);\n } catch (e) {}\n return result;\n}", "title": "" }, { "docid": "1e6a0e1d0b4d2c561044919320626678", "score": "0.5112986", "text": "function get(target, field) {\n var pathArray = splitNested(field);\n var result = void 0;\n try {\n result = pathArray.reduce(function (curr, path) {\n return curr[path];\n }, target);\n } catch (e) {}\n return result;\n}", "title": "" }, { "docid": "eb38d845710c3a5b28102c1849a91902", "score": "0.5092993", "text": "function getField( key ) {\n //return inData.filter( (item) => item.Name === Name )\n return inData[ key ]\n }", "title": "" }, { "docid": "96e8c26aea14f053decd1400d4d46e16", "score": "0.5092683", "text": "function NODE_getLVReferencedName()\n{\n\treturn this.LVReferencedName;\n}", "title": "" }, { "docid": "8a7f7f192eae66f02b0f86c8cc001191", "score": "0.5081358", "text": "getFormField(field) {\n return this.state.currentForm.get(field)\n }", "title": "" }, { "docid": "23f7208d94dd538faad066da7738ccaa", "score": "0.5077286", "text": "function getFieldValue(object, fieldName) {\n\t var d = Def.fromValue(object);\n\t if (d) {\n\t var field = d.allFields[fieldName];\n\t if (field) {\n\t return field.getValue(object);\n\t }\n\t }\n\t\n\t return object && object[fieldName];\n\t }", "title": "" }, { "docid": "de10c0cd4afb16a9e96be55e0270b34a", "score": "0.50765204", "text": "function getFieldValue(data, fieldName) {\n var fieldValue;\n data.fields.forEach(function(field){\n if (field.value && field.variable_name === fieldName){\n if (field.type === 'image' && field.value[0]) {\n fieldValue = field.value[0].secure_url\n } else {\n fieldValue = field.value;\n }\n }\n });\n return fieldValue;\n}", "title": "" }, { "docid": "08c9d074dce52acab721ed3f3ad3b3d8", "score": "0.50495416", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.SchemaMetaFieldDef;\n } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.TypeMetaFieldDef;\n } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) {\n return _introspection.TypeNameMetaFieldDef;\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "08c9d074dce52acab721ed3f3ad3b3d8", "score": "0.50495416", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.SchemaMetaFieldDef;\n } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.TypeMetaFieldDef;\n } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) {\n return _introspection.TypeNameMetaFieldDef;\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "08c9d074dce52acab721ed3f3ad3b3d8", "score": "0.50495416", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.SchemaMetaFieldDef;\n } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _introspection.TypeMetaFieldDef;\n } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) {\n return _introspection.TypeNameMetaFieldDef;\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "db9a7c54f5a3f3820deb1f0290e8cb8c", "score": "0.50399363", "text": "getReferenceValue() {\n let type = (this.$el.attr('data-dependsonreftype') || '').trim();\n if (!type) {\n type = ns.ElementAccessors.getPreferableType(this.$el);\n }\n return ns.castToType(ns.ElementAccessors.getValue(this.$el), type);\n }", "title": "" }, { "docid": "79ee8806a97c2bd21788acffe53e8f59", "score": "0.5038828", "text": "function isReferenceField(field) {\n\t\tlet result = false;\n\t\t//get value from field\n\t\tObject.keys(field).forEach((locale) => {\n\t\t\tconst fieldValue = field[locale];\n\t\t\tif (Array.isArray(fieldValue)) {\n\t\t\t\tfieldValue.forEach((val) => {\n\t\t\t\t\tif (val.sys && val.sys.type === \"Link\") {\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// check if single link or rich text\n\t\t\t\tif (fieldValue.nodeType === \"document\") {\n\t\t\t\t\tresult = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (fieldValue.sys && fieldValue.sys.type === \"Link\") {\n\t\t\t\t\tresult = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "fdeb4ac6043da1607b0068d6e69a3255", "score": "0.5030732", "text": "function getFieldDef(schema, parentType, fieldName) {\n if (fieldName === _typeIntrospection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _typeIntrospection.SchemaMetaFieldDef;\n } else if (fieldName === _typeIntrospection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return _typeIntrospection.TypeMetaFieldDef;\n } else if (fieldName === _typeIntrospection.TypeNameMetaFieldDef.name) {\n return _typeIntrospection.TypeNameMetaFieldDef;\n }\n return parentType.getFields()[fieldName];\n}", "title": "" }, { "docid": "ecde9b0be82ac693f12f54975a680bbd", "score": "0.5027917", "text": "function fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map(function(f, i) {\n return as[i] || Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"accessorName\"])(f);\n });\n}", "title": "" }, { "docid": "ecde9b0be82ac693f12f54975a680bbd", "score": "0.5027917", "text": "function fieldNames(fields, as) {\n if (!fields) return null;\n return fields.map(function(f, i) {\n return as[i] || Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"accessorName\"])(f);\n });\n}", "title": "" } ]
911448959c7ec4e868f93394011d9c30
This function handles getting the index from toDos using the id from the element.
[ { "docid": "aebea32c0e771cee02822ba43ee0d40f", "score": "0.70989585", "text": "function findIndexById(check){\n // Loop through until we find id that matches the check\n for(let i = 0; i < toDos.length; i ++) {\n if (toDos[i].id === parseInt(check)) {\n return i;\n }\n }\n return false;\n}", "title": "" } ]
[ { "docid": "557f6dd28d04e1eae8863714d0dce257", "score": "0.66794723", "text": "function getIndexElemFrom(id, list) {\n for (var index = 0; index < list.length; index++) {\n var element = list[index];\n if (element.id === id) {\n return index;\n }\n }\n }", "title": "" }, { "docid": "a8c5264654f4846a33813a891b22ee12", "score": "0.6610599", "text": "getTheID(todoID) {\r\n return todoIndex = todos.findIndex(todo => todo.id === todoID)\r\n }", "title": "" }, { "docid": "efb9afafcf8432bb71e99b918db60a7a", "score": "0.6336692", "text": "function todoElementIndex(element) {\n const todoElements = Array.from( viewSection.querySelectorAll(\".todo-container\") );\n return todoElements.indexOf(element);\n}", "title": "" }, { "docid": "c59f71fb7ceee11b7da25c08f0fb8baf", "score": "0.631505", "text": "buscarIndex(id,array){\r\n return array.findIndex((elem) => elem.getId() === id);\r\n }", "title": "" }, { "docid": "a3795553adde4461ba3029e5bee46ae9", "score": "0.62278867", "text": "function BuscarIndiceAnuncio(id){\n //Validar datos\n for(let i=0; i<listaAnuncios.length; i++){\n if(listaAnuncios[i].id == id)\n return i;\n }\n \n return -1;\n}", "title": "" }, { "docid": "1eb59951cc261992a89f1749705f8de4", "score": "0.62058675", "text": "indexOfId(id) {\n for (let index = 0; index < this.items.length; index++) {\n if (this.items[index].id === id) return index;\n }\n }", "title": "" }, { "docid": "dbb05c24e147090a42aa47ffa775d7c7", "score": "0.61699677", "text": "at(id) {\n\n // get the idx of the todo\n let idx = typeof id == 'number' ? id : this.data.findIndex(function (item) { return item.id == id });\n\n // no todo? return null\n if (idx == -1) return null;\n\n // return the Todo\n return this.data[idx];\n }", "title": "" }, { "docid": "c0f9a58136de910278075a7773a166b5", "score": "0.61510885", "text": "function getIndexById(id){\r\n var index;\r\n for(var i = 0; i < shop.products.length; i++){\r\n if(shop.products[i].id == id){\r\n index = i;\r\n }\r\n };\r\n return index;\r\n }", "title": "" }, { "docid": "69c8b310414166efc5acf37319b8c929", "score": "0.61255133", "text": "function ObtenerUsuarioIndex(_id, _array) {\n var indice;\n $.each(_array, function(index, value) {\n if (_id == value.id) indice = index;\n })\n return indice;\n}", "title": "" }, { "docid": "cc8e5026ad72605dcfeb6e5379e620b5", "score": "0.6106144", "text": "function findObjectIndex (e) {\n if(e.target && e.target.nodeName == \"INPUT\") {\n let affectedObject = this.getAttribute(\"data-id\");\n myLibrary[affectedObject].readStatus();\n }\n}", "title": "" }, { "docid": "78924ab67897de61e55f580ef59d6f16", "score": "0.6099374", "text": "function readTodo(id){\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\treturn listArr[index];\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "29c90219f547d613b0b398663509a8f8", "score": "0.60511345", "text": "function ObtenerLibroIndex(_id) {\n var indice;\n $.each(Libros, function(index, libro) {\n if (libro.libro_id == _id) indice = index;\n });\n return indice;\n}", "title": "" }, { "docid": "197d6ec1ca47f75e990842550ac1a995", "score": "0.60335076", "text": "function findNodeID(list, id) {\n\t\tvar len = list.length;\n\t\tfor (var i=len-1; i > -1; i--) {\n\t\t\tif (list[i].index == id)\n\t\t\t\treturn i;\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "e5eea5e9223182eb9cbbe6c01d62aaef", "score": "0.59604424", "text": "function posicion(id, array) {\n var ctl = -1;\n var long = array.length;\n for (var i = 0; i < long; i++) {\n if (array[i] == id) {\n ctl = i;\n return ctl;\n }\n }\n return ctl;\n}", "title": "" }, { "docid": "1ec3716b077bd1418d7f93ebc4a69138", "score": "0.5958282", "text": "getItemIndex(id) {\n if (!id) {\n throw new Error(`An id must be provided to getItemIndex`);\n }\n if (typeof id !== 'string') {\n throw new Error(\n `The id provided to getItemIndex must be a string. Received ${id}(${typeof id})`\n );\n }\n const index = this.#items.findIndex((item) => {\n return item._id === id;\n });\n\n if (!~index) {\n log(`Item with _id of ${id} not found`);\n }\n return index;\n }", "title": "" }, { "docid": "624c46b509981df1dc35ce4e39890097", "score": "0.5952308", "text": "getItemIndex(id) {\n if (typeof id === \"undefined\") {\n throw new Error(`An id must be provided to getItemIndex`);\n }\n if (typeof id !== \"string\") {\n throw new Error(\n `The id provided to getItemIndex must be a string. Received ${id}(${typeof id})`\n );\n }\n const index = this.#items.findIndex((item) => {\n return item._id === id;\n });\n\n if (!~index) {\n log(`Item with _id of ${id} not found`);\n }\n return index;\n }", "title": "" }, { "docid": "0fc9e448c16d14d8ddbd1d9d437cdf88", "score": "0.59229517", "text": "get (id) {\n return this.index[id] || null;\n }", "title": "" }, { "docid": "f6a9a274bda80cba3c2458327f866c9f", "score": "0.59160364", "text": "function getIndexByID(id) {\n var index = posts.map(function(el) {\n return el.ids;\n }).indexOf(id);\n return index;\n}", "title": "" }, { "docid": "ea3bd57befc308a2c5bf67905bf1401b", "score": "0.5902852", "text": "function getTaskIndex (e) {\n\t// Obtenemos el elemento de la tarea, el padre que es el li\n\tlet taskItem = e.target.parentElement,\n\t\t// creamos un array con todos los elementos li\n\t tasksItems = [...taskContainerElement.querySelectorAll('li')];\n\t return tasksItems.indexOf(taskItem);\n}", "title": "" }, { "docid": "2e4a6da4909487b21f7081b4883e8530", "score": "0.5891021", "text": "function getSelectedIndexes(){\n console.log('Herro')\n console.log($('.active_file').index())\n}", "title": "" }, { "docid": "bc0c619e9d2a6c6fd527b88f024cb75f", "score": "0.5887517", "text": "function findElement(id){\r\n\t\tvar found = false;\r\n\t\tvar i = 0;\r\n\t\twhile(!found){\r\n\t\t\tif($scope.tasks[i].id == id){\r\n\t\t\t\tfound=true;\r\n\t\t\t}else{\r\n\t\t\t\ti++;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn i;\r\n\t}", "title": "" }, { "docid": "2f52e7209d693d22c70fe0c357758ecb", "score": "0.58700186", "text": "findCurrentTouchIndex(id){\n for (let i=0; i < this.state.currentTouches.length; i++) {\n if (this.state.currentTouches[i].id === id) {\n return i;\n }\n }\n // Touch not found! Return -1.\n return -1;\n }", "title": "" }, { "docid": "00ff4022414247d3cc6208a06e768218", "score": "0.58613896", "text": "function getSelectedIndex(id) {\n for (var i = 0; i < $scope.listProducts.length; i++) {\n if ($scope.listProducts[i].id == id) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "f1d6f0dc23c82abd5358c6adb980d196", "score": "0.5855175", "text": "function get_node(id)\n {\n return indexbyid[id];\n }", "title": "" }, { "docid": "bcbb69a09a49b37bbe11c2e71ac6e9f6", "score": "0.5854096", "text": "function getIndexFromAllDayDiv(strId) {\n var ind = strId.replace(/^allDayListDiv[\\D]*/i, '');\n return ind;\n }", "title": "" }, { "docid": "6ddd558c3bd15d8773d46c1ff5829974", "score": "0.5849654", "text": "function getProductIndex(id) \n{\n for (var i = 0; i < products.length; i++) \n\t{\n if (products[i].Id == id) \n\t\treturn i;\n }\n}", "title": "" }, { "docid": "25869e428edd26031a4ad5b7272313ef", "score": "0.5843295", "text": "getId() {\n this.currentIndex = this.currentIndex + 1;\n return this.currentIndex;\n }", "title": "" }, { "docid": "c224cc4de9a00bff27baa2d4a199a07a", "score": "0.5841371", "text": "function getOtherRobotIndex(id) {\n for (var i = 0; i < otherRobots.length; i++) {\n if (otherRobots[i].scans[0].data.id == id) {\n otherIndex = i;\n return i;\n }\n }\n return null;\n}", "title": "" }, { "docid": "008fb4288dc4feb995be652b5db95098", "score": "0.58129996", "text": "function getIndexByTdId(cell) // cell: Spot <td> id\r\n{\r\n for(var i = 0; i < boardSize; i++)\r\n {\r\n if(cell == Board[i].dspot)\r\n {\r\n return i;\r\n }\r\n }\r\n alert(\"BUG! Invalid Cell\\n\"+\"Object: \"+cell);\r\n return null;\r\n}", "title": "" }, { "docid": "caf060abe3864e628dbc6674d4b91ec2", "score": "0.5810079", "text": "function findIndex(id, objs){\n\t\t\tfor(var i = 0; i < objs.length; i++){\n\t\t\t\tvar obj = objs[i];\n\t\t\t\tif(obj && obj.id === id){\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "title": "" }, { "docid": "b12c9a4eeef62bc90b8bea16e864fb8d", "score": "0.5809276", "text": "function findIndexInListById(idToFind, idField) {\n if (idToFind && idField) {\n var elementIndex = vm.catalogElements\n .map(function mapRepeater(currentElement) {\n return currentElement[idField];\n })\n .indexOf(idToFind);\n return elementIndex;\n }\n else {\n return -1;\n }\n }", "title": "" }, { "docid": "16366111f65d8ce087e87741975e0d0c", "score": "0.5797147", "text": "function findNodeIndex(id) {\n for (var i=0; i<nodes_data.length; i++) {\n if (nodes_data[i].id === id) {\n return i;\n }\n }\n\n console.log(\"Error: ID \"+id+\" not found\");\n return -1;\n}", "title": "" }, { "docid": "e9fcd0601e4a694d5d6ddf30b74e1937", "score": "0.5752073", "text": "traverseToIndex() { }", "title": "" }, { "docid": "498c9932811a11a7cd777b205dff7211", "score": "0.57506686", "text": "function thisToDoId(id) {\n return id;\n}", "title": "" }, { "docid": "eeb95dd4ee047d05167feb6582a03761", "score": "0.57151824", "text": "function getProductIndex(id)\n{\n for(var i=0;i<products.length;i++)\n {\n if(products[i].id==id)\n return i;\n }\n}", "title": "" }, { "docid": "0ea269b0cd850c028bcfac40e11f5dc0", "score": "0.56818014", "text": "function findListInCtrl(id) {\n\t\tvar lists = that.data.lists;\n\t\tfor (var i = 0, len = lists.length; i < len; i++) {\n\t\t\tif (lists[i].id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "1496877d92cda40da05ca4c8e4b9ac8e", "score": "0.5670302", "text": "function getIndex(cardEl) {\n return (cardEl.attr(\"id\").split(\"-\"))[1];\n }", "title": "" }, { "docid": "b05f01a64aaa15fb825495811a2329b6", "score": "0.5654604", "text": "function getRestaurantIndex(restaurantList, id) {\n return restaurantList\n .findIndex((restaurant) => restaurant.ID === parseInt(id))\n}", "title": "" }, { "docid": "4b1bbbb072716a129a77a1b61c5e9872", "score": "0.56528246", "text": "function returnIndexOfArrayFromId(req, res, next) {\r\n const { id } = req.params;\r\n req.indexArray = projects.findIndex(p => p.id === id);\r\n return next();\r\n}", "title": "" }, { "docid": "43b280e7bf61cc7292fdc46d6a51dfda", "score": "0.56190336", "text": "function findId(id) {\n\tfor(var i=0; i<tasks.length; i++) {\n\t\tif(tasks[i] == id) return i;\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "a60b4b3152715191b3ef4b5672337b81", "score": "0.56170344", "text": "function getExerciseIndexFromClick(e){\n const target = $(e.currentTarget).closest('.exercise').closest('.col-4');\n \n let index = target.index();\n console.log('Index' + index);\n return index;\n}", "title": "" }, { "docid": "bf3dd87b11cafef489e135458e585a88", "score": "0.56100565", "text": "get index() {\n\t\treturn parseInt(this.getAttribute('index'));\n\t}", "title": "" }, { "docid": "5ed2903e70a476f7cbf91e871c87eed1", "score": "0.56075966", "text": "function editTodoStart(start, id){\n\tvar count = readCount();\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\tlistArr[index][START] = start;\n\t\t\twriteTodosArray(count, listArr);\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "title": "" }, { "docid": "12c8753719637e485da368e9bc33f621", "score": "0.56052524", "text": "function getResultId(id, index) {\n return id + \"-result-\" + (index + 1);\n}", "title": "" }, { "docid": "2645b873a09e406a4c8c979236600d26", "score": "0.560209", "text": "function getIndex(id, array){ //function that returns the index of where a seat element object is\n\tfor(i=0; i<array.length; i++) {\n\t\tif(array[i].seat == id)\n\t\t{\n\t\t\treturn i;\n\t\t\tbreak;\n\t\t}\n}\n}", "title": "" }, { "docid": "14a0774c2f9a5636670680095882b584", "score": "0.5596725", "text": "function elemOrderToLedId( ielem ) {\n\tfor ( var i=0; i < fixture.channels.length; i++ ) {\n\t\tvar elem = fixture.channels[i];\n\t\tif (elem.index == ielem) {\n\t\t\treturn elem.id;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "10b5ef2613a1371e6467991463c7c515", "score": "0.55918753", "text": "function dskLbl2Idx(id) {\r\n for (var i = 0; i < dsks.length; i++) {\r\n if (dsks[i].id == id) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }", "title": "" }, { "docid": "41a2fba095dd486a3602077cff528d2c", "score": "0.55780804", "text": "function findIndexById(id) {\n return $scope.contacts.findIndex(contact => (contact._id === id));\n }", "title": "" }, { "docid": "e7ca674c9541d15fcb71e3f4f59fb599", "score": "0.5577621", "text": "function elemIndexInspektor(node)\n{\n for (let i = 0; i < allLi.length; i++)\n {\n if (allLi[i] === node)\n return i;\n }\n}", "title": "" }, { "docid": "6366f6bfdb435acbd1af05c9bc62d15d", "score": "0.55474705", "text": "function showTodo(id){\n\tconsole.log(\"edit todo : \" + id);\n\tvar todoArr = readTodosArray();\n\tconsole.log(todoArr);\n\tvar content_input = document.getElementById(\"content-input\");\n\tcontent_input.value = todoArr[id-1][CONTENT];\n\tvar due_input = document.getElementById(\"due-input\");\n\tdue_input.value = todoArr[id-1][DUE];\n\tvar due_input = document.getElementById(\"id-input\");\n\tdue_input.value = todoArr[id-1][ID];\n}", "title": "" }, { "docid": "7f59aaab071c1cdf47d40d67a1d06b07", "score": "0.5540629", "text": "function getReaderIndexByID(id){\n\t// Iterates through the reader array\n\tfor (var i = 0; i < readerArr.length; i++) {\n\t\t// If the id is correct, return the index\n\t\tif (readerArr[i].id == id) {\n\t\t\treturn i;\n\t\t}\n\t}\n\t// If id not found, return the length (next index) of the array\n\treturn readerArr.length;\n}", "title": "" }, { "docid": "28631519f9f38c51fec21f09f5085474", "score": "0.5535981", "text": "trackNodeBy(index, node) {\n return node.id;\n }", "title": "" }, { "docid": "c000f98f10949bccef287224be6f3fe5", "score": "0.55058163", "text": "function ledIdToElemOrder( ledid ) {\n\tfor ( var i=0; i < fixture.channels.length; i++ ) {\n\t\tvar elem = fixture.channels[i];\n\t\tif (elem.id == ledid) {\n\t\t\treturn elem.index;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "a622e587d0a748cec0b24b24fb86b8a0", "score": "0.550383", "text": "function getEventObject(array, object){\n var len = array.length;\n \n for (var i = 0; i < len; i++){\n if ( object.attr('id') == array[i].object.attr('id')){\n return i;\n }\n }\n\n return -1;\n}", "title": "" }, { "docid": "3256dfd64776c7a6a71706fa06298245", "score": "0.5497132", "text": "function deleteTodo(id){\n\tconsole.log(\"delete todo : \" + id)\n\t\n\tvar count = readCount();\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\t\n\tvar found_id = -1;\n\t\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\tfound_id = index;\n\t\t}\n\t\tif(found_id!=-1){\n\t\t\tlistArr[index][ID]--;\n\t\t}\n\t}\n\t\n\tif(found_id==-1){\n\t\treturn -1;\n\t}\n\n\tlistArr.splice(found_id, 1);\n\tconsole.log(\"count \" + readCount());\n\twriteTodosArray(readCount() - 1, listArr);\n\tconsole.log(\"count \" + readCount());\n\t\n\treturn 0;\n\t\n}", "title": "" }, { "docid": "b8fc35edcad329674b7eab50acb6cc6b", "score": "0.5494003", "text": "function getWaypiontIndexByFeatureId(featureId) {\n\t\t\tvar wpResult = $('#' + featureId);\n\t\t\tvar wpElement;\n\t\t\tif (wpResult) {\n\t\t\t\twpElement = wpResult.parent().parent();\n\t\t\t}\n\t\t\tif (wpElement) {\n\t\t\t\tvar wpIndex = wpElement.attr('id');\n\t\t\t\tif (!isNaN(wpIndex)) {\n\t\t\t\t\treturn wpIndex;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ddfd3b9d662625dc3de8f3e1a3149af3", "score": "0.54873836", "text": "function getbyId (index, arr) {\n\t\t\tvar i = 0;\n\t\t\tindex = index.toString();\n\n\t\t\twhile (i < arr.length) {\n\t\t\t\tif (arr[i].id === index) {\n\t\t\t\t\treturn arr[i];\n\t\t\t\t}\n\n\t\t\t\ti += 1;\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "372512488421d79a8fd386e64532cb50", "score": "0.5485152", "text": "getIndexOfStepWithId(stepId) {\n return this.wizardSteps.findIndex(step => step.stepId === stepId);\n }", "title": "" }, { "docid": "4953c8f9bdfb39558931019d3c703d1b", "score": "0.5476097", "text": "function getIndexById(postArray, postid) {\n for (var i = 0; i < postArray.length; i++) {\n if (postArray[i].id == postid) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "14fba43699e823b28921586d6483cbfa", "score": "0.5474294", "text": "findIndex(obj, arr){\n\n console.log(\"CART: FINDINDEX: ARR=\", arr);\n console.log(\"CART: FINDINDEX: obj=\", obj);\n\n let index=-1;\n\n if (obj.id) {\n \n arr.forEach((item, i) => {\n // console.log(\"CART: FIND INDEX: item.quantity=\",item.quantity);\n \n console.log(\"CART: FINDINDEX: obj.id=\", obj.id,\" item.product_Id=\",item.product_Id, \" i=\",i);\n \n if (item.product_Id===obj.id) index=i;\n // if (item.id === obj.product_Id) return i;\n })\n }\n return index;\n }", "title": "" }, { "docid": "6bf8d7681b42873543c7d0b4f53ab6f9", "score": "0.54727316", "text": "function indexOfEl(listPast, el) {\n let current = listPast\n let index = 0\n const idxArr = []\n while (current) {\n if (current.value === el) idxArr.push(index)\n current = current.next\n index++\n }\n console.log(`idxArr ${idxArr}`)\n return idxArr\n }", "title": "" }, { "docid": "c60eca021258480633dd747d72679d3d", "score": "0.5470723", "text": "function keyIndexById (id) {\n return keys.findIndex(element => {return element.id === id});\n}", "title": "" }, { "docid": "3a67411d9ac566b17344c7b304daa0f1", "score": "0.5464847", "text": "leerProductosConId(id){\n if (this.listaProductos[id-1]==undefined) {\n return {error:\"Ese producto no existe aun\"}\n } else {\n return this.listaProductos[id-1]\n } \n }", "title": "" }, { "docid": "d2b1745cabddb67dd65e7d620869fc37", "score": "0.54619527", "text": "elementoById(id, array){\r\n return array.find((ele) => ele.getId() === id);\r\n }", "title": "" }, { "docid": "c1e99d4b777061601357f639447ceca9", "score": "0.5460371", "text": "function temukanItem(id, array) {\n const i = array.findIndex( item => item.ID == id)\n return array[i]\n}", "title": "" }, { "docid": "81006b0129de8e825b8d529dd71c8aee", "score": "0.545644", "text": "function getLastIdInDom(){\n lastID=-1;\n const listeChildren=document.querySelector('#liste').children;\n for(domPostit in listeChildren){\n if(lastID<parseInt(domPostit.id.substring(7)))\n {\n lastID=domPostit.id.substring(7);\n }\n }\n}", "title": "" }, { "docid": "b70a91b190601852e427b74cbb796b84", "score": "0.5450633", "text": "findTransactionIndex(transactionID) {\r\n for (let i = 0; i < this._transactionList.length; i++) {\r\n //test code: console.log(transactionID +' === '+ this._transactionList[i]._id);\r\n if (this._transactionList[i]._id === Number(transactionID)) {\r\n return i; // return the found index;\r\n }\r\n }\r\n return -1; // return -1 when no match is found\r\n }", "title": "" }, { "docid": "2be1a92b0f706ecaca3770db42d49cd2", "score": "0.5448207", "text": "getIndexForm(id) {\n return this.state.formFields.findIndex(e => e.id === id)\n }", "title": "" }, { "docid": "2e80ccf9dda56fe213f4de86aaa5b7c3", "score": "0.5443866", "text": "pageIndex(itemIndex) {\n return this.pages.findIndex(page =>\n page.element.find(element => element.originalIndex === itemIndex)\n )\n }", "title": "" }, { "docid": "495d3b7a8c783ab31227e4bf2ac4cffd", "score": "0.5442015", "text": "function thisToDoEl(id) {\n return document.querySelector(`[data-todo-id=\"${id}\"]`);\n}", "title": "" }, { "docid": "3370709426287274442fed25acb092c0", "score": "0.5441394", "text": "findCursorByID(id) {\n\t\tfor (let i = 0; i < this.menuData.length; i++) {\n\t\t\tif (this.menuData[i].id === id) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "2e5a423e0bd86d0809fee9881634ac50", "score": "0.54382175", "text": "get index() {\r\n return this.i.index;\r\n }", "title": "" }, { "docid": "be9db73a1af87aeb632eab5fb8b325be", "score": "0.54381007", "text": "function findTimelineEntryIndex(entries, timelineId){\n\t\t\tfor (var i = 0; i < entries.length; i++) {\n\t\t\t\tif(entries[i].timelineId == timelineId){\n\t\t\t\t\treturn i;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "title": "" }, { "docid": "0430630d6eaa950971efd5a1b165d97a", "score": "0.5429689", "text": "function getIndex(waypointId) {\n const m = waypointId.match(/:([0-9]+)$/);\n return m && m[1] ? parseInt(m[1]) : 0;\n}", "title": "" }, { "docid": "b5745c1db3166268f4c99b2ce4608e32", "score": "0.54261184", "text": "function doIndex() {\n //Clear out container and show laoder if it is hidden\n $(\"#list\").html('');\n $(\".indicator\").show();\n \n //Fetch initial data\n var xhr = Titanium.Network.createHTTPClient();\n var done = false;\n xhr.onreadystatechange = function() {\n try {\n if (this.readyState == 4 && !done) {\n done = true;\n $(\".indicator\").hide();\n var parser = new DOMParser();\n var doc = parser.parseFromString(this.responseText, \"text/xml\");\n $(doc).find(\"notes note\").each(function() {\n var node = $(this);\n var html = \"<li><img class='deleter' src='delete.png'/>\";\n html += \"<input type='hidden' name='id' value='\"+node.find(\"id\").text()+\"'></input>\";\n html += node.find(\"content\").text()+\"</li>\";\n $(\"#list\").append(html);\n });\n\n \t\t\t}\n }\n catch(e) {\n Titanium.API.debug(e);\n }\n };\n xhr.open(services.index.method,services.index.getUrl());\n xhr.send();\n }", "title": "" }, { "docid": "451fc3dccbcf21b7bcf1e77a79c831ba", "score": "0.54163027", "text": "obterPorId(_id){\n return this.lista.filter( aluno => aluno._id === _id )[0];\n }", "title": "" }, { "docid": "ee0f6e6ee637cc6bfb779d0c891169a6", "score": "0.5405326", "text": "get index() { return this._index; }", "title": "" }, { "docid": "60beb462c4b9d6c9a983ea39e4c85aee", "score": "0.54040766", "text": "function getNoteIndex(index){\n return notes[index];\n}", "title": "" }, { "docid": "48f2be0323b24c9fc8f0f5f58c7bc89e", "score": "0.5401764", "text": "getEntityIndex(id, type) {\n let idPropertyName = type === 'resourcePerson' ? 'rp' : type;\n return this.state[EntityTypes[type]].findIndex(entity => entity[idPropertyName + '_id'] === parseInt(id));\n }", "title": "" }, { "docid": "4b0bc18be1f2799199e5e88082720857", "score": "0.5400248", "text": "function indexById(array, id) {\n if (!array) return -1;\n return smartIndexOf(array, function (obj) {\n return obj.id === id;\n });\n}", "title": "" }, { "docid": "7d6d719a22bb854a35f9faff2e55f476", "score": "0.5395883", "text": "get selectedIndex() {\n var tree = this.getElement({type: \"engine_list\"});\n var treeNode = tree.getNode();\n\n return treeNode.view.selection.currentIndex;\n }", "title": "" }, { "docid": "9475a50dc475e650792bf46e9a7d4c85", "score": "0.5394784", "text": "function findIndex(array, id) {\n var low = 0, high = array.length, mid;\n while (low < high) {\n mid = (low + high) >>> 1;\n array[mid]._id < id ? low = mid + 1 : high = mid\n }\n return low;\n }", "title": "" }, { "docid": "e0918cdb9119b32e96dba5429eb67fdc", "score": "0.53927404", "text": "function TRACKING_FindIdObjectFree ( label){\n\tvar indexObject=-1; \n\tfor (var i = 0 ; i < listTracking.length ; i++ ){\n\t\t//tính theo thời gian cho chính xác\n\t\tif (listTracking[i].dispo)\n\t\t{\n\t\t\tvar difX = listTracking[i].X - label.X;\n\t\t\tvar difY = listTracking[i].Y - label.Y;\n\t\t\t//check if valide => update tableau\n\t\t\tif (difX < 0)\n\t\t\t{\n\t\t\t\tdifX = 0 - difX;\n\t\t\t}\n\t\t\tif (difY < 0)\n\t\t\t{\n\t\t\t\tdifY = 0 - difY;\n\t\t\t}\n\t\t\tif ((difX <= 4) && (difY <= 4))\n\t\t\t{\n\t\t\t\tindexObject = i;\n\t\t\t\treturn indexObject;\n\t\t\t}\n\t\t}\n\t}\n\tfor (var i = 0 ; i < listTracking.length ; i++ ){\n\t\tif (listTracking[i].dispo)\n\t\t{\n\t\t\tindexObject = i;\n\t\t\treturn indexObject;\n\t\t}\n\t}\n\treturn indexObject;\n}", "title": "" }, { "docid": "ef7a6f137937f15676a5cb3a349716da", "score": "0.5390694", "text": "function getData(item) {\n let dataProduct = JSON.parse(localStorage.getItem(\"products\"));\n let index;\n for (let i = 0; i < dataProduct.length; i++) {\n if (dataProduct[i].id == item.id) {\n index = i;\n }\n }\n return index;\n}", "title": "" }, { "docid": "4d1fa8f626de0cda61ae6eabdb37f5ce", "score": "0.5385433", "text": "function setTableId(index, id) {\n return $('table.table_lines').eq(index).attr('id', id);\n }", "title": "" }, { "docid": "d6463d0406c2c46e4f87c75fe32777fa", "score": "0.5385294", "text": "getIndexShare(id){\n // let index = -1;\n for (let i = 0 ; i < this.sharesChart.length; i++ )\n if (this.sharesChart[i].instrumentID === id)\n return i;\n return -1; \n }", "title": "" }, { "docid": "1eec2086287094c8fbe77cf4910fb611", "score": "0.5384403", "text": "function getIndexEvent(strId) {\n // Use regex to pull out the actual ID number\n var pat = new RegExp('^eventDiv[\\\\D]*__');\n var id = strId.replace(pat, '');\n return id;\n }", "title": "" }, { "docid": "70b8e6775392d9148e8bbfa2f7b939e4", "score": "0.53841394", "text": "function editTodoContent(contnet, id){\n\tvar count = readCount();\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\tlistArr[index][CONTENT] = content;\n\t\t\twriteTodosArray(count, listArr);\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "title": "" }, { "docid": "02b058b2fde3cf3dde76ac0c5b4190f8", "score": "0.5373689", "text": "findPlayerIndex(id) {\n for(let i = 0; i < this.playersArray.length; i++) {\n if(this.playersArray[i].id === id\n && this.playersArray[i].removed === false) {\n return i;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "ca6cab882910f8b2aa547cc0a7a371f1", "score": "0.53726786", "text": "function getTeamIndexByID(Data, id) {\n var numberOfTeam = Data.length;\n for(var i = 0; i < numberOfTeam; i++){\n if(parseInt(Data[i]['teamId']) == id) {\n return i;\n }\n } \n}", "title": "" }, { "docid": "3cd2d09f018ea777974e56b7cc13c972", "score": "0.53662735", "text": "function findArduino(id_a){\n\tfor (var i = arduinos.length - 1; i >= 0; i--) {\n\t\tif(arduinos[i].id == id_a){\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "title": "" }, { "docid": "ce4b2d842c59e1973c214d84b2b8dd95", "score": "0.53614813", "text": "function getItemId() {\r\n var item_id = 0;\r\n var element = document.getElementById('Table6');\r\n try {\r\n a_tag = element.getElementsByTagName('a');\r\n slug = a_tag[0].href.split('?');\r\n item_id = slug[1].match(/[0-9]*[\\.]?[0-9]+/g);\r\n } catch (e) {\r\n alert('Không lấy được id sản phẩm. ' + e);\r\n }\r\n return item_id;\r\n }", "title": "" }, { "docid": "3f1832a83d5ccd1f3f171903d52780ac", "score": "0.53612256", "text": "function findIndex(array, id) {\n\t\tvar low = 0,\n\t\t\thigh = array.length,\n\t\t\tmid;\n\t\twhile (low < high) {\n\t\t\tmid = (low + high) >>> 1;\n\t\t\tarray[mid]._id < id ? low = mid + 1 : high = mid;\n\t\t}\n\t\treturn low;\n\t}", "title": "" }, { "docid": "41e7fc77c39b9b2d38ce8fbb28258ac3", "score": "0.5360889", "text": "function getidElementos(img,typeelem,tipoimg){\n var tabla;\n var idCuento;\n var idelemento;\n\n idCuento= CuentoActual.ID.split('_')[1];\n\n switch (typeelem){\n case 'Personaje':\n tabla = 'Personajes';\n break;\n case 'Objeto':\n tabla = 'Objetos';\n break;\n case 'Bocadillo':\n tabla = 'Bocadillos';\n break;\n case 'Narracion':\n tabla = 'Narraciones';\n break;\n }\n\t\n\tvar sql = \"SELECT ID FROM \"+ tabla +\" WHERE ID_Cuento=\"+ idCuento +\" ORDER BY ID DESC\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n if(results.rows.length == 0) {\n addElemento(img, typeelem, tipoimg, 0);\n\n }\n else\n addElemento(img,typeelem,tipoimg, results.rows.item(0).ID + 1);\n }\n\n\n function errorCB(err) {\n alert(\"Error al crear elemento. processing SQL: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n}", "title": "" }, { "docid": "2c7358499e992e0b48d04c6195aa9bc1", "score": "0.5346706", "text": "function u(index) {\n return document.getElementById('u' + index);\n}", "title": "" }, { "docid": "876c2e220606acc92caed2a5890ced03", "score": "0.53460383", "text": "function myScrollTo (id) {\n\t// alert (\"x myScrollTo: \\\"\" + id + \"\\\"\");\n\n\tvar obj = $(id);\n\tif (obj != null) {\n\t\talert (\"scrolling to \\\"\" + id + \"\\\"\");\n\t\t// return $(\"hierarchy\").scrollTo(id);\n\t\t$(\"hierarchy\").scrollTo(id);\n\t\t// new Element.scrollTo(id);\n\t}\n\telse {\n\t\talert (\"object not found for \\\"\" + id + \"\\\"\");\n\t}\n}", "title": "" }, { "docid": "b1335b6392362f1317075ee8cb0879d5", "score": "0.53361624", "text": "getCartProductIndexByID(cart, id) {\n return cart.findIndex(list => list.product.id === id);\n }", "title": "" }, { "docid": "5563628eb987756c7fa6ee17ae1f9220", "score": "0.53356534", "text": "function getPlayerIndex(id){\n var index = game.players.map(function(o) { return o.id; }).indexOf(id);\n return index;\n console.log(\"index of \" + id + \" is \" + index);\n}", "title": "" }, { "docid": "7e4fbfb872a17e5b6f4b698f89ec736b", "score": "0.5332777", "text": "getPlaylistItemWithIndex(index) {\n let that = this;\n if (that._playlist)\n return that._playlist.getItemWithIndex(id);\n else\n return undefined;\n }", "title": "" }, { "docid": "8be29d23040dc8129274b0fc83167119", "score": "0.53297985", "text": "function index(element) {\n\t\treturn element.parent().find(\"button[data-toggle='slider']\").index(element);\n\t}", "title": "" } ]
9c9e0fa2255fb395be6d4088ec5b9890
Ensure that if removeListener gets called, it's working with the unwrapped listeners.
[ { "docid": "d6144830c45557d941b1ec22d0e1eac3", "score": "0.64100695", "text": "function remover(removeListener) {\n return function removed() {\n this._events[event] = unwrapped;\n try {\n return removeListener.apply(this, arguments);\n }\n finally {\n unwrapped = this._events[event];\n this._events[event] = _wrap(unwrapped, onEmit);\n }\n };\n }", "title": "" } ]
[ { "docid": "4b8bea0b608f369eccd7956f589676be", "score": "0.7210724", "text": "unregisterListener(listener) {\n // add listener to the beginning of the array to allow stopPropagation to work\n this._listeners.splice(this._listeners.indexOf(listener), 1);\n }", "title": "" }, { "docid": "6d1826e6cf7ac0b3d1573b18e9d6cd10", "score": "0.7052162", "text": "_removeListeners() {\r\n // Do nothing if listeners were already removed.\r\n if (!this._isListening) {\r\n return;\r\n }\r\n\r\n window.removeEventListener('resize', this.startUpdateCycle, true);\r\n window.removeEventListener('scroll', this.scheduleUpdate, true);\r\n\r\n this._removeHoverListener();\r\n\r\n if (!mutationsSupported) {\r\n this._repeatCycle = false;\r\n\r\n window.removeEventListener('click', this.startUpdateCycle, true);\r\n } else if (this._mutationsObserver) {\r\n this._mutationsObserver.disconnect();\r\n this._mutationsObserver = null;\r\n }\r\n\r\n this._isListening = false;\r\n }", "title": "" }, { "docid": "6cf93c13aba6cc8ff35a7703dae78909", "score": "0.70425236", "text": "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "title": "" }, { "docid": "ff77e05bd3e1af0bb61dcd740ddeafe9", "score": "0.69846624", "text": "removeListener(listener) {\r\n this.listeners = this.listeners.filter((l) => l !== listener);\r\n }", "title": "" }, { "docid": "eb7d4f4b672356f42b4acb03a4810d80", "score": "0.6965555", "text": "function cleaner() {\n\t\tif (this.removeEventListener) {\n\t\t\tfor(var n in mListeners) {\n\t\t\t\tthis.removeEventListener(n, mListeners[n], bBubble);\n\t\t\t\tdelete mListeners[n];\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var n in mListeners) {\n\t\t\t\tthis.detachEvent('on'+ n, mListeners[n]);\n\t\t\t\tdelete mListeners[n];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "50dda9bb08fecb831c3268d54b1115a8", "score": "0.6895126", "text": "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName)\n } else {\n super.removeAllListeners()\n }\n // re-add internal events\n this._setupInternalEvents()\n // trigger stop check just in case\n this._onRemoveListener()\n }", "title": "" }, { "docid": "5619a892996a54028759fb8a1252d7b1", "score": "0.6893893", "text": "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "title": "" }, { "docid": "5619a892996a54028759fb8a1252d7b1", "score": "0.6893893", "text": "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "title": "" }, { "docid": "5619a892996a54028759fb8a1252d7b1", "score": "0.6893893", "text": "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "title": "" }, { "docid": "5619a892996a54028759fb8a1252d7b1", "score": "0.6893893", "text": "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "title": "" }, { "docid": "df7e6d6c7bfc36572114ecc5a4374ca2", "score": "0.6760405", "text": "removeListeners() {\n\n const removeListeners = el => {\n\n if (this.el.listeners) {\n\n el.listeners.forEach(listener => {\n const { type, eventHandler, opts } = listener;\n el.removeEventListener(type, eventHandler, opts);\n });\n\n el.listeners.splice(0); // empty the array without redeclaring it\n\n }\n\n };\n\n removeListeners(this.el);\n\n for (const el in this.nodes) {\n removeListeners(this.nodes[el]);\n }\n\n this.emit('removeListeners');\n\n }", "title": "" }, { "docid": "1fba14e953b14b945b0a8488d9c264c9", "score": "0.6703679", "text": "removeAllListeners() {\r\n this.listeners = [];\r\n }", "title": "" }, { "docid": "42a92cd43b3ab0d411ae553ac9f17126", "score": "0.6675878", "text": "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName);\n } else {\n super.removeAllListeners();\n }\n // re-add internal events\n this._setupInternalEvents();\n // trigger stop check just in case\n this._onRemoveListener();\n }", "title": "" }, { "docid": "b7b299023d177f54f0b0077d8070c90d", "score": "0.66431004", "text": "removeListeners() {\n /* istanbul ignore next */\n if (this.options.enableTouch) {\n global.removeEventListener('touchmove', this.handleMove)\n global.removeEventListener('touchend', this.handleUp)\n this.slidesWrapper.removeEventListener('touchstart', this.handleDown)\n }\n /* istanbul ignore next */\n if (this.options.enableSwipe) {\n global.removeEventListener('mousemove', this.handleMove)\n global.removeEventListener('mouseup', this.handleUp)\n this.slidesWrapper.removeEventListener('mousedown', this.handleDown)\n }\n }", "title": "" }, { "docid": "7d1cf34e4dfdf5f0705a92dbf27411b4", "score": "0.6561512", "text": "removeEventListener( type, listener ) { }", "title": "" }, { "docid": "fc9472356b81d4717873ac8f4481cbf3", "score": "0.6542509", "text": "removeListener(){\n if( this.listener != null ){\n this.node.vector1.dom.removeEventListener(\"pointerup\",this.listener);\n this.node.vector2.dom.removeEventListener(\"pointerup\",this.listener);\n }\n }", "title": "" }, { "docid": "970ccadf8958635555e387a6c52dbbf6", "score": "0.65305173", "text": "deregisterListeners() {\n this.eventManager.clearEvents(true);\n }", "title": "" }, { "docid": "01be4dbd203e4893215bc8b7ab98b370", "score": "0.65162194", "text": "function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(element => element.removeEventListener('scroll', scrollChange, true));\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers", "title": "" }, { "docid": "01be4dbd203e4893215bc8b7ab98b370", "score": "0.65162194", "text": "function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(element => element.removeEventListener('scroll', scrollChange, true));\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers", "title": "" }, { "docid": "202d6cdc5c1d580ba32a302a5102649e", "score": "0.6509101", "text": "function listener () {\n self.off(name, listener);\n // The off() function removes the event handlers\n callback.apply(context, arguments);\n // The apply() method calls a function with a given this value, and arguments provided as an array\n }", "title": "" }, { "docid": "09b79a9b7c1ba1a39af661423af6cb8d", "score": "0.6476309", "text": "function removeListeners() {\r\n\t\t\tdocument.removeEventListener('mousemove', moveElement, false);\r\n\t\t\tdocument.removeEventListener('mouseup', removeListeners, false);\r\n\t\t\twindow.removeEventListener('selectstart', disableSelect);\r\n\t\t}", "title": "" }, { "docid": "42583cd2672418d46c9bc1d784fafdf4", "score": "0.64610404", "text": "function _releaseListens(){\n var attrs_setup_list = this.__listening__ || [];\n\n /* for all the recorded registrations-to-remove */\n for(var i = this.__listening__.length-1; i >= 0; i --){\n var obj = this.__listening__[i][0];\n var attr = this.__listening__[i][1];\n var method = this.__listening__[i][2];\n \n /* use that information to find the registration (going backwards) removing them. */\n var listened_list = obj.__listeners__[attr] || [];\n \n for(var j = listened_list.length-1; j >= 0; j --)\n if(listened_list[j][0] == method){\n obj.__listeners__[attr].remove(j);\n if(obj.__listeners__[attr].length == 0)\n delete obj.__listeners__[attr];\n break;\n } \n \n /* remove the entry as we empty it -- reset() requires this although remove() would have dumped this anyway. */\n this.__listening__.remove(i);\n }\n}", "title": "" }, { "docid": "e7e324835daf4d4cbe65fcccc720395e", "score": "0.6447784", "text": "function setRemoved(listener) {\n listener.flags |= 8 /* Removed */;\n}", "title": "" }, { "docid": "20807b358bf8f628afab0ba65c4ee299", "score": "0.64433336", "text": "off(listener) {\r\n const typeSafeListener = this._listeners.get(listener);\r\n if (typeSafeListener) {\r\n this._events.removeListener(typeSafeListener);\r\n }\r\n }", "title": "" }, { "docid": "ed0e2d50f46279ad7e64f2637f65b640", "score": "0.64284027", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t}", "title": "" }, { "docid": "81cfdb9fbf29390276ccbf3ccdfac8b1", "score": "0.642505", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) {\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "3f6db75d6931068eee0aea8021c4c508", "score": "0.64178336", "text": "removeAllEventListeners()\n {\n this.listeners = [];\n }", "title": "" }, { "docid": "54439719152d68f7e646c7b9e231320d", "score": "0.64135265", "text": "_cleanupListeners() {\n window.removeEventListener(\"deactivate\", this);\n this.tabEvents.forEach((ev) => gBrowser.tabContainer.removeEventListener(ev, this));\n this.dragEvents.forEach((ev) => this.containerNode.removeEventListener(ev, this));\n this.paneEvents.forEach((ev) => this.pane.removeEventListener(ev, this));\n this.pane.removeEventListener(\"keydown\", this);\n this.pane.removeEventListener(\"blur\", this, true);\n gBrowser.removeEventListener(\"TabMultiSelect\", this, false);\n for (let stop of this.pane.getElementsByTagName(\"toolbartabstop\"))\n stop.removeEventListener(\"focus\", this);\n this.listenersRegistered = false;\n }", "title": "" }, { "docid": "c3058af30c6fc22d70c834c42ecb0def", "score": "0.6410688", "text": "detachUnusedListeners() {\n\t\tfor (var selector in this.eventHandles_) {\n\t\t\tif (this.eventHandles_[selector] && !this.hasListener_[selector]) {\n\t\t\t\tthis.eventHandles_[selector].removeAllListeners();\n\t\t\t\tthis.eventHandles_[selector] = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.64052576", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.64052576", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "2814e29a32316aea0589fa52ba765418", "score": "0.63998437", "text": "function y(e){if(null!=e&&null!=e[u])for(const t in e._handlers)e[u].removeListener(t,e._handlers[t])}", "title": "" }, { "docid": "f41fcf092e455233de55108fd3026dad", "score": "0.63947845", "text": "function cancel(listener){\n for(var property in listeners){\n off(property, listener);\n }\n }", "title": "" }, { "docid": "e6840a7135f6b821c49822d984b3937f", "score": "0.63935804", "text": "function removeEventListener(event, callback) {\n if (!listeners[event]) return;\n for (var i = 0, len = listeners[event].length; i < len; i++) {\n listeners[event].splice(i, 1);\n break;\n }\n }", "title": "" }, { "docid": "76de4bbd7a4e61e8faa305a23cf64025", "score": "0.63881296", "text": "function removeListener () {\n for (var i = 0; i < allBoxes.length; i++) {\n allBoxes[i].removeEventListener('click', flip)\n }\n }", "title": "" }, { "docid": "918f9faa1d17aaae4cfaef4103774404", "score": "0.6376911", "text": "removeEventListener(event, listener) {\r\n if (typeof(listener) != \"function\" || !(listeners[event] instanceof Array))\r\n return\r\n \r\n const index = listeners[event].indexOf(listener)\r\n if (index >= 0)\r\n listeners[event].splice(index, 1)\r\n }", "title": "" }, { "docid": "bae908cdf895d812454140359f45d5b5", "score": "0.63686335", "text": "function detachedCallback() {\n let audioEl = this.querySelector('audio'),\n listeners = eventListeners.get(this);\n\n this.removeEventListener('click', listeners.click);\n audioEl.removeEventListener('timeupdate', listeners.timeupdate);\n audioEl.removeEventListener('play', listeners.play);\n audioEl.removeEventListener('pause', listeners.pause);\n}", "title": "" }, { "docid": "b948adfc4e0e1921ec168472433b18f4", "score": "0.63612443", "text": "_cleanupDOMEventListeners() {\n // _clean DOM event listener bindings\n for (const callback of this._domEventListenerCleanupQueue.splice(0)) {\n callback();\n }\n }", "title": "" }, { "docid": "8638892e9661bde1bc26074a3253d603", "score": "0.6357071", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "15cdbcdc69ed474929e1a28f336d7977", "score": "0.6341846", "text": "_stopListeners() {\n /*\n Serve para receber a nova hora/min digitada pelo usuario.\n Ocorre apos o _callbackQueryUpdateReg, porque onReplyToMessage nao funciona \n https://github.com/yagop/node-telegram-bot-api/issues/113\n */\n try {\n bot.removeTextListener(CMD.P1);\n bot.removeTextListener(CMD.P2);\n bot.removeTextListener(CMD.P3);\n bot.removeTextListener(CMD.P4);\n bot.removeTextListener(CMD.SHORTCUT);\n bot.removeTextListener(CMD.EDIT);\n bot.removeListener('callback_query');\n bot.removeTextListener(CMD.EXPT);\n bot.removeTextListener(CMD.LIST);\n bot.removeTextListener(CMD.HELP);\n } catch (err) {\n logger.error(['Bot > _stopListener -> Erro ao desativar listeners', err]);\n }\n }", "title": "" }, { "docid": "c6064cd68452fe2761682f0913226af8", "score": "0.6331138", "text": "function _removeListeners() {\n self.off(\".msgbox\");\n }", "title": "" }, { "docid": "f65baa6fa8646d92ab357bbfeb7e4601", "score": "0.6325889", "text": "function _clearListeners(arr) {\n if (arr == null || arr._parent == null) {\n return;\n }\n\n for (const key in arr._handlers) {\n arr._parent.removeListener(key, arr._handlers[key]);\n }\n}", "title": "" }, { "docid": "274d72d417709ba8e370c5459e0c8a9e", "score": "0.63175553", "text": "unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }", "title": "" }, { "docid": "b020b213fa5913c5cc8b9dfed1fa31d7", "score": "0.63080835", "text": "unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }", "title": "" }, { "docid": "6267cf0dc930f262e2ef4037f28a901b", "score": "0.63076645", "text": "function removeListeners() {\r\n\t\t\t$element.unbind(START_EV, touchStart);\r\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\r\n\t\t\t$element.unbind(MOVE_EV, touchMove);\r\n\t\t\t$element.unbind(END_EV, touchEnd);\r\n\t\t\t\r\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n\t\t\tif(LEAVE_EV) { \r\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTouchInProgress(false);\r\n\t\t}", "title": "" }, { "docid": "e934bb5d0248873109c7048d707f30b3", "score": "0.6306465", "text": "removeEventListeners(event) {\r\n delete listeners[event]\r\n }", "title": "" }, { "docid": "1bc8ec175cea8108a92a95acf651f210", "score": "0.63039285", "text": "revoke() {\n this.removeListeners();\n }", "title": "" }, { "docid": "e982bc05286ca81f73987241cedeee3a", "score": "0.63015175", "text": "registerListener(listener) {\n // add listener to the beginning of the array to allow stopPropagation to work\n this._listeners.unshift(listener);\n }", "title": "" }, { "docid": "7ef82e43a35638785498fd33834eaae7", "score": "0.63008493", "text": "removeAllEventListeners() {\n const events = Array.from(this.m_listeners.keys());\n for (const event of events) {\n this.removeEventListener(event);\n }\n }", "title": "" }, { "docid": "45b30ab2d7f4b85e4b909603a3409161", "score": "0.6286592", "text": "function test_listeners() {\n let board = new GameBoard();\n board.canvas.addEventListener('click', clicker);\n\n function clicker() {\n console.log('Click event from clicker');\n board.canvas.removeEventListener('click', clicker);\n }\n\n\n}", "title": "" }, { "docid": "e2a2e7704ee303486dc40976852258dc", "score": "0.6269342", "text": "function _disposeAddTagListeners() {\n\t\tKeyBindingManager.removeGlobalKeydownHook(_insertEmptyTagKeyboardListener);\n\t\t\n\t\tif (_hasLineBreakKeyboardListener === false) {\n\t\t\t_hasLineBreakKeyboardListener = true;\n\t\t\tKeyBindingManager.addGlobalKeydownHook(_lineBreakKeyboardListener);\n\t\t}\n\t\t\n\t\t_editor.off(\"cursorActivity\");\n\t\t_lng = 0;\n\t\t_currentDoc = null;\n\t\t_currentPos = null;\n\t\t_editor = null;\n\t}", "title": "" }, { "docid": "94636fa05ce6b3ee04d5d38469dd102a", "score": "0.62595266", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "0c9da04a10333467931dbbf258d742b6", "score": "0.6259042", "text": "function removeEventListener(type, listener, options) {\n var secret = get(this);\n var listeners = secret[type];\n if (listeners) {\n var i = findIndex.call(listeners, registered, listener);\n if (-1 < i) listeners.splice(i, 1);\n }\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.62587225", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.62587225", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "90930953d4d06c8f141ebc65c4872b57", "score": "0.6236159", "text": "off(event, listener) {\n const listeners = this._listeners.get(event);\n if (listeners) {\n const index = listeners.findIndex((lo) => lo.listener === listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }\n }", "title": "" }, { "docid": "79002bc5dd8f0978420682e323dcf8a1", "score": "0.62284267", "text": "removeListeners(ele) {\n for (event in ele.events) {\n ele.DOMelement.removeEventListener(event, ele.events[event]);\n }\n }", "title": "" }, { "docid": "20f7cc3270fa413a9cad4d50e6344b34", "score": "0.62266105", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n \n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n \n setTouchInProgress(false);\n }", "title": "" }, { "docid": "151a9a396f3322560612a94991d57392", "score": "0.61954963", "text": "_removeEventListeners() {\n removeEventListener(\"mouseup\", this._onMouseUp);\n removeEventListener(\"mousemove\", this._onMouseMove);\n }", "title": "" }, { "docid": "09f06ce47046aee285af935f12366260", "score": "0.6193257", "text": "removeListener(eventType, listenerFunc) {\n let listenerList = this.onListeners.get(eventType);\n\n if (listenerList) {\n listenerList.removeListener(listenerFunc);\n }\n }", "title": "" }, { "docid": "684e7144f10fb1e5bef64053cce70cd6", "score": "0.61862713", "text": "function removeSliderListeners() {\n slider.removeEventListener('touchstart', startMove);\n slider.removeEventListener('touchmove', continueMove);\n slider.removeEventListener('touchend', endMove);\n }", "title": "" }, { "docid": "9f5b45b2591b8f4e805ea6d32134b542", "score": "0.6177542", "text": "function removeListener(type, callback, useCapture) {\n if (useCapture === void 0) { useCapture = false; }\n if (window.removeEventListener) {\n window.removeEventListener(type, callback, useCapture);\n }\n else if (window.detachEvent && __ENABLE_POLYFILLS) {\n window.detachEvent(\"on\" + type, callback);\n }\n }", "title": "" }, { "docid": "91f61ebfea922e3b02104cdc77b0e857", "score": "0.61648273", "text": "removeButtonListeners() {\n this.removeAllListeners()\n }", "title": "" }, { "docid": "947838d412b1412001e68583d7b9c1c1", "score": "0.61606896", "text": "function clearListeners(event) {\n if (event) {\n delete listeners[event];\n } else {\n listeners = {};\n }\n }", "title": "" }, { "docid": "89e89bfcd28873e42980e6cc4c1a4d63", "score": "0.6134445", "text": "unregisterSpanEventListener(listener) {\n const index = this.eventListenersLocal.indexOf(listener, 0);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n }", "title": "" }, { "docid": "723166acb2c83b4edbec02f3cdd3e120", "score": "0.612899", "text": "function removeListeners() {\n [].map.call(signs, function(sign) {\n sign.removeEventListener('click', click);\n });\n\n [].map.call(items, function(item) {\n item.removeEventListener('mouseover', mouseover);\n item.removeEventListener('mouseout', mouseout);\n });\n\n document.querySelector('#open-close').removeEventListener('click', all);\n }", "title": "" }, { "docid": "6676b034b72fb779176afef0c288fb2b", "score": "0.61272216", "text": "function removeEventListeners() {\n window.removeEventListener('resize', this.eventListener);\n this.scrollParents.forEach(parent => {\n parent.removeEventListener('scroll', this.eventListener);\n });\n}", "title": "" }, { "docid": "5acd5d6bef8ef7472c41b105234d02d0", "score": "0.6122486", "text": "function g(e){if(null!=e&&null!=e[p])for(const t in e._handlers)e[p].removeListener(t,e._handlers[t])}", "title": "" }, { "docid": "3eb3944b4639ef9f395306a1c6c71ece", "score": "0.6121789", "text": "function removeListeners(l) {\r\n var idx = listeners.indexOf(l);\r\n if(idx > -1) {\r\n listeners.splice(idx, 1);\r\n if(listeners.length === 0) {\r\n stop();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "4fb3303cf944a48084491144b2b4034f", "score": "0.6119723", "text": "unbind(eventName, listener) {\n const listeners = this.events[eventName]\n if (listeners) {\n listeners = listeners.filter(fn => fn !== listener)\n }\n }", "title": "" }, { "docid": "1ed81b31d7755b63b570b41e4ed4c0eb", "score": "0.61043954", "text": "clear()\n {\n this.m_listeners.clear();\n }", "title": "" }, { "docid": "4dec6b4a707e0593599b874e195292d4", "score": "0.6103129", "text": "clearListeners() {\n\t\tvar listeners = this.listeners, i = listeners.length;\n\n\t\twhile (i--) {\n\t\t\tthis.removeListener(listeners[i].fn, listeners[i].scope);\n\t\t}\n\t}", "title": "" }, { "docid": "2a37e396ab089433098962e0d57284ac", "score": "0.60827583", "text": "removeTickerListener() {\n if (!this.tickerAdded) {\n return;\n }\n Ticker.system.remove(this.tickerUpdate, this);\n this.tickerAdded = false;\n }", "title": "" }, { "docid": "9cc335dabab926baa96943562bd44094", "score": "0.60763204", "text": "static clearListener() {\n InputListener.activeListener = undefined;\n }", "title": "" }, { "docid": "dca04c2568ed4ebcc710aa35d2be03a4", "score": "0.60715073", "text": "function removeContractedEventListeners() {\n displayContainer.interactive = false;\n displayContainer.buttonMode = false;\n displayContainer.click = null;\n }", "title": "" }, { "docid": "01ad1deb0d85de0c0f549ffad0d9db2a", "score": "0.6067857", "text": "removeDragListeners() {\n }", "title": "" }, { "docid": "63887fff16bb55bcb9bcbe9bf7cc2dac", "score": "0.6065927", "text": "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "title": "" }, { "docid": "63887fff16bb55bcb9bcbe9bf7cc2dac", "score": "0.6065927", "text": "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "title": "" }, { "docid": "63887fff16bb55bcb9bcbe9bf7cc2dac", "score": "0.6065927", "text": "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "title": "" }, { "docid": "5d85f4c689ef61fab14891dfca744255", "score": "0.6062529", "text": "remove_listener(topic) {\r\n if (! (topic in gui.listeners)) return\r\n var index = gui.listeners[topic].indexOf(this)\r\n if (index > -1) gui.listeners[topic].splice(index, 1)\r\n }", "title": "" }, { "docid": "45b28576d877b597c8b0c2b61422f1a7", "score": "0.60536224", "text": "function remove() {\n primus.removeListener('error', remove)\n .removeListener('open', remove)\n .removeListener('end', remove)\n .clearTimeout('connect');\n }", "title": "" }, { "docid": "881561e57e94f4710b58aaf7b7c7c311", "score": "0.6052383", "text": "function unsubscribe(listener) {\r\n _listeners.splice(_listeners.indexOf(listener));\r\n}", "title": "" }, { "docid": "6903927d70415c636815bc614f3b0cad", "score": "0.60472363", "text": "function unlisten(eventName, listener) {\n if(typeof eventName !== \"string\" || eventName.length === 0) {\n throw new Error(\"[notifier.listen] Expected event name must be a non-empty string.\");\n }\n if(typeof listener !== \"function\") {\n throw new Error(\"[notifier.listen] Expected listener must be a function.\");\n }\n\n let eventListeners = listeners[eventName];\n if(Array.isArray(eventListeners)) {\n const listenerIndex = eventListeners.findIndex((testListener) => testListener === listener);\n if(listenerIndex !== -1) {\n eventListeners.splice(listenerIndex, 1);\n }\n }\n }", "title": "" }, { "docid": "6678f9e7695c1b6dff38824a9d5a87a3", "score": "0.6046755", "text": "function clearListeners(event) {\n\t\t\tif(event) {\n\t\t\t\tdelete listeners[event];\n\t\t\t} else {\n\t\t\t\tlisteners = {};\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fd7331c4cbf17e335f920bbe78a3be9c", "score": "0.60343754", "text": "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "title": "" }, { "docid": "0ebec63d5e8136a850763fbe9d449fd5", "score": "0.60302955", "text": "function removeListener(types, selector, fn) {\n var type, splitTypes, filteredListeners;\n if (arguments.length === 0) return this.data('listeners', []);\n\n // A utility function for checking for matches between types even when there are a number\n // of namespaces involved. Used below.\n function isMatch(type, listener) {\n var doesMatch = true;\n var nsTypes = $.grep(type.split('.'), function(nsType) {\n return nsType.length > 0; // ignore empty strings\n });\n var nsListenerTypes = $.grep(listener.type.split('.'), function(nsListenerType) {\n return nsListenerType.length > 0;\n });\n var nsTypesLen = nsTypes.length;\n\n // The removed listener cannot be this specific listener if the removed type\n // has more namespaces than the listener's type\n if (nsTypesLen > nsListenerTypes.length) {\n return false;\n }\n\n // Iterate through the namespaces in the removed type of event, comparing them\n // to those in the current stored listener's type. If there is a failure to\n // match, break the loop -- we know there's not a match. On the other hand,\n // if we make it all the way through this loop, everything matches.\n $.each(nsTypes, function(idx, nsType) {\n doesMatch = nsType === nsListenerTypes[idx];\n return doesMatch;\n });\n\n return doesMatch;\n }\n\n if (this.data('listeners') && this.data('listeners').length) {\n // As with `addListener`, `types` can be either a string or an object. Again, we let\n // jQuery handle the object case\n if (typeof types === \"object\") {\n return false;\n } else {\n splitTypes = types.trim().split(/\\s+/g); //handles multiple whitespace-delimited types\n $.each(splitTypes, function(idx, type) {\n // filter out the stored types that match the removed type\n this.data('listeners', $.grep(this.data('listeners'), function(listener) {\n return isMatch(type, listener);\n }, true));\n }.bind(this));\n }\n }\n }", "title": "" }, { "docid": "54e5765bf7b316b7372464513f5d7c03", "score": "0.6025349", "text": "function removeEventListeners() {\n\n\t\t\teventsAreBound = false;\n\n\t\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// IE11\n\t\t\tif( window.navigator.pointerEnabled ) {\n\t\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t\t}\n\t\t\t// IE10\n\t\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\n\t\t\tif ( config.progress && dom.progress ) {\n\t\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t\t}\n\n\t\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t\t} );\n\n\t\t}", "title": "" }, { "docid": "db4c744d9e6d579253dc3cae8fed6c97", "score": "0.602356", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t// IE11\n\t\tif( window.navigator.pointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t}\n\t\t// IE10\n\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "db4c744d9e6d579253dc3cae8fed6c97", "score": "0.602356", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t// IE11\n\t\tif( window.navigator.pointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t}\n\t\t// IE10\n\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "e26fa727101bf56e0a720868b2cf456c", "score": "0.6020363", "text": "clearListeners() {\n messageListeners.length = 0;\n }", "title": "" }, { "docid": "38549dd95df5a465be6dfbd225c74bf7", "score": "0.60183734", "text": "function hookDetachedCallback() {\n this.removeEventListener(event, action.bind(this), bubbling);\n }", "title": "" }, { "docid": "4c98dbbe97b97c42a8a4b6d81f8c30c0", "score": "0.60101104", "text": "_removeEventListeners() {\n this.host.removeEventListener('mousemove', this._onMove);\n this.host.removeEventListener('mouseleave', this._onEnd);\n this.host.removeEventListener('touchmove', this._onMove);\n this.host.removeEventListener('touchend', this._onEnd);\n this.host.removeEventListener('touchcancel', this._onEnd);\n }", "title": "" }, { "docid": "ab2a9a1762405afc77e165cc4bef6033", "score": "0.5995917", "text": "function off (node, events, listener, options) {\n var instance = Object(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_1__[\"makeInstance\"])(node)\n var bag = getEvents(instance)\n var n = getEventTarget(instance)\n\n // listener can be a function or a number\n if (typeof listener === 'function') {\n listener = listener._svgjsListenerId\n if (!listener) return\n }\n\n // events can be an array of events or a string or undefined\n events = Array.isArray(events) ? events : (events || '').split(_regex_js__WEBPACK_IMPORTED_MODULE_0__[\"delimiter\"])\n\n events.forEach(function (event) {\n var ev = event && event.split('.')[0]\n var ns = event && event.split('.')[1]\n var namespace, l\n\n if (listener) {\n // remove listener reference\n if (bag[ev] && bag[ev][ns || '*']) {\n // removeListener\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\n\n delete bag[ev][ns || '*'][listener]\n }\n } else if (ev && ns) {\n // remove all listeners for a namespaced event\n if (bag[ev] && bag[ev][ns]) {\n for (l in bag[ev][ns]) {\n off(n, [ ev, ns ].join('.'), l)\n }\n\n delete bag[ev][ns]\n }\n } else if (ns) {\n // remove all listeners for a specific namespace\n for (event in bag) {\n for (namespace in bag[event]) {\n if (ns === namespace) {\n off(n, [ event, ns ].join('.'))\n }\n }\n }\n } else if (ev) {\n // remove all listeners for the event\n if (bag[ev]) {\n for (namespace in bag[ev]) {\n off(n, [ ev, namespace ].join('.'))\n }\n\n delete bag[ev]\n }\n } else {\n // remove all listeners on a given node\n for (event in bag) {\n off(n, event)\n }\n\n clearEvents(instance)\n }\n })\n}", "title": "" }, { "docid": "0802db99c113436373182ca3b9f95872", "score": "0.5995624", "text": "removeChangeListener( callback ){\n this.removeListener( CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "50a4c7e0f7b4bdc8880e4937e15cfaeb", "score": "0.599441", "text": "removeEventListener(type, listener) {\n const listeners = this.m_listeners.get(type);\n if (listeners === undefined) {\n return;\n }\n if (listener === undefined) {\n this.m_listeners.delete(type);\n }\n else {\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n this.m_listeners.delete(type);\n }\n }\n }\n }", "title": "" }, { "docid": "cd0ba84c98d3f404a0ffaecbec7e8bfb", "score": "0.59915036", "text": "_unbindEvents() {\n this._internalPlayer.removeEventListener('onReady', this._playerReadyHandle);\n this._internalPlayer.removeEventListener('onError', this._playerErrorHandle);\n this._internalPlayer.removeEventListener('onStateChange', this._stateChangeHandle);\n }", "title": "" }, { "docid": "e21613f6b8957b5e3d544107bb04176f", "score": "0.5988939", "text": "removeEvents() {\n window.removeEventListener('resize', this.resizeSlider);\n this.lineNode.removeEventListener('pointerdown', this.startDrag);\n window.removeEventListener('pointerup', this.stopDrag);\n window.removeEventListener('pointercancel', this.stopDrag);\n this.navLeft.removeEventListener('click', this.shiftLeft);\n this.navRight.removeEventListener('click', this.shiftRight);\n }", "title": "" }, { "docid": "56c31a1dc067546dbb61ebd605be1004", "score": "0.59831494", "text": "function unlisten () {\n\t\tbuttonCountMesssages.removeventListener('click', countMessages);\n\t\tbuttonCountThreads.removeEventListener('click', countThreads);\n\t\tbuttonImport.removeEventListener('click', pickFile);\n\t\tbuttonExport.removeEventListener('click', exportMessages);\n\t}", "title": "" }, { "docid": "52711aa41fa41e8fd33a6847aff21fc1", "score": "0.59830767", "text": "removeClickListener(callback){\r\n this.canvas.removeEventListener('mousedown', this.onClicked);\r\n\r\n if(callback){\r\n //this.canvas.removeEventListener('canvasbuttonclicked', callback);\r\n } else {\r\n while(this.callbacks.length > 0){\r\n let cb = this.callbacks.pop();\r\n //this.canvas.removeEventListener('canvasbuttonclicked', cb);\r\n }\r\n }\r\n\r\n // Update UI:\r\n this.bgColor = this.bgOFF;\r\n this.fontColor = this.fontOFF;\r\n }", "title": "" }, { "docid": "144f2ded91c23ada01aee67d692bd975", "score": "0.597707", "text": "function removeListeners(lView) {\n var tCleanup = lView[TVIEW].cleanup;\n if (tCleanup != null) {\n var lCleanup = lView[CLEANUP];\n for (var i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener\n var idxOrTargetGetter = tCleanup[i + 1];\n var target = typeof idxOrTargetGetter === 'function' ?\n idxOrTargetGetter(lView) :\n unwrapRNode(lView[idxOrTargetGetter]);\n var listener = lCleanup[tCleanup[i + 2]];\n var useCaptureOrSubIdx = tCleanup[i + 3];\n if (typeof useCaptureOrSubIdx === 'boolean') {\n // native DOM listener registered with Renderer3\n target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);\n }\n else {\n if (useCaptureOrSubIdx >= 0) {\n // unregister\n lCleanup[useCaptureOrSubIdx]();\n }\n else {\n // Subscription\n lCleanup[-useCaptureOrSubIdx].unsubscribe();\n }\n }\n i += 2;\n }\n else {\n // This is a cleanup function that is grouped with the index of its context\n var context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n lView[CLEANUP] = null;\n }\n}", "title": "" } ]
5dc7f93033fa009db76c6ff88361cb3d
Get the specificity of the encoding.
[ { "docid": "211f6c2410439ca921d4c3d1a16a6590", "score": "0.0", "text": "function specify(encoding, spec, index) {\n var s = 0;\n if(spec.encoding.toLowerCase() === encoding.toLowerCase()){\n s |= 1;\n } else if (spec.encoding !== '*' ) {\n return null\n }\n\n return {\n i: index,\n o: spec.i,\n q: spec.q,\n s: s\n }\n}", "title": "" } ]
[ { "docid": "0a889c85a5e1aa6907b3b8b5d031b9d0", "score": "0.60888606", "text": "getEncoding() {}", "title": "" }, { "docid": "b4960dc72fdc9c19a455ae9997589054", "score": "0.5944697", "text": "function getSpecificity(selector) {\n return specificity.calculate(selector)[0].specificity;\n}", "title": "" }, { "docid": "812fae80014025560739dbc2717b410f", "score": "0.5618372", "text": "get encoding() {\n return this[ENCODING];\n }", "title": "" }, { "docid": "97199765ecdc6b06c48ca777d0dcd1f8", "score": "0.5589935", "text": "get encodingTypeInput() {\n return this._encodingType;\n }", "title": "" }, { "docid": "0f3888d8052cc86b1b4cbe0e6599486f", "score": "0.5523521", "text": "get encoding() {\n return this._state.encoding;\n }", "title": "" }, { "docid": "54b00b34b4a34ee85751f4f1866293a7", "score": "0.5244193", "text": "function prv_getCharacterSet(){\n\t\t\t\treturn cs;\n\t\t\t}", "title": "" }, { "docid": "b56ab91d83e48ec93963229a229b330f", "score": "0.52349603", "text": "static getEncoding(v) {\n if (v.length < 2) {\n throw new Error(\"Too Short\");\n }\n\n const encoding = multibase_1.default.isEncoded(v); // check encoding is valid\n\n if (encoding === false) {\n throw new Error(\"Invalid Encoding\");\n }\n\n return encoding;\n }", "title": "" }, { "docid": "39b71dda05ea066c1b1671ec5eade4ac", "score": "0.52185774", "text": "async encoding() {\n if (!this._mime) {\n await this._detectContentType();\n }\n\n if (this._encoding === \"binary\") {\n return null;\n }\n return this._encoding;\n }", "title": "" }, { "docid": "9bc8a618b35a1b12f54fcf0fecd639b5", "score": "0.5152823", "text": "static getEncoding(v) {\n if (v.length < 2) {\n throw new Error(\"Too Short\");\n }\n\n const encoding = _multibase.default.isEncoded(v); // check encoding is valid\n\n\n if (encoding === false) {\n throw new Error(\"Invalid Encoding\");\n }\n\n return encoding;\n }", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "7a0d7fb0d5a53f3bd408f832e3b308ef", "score": "0.5141077", "text": "function getFullCharset(spec) {\n return spec.charset;\n}", "title": "" }, { "docid": "4bec3031d6a64329670cb365c306e5bf", "score": "0.5123304", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "4bec3031d6a64329670cb365c306e5bf", "score": "0.5123304", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "1325f30b559af241e092b2ec0fecd2be", "score": "0.50983864", "text": "function getEncodingPriority(encoding, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(encoding, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "922da6b8b53fae0689fb8eba4b4ba47f", "score": "0.50963384", "text": "static getEncoding(v) {\n if (v.length < 2) {\n throw new Error(\"Too Short\");\n }\n const encoding = multibase_1.default.isEncoded(v);\n // check encoding is valid\n if (encoding === false) {\n throw new Error(\"Invalid Encoding\");\n }\n return encoding;\n }", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "e6e2944c812753e9b7d8b5558193dcae", "score": "0.50672084", "text": "function getFullEncoding(spec) {\n return spec.encoding;\n}", "title": "" }, { "docid": "193435300a414db011794a0a7a3ba4e9", "score": "0.5063125", "text": "static detectFileEncoding(buffer) {\n if (buffer.length < 1) return false;\n let buf = (buffer.length < 4096 ? buffer : buffer.slice(0, 4096));\n\n const encodings = ['utf8', 'utf16le'];\n\n let encoding;\n if (buffer.length <= 128) {\n encoding = encodings.find(x =>\n Buffer.compare(new Buffer(buffer.toString(), x), buffer) === 0\n );\n } else {\n encoding = encodings.find(x => !FileChangedCache.containsControlCharacters(buf.toString(x)));\n }\n\n return encoding;\n }", "title": "" }, { "docid": "d2711746a57c7b7544aadb65c0497fcd", "score": "0.5033606", "text": "kindOf(name) {\n const symbol = this.getSymbol(name);\n return symbol ? symbol.kind : undefined;\n }", "title": "" }, { "docid": "bde0fd7b6c29c56882957a8185647186", "score": "0.4983749", "text": "function httpGetEncoding(sFile) {\n\tvar sMime = httpGetMime(sFile);\n\tvar aMime = sMime.split('/');\n\tvar bText = aMime[0] === 'text';\t\n\treturn bText ? 'utf8' : null;\n}", "title": "" }, { "docid": "6361e2b6ed1660743a24e19f1d83cf21", "score": "0.49722904", "text": "function specificity(str) {\n var chunk,pos,i,retval =[0,0,0];\n str = str.split(/(?=\\.|:|#|\\s+)\\b|\\+|\\*|\\>|~/);\n i = str.length;\n while (i--) {\n chunk = str[i].trim();\n if (chunk !== \"\") {\n if (chunk[0] == \"#\") {\n pos = 0;\n } else if(chunk[0] == \".\" || chunk[0] == \":\" || chunk[0] == \"[\") {\n if (chunk[0] == \":\" && (/:(first\\-(line|letter)|before|after)/.test(chunk))) {\n pos = 2;\n } else {\n pos = 1;\n }\n } else {\n pos = 2;\n }\n retval[pos]++;\n }\n }\n return parseInt(retval.join(\"\"),10);\n }", "title": "" }, { "docid": "b3fdab75e976f9f6927367c908c52746", "score": "0.49705088", "text": "function Charset() {}", "title": "" }, { "docid": "69ecee95c80863b782ef7c326ff7e204", "score": "0.49442756", "text": "function ixo116085() { return 'ihave'; }", "title": "" }, { "docid": "d62756ac17f6b9e38930333ea515db87", "score": "0.49111563", "text": "function getEncoding(character) {\n\treturn getBinary(characterValue(character));\n}", "title": "" }, { "docid": "9e958a6c877f14f33b1d1b7a372a42e2", "score": "0.4888469", "text": "getClass(firstByte) {\n if (firstByte <= 127)\n return \"A\";\n else if (firstByte <= 191)\n return \"B\";\n else if (firstByte <= 223)\n return \"C\";\n else if (firstByte <= 239)\n return \"D\";\n else\n return \"E\";\n }", "title": "" }, { "docid": "ef26d3aa9f4b835a49527e3ab395b817", "score": "0.4882488", "text": "sentence_type() {\n let char = this.terminator();\n let types = {\n \"?\": \"interrogative\",\n \"!\": \"exclamative\",\n \".\": \"declarative\",\n };\n return types[char] || \"declarative\";\n }", "title": "" }, { "docid": "41e3e61415057815cc1f8e084cdab579", "score": "0.48663655", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "41e3e61415057815cc1f8e084cdab579", "score": "0.48663655", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {\n o: -1,\n q: 0,\n s: 0\n };\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "cb981eca4eb674216a5591d45645e129", "score": "0.48469746", "text": "getCodeNorm() {\n const c = this.getCode();\n return c === NL_LIKE ? NL : c;\n }", "title": "" }, { "docid": "cb981eca4eb674216a5591d45645e129", "score": "0.48469746", "text": "getCodeNorm() {\n const c = this.getCode();\n return c === NL_LIKE ? NL : c;\n }", "title": "" }, { "docid": "cdea257aedced84f05400cf7f473e648", "score": "0.48451725", "text": "static getEncoding(v) {\n if (v.length < 2) {\n throw new Error('Too Short');\n }\n\n const encoding = src$1.isEncoded(v); // check encoding is valid\n\n if (encoding === false) {\n throw new Error('Invalid Encoding');\n }\n\n return encoding;\n }", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" }, { "docid": "e80cf7d76e52c72d529df15b68757efe", "score": "0.48320654", "text": "function getCharsetPriority(charset, accepted, index) {\n var priority = {o: -1, q: 0, s: 0};\n\n for (var i = 0; i < accepted.length; i++) {\n var spec = specify(charset, accepted[i], index);\n\n if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {\n priority = spec;\n }\n }\n\n return priority;\n}", "title": "" } ]
c43526605fe831cb9f2285aa2e4ef97b
Method for getting all users in the database.
[ { "docid": "eff6cd18ca9d2372db86cc764b5f8525", "score": "0.73166096", "text": "allData() {\n const sql = 'SELECT * FROM users';\n return this.db.many(sql);\n }", "title": "" } ]
[ { "docid": "b018f7d2660e59ddd9cdd3bdf2137f8f", "score": "0.834214", "text": "getAllUsers() {\n return User.findAll()\n }", "title": "" }, { "docid": "0cb1e991986663e4f58e26df1f54cca1", "score": "0.82981026", "text": "getUsers() {\n winston_logger.debug(\"database.getUsers entered.\");\n const sql = \"SELECT id, username, email, isAdmin FROM user\";\n return this.db.allAsync(sql, []);\n }", "title": "" }, { "docid": "78853f091f7c882c8a05cf1e6f0ae4fa", "score": "0.8212312", "text": "getAll() {\n return db.users.find().toArray();\n }", "title": "" }, { "docid": "6618af648e65da9351e77c901ea59424", "score": "0.8204347", "text": "retrieveUsers() {\n this.DatabaseService.getAllUsers();\n }", "title": "" }, { "docid": "92e166ff555afe6131337246ce91caa4", "score": "0.8055622", "text": "static async getAll() {\n\t\tconst results = await db.query(\n\t\t\t`SELECT username, first_name, last_name, email\n FROM users`\n\t\t);\n\t\treturn results.rows;\n\t}", "title": "" }, { "docid": "595ffa7cb49a94395b18e0176ccf30d0", "score": "0.8002344", "text": "static async getAll() {\n const users = await User.find({});\n return users;\n }", "title": "" }, { "docid": "e0596d6227224536fe65d4a4fa7b62cf", "score": "0.79607964", "text": "async getAll() {\n try {\n const users = await UserModel.findAll();\n\n if (!users)\n throw createError(404, \"There are no users currently registered!\");\n\n return users;\n } catch (error) {\n throw error;\n }\n }", "title": "" }, { "docid": "f2c1b0a7fe5df6a6d4493c245bd5d651", "score": "0.7931407", "text": "function getAllUsers() {\n var deferred = $q.defer();\n var users = [];\n\n var request = \n localdb.getObjectStore(DB_STORENAME, 'readonly')\n .openCursor();\n\n request.onerror = function() {\n $log.info(\"Open Cursor Error!\");\n deferred.reject();\n };\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n\n if (cursor) {\n users.push(cursor.value);\n cursor.continue();\n }\n else {\n deferred.resolve(users);\n }\n };\n\n return deferred.promise;\n }", "title": "" }, { "docid": "a765a459c4bcd8bef025d133fd863e1b", "score": "0.7908304", "text": "function get_all_users() {\n return models.user\n .findAll({\n where: { enabled: true },\n attributes: ['email']\n })\n .then(function (users) {\n return users;\n })\n .catch(function (error) {\n return Promise.reject(error);\n });\n}", "title": "" }, { "docid": "19645d907f235f95fec851dddd8d5769", "score": "0.7905717", "text": "function getAll() {\n return db('users');\n}", "title": "" }, { "docid": "2baa5ab6a5f9745dfce5ee9577acf10f", "score": "0.79015994", "text": "async findAllUsers() {\n return User.findAll();\n }", "title": "" }, { "docid": "95c41e4f7253ce782e997ca1266c0d39", "score": "0.7899984", "text": "function findAllUsers(){\n AdminService\n .findAllUsers()\n .then(renderUsers);\n }", "title": "" }, { "docid": "888447984bbad0e46a45d659357ed660", "score": "0.78810555", "text": "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers)\n }", "title": "" }, { "docid": "3d14f76be25a5fb721a444ba0ce08f57", "score": "0.78639203", "text": "function getUsers() {\n User.query(function(data){\n // return self.all = data.users; MADE THIS CHANGE\n self.all = data.users;\n });\n }", "title": "" }, { "docid": "fde0f5e3fe33e624d19e4a76f976a9cc", "score": "0.7852425", "text": "static async all() {\n const resp = await db.query(\n `SELECT username, first_name, last_name, email\n FROM users`\n );\n return resp.rows;\n }", "title": "" }, { "docid": "22ea41be8e9f6ac3eab25ffe76ad5565", "score": "0.78481185", "text": "function getAll() {\r\n return users;\r\n}", "title": "" }, { "docid": "5a978ce57cc6a8f48b05ed26db8922e1", "score": "0.7838106", "text": "getUsers() {\n return this.fetchAPI (`${this.apiURL}/api/users/all`, \"GET\");\n }", "title": "" }, { "docid": "8016f3479e54712d16540a0c1798ffb3", "score": "0.7828627", "text": "function getAllUsers(req, res) {\n console.log('getting all users');\n db.User.find({}, function(err, users) {\n res.json(users);\n });\n}", "title": "" }, { "docid": "055438839a5666644e8b3c2aaa2ab092", "score": "0.7791192", "text": "function findAllUsers() {\n userService.findAllUsers()\n .then(allUsers => {\n users = allUsers;\n renderUsers(users);\n })\n }", "title": "" }, { "docid": "34a7aaf536676467e8c405bf2da609e6", "score": "0.77848864", "text": "async getAll() {\n try {\n /* Get All the user in the database */\n const users = await getAllUsers();\n\n if (users === null) {\n return { statusCode: HTTP.NoContent, data: \"User not found\" };\n }\n\n return { statusCode: HTTP.OK, data: users };\n } catch (err) {\n debug(\"[User|GetAll]: \", err);\n return { statusCode: HTTP.InternalServerError, data: err };\n }\n }", "title": "" }, { "docid": "885fadd75c01b60f828fef16c61b3c4e", "score": "0.7775008", "text": "getAllUsersFromDb() {\n const item = UserRepository.getAll();\n\n if (!item) {\n return null;\n }\n return item;\n }", "title": "" }, { "docid": "d14a834fa7f7ddb45c11cc120ad37b5e", "score": "0.7770147", "text": "function fetchAllUsers(){\r\n UserService.fetchAllUsers()\r\n .then(\r\n function(users) {\r\n self.users = users;\r\n self.FilterUsers = self.users;\r\n pagination();\r\n console.log(users);\r\n },\r\n function(errResponse){\r\n console.error('Error while fetching Users');\r\n }\r\n );\r\n }", "title": "" }, { "docid": "8e547318c15117d6e0c106dc974ac3ca", "score": "0.77605987", "text": "function findAllUsers() {\n userService\n .findAllUsers()\n .then(theusers => {\n users = theusers\n renderUsers(theusers)\n })\n }", "title": "" }, { "docid": "28b2a04c31a6a28945f57ee05e99c879", "score": "0.77375656", "text": "function findAll() {\n var deferred = q.defer();\n UserModel.find().then(function (data) {\n deferred.resolve(data);\n }, function (err) {\n deferred.reject(err);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "18fa3891ac6f193e7ee614b0dcde01d5", "score": "0.77295154", "text": "function get_all_users(){\n return new Promise(function(resolve, reject){\n let query = connection.query('SELECT * FROM users', [], function(error,results,fields) {\n if (error){\n reject(error);\n }else{\n resolve(results);\n }\n });\n });\n}", "title": "" }, { "docid": "1961638363d3555c565e418bd94b65f0", "score": "0.77140003", "text": "function users(){return allUsers}", "title": "" }, { "docid": "bada5509a28a8eb7679daaf4732cf39e", "score": "0.770554", "text": "function listAllUsers (req, res) {\n User.find({}, function (err, user) {\n if (err) { res.send(err); }\n res.status(200)\n .json({\n status: 'success',\n data: user,\n message: 'Retrieved all users'\n });\n });\n}", "title": "" }, { "docid": "573badebef2cfaebae5bf09e902cf9e8", "score": "0.77042145", "text": "function GetAllUsers(req, res) {\n const {knex}=req.app.locals;\n knex\n .select('*')\n .from('users')\n .then(data => res.status(200).json(data))\n .catch(error => res.status(500).json(error))\n}", "title": "" }, { "docid": "1887ec2eccce7fba5d929dfda1f49294", "score": "0.7703289", "text": "function findAllUsers() {\n return $http.get(\"/api/user\")\n .then(function (response) {\n return response.data;\n });\n }", "title": "" }, { "docid": "a7d164c02e3d382b78f06dddc5289609", "score": "0.76709354", "text": "static async findAllUsers() {\n const userList = await User.find({});\n return userList;\n }", "title": "" }, { "docid": "2d22a9d112f8e2212b8cd6c9cba0ed9f", "score": "0.7660639", "text": "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "972355222e684cafcf6574789b48d9f2", "score": "0.76553315", "text": "function getAllUsers(callback){\n User.find({}, function(err, users){\n if(err){\n console.error(\"Error finding users\");\n console.error(err);\n }\n callback(err, users);\n });\n}", "title": "" }, { "docid": "5bc106ce29fdb96e3aa8fe0dbc84bbb0", "score": "0.764972", "text": "async getAllUsers(){\r\n const url = 'users';\r\n return await apiService.get(url);\r\n }", "title": "" }, { "docid": "ac924e48e3b2c037f403bea8f7b4db3c", "score": "0.76370305", "text": "all_users(callback) {\n let q = `SELECT * from user;`\n this.query_db(q, [], callback)\n }", "title": "" }, { "docid": "87c8194239283ed9a5a60a56ef043a34", "score": "0.76356006", "text": "static findAll() {\n return hydra.makeAPIRequest(new Message(`db-service:[get]${BASE_URL}`, {})).then(response => {\n if (response.statusCode == 200) {\n let users = [];\n response.result.forEach(user => {\n users.push(new User(user));\n });\n return users;\n // return new User(response.result);\n } else {\n return Promise.reject(response.result);\n }\n });\n }", "title": "" }, { "docid": "e8caf998e1aae72bfa8ca52522367a28", "score": "0.7634365", "text": "getAllUsers() {\n return userCtrl.getAllUserList();\n }", "title": "" }, { "docid": "65e2560629628c06b362c316ad500a74", "score": "0.7609922", "text": "async findAllUsers() {\n return User.findAll();\n }", "title": "" }, { "docid": "b4b72c146a60d4a6b41b810a23e2f83b", "score": "0.76090497", "text": "function _getAllUsers() {\n var deferred = $q.defer();\n var url = \"/api/user/getusers\";\n\n $http.post(url,\n null,\n {\n headers: { 'Content-Type': 'application/json' }\n }\n )\n .success(function (response) {\n deferred.resolve(response);\n return response;\n })\n .error(function (errMessage, statusCode) {\n var result = { isSuccess: false, status: statusCode, message: errMessage };\n deferred.reject(result);\n return result;\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "797c52d3dacd0d0ad7c4f22c840faa18", "score": "0.7592024", "text": "async function getAllUsers () {\n if (allUsers) {\n return allUsers\n\n } else {\n await loadAllUsers()\n return allUsers\n }\n}", "title": "" }, { "docid": "d611e3c3b70cb981ed3dae543b79fed5", "score": "0.75765055", "text": "async function getAllUsersController() {\n try {\n var users = await execQuery(getUsersQuery, null);\n } catch (error) {\n throw new Error(error);\n }\n return users;\n}", "title": "" }, { "docid": "5ed9ed9dd76671999cb3a99bf7e09e4b", "score": "0.7574842", "text": "async getUsers () {\n\t\tconst method = 'get_users/';\n\t\tconst url = this.host + method;\n\t\tconst options = {\n\t\t\tmethod: 'GET',\n\t\t\theaders: this.headers\n\t\t};\n\n\t\tconst data = await this.myFetch(url, options);\n\t\treturn await data;\n\t}", "title": "" }, { "docid": "23843a1de79ec3965c8b039cb85b72f2", "score": "0.75704503", "text": "function getAllUsersQuery() {\n return new Promise((resolve, reject) => {\n pool.query(\n {\n sql: \"select * from Users\",\n timeout: 40000\n },\n (err, result) => {\n if (err) {\n return reject(err);\n }\n\n users = [];\n result.forEach(user => {\n users.push(user);\n });\n\n return resolve(users);\n }\n );\n });\n}", "title": "" }, { "docid": "f0bf532069952996ef8e12cc3e5d84f7", "score": "0.7568132", "text": "function getAllUsers(callback) {\n user.getAllUsers(callback);\n}", "title": "" }, { "docid": "5cfc6aef5b504a6a8e3a4ea553030a26", "score": "0.7558807", "text": "getAllUsers() {\n return this.httpGet('/admin/users').pipe(map((result) => result.getBody(UsersResponse).users), catchError(this.handleJsonError));\n }", "title": "" }, { "docid": "974b27ff621f76cbae15f4432213ce3b", "score": "0.75458", "text": "function getAllUsers(req, res) {\n User.find({}, {\n _id: 0,\n __v: 0\n }, function(err, users) {\n if (err) {\n res.send(err);\n } else {\n res.json(users);\n }\n });\n}", "title": "" }, { "docid": "e4e5bed9114d75a7f7001224e67fb770", "score": "0.7536683", "text": "getAllUsers() {\n return this.store.findAll(this.users);\n }", "title": "" }, { "docid": "6c4bc5dfa2255b28243778a01c131c70", "score": "0.75220346", "text": "function getAll() {\r\n const requestOptions = {\r\n method: 'GET',\r\n headers: authHeader()\r\n };\r\n return fetch(`${config.apiUrl}/users`, requestOptions).then(handleResponse);\r\n}", "title": "" }, { "docid": "ba27e3cea85418ff86188c3920059023", "score": "0.75207853", "text": "function fetchAllUser(){\r\n\t\t\tUserService.fetchAllUser()\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\tfunction(user) {\r\n\t\t\t\t\t\t\tself.userall = user;\r\n\t\t\t\t\t\t\tconsole.log(user);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tfunction(errResponse) {\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 );\r\n\t\t}", "title": "" }, { "docid": "3f5ae8cf3dc6a7aadee51fe262179a7d", "score": "0.7513465", "text": "function GetAllUsers(req, res){\n User.find({}, (err, users)=>{\n if(err){\n res.status(500).json({\n message:\"Server Error-> userController/GetAllUsers\"\n });\n }\n else{\n res.status(200).json({\n message:\"All users\",\n users\n });\n }\n });\n}", "title": "" }, { "docid": "c82092448e79f230ae76624e00f36385", "score": "0.75075334", "text": "static async getAll() {\n try {\n const response = await db.any(`\n SELECT * FROM users; `\n )\n return response;\n } catch (error) {\n console.error('ERROR', error)\n return error\n }\n }", "title": "" }, { "docid": "2fc5d3d06380a20a2800a76eaf5a06d3", "score": "0.749341", "text": "findAll() {\n\t\treturn db.any('SELECT * FROM users');\n\n\t}", "title": "" }, { "docid": "348f8b163fc2d0ab10680a9b23d36d41", "score": "0.7490694", "text": "function getAll(req, res) {\n console.log(\"getAll for user\");\n userModel.selectAll(function (e, o) {\n if (e) {\n console.log(e);\n res.status(503).send(e)\n } else {\n res.status(200).send(o.rows);\n }\n })\n }", "title": "" }, { "docid": "d23f54a2e363469057d4faada427f7b3", "score": "0.7446513", "text": "function getAllUsersFromDataStore() {\n myDB.getCollection(apiUsers, function (err, resources) {\n userData = resources;\n });\n return userData;\n }", "title": "" }, { "docid": "d23f54a2e363469057d4faada427f7b3", "score": "0.7446513", "text": "function getAllUsersFromDataStore() {\n myDB.getCollection(apiUsers, function (err, resources) {\n userData = resources;\n });\n return userData;\n }", "title": "" }, { "docid": "1d5dc798aa87cb34c0bdc98640792885", "score": "0.7442762", "text": "function getAllUsers(req, res){\n User.find({}, function (err, users) {\n if (err) {\n console.error(`Error: ${error}`)\n res.send(`Error: ${error}`)\n } else {\n console.log(users)\n res.send(users)\n }\n })\n}", "title": "" }, { "docid": "2003be5071a0974662a76231fd3ef74f", "score": "0.7398224", "text": "function getAllUsers(req, res, next){\n User.find({}).exec((err, users) => {\n if (err) {\n return res.json(err);\n }\n return res.json(users);\n});\n}", "title": "" }, { "docid": "7a00635aad5a379afd6d7ac00606160c", "score": "0.73907334", "text": "function getUsers() {\n vm.Noty(\"Getting Users from Backend\", \"info\", false, true, 3000);\n return getUsersApi().then(function(){\n vm.Noty(vm.rest2.message, \"success\", false, true, 3000);\n });\n }", "title": "" }, { "docid": "71bc0003e8590a270a973f2b269d8eee", "score": "0.7390309", "text": "function getAllUsers() {\n return axios.get(USER_API_URL + \"/users\");\n}", "title": "" }, { "docid": "bd5c858e160779c0327d4d866e486c9f", "score": "0.7366763", "text": "function findallusers(req, res) {\n\n userModel\n .findAllUsers()\n .then(\n function (users) {\n res.json(users);\n },\n function (error) {\n res.statusCode(404).send(error);\n }\n );\n }", "title": "" }, { "docid": "b7c9f1ea170d687fbea6f6e86a41c07c", "score": "0.7365655", "text": "async function getUsers() {\n let users = await DButils.execQuery(`select * from dbo.Users;`);\n\n return users;\n}", "title": "" }, { "docid": "116393969ba46d9341ea80ff491fbb81", "score": "0.7361114", "text": "function getUsers() {\n return new Promise(function (resolve, reject) {\n\n const sqlString = `\n SELECT id, username\n FROM users;\n `;\n getConnection().then(function(connection) {\n connection.query(sqlString, function (err, result, fields) {\n connection.release();\n if (err) {\n reject(err)\n } else {\n var itemList = [];\n result.forEach(element => {\n itemList.push(new User(element.id, element.username))\n });\n resolve(itemList);\n }\n });\n }).catch(function(error) {\n reject(error);\n });\n });\n}", "title": "" }, { "docid": "bd9f085ee97270cb4c2402b9d875491f", "score": "0.73547506", "text": "function getUsers() {\n\t\t$.get(\"/api/users\", function (data) {\n\t\t\tvar rowsToAdd = [];\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\trowsToAdd.push(createUserRow(data[i]));\n\t\t\t}\n\t\t\trenderUserList(rowsToAdd);\n\t\t});\n\t}", "title": "" }, { "docid": "903e3ae2c7c6c722c0039d910b2e709f", "score": "0.7341586", "text": "all() {\n return this.db.any('SELECT * FROM users');\n }", "title": "" }, { "docid": "e256ddcaca144bb56f4654e1e55164e6", "score": "0.7341408", "text": "static get users() {\n const users = Modules.UserStore.getUsers();\n return List.from(Object.values(users), u => User.from(u));\n }", "title": "" }, { "docid": "ba0e3aa3b679f8ee7db3557cb9fd24a0", "score": "0.7334866", "text": "function getUsers(){\n UserService.getAll(function(users)\n {\n $scope.data.users = users;\n })\n }", "title": "" }, { "docid": "0e4451374d2d3931b8e2d02effd32866", "score": "0.732606", "text": "function getAllUsers() {\n userService.getAllUsers().then(function(data) {\n if (data !== null) {\n $scope.allUsers = appendFollowedAttribute(data);\n } else {\n $scope.allUsers = [];\n }\n });\n }", "title": "" }, { "docid": "d3ce56f6d13c0bdee29ae1111c4d882f", "score": "0.7300799", "text": "function getUsers() {\n var deferred = Q.defer();\n users.find({}, function(err, users) {\n if (err) {\n deferred.reject(err);\n } else {\n deferred.resolve(users);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "8c5d7cfce6f454141cc8410aad8dd1f1", "score": "0.7297863", "text": "function getUsers() {\n return fetch(CONFIG.getUsers)\n .then(response => response.json())\n .catch(error => {\n throw new Error('API Error', error)\n });\n }", "title": "" }, { "docid": "ff6453f751bc8cc34eaece7be9db5638", "score": "0.7297511", "text": "async getAllUsers(req, res) {\n try {\n const users = await User.find();\n logger.verbose(\n `Status: ${res.statusCode}: Successfully fetched all users`\n );\n return res.status(200).json(users);\n } catch (error) {\n logger.error(`Status: ${res.statusCode}: ${error.message}`);\n return res.status(500).json({ message: error });\n }\n }", "title": "" }, { "docid": "ef7f9060a753d00d89780b312c916fea", "score": "0.72859037", "text": "function getAllUser(req, res, next) {\n userModel.getAllUser().then(users => {\n res.status(200).json({ users })\n })\n}", "title": "" }, { "docid": "99499d8f665e589d2ee7f5b6e46446d9", "score": "0.7280607", "text": "async function getUsers() {\n return await mongoHelpers.mongoRead(\"main\", \"data\");\n}", "title": "" }, { "docid": "62ef5833a230a1528f43036aa4422891", "score": "0.7272801", "text": "async function getAllUsers(req, res, next) {\n try {\n const docs = await User.find().exec();\n\n return res.json(docs);\n } catch (e) {\n next(e);\n }\n}", "title": "" }, { "docid": "df2d0a990061cf9ed8d953246842a73a", "score": "0.72721136", "text": "static async getAll(req, res) {\n try {\n const usuarios = await usersModel.findAll();\n res.status(200).json(usuarios);\n } catch {\n return res.status(500).json({ message: \"users query error\" });\n }\n }", "title": "" }, { "docid": "9baaf60bd6df046748135da74c023561", "score": "0.7261847", "text": "function returnUsers() {\n database.collection(\"users\").find({}).toArray(function(err, result) {\n if (err) { return console.log(err) }\n console.log(result);\n res.send(result);\n });\n }", "title": "" }, { "docid": "a08867b672a91550f0d1cc91e522ad01", "score": "0.725027", "text": "function getUsers() {\n userService.getUsers()\n .then(\n function(users) {\n vm.users = users;\n },\n function(error) {\n Notification.error({\n title: \"Failed to get users\",\n message: error.message\n });\n }\n );\n }", "title": "" }, { "docid": "3e6d8452f7fa52494deec06a2bb0cbb9", "score": "0.7236096", "text": "function getUsers(request, response) {\n var tk = request.headers.token;\n var auth = new controllerAuth.AuthUserServer(tk);\n var q = 'SELECT * FROM users;';\n dataBase.query(q, response, parser.parserGetUsers, auth);\n}", "title": "" }, { "docid": "efe1d393ef45d8f68f140e1e5a0fe0b8", "score": "0.723148", "text": "function getAllUsers(){\n\t\t\n\t\t$.get(\"./AllUsersServlet\", function(data){\n\t\t\tconsole.log(data);\n\t\t\t\n\t\t\tif(data.status == \"success\"){\n\t\t\t\tallUsers = data.users;\n\t\n\t\t\t\tfor(user of allUsers){\n\t\t\t\t\t$(\"#table\").append(\"<tr>\" + \n\t\t\t\t\t\t\t\t\t \"<td></td>\" +\n\t\t\t\t\t\t\t\t\t \"<td><a href='User.html?id=\" + user.id +\"'>\" + user.username + \"</a></td>\" + \n\t\t\t\t\t\t\t\t\t \"<td>\" + new Date(user.registrationDate).toString().substring(4,16) + \"</td>\" + \n\t\t\t\t\t\t\t\t\t \"<td>\" + new Date(user.registrationDate).toString().substring(16,21) + \"</td>\" +\n\t\t\t\t\t\t\t\t\t \"<td>\" + user.role.toString() + \"</td>\");\n\t\t\t\t}\n\t\t\t}else if(data.status == \"fail\"){\n\t\t\t\talert(\"Something went wrong! Please try again!\");\n\t\t\t\twindow.location.reload();\n\t\t\t}\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "b25d81aeb6f945ca2b77ec316ccb9c0a", "score": "0.7230317", "text": "function getUsers() {\n return new Promise((resolve, reject) => {\n if (users.length === 0) {\n reject({\n message: 'no users available',\n status: 202\n })\n }\n resolve(users)\n })\n}", "title": "" }, { "docid": "da5a0c6d24e0b0315c13fd0104408813", "score": "0.7230098", "text": "static async getAllUsers(filters) {\n let res = await this.request(`users`, filters);\n return res.users;\n }", "title": "" }, { "docid": "c6a65fdb5d9b2b05b564566a82eee721", "score": "0.7226925", "text": "function queryUsers() {\n\t\t\tserver.getUsers().then(function(res) {\n\t\t\t\tvm.users = res.data.users;\n\t\t\t\tformatLastLogin();\n\t\t\t}, function(res) {\n\t\t\t\tgui.alertBadResponse(res);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4459d38b152d94156b82dfb585bf6c51", "score": "0.72182107", "text": "function getAllUsers(req, res) { \n const token = getToken(req.headers);\n if (token) {\n let decoded = jwt.decode(token, config.secret);\n const promise = User.findOne({\n username: decoded.username\n });\n promise\n .then(() => {\n // note that `User.find(user)` will bring only the decoded.username\n // instead of all the users\n const promise_get_users = User.find({});\n promise_get_users\n .then(users => res.status(200).json(users))\n .catch(err => {\n res.status(401).send({\n success: false,\n msg: \"Authentication failed. User not found.\",\n err: err\n });\n });\n })\n .catch(err => {\n res.status(401).send({\n success: false,\n msg: \"Authentication failed. Wrong user.\",\n err: err\n });\n });\n } else {\n res.status(401).send({\n success: false,\n msg: \"No token provided.\"\n });\n }\n }", "title": "" }, { "docid": "7f354b54a311a5a74c0ddeece47a93cd", "score": "0.7199747", "text": "static async getUsers(req, res) {\n const users = await User.find();\n res.status(200).json(users);\n }", "title": "" }, { "docid": "070d88f602f44606c9a1ce14c0f06027", "score": "0.71969545", "text": "getAllUsers(request) {\n return userstore.getAllUsers();\n }", "title": "" }, { "docid": "f3d4b3c92139011a6a2afad48548af42", "score": "0.7185496", "text": "function getAll() {\n var deferred = Q.defer();\n \n //db.users.find({role: {$ne : \"Admin\"}}).toArray(function(err, user) {\n db.users.find({}).toArray(function(err, user) {\n if (err) deferred.reject(err);\n \n if (user) {\n // return user (without hashed password)\n deferred.resolve(_.omit(user, 'hash'));\n } else {\n // user not found\n deferred.resolve();\n }\n });\n \n return deferred.promise;\n}", "title": "" }, { "docid": "7501f9c3a9d79470d445163f031c198e", "score": "0.7180781", "text": "async function listUsers() {\r\n const SQUser = await connectDB();\r\n const users = await SQUser.findAll({});\r\n return users.map( user => sanitizedUser(user));\r\n}", "title": "" }, { "docid": "e7bde40d2a6889df099506936b4d0306", "score": "0.71773845", "text": "async function getUsers() {\n let serverResponse = await userService.getUsers();\n if (serverResponse.status === 200) {\n setUsers(serverResponse.data)\n }\n }", "title": "" }, { "docid": "13b2f124900596c0870e64cf8e7444cb", "score": "0.7172943", "text": "async users() {\n return await this.userCollection;\n }", "title": "" }, { "docid": "bc7009eefa635172eef6315764caf2cc", "score": "0.71666694", "text": "function getUsers() {\n $.get('/api/user', (data) => {\n const rowsToAdd = [];\n for (let i = 0; i < data.length; i++) {\n rowsToAdd.push(createUserRow(data[i]));\n }\n renderUserList(rowstoAdd);\n nameInput.val('');\n });\n }", "title": "" }, { "docid": "2cee499207d4b8dd2250b31c3b24399d", "score": "0.7160664", "text": "getAlluser(cb){\n return connection.query(\"SELECT * FROM user\",cb);\n }", "title": "" }, { "docid": "791429f4e62597216e2bc16d1e22d209", "score": "0.7150124", "text": "async function getUsers(req, res) {\r\n const users = await db.query(\r\n `SELECT * FROM users`, {\r\n type: QueryTypes.SELECT,\r\n })\r\n if (users.length === 0) {\r\n res.status(404).send('There are no users')\r\n } else {\r\n res.status(200).send(users)\r\n }\r\n console.table(users)\r\n}", "title": "" }, { "docid": "a9bf1f3e74d0de295d7d128a71156a0b", "score": "0.7140928", "text": "allUsers(_, args, {dataSources}){\n\t\t\treturn dataSources.catalogNext.getAllUsers();\n\t\t}", "title": "" }, { "docid": "2a410e88769b0029bef851a73a1c1a62", "score": "0.71382165", "text": "function findAllUsers(req, res, next) {\n\tres.json([\n\t\tusers,\n\t]);\n\n\tnext();\n}", "title": "" }, { "docid": "5690d78284c08209942ff784146131f1", "score": "0.713809", "text": "static async getAllUsers(req, res) \n {\n let result = await UserService.getAllUsers();\n res.send(result);\n }", "title": "" }, { "docid": "2086d357b1fc3c89945d4e27ab163ce2", "score": "0.7127482", "text": "async users(parent, args, ctx, info) {\n // Check if logged in\n if (!ctx.request.userId) {\n throw new Error('Please login.');\n }\n // Check if user has the permission to query all the users\n hasPermission(ctx.request.user, ['PERMISSIONUPDATE', 'ADMIN']);\n // Query all the users\n const users = await ctx.db.query.users({}, info);\n return users;\n }", "title": "" }, { "docid": "7ec529ba31a8259696d4e60b9f19618e", "score": "0.71037936", "text": "async getUsers(){ \n var users = [];\n try {\n var snapshot = await this.collection().get();\n snapshot.forEach((user)=> {\n users.push(user.data());\n }) \n } catch (error) {\n console.log(Errors.USERS.ERROR_USER_RETRIEVAL_FAILED);\n }\n \n return users; \n }", "title": "" }, { "docid": "71119444f0f8ac72e80764c11c0c9cfe", "score": "0.70994806", "text": "function getUsers() {\n return new Promise((resolve, reject) => {\n if (users.length === 0) {\n reject({\n message: 'No user found. Please add a new user first.',\n status: 202,\n })\n }\n resolve(users)\n })\n}", "title": "" }, { "docid": "24e3ed996526066299feed898dd45887", "score": "0.70881563", "text": "get allUsers() {\n // Returning a freezed copy of the list of users to prevent outside changes\n return Object.fromEntries(this.users.map((user) => [user.id, user]));\n }", "title": "" }, { "docid": "c49ac63f8e127e5eb5ba961edaa83604", "score": "0.70802975", "text": "function getUsers() {\n $.get(\"/api/users\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createUserRow(data[i]));\n }\n renderUserList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "title": "" }, { "docid": "5a6ed3d9ab950a28290e1866e960cfb6", "score": "0.7074944", "text": "function getUsers() {\n\n return userInfo\n .find({}, function (err, userData) {\n if (err) throw err;\n\n if (userData) {\n //console.log(userData);\n return userData;\n } else {\n console.log(\"Error: \" + err);\n return null;\n }\n });\n}", "title": "" }, { "docid": "7e40c938cfba8f9c18897f5103feb068", "score": "0.707081", "text": "async function obtenerAllUsers(req, res){\n console.info('Conexion GET entrante : /api/user/all');\n\n //Obtenemos los datos\n let { users, message } = await getAllUsers();\n\n if(users){\n //Retornamos los datos\n console.info(`${users.length} usuarios encontrados`);\n console.info('Preparando response');\n res.status(200).json(users);\n }\n else{\n //Si fallo, damos error\n console.info('No se encontraron usuarios');\n console.info('Preparando response');\n res.status(200).json({message});\n }\n}", "title": "" } ]
8a8cc737827e878fcc1232efe85c193a
endregion Constructors (1) region Public Accessors (9)
[ { "docid": "a8e2b2726f3bfa7893de6f284a3eb41d", "score": "0.0", "text": "get arrowManager() {\n return this._arrowManager;\n }", "title": "" } ]
[ { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.79654545", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "3348d7d936c4fbaaa4bf45b9cb4ab24f", "score": "0.79654545", "text": "function constructor()\n {\n //write your code here\n\n //please note that it is a private function, so you can call the public fields or methods only\n //do the private visiting in the following {}\n }", "title": "" }, { "docid": "e3384d809f49005a1c6b36771e3eae5c", "score": "0.7766378", "text": "constructor()\n\t{\n\n\t}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.76319695", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.76319695", "text": "constructor(){}", "title": "" }, { "docid": "16a47861159046dc7590ae9341dad244", "score": "0.76319695", "text": "constructor(){}", "title": "" }, { "docid": "10f798635c00307b41121dea22b39cd8", "score": "0.74804395", "text": "function Ctor() {\n\t}", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.7431837", "text": "constructor () {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.7401697", "text": "constructor() {}", "title": "" }, { "docid": "29309d242b1774a419f3a30357cf2b00", "score": "0.73585314", "text": "function Ctor(){}", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "9f4cdaeffeae89627614b3b10a716f3d", "score": "0.7337111", "text": "constructor() { }", "title": "" }, { "docid": "07390c709a26d06ee9161a789b6aa9a9", "score": "0.733416", "text": "function Ctor() {\n }", "title": "" }, { "docid": "6501de2f8854027c7a789270548a6917", "score": "0.73266816", "text": "construct() {}", "title": "" }, { "docid": "0d10a41e2d2e15b14bd621e554dff73c", "score": "0.7322572", "text": "function Ctor() {\n }", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.73148274", "text": "function Ctor() {}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.73148274", "text": "function Ctor() {}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.7309552", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.7309552", "text": "constructor() {\n\t}", "title": "" }, { "docid": "02f0393a65493fb153c08356ca5048c9", "score": "0.73053944", "text": "function InternalConstructor() {}", "title": "" }, { "docid": "02f0393a65493fb153c08356ca5048c9", "score": "0.73053944", "text": "function InternalConstructor() {}", "title": "" }, { "docid": "faa21726fbbc15216623fac4732a41a4", "score": "0.72935265", "text": "constructor()\n {\n }", "title": "" }, { "docid": "f6bc61f1bfb794c8c7808b5f06089cd1", "score": "0.7287028", "text": "constructor() {\r\n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.7269696", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.7212017", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.7212017", "text": "constructor() {\n\n\t}", "title": "" } ]
96fb56f913d22b794164829dda9e7279
These helpers produce better VM code in JS engines due to their explicitness and function inlining.
[ { "docid": "642587c0dffe8f20c966f94f9796cfbb", "score": "0.0", "text": "function isUndef (v) {\n return v === undefined || v === null\n}", "title": "" } ]
[ { "docid": "a6ec7b9beab46f2da82696e5eeff7b35", "score": "0.59664285", "text": "function foo() {\n 'use asm';\n function bar() {\n return -1e-15;\n }\n return {bar: bar};\n}", "title": "" }, { "docid": "9bf7cce98f0cc86a613e0f909807316f", "score": "0.59073234", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o0 = {o1:1, o2: 2};\n //views\n var o14 = o0.o1(\"ES6ArrayUseConstructor_helper.js\",\"samethread\");\n\n function o4(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "922f7a7639b8920536cea4b5b9d81c36", "score": "0.5788862", "text": "function test5()\r\n{\r\n function func1() {}\r\n var ary = new Array(10);\r\n var obj1 = {};\r\n var func0 = function(argArr91,argMath92){}\r\n function leaf() { return 100; };\r\n var arrObj0 = {};\r\n var obj0 = {};\r\n\r\n func1(obj1, leaf, ((arrObj0[(((454028936 >= 0 ? 454028936 : 0)) & 0XF)] instanceof ((typeof Object == 'function' ) ? Object : Object)) >= ary[(0)]), (((arrObj0[(((454028936 >= 0 ? 454028936 : 0)) & 0XF)] instanceof ((typeof Object == 'function' ) ? Object : Object)) < ary[(0)]) < (arrObj0[(((454028936 >= 0 ? 454028936 : 0)) & 0XF)] instanceof ((typeof Object == 'function' ) ? Object : Object)))); \r\n\r\n if (runningJITtedCode)\r\n {\r\n obj1.prop0=arrObj0[(6)];\r\n }\r\n \r\n return (~ (func0.call(arrObj0 , obj0, arrObj0, leaf, obj0) != func0.call(obj0 , obj1, arrObj0, leaf, obj0)));\r\n}", "title": "" }, { "docid": "8e65e13a6d6af213e89dfa268792ab0a", "score": "0.57796174", "text": "function Module() {\n \"use asm\";\n\n function if0() {\n var x = 0;\n x = 0 ? 11 : 12;\n return (x | 0) == 11 | 0;\n }\n\n function if1() {\n var x = 0;\n x = 1 ? 13 : 14;\n return (x | 0) == 13 | 0;\n }\n\n function if2() {\n var x = 0;\n x = 0 ? 15 : 16;\n return (x | 0) != 15 | 0;\n }\n\n function if3() {\n var x = 0;\n x = 1 ? 17 : 18;\n return (x | 0) != 17 | 0;\n }\n\n function if4() {\n var x = 0;\n var y = 0;\n x = 0 ? 19 : 20;\n y = (x | 0) == 19 ? 21 : 22;\n return y | 0;\n }\n\n function if5() {\n var x = 0;\n var y = 0;\n x = 1 ? 23 : 24;\n y = (x | 0) == 23 ? 25 : 26;\n return y | 0;\n }\n\n function if6() {\n var x = 0;\n var y = 0;\n var z = 0;\n x = 0 ? 27 : 28;\n y = (x | 0) == 27 ? 29 : 30;\n z = (y | 0) == 29 ? 31 : 32;\n return z | 0;\n }\n\n function if7() {\n var x = 0;\n var y = 0;\n var z = 0;\n var w = 0;\n x = 1 ? 33 : 34;\n y = (x | 0) == 33 ? 35 : 36;\n z = (y | 0) == 35 ? 37 : 38;\n w = (z | 0) == 37 ? 39 : 40;\n return w | 0;\n }\n\n function if8() {\n var w = 0;\n var x = 0;\n var y = 0;\n var z = 0;\n\n if (0) {\n x = 0 ? 43 : 44;\n y = (x | 0) == 43 ? 45 : 46;\n z = (y | 0) == 45 ? 47 : 48;\n w = (z | 0) == 47 ? 49 : 50;\n } else {\n x = 1 ? 53 : 54;\n y = (x | 0) == 53 ? 55 : 56;\n z = (y | 0) == 55 ? 57 : 58;\n w = (z | 0) == 57 ? 59 : 60;\n }\n\n return w | 0;\n }\n\n return {\n if0: if0,\n if1: if1,\n if2: if2,\n if3: if3,\n if4: if4,\n if5: if5,\n if6: if6,\n if7: if7,\n if8: if8\n };\n}", "title": "" }, { "docid": "23072403cc4a74335e0402f4b5491228", "score": "0.57722735", "text": "function __ZNSt3__112_GLOBAL__N_14makeINS_7collateIcEEjEERT_T0_($a0) {\n var label = 0;\n label = 1; \n while(1) switch(label) {\n case 1: \n var $1;\n var $2;\n var $3;\n var $4;\n var $5;\n var $6;\n var $7;\n var $8;\n var $9;\n $9=$a0;\n if (0) { var $28 = 0;label = 3; break; } else { label = 2; break; }\n case 2: \n var $11=$9;\n $7=4336;\n $8=$11;\n var $12=$7;\n var $13=$8;\n $5=$12;\n $6=$13;\n var $14=$5;\n var $15=$14;\n var $16=$6;\n $3=$15;\n $4=$16;\n var $17=$3;\n var $18=$17;\n var $19=$4;\n var $20=((($19)-(1))|0);\n $1=$18;\n $2=$20;\n var $21=$1;\n var $22=$21;\n SAFE_HEAP_STORE($22, ((7336)|0), \"i8**\", 0);\n var $23=(($21+4)|0);\n var $24=$2;\n SAFE_HEAP_STORE($23, $24, \"i32\", 0);\n var $25=$17;\n SAFE_HEAP_STORE($25, ((6680)|0), \"i8**\", 0);\n var $26=$14;\n SAFE_HEAP_STORE($26, ((6416)|0), \"i8**\", 0);\n var $28 = 4336;label = 3; break;\n case 3: \n var $28;\n return 4336;\n default: assert(0, \"bad label: \" + label);\n }\n}", "title": "" }, { "docid": "db83fbda691792dc6265dce4af981ce8", "score": "0.57640594", "text": "getWasm() {\n\t\t//identify every predefined and imported function before compiling begins\n\t\tconst importedFuncs = [];\n\t\tconst predefinedFuncs = [];\n\n\t\tfunction noticePredefinedFunc(func) {\n\t\t\tif (!predefinedFuncs.includes(func)) {\n\t\t\t\tpredefinedFuncs.push(func);\n\n\t\t\t\tfor (const dependency of func.dependencies) {\n\t\t\t\t\tif (dependency.constructor === ImportedFunc) {\n\t\t\t\t\t\tif (!importedFuncs.includes(dependency)) {\n\t\t\t\t\t\t\timportedFuncs.push(dependency);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//this assumes that dependencies are not recursive\n\t\t\t\t\t\tif (!predefinedFuncs.includes(dependency)) {\n\t\t\t\t\t\t\tpredefinedFuncs.push(dependency);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let row = 0; row < this.lineCount; ++row) {\n\t\t\tfor (const item of this.lines[row].items) {\n\t\t\t\tif (item.constructor === FuncRef) {\n\t\t\t\t\tif (item.funcDef.constructor === ImportedFunc) {\n\t\t\t\t\t\tlet func = item.funcDef;\n\t\t\t\t\t\tif (func === BuiltIns.PRINTLN) {\n\t\t\t\t\t\t\tif (!importedFuncs.includes(BuiltIns.PRINT_CHAR)) {\n\t\t\t\t\t\t\t\timportedFuncs.push(BuiltIns.PRINT_CHAR);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfunc = BuiltIns.PRINT;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (func !== BuiltIns.PRINT) {\n\t\t\t\t\t\t\tif (!importedFuncs.includes(func)) {\n\t\t\t\t\t\t\t\timportedFuncs.push(func);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//assume PRINT call appears as the first item in a line\n\t\t\t\t\t\t\tconst itemCount = this.getItemCount(row);\n\t\t\t\t\t\t\tfor (let col = 2; col < itemCount; ++col) {\n\t\t\t\t\t\t\t\tconst [start, end] = this.getExpressionBounds(row, col);\n\t\t\t\t\t\t\t\tconst argType = this.getExpressionType(row, start, end);\n\t\t\t\t\t\t\t\tconst implementation = getPrintImplementation(argType);\n\n\t\t\t\t\t\t\t\tif (implementation.constructor === ImportedFunc) {\n\t\t\t\t\t\t\t\t\tif (!importedFuncs.includes(implementation)) {\n\t\t\t\t\t\t\t\t\t\timportedFuncs.push(implementation);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnoticePredefinedFunc(implementation);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcol = end;\n\t\t\t\t\t\t\t\tif (this.getItem(row, col) === BuiltIns.ARG_SEPARATOR) {\n\t\t\t\t\t\t\t\t\tif (!importedFuncs.includes(BuiltIns.PRINT_CHAR)) {\n\t\t\t\t\t\t\t\t\t\timportedFuncs.push(BuiltIns.PRINT_CHAR);\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\telse if (item.funcDef.constructor === PredefinedFunc) {\n\t\t\t\t\t\tnoticePredefinedFunc(func);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet mainFunc = [];\n\n\t\tconst callStack = [];\n\t\tconst expression = [];\n\t\tconst localVarMapping = []; //maps local var indexes to TouchScript vars\n\t\tlet lvalueType, lvalueLocalIndex;\n\t\tconst endOfLineInstructions = [];\n\t\tconst endOfScopeData = [];\n\n\t\tfunction insertPrecondition(wasmCode) {\n\t\t\t//The wasmCode array has code that produces a start value and an end value on the\n\t\t\t//operand stack, then a comparison opcode, then an increment opcode (typed add or sub).\n\t\t\t//Backup the comparison opcode for the break condition and the increment opcode for\n\t\t\t//the end of the loop body, then the start and stop values.;\n\t\t\tconst lvar = localVarMapping[lvalueLocalIndex];\n\n\t\t\t//create a new local var with the same type as the looping var to hold the end value\n\t\t\tconst endValLocalIndex = localVarMapping.length;\n\t\t\tlocalVarMapping.push(new VarDef(\"inc\", lvar.type, { id: -1 }));\n\n\t\t\tconst comparisonOpcode = wasmCode.pop();\n\n\t\t\tmainFunc.push(...wasmCode);\n\t\t\tendOfLineInstructions.push(Wasm.set_local, endValLocalIndex);\n\t\t\tendOfLineInstructions.push(Wasm.set_local, lvalueLocalIndex);\n\n\t\t\tendOfLineInstructions.push(Wasm.block, WasmTypes.void);\n\t\t\tendOfLineInstructions.push(Wasm.loop, WasmTypes.void);\n\n\t\t\tendOfLineInstructions.push(Wasm.get_local, lvalueLocalIndex);\n\t\t\tendOfLineInstructions.push(Wasm.get_local, endValLocalIndex);\n\t\t\tendOfLineInstructions.push(comparisonOpcode, Wasm.i32_eqz);\n\t\t\tendOfLineInstructions.push(Wasm.br_if, 1);\n\t\t}\n\n\t\tconst topOfStack = 2 ** 15;\n\t\tconst initialData = [];\n\n\t\tfor (let row = 0, endRow = this.lineCount; row < endRow; ++row) {\n\t\t\tlvalueType = BuiltIns.VOID;\n\t\t\tlvalueLocalIndex = -1;\n\n\t\t\tif (row > 0) {\n\t\t\t\tlet scopeDrop = this.getIndent(row - 1) - this.getIndent(row);\n\t\t\t\tif (this.getItem(row, 0) === BuiltIns.ELSE) {\n\t\t\t\t\t--scopeDrop;\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < scopeDrop; ++i) {\n\t\t\t\t\tconst scopeData = endOfScopeData.pop();\n\t\t\t\t\tmainFunc.push(...scopeData.wasmCode);\n\t\t\t\t\tmainFunc.push(...Array(scopeData.blockCount).fill(Wasm.end));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let col = 0, endCol = this.getItemCount(row); col < endCol; ++col) {\n\t\t\t\tconst item = this.getItem(row, col);\n\n\t\t\t\tswitch (item.constructor) {\n\t\t\t\t\tcase VarDef: {\n\t\t\t\t\t\texpression.push(new LocalVarReference(localVarMapping.length, item));\n\t\t\t\t\t\tlocalVarMapping.push(item);\n\t\t\t\t\t} break;\n\n\t\t\t\t\tcase VarRef: {\n\t\t\t\t\t\tconst localIndex = localVarMapping.findIndex(localVar => localVar === item.varDef);\n\t\t\t\t\t\tif (localIndex === -1) {\n\t\t\t\t\t\t\tthrow \"var\" + value + \" is referenced before it is declared\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\texpression.push(new LocalVarReference(localIndex, localVarMapping[localIndex]));\n\t\t\t\t\t} break;\n\n\t\t\t\t\tcase FuncRef:\n\t\t\t\t\t\tcallStack.push(item.funcDef);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ArgHint: {\n\t\t\t\t\t\tconst param = item.funcDef.signature.parameters[item.argIndex];\n\t\t\t\t\t\tif (param.default) {\n\t\t\t\t\t\t\tif (param.type === BuiltIns.STRING || param.type === BuiltIns.ANY) {\n\t\t\t\t\t\t\t\tconst bytes = encodePrefixedString(param.default);\n\t\t\t\t\t\t\t\tconst operand = new InternalStringLiteral(initialData.length + topOfStack, bytes.length);\n\t\t\t\t\t\t\t\texpression.push(operand);\n\t\t\t\t\t\t\t\tinitialData.push(...bytes);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\texpression.push(new InternalNumericLiteral(param.default));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} break;\n\n\t\t\t\t\tcase Symbol: {\n\t\t\t\t\t\tconst func = callStack[callStack.length - 1];\n\n\t\t\t\t\t\tif (item.isAssignment) {\n\t\t\t\t\t\t\tconst localVar = expression.pop();\n\t\t\t\t\t\t\tlvalueType = localVar.getType();\n\t\t\t\t\t\t\tlvalueLocalIndex = localVar.index;\n\n\t\t\t\t\t\t\tif (item !== BuiltIns.ASSIGN) {\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.get_local, ...varint(localVar.index));\n\t\t\t\t\t\t\t\tconst { wasmCode, resultType } = item.uses.get(lvalueType);\n\t\t\t\t\t\t\t\tendOfLineInstructions.push(...wasmCode);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tendOfLineInstructions.push(Wasm.set_local, localVar.index);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet wasmCode = [];\n\t\t\t\t\t\tlet expressionType;\n\t\t\t\t\t\tif ((item === BuiltIns.ARG_SEPARATOR || item === BuiltIns.END_ARGS)\n\t\t\t\t\t\t\t&& func.signature.parameters.length > 0) {\n\t\t\t\t\t\t\t//find argument type\n\t\t\t\t\t\t\tlet expectedType = BuiltIns.ANY;\n\t\t\t\t\t\t\tlet funcCallDepth = 0;\n\t\t\t\t\t\t\tlet argumentIndex = 0;\n\t\t\t\t\t\t\tfor (let j = col - 1; j > 0; --j) {\n\t\t\t\t\t\t\t\tconst item = this.getItem(row, j);\n\t\t\t\t\t\t\t\tif (item === BuiltIns.END_ARGS) {\n\t\t\t\t\t\t\t\t\t++funcCallDepth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (item === BuiltIns.ARG_SEPARATOR && funcCallDepth === 0) {\n\t\t\t\t\t\t\t\t\t++argumentIndex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (item === BuiltIns.BEGIN_ARGS) {\n\t\t\t\t\t\t\t\t\tif (funcCallDepth === 0) {\n\t\t\t\t\t\t\t\t\t\tconst func = this.getItem(row, j - 1).funcDef;\n\t\t\t\t\t\t\t\t\t\tif (func === BuiltIns.PRINT || func === BuiltIns.PRINTLN) {\n\t\t\t\t\t\t\t\t\t\t\texpectedType = BuiltIns.ANY;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tconst argumentType = func.signature.parameters[argumentIndex].type;\n\t\t\t\t\t\t\t\t\t\t\texpectedType = argumentType;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t--funcCallDepth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t[expressionType, wasmCode] = compileExpression(expression, expectedType);\n\t\t\t\t\t\t\texpression.length = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmainFunc.push(...wasmCode);\n\n\t\t\t\t\t\t//println and print call system print function on each argument separately\n\t\t\t\t\t\tif (func === BuiltIns.PRINT || func === BuiltIns.PRINTLN) {\n\t\t\t\t\t\t\tif (item === BuiltIns.END_ARGS || item === BuiltIns.ARG_SEPARATOR) {\n\t\t\t\t\t\t\t\t//use specialized printing functions\n\t\t\t\t\t\t\t\tlet funcIndex;\n\t\t\t\t\t\t\t\tconst implementation = getPrintImplementation(expressionType);\n\n\t\t\t\t\t\t\t\tif (implementation.constructor === ImportedFunc) {\n\t\t\t\t\t\t\t\t\tfuncIndex = importedFuncs.indexOf(implementation);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfuncIndex = predefinedFuncs.indexOf(implementation) + importedFuncs.length + 1;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.call, ...varuint(funcIndex));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (item === BuiltIns.ARG_SEPARATOR) {\n\t\t\t\t\t\t\t\t//print ' '\n\t\t\t\t\t\t\t\tmainFunc.push(\n\t\t\t\t\t\t\t\t\tWasm.i32_const, ' '.charCodeAt(),\n\t\t\t\t\t\t\t\t\tWasm.call, ...varuint(importedFuncs.indexOf(BuiltIns.PRINT_CHAR)),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (item === BuiltIns.END_ARGS && func === BuiltIns.PRINTLN) {\n\t\t\t\t\t\t\t\t//print '\\n'\n\t\t\t\t\t\t\t\tmainFunc.push(\n\t\t\t\t\t\t\t\t\tWasm.i32_const, '\\n'.charCodeAt(),\n\t\t\t\t\t\t\t\t\tWasm.call, ...varuint(importedFuncs.indexOf(BuiltIns.PRINT_CHAR)),\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\n\t\t\t\t\t\t//any other function\n\t\t\t\t\t\telse if (item === BuiltIns.END_ARGS) {\n\t\t\t\t\t\t\tif (func.constructor === Macro) {\n\t\t\t\t\t\t\t\tmainFunc.push(...func.wasmCode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (func.constructor === PredefinedFunc) {\n\t\t\t\t\t\t\t\tconst index = predefinedFuncs.indexOf(func);\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.call, ...varuint(index + importedFuncs.length + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (func.constructor === ImportedFunc) {\n\t\t\t\t\t\t\t\tconst index = importedFuncs.indexOf(func);\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.call, ...varuint(index));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (func.signature.returnType !== BuiltIns.VOID) {\n\t\t\t\t\t\t\t\texpression.push(new Placeholder(func.signature.returnType)); //TODO place wasm code of function call as 2nd argument\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (item === BuiltIns.END_ARGS) {\n\t\t\t\t\t\t\tcallStack.pop()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (![BuiltIns.ARG_SEPARATOR, BuiltIns.BEGIN_ARGS, BuiltIns.END_ARGS].includes(item) && !item.isAssignment) {\n\t\t\t\t\t\t\texpression.push(item);\n\t\t\t\t\t\t}\n\t\t\t\t\t} break;\n\n\t\t\t\t\tcase Keyword: {\n\t\t\t\t\t\tswitch (item) {\n\t\t\t\t\t\t\tcase BuiltIns.IF: {\n\t\t\t\t\t\t\t\tlvalueType = BuiltIns.BOOL;\n\t\t\t\t\t\t\t\tendOfLineInstructions.push(Wasm.if, WasmTypes.void);\n\t\t\t\t\t\t\t\tendOfScopeData.push({ wasmCode: [] });\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.ELSE: {\n\t\t\t\t\t\t\t\tendOfLineInstructions.push(Wasm.else);\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.WHILE: {\n\t\t\t\t\t\t\t\tlvalueType = BuiltIns.BOOL;\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.block, WasmTypes.void, Wasm.loop, WasmTypes.void);\n\t\t\t\t\t\t\t\tendOfLineInstructions.push(Wasm.i32_eqz, Wasm.br_if, 1);\n\t\t\t\t\t\t\t\tendOfScopeData.push({ wasmCode: [Wasm.br, 0], isBranchable: true, blockCount: 2 });\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.DO_WHILE: {\n\t\t\t\t\t\t\t\tlvalueType = BuiltIns.BOOL;\n\t\t\t\t\t\t\t\tmainFunc.push(Wasm.block, WasmTypes.void, Wasm.loop, WasmTypes.void);\n\t\t\t\t\t\t\t\tendOfScopeData.push({ wasmCode: [Wasm.br_if, 0], isBranchable: true, blockCount: 2 });\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.BREAK: {\n\t\t\t\t\t\t\t\tlet requestedDepth = 1;\n\n\t\t\t\t\t\t\t\tif (this.getItemCount(row) >= 2) {\n\t\t\t\t\t\t\t\t\tconst { value } = this.getData(row, col + 1);\n\t\t\t\t\t\t\t\t\trequestedDepth = +this.literals.get(value);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//branch depth must be 1 over the depth of the loop to break out rather than repeat\n\t\t\t\t\t\t\t\tlet depthTraveled = 1;\n\t\t\t\t\t\t\t\tfor (let i = endOfScopeData.length - 1; i >= 0; --i) {\n\t\t\t\t\t\t\t\t\tif (endOfScopeData[i].isBranchable && --requestedDepth <= 0) {\n\t\t\t\t\t\t\t\t\t\tmainFunc.push(Wasm.br, depthTraveled);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t++depthTraveled;\n\t\t\t\t\t\t\t\t\tif (endOfScopeData[i].isBranchable) {\n\t\t\t\t\t\t\t\t\t\t++depthTraveled;\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\tcol = 1000; //do not attempt to write any expression using the rest of this line\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.CONTINUE: {\n\t\t\t\t\t\t\t\tlet requestedDepth = 1;\n\n\t\t\t\t\t\t\t\tif (this.getItemCount(row) >= 2) {\n\t\t\t\t\t\t\t\t\trequestedDepth = this.getItem(row, 1).loopLayers;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlet depthTraveled = 0;\n\t\t\t\t\t\t\t\t//work backward through the scopes until we find one that is branchable\n\t\t\t\t\t\t\t\tfor (let i = endOfScopeData.length - 1; i >= 0; --i) {\n\t\t\t\t\t\t\t\t\tconst scopeData = endOfScopeData[i];\n\t\t\t\t\t\t\t\t\tif (scopeData.isBranchable && --requestedDepth <= 0) {\n\t\t\t\t\t\t\t\t\t\t//slice off the depth of the branch instruction and use our own\n\t\t\t\t\t\t\t\t\t\tmainFunc.push(...scopeData.wasmCode.slice(0, -1), depthTraveled);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t++depthTraveled;\n\t\t\t\t\t\t\t\t\tif (scopeData.isBranchable) {\n\t\t\t\t\t\t\t\t\t\t++depthTraveled;\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\tcol = 1000; //do not attempt to write any expression using the rest of this line\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.IN: {\n\t\t\t\t\t\t\t\tconst localVar = expression.pop(); //consume the looping variable reference\n\t\t\t\t\t\t\t\tlvalueType = localVar.getType();\n\t\t\t\t\t\t\t\tlvalueLocalIndex = localVar.index;\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t\tcase BuiltIns.STEP: { //part of a for loop\n\t\t\t\t\t\t\t\tconst [, wasmCode] = compileExpression(expression, lvalueType);\n\t\t\t\t\t\t\t\texpression.length = 0;\n\t\t\t\t\t\t\t\tconst incrementOpcode = wasmCode.pop();\n\n\t\t\t\t\t\t\t\tconst lvar = localVarMapping[lvalueLocalIndex];\n\t\t\t\t\t\t\t\tconst stepSizeLocalIndex = localVarMapping.length;\n\t\t\t\t\t\t\t\tlocalVarMapping.push(new VarDef(\"inc\", lvar.type, { id: -1 }));\n\n\t\t\t\t\t\t\t\tendOfLineInstructions.push(Wasm.set_local, stepSizeLocalIndex);\n\n\t\t\t\t\t\t\t\tendOfScopeData.push({\n\t\t\t\t\t\t\t\t\twasmCode: [\n\t\t\t\t\t\t\t\t\t\tWasm.get_local, lvalueLocalIndex,\n\t\t\t\t\t\t\t\t\t\tWasm.get_local, stepSizeLocalIndex,\n\t\t\t\t\t\t\t\t\t\tincrementOpcode,\n\t\t\t\t\t\t\t\t\t\tWasm.set_local, lvalueLocalIndex,\n\t\t\t\t\t\t\t\t\t\tWasm.br, 0,\n\t\t\t\t\t\t\t\t\t], isBranchable: true, blockCount: 2\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tinsertPrecondition(wasmCode);\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} break;\n\n\t\t\t\t\tcase BooleanLiteral:\n\t\t\t\t\t\texpression.push(new Placeholder(BuiltIns.BOOL, Wasm.i32_const, item.value | 0));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase StringLiteral:\n\t\t\t\t\t\tconst stringLiteral = item.text.replace(/\\\\n/g, \"\\n\");\n\t\t\t\t\t\tconst bytes = encodeString(stringLiteral);\n\t\t\t\t\t\tconst operand = new InternalStringLiteral(initialData.length + topOfStack, bytes.length);\n\t\t\t\t\t\texpression.push(operand);\n\t\t\t\t\t\tinitialData.push(...bytes);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase NumericLiteral:\n\t\t\t\t\t\texpression.push(new InternalNumericLiteral(item.text));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//end of line delimits expression\n\t\t\tif (expression.length > 0) {\n\t\t\t\tconst [, wasmCode] = compileExpression(expression, lvalueType);\n\t\t\t\texpression.length = 0;\n\t\t\t\tconst firstItem = this.getItem(row, 0);\n\n\t\t\t\tif (firstItem === BuiltIns.DO_WHILE) {\n\t\t\t\t\t//move the expression to right before the conditional loop branch\n\t\t\t\t\tendOfScopeData[endOfScopeData.length - 1].wasmCode.unshift(...wasmCode);\n\t\t\t\t} else if (firstItem === BuiltIns.FOR) {\n\t\t\t\t\tif (!this.lines[row].items.includes(BuiltIns.STEP)) {\n\t\t\t\t\t\tconst incrementOpcode = wasmCode.pop();\n\t\t\t\t\t\tinsertPrecondition(wasmCode)\n\n\t\t\t\t\t\t//if the step size is not specified, use the numeric literal \"1\"\n\t\t\t\t\t\tconst constStep = (new InternalNumericLiteral(\"1\")).getWasmCode(lvalueType);\n\n\t\t\t\t\t\tendOfScopeData.push({\n\t\t\t\t\t\t\twasmCode: [\n\t\t\t\t\t\t\t\tWasm.get_local, lvalueLocalIndex,\n\t\t\t\t\t\t\t\t...constStep,\n\t\t\t\t\t\t\t\tincrementOpcode,\n\t\t\t\t\t\t\t\tWasm.set_local, lvalueLocalIndex,\n\t\t\t\t\t\t\t\tWasm.br, 0,\n\t\t\t\t\t\t\t], isBranchable: true, blockCount: 2\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmainFunc.push(...wasmCode);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmainFunc.push(...wasmCode);\n\t\t\t\t\tif (endOfLineInstructions.length === 0) {\n\t\t\t\t\t\tmainFunc.push(Wasm.drop);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (endOfLineInstructions.length > 0) {\n\t\t\t\tmainFunc.push(...endOfLineInstructions);\n\t\t\t\tendOfLineInstructions.length = 0;\n\t\t\t}\n\t\t}\n\n\t\twhile (endOfScopeData.length > 0) {\n\t\t\tconst scopeData = endOfScopeData.pop();\n\t\t\tmainFunc.push(...scopeData.wasmCode);\n\t\t\tmainFunc.push(...Array(scopeData.blockCount).fill(Wasm.end));\n\t\t}\n\n\t\tconst localVarDefinition = [];\n\n\t\t//collapses paramaters of the same type that are next to each other\n\t\tlet localEntriesCount = 0;\n\t\tfor (let i = 0; i < localVarMapping.length;) {\n\t\t\tconst local = localVarMapping[i];\n\t\t\tconst types = getWasmTypes(local.type);\n\t\t\tconst type = types[0];\n\t\t\tlet count = 0;\n\t\t\twhile (i < localVarMapping.length && getWasmTypes(localVarMapping[i].type)[0] === type) {\n\t\t\t\tcount += types.length;\n\t\t\t\t++i;\n\t\t\t}\n\t\t\tlocalVarDefinition.push(count, type);\n\t\t\t++localEntriesCount;\n\t\t}\n\n\t\tlocalVarDefinition.unshift(\n\t\t\t...varuint(localEntriesCount), //count of local entries (count and type pairs, not total locals)\n\t\t)\n\n\t\tmainFunc = [...localVarDefinition, ...mainFunc, Wasm.end];\n\n\t\t//figure out which function signatures we need to define\n\t\tconst signatures = [{\n\t\t\treturnType: WasmTypes.void,\n\t\t\tparameterTypes: [],\n\t\t}];\n\n\t\tfunction getSignature(func) {\n\t\t\tconst paramTypes = [];\n\n\t\t\tfor (const param of func.signature.parameters) {\n\t\t\t\tparamTypes.push(...getWasmTypes(param.type))\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\treturnType: getWasmTypes(func.signature.returnType)[0], //TODO support String return types\n\t\t\t\tparameterTypes: paramTypes,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Return true if the parameter signature matches the signature bound to this\n\t\t * @param signature Current wasm signature being tested\n\t\t */\n\t\tfunction findCallack(signature) {\n\t\t\tif (signature.returnType !== this.returnType) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (signature.parameterTypes.length !== this.parameterTypes.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < signature.parameterTypes.length; ++i) {\n\t\t\t\tif (signature.parameterTypes[i] !== this.parameterTypes[i]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n\t\tfor (const func of [...importedFuncs, ...predefinedFuncs]) {\n\t\t\tconst signature = getSignature(func);\n\n\t\t\tif (!signatures.find(findCallack, signature)) {\n\t\t\t\tsignatures.push(signature);\n\t\t\t}\n\t\t}\n\n\t\tconst getTypeIndex = (func) => {\n\t\t\tconst signature = getSignature(func);\n\t\t\treturn signatures.findIndex(findCallack, signature);\n\t\t}\n\n\n\t\tconst typeSection = [\n\t\t\t...varuint(signatures.length), //count of type entries\n\t\t];\n\t\tfor (const signature of signatures) {\n\t\t\tconst wasmReturnTypes = [];\n\t\t\tif (signature.returnType !== WasmTypes.void) {\n\t\t\t\twasmReturnTypes.push(signature.returnType);\n\t\t\t}\n\n\t\t\ttypeSection.push(WasmTypes.func);\n\t\t\ttypeSection.push(signature.parameterTypes.length, ...signature.parameterTypes);\n\t\t\ttypeSection.push(wasmReturnTypes.length, ...wasmReturnTypes);\n\t\t}\n\n\t\tlet importSection = [\n\t\t\t...varuint(importedFuncs.length + 1), //count of things to import\n\n\t\t\t...encodePrefixedString(\"env\"),\n\t\t\t...encodePrefixedString(\"memory\"),\n\t\t\texternalKind.Memory,\n\t\t\t0, //flag that max pages is not specified\n\t\t\t...varuint(1), //initially 1 page allocated\n\t\t]\n\n\t\tfor (const func of importedFuncs) {\n\t\t\timportSection.push(\n\t\t\t\t...encodePrefixedString(func.moduleName),\n\t\t\t\t...encodePrefixedString(func.fieldName),\n\t\t\t\texternalKind.Function,\n\t\t\t\t...varuint(getTypeIndex(func)),\n\t\t\t);\n\t\t}\n\n\t\tlet functionSection = [\n\t\t\t...varuint(predefinedFuncs.length + 1), //count of function bodies defined later\n\t\t\t...varuint(0), //type indicies (func signitures)\n\t\t];\n\n\t\tfor (const func of predefinedFuncs) {\n\t\t\tfunctionSection.push(getTypeIndex(func));\n\t\t}\n\n\t\t// let exportSection = [\n\t\t// ...varuint(0), //count of exports\n\n\t\t// ...wasm.getStringBytesAndData(\"init\"), //length and bytes of function name\n\t\t// externalKind.Function, //export type\n\t\t// ...varuint(importedFunctionsCount), //exporting entry point function\n\t\t// ];\n\n\t\tlet codeSection = [\n\t\t\t...varuint(predefinedFuncs.length + 1), //count of functions to define\n\t\t\t...varuint(mainFunc.length),\n\t\t\t...mainFunc,\n\t\t];\n\n\t\tfor (const func of predefinedFuncs) {\n\t\t\t//replace references to dependencies with the index assigned to that function\n\t\t\tconst compiledCode = [];\n\t\t\tfor (const item of func.wasmCode) {\n\t\t\t\tif (item.constructor === ImportedFunc) {\n\t\t\t\t\tconst funcIndex = importedFuncs.indexOf(item);\n\t\t\t\t\tcompiledCode.push(...varuint(funcIndex));\n\t\t\t\t}\n\t\t\t\telse if (item.constructor === PredefinedFunc) {\n\t\t\t\t\tconst funcIndex = importedFuncs.length + 1 + predefinedFuncs.indexOf(item);\n\t\t\t\t\tcompiledCode.push(...varuint(funcIndex));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcompiledCode.push(item);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcodeSection.push(\n\t\t\t\t...varuint(compiledCode.length),\n\t\t\t\t...compiledCode\n\t\t\t);\n\t\t}\n\n\t\tconst globalSection = [\n\t\t\t1, //1 global\n\t\t\tWasmTypes.i32, 1, //1 global of type i32\n\t\t\tWasm.i32_const, ...varuint(topOfStack), Wasm.end, //initialized to stop of stack\n\t\t];\n\n\t\tconst wasmModule = [\n\t\t\t0x00, 0x61, 0x73, 0x6d, //magic numbers\n\t\t\t0x01, 0x00, 0x00, 0x00, //wasm version\n\n\t\t\tsection.Type,\n\t\t\t...varuint(typeSection.length), //size in bytes of section\n\t\t\t...typeSection,\n\n\t\t\tsection.Import,\n\t\t\t...varuint(importSection.length),\n\t\t\t...importSection,\n\n\t\t\tsection.Function,\n\t\t\t...varuint(functionSection.length),\n\t\t\t...functionSection,\n\n\t\t\tsection.Global,\n\t\t\t...varuint(globalSection.length),\n\t\t\t...globalSection,\n\n\t\t\t// section.Export,\n\t\t\t// ...varuint(exportSection.length),\n\t\t\t// ...exportSection,\n\n\t\t\tsection.Start,\n\t\t\t[...varuint(importedFuncs.length)].length,\n\t\t\t...varuint(importedFuncs.length), //the start function is the first function after the imports\n\n\t\t\tsection.Code,\n\t\t\t...varuint(codeSection.length),\n\t\t\t...codeSection,\n\t\t];\n\n\t\tif (initialData.length > 0) {\n\t\t\tconst dataSection = [\n\t\t\t\t1, //1 data segment\n\n\t\t\t\t0, //memory index 0\n\t\t\t\tWasm.i32_const, ...varuint(topOfStack), Wasm.end, //fill memory after stack\n\t\t\t\t...varuint(initialData.length), //count of bytes to fill in\n\t\t\t\t...initialData,\n\t\t\t];\n\n\t\t\twasmModule.push(\n\t\t\t\tsection.Data,\n\t\t\t\t...varuint(dataSection.length),\n\t\t\t\t...dataSection,\n\t\t\t)\n\t\t}\n\n\t\treturn (new Uint8Array(wasmModule)).buffer;\n\t}", "title": "" }, { "docid": "0cd500e2f72f4ec5ca805728346b21c2", "score": "0.5749348", "text": "function Module() {\n \"use asm\";\n function f() {\n var i = (140737463189505);\n do {\n i = i + i | 0;\n x = undefined + i | 0;\n } while (!i);\n }\n return { f: f };\n}", "title": "" }, { "docid": "6778f4f3d4682dd67e91bad9436040e9", "score": "0.5720137", "text": "function o0(o9,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o35 = o1 = [];\n //views\n function o0() {\n try {\n'use strict';\n}catch(e){}\n try {\ntry {\n var o1 = {};\n var o2 = new Array(10);\n try {\no1.length = 1;\n}catch(e){}\n var o3 = 0;\n try {\nwhile ((1) && o3 < 3) {\n try {\no3++;\n}catch(e){}\n try {\no2.length = -804513990;\n}catch(e){}\n }\n}catch(e){}\n //Snippet 3: fewer arguments than formal parameters\n try {\no1.length = (function (o4, o5, o6, o7, o8) {\n try {\no9 *= o1.o10;\n}catch(e){}\n var o11 = o4 + o5 + o6 + o7 + o8;\n try {\nreturn o11 + o2[(1)];\n}catch(e){}\n })(1, 1, 1);\n}catch(e){}\n }\n catch(o9) {\n try {\no12.o13(o9);\n}catch(e){}\n }\n}catch(e){}\n};\n\n var o733 = 0\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "41879bb8fe324b52ee81f92701b5201f", "score": "0.57197374", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\";\n function f1(i) {\n i = i | 0;\n return (i >>> 0) / 3 | 0;\n }\n function f2(i) {\n i = i | 0;\n return (i >>> 0) / 17 | 0;\n }\n function f3(i) {\n i = i | 0;\n return (i >>> 0) / 1024 | 0;\n }\n function f4(i) {\n i = i | 0;\n return (i >>> 0) / 3343330 | 0;\n }\n return { f1: f1, f2: f2, f3: f3, f4: f4 };\n}", "title": "" }, { "docid": "47bd9deda0a682ed5ed4d64714a1063a", "score": "0.5714222", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o56 = stdlib.o598.o114;\n //views\n var o869 = o25.next();\n\n function o4(){\n var o39 = Symbol('symbol 2')\n function write(o0) { try {\no1.o2(o0 + \"\");\n}catch(e){} };\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "4494a25b53eb29e5a186102b7456c1d9", "score": "0.57138807", "text": "function foo() {\n \"use asm\";\n function bar() {}\n return {bar: bar};\n}", "title": "" }, { "docid": "5568b0470a7547a63ee0ed66fa265503", "score": "0.5666262", "text": "function unsafeIntrinsics(func) {\n t0 = __uasm.add32(1, 2);\n t1 = __uasm.mul32(42, 7);\n return t0 + t1;\n}", "title": "" }, { "docid": "f477b9e23479ca227ac18961e44f75f6", "score": "0.5628282", "text": "function v8(v9) {\n function v10(v11,v12) {\n function v13(v14,v15) {\n const v16 = -65535;\n // v16 = .integer\n const v17 = 100;\n // v17 = .integer\n const v22 = {b:4677756};\n // v22 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\"])\n const v23 = {b:v22};\n // v23 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\"])\n const v24 = [13.37,13.37];\n // v24 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v26 = [1337,1337,1337];\n // v26 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v27 = [4294967297,v24,v26,Function,Function];\n // v27 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v28 = {a:v27,c:Function,length:1337,toString:1337,valueOf:Function};\n // v28 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"valueOf\", \"a\", \"c\", \"toString\", \"length\"])\n const v29 = {__proto__:v26,a:v28,b:v26,c:v23,constructor:4294967297,d:v28,valueOf:v24};\n // v29 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"c\", \"valueOf\", \"b\", \"d\", \"constructor\", \"a\"])\n const v30 = 1;\n // v30 = .integer\n let v33 = 13.37;\n function v34(v35,v36) {\n function v37(v38,v39) {\n function v40(v41,v42) {\n const v44 = Symbol.toPrimitive;\n // v44 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n v9[v44] = v10;\n const v45 = 100;\n // v45 = .integer\n const v46 = 1;\n // v46 = .integer\n }\n const v48 = 100;\n // v48 = .integer\n const v49 = 1;\n // v49 = .integer\n const v50 = v40(v40,\"4x1rRJyrZc\");\n // v50 = .unknown\n const v51 = 65537;\n // v51 = .integer\n const v52 = 1;\n // v52 = .integer\n }\n const v55 = Symbol(2152962827);\n // v55 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v56 = v37(v37,v33);\n // v56 = .unknown\n }\n const v57 = v34(v34,Function);\n // v57 = .unknown\n const v58 = v7 & v10;\n // v58 = .integer | .bigint\n }\n const v60 = new Promise(v13);\n // v60 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n return Promise;\n }\n const v62 = new Promise(v10);\n // v62 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "742bae9c6eea3acebb0207cd98a94ca3", "score": "0.56168497", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\no2 = +o2;\n}catch(e){}\n try {\nMath.cbrt = +o3;\n}catch(e){}\n try {\nreturn !(new Int32Array(1)['set']);\n}catch(e){}\n }\n \n function o4(o2,o3){\n try {\no2 = +o2;\n}catch(o390){}\n try {\no3 = +o3;\n}catch(e){}\n var o5 = 0.0;\n var o6 = o1;\n try {\no5 = NaN >= new Number(Number.o4);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn this.o497;\n}catch(e){}\n}", "title": "" }, { "docid": "69efabf306130317d57a7d1f6ccd9615", "score": "0.55784446", "text": "function foo(s) {\n %DeoptimizeFunction(bar);\n var x = 12;\n return s + x;\n}", "title": "" }, { "docid": "66e1837692a742f39959ff9def1eb253", "score": "0.55638874", "text": "function o0(stdlib,o1,call) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\nthis.o155[0xFF55] = 0xFF;\n}catch(e){}\n try {\no502.o508 = +o3;\n}catch(e){}\n try {\nreturn +(o2+o3);\n}catch(e){}\n }\n \n function o4(o29,o3){\n try {\no2 = +o2;\n}catch(e){}\n try {\no3 = +o3;\n}catch(e){}\n var o5 = 0.0;\n var o6 = 1;\n try {\no25.next = NaN >= new Number(Number.String);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,o2,add,add];\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "767c991259da595eaf921345eed5cdf0", "score": "0.55511653", "text": "function __js_main(){var params=new CmdParams();params.collect();var o=new CompilerInterface();o.run(params);}", "title": "" }, { "docid": "bdfa35073bff32f8fe9c58426dcb7d35", "score": "0.5548934", "text": "function v13(v14) {\n function v16(v17,v18) {\n function v20(v21,v22) {\n const v23 = -857902123;\n // v23 = .integer\n const v25 = [1678101740,1678101740,1678101740];\n // v25 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v26 = v14.__proto__;\n // v26 = .unknown\n const v27 = {e:v25};\n // v27 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"e\"])\n const v28 = 7;\n // v28 = .integer\n const v30 = [1337];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v35(v36,v37) {\n function v39(v40,v41) {\n const v44 = Symbol.match;\n // v44 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v45 = (100).toLocaleString();\n // v45 = .unknown\n let v46 = v30;\n v46 = v44;\n const v47 = v45.split(v46);\n // v47 = .unknown\n const v48 = 0;\n // v48 = .integer\n const v49 = 5;\n // v49 = .integer\n const v50 = 1;\n // v50 = .integer\n const v51 = 0;\n // v51 = .integer\n const v52 = 8;\n // v52 = .integer\n const v53 = 1;\n // v53 = .integer\n return v35;\n }\n const v55 = new Promise(v39);\n // v55 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v56 = 0;\n // v56 = .integer\n const v57 = 8;\n // v57 = .integer\n const v58 = 1;\n // v58 = .integer\n const v60 = \"unicode\".padStart(-65536,v35);\n // v60 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v61 = Function(v60);\n // v61 = .unknown\n const v62 = 785494185n;\n // v62 = .bigint\n with (v60) {\n const v63 = EPSILON;\n // v63 = .unknown\n }\n function v67(v68,v69) {\n for (let v72 = -2.2250738585072014e-308; v72 < 100; v72 = v72 + 1) {\n const v73 = 1 ^ v72;\n // v73 = .integer | .bigint\n const v74 = 1 % v73;\n // v74 = .integer | .float | .bigint\n const v75 = 1;\n // v75 = .integer\n const v76 = 16;\n // v76 = .integer\n const v77 = 1;\n // v77 = .integer\n const v78 = 0;\n // v78 = .integer\n const v79 = 100;\n // v79 = .integer\n const v80 = 1;\n // v80 = .integer\n const v84 = isNaN(13.37);\n // v84 = .boolean\n const v86 = {construct:isNaN,defineProperty:isNaN,deleteProperty:isNaN,get:isNaN,getOwnPropertyDescriptor:isNaN,getPrototypeOf:isNaN,has:isNaN,preventExtensions:isNaN,set:isNaN};\n // v86 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"getPrototypeOf\", \"preventExtensions\", \"defineProperty\", \"deleteProperty\", \"get\", \"getOwnPropertyDescriptor\", \"set\", \"construct\", \"has\"])\n for (let v88 = 0; v88 < 100; v88 = v88 + 1) {\n }\n const v89 = [63455.09052841901,63455.09052841901,63455.09052841901,\"0jb3mmw5pG\"];\n // v89 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n }\n const v90 = v67(undefined,undefined);\n // v90 = .unknown\n return 1337;\n }\n function v91(v92,v93) {\n let v94 = v92;\n const v95 = 100;\n // v95 = .integer\n const v96 = 1;\n // v96 = .integer\n return v94;\n }\n const v97 = 0;\n // v97 = .integer\n const v98 = 1;\n // v98 = .integer\n const v99 = 0;\n // v99 = .integer\n }\n const v101 = \"bPUvyr2kk*\".padStart(1337,v16);\n // v101 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v102 = eval(v101);\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n const v104 = new Promise(v16);\n // v104 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "143a0b23a2be59ae6778312cb99a2bc7", "score": "0.553779", "text": "function MODULE_TEMPLATE(stdlib, foreign, buffer) {\n \"use asm\";\n var imul = stdlib.Math.imul;\n var fround = stdlib.Math.fround;\n var M = new stdlib.Int32Array(buffer);\n var G = 0;\n\n function void_func() {}\n function i32_func(a) {\n a = a | 0;\n return a | 0;\n }\n\n FUNC_DECL\n return {main: main};\n}", "title": "" }, { "docid": "e3c07d7ec35e31fe02e56deeff083230", "score": "0.5521364", "text": "function foo(x) {\n // Two variables holding constants such that the bytecode generation constant folder\n // will not constant fold the division below, but the DFG constant folder will.\n var a = 1;\n var b = 4000;\n // A division that is going to be predicted integer on the first compilation. The\n // compilation will be triggered from the loop below so the slow case counter of the\n // division will be 1, which is too low for the division to be predicted double.\n // If we constant fold this division, we'll have a constant node that is predicted\n // integer but that contains a double. The subsequent addition to x, which is\n // predicted double, will lead the Fixup phase to inject an Int32ToDouble node on\n // the constant-that-was-a-division; subsequent fases in the fixpoint will constant\n // fold that Int32ToDouble. And hence we will have an infinite loop. The correct fix\n // is to disable constant folding of mispredicted nodes; that allows the normal\n // process of correcting predictions (OSR exit profiling, exiting to profiled code,\n // and recompilation with exponential backoff) to take effect so that the next\n // compilation does not make this same mistake.\n var c = (a / b) + x;\n // A pointless loop to force the first compilation to occur before the division got\n // hot. If this loop was not here then the division would be known to produce doubles\n // on the first compilation.\n var d = 0;\n for (var i = 0; i < 1000; ++i)\n d++;\n return c + d;\n}", "title": "" }, { "docid": "615ec4f1dd04492404486a2c14696391", "score": "0.5515462", "text": "function __f_7() {\n %DeoptimizeFunction(__f_5);\n}", "title": "" }, { "docid": "0f18283797259015bd45a5016fd963d5", "score": "0.5444088", "text": "function genLowerFunc(primName)\n{\n return function (compParams)\n {\n // Return the primitive to be inlined\n return compParams.staticEnv.getBinding(primName);\n }\n}", "title": "" }, { "docid": "bc180e578eefec5d2abc083c5b1bd3cf", "score": "0.5443669", "text": "function foo(){ return 1; }", "title": "" }, { "docid": "ad7c4842cd76a58d40e892a8ccb7f00d", "score": "0.54330146", "text": "function asmFunc(env) {\n var buffer = new ArrayBuffer(131072);\n var HEAP8 = new Int8Array(buffer);\n var HEAP16 = new Int16Array(buffer);\n var HEAP32 = new Int32Array(buffer);\n var HEAPU8 = new Uint8Array(buffer);\n var HEAPU16 = new Uint16Array(buffer);\n var HEAPU32 = new Uint32Array(buffer);\n var Math_imul = Math.imul;\n var Math_abs = Math.abs;\n\n // int32\n function add32(x, y) {\n x = x | 0;\n y = y | 0;\n var z = x + y;\n return (z + x) | 0;\n }\n //CHKRA-LABEL: function add32(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.add32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.add32_2] : number, %4 : number, %1 : number\n //CHKRA-NEXT: %6 = ReturnInst %5 : number\n //CHKRA-NEXT: function_end\n\n // uint32\n function add32u(x, y) {\n x = x >>> 0;\n y = y >>> 0;\n var z = x + y;\n return (z + x) | 0;\n }\n //CHKRA-LABEL: function add32u(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = HBCLoadConstInst 0 : number\n //CHKRA-NEXT: %2 = BinaryOperatorInst '>>>', %0, %1 : number\n //CHKRA-NEXT: %3 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %4 = BinaryOperatorInst '>>>', %3, %1 : number\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.add32_2] : number, %2 : number, %4 : number\n //CHKRA-NEXT: %6 = CallIntrinsicInst [__uasm.add32_2] : number, %5 : number, %2 : number\n //CHKRA-NEXT: %7 = ReturnInst %6 : number\n //CHKRA-NEXT: function_end\n\n // int32 adding a literal number in Wasm mode should be treated as int32\n function add32l(x, y) {\n x = x | 0;\n y = y | 0;\n var z = x + y + 42;\n return (10086 + z) | 0;\n }\n //CHKRA-LABEL: function add32l(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = HBCLoadConstInst 10086 : number\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.add32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %6 = HBCLoadConstInst 42 : number\n //CHKRA-NEXT: %7 = CallIntrinsicInst [__uasm.add32_2] : number, %5 : number, %6 : number\n //CHKRA-NEXT: %8 = CallIntrinsicInst [__uasm.add32_2] : number, %4 : number, %7 : number\n //CHKRA-NEXT: %9 = ReturnInst %8 : number\n //CHKRA-NEXT: function_end\n\n function add32lf(x, y) {\n x = x | 0;\n y = y | 0;\n return (((x + y ) | 0) + 4.2) | 0;\n }\n //CHKRA-LABEL: function add32lf(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.add32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = HBCLoadConstInst 4.2 : number\n //CHKRA-NEXT: %6 = BinaryOperatorInst '+', %4 : number, %5 : number\n //CHKRA-NEXT: %7 = AsInt32Inst %6 : number\n //CHKRA-NEXT: %8 = ReturnInst %7 : number\n //CHKRA-NEXT: function_end\n\n // Regular add\n function add32n(x, y) {\n var z = x + y;\n return (z + x) | 0;\n }\n //CHKRA-LABEL: function add32n(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %2 = BinaryOperatorInst '+', %0, %1\n //CHKRA-NEXT: %3 = BinaryOperatorInst '+', %2 : string|number, %0\n //CHKRA-NEXT: %4 = AsInt32Inst %3 : string|number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n // Phi node and local variable\n function local() {\n var x = 0;\n var i = 0;\n label$1: while (1) {\n x = x + i | 0;\n i = i + 1 | 0;\n if ((i | 0) != (10 | 0)) {\n continue label$1;\n }\n break label$1;\n }\n return x;\n }\n //CHKRA-LABEL: function local() : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadConstInst 0 : number\n //CHKRA-NEXT: %1 = HBCLoadConstInst 1 : number\n //CHKRA-NEXT: %2 = HBCLoadConstInst 10 : number\n //CHKRA-NEXT: %3 = HBCLoadConstInst 0 : number\n //CHKRA-NEXT: %4 = BranchInst %BB1\n //CHKRA-NEXT: %BB2:\n //CHKRA-NEXT: %5 = ReturnInst %8 : number\n //CHKRA-NEXT: %BB1:\n //CHKRA-NEXT: %6 = PhiInst %0 : number, %BB0, %10 : number, %BB1\n //CHKRA-NEXT: %7 = PhiInst %3 : number, %BB0, %11 : number, %BB1\n //CHKRA-NEXT: %8 = CallIntrinsicInst [__uasm.add32_2] : number, %6 : number, %7 : number\n //CHKRA-NEXT: %9 = CallIntrinsicInst [__uasm.add32_2] : number, %7 : number, %1 : number\n //CHKRA-NEXT: %10 = MovInst %8 : number\n //CHKRA-NEXT: %11 = MovInst %9 : number\n //CHKRA-NEXT: %12 = CompareBranchInst '!==', %11 : number, %2 : number, %BB1, %BB2\n //CHKRA-NEXT: function_end\n\n // int32 sub\n function sub32(x, y) {\n x = x | 0;\n y = y | 0;\n var z = x - y;\n return (z - x) | 0;\n }\n //CHKRA-LABEL: function sub32(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.sub32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.sub32_2] : number, %4 : number, %1 : number\n //CHKRA-NEXT: %6 = ReturnInst %5 : number\n //CHKRA-NEXT: function_end\n\n // divi\n function divi32(x, y) {\n x = x | 0;\n y = y | 0;\n var z = x / y;\n return (z / x) | 0;\n }\n //CHKRA-LABEL: function divi32(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.divi32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.divi32_2] : number, %4 : number, %1 : number\n //CHKRA-NEXT: %6 = ReturnInst %5 : number\n //CHKRA-NEXT: function_end\n\n // divu\n function divu32(x, y) {\n x = x | 0;\n y = y | 0;\n return ((x >>> 0) / (y >>> 0)) | 0;\n }\n //CHKRA-LABEL: function divu32(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.divu32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n // Math_imul\n function mul32(x, y) {\n x = x | 0;\n y = y | 0;\n return Math_imul(x, y);\n }\n //CHKRA-LABEL: function mul32(x, y) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %3 = AsInt32Inst %2\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.mul32_2] : number, %1 : number, %3 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n // Should not be replaced.\n function math_abs(x) {\n x = x | 0;\n return Math_abs(x);\n }\n //CHKRA-LABEL: function math_abs(x)\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [Math_abs@asmFunc]\n //CHKRA-NEXT: %4 = HBCLoadConstInst undefined : undefined\n //CHKRA-NEXT: %5 = ImplicitMovInst %4 : undefined\n //CHKRA-NEXT: %6 = ImplicitMovInst %1 : number\n //CHKRA-NEXT: %7 = HBCCallNInst %3, %4 : undefined, %1 : number\n //CHKRA-NEXT: %8 = ReturnInst %7\n //CHKRA-NEXT: function_end\n\n function loadi8(addr) {\n addr = addr | 0;\n return HEAP8[addr >> 0];\n }\n //CHKRA-LABEL: function loadi8(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAP8@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadi8_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function loadu8(addr) {\n addr = addr | 0;\n return HEAPU8[addr >> 0];\n }\n //CHKRA-LABEL: function loadu8(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAPU8@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadu8_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function loadi16(addr) {\n addr = addr | 0;\n return HEAP16[addr >> 1];\n }\n //CHKRA-LABEL: function loadi16(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAP16@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadi16_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function loadu16(addr) {\n addr = addr | 0;\n return HEAPU16[addr >> 1];\n }\n //CHKRA-LABEL: function loadu16(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAPU16@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadu16_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function loadi32(addr) {\n addr = addr | 0;\n return HEAP32[addr >> 2];\n }\n //CHKRA-LABEL: function loadi32(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadi32_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function loadu32(addr) {\n addr = addr | 0;\n return HEAPU32[addr >> 2];\n }\n //CHKRA-LABEL: function loadu32(addr) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = AsInt32Inst %0\n //CHKRA-NEXT: %2 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %3 = HBCLoadFromEnvironmentInst %2, [HEAPU32@asmFunc] : undefined|object\n //CHKRA-NEXT: %4 = CallIntrinsicInst [__uasm.loadu32_2] : number, %3, %1 : number\n //CHKRA-NEXT: %5 = ReturnInst %4 : number\n //CHKRA-NEXT: function_end\n\n function store8(addr, data) {\n addr = addr | 0;\n HEAP8[addr >> 0] = data;\n HEAPU8[addr >> 0] = data;\n }\n //CHKRA-LABEL: function store8(addr, data) : undefined\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %1 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %2 = AsInt32Inst %1\n //CHKRA-NEXT: %3 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %4 = HBCLoadFromEnvironmentInst %3, [HEAP8@asmFunc] : undefined|object\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.store8_3] : number, %4, %2 : number, %0\n //CHKRA-NEXT: %6 = HBCLoadFromEnvironmentInst %3, [HEAPU8@asmFunc] : undefined|object\n //CHKRA-NEXT: %7 = CallIntrinsicInst [__uasm.store8_3] : number, %6, %2 : number, %0\n //CHKRA-NEXT: %8 = HBCLoadConstInst undefined : undefined\n //CHKRA-NEXT: %9 = ReturnInst %8 : undefined\n //CHKRA-NEXT: function_end\n\n function store16(addr, data) {\n addr = addr | 0;\n HEAP16[addr >> 1] = data;\n HEAPU16[addr >> 1] = data;\n }\n //CHKRA-LABEL: function store16(addr, data) : undefined\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %1 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %2 = AsInt32Inst %1\n //CHKRA-NEXT: %3 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %4 = HBCLoadFromEnvironmentInst %3, [HEAP16@asmFunc] : undefined|object\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.store16_3] : number, %4, %2 : number, %0\n //CHKRA-NEXT: %6 = HBCLoadFromEnvironmentInst %3, [HEAPU16@asmFunc] : undefined|object\n //CHKRA-NEXT: %7 = CallIntrinsicInst [__uasm.store16_3] : number, %6, %2 : number, %0\n //CHKRA-NEXT: %8 = HBCLoadConstInst undefined : undefined\n //CHKRA-NEXT: %9 = ReturnInst %8 : undefined\n //CHKRA-NEXT: function_end\n\n function store32(addr, data) {\n addr = addr | 0;\n HEAP32[addr >> 2] = data;\n HEAPU32[addr >> 2] = data;\n }\n //CHKRA-LABEL: function store32(addr, data) : undefined\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %1 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %2 = AsInt32Inst %1\n //CHKRA-NEXT: %3 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %4 = HBCLoadFromEnvironmentInst %3, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.store32_3] : number, %4, %2 : number, %0\n //CHKRA-NEXT: %6 = HBCLoadFromEnvironmentInst %3, [HEAPU32@asmFunc] : undefined|object\n //CHKRA-NEXT: %7 = CallIntrinsicInst [__uasm.store32_3] : number, %6, %2 : number, %0\n //CHKRA-NEXT: %8 = HBCLoadConstInst undefined : undefined\n //CHKRA-NEXT: %9 = ReturnInst %8 : undefined\n //CHKRA-NEXT: function_end\n\n function store32cse(addr, data) {\n addr = addr | 0;\n HEAP32[addr >> 2] = data;\n HEAPU32[addr >> 2] = data;\n return addr >> 2;\n }\n //CHKRA-LABEL: function store32cse(addr, data) : number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 2 : number\n //CHKRA-NEXT: %1 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %2 = AsInt32Inst %1\n //CHKRA-NEXT: %3 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %4 = HBCLoadFromEnvironmentInst %3, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %5 = CallIntrinsicInst [__uasm.store32_3] : number, %4, %2 : number, %0\n //CHKRA-NEXT: %6 = HBCLoadFromEnvironmentInst %3, [HEAPU32@asmFunc] : undefined|object\n //CHKRA-NEXT: %7 = CallIntrinsicInst [__uasm.store32_3] : number, %6, %2 : number, %0\n //CHKRA-NEXT: %8 = HBCLoadConstInst 2 : number\n //CHKRA-NEXT: %9 = BinaryOperatorInst '>>', %2 : number, %8 : number\n //CHKRA-NEXT: %10 = ReturnInst %9 : number\n //CHKRA-NEXT: function_end\n\n // The case where >> 2 is missing or have a different amount.\n function incorrect_load32(addr, data) {\n return HEAP32[addr >> 3] + HEAP32[addr] + HEAP32[addr + 3];\n }\n //CHKRA-LABEL: function incorrect_load32(addr, data) : string|number\n //CHKRA-NEXT: frame = []\n //CHKRA-NEXT: %BB0:\n //CHKRA-NEXT: %0 = HBCLoadParamInst 1 : number\n //CHKRA-NEXT: %1 = HBCResolveEnvironment %asmFunc()\n //CHKRA-NEXT: %2 = HBCLoadFromEnvironmentInst %1, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %3 = HBCLoadConstInst 3 : number\n //CHKRA-NEXT: %4 = BinaryOperatorInst '>>', %0, %3 : number\n //CHKRA-NEXT: %5 = LoadPropertyInst %2, %4 : number\n //CHKRA-NEXT: %6 = HBCLoadFromEnvironmentInst %1, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %7 = LoadPropertyInst %6, %0\n //CHKRA-NEXT: %8 = BinaryOperatorInst '+', %5, %7\n //CHKRA-NEXT: %9 = HBCLoadFromEnvironmentInst %1, [HEAP32@asmFunc] : undefined|object\n //CHKRA-NEXT: %10 = BinaryOperatorInst '+', %0, %3 : number\n //CHKRA-NEXT: %11 = LoadPropertyInst %9, %10 : string|number\n //CHKRA-NEXT: %12 = BinaryOperatorInst '+', %8 : string|number, %11\n //CHKRA-NEXT: %13 = ReturnInst %12 : string|number\n //CHKRA-NEXT: function_end\n\n return {\n \"add32\" : add32,\n \"add32u\" : add32u,\n \"add32l\" : add32l,\n \"add32lf\" : add32lf,\n \"add32n\" : add32n,\n \"local\" : local,\n \"sub32\" : sub32,\n \"divi32\" : divi32,\n \"divu32\" : divu32,\n \"mul32\" : mul32,\n \"math_abs\" : math_abs,\n \"loadi8\" : loadi8,\n \"loadu8\" : loadu8,\n \"loadi16\" : loadi16,\n \"loadu16\" : loadu16,\n \"loadi32\" : loadi32,\n \"loadu32\" : loadu32,\n \"store8\" : store8,\n \"store16\" : store16,\n \"store32\" : store32,\n \"store32cse\" : store32cse,\n \"incorrect\" : incorrect_load32\n };\n}", "title": "" }, { "docid": "46f1bd873066573ce296cd83f6dc6192", "score": "0.5382758", "text": "function v(a,b){for(var c,d=0;null!=(c=a[d]);d++)ea._data(c,\"globalEval\",!b||ea._data(b[d],\"globalEval\"))}", "title": "" }, { "docid": "d92bbd19fcf5750ad209608739984fc2", "score": "0.5359771", "text": "function test0() {\n var obj0 = {};\n\n var func4 = function () {\n var a = ui8;\n func0();\n };\n\n var func0 = function () {\n for (; prop0 < 100;) {\n argMath5;\n }\n };\n\n obj0.method1 = func4;\n var ui8 = new Uint8Array(256);\n prop0 = Infinity;\n obj0.method1();\n prop0 = -1766989739;\n obj0.method1();\n}", "title": "" }, { "docid": "aa837aef87f6235bc86b5152ad2b6ec9", "score": "0.53560364", "text": "function o0(o9,o525,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o35 = Array.prototype.map.call(o4, o16);\n //views\n var o350 = 0;\n\n function o4(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try { try {\no1.o2(\"Testing Object.defineProperty with accessors:\");\n}catch(e){} } catch(e) {}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "240644cc0b3bb87bf74241a66c29e74d", "score": "0.53337777", "text": "function StupidBug() {}", "title": "" }, { "docid": "f3b8f2eb4ceb210299839c96a80af6e0", "score": "0.5327984", "text": "async function processRuntime(options) {\n let originalCode = options.code;\n let downlevelCode = options.code;\n // Replace integrity hashes with updated values\n if (options.integrityAlgorithm && options.runtimeData) {\n for (const data of options.runtimeData) {\n if (!data.integrity) {\n continue;\n }\n if (data.original && data.original.integrity) {\n originalCode = originalCode.replace(data.integrity, data.original.integrity);\n }\n if (data.downlevel && data.downlevel.integrity) {\n downlevelCode = downlevelCode.replace(data.integrity, data.downlevel.integrity);\n }\n }\n }\n // Adjust lazy loaded scripts to point to the proper variant\n // Extra spacing is intentional to align source line positions\n downlevelCode = downlevelCode.replace('\"-es2015.', ' \"-es5.');\n const downlevelFilePath = options.filename.replace('es2015', 'es5');\n let downlevelMap;\n let result;\n if (options.optimize) {\n const minifiyResults = terserMangle(downlevelCode, {\n filename: path.basename(downlevelFilePath),\n map: options.map === undefined ? undefined : JSON.parse(options.map),\n });\n downlevelCode = minifiyResults.code;\n downlevelMap = JSON.stringify(minifiyResults.map);\n result = {\n original: await mangleOriginal({ ...options, code: originalCode }),\n downlevel: createFileEntry(downlevelFilePath, downlevelCode, downlevelMap, options.integrityAlgorithm),\n };\n }\n else {\n if (options.map) {\n const rawMap = JSON.parse(options.map);\n rawMap.file = path.basename(downlevelFilePath);\n downlevelMap = JSON.stringify(rawMap);\n }\n result = {\n original: createFileEntry(options.filename, originalCode, options.map, options.integrityAlgorithm),\n downlevel: createFileEntry(downlevelFilePath, downlevelCode, downlevelMap, options.integrityAlgorithm),\n };\n }\n if (downlevelMap) {\n await cachePut(downlevelMap, (options.cacheKeys && options.cacheKeys[3 /* DownlevelMap */]) || null);\n fs.writeFileSync(downlevelFilePath + '.map', downlevelMap);\n downlevelCode += `\\n//# sourceMappingURL=${path.basename(downlevelFilePath)}.map`;\n }\n await cachePut(downlevelCode, (options.cacheKeys && options.cacheKeys[2 /* DownlevelCode */]) || null);\n fs.writeFileSync(downlevelFilePath, downlevelCode);\n return result;\n}", "title": "" }, { "docid": "8e3f6602f4a2c0e9e14d9ca7d11bc327", "score": "0.53257906", "text": "function jsToWasmFunc(func, sig) {\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "title": "" }, { "docid": "8f4b2332e3d629c49871f0eb8fcc1d38", "score": "0.5310395", "text": "function codeGenerator_main(){\n auxVars.createTmpVarsTable();\n\n var code;\n\n if (cg_revLogic===undefined) {\n cg_revLogic=false;\n }\n\n if (cg_jumpTarget === undefined) {\n code=genCode(cg_ast, false, cg_revLogic, cg_jumpTarget, cg_jumpNotTarget);\n if (code.MemObj !== undefined && auxVars.isTemp(code.MemObj.location) && code.MemObj.type.indexOf(\"_ptr\") == -1 ) {\n if ( cg_ast.Operation === undefined || cg_ast.Operation.type !== \"FunctionCall\") {\n var line;\n if (cg_ast.line !== undefined) {\n line = cg_ast.line;\n } else if (cg_ast.Operation.line !== undefined) {\n line = cg_ast.Operation.line;\n }\n if (bc_Big_ast.Config.warningToError) {\n throw new TypeError(\"At line: \"+line+\". Warning: sentence returned a value that is not being used.\");\n }\n }\n }\n } else {\n code=genCode(cg_ast, true, cg_revLogic, cg_jumpTarget, cg_jumpNotTarget);\n }\n\n code.instructionset+=auxVars.postOperations;\n\n //optimizations for jumps and labels\n if (code.instructionset.indexOf(\":\") >=0) {\n if (cg_ast.type !== undefined) {\n if (cg_ast.type === \"Keyword\" && cg_ast.value === \"label\") {\n return code.instructionset; //do not optimize!!!\n }\n }\n //code.instructionset+=\"\\n\\n\"+optimizeJumps(code.instructionset);\n code.instructionset=optimizeJumps(code.instructionset);\n }\n\n return code.instructionset;\n }", "title": "" }, { "docid": "9b4e2f3f0e72d2d3ff69fb611b5d24f8", "score": "0.53054583", "text": "function\nXATS2JS_lazy_vt_cfr(a1x1)\n{\nlet xtmp10;\nlet xtmp12;\nlet xtmp13;\n;\nxtmp12 =\nfunction()\n{\nlet xtmp11;\n{\nxtmp11 = a1x1();\n}\n;\nreturn xtmp11;\n} // lam-function\n;\nxtmp13 =\nfunction()\n{\nlet xtmp11;\n} // lam-function\n;\nxtmp10 = XATS2JS_new_llazy(xtmp12,xtmp13);\nreturn xtmp10;\n} // function // XATS2JS_lazy_vt_cfr(2)", "title": "" }, { "docid": "da4d5bcfed717406afd9c096ce542530", "score": "0.52982336", "text": "function convertJsFunctionToWasm(func, sig) {\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "title": "" }, { "docid": "d0dcac3ce08d7b60495aa869931e7a3a", "score": "0.5296654", "text": "function TMP(){return;}", "title": "" }, { "docid": "a91485dda7ac201efcc4c20e6bc593f9", "score": "0.52934873", "text": "function toStringMaker(name) {\n return function() {\n return 'function ' + name + '() { [native code] }';\n };\n }", "title": "" }, { "docid": "70d17e95aca848dc11bdd1a3b7544c2d", "score": "0.5258535", "text": "__iii() { }", "title": "" }, { "docid": "f821ac9a9c3151de7216de057af3d5bc", "score": "0.52502924", "text": "function o188(o78) {\n try {\ntry {\n var o116 = Module['_' + o78]; // closure exported function\n try {\nif (!o116) try {\no116 = eval('_' + o78);\n}catch(e){}\n}catch(e){} // explicit lookup\n } catch (o189) {}\n}catch(e){}\n try {\no73(o116, 'Cannot call unknown function ' + o78 + ' (perhaps LLVM optimizations or closure removed it?)');\n}catch(e){}\n try {\nreturn o116;\n}catch(e){}\n}", "title": "" }, { "docid": "2a57706ff5ae146d3d5eb787550e7e1a", "score": "0.5244745", "text": "function M22() {\n}", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.52209735", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "a53beca99fa2cd258fe42bafca1837f0", "score": "0.51996493", "text": "function code_generator () {}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "9ae3e2f0a55ddd171dd21da970b85699", "score": "0.5195811", "text": "function convertJsFunctionToWasm(func, sig) {\n return func;\n}", "title": "" }, { "docid": "978bff012b077cc82e2bb0019a420a71", "score": "0.51946265", "text": "assembleCode() {\r\n // halt cpu for assembly\r\n this.cpuData.cpuEnabled = self.cpuEnabled.checked = false;\r\n\r\n // clear existing memory\r\n this.clearAndInitializeMemory(65536);\r\n\r\n // clear assembler label locations\r\n this.cpuData.assembler.labels.labelLocations = {};\r\n this.cpuData.assembler.privatePointer = 0;\r\n\r\n // operand type 'constants'\r\n var operandTypes = {\r\n NULL: 0,\r\n IMMEDIATE: 1,\r\n ABSOLUTE: 2,\r\n RELATIVE: 3,\r\n };\r\n\r\n var nextMemoryIndex = 0;\r\n\r\n // iterate through program\r\n var lines = self.prg.value.replace(/\\r\\n/g, \"\\n\").split(\"\\n\");\r\n lines.forEach(line => {\r\n\r\n if (line.trim() != \"\") {\r\n // check for compiler directive\r\n if (line.trim().startsWith('.')) {\r\n var directiveParts = line.trim().split(' ');\r\n var directiveCode = directiveParts[0].trim().toUpperCase();\r\n var directiveArgs = line.trim().split(/ |,/ig);\r\n switch (directiveCode) {\r\n case '.ORG':\r\n if (directiveParts.length > 1) {\r\n var orgAddress = directiveParts[1];\r\n if (orgAddress.startsWith('$')) {\r\n nextMemoryIndex = parseInt(\"0x\" + orgAddress.substr(1, 4))\r\n }\r\n }\r\n break;\r\n\r\n case '.BYTE':\r\n // .byte $ff, $cc\r\n if (directiveArgs.length > 1) {\r\n directiveArgs.forEach((byteValue, idx) => {\r\n if (byteValue.startsWith('$')) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(\"0x\" + byteValue.substr(1, 2));\r\n nextMemoryIndex++;\r\n }\r\n }\r\n );\r\n }\r\n break;\r\n\r\n case '.WORD':\r\n // .word $ffee, $99cc\r\n // Note: the word is converted to low byte, high byte so that $04ff is stored as $ff $04\r\n if (directiveArgs.length > 1) {\r\n directiveArgs.forEach((wordValue, idx) => {\r\n if (wordValue.startsWith('$')) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(\"0x\" + wordValue.substr(3, 2));\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(\"0x\" + wordValue.substr(1, 2));\r\n nextMemoryIndex++;\r\n }\r\n }\r\n );\r\n }\r\n break;\r\n }\r\n }\r\n else {\r\n // check for comment\r\n if (!line.trim().startsWith(';')) {\r\n // check for label\r\n if (line.trim().endsWith(':')) {\r\n var labelName = line.trim().replace(':', '');\r\n\r\n // fix issue with bad label location\r\n var labelLocation = (\"0000\" + nextMemoryIndex.toString(16)).substr(-4, 4);\r\n\r\n var labelLocationZero = labelLocation.substr(2, 2);\r\n var labelLocationIchi = labelLocation.substr(0, 2);\r\n\r\n this.cpuData.assembler.labels.labelLocations[labelName] = [labelLocationZero, labelLocationIchi];\r\n\r\n\r\n // check for predeclaration label calls\r\n if (labelName in this.cpuData.assembler.labels.futureLabels) {\r\n // loop through memory to update\r\n this.cpuData.assembler.labels.futureLabels[labelName].forEach(\r\n (futureLabel, idx) => {\r\n if(futureLabel.isRelative){\r\n var offset = nextMemoryIndex - futureLabel.operandLocationForOffset;\r\n offset += 256; // handle negative numbers with two's compliment for negative offset\r\n offset &= 0xFF; // for positive offset and with byte mask to get true offset\r\n this.cpuData.memoryArray[futureLabel.memLocationRelative] = offset;\r\n }\r\n else {\r\n this.cpuData.memoryArray[futureLabel.memLocationZero] = parseInt(`0x${labelLocationZero}`);\r\n this.cpuData.memoryArray[futureLabel.memLocationIchi] = parseInt(`0x${labelLocationIchi}`);\r\n }\r\n }\r\n );\r\n\r\n // after processing clear array\r\n this.cpuData.assembler.labels.futureLabels[labelName] = [];\r\n }\r\n }\r\n else {\r\n var lineParts = line.trim().split(' ');\r\n var operation = lineParts[0].toUpperCase();\r\n\r\n var operand = '';\r\n\r\n var operandType = 0;\r\n var operandValue = [];\r\n\r\n if (lineParts.length > 1) {\r\n operand = lineParts[1];\r\n\r\n var commentIndex = operand.indexOf(';')\r\n\r\n // strip end of line comment\r\n if (commentIndex > -1) { operand = operand.substr(0, commentIndex - 1); }\r\n\r\n\r\n if (operand.startsWith('#')) {\r\n operandType = operandTypes.IMMEDIATE;\r\n operandValue.push(parseInt(\"0x\" + operand.substr(2)));\r\n }\r\n if (operand.startsWith('$')) {\r\n if(operand.length == 3){\r\n operandType = operandTypes.RELATIVE;\r\n operandValue.push(parseInt(operand));\r\n }\r\n if(operand.length == 5){\r\n operandType = operandTypes.ABSOLUTE;\r\n operandValue.push(parseInt(\"0x\" + operand.substr(3, 2)));\r\n operandValue.push(parseInt(\"0x\" + operand.substr(1, 2)));\r\n }\r\n }\r\n else {\r\n if(/^(-[0-9]|[0-9])/.test(operand)){\r\n operandType = operandTypes.RELATIVE;\r\n operandValue.push(parseInt(operand));\r\n }\r\n }\r\n }\r\n\r\n switch (operation) {\r\n case 'ADC':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x69);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x6D);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n case 'AND':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x29);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x2D);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'ASL':\r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for A\r\n if (operand.toUpperCase() == 'A') {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x0A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n }\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x0E);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'CLC':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x18);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'SEC':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x38);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'CLI':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x58);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'SEI':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x78);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'CLV':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xB8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'CLD':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xD8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'SED':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xF8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'DEX':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xCA);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'DEY':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x88);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'INX':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xE8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'INY':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xC8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'JSR':\r\n case 'JMP':\r\n var opcode = 0;\r\n switch (operation) {\r\n case 'JSR':\r\n opcode = parseInt(0x20);\r\n break;\r\n\r\n case 'JMP':\r\n opcode = parseInt(0x4C);\r\n break;\r\n }\r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for label\r\n if (operand in this.cpuData.assembler.labels.labelLocations) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = opcode;\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt('0x' + this.cpuData.assembler.labels.labelLocations[operand][0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt('0x' + this.cpuData.assembler.labels.labelLocations[operand][1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n }\r\n else {\r\n // maybe label will be declared later\r\n var memLocationZero = 0;\r\n var memLocationIchi = 0;\r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = opcode;\r\n nextMemoryIndex++;\r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = 0;\r\n memLocationZero = nextMemoryIndex;\r\n nextMemoryIndex++;\r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = 0;\r\n memLocationIchi = nextMemoryIndex;\r\n nextMemoryIndex++;\r\n\r\n // if not in future labels yet, init it\r\n if (!(operand in this.cpuData.assembler.labels.futureLabels)) {\r\n this.cpuData.assembler.labels.futureLabels[operand] = [];\r\n }\r\n this.cpuData.assembler.labels.futureLabels[operand].push(\r\n {\r\n isRelative: false,\r\n memLocationZero,\r\n memLocationIchi,\r\n memLocationRelative: 0,\r\n operandLocationForOffset: 0,\r\n }\r\n );\r\n }\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = opcode;\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n }\r\n\r\n break;\r\n\r\n case 'LDA':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xA9);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xAD);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'LDX':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xA2);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xAE);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'LDY':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xA0);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xAC);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'NOP':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xEA);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'STA':\r\n if (operandType == operandTypes.ABSOLUTE) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x8D);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n }\r\n break;\r\n\r\n case 'STX':\r\n if (operandType == operandTypes.ABSOLUTE) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x8E);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n }\r\n break;\r\n\r\n case 'STY':\r\n if (operandType == operandTypes.ABSOLUTE) {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x8C);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n }\r\n break;\r\n\r\n case 'TAX':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xAA);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'TXA':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x8A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'TAY':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xA8);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'TYA':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x98);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'TSX':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xBA);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'TXS':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x9A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'RTS':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x60);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'PHA':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x48);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'PLA':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x68);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'PHP':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x08);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'PLP':\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x28);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n break;\r\n\r\n case 'EOR':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x49);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x4D);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n \r\n case 'ORA':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x09);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x0D);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'LSR':\r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for A\r\n if (operand.toUpperCase() == 'A') {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x4A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n }\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x4E);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break; \r\n\r\n case 'ROL':\r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for A\r\n if (operand.toUpperCase() == 'A') {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x2A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n }\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x2E);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break; \r\n\r\n case 'ROR':\r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for A\r\n if (operand.toUpperCase() == 'A') {\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x6A);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer++;\r\n }\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x6E);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'SBC':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xE9);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xED);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'CMP':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xC9);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xCD);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break;\r\n\r\n case 'CPX':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xE0);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xEC);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break; \r\n\r\n case 'CPY':\r\n switch (operandType) {\r\n case operandTypes.IMMEDIATE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xC0);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0xCC);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n break; \r\n\r\n case \"BIT\":\r\n switch (operandType) {\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(0x2C);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n } \r\n break;\r\n \r\n case \"BPL\":\r\n case \"BMI\":\r\n case \"BVC\":\r\n case \"BVS\":\r\n case \"BCC\":\r\n case \"BCS\":\r\n case \"BNE\":\r\n case \"BEQ\":\r\n var opcodes = {\r\n BPL: 0x10, BMI: 0x30, BVC: 0x50,\r\n BVS: 0x70, BCC: 0x90, BCS: 0xB0,\r\n BNE: 0xD0, BEQ: 0xF0,\r\n };\r\n var opcode = opcodes[operation];\r\n \r\n switch (operandType) {\r\n case operandTypes.NULL:\r\n // look for label, find offset for label\r\n if (operand in this.cpuData.assembler.labels.labelLocations) {\r\n // calculate offset to label location\r\n var offset = parseInt(`0x${this.cpuData.assembler.labels.labelLocations[operand][1]}${this.cpuData.assembler.labels.labelLocations[operand][0]}`) - nextMemoryIndex;\r\n offset += 256; // handle negative numbers with two's compliment for negative offset\r\n offset &= 0xFF; // for positive offset and with byte mask to get true offset \r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(opcode);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = offset;\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n }\r\n else {\r\n // maybe label will be declared later\r\n var memLocationRelative = 0;\r\n var operandLocationForOffset = 0;\r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(opcode);\r\n operandLocationForOffset = nextMemoryIndex;\r\n nextMemoryIndex++;\r\n\r\n this.cpuData.memoryArray[nextMemoryIndex] = 0;\r\n memLocationRelative = nextMemoryIndex;\r\n nextMemoryIndex++;\r\n\r\n\r\n // if not in future labels yet, init it\r\n if (!(operand in this.cpuData.assembler.labels.futureLabels)) {\r\n this.cpuData.assembler.labels.futureLabels[operand] = [];\r\n }\r\n this.cpuData.assembler.labels.futureLabels[operand].push(\r\n {\r\n isRelative: true,\r\n memLocationZero: 0,\r\n memLocationIchi: 0,\r\n memLocationRelative,\r\n operandLocationForOffset,\r\n }\r\n );\r\n } \r\n break; \r\n \r\n case operandTypes.RELATIVE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(opcode);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 2;\r\n break;\r\n\r\n case operandTypes.ABSOLUTE:\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(opcode);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[0]);\r\n nextMemoryIndex++;\r\n this.cpuData.memoryArray[nextMemoryIndex] = parseInt(operandValue[1]);\r\n nextMemoryIndex++;\r\n this.cpuData.assembler.privatePointer += 3;\r\n break;\r\n }\r\n\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n });\r\n\r\n this.writeMemory();\r\n\r\n // cpu enabled\r\n this.cpuData.cpuEnabled = self.cpuEnabled.checked = true;\r\n\r\n }", "title": "" }, { "docid": "bd4b51e42b440d6e09c939e4f0bcbe18", "score": "0.5193338", "text": "function _0x22e1(_0x2add77,_0x37dc57){var _0x1834b3=_0x93d8();return _0x22e1=function(_0x1a3c1c,_0x3b4bfe){_0x1a3c1c=_0x1a3c1c-0x184;var _0x93d8c8=_0x1834b3[_0x1a3c1c];if(_0x22e1['\\x6c\\x61\\x68\\x46\\x6a\\x75']===undefined){var _0x2a2ddf=function(_0xa6d1e6){var _0x4215a9='\\x61\\x62\\x63\\x64\\x65\\x66\\x67\\x68\\x69\\x6a\\x6b\\x6c\\x6d\\x6e\\x6f\\x70\\x71\\x72\\x73\\x74\\x75\\x76\\x77\\x78\\x79\\x7a\\x41\\x42\\x43\\x44\\x45\\x46\\x47\\x48\\x49\\x4a\\x4b\\x4c\\x4d\\x4e\\x4f\\x50\\x51\\x52\\x53\\x54\\x55\\x56\\x57\\x58\\x59\\x5a\\x30\\x31\\x32\\x33\\x34\\x35\\x36\\x37\\x38\\x39\\x2b\\x2f\\x3d';var _0x5e5c6b='',_0x22e145='',_0x1cb9dd=_0x5e5c6b+_0x2a2ddf;for(var _0x54f7a3=0x0,_0x5b2987,_0x38fdd7,_0xf5b9d6=0x0;_0x38fdd7=_0xa6d1e6['\\x63\\x68\\x61\\x72\\x41\\x74'](_0xf5b9d6++);~_0x38fdd7&&(_0x5b2987=_0x54f7a3%0x4?_0x5b2987*0x40+_0x38fdd7:_0x38fdd7,_0x54f7a3++%0x4)?_0x5e5c6b+=_0x1cb9dd['\\x63\\x68\\x61\\x72\\x43\\x6f\\x64\\x65\\x41\\x74'](_0xf5b9d6+0xa)-0xa!==0x0?String['\\x66\\x72\\x6f\\x6d\\x43\\x68\\x61\\x72\\x43\\x6f\\x64\\x65'](0xff&_0x5b2987>>(-0x2*_0x54f7a3&0x6)):_0x54f7a3:0x0){_0x38fdd7=_0x4215a9['\\x69\\x6e\\x64\\x65\\x78\\x4f\\x66'](_0x38fdd7);}for(var _0x21c524=0x0,_0x105558=_0x5e5c6b['\\x6c\\x65\\x6e\\x67\\x74\\x68'];_0x21c524<_0x105558;_0x21c524++){_0x22e145+='\\x25'+('\\x30\\x30'+_0x5e5c6b['\\x63\\x68\\x61\\x72\\x43\\x6f\\x64\\x65\\x41\\x74'](_0x21c524)['\\x74\\x6f\\x53\\x74\\x72\\x69\\x6e\\x67'](0x10))['\\x73\\x6c\\x69\\x63\\x65'](-0x2);}return decodeURIComponent(_0x22e145);};_0x22e1['\\x62\\x47\\x63\\x4d\\x57\\x5a']=_0x2a2ddf,_0x2add77=arguments,_0x22e1['\\x6c\\x61\\x68\\x46\\x6a\\x75']=!![];}var _0x17abca=_0x1834b3[0x0],_0x5f46e2=_0x1a3c1c+_0x17abca,_0x4a6ebd=_0x2add77[_0x5f46e2];if(!_0x4a6ebd){var _0x18690e=function(_0x2adf7a){this['\\x4a\\x63\\x52\\x75\\x70\\x6d']=_0x2adf7a,this['\\x5a\\x51\\x78\\x46\\x79\\x42']=[0x1,0x0,0x0],this['\\x5a\\x4f\\x47\\x54\\x49\\x57']=function(){return'\\x6e\\x65\\x77\\x53\\x74\\x61\\x74\\x65';},this['\\x6f\\x69\\x42\\x6d\\x4e\\x61']='\\x5c\\x77\\x2b\\x20\\x2a\\x5c\\x28\\x5c\\x29\\x20\\x2a\\x7b\\x5c\\x77\\x2b\\x20\\x2a',this['\\x54\\x4e\\x67\\x65\\x61\\x4b']='\\x5b\\x27\\x7c\\x22\\x5d\\x2e\\x2b\\x5b\\x27\\x7c\\x22\\x5d\\x3b\\x3f\\x20\\x2a\\x7d';};_0x18690e['\\x70\\x72\\x6f\\x74\\x6f\\x74\\x79\\x70\\x65']['\\x43\\x72\\x55\\x66\\x54\\x46']=function(){var _0x4a6446=new RegExp(this['\\x6f\\x69\\x42\\x6d\\x4e\\x61']+this['\\x54\\x4e\\x67\\x65\\x61\\x4b']),_0x2e07cf=_0x4a6446['\\x74\\x65\\x73\\x74'](this['\\x5a\\x4f\\x47\\x54\\x49\\x57']['\\x74\\x6f\\x53\\x74\\x72\\x69\\x6e\\x67']())?--this['\\x5a\\x51\\x78\\x46\\x79\\x42'][0x1]:--this['\\x5a\\x51\\x78\\x46\\x79\\x42'][0x0];return this['\\x55\\x71\\x42\\x54\\x72\\x47'](_0x2e07cf);},_0x18690e['\\x70\\x72\\x6f\\x74\\x6f\\x74\\x79\\x70\\x65']['\\x55\\x71\\x42\\x54\\x72\\x47']=function(_0x3f4457){if(!Boolean(~_0x3f4457))return _0x3f4457;return this['\\x42\\x65\\x67\\x76\\x74\\x7a'](this['\\x4a\\x63\\x52\\x75\\x70\\x6d']);},_0x18690e['\\x70\\x72\\x6f\\x74\\x6f\\x74\\x79\\x70\\x65']['\\x42\\x65\\x67\\x76\\x74\\x7a']=function(_0x3afade){for(var _0x239460=0x0,_0x393405=this['\\x5a\\x51\\x78\\x46\\x79\\x42']['\\x6c\\x65\\x6e\\x67\\x74\\x68'];_0x239460<_0x393405;_0x239460++){this['\\x5a\\x51\\x78\\x46\\x79\\x42']['\\x70\\x75\\x73\\x68'](Math['\\x72\\x6f\\x75\\x6e\\x64'](Math['\\x72\\x61\\x6e\\x64\\x6f\\x6d']())),_0x393405=this['\\x5a\\x51\\x78\\x46\\x79\\x42']['\\x6c\\x65\\x6e\\x67\\x74\\x68'];}return _0x3afade(this['\\x5a\\x51\\x78\\x46\\x79\\x42'][0x0]);},new _0x18690e(_0x22e1)['\\x43\\x72\\x55\\x66\\x54\\x46'](),_0x93d8c8=_0x22e1['\\x62\\x47\\x63\\x4d\\x57\\x5a'](_0x93d8c8),_0x2add77[_0x5f46e2]=_0x93d8c8;}else _0x93d8c8=_0x4a6ebd;return _0x93d8c8;},_0x22e1(_0x2add77,_0x37dc57);}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.51885813", "text": "function TMP() {}", "title": "" }, { "docid": "9bad85cba5dcc35cba6dbbd33ab21626", "score": "0.51837033", "text": "function definition() {\n return {\n // llvmType\n types: [\n 'void', 'half', 'float', 'double', 'x86_fp80', 'fp128', 'ppc_fp128',\n 'label', 'metadata', 'x86_mmx',\n 'type', 'label', 'opaque', 'token'\n ],\n // llvmStatement\n statements: [\n 'add', 'addrspacecast', 'alloca', 'and', 'arcp', 'ashr', 'atomicrmw',\n 'bitcast', 'br', 'catchpad', 'catchswitch', 'catchret', 'call',\n 'cleanuppad', 'cleanupret', 'cmpxchg', 'eq', 'exact', 'extractelement',\n 'extractvalue', 'fadd', 'fast', 'fcmp', 'fdiv', 'fence', 'fmul', 'fpext',\n 'fptosi', 'fptoui', 'fptrunc', 'free', 'frem', 'fsub', 'getelementptr',\n 'icmp', 'inbounds', 'indirectbr', 'insertelement', 'insertvalue',\n 'inttoptr', 'invoke', 'landingpad', 'load', 'lshr', 'malloc', 'max', 'min',\n 'mul', 'nand', 'ne', 'ninf', 'nnan', 'nsw', 'nsz', 'nuw', 'oeq', 'oge', 'ogt', 'ole',\n 'olt', 'one', 'or', 'ord', 'phi', 'ptrtoint', 'resume', 'ret', 'sdiv', 'select',\n 'sext', 'sge', 'sgt', 'shl', 'shufflevector', 'sitofp', 'sle', 'slt', 'srem',\n 'store', 'sub', 'switch', 'trunc', 'udiv', 'ueq', 'uge', 'ugt', 'uitofp', 'ule', 'ult',\n 'umax', 'umin', 'une', 'uno', 'unreachable', 'unwind', 'urem', 'va_arg',\n 'xchg', 'xor', 'zext'\n ],\n // llvmKeyword\n keywords: [\n 'acq_rel', 'acquire', 'addrspace', 'alias', 'align', 'alignstack', 'alwaysinline',\n 'appending', 'argmemonly', 'arm_aapcscc', 'arm_aapcs_vfpcc', 'arm_apcscc', 'asm',\n 'atomic', 'available_externally', 'blockaddress', 'builtin', 'byval', 'c', 'catch',\n 'caller', 'cc', 'ccc', 'cleanup', 'coldcc', 'comdat', 'common', 'constant',\n 'datalayout', 'declare', 'default', 'define', 'deplibs', 'dereferenceable',\n 'distinct', 'dllexport', 'dllimport', 'dso_local', 'dso_preemptable', 'except',\n 'external', 'externally_initialized', 'extern_weak', 'fastcc', 'filter', 'from',\n 'gc', 'global', 'hhvmcc', 'hhvm_ccc', 'hidden', 'initialexec', 'inlinehint',\n 'inreg', 'inteldialect', 'intel_ocl_bicc', 'internal', 'linkonce', 'linkonce_odr',\n 'localdynamic', 'localexec', 'local_unnamed_addr', 'minsize', 'module',\n 'monotonic', 'msp430_intrcc', 'musttail', 'naked', 'nest', 'noalias', 'nobuiltin',\n 'nocapture', 'noimplicitfloat', 'noinline', 'nonlazybind', 'nonnull', 'norecurse',\n 'noredzone', 'noreturn', 'nounwind', 'optnone', 'optsize', 'personality',\n 'private', 'protected', 'ptx_device', 'ptx_kernel', 'readnone', 'readonly',\n 'release', 'returned', 'returns_twice', 'sanitize_address', 'sanitize_memory',\n 'sanitize_thread', 'section', 'seq_cst', 'sideeffect', 'signext', 'syncscope',\n 'source_filename', 'speculatable', 'spir_func', 'spir_kernel', 'sret', 'ssp',\n 'sspreq', 'sspstrong', 'strictfp', 'swiftcc', 'tail', 'target', 'thread_local',\n 'to', 'triple', 'unnamed_addr', 'unordered', 'uselistorder', 'uselistorder_bb',\n 'uwtable', 'volatile', 'weak', 'weak_odr', 'within', 'writeonly', 'x86_64_sysvcc',\n 'win64cc', 'x86_fastcallcc', 'x86_stdcallcc', 'x86_thiscallcc', 'zeroext'\n ],\n\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n\n tokenizer: {\n root: [\n [/[,(){}<>[\\]]/, 'delimiters'],\n [/i\\d+\\**/, 'type'], // llvmType\n\n // Misc syntax.\n [/[%@!]\\d+/, 'variable.name'], // llvmNoName\n [/-?\\d+\\.\\d*(e[+-]\\d+)?/, 'number.float'], // llvmFloat\n [/0[xX][0-9A-Fa-f]+/, 'number.hex'], // llvmFloat\n [/-?\\d+/, 'number'], // llvmNumber\n [/\\b(true|false)\\b/, 'keyword'], // llvmBoolean\n [/\\b(zeroinitializer|undef|null|none)\\b/, 'constant'], // llvmConstant\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid' ], // non-teminated string\n [/\"/, 'string', '@string'], // push to string state\n [/[-a-zA-Z$._][-a-zA-Z$._0-9]*:/, 'tag'], // llvmLabel\n [/[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/, 'variable.name'], // llvmIdentifier\n\n // Named metadata and specialized metadata keywords.\n [/![-a-zA-Z$._][-a-zA-Z$._0-9]*(?=\\s*)$/, 'identifier'], // llvmIdentifier\n [/![-a-zA-Z$._][-a-zA-Z$._0-9]*(?=\\s*[=!])/, 'identifier'], // llvmIdentifier\n [/![A-Za-z]+(?=\\s*\\()/, 'type'], // llvmType\n [/\\bDW_TAG_[a-z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_ATE_[a-zA-Z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_OP_[a-zA-Z0-9_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_LANG_[a-zA-Z0-9_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_VIRTUALITY_[a-z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDIFlag[A-Za-z]+\\b/, 'constant'], // llvmConstant\n\n // Syntax-highlight lit test commands and bug numbers.\n [/;\\s*PR\\d*\\s*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*REQUIRES:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*RUN:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*CHECK:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*CHECK-(?:NEXT|NOT|DAG|SAME|LABEL):.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*XFAIL:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;.*$/, 'comment'],\n [/[*#=!]/, 'operators'],\n [/[a-z_$][\\w$]*/, {\n cases: {\n '@statements': 'operators',\n '@keywords': 'keyword',\n '@types': 'type',\n '@default': 'identifier'\n }\n }],\n [/[ \\t\\r\\n]+/, 'white']\n\n ],\n string: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop' ]\n ]\n }\n };\n}", "title": "" }, { "docid": "2a9ce6f3a2abf37f67377eeb86a1a0bd", "score": "0.5183562", "text": "function v35(v36,v37) {\n function v39(v40,v41) {\n const v44 = Symbol.match;\n // v44 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v45 = (100).toLocaleString();\n // v45 = .unknown\n let v46 = v30;\n v46 = v44;\n const v47 = v45.split(v46);\n // v47 = .unknown\n const v48 = 0;\n // v48 = .integer\n const v49 = 5;\n // v49 = .integer\n const v50 = 1;\n // v50 = .integer\n const v51 = 0;\n // v51 = .integer\n const v52 = 8;\n // v52 = .integer\n const v53 = 1;\n // v53 = .integer\n return v35;\n }\n const v55 = new Promise(v39);\n // v55 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v56 = 0;\n // v56 = .integer\n const v57 = 8;\n // v57 = .integer\n const v58 = 1;\n // v58 = .integer\n const v60 = \"unicode\".padStart(-65536,v35);\n // v60 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v61 = Function(v60);\n // v61 = .unknown\n const v62 = 785494185n;\n // v62 = .bigint\n with (v60) {\n const v63 = EPSILON;\n // v63 = .unknown\n }\n function v67(v68,v69) {\n for (let v72 = -2.2250738585072014e-308; v72 < 100; v72 = v72 + 1) {\n const v73 = 1 ^ v72;\n // v73 = .integer | .bigint\n const v74 = 1 % v73;\n // v74 = .integer | .float | .bigint\n const v75 = 1;\n // v75 = .integer\n const v76 = 16;\n // v76 = .integer\n const v77 = 1;\n // v77 = .integer\n const v78 = 0;\n // v78 = .integer\n const v79 = 100;\n // v79 = .integer\n const v80 = 1;\n // v80 = .integer\n const v84 = isNaN(13.37);\n // v84 = .boolean\n const v86 = {construct:isNaN,defineProperty:isNaN,deleteProperty:isNaN,get:isNaN,getOwnPropertyDescriptor:isNaN,getPrototypeOf:isNaN,has:isNaN,preventExtensions:isNaN,set:isNaN};\n // v86 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"getPrototypeOf\", \"preventExtensions\", \"defineProperty\", \"deleteProperty\", \"get\", \"getOwnPropertyDescriptor\", \"set\", \"construct\", \"has\"])\n for (let v88 = 0; v88 < 100; v88 = v88 + 1) {\n }\n const v89 = [63455.09052841901,63455.09052841901,63455.09052841901,\"0jb3mmw5pG\"];\n // v89 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n }\n const v90 = v67(undefined,undefined);\n // v90 = .unknown\n return 1337;\n }", "title": "" }, { "docid": "c7f277e64d313e85e25f812ff2300e5b", "score": "0.5180753", "text": "function codegen_debug() {\n codegen_debug.supported = codegen.supported;\n codegen_debug.verbose = codegen.verbose;\n var gen = codegen.apply(null, Array.prototype.slice.call(arguments));\n gen.str = (function(str) { return function str_debug() {\n return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, \"function $1($2) {\\n\\t$1.calls=($1.calls|0)+1\");\n };})(gen.str);\n return gen;\n}", "title": "" }, { "docid": "ce29bfc931c907ddbefc0ceb69e38763", "score": "0.51787084", "text": "function foo() {\n return 42;\n}", "title": "" }, { "docid": "ce29bfc931c907ddbefc0ceb69e38763", "score": "0.51787084", "text": "function foo() {\n return 42;\n}", "title": "" }, { "docid": "7cf8f49eb4b6e5d60f3544793086acdd", "score": "0.51784235", "text": "function ExpandoInstructions() {}", "title": "" }, { "docid": "2281464a9d5529071dac1d9e36fe7e22", "score": "0.5174967", "text": "function foo() {\n return \"bar\";\n}", "title": "" }, { "docid": "edaf9644020839e0a03917cd76d34512", "score": "0.5173437", "text": "function func() {}", "title": "" }, { "docid": "5f6c06e2216e914b14766c786d034af9", "score": "0.5164817", "text": "function i() {}", "title": "" }, { "docid": "8783174b35a2cef4cba2b6571c53fac6", "score": "0.51593405", "text": "function Vr(t){return Vr=\"function\"===typeof Symbol&&\"symbol\"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},Vr(t)}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b03269a55c2fea36d5a386959321cf7c", "score": "0.51572376", "text": "function foo() {}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "b9a16260abfe22acad6aa709ff72dabb", "score": "0.5151843", "text": "function asmJsFunction(globalEnv, name, ret, args)\n{\n var s = \" function \" + name + \"(\" + args.join(\", \") + \")\\n\";\n s += \" {\\n\";\n s += parameterTypeAnnotations(args);\n\n // Add local variables\n var locals = args;\n while (rnd(2)) {\n var isDouble = rnd(2);\n var local = (isDouble ? \"d\" : \"i\") + locals.length;\n s += \" var \" + local + \" = \" + (isDouble ? doubleLiteral() : \"0\") + \";\\n\";\n locals.push(local);\n }\n\n var env = {globalEnv: globalEnv, locals: locals, ret: ret};\n\n // Add assignment statements\n if (locals.length) {\n while (rnd(5)) {\n s += asmStatement(\" \", env, 6);\n }\n }\n\n // Add the required return statement at the end of the function\n if (ret != \"void\" || rnd(2))\n s += asmReturnStatement(\" \", env);\n\n s += \" }\\n\";\n\n return s;\n}", "title": "" }, { "docid": "e9abd9a7b3028c0a61e5a5bbc2128c2e", "score": "0.5146953", "text": "function dummy() {\n}", "title": "" }, { "docid": "fb7b3f089420c85c9ec5f89cc9bdd337", "score": "0.5142134", "text": "function registerRuntimeCompiler(_compile){compile=_compile;}", "title": "" }, { "docid": "79e3e1fccaf7fa57e3d5da7589cd4159", "score": "0.5141541", "text": "__init2() {this.noAnonFunctionType = false;}", "title": "" }, { "docid": "79e3e1fccaf7fa57e3d5da7589cd4159", "score": "0.5141541", "text": "__init2() {this.noAnonFunctionType = false;}", "title": "" }, { "docid": "5280fe89e245bd2422d62986b867a609", "score": "0.51378524", "text": "function foo(){\n return 42;\n}", "title": "" }, { "docid": "ea6e352239047ad0497107be5d9e021b", "score": "0.51290846", "text": "function makeBenchmarks() {\n const benchmarks = new Map();\n\n benchmarks.wbindgen_thunk = wbindgen_thunk;\n benchmarks.raw_thunk = raw_thunk;\n benchmarks.js_thunk = js_thunk;\n\n benchmarks.wbindgen_fib_40 = () => wbindgen_fibonacci(40);\n benchmarks.js_fib_40 = () => js_fibonacci(40);\n\n benchmarks.wbindgen_add = () => wbindgen_add(2, 3);\n benchmarks.raw_add = () => raw_add(2, 3);\n benchmarks.js_add = () => js_add(2, 3);\n\n benchmarks.js_call_js_thunk_n_times = () => js_call_js_thunk_n_times(10000);\n benchmarks.raw_call_js_thunk_n_times = () => raw_call_js_thunk_n_times(10000);\n benchmarks.wbindgen_call_js_thunk_n_times = () => wbindgen_call_js_thunk_n_times(10000);\n\n benchmarks.js_call_js_add_n_times = () => js_call_js_add_n_times(10000, 2, 3);\n benchmarks.raw_call_js_add_n_times = () => raw_call_js_add_n_times(10000, 2, 3);\n benchmarks.wbindgen_call_js_add_n_times = () => wbindgen_call_js_add_n_times(10000, 2, 3);\n\n const list = [];\n for (let i = 0; i < 10; i++)\n list.push(document.body);\n benchmarks.wbindgen_call_node_first_child_n_times = () => wbindgen_call_node_first_child_n_times(1000, list);\n benchmarks.js_call_node_first_child_n_times = () => js_call_node_first_child_n_times(1000, list);\n benchmarks.wbindgen_call_node_node_type_n_times = () => wbindgen_call_node_node_type_n_times(1000, list);\n benchmarks.js_call_node_node_type_n_times = () => js_call_node_node_type_n_times(1000, list);\n\n const body = document.body;\n benchmarks.wbindgen_count_node_types = () => wbindgen_count_node_types(body);\n benchmarks.js_count_node_types = () => js_count_node_types(body);\n\n benchmarks.wbindgen_call_first_child_final_n_times = () => wbindgen_call_first_child_final_n_times(10000, body);\n benchmarks.wbindgen_call_first_child_structural_n_times = () => wbindgen_call_first_child_structural_n_times(10000, body);\n\n const foo = new globals.Foo();\n benchmarks.wbindgen_call_foo_bar_final_n_times = () => wbindgen_call_foo_bar_final_n_times(10000, foo);\n benchmarks.wbindgen_call_foo_bar_structural_n_times = () => wbindgen_call_foo_bar_structural_n_times(10000, foo);\n\n\n const strings = {\n ascii_small: 'ja',\n ascii_medium: 'aym0566x',\n ascii_number: '505874924095815681',\n ascii_date: 'Sun Aug 31 00:29:15 +0000 2014',\n ascii_url: 'https://pbs.twimg.com/profile_images/497760886795153410/LDjAwR_y_normal.jpeg',\n ascii_link: '<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>',\n unicode: '@aym0566x \\n\\n名前:前田あゆみ\\n第一印象:なんか怖っ!\\n今の印象:とりあえずキモい。噛み合わない\\n好きなところ:ぶすでキモいとこ😋✨✨\\n思い出:んーーー、ありすぎ😊❤️\\nLINE交換できる?:あぁ……ごめん✋\\nトプ画をみて:照れますがな😘✨\\n一言:お前は一生もんのダチ💖'\n }\n const template = document.querySelector('tr.str-benchmark');\n template.remove();\n const tbody = document.querySelector('tbody#wbindgen-body');\n for (const bm in strings) {\n const s = strings[bm];\n const bm_name = `wbindgen_str_${bm}`;\n benchmarks[bm_name] = () => wbindgen_str_roundtrip(s);\n\n const row = template.cloneNode(true);\n row.querySelector('.str').textContent = bm;\n row.querySelector('td.bm').id = bm_name;\n row.removeAttribute('style');\n tbody.appendChild(row);\n }\n\n return benchmarks;\n}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5128631", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.5128631", "text": "function dummy() {}", "title": "" }, { "docid": "d71dc03e5398389cc9160464adbdd65d", "score": "0.51038796", "text": "function dummy(){\n}", "title": "" }, { "docid": "6d01320d4a1234dd2462e19619268f13", "score": "0.51020014", "text": "genNextEnv(size) {\n this.code.push(`${this.isFunc}p = p + ${size};`);\n }", "title": "" }, { "docid": "6d01320d4a1234dd2462e19619268f13", "score": "0.51020014", "text": "genNextEnv(size) {\n this.code.push(`${this.isFunc}p = p + ${size};`);\n }", "title": "" }, { "docid": "55fdb2b22321a9680a67d01be68919e0", "score": "0.50914043", "text": "function compile() {}", "title": "" }, { "docid": "cf923a5dff4b0bfa3b17b0f71dedd310", "score": "0.5088178", "text": "function createIsRealFun() {\n var isRealFun = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {\n var str, parser, result, val, temp;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n str = sto.applyStore(\"str\");\n parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__[\"IVProgParser\"].createParser(str.get());\n result = false;\n\n try {\n val = parser.parseTerm();\n\n if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__[\"RealLiteral\"]) {\n result = true;\n }\n } catch (error) {// ignore\n }\n\n temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__[\"StoreValue\"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__[\"Types\"].BOOLEAN, result);\n sto.insertStore(\"$\", temp);\n sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__[\"Modes\"].RETURN;\n return _context.abrupt(\"return\", sto);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function isRealFun(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n\n var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__[\"CommandBlock\"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__[\"SysCall\"](isRealFun)]);\n var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__[\"Function\"]('$isReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__[\"Types\"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__[\"FormalParameter\"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__[\"Types\"].STRING, 'str', false)], block);\n return func;\n}", "title": "" }, { "docid": "5e8bba2b1bfb2951babe548e2fb51175", "score": "0.5087507", "text": "function m(){}", "title": "" }, { "docid": "850b909dc2ea4673ec3371f2d5a277ab", "score": "0.508062", "text": "function KsanaVm(dictsize) {\r\n /* private members for KsanaVm instance*/\r\n var ip=0; // instruction pointer\r\n var abortexec=false;\r\n dictsize=dictsize || 0xfff; // default 4095 cells ( must be 0xFF , 0xFFF , 0x1FF for & in execprimitive )\r\n var dictionary=new Array(dictsize+1) ;//Uint32Array(dictsize+1); // Typed Array for faster memory access\r\n var stack=[], rstack=[]; // change to fix length Typed Array for faster speed\r\n var tib=\"\", ntib=0, here=0, base=10;\r\n var newname,newxt; // for word under construction\r\n var compiling=false;\r\n this.getcompiling=function(){return compiling;} // get variable compiling\r\n var token=\"\";\r\n this.gettoken=function(){return token;} // get variable token\r\n var error=false;\r\n this.geterror=function(){return error;} // get variable error\r\n this.ticktype=0; // 'type vector not defined yet\r\n function systemtype(t){if(ticktype)ticktype(t);}\r\n function redtype(t){systemtype(\"<font color='red'>\"+t+\"</font>\");}\r\n function bluetype(t){systemtype(\"<font color='blue'>\"+t+\"</font>\");}\r\n function greentype(t){systemtype(\"<font color='green'>\"+t+\"</font>\");}\r\n function pinktype(t){systemtype(\"<font color='pink'>\"+t+\"</font>\");}\r\n function cr(){systemtype(\"<br />\\n\");}\r\n function reset(){abortexec=true; stack=[]; rstack=[]; compiling=false;}\r\n function panic(msg){pinktype(msg); reset(); error=true;}\r\n function nexttoken(deli){\r\n token=\"\"; \r\n if (deli===undefined) deli=\" \"; \r\n while(tib.substr(ntib,1)===\" \" || tib.substr(ntib,1)===\"\\n\" ) ntib++;\r\n \r\n while(ntib<tib.length && tib.substr(ntib,1)!=deli && tib.substr(ntib,1)!=\"\\n\") {\r\n token+=tib.substr(ntib++,1);\r\n }\r\n if (deli!=\" \") ntib++;\r\n return token;\r\n }\r\n function dictcompile(n){dictionary[here++]=n;}\r\n function findword(name){for(var i=words.length-1;i>=0;i--)if(words[i].name===name)break; return i;}\r\n /* in dictionary, primitive words have the format of 0x40000000+index in words */\r\n function compilecode(n){ // **** 將 n 編入 dictionary\r\n if(typeof(n)===\"string\")n=findword(n); // compilecode(\"wordname\") , find out the word index by name\r\n dictcompile(words[n].xt);} // high level words , xt is a number \r\n function execute(xt){ // **** 執行 xt 指令\r\n if(typeof(xt)===\"function\")xt(); // 執行 xt 低階指令 execute a low level primitive ///yap remove isprimitive\r\n else call(xt);\r\n // 呼叫 xt 高階指令 call a high level definition\r\n };\r\n function call(xt){ // *** 呼叫 xt 高階指令\r\n abortexec=false; ip=xt; // inner loop\r\n do{ \r\n var addr=dictionary[ip++]; // go to next cell\r\n if (typeof(addr)===\"function\") addr(); // a primitive //yap\r\n else{rstack.push(ip); call(addr);}\r\n }while(!abortexec);\r\n }\r\n function ret(){ // high level return\r\n if(rstack.length===0){abortexec=true; return;}\r\n ip=rstack.pop();}\r\n function exec(cmd){ntib=0; error=false; tib=cmd; // outer loop\r\n do{ token=nexttoken(); if(token===\"\")break;\r\n var n=parseInt(token,base); // convert to number, javascript allow parseInt(str,base)\r\n var nword=findword(token);\r\n if(nword>-1){var w=words[nword];\r\n if(compiling && !w.immediate)compilecode(nword)\r\n else execute(w.xt); \r\n }else if(n || token==0){ // if the token is a number\r\n if(compiling){ \r\n compilecode(\"doLit\"); dictcompile(n); // compile an literal\r\n }else stack.push(n); \r\n }else panic(\" ? \"+token);\r\n }while(!error);\r\n \r\n }\r\n function tick(){\r\n token=nexttoken(); \r\n var i=findword(token); \r\n if(i>=0)stack.push(i);\r\n else panic(\" ? \"+token);}\r\n////////////////////////\r\n function toname(cfa) {\r\n for (var i=0;i<words.length;i++) {\r\n if (words[i].xt===cfa) {\r\n return words[i].name;\r\n }\r\n }\r\n return \"\";\r\n }\r\n function see() {\r\n var token=nexttoken();\r\n var wid=findword(token);\r\n if (wid>-1) {\r\n var xt=words[wid].xt;\r\n if(typeof(xt)===\"function\") {\r\n systemtype(token+\" is a primitive\");\r\n return;\r\n }\r\n cr(); var c=findword(\"doCon\"); var v=findword(\"doVar\"); var x=xt; var lst=[x];\r\n do {var cfa=dictionary[x]; var a=cfa&dictsize;\r\n if (isprimitive(cfa)) { var n=words[a].name;\r\n if(n===\"doLit\"||a===c||a===v)++x;\r\n else if(n===\"0branch\"||n===\"branch\"||n===\"doNext\")lst.push(++x);\r\n }\r\n x++;\r\n } while ( words[a].xt!==ret && a!==c && a!==v );\r\n do { if(xt in lst){cr(); greentype(xt+\": \");}\r\n var cfa=dictionary[xt]; var a=cfa&dictsize;\r\n if (isprimitive(cfa)) { var n=words[a].name;\r\n systemtype(n+\" \");\r\n if(n===\"doLit\"||a===c||a===v)systemtype(dictionary[++xt] & dictsize);\r\n else if(n===\"0branch\"||n===\"branch\"||n===\"doNext\")greentype(dictionary[++xt] & dictsize);\r\n } else {\r\n var name=toname(cfa);\r\n if (name===\"\")\r\n systemtype(cfa.toString(base));\r\n else systemtype(name);\r\n }\r\n xt++;\r\n } while ( words[a].xt!==ret && a!==c && a!==v );\r\n } }\r\n \r\n var tests=\" \";\r\n \r\n //params of javascript function\r\n function execmethod(obj,fn) {\r\n var js_nparam = {lineTo:2 , moveTo:2, fillRect:4 , lineWidth:1, rotate: 1,translate:2, arc:6, fillText:3,createRadialGradient:6,addColorStop:2};\r\n var js_return = {\"getHours\":true,\"getMinutes\":true,\"getSeconds\":true,\"createRadialGradient\":true} ;\r\n var pcount=fn.length;\r\n \t if (fn.length===0) pcount=js_nparam[fn.name]; //try to fetch from array\r\n \t if (pcount==undefined) pcount=0;\r\n \t var params=[];\r\n \t for (var i=0; i<pcount;i++) params[pcount-i-1]=stack.pop();\r\n \t var r=fn.apply(obj,params);\r\n \t if (js_return[fn.name]) stack.push(r);\r\n }\r\n \r\n timers=[];\r\n function cleartimers() {\r\n \t for (var i=0;i<timers.length;i++) clearTimeout(timers[i]);\r\n }\r\n\r\n \r\n var words = [\r\n {name:\"here\" ,xt:function(){ // here ( -- a ) 系統 dictionary 編碼位址 a\r\n stack.push(here);}}\r\n ,{name:\",\" ,xt:function(){ // , ( n -- ) 將 n 編碼到系統 dictionary\r\n dictcompile(stack.pop());}}\r\n ,{name:\"doLit\" ,xt:function(){ // doLit ( -- n ) 將系統 dictionary 中當前 doLit 指令隨後數值 n 取出\r\n stack.push(dictionary[ip++]);}}\r\n ,{name:\"exit\" ,xt:ret} // exit ( -- ) 跳出高階指令的程式碼\r\n ,{name:\"doCol\" ,xt:function(){} } // exit ( -- ) 跳出高階指令的程式碼\r\n ,{name:\":\" ,xt:function(){ // : ( <name> -- ) 定義高階指令\r\n newname=nexttoken();newxt=here; compilecode(\"doCol\"); compiling=true;}}\r\n ,{name:\";\" ,xt:function(){ // ; ( -- ) 結束高階指令定義\r\n compiling=false;\r\n compilecode(\"exit\");\r\n words.push({name:newname,xt:newxt});\r\n },immediate:true}\r\n ,{name:\"*\" ,xt:function(){ // * ( a b -- c ) 計算 a 與 b 兩數相乘的積 c\r\n stack.push(stack.pop()*stack.pop());}}\r\n ,{name:\"dup\" ,xt:function(){ // dup ( n -- n n ) 複製堆疊頂的數值 n\r\n stack.push(stack[stack.length-1]);}}\r\n ,{name:\"drop\" ,xt:function(){ // drop ( n -- ) 丟掉堆疊頂的數值 n\r\n stack.pop();}}\r\n ,{name:\".\" ,xt:function(){ // . ( n -- ) 依 base 印出數值 n *** 20111224 sam\r\n systemtype(stack.pop().toString(base)+\" \");}}\r\n ,{name:\"hex\" ,xt:function(){ // hex ( -- ) 設定數值以十六進制印出 *** 20111224 sam\r\n base=16;}}\r\n ,{name:\"decimal\" ,xt:function(){ // decimal ( -- ) 設定數值以十進制印出 *** 20111224 sam\r\n base=10;}}\r\n ,{name:\"base@\" ,xt:function(){ // base@ ( -- n ) 取得 base 值 n *** 20111224 sam\r\n stack.push(base);}}\r\n ,{name:\"base!\" ,xt:function(){ // base! ( n -- ) 設定 n 為 base 值 *** 20111224 sam\r\n base=stack.pop();}}\r\n ,{name:\"cr\" ,xt:cr} // cr ( -- ) 到下一列繼續輸出 *** 20111224 sam\r\n ,{name:\"[\" ,xt:function(){ // [ ( -- ) 進入直譯狀態, 輸入指令將會直接執行 *** 20111224 sam\r\n compiling=false;},immediate:true}\r\n ,{name:\"]\" ,xt:function(){ // ] ( -- ) 進入編譯狀態, 輸入指令將會編碼到系統 dictionary *** 20111224 sam\r\n compiling=true;}}\r\n ,{name:\"findword\",xt:function(){ // findword ( <name> -- i | -1 ) 取得系統 dictionary 中的指令序號 i *** 20111224 sam\r\n token=nexttoken(); stack.push(findword(token));}}\r\n ,{name:\"'\" ,xt:tick} // ' ( <name> -- i ) 取得系統 dictionary 中的指令序號 i *** 20111224 sam\r\n ,{name:\"(')\" ,xt:function(){ // ' ( -- i ) 取隨後位址內的指令序號 i *** 20111224 sam\r\n stack.push(dictionary[ip++])}}\r\n ,{name:\"[']\" ,xt:function(){ // ' ( <name> -- i ) 取得系統 dictionary 中的指令序號 *** 20111224 sam\r\n compilecode(\"(')\"); tick(); compilecode(stack.pop())},immediate:true}\r\n ,{name:\"words\" ,xt:function(){ // words ( -- ) 印出系統 dictionary 中已定義的所有指令名稱 *** 20111224 sam\r\n for(var i in words)systemtype(words[i].name+\" \");}}\r\n ,{name:\"branch\" ,xt:function(){ // branch ( -- ) 將當前 ip 內數值當作 ip *** 20111224 sam\r\n ip=dictionary[ip]&dictsize;}}\r\n ,{name:\"0branch\" ,xt:function(){ // 0branch ( n -- ) 若 n!==0 就將當前 ip 內數值當作 ip, 否則將 ip 進位 *** 20111224 sam\r\n if(stack.pop())ip++; else ip=dictionary[ip]&dictsize;}}\r\n ,{name:\"if\" ,xt:function(){ // if ( -- here ) 將 \"0branch\" 編碼到系統並留下 here 待 else 或 then 填入位址 *** 20111224 sam\r\n compilecode(\"0branch\"); stack.push(here); dictcompile(0);},immediate:true}\r\n ,{name:\"else\" ,xt:function(){ // else ( there -- here ) 將 \"branch\" 編碼到系統且留下 here 並將 here 填入 if 原留位址 *** 20111224 sam\r\n compilecode(\"branch\"); var h=here; dictcompile(0); dictionary[stack.pop()]=here; stack.push(h);},immediate:true}\r\n ,{name:\"then\" ,xt:function(){ // then ( there -- ) 將 here 填入 if 或 else 原留位址 *** 20111224 sam\r\n dictionary[stack.pop()]=here;},immediate:true}\r\n ,{name:\"begin\" ,xt:function(){ // begin ( -- here ) 留下 here 待 agan , until, or repeat 填入位址 *** 20111224 sam\r\n stack.push(here);},immediate:true}\r\n ,{name:\"again\" ,xt:function(){ // again ( there -- ) 將 \"branch\" 編碼到系統並編入 begin 原留位址 *** 20111224 sam\r\n compilecode(\"branch\"); compilecode(stack.pop());},immediate:true}\r\n ,{name:\"until\" ,xt:function(){ // until ( there -- ) 將 \"0branch\" 編碼到系統且編入 begin 原留位址 *** 20111224 sam\r\n compilecode(\"0branch\"); compilecode(stack.pop());},immediate:true}\r\n ,{name:\"while\" ,xt:function(){ // while ( there -- there here ) 將 \"0branch\" 編碼到系統且留下 here 待 repeat 填入位址 *** 20111224 sam\r\n compilecode(\"0branch\"); stack.push(here); dictcompile(0);},immediate:true}\r\n ,{name:\"repeat\" ,xt:function(){ // repeat ( there1 there2 -- ) 將 \"branch\" 編碼到系統且編入 begin 原留位址, 並將 here 填入 while 原留位址 *** 20111224 sam\r\n compilecode(\"branch\"); var w=stack.pop(); compilecode(stack.pop()); dictionary[w]=here;},immediate:true}\r\n ,{name:\".s\" ,xt:function(){ // ,s ( -- ) 印出 stack 上所有數字 *** 20111224 sam\r\n if(stack.length>0)for(var i in stack)systemtype(stack[i]+\" \")\r\n else systemtype(\"empty\");}}\r\n ,{name:\"+\" ,xt:function(){ // + ( a b -- c ) 計算 a 與 b 兩數相加的和 c\r\n stack.push(stack.pop()+stack.pop());}}\r\n ,{name:\"1+\" ,xt:function(){ // 1+ ( a b -- c ) 計算 a 與 b 兩數相加的和 c\r\n stack.push(stack.pop()+1);}}\r\n ,{name:\"2+\" ,xt:function(){ // 2+ ( a b -- c ) 計算 a 與 b 兩數相加的和 c\r\n stack.push(stack.pop()+2);}}\r\n ,{name:\"-\" ,xt:function(){ // - ( a b -- c ) 計算 a 與 b 兩數相減的差 c\r\n var b=stack.pop(); stack.push(stack.pop()-b);}}\r\n ,{name:\"1-\" ,xt:function(){ // 1- ( a b -- c ) 計算 a 與 b 兩數相加的和 c\r\n stack.push(stack.pop()-1);}}\r\n ,{name:\"2-\" ,xt:function(){ // 2- ( a b -- c ) 計算 a 與 b 兩數相加的和 c\r\n stack.push(stack.pop()-2);}}\r\n ,{name:\"/\" ,xt:function(){ // / ( a b -- c ) 計算 a 與 b 兩數相除的商 c\r\n var b=stack.pop(); stack.push(stack.pop()/b);}}\r\n ,{name:\"mod\" ,xt:function(){ // mod ( a b -- c ) 計算 a 與 b 兩數相除的餘 c\r\n var b=stack.pop(); stack.push(stack.pop()%b);}}\r\n ,{name:\"div\" ,xt:function(){ // div ( a b -- c ) 計算 a 與 b 兩數相除的整數商 c\r\n var b=stack.pop(); var a=stack.pop(); stack.push((a-(a%b))/b);}}\r\n ,{name:\"see\" ,xt:see} // see ( <name> -- ) 解譯所給指令 *** 20111227 yap\r\n ,{name:\"0=\" ,xt:function(){ // 0= ( a -- f ) 比較 a 是否等於 0\r\n stack.push(stack.pop()===0);}}\r\n ,{name:\"0<\" ,xt:function(){ // 0< ( a -- f ) 比較 a 是否小於 0\r\n stack.push(stack.pop()<0);}}\r\n ,{name:\"0>\" ,xt:function(){ // 0> ( a -- f ) 比較 a 是否大於 0\r\n stack.push(stack.pop()>0);}}\r\n ,{name:\"0<>\" ,xt:function(){ // 0<> ( a -- f ) 比較 a 是否不等於 0\r\n stack.push(stack.pop()!==0);}}\r\n ,{name:\"0<=\" ,xt:function(){ // 0<= ( a -- f ) 比較 a 是否小於等於 0\r\n stack.push(stack.pop()<=0);}}\r\n ,{name:\"0>=\" ,xt:function(){ // 0>= ( a -- f ) 比較 a 是否大於等於 0\r\n stack.push(stack.pop()>=0);}}\r\n ,{name:\"=\" ,xt:function(){ // = ( a b -- f ) 比較 a 是否等於 b\r\n stack.push(stack.pop()===stack.pop());}}\r\n ,{name:\">\" ,xt:function(){ // > ( a b -- f ) 比較 a 是否大於 b\r\n var b=stack.pop(); stack.push(stack.pop()>b);}}\r\n ,{name:\"<\" ,xt:function(){ // > ( a b -- f ) 比較 a 是否小於 b\r\n var b=stack.pop(); stack.push(stack.pop()<b);}}\r\n ,{name:\"<>\" ,xt:function(){ // <> ( a b -- f ) 比較 a 是否不等於 b\r\n stack.push(stack.pop()!==stack.pop());}}\r\n ,{name:\">=\" ,xt:function(){ // > ( a b -- f ) 比較 a 是否大於等於 b\r\n var b=stack.pop(); stack.push(stack.pop()>=b);}}\r\n ,{name:\"<=\" ,xt:function(){ // > ( a b -- f ) 比較 a 是否小於等於 b\r\n var b=stack.pop(); stack.push(stack.pop()<=b);}}\r\n ,{name:\"==\" ,xt:function(){ // == ( a b -- f ) 做必要轉換後, 比較 a 與 b 兩數是否相等\r\n stack.push(stack.pop()==stack.pop());}}\r\n ,{name:\"doCon\" ,xt:function(){ // doCon ( -- n ) 取隨後位址內數值 n\r\n stack.push(dictionary[ip]); ret();}}\r\n ,{name:\"constant\" ,xt:function(){ // constant ( <name> -- ) 定義常數名稱\r\n newname=nexttoken(); words.push({name:newname,xt:here}); compilecode(\"doCon\"); dictcompile(stack.pop());}}\r\n ,{name:\"doVar\" ,xt:function(){ // doVar ( -- a ) 取隨後位址 a\r\n stack.push(ip); ret();}}\r\n ,{name:\"variable\" ,xt:function(){ // variable ( <name> -- ) 定義變數名稱\r\n newname=nexttoken(); words.push({name:newname,xt:here}); compilecode(\"doVar\"); dictionary[here++]=0;}}\r\n ,{name:\"create\" ,xt:function(){ // create ( <name> -- ) 定義 memory 區塊名稱\r\n newname=nexttoken(); words.push({name:newname,xt:here}); compilecode(\"doVar\");}}\r\n ,{name:\"allot\" ,xt:function(){ // allot ( n -- ) 增加 n cells 擴充 memory 區塊\r\n var h=here; here+=stack.pop(); for(var i=h;i<here;i++)dictionary[i]=0;}}\r\n ,{name:\"@\" ,xt:function(){ // @ ( a -- n ) 從位址 a 取出 n\r\n stack.push(dictionary[stack.pop()]);}}\r\n ,{name:\"?\" ,xt:function(){ // ? ( a -- ) 印出位址 a 內的值\r\n systemtype(dictionary[stack.pop()]);}}\r\n ,{name:\"!\" ,xt:function(){ // ! ( n a -- ) 將 n 存入位址 a\r\n dictionary[stack.pop()]=stack.pop();}}\r\n ,{name:\"swap\" ,xt:function(){ // swap ( a b -- b a )\r\n var t=stack.length-1; var b=stack[t]; stack[t]=stack[t-1]; stack[t-1]=b;}}\r\n ,{name:\"nip\" ,xt:function(){ // nip ( a b -- b )\r\n stack[stack.length-2]=stack.pop();}}\r\n ,{name:\"rot\" ,xt:function(){ // rot ( a b c -- b c a )\r\n var t=stack.length-1; var a=stack[t-2]; stack[t-2]=stack[t-1]; stack[t-1]=stack[t]; stack[t]=a;}}\r\n ,{name:\"pick\" ,xt:function(){ // pick ( nj ... n1 n0 j -- nj ... n1 n0 nj )\r\n var t=stack.length-1; var j=stack[t]; stack[t]=stack[t-j-1];}}\r\n ,{name:\"roll\" ,xt:function(){ // roll ( nj ... n1 n0 j -- ... n1 n0 nj )\r\n var j=stack.pop();\r\n if(j>0){\r\n var t=stack.length-1;\r\n var nj=stack[t-j];\r\n for(i=j-1;i>=0;i--)\r\n stack[t-i-1]=stack[t-i];\r\n stack[t]=nj;}}}\r\n ,{name:\"doNext\" ,xt:function(){ // doNext ( nj ... n1 n0 j -- ... n1 n0 nj )\r\n var i=rstack.pop()-1; if(i>0){ip=dictionary[ip]; rstack.push(i); }\r\n else ip++;}}\r\n ,{name:\">r\" ,xt:function(){ // >r ( n -- )\r\n rstack.push(stack.pop());}}\r\n ,{name:\"r>\" ,xt:function(){ // r> ( -- n )\r\n stack.push(rstack.pop());}}\r\n ,{name:\"r@\" ,xt:function(){ // r> ( -- i )\r\n stack.push(rstack[rstack.length-1]);}}\r\n ,{name:\"for\" ,xt:function(){ // for\r\n compilecode(\">r\"); stack.push(here);},immediate:true}\r\n ,{name:\"next\" ,xt:function(){ // next\r\n compilecode(\"doNext\"); dictionary[here++]=stack.pop();},immediate:true}\r\n\r\n ,{name:\"does\" ,xt:function(){ \r\n dictionary[words[words.length-1].xt] =ip;\r\n compilecode(\"exit\");\r\n }}\r\n \r\n ,{name:\"doStr\" ,xt:function(){ // next\r\n stack.push(dictionary[ip++]);\r\n }}\r\n\r\n ,{name:'s\"' ,xt:function(){ // next\r\n var s=nexttoken('\"');\r\n //console.log('['+s+']');\r\n if (compiling) {\r\n compilecode(\"doStr\");\r\n dictcompile(s);\r\n } else {\r\n \tstack.push(s);\r\n }\r\n }\r\n ,immediate:true}\r\n ,{name:\".r\" ,xt:function(){ // .r ( i n -- )\r\n var n=stack.pop(); var i=stack.pop();\r\n i=i.toString(base);\r\n n=n-i.length;\r\n if(n>0)do{\r\n i=\"0\"+i;\r\n n--;}while(n>0);\r\n systemtype(i); }}\r\n ,{name:\"space\" ,xt:function(){\r\n systemtype(\" \");}}\r\n ,{name:\"canvas:\" , xt :function() { //create a context object\r\n \t var canvasid=nexttoken();\r\n \t var canvas=document.getElementById(canvasid);\r\n \t var c=canvas.getContext('2d');\r\n \t words.push({name:canvasid,xt:here}); \r\n \t compilecode(\"doCon\");\r\n \t dictcompile(c);\r\n \t compilecode(\"exit\");\r\n }}\r\n // cv :: lineTo\r\n ,{name:\"do::\", xt: function() { // do:: 執行object method\r\n \t var obj=stack.pop();\r\n \t var funcname=dictionary[ip++];\r\n \t var fn=obj[funcname];\r\n \t if (fn) execmethod(obj,fn);\r\n }}\r\n ,{name:\"::\" , xt: function() { // :: compile or run a object method\r\n var funcname=nexttoken();\r\n \t if (compiling) {\r\n \t \t var obj=dictionary[1+dictionary[here-1]]; // newly compiled canvas object\r\n \t \t if (obj[funcname]) {\r\n \t \t compilecode(\"do::\");\r\n \t \t dictcompile(funcname);\r\n \t \t } else {\r\n panic(\"? \"+funcname);\r\n \t \t }\r\n \t } else {\r\n var obj=stack.pop();\r\n var fn=obj[funcname];\r\n if (fn) execmethod(obj,fn); else panic(\"? \"+funcname);\r\n }\r\n },immediate:true}\r\n ,{name:\"do:!\", xt: function() { // do:! execute fetch a prop\r\n \t var obj=stack.pop();\r\n \t var propname=dictionary[ip++];\r\n \t var fn=obj[propname];\r\n \t obj[propname]=stack.pop();\r\n }}\r\n ,{name:\":!\" , xt: function() { // :! write a prop\r\n \t var propname=nexttoken();\r\n \t if (compiling) {\r\n \t \t compilecode(\"do:!\");\r\n \t \t dictcompile(propname);\r\n \t } else {\r\n \t \t var obj=stack.pop();\r\n \t \t obj[propname]=stack.pop() ;\r\n \t }\r\n },immediate:true}\r\n ,{name:\"do:@\", xt: function() { // do:! execute fetch a prop\r\n \t var obj=stack.pop();\r\n \t var funcname=dictionary[ip++];\r\n \t var fn=obj[funcname];\r\n \t stack.push( obj[propname] );\r\n }}\r\n ,{name:\":@\" , xt: function() { // :@ fetch a prop\r\n \t var propname=nexttoken();\r\n \t if (compiling) {\r\n \t \t compilecode(\"do:@\");\r\n \t \t dictcompile(propname);\r\n \t } else {\r\n \t var obj=stack.pop();\r\n \t stack.push( obj[propname] ) ;\r\n }\r\n },immediate:true} \r\n ,{name:'\\\\' , xt: function() { // comment out\r\n \t var comment=nexttoken('\\n');\r\n },immediate:true}\r\n\r\n ,{name:\"jseval\" , xt: function() { // evaluate a javascript function, return to TOS\r\n stack.push( eval(stack.pop() ) );\r\n }}\r\n \r\n ,{name:\"setTimeout\", xt: function() { // make a callback from a forth word\r\n \tvar ms=stack.pop();\r\n \tvar wid=stack.pop();\r\n timers.push(setTimeout( (function() {execute(words[wid].xt) } ), ms));\r\n }}\r\n ,{name:\"self\", xt: function() { // push the wid of current word on TOS , for setTimeout\r\n stack.push(words.length-1);\r\n }}\r\n ,{name:\"reboot\", xt: function() { // to a value\r\n \treset();\r\n \tcleartimers();\r\n \tdictionary=[];\r\n \there=0;\r\n }\t\r\n,immediate:true}\r\n \t\r\n ]\r\n this.exec= exec; // make exec become a public interface\r\n }", "title": "" }, { "docid": "910d771763bb04cfcb53563e8647d9c5", "score": "0.5080124", "text": "function M33() {\n}", "title": "" }, { "docid": "33335a0771b3ed2e9c953aeb1116f392", "score": "0.507754", "text": "function test0() {\r\n var obj0 = {};\r\n var arrObj0 = {};\r\n arrObj0.method0 = function () {\r\n arrObj0.prop0 += 1 /**bp(loc0):setFrame(1);evaluate('CollectGarbage();CollectGarbage();');**/\r\n }\r\n var l = 1;\r\n var m = 65536;\r\n var q = 1;\r\n l = (m * (1 - m));\r\n q ^= arrObj0.method0.call(obj0);\r\n}", "title": "" }, { "docid": "1d74a8725245c99b8c160d4e8c4213c8", "score": "0.5076333", "text": "function V4() {\n}", "title": "" }, { "docid": "9b7ba8eb11755cb27e769468a281d0b8", "score": "0.50759107", "text": "function AsmModule(stdlib) {\n \"use asm\";\n\n var m1 = stdlib.Math.fround; //Not operator testing\n\n function f1() {\n var x = m1(1.5);\n var y = 1;\n y = ~~~x;\n return y | 0;\n }\n\n return f1;\n}", "title": "" }, { "docid": "ed08e8b111c69c90b790216999bf571d", "score": "0.5074512", "text": "async function v14(v15,v16) {\n const v18 = 7;\n // v18 = .integer\n let v19 = 0;\n v7[65537] = v14;\n const v22 = \"prototype\" in Object;\n // v22 = .boolean\n for (let v26 = 0; v26 < -536870912; v26 = v26 + 1) {\n }\n const v27 = v19 + 1;\n // v27 = .primitive\n v19 = v27;\n }", "title": "" }, { "docid": "b6ad428a75e7b9b45352972afa639644", "score": "0.5069539", "text": "function foo() {\n return 1;\n}", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.50615394", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.50615394", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "5723ac47e0a9817e37394f59f391742b", "score": "0.50507396", "text": "function generateMemoryAccessBoilerplate(fn, ctx) {\n let code = '';\n\n const might_adjust_next_pc = true;\n code += generateStandardPCUpdate(fn, ctx, might_adjust_next_pc);\n\n // Memory instructions never cause a branch delay\n code += ctx.genAssert('c.delayPC === 0', 'delay pc should be zero');\n ctx.needsDelayCheck = false;\n\n if (accurateCountUpdating) {\n code += 'c.incrementCount(1);\\n';\n }\n\n // If bailOut is set, always return immediately\n assert(!ctx.bailOut, \"Not expecting bailOut to be set for memory access\");\n code += `if (c.stuffToDo) { return ${ctx.fragment.opsCompiled}; }\\n`;\n code += `if (c.pc !== ${toString32(ctx.postPC)}) { return ${ctx.fragment.opsCompiled}; }\\n`;\n return code;\n}", "title": "" }, { "docid": "5952aa0df225516cb25436e4d890981f", "score": "0.5046854", "text": "function fF(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "title": "" }, { "docid": "a7ee3a12e4baa6990d68fdfc1db6d04c", "score": "0.5043977", "text": "function isOptimized(fun) {\n return (%GetOptimizationStatus(fun) & (1 << 4)) != 0;\n}", "title": "" }, { "docid": "b9413b3579cf25bfa3cfdb317db18ff5", "score": "0.5038253", "text": "function createCode() {}", "title": "" }, { "docid": "36e88af55b007fa564fd144a06214b40", "score": "0.5025824", "text": "function c2_compile3 () {\n var p,to=this._to,result='(function (to,s,d3) {return function (d,i) {',\n vars = ['var me=this'],\n vars2 = [],\n interpolators = [],\n tween = [],\n compiled = this._compiled,\n not_same = false,\n cnt=0;\n\n if (compiled) {\n for (p in to) {\n if (compiled[p] !== to[p]) {\n not_same = true;\n break;\n }\n }\n if (not_same === false) {\n return this._compiled_fn;\n }\n }\n\n\n compiled = this._compiled = {};\n //right now tween is a function -- we want to try the following\n //[ln,property,v,t,s,instance,] //instance comes from parent -- shoudl be uneeded\n\n\n for (p in to) {\n compiled[p] = to[p];\n vars.push(\n 'v'+(cnt)+'='+ (typeof to[p] === 'function' && 'to[\"'+p+'\"].call(this,d,i)'||'to[\"'+p+'\"]'),\n 't'+(cnt)+'=typeof v'+cnt+' === \"number\"',\n 's'+cnt+'=this[\"'+p+'\"]'\n );\n vars2.push('v'+cnt,'t'+cnt,'s'+cnt);\n interpolators.push(\n 'if (t'+cnt+') {s'+cnt+'=s'+cnt+'||0;v'+cnt+'-=s'+cnt+';} else {v'+cnt+'=d3.interpolate(s'+cnt+',v'+cnt+');}'\n );\n //tween.push ('if (t'+cnt+') me[\"'+p+'\"]=s'+cnt+'+v'+cnt+'*t; else me[\"'+p+'\"]=v'+cnt+'(t);');\n tween.push ('if (t'+cnt+') n=s'+cnt+'+v'+cnt+'*t; else n=v'+cnt+'(t); n!==me[\"'+p+'\"] && (me[\"'+p+'\"]=n,!c && (c=true));');\n cnt++;\n }\n var s = (0,eval)(`\n (function (t,me,d3,${vars2.join(',')}) {var n,c=false;\n ${tween.join('')};\n c && ((me.children && me._not_invalid_) || (me.parentNode && me.parentNode._not_invalid_)) && me.invalidate();\n })\n `);\n /*\n *s2 = (0,eval)(`(function (t) {\n * s(t,this,${vars2.join(',')});\n *})`)\n */\n//shared2 = function (t,);\n result += vars.join(',') + ';';\n result += interpolators.join('');\n result += isChrome ? `return function (t) {s(t,me,d3,${vars2.join(',')})};` : \n `return function (t) {var n,c=false;\n ${tween.join('')};\n c && ((me.children && me._not_invalid_) || (me.parentNode && me.parentNode._not_invalid_)) && me.invalidate();\n }`\n //result += 'return function (t) {';\n //vars2.join(',') + ';';\n\n //result += tween.join('');\n //result += '(me.children && me._not_invalid_) || (me.parentNode && me.parentNode._not_invalid_) && me._invalidate();'\n //result += 'm._not_invalid_&&m.parentNode &&m._invalidate();';\n //result += 'm._invalidate();';\n //result += '}';\n //result += `return shared.bind(me,t,me,${vars2.join(',')})`\n //result += 'return function () {}'\n\n result += '}})';\n return this._compiled_fn = (0,eval)(result)(to,s,c2.d3);\n}", "title": "" }, { "docid": "50d638b4bb130724243f0c59d056caf9", "score": "0.50170493", "text": "function foo (){ }", "title": "" }, { "docid": "2e2e3b68e3e3a0646b609abb42e84ec2", "score": "0.5014403", "text": "function o0(stdlib,o1,o49) {\n try {\n\"use asm\";\n}catch(e){}\n var o2 = stdlib.DataView.prototype.[];\n //views\n var o3 =new stdlib.Float64Array(buffer);\n\n function o4(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no11.get = o6;\n}catch(e){}\n try {\nreturn +(o1(\"redirectCount\") > 0[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "0df309ae3cd0145de05c627fecf6e675", "score": "0.5013156", "text": "function foo(){\n return 1;\n}", "title": "" } ]
53f51ddab11a7c82414cac87b361c28e
Runtime helper for rendering
[ { "docid": "5e66ff97a95674cb311b0d652c223b17", "score": "0.0", "text": "function renderSlot (\r\n name,\r\n fallback,\r\n props,\r\n bindObject\r\n ) {\r\n var scopedSlotFn = this.$scopedSlots[name];\r\n var nodes;\r\n if (scopedSlotFn) { // scoped slot\r\n props = props || {};\r\n if (bindObject) {\r\n if (!isObject(bindObject)) {\r\n warn(\r\n 'slot v-bind without argument expects an Object',\r\n this\r\n );\r\n }\r\n props = extend(extend({}, bindObject), props);\r\n }\r\n nodes = scopedSlotFn(props) || fallback;\r\n } else {\r\n nodes = this.$slots[name] || fallback;\r\n }\r\n\r\n var target = props && props.slot;\r\n if (target) {\r\n return this.$createElement('template', { slot: target }, nodes)\r\n } else {\r\n return nodes\r\n }\r\n }", "title": "" } ]
[ { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.8101097", "text": "function render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7970649", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7970649", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.7970649", "text": "render() {}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.7546174", "text": "render () {}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.7532723", "text": "render(){}", "title": "" }, { "docid": "ca32b4a929be7d39d5be725bf5c059e2", "score": "0.74118465", "text": "function render () {\n\n\t}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.74088156", "text": "render() { }", "title": "" }, { "docid": "6bfa2715be4bc3ed814e97fc202bb936", "score": "0.7384591", "text": "render() {\n \n }", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7255686", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7255686", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7255686", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "23e71342fc3fd06f8eb8cf88e5a0e5a7", "score": "0.7234448", "text": "render() {return null}", "title": "" }, { "docid": "8c47bf9a7db2501fec446319c0426e3d", "score": "0.72231996", "text": "_render({}) {\n return html`\n <div>waaaaa</div>\n `;\n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.72059643", "text": "function render() {\n\n}", "title": "" }, { "docid": "f99d363400e1484dcc327d479047e977", "score": "0.714084", "text": "function render()\n{\n}", "title": "" }, { "docid": "77e0dba3247a7a46f7ebe69203327b9c", "score": "0.7106695", "text": "render () {\n\n }", "title": "" }, { "docid": "27dc5213ecbc1016f1ed706505e01a1a", "score": "0.70756656", "text": "render(){return html``}", "title": "" }, { "docid": "1c4e39e8ebcd58215474d33ca848fd0b", "score": "0.7055319", "text": "render()\n {\n return <div>{this.renderHelper()}</div>\n }", "title": "" }, { "docid": "534f4c3876534191a887ffbbe24360b3", "score": "0.69987273", "text": "render(value) {\n throw 'not implemented';\n }", "title": "" }, { "docid": "4be4af5034675452e0a61fc059a77686", "score": "0.68730235", "text": "render()\n {\n \n\n }", "title": "" }, { "docid": "2e04e5de8621b1246fc8aa5b8153cba1", "score": "0.6863863", "text": "render()\n {\n\n }", "title": "" }, { "docid": "528826733fd7d0faf0ee6d287abe8336", "score": "0.6863618", "text": "render () {\n this.log('render()')\n return this.actualRender()\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.68527985", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.68527985", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.68527985", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.68527985", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.68527985", "text": "render() {\n\n }", "title": "" }, { "docid": "4c8c976406f8012f2db5f2ed6e795289", "score": "0.68489116", "text": "function Renderable() {}", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68321025", "text": "render() {\n }", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68321025", "text": "render() {\n }", "title": "" }, { "docid": "12a434792e443218211280a8c66ef1af", "score": "0.6688323", "text": "render(data) {\n\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6670414", "text": "_onRender() {}", "title": "" }, { "docid": "56f139c31ec689f7c15259c4b2c9e216", "score": "0.6670374", "text": "renderToHTML() {\n return \"<div>\"+this.content+\"</div>\";\n }", "title": "" }, { "docid": "613a99fe41741c4aa233aee50ada89e9", "score": "0.66296834", "text": "render() {\n\t\treturn <div/>\n\t}", "title": "" }, { "docid": "e3b8514508a53fbe6d4a51ca1b63cda5", "score": "0.6623674", "text": "render() {\n return html``;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.66158843", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.66158843", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.66158843", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "a63337f2020961acfb782d811e9eb6ab", "score": "0.6607013", "text": "render() {\n return this.renderContent();\n }", "title": "" }, { "docid": "bae70cc5194b8d486d854d1704fd1cea", "score": "0.6591644", "text": "function Renderable() {\n\n }", "title": "" }, { "docid": "643584d180c74f1bf93146754c908527", "score": "0.6583475", "text": "Render(){\n\n }", "title": "" }, { "docid": "fde0be9bc771b712eb81f5826c79a2d5", "score": "0.6551421", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "9d0440fd060f1bda4a6792f1201da602", "score": "0.6538938", "text": "function Renderable() {\n \n }", "title": "" }, { "docid": "6910a8b312c4c9e61905b40e03159258", "score": "0.6519302", "text": "render () {\n return ''\n }", "title": "" }, { "docid": "c877af767285994f11c8e05bbcd6630e", "score": "0.6494974", "text": "render() {\n // How will UI tree / expression be encoded?\n return (null);\n }", "title": "" }, { "docid": "24ef9364c6a734e0826b8f64d6586337", "score": "0.64328015", "text": "get render() {\r\n\t\treturn this.renderFull();\r\n\t}", "title": "" }, { "docid": "ea43b72be10ab14e4950c15a297a7c0a", "score": "0.64290476", "text": "function render() {\n console.warn('Component ' + this.id() + ' must override render()');\n return '<div></div>';\n }", "title": "" }, { "docid": "11c76525d99f2d6195f928e1aeaf1a58", "score": "0.6425534", "text": "render() {\n if (!this._renderFunc) {\n if (this._companionObj) {\n throw(new Error(\"You must define a render function with .fill()\"));\n }\n else {\n throw(new Error(\"You must override render() in descendant classes\"));\n }\n }\n else {\n return this._renderFunc(this._companionObj);\n }\n }", "title": "" }, { "docid": "c95fdebe50ad09c18cc96d06a4835905", "score": "0.641035", "text": "render() {\n return this.template;\n }", "title": "" }, { "docid": "34f0a07fd5adeff7287776c71138385b", "score": "0.64076316", "text": "renderToHTML() {\n return '<p>'+this.content+'</p>'\n }", "title": "" }, { "docid": "e4fde00acd17096d7d9b3891dde3c6f9", "score": "0.64041185", "text": "render() { return super.render(); }", "title": "" }, { "docid": "3702809eae44b435a50018d3da52f0e4", "score": "0.63946295", "text": "function render () {\n renderBody()\n}", "title": "" }, { "docid": "c851556db1c55fff39eb2bed05073b94", "score": "0.63845134", "text": "render() {\n return null\n }", "title": "" }, { "docid": "c851556db1c55fff39eb2bed05073b94", "score": "0.63845134", "text": "render() {\n return null\n }", "title": "" }, { "docid": "b8462b11a23756200af0a725ce4fecb0", "score": "0.6381599", "text": "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{this.renderContent()}\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "0048f00c2fd8d156564656f895ba31ec", "score": "0.63766944", "text": "preRender() { }", "title": "" }, { "docid": "e6e9d3eb8e3b6dfa8207640af2325c0c", "score": "0.63627154", "text": "render() {\n return _litElement.html``;\n }", "title": "" }, { "docid": "1b7e901b1d56d991310b41bbdeda42b5", "score": "0.63362384", "text": "render() {\n return html`<p>your ${this.adjective} template-here</p>`;\n }", "title": "" }, { "docid": "cb7f8594e8eb66f9e0c70a30315bd81b", "score": "0.6332249", "text": "_render() {\n if (this._template && this.renderer) this.renderer(this._template.apply(this, this.getTemplateArgs()), this.element);\n }", "title": "" }, { "docid": "d53dca5ea3b958b5e1d0a48126377bb7", "score": "0.633171", "text": "preRendering() {}", "title": "" }, { "docid": "0d19d6e09b2ecb269f522b03490e51b2", "score": "0.63225025", "text": "render (h) { return h('p') }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310488", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310488", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "a197bb9a564cded0e6656e189204d649", "score": "0.6292769", "text": "postRendering() {}", "title": "" }, { "docid": "c96de6227a7e85138e7c1057d2abf48b", "score": "0.6284919", "text": "render() {\n return `<li> ${this.text} </li>`\n }", "title": "" }, { "docid": "66a7a674ba9de6b72ef5e94f5a4f7d56", "score": "0.6256846", "text": "render() {\n this.domElement && (this.domElement.innerHTML = this.renderTemplate());\n }", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.62561727", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "859dd7d281943c1c52a30e396e05ce32", "score": "0.6247201", "text": "renderHtml(markup) {\n return {__html: markup};\n }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62457335", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62457335", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62457335", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "ded9a932fd5fd5d09e9395625d138b4d", "score": "0.62453467", "text": "preRender() {\n }", "title": "" }, { "docid": "79976329f8302d6a9d7e2cf148ab2469", "score": "0.62367475", "text": "doRender( comps ) {\n }", "title": "" }, { "docid": "23b31d703ddcd3c1895cf1f479d47760", "score": "0.6218389", "text": "onRender(){}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61942744", "text": "willRender() {}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61942744", "text": "willRender() {}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61942744", "text": "willRender() {}", "title": "" }, { "docid": "0f4a93a39627acf23f006cb844fb9da3", "score": "0.61895037", "text": "render() {\n throw new Error('Extending class should implement #render');\n }", "title": "" }, { "docid": "d0a45c6f4d95e49e7d08848750addfd2", "score": "0.6183716", "text": "renderElement() {\n\t\tthis.associatedData = { id: this.id };\n\t\tconst associatedData = this.associatedData;\n\t\tassociatedData.htmlPath = this.component.htmlPath;\n\t\tassociatedData.cssPath = this.component.cssPath;\n\t\tassociatedData.jsPath = this.component.jsPath;\n\n\t\t_common_WebFormHandler__WEBPACK_IMPORTED_MODULE_2__[\"default\"].associateHandler(this, associatedData);\n\n\t\tif (this.isBuilderMode) {\n\t\t\t// add later\n\t\t}\n\n\t\tthis.delayRender();\n\n\t\tlet mainStyle = '';\n\t\tif (this.component.styles) {\n\t\t\tmainStyle = _common_StyleGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].toString(\n\t\t\t\t_common_StyleGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].parseStyle(this.component.styles.main),\n\t\t\t);\n\t\t}\n\t\tlet cssclass = this.component.cssClass;\n\t\tif (cssclass == null) cssclass = '';\n\n\t\tlet result = '';\n\t\tlet path = this.component.htmlPath;\n\t\tif (path == null || path === '') path = 'not defined';\n\n\t\tif (this.isBuilderMode) {\n\t\t\tif (path === 'not defined') {\n\t\t\t\tresult = Object(_templates_placeholder_ejs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])({\n\t\t\t\t\tmessage: 'Please Provide a valid custom HTML path',\n\t\t\t\t\ticon: 'html5',\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tresult = `<div class=\"outsideHTML-builder ${cssclass}\" style='${mainStyle}'>Custom HTML, path: ${path}</div>`;\n\t\t\t}\n\t\t} else {\n\t\t\tresult = `<div class=\"outsideHTML ${cssclass}\" style='${mainStyle}'></div>`;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "6e3b9d0539e54abca3dc64d612a42347", "score": "0.61656535", "text": "render() {\n return <div>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6161611", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "f5e31ceb93c32a41482596c6c4a592cc", "score": "0.61469364", "text": "render(){\n return <span>Hello Priyanka<Mahima/></span>\n }", "title": "" }, { "docid": "51dee838b3cb30c64c6f0677fb231d4e", "score": "0.6141849", "text": "_firstRendered() {\n\n }", "title": "" }, { "docid": "e06a383246536a532f1629b4cdad40dd", "score": "0.6140303", "text": "render() {\n const classes = {\n 'primary': this.primary,\n 'emphasis': this.emphasis,\n 'accent': this.accent,\n 'disabled': this.disabled,\n 'error': this.error,\n 'success': this.success,\n 'advisory': this.advisory\n }\n\n return html`\n <div class=\"${classMap(classes)}\">\n <div class=\"util_displayHiddenVisually\">\n <slot></slot>\n </div>\n <slot name=\"icon\">${this.svg}</slot>\n </div>\n `;\n }", "title": "" }, { "docid": "a83aa084f483ab862609658e5efefa36", "score": "0.61328316", "text": "renderEngineer() {\n // setting data argument into a variable\n let e = this.data;\n // returning html structure using methods from data argument\n return `\n\t<!-- Engineer Template -->\n\t<div class=\"card employeeCard\" style=\"width: 18rem\">\n\t\t<div class=\"card-body bg-primary text-white\">\n\t\t\t<h3 class=\"card-title\">${e.getName()}</h3>\n\t\t\t<h5><i class=\"fas fa-mug-hot\"></i> ${e.getRole()}</h5>\n\t\t</div>\n\t\t<div class=\"mx-3 my-5\">\n\t\t\t<ul class=\"list-group\">\n\t\t\t\t<li class=\"list-group-item\">ID: ${e.getID()}</li>\n\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\tEmail: <a href=\"mailto:${e.getEmail()}\">${e.getEmail()}</a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"list-group-item\">GitHub: <a href=\"https://github.com/${e.getGithub()}\">${e.getGithub()}</a></li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t`;\n }", "title": "" }, { "docid": "cc58215aba62f4ab71be2b6e664a3906", "score": "0.6122781", "text": "function render() {\n\t\trenderResult = navTpl;\n\t\t$renderResult = $(renderResult);\n\t\t// bind data here if required \n\t\treturn navTpl;\n\t}", "title": "" }, { "docid": "c2645d83428ab9302bbc709c1e852d67", "score": "0.61014974", "text": "postRender() {\n }", "title": "" }, { "docid": "2ed8b323860f056308e3e5672f2d0777", "score": "0.6100224", "text": "preRender() {\n\n }", "title": "" }, { "docid": "624e38a287a4923f5451affdd1f8f2b5", "score": "0.60856223", "text": "render(){\n this.inheritState();\n let out = '';\n switch (this.type) {\n case 'text':\n out += this.evalExpression(this.data);\n break;\n case 'directive':\n out += '<' + this.data + '>';\n break;\n case 'comment':\n out += '<!-- ' + this.evalExpression(this.data) + '-->';\n break;\n default: {\n let isClosing = (Node.isClosingTag(this.name) && !this.children.length),\n isDeclarative = Node.isDeclarative(this.name);\n\n // Allow dynamic changing of tags\n if (this.attributes['@tag']) {\n let replaceTag = this.evalExpression(this.attributes['@tag']);\n if (replaceTag && replaceTag !== 'undefined') {\n this.name = replaceTag;\n }\n }\n\n out += '<' + this.name + this.getAttributeString() + ((isClosing && !isDeclarative) ? ' /' : '') + '>';\n if (!isClosing) {\n out += Node.renderArray(this.children);\n out += '</' + this.name + '>';\n }\n }\n break;\n }\n this.pushState();\n return out;\n }", "title": "" }, { "docid": "0e71f5c36070fa849f9e32c3d6a925d5", "score": "0.6073332", "text": "function ConsoleRender() {}", "title": "" }, { "docid": "cf93aa53432f8d54b4ae8ead8969db8e", "score": "0.6070727", "text": "postRender() {\n\n }", "title": "" }, { "docid": "f31aa9946bf992760be5ebd962512fda", "score": "0.6070014", "text": "_render() {\n var self = this;\n self.$el.html( self.template( self.data ) );\n }", "title": "" }, { "docid": "6cc2f4a0bbdcea450ea3d8f499dc1768", "score": "0.60655856", "text": "function render ($$) {\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\n var _ref = undefined;\n var _res = '';\n var _i = 0;\n var __extends__ = null;\n \n _res += 'var _require = function (mod) { \\n if ((typeof mod === \\\"object\\\") && (mod.render != null))\\n return mod;\\n return ';\n _res += ((_ref = $default.call($$,$$.require_exp, \"require\")) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '(mod);\\n};\\nvar __last_ctx__ = null;\\n\\nvar __indexOf = [].indexOf || function(x) {\\n for (var i = this.length - 1; i >= 0; i--)\\n if (this[i] === x) return i;\\n};\\n\\nif (!Object.keys) Object.keys = function(o){\\n if (o !== Object(o))\\n throw new TypeError(\\'Object.keys called on non-object\\');\\n var ret=[],p;\\n for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);\\n return ret;\\n}\\n\\n';\n (function() {var _fref = $$.utils || [], _prev_loop = $$.loop, _prev_key = $$['fname'], _prev_value = $$['fn'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fname'] = _fref[i]; $$['fn'] = i;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fname'] = x;$$['fn'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fname'] = _prev_key; $$['fn'] = _prev_value;})();\n _res += '\\n';\n (function() {var _fref = $$.filters_used || [], _prev_loop = $$.loop, _prev_key = $$['fn_name'], _prev_value = $$['decl'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fn_name'] = _fref[i]; $$['decl'] = i;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fn_name'] = x;$$['decl'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fn_name'] = _prev_key; $$['decl'] = _prev_value;})();\n _res += '\\n';\n if ($$.blocks) {\n _res += '// Start Block Definitions\\n\\n';\n (function() {var _fref = $$.blocks || [], _prev_loop = $$.loop, _prev_key = $$['name'], _prev_value = $$['contents'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['name'] = _fref[i]; $$['contents'] = i;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['name'] = x;$$['contents'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['name'] = _prev_key; $$['contents'] = _prev_value;})();\n _res += '\\n// End Block Definitions\\n';\n }\n _res += '// RENDERING FUNCTION, EVERYTHING HAPPENS HERE.\\nfunction render ($$) {\\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\\n var _ref = undefined;\\n var _res = \\'\\';\\n var _i = 0;\\n var __extends__ = null;\\n var require = _require;\\n ';\n if ($$.blocks) {\n _res += ' var _b = null;\\n ($$.__blocks__ == null) && ($$.__blocks__ = {});\\n _b = $$.__blocks__;\\n var __newblocks__ = {};\\n var _block_iterator = null;\\n ';\n }\n _res += ' ';\n _res += ((_ref = $$.body) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\\n return _res;\\n}\\nexports.render = render;\\n\\nfunction _cached_ctx () {\\n if (!__last_ctx__) {\\n __last_ctx__ = {};\\n render(__last_ctx__);\\n }\\n return __last_ctx__;\\n}\\nexports._cached_ctx = _cached_ctx;\\n';\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\n return _res;\n}", "title": "" }, { "docid": "6cc2f4a0bbdcea450ea3d8f499dc1768", "score": "0.60655856", "text": "function render ($$) {\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\n var _ref = undefined;\n var _res = '';\n var _i = 0;\n var __extends__ = null;\n \n _res += 'var _require = function (mod) { \\n if ((typeof mod === \\\"object\\\") && (mod.render != null))\\n return mod;\\n return ';\n _res += ((_ref = $default.call($$,$$.require_exp, \"require\")) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '(mod);\\n};\\nvar __last_ctx__ = null;\\n\\nvar __indexOf = [].indexOf || function(x) {\\n for (var i = this.length - 1; i >= 0; i--)\\n if (this[i] === x) return i;\\n};\\n\\nif (!Object.keys) Object.keys = function(o){\\n if (o !== Object(o))\\n throw new TypeError(\\'Object.keys called on non-object\\');\\n var ret=[],p;\\n for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);\\n return ret;\\n}\\n\\n';\n (function() {var _fref = $$.utils || [], _prev_loop = $$.loop, _prev_key = $$['fname'], _prev_value = $$['fn'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fname'] = _fref[i]; $$['fn'] = i;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fname'] = x;$$['fn'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fname'] = _prev_key; $$['fn'] = _prev_value;})();\n _res += '\\n';\n (function() {var _fref = $$.filters_used || [], _prev_loop = $$.loop, _prev_key = $$['fn_name'], _prev_value = $$['decl'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fn_name'] = _fref[i]; $$['decl'] = i;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fn_name'] = x;$$['decl'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fn_name'] = _prev_key; $$['decl'] = _prev_value;})();\n _res += '\\n';\n if ($$.blocks) {\n _res += '// Start Block Definitions\\n\\n';\n (function() {var _fref = $$.blocks || [], _prev_loop = $$.loop, _prev_key = $$['name'], _prev_value = $$['contents'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['name'] = _fref[i]; $$['contents'] = i;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['name'] = x;$$['contents'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['name'] = _prev_key; $$['contents'] = _prev_value;})();\n _res += '\\n// End Block Definitions\\n';\n }\n _res += '// RENDERING FUNCTION, EVERYTHING HAPPENS HERE.\\nfunction render ($$) {\\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\\n var _ref = undefined;\\n var _res = \\'\\';\\n var _i = 0;\\n var __extends__ = null;\\n var require = _require;\\n ';\n if ($$.blocks) {\n _res += ' var _b = null;\\n ($$.__blocks__ == null) && ($$.__blocks__ = {});\\n _b = $$.__blocks__;\\n var __newblocks__ = {};\\n var _block_iterator = null;\\n ';\n }\n _res += ' ';\n _res += ((_ref = $$.body) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\\n return _res;\\n}\\nexports.render = render;\\n\\nfunction _cached_ctx () {\\n if (!__last_ctx__) {\\n __last_ctx__ = {};\\n render(__last_ctx__);\\n }\\n return __last_ctx__;\\n}\\nexports._cached_ctx = _cached_ctx;\\n';\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\n return _res;\n}", "title": "" }, { "docid": "05f8809dbadb1120a01384651f0d5037", "score": "0.6065464", "text": "toHtml() {\n var node = this.render();\n return node ? node.toHtml() : '';\n }", "title": "" }, { "docid": "0627883e7e5e9b5d09700f08556724af", "score": "0.6051942", "text": "renderNode(node)\n {\n\n }", "title": "" }, { "docid": "00df6ecf882a2cea240e8c040121a60f", "score": "0.60518384", "text": "render() {\n return \"something went wrong\"\n }", "title": "" }, { "docid": "b90aedbcdbaaa5915ec6d982dd3f36ec", "score": "0.6048858", "text": "function render() {\n // create a variable that is the result of what generateHTML gets and make into a string via .join\n const html = generateHTML().join(\"\");\n $ulEl.html(html);\n}", "title": "" }, { "docid": "ea65e4a210fe7f553cad51f7be5d5031", "score": "0.603618", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "964b8ee6dd6bff9116b3a78674625e33", "score": "0.6016021", "text": "render() {\r\n return(BodyJSX.call(this));\r\n }", "title": "" } ]
8f21c4b9c85705490022bbc7f7f3d6d2
Depth First Searchlike: send flow at along path from from>to recursively while increasing the level of the visited vertices by one
[ { "docid": "6db228a6b2c29b6810c53557d62cccd8", "score": "0.5984935", "text": "calcFlow(start, end, targetFlow, count) {\n if (start === end) { // Sink reached , abort recursion\n return targetFlow;\n }\n let edge;\n let flowTillHere = 0;\n let flowToT = 0;\n while (count[start] < this.edges[start].length) { // Visit all edges of the vertex one after the other\n edge = this.edges[start][count[start]];\n if (this.level[edge.to] === this.level[start] + 1 && edge.flow < edge.capacity) {\n // Edge leads to Vertex with a level one higher, and has flow left\n flowTillHere = Math.min(targetFlow, edge.capacity - edge.flow);\n flowToT = this.calcFlow(edge.to, end, flowTillHere, count);\n if (flowToT > 0) {\n edge.flow += flowToT; // Add Flow to current edge\n // subtract from reverse Edge -> Residual Graph neg. Flow to use backward direction of BFS/DFS\n this.edges[edge.to][edge.resEdge].flow -= flowToT;\n return flowToT;\n }\n }\n count[start]++;\n }\n return 0;\n }", "title": "" } ]
[ { "docid": "aa1e4cf960051a7b55440354b3bcc243", "score": "0.75165725", "text": "recursePath(from, to, visited = [], path = []) {\n //if there is no from return false\n if (this.v < from || from < 0) return false;\n //if from has no out edges return false\n if (!this.adList[from]) return false;\n\n //init visited\n visited = visited.slice(0);\n visited.push(from);\n\n //init path\n path = path.slice(0);\n\n //base case #1 : from and to are the same\n if (from === to) return path;\n //base case #2 : from and to are adjacent\n let adjacentNode = this.adList[from].search({ to: to });\n if (adjacentNode) {\n let newPath = path.slice(0);\n newPath.push(adjacentNode);\n return newPath;\n }\n let recursions = []; //clean this up later\n //there are no places to go that haven't been visited\n this.adList[from].forEach(edge => {\n //base case #2 : from and to are adjacent\n // if (edge.to === to) {\n // //add this edge\n // let newPath = path.slice(0);\n // newPath.push(edge);\n // recursions.push(newPath);\n // }\n //for each adjacent vertices call is recursePath\n if (visited.includes(edge.to)) {\n //do nothing, we've been there before\n } else {\n //add this edge\n let newPath = path.slice(0);\n newPath.push(edge);\n recursions.push(this.recursePath(edge.to, to, visited, newPath));\n }\n });\n //filter out paths that didn't work\n recursions = recursions.filter(trip => trip);\n\n if (recursions.length) {\n //there is at least one path\n //find the shortest path\n let min = recursions[0].reduce((total, edge) => total + edge.weight, 0);\n\n recursions = recursions.reduce((shortest, trip, i) => {\n let tripTotal = trip.reduce((total, edge) => total + edge.weight, 0);\n // console.log(`tripTotal = ${tripTotal}`);\n if (tripTotal < min) {\n min = tripTotal;\n return trip;\n }\n return shortest;\n });\n //add a virtual edge\n this.addEdge(from, to, min);\n return recursions;\n }\n return false;\n }", "title": "" }, { "docid": "b7461f7781848e2cf571e9727d2fce56", "score": "0.7213508", "text": "isReachable(from, to, visited = []) {\n //if there is no from return false\n if (this.v < from || from < 0) return false;\n //if from has no out edges return false\n if (!this.adList[from]) return false;\n\n //init visited\n visited = visited.slice(0);\n visited.push(from);\n //base case #1 : from and to are the same\n if (from === to) return true;\n //base case #2 : from and to are adjacent\n if (this.adList[from].search({ to: to })) {\n return true;\n }\n let recursions = []; //clean this up later\n //there are no places to go that haven't been visited\n this.adList[from].forEach(edge => {\n //for each adjacent vertices call is reachable\n if (visited.includes(edge.to)) {\n //do nothing\n } else {\n recursions.push(this.isReachable(edge.to, to, visited));\n }\n });\n if (recursions.includes(true)) return true;\n return false;\n }", "title": "" }, { "docid": "24a6ea7bb747b6d9cbceb17622be766b", "score": "0.68943906", "text": "depthFirstIterative(start) {\n //the stack will keep track of each individual vertex\n let stack = [start];\n //returns all the vertices visited\n let result = [];\n //will determine if a vertex has been visited\n let visited = {};\n //stores the current vertex being checked\n let currentVertex;\n //set the starting vertex to be visited within the visited object\n visited[start] = true;\n\n //while we have something in the stack (vertices) then we'll loop through and find other vertices\n while (stack.length) {\n currentVertex = stack.pop();\n result.push(currentVertex);\n //use a foreach loop again to traverse all the neighbors (connections) to other vertices\n this.adjacencyList[currentVertex].forEach((neighbor) => {\n //if we have not visited that vertex then we'll set it to be visited\n if (!visited[neighbor]) {\n visited[neighbor] = true;\n stack.push(neighbor);\n }\n });\n }\n console.log(\"DFS Iterative \", result);\n return result;\n }", "title": "" }, { "docid": "24a419da106a70826ca746c1759c3fe1", "score": "0.68519115", "text": "function DFS(nodes, u, d, traverse,cycle){\n\n u.color = \"grey\";\n\n //console.log(\"u: \"+u.data);\n d++;\n u.distance = d;\n //console.log(\"u.distance:\"+u.distance);\n\n\n\n for (var i =0; i<u.neighbour.length;i++){\n\n //console.log(\"u+neighbour:\"+u.data);\n\n // get an array of vertices whose child is being checked\n if (u.data != traverse[traverse.length-1]){\n traverse.push(u.data);\n }\n\n\n if (nodes[u.neighbour[i]].color == \"white\"){\n\n nodes[u.neighbour[i]].parent = u;\n\n // recursivly call DFS\n DFS(nodes,nodes[u.neighbour[i]],d,traverse,cycle);\n\n }\n // meet a cycle\n else\n { // condition of meet a cycle(source node was involved)\n if (u.parent==null && nodes[u.neighbour[i]].color == \"grey\" ){\n //console.log(\"meet a ring of \"+ring);\n console.log(u.data+\" \"+u.neighbour[i]+\"form a ring\");\n //var ring = u.distance-nodes[i].distance;\n\n var add = [u.data,u.neighbour[i]];\n add2cycle(cycle,add);\n\n\n }\n // condition of meet a cycle(source node was not involved)\n else if(nodes[u.neighbour[i]].color == \"grey\" && u.neighbour[i] != u.parent.data){\n //console.log(\"meet a ring of \"+ring);\n console.log(u.data+\" \"+u.neighbour[i]+\"form a ring\");\n //var ring = u.distance-nodes[i].distance;\n\n var add = [u.data,u.neighbour[i]];\n add2cycle(cycle,add);\n }\n\n\n }\n\n }\n\n\n\n }", "title": "" }, { "docid": "27dc04ee43385bbba34a20fd1263a634", "score": "0.6722464", "text": "function dfs(graph, start, toFind, visited = new Set()) {\n console.log(start);\n const destinations = graph.getEdges(start);\n visited.add(start);\n\n for (const destination of destinations) {\n if (destination === toFind) {\n console.log('!! We found !!', toFind, 'in', visited.size, ' steps');\n return;\n }\n if (!visited.has(destination)) {\n dfs(graph, destination, toFind, visited);\n }\n }\n}", "title": "" }, { "docid": "76c2e424e57cbc9a6e8331ea5e568315", "score": "0.67181575", "text": "depthFirstTraversalRecursive(startingVertex, visited = new Set()) {\n\n if(visited.has(startingVertex)) return;\n visited.add(startingVertex);\n\n this.adjacentList[startingVertex].forEach((neighbor)=> {\n this.depthFirstTraversalRecursive(neighbor, visited);\n })\n return Array.from(visited);\n }", "title": "" }, { "docid": "2c346c8a704574aa287526d0bb57ff15", "score": "0.66215605", "text": "depthFirstTraversal(callback, start = this.vertices[0], visitedVertices = [start]) {\n callback(start);\n start.edges.forEach((edge) => {\n const neighbour = edge.end;\n if (!visitedVertices.includes(neighbour)) {\n // the visitedVertices list ensures we don't enter an infinate loop \n // when the traversal encounters a cycle or it's neighbour has already been visited\n visitedVertices.push(neighbour);\n this.depthFirstTraversal(callback, neighbour, visitedVertices);\n }\n });\n }", "title": "" }, { "docid": "14c44a39c5c5684998d1b4fe34ce6eb6", "score": "0.66075593", "text": "createLevelGraph(from, to) {\n if (to >= this.totalVertices) {\n return false;\n }\n this.level.fill(-1); // reset old levels\n this.level[from] = 0;\n const q = []; // queue with s as starting point\n q.push(from);\n let u = 0;\n let edge = null;\n while (q.length) {\n u = q.shift();\n for (edge of this.edges[u]) {\n if (this.level[edge.to] < 0 && edge.flow < edge.capacity) {\n this.level[edge.to] = this.level[u] + 1;\n q.push(edge.to);\n }\n }\n }\n return this.level[to] >= 0; // return if theres a path, no level, no path!\n }", "title": "" }, { "docid": "11220d6b647a61ad015f6b11ca7f53ef", "score": "0.65677273", "text": "depthFirstIterative(start) {\n const stack = [start]\n const result = []\n const visited = {}\n\n visited[start] = true\n\n while (stack.length) {\n let currentVertex = stack.pop()\n\n result.push(currentVertex)\n\n this.adjacencyList[currentVertex].forEach(neighbor => {\n if (!visited[neighbor]) {\n visited[neighbor] = true\n\n stack.push(neighbor)\n }\n })\n }\n\n return result\n }", "title": "" }, { "docid": "2079ce32b3afdb18aebf0900b72a624f", "score": "0.65655667", "text": "DFSRecursive(start) {\n const result = [];\n const visited = {};\n const dfs = (vertex) => {\n visited[vertex] = true;\n result.push(vertex);\n this.list[vertex].forEach((neighbor) => {\n if (!visited[neighbor]) {\n dfs(neighbor);\n }\n });\n };\n\n dfs(start);\n return result;\n }", "title": "" }, { "docid": "47ae353ab45349645e2fe6303bf9f53f", "score": "0.65448165", "text": "function dfs(start, visited = new Set()) {\n // console.log(start)\n visited.add(start);\n\n const destinations = adjacencyList.get(start);\n\n for (const destination of destinations) {\n\n if (destination === 'BKK') { \n console.log(`DFS found Bangkok`)\n return;\n }\n \n if (!visited.has(destination)) {\n dfs(destination, visited);\n }\n }\n}", "title": "" }, { "docid": "75ecc203ee481be82b78aba143cf5cb8", "score": "0.64958775", "text": "function findPathway(m, start, end) {\n // DFS \n var loop = function (current, array) {\n array.push(current.index);\n \n for(var i = 0; i < current.connectTo.length; i++) {\n // we do not want to loop back\n if (array.includes(current.connectTo[i]))\n continue;\n \n // recursion\n var a = loop(m[current.connectTo[i]], JSON.parse(JSON.stringify(array)));\n \n if (a.includes(end.index))\n return a;\n }\n return array;\n }\n\n return loop(start, []);\n}", "title": "" }, { "docid": "e85bf99ab05d08b3ae97fcf3032ea454", "score": "0.6461876", "text": "function depth_limited_search(initial_state, depth_limit) {\r\n\r\n /***Your code for depth-limited search here!***/\r\n\r\n /***DO NOT do repeated state or loop checking!***/\r\n\r\n /*\r\n Hint: You may implement DLS either iteratively (with open set) or recursively.\r\n \r\n In the iterative case, you will need to do similar to breadth-first search and augment\r\n the state. In addition to predecessor and action, you will also need to store depth.\r\n (You should be able to re-use your BFS code and only make a small amount of changes to\r\n accomplish this. Be sure to remove repeat checking!)\r\n\r\n In the recursive case, you don't need the above. Building the solution path is a little\r\n trickier, but I suggest you look into the Array.unshift() function.\r\n */\r\n\r\n let open = []; //See push()/pop() and unshift()/shift() to operate like stack or queue\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\r\n let closed = new Set(); //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\r\n\r\n /***Your code for depth-first search here***/\r\n\r\n let current = {\r\n state: [],\r\n predecessor: [],\r\n action: [],\r\n depth: 0\r\n };\r\n\r\n let found = false;\r\n\r\n //1. Initialize Open to contain initial state\r\n open.push({\r\n state: initial_state,\r\n predecessor: [],\r\n action: [],\r\n depth: 0\r\n });\r\n\r\n while(!found && open.length!=0) {\r\n\r\n //2. Choose/remove one state from Open\r\n\t\tcurrent = open.pop();\r\n \r\n //3. Jump to (8) if already in visited\r\n\t\tif(!closed.has(state_to_uniqueid(current.state)) && current.depth<depth_limit) {\r\n \r\n //4. Check if state is a goal state (done if so)\r\n\t\t\tif(is_goal_state(current.state)) {\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n //5. Get child states using successor function\r\n let successors = find_successors(current.state);\r\n \r\n //6. Insert children into Open\r\n\t\t\t\twhile(successors.length!=0){\r\n\t\t\t\t\t\r\n\t\t\t\t\telement = successors.shift();\r\n\r\n\t\t\t\t\tlet predecessor_path = current.predecessor.map(x => x);\r\n\t\t\t\t\tpredecessor_path.push(current.state);\r\n\r\n\t\t\t\t\tlet action_path = current.action.map(x => x);\r\n\t\t\t\t\taction_path.push(element.actionID);\r\n \r\n\t\t\t\t\topen.push({\r\n\t\t\t\t\t\tstate: element.resultState,\r\n\t\t\t\t\t\tpredecessor: predecessor_path,\r\n action: action_path,\r\n depth: current.depth + 1\r\n\t\t\t\t\t})\r\n }\r\n \r\n //7. Insert original state into visited\r\n\t\t\t\tclosed.add(state_to_uniqueid(current.state));\r\n\t\t\t}\r\n }\r\n\r\n //8. Repeat from (2)\r\n\t}\r\n\r\n /*\r\n Hint: In order to generate the solution path, you will need to augment\r\n the states to store the predecessor/parent state they were generated from\r\n and the action that generates the child state from the predecessor state.\r\n \r\n For example, make a wrapper object that stores the state, predecessor and action.\r\n Javascript objects are easy to make:\r\n let object={\r\n member_name1 : value1,\r\n member_name2 : value2\r\n };\r\n \r\n Hint: Because of the way Javascript Set objects handle Javascript objects, you\r\n will need to insert (and check for) a representative value instead of the state\r\n object itself. The state_to_uniqueid function has been provided to help you with\r\n this. For example\r\n let state=...;\r\n visited.add(state_to_uniqueid(state)); //Add state to visited set\r\n if(visited.has(state_to_uniqueid(state))) { ... } //Check if state is in visited set\r\n */\r\n\r\n /***Your code to generate solution path here***/\r\n\r\n if (found) {\r\n current.predecessor.shift();\r\n current.predecessor.push(current.state);\r\n return {\r\n actions: current.action /*array of action ids*/,\r\n states: current.predecessor /*array of states*/\r\n };\r\n }\r\n\r\n //OR\r\n\r\n //No solution found\r\n return null;\r\n}", "title": "" }, { "docid": "e3ca8091c46513a9fcf95075e84cbd6c", "score": "0.64520323", "text": "DFS_Recursive(start) {\n const list = [];\n const visited = {};\n const graph = this.adjacencyList;\n\n const DFS = (vertex) => {\n if (!vertex) return null;\n if (!graph[vertex]) return list;\n\n list.push(vertex);\n visited[vertex] = true;\n\n graph[vertex].forEach(neighbor => {\n if (!visited[neighbor]) {\n return DFS(neighbor);\n }\n });\n }\n\n DFS(start);\n\n return list;\n }", "title": "" }, { "docid": "d00930647eeae18136bde5069db583df", "score": "0.6441747", "text": "DFS() {\n let stackFrontier = new Stack(\"object\");\n let visited = new Set();\n stackFrontier.push(this.nodes[0]);\n stackFrontier.disableLogging();\n while (!stackFrontier.isEmpty()) {\n const currentNode = stackFrontier.pop();\n if (!visited.has(currentNode)) {\n visited.add(currentNode);\n console.log(\"Node: \", currentNode);\n this.edges[currentNode].forEach((neighbor) => {\n stackFrontier.push(neighbor);\n });\n }\n }\n }", "title": "" }, { "docid": "3f9c7dd6f17bd46611b89f37596dd6be", "score": "0.6435661", "text": "depthFirstTraversal(i) {\n\n if (!this.stopDFT) {\n // label the vertex as having been visited\n this.visited[i] = true;\n\n // edge to be considered and its vertex endpoints\n let connection;\n let dv1;\n let dv2;\n\n // loop over all edges in a vertex's edge adjacency list\n for (let j = 0; j < waypoints[i].edgeList.length; j++) {\n\n // getting num of edge in vertex i's edge list\n connection = waypoints[i].edgeList[j].edgeListIndex;\n\t\t\n // make sure that the current connection is not the edge\n // we are already checking to be a bridge\n if (this.nextToCheck != connection) {\n\n dv1 = graphEdges[connection].v1;\n dv2 = graphEdges[connection].v2;\n\n // if the endpoint of the current connection is\n // not the endpoint of the bridge we have been\n // looking for then we continue the dft, if not\n // then we set v2 as being visited. Not strictly\n // necessary but boosts efficency.\n if (dv2 != this.v2) {\n\n // make sure that edge we are not calling dft\n // on a vertex we have already visited\n if (!this.visited[dv1] && dv2 == i) {\n this.visitedEdges[connection] = true;\n this.depthFirstTraversal(dv1)\n }\n\t\t\telse if (!this.visited[dv2] && dv1 == i) {\n this.visitedEdges[connection] = true;\n this.depthFirstTraversal(dv2);\n }\n }\n\t\t else {\n // if the endpoint in the current connection\n // is the endpoint of the edge we are checking\n // is a bridge then we mark the end point as\n // visited, and because it has been visited by\n // another path, that means the edge is not a\n // bridge, so we no longer have to call dft\n this.stopDFT = true;\n this.visited[this.v2] = true;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "61edab2357cda49f9fd1937f47af20a9", "score": "0.64236665", "text": "function findPath(start,destination,visited = new Set()) {\n console.log(start);\n\n visited.add(start);\n const destinations = graph.get(start);\n for(desti of destinations) {\n if(desti===destination) {\n console.log('found it...!!');\n return;\n }if(!visited.has(desti)) {\n findPath(desti,destination,visited);\n }\n }\n}", "title": "" }, { "docid": "c1a53175d3b45d2a0f02e8e2c0902e75", "score": "0.6367788", "text": "depthFirstRecursive(start) {\n let result = [];\n let visited = {};\n let adjacencyList = this.adjacencyList;\n function dfs(vertex) {\n visited[vertex] = true;\n result.push(vertex);\n adjacencyList[vertex].forEach((n) => {\n if (!visited[n]) {\n dfs(n);\n }\n });\n }\n dfs(start);\n return result;\n }", "title": "" }, { "docid": "87f9ab8c7a04d7fd109e43e4e07af7ef", "score": "0.63577515", "text": "DFS_Iterative(start) {\n const stack = [start];\n const result = [];\n const visited = {};\n const graph = this.adjacencyList;\n\n visited[start] = true;\n\n while(stack.length) {\n const vertex = stack.pop();\n result.push(vertex);\n\n graph[vertex].forEach(neighbor => {\n if (!visited[neighbor]) {\n stack.push(neighbor);\n visited[neighbor] = true;\n }\n });\n }\n\n return result;\n }", "title": "" }, { "docid": "d8e45df4a0917ce1fc7e76e9f06f15ff", "score": "0.63252455", "text": "function traversingThroughNodes() {\n for (let i = 0; i < currentNodes.length; i++) {\n if (!_.includes(visitedNodes, currentNodes[i])) {\n visitedNodes.push(currentNodes[i]); // marking current nodes as visited nodes\n currentNodes[i] = adjacentNodes[`${currentNodes[i]}`]; // replacing the current nodes with its child nodes\n } else {\n currentNodes.splice(i, 1, ''); // removing already visited nodes\n }\n }\n\n /* Transforming [[[], [1,2], [1,2]]] into [1,2] by removing \n repeated values(_uniq), invalid values(compact) and\n flattening the inner array(flattenDeep) */\n currentNodes = _.compact(_.flattenDeep(_.uniq(currentNodes)));\n\n if (_.includes(currentNodes, endValue)) {\n distance++; // if end node is found in child nodes\n return;\n } else if (distance > maximumLimit) {\n distance = 0; // if node is not found even after traversing through all nodes\n return; \n } else {\n distance++; // if node is not found in child nodes\n traversingThroughNodes(); // continues traversing through next set of child nodes\n }\n }", "title": "" }, { "docid": "83f953fa51d7b3627aa65243aac3cfa5", "score": "0.6323264", "text": "traverseDepthFirst(fn) {}", "title": "" }, { "docid": "37da9ebc32d23e005a72a679e2956e35", "score": "0.63162297", "text": "depthFirstSearch(start) {\n let visited = new Set();\n// debugger;\n\n function _depthFirstSearch(start){\n// debugger;\n visited.add(start);\n\n for(let neighbor of start.adjacent){\n if(!visited.has(neighbor)){\n _depthFirstSearch(neighbor)\n }\n }\n }\n\n _depthFirstSearch(start)\n \n return visited;\n \n }", "title": "" }, { "docid": "e9051008b97029b6524fe42dfd45d0f2", "score": "0.6312393", "text": "function findRoute(graph, from, to) {\n let work = [{at: from, route: []}];\n for (let i = 0; i < work.length; i++) { // i guess work.length is recalculated every new iteration\n let {at, route} = work[i];\n for (let place of graph[at]) {\n if (place == to) return route.concat(place);\n\n // a new state is created for all of the child nodes in the bfs graph, but \n // a new route is also created to capture that we got to this child\n // from the starting position\n if (!work.some(w => w.at == place)) {\n work.push({at: place, route: route.concat(place)});\n }\n }\n }\n // the for loop exits if we couldn't get to location. but\n // our graph is \"connected\", so this shouldn't happen\n}", "title": "" }, { "docid": "fd94d62f756f2da5597b19e027ba340d", "score": "0.6268485", "text": "function dfs(start, airportToFind, visited = new Set()) {\n console.log(start);\n visited.add(start);\n\n const destinations = adjacenyList.get(start);\n steps = 1;\n\n for (const destination of destinations) {\n steps++\n\n if (destination === airportToFind) {\n console.log(`DFS found ${airportToFind} in ${steps} steps`);\n return;\n }\n\n if (!visited.has(destination)) {\n dfs(destination, airportToFind, visited);\n }\n }\n}", "title": "" }, { "docid": "d05184600b0b26b287cda364967b5cba", "score": "0.6223191", "text": "depthFirstSearch(node) {\n /* RECURSIVE APPROACH\n let result = []; \n let visitedNodes = new Set()\n\n function dfsHelper(node) {\n if (!node) return null; // base case \n\n // visit node. \n result.push(node.value);\n visitedNodes.add(node); \n\n // visit node's neighbors.\n node.adjacent.forEach(neighbor => {\n if (!visitedNodes.has(neighbor)) {\n return dfsHelper(neighbor);\n }\n });\n }\n dfsHelper(node); \n\n return result; \n */\n\n // ITERATIVE APPROACH\n let result = [];\n let visitedNodes = new Set(); \n let stack = [node];\n let currentNode; \n\n visitedNodes.add(node);\n\n while (stack.length) {\n // visit node.\n currentNode = stack.pop(); \n result.push(currentNode.value);\n visitedNodes.add(currentNode); \n\n // visit node's neighbors.\n currentNode.adjacent.forEach(neighbor => {\n if (!visitedNodes.has(neighbor)) {\n visitedNodes.add(neighbor);\n stack.push(neighbor);\n }\n })\n }\n\n return result; \n }", "title": "" }, { "docid": "425a9a0806bb1aa18d4207cf208996dc", "score": "0.6207476", "text": "depthFirstSearch(start) {\n let visited = new Set();\n let nodes = [start.value];\n\n function _dfsHelper(node) {\n if (!visited.has(node)) {\n visited.add(node);\n for (let n of node.adjacent) {\n if (!visited.has(n)) nodes.push(n.value);\n _dfsHelper(n);\n }\n }\n }\n _dfsHelper(start);\n return nodes;\n }", "title": "" }, { "docid": "0d42b54baf23cc5e1df0d55b1ff36c6f", "score": "0.620643", "text": "DFS_Recursive(start){\n let visited= {},\n result=[],\n adjacencylist=this.adjacencylist;\n function recursionhelper(vertex){\n if(!adjacencylist[vertex]) return null;\n visited[vertex]=true;\n result.push(vertex);\n for(let i in adjacencylist[vertex])\n if(!visited[adjacencylist[vertex][i]])\n recursionhelper(adjacencylist[vertex][i])\n return result;\n }\n return recursionhelper(start);\n }", "title": "" }, { "docid": "e0de1ee5b589a8a8bb6722e00af104d0", "score": "0.6194456", "text": "depthFirstSearch(start) {\n let toVisitStack = [start]\n let seen = new Set([start]);\n let visitedVertices = [];\n\n while (toVisitStack.length) {\n let current = toVisitStack.pop();\n visitedVertices.push(String(current.value));\n\n for (let neighbor of current.adjacent) {\n if (!seen.has(neighbor)) {\n toVisitStack.push(neighbor);\n seen.add(neighbor);\n }\n }\n }\n return visitedVertices;\n }", "title": "" }, { "docid": "d126ce1bc9f30a169ed2a6d37e2aad38", "score": "0.619142", "text": "depthFirstRecursive(startVertex) {\n if (!this.adjacencyList[startVertex]) return undefined;\n //this will store all the vertices visited as well to return all of them in an array\n const result = [];\n //this object will keep track of which vertices we've already visited to avoid backtracking uneccessarily\n const visited = {};\n //store a reference to the adjacency list and make it easier (shorter) to utilize below\n const adList = this.adjacencyList;\n\n const dfs_helper = (vertex) => {\n if (!vertex) return null;\n result.push(vertex);\n visited[vertex] = true;\n //we'll loop through the array to find all the connections 'neighbors' of that vertex\n adList[vertex].forEach((neighbor) => {\n //if the neighbor (a vertex) has not been visited already, then we recursively call the helper function to mark it as\n //visited then add it to the result array, otherwise we skip it\n if (!visited[neighbor]) {\n dfs_helper(neighbor);\n }\n });\n console.log(vertex + \": \" + adList[vertex]);\n };\n //we initiate the helper function with a starting vertex\n dfs_helper(startVertex);\n console.log(\"DFS Recursive \", result);\n return result;\n }", "title": "" }, { "docid": "a867be6f25a1f857478a04664e0a7eda", "score": "0.61764765", "text": "depthFirstTraversalIterative(startingVertex) {\n let stack = [startingVertex];\n let visited = new Set();\n let curr;\n\n while (stack.length) {\n curr = stack.pop();\n\n if (!visited.has(curr)) {\n visited.add(curr);\n stack.push(...this.adjList[curr]);\n }\n }\n return Array.from(visited);\n }", "title": "" }, { "docid": "d3c0000bfee902ed715db1ea3ef66e7a", "score": "0.6150963", "text": "DFSR(start) {\n let result = [];\n let visited= {};\n let adjacentList = this.adjacentList;\n\n function DFS(vertex){\n // BASE Case\n if(!vertex){\n return null;\n }\n\n visited[vertex] = true;\n result.push(vertex); \n adjacentList[vertex].forEach((neighbour) => {\n if(!visited[neighbour]){\n return DFS(neighbour);\n }\n })\n\n }\n\n DFS(start);\n\n return result;\n }", "title": "" }, { "docid": "5613061d7dee2e1ba9d53bc7b7c32d60", "score": "0.61093783", "text": "depthFirstIterative(start) {\n let result = [];\n let visited = {};\n let stack = [start];\n visited[start] = true;\n while (stack.length !== 0) {\n let current = stack.pop();\n result.push(current);\n this.adjacencyList[current].forEach((n) => {\n if (!visited[n]) {\n visited[n] = true;\n stack.push(n);\n }\n });\n }\n return result;\n }", "title": "" }, { "docid": "276c0a2af0a7ef2a7ee7c50e225f3a87", "score": "0.60851926", "text": "function depthFirst ( graph, startVertex){\n\n const visitedVertices = new Set();\n\n visitedVertices.add(startVertex);\n\n function traverse(graph, vertax){\n const neighbors = graph.getNeighbors(vertax);\n if (!neighbors.length) return;\n\n for (let neighbor of neighbors) {\n const neighborVertex = neighbor.toVertex;\n if (!visitedVertices.has(neighborVertex)){\n visitedVertices.add(neighborVertex);\n traverse(graph, neighborVertex);\n }\n }\n }\n\n traverse(graph, startVertex);\n\n return visitedVertices;\n}", "title": "" }, { "docid": "e3d8a5d3689171febd13995b2ab66723", "score": "0.60781455", "text": "dfsI(g, root ) {\n let stack = [];\n let visited = [];\n for ( let i of g.vertex) {\n visited[i] = false;\n }\n stack.push(root);\n visited[root] = true;\n\n while (stack.length > 0) {\n\n let v = stack.pop();\n console.log( v );\n\n let adjList = g.adjList.get(v);\n let len = adjList.length;\n\n for(let i=len-1; i>=0; i--) {\n \n let neighbor = adjList[i];\n if ( !visited[neighbor] ) {\n visited[neighbor] = true;\n stack.push(neighbor);\n } \n }\n }\n }", "title": "" }, { "docid": "ddc37908cfca69e7eacfe37ff297e888", "score": "0.60594535", "text": "DFSUtil( vert, visited ) {\n \n visited[vert] = true;\n console.log(vert);\n\n let adjList = this.adjList.get( vert );\n\n for (let i in adjList) {\n let neighbor = adjList[i];\n if ( !visited[neighbor] ) {\n this.DFSUtil( neighbor, visited);\n } \n }\n }", "title": "" }, { "docid": "d0abd6e277536e15943d7f9bdc104b13", "score": "0.6051312", "text": "function depthFirstRecur(node, graph, visited=new Set()) {\n if (visited.has(node)) return;\n\n console.log(node);\n visited.add(node);\n\n graph[node].forEach(neighbor => {\n depthFirstRecur(neighbor, graph, visited);\n });\n}", "title": "" }, { "docid": "022032374adcd7a0b69dc164ac79ab8d", "score": "0.6043965", "text": "function bfs(startingRoom, graph) {\n let queue = [];\n queue.push([startingRoom]);\n const visited = new Set();\n while (queue.length > 0) {\n let path = queue.shift();\n let room = path[path.length - 1];\n if (validDirection(room, graph) !== null) {\n return path;\n }\n if (!visited.has(room.room_id)) {\n visited.add(room.room_id);\n let neighbors = graph[room.room_id].neighbors;\n for (let neighbor in neighbors) {\n let new_path = [...path, graph[neighbors[neighbor]]];\n queue.push(new_path);\n }\n }\n }\n}", "title": "" }, { "docid": "f444700a22aaf4fa491c8d61ae1d5857", "score": "0.6029921", "text": "Program(path,state){path.traverse(visitor,state);}", "title": "" }, { "docid": "2957e53ebf851e76d0532991a971ac5e", "score": "0.60216576", "text": "traverseEdges(startNode, endNode, path){\n\t\tconst self = this;\n\t\t// console.log('Find:', startNode.id, '-->', endNode.id, 'path: ', path.join('-'));\n\t\tObject.values(startNode.getEdges()).forEach(edge => {\n\t\t\t//\tDo not revisit\n\t\t\tif(path.indexOf(edge.targetNode.id) === -1){\n\t\t\t\tconst newPath = [...path, edge.targetNode.id];\n\t\t\t\t//\tLog successful path\n\t\t\t\tif(edge.targetNode.id === endNode.id){\n\t\t\t\t\tthis.paths.push(newPath);\n\t\t\t\t\tthis.shortestPath = newPath.length;\n\t\t\t\t//\tOnly queue a node once\n\t\t\t\t} else if(!self.processed[edge.targetNode.id]){\n\t\t\t\t\tself.queue.push({node: edge.targetNode, path: newPath});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn edge;\n\t\t});\n\t}", "title": "" }, { "docid": "d698268c281b9a57f64b7e69a8db6a0a", "score": "0.6015925", "text": "depthFirstSearchRecursive(vertexToExplore) {\n if(!this.adjacencyList[vertexToExplore]) return undefined;\n let resultList = []\n let graph = this.adjacencyList;\n let visited = {}; // using this can improve fastness more than a list\n (function dfs(vertex) {\n //if(!vertex) return null;\n resultList.push(vertex);\n visited[vertex] = true;\n let element;\n for(element of graph[vertex]) {\n if(!visited[element])\n dfs(element)\n }\n })(vertexToExplore);\n\n return resultList;\n }", "title": "" }, { "docid": "8c67c86ff75bf1cf62e0229b7a9d058b", "score": "0.6003717", "text": "function depthFirstRecur(node, visited=new Set()) {\n if (visited.has(node.val)) return;\n\n console.log(node.val);\n visited.add(node.val);\n\n node.neighbors.forEach(neighbor => {\n depthFirstRecur(neighbor, visited);\n });\n}", "title": "" }, { "docid": "e24c0123e25d21d56c17ec2733e47e26", "score": "0.59931874", "text": "function dfs(start, prev) {\n var adjacent;\n var next;\n preVisit(start, prev);\n markIt(start);\n adjacent = start.neighbors();\n for (next = adjacent.next(); next; next = adjacent.next()) {\n av.umsg(\"Process (\" + start.value() + \",\" + next.value() + \")\");\n av.step();\n if (next.hasClass(\"marked\")) {\n av.umsg(\"Node \" + next.value() + \" already marked\");\n av.step();\n } else {\n av.umsg(\"Call depth first search on \" + next.value());\n av.step();\n dfs(next, start);\n }\n }\n postVisit(start, prev);\n }", "title": "" }, { "docid": "6796cca9cd529e01e48f33bd1092f2ea", "score": "0.59856135", "text": "function findPath() {\n // The current node\n var node;\n\n // Set node to root node\n node = root;\n\n // Run DFS\n while (!!node) {\n\n // Add current node value to results\n result.push(node.val);\n // If (node has edge)\n // Then {set next node to edge}\n // Else {end loop}\n node = ( (!!node.edge) ?\n node.edge : !node\n );\n }\n }", "title": "" }, { "docid": "eb193e0ce56b12ed1692403ebbe6ae24", "score": "0.59802455", "text": "function findroutes(start, finish, visited) {\n visited.push(start);\n\n var nodes = nameToObject(start).neighbours;\n\n for (var q in nodes) {\n if (visited.indexOf(nodes[q]) != -1) {\n continue;\n }\n if (nodes[q] == finish) {\n visited.push(nodes[q]);\n allpossibleroutes.push(visited.join());\n visited.pop();\n }\n }\n\n for (var q in nodes) {\n if (visited.indexOf(nodes[q]) != -1) {\n continue;\n } else if (nodes[q] == finish) {\n continue;\n } else {\n findroutes(nodes[q], finish, visited);\n visited.pop();\n }\n }\n }", "title": "" }, { "docid": "fe649afd2fd4efe64b13e1ffbf8d0623", "score": "0.5975915", "text": "DFSUtil(vert, visited, probability) {\n visited[vert] = true;\n if (vert === this.target) {\n this.paths.push({\n probability: probability,\n path: this.path[vert]\n })\n }\n\n var get_neighbours = this.AdjList.get(vert);\n\n for (var i in get_neighbours) {\n var get_elem = get_neighbours[i].vertex;\n if(get_elem === vert && get_elem !== this.target)\n continue;\n\n // console.log(\"Parent: \" + vert + \", Child: \" + get_elem);\n this.path[get_elem] = [...this.path[vert], get_elem];\n probability *= get_neighbours[i].weight;\n if (!visited[get_elem])\n this.DFSUtil(get_elem, visited, probability);\n else if(get_elem === this.target)\n this.paths.push({\n probability: probability,\n path: this.path[get_elem]\n })\n }\n }", "title": "" }, { "docid": "522f6312defcc0792808019a954cdfa4", "score": "0.59755886", "text": "getPathUtil(src,dest,visited){\n if(src === dest) \n { console.log(\"here\",visited)\n return true;\n }\n\n visited[src] = true;\n\n var get_neighbours = this.AdjList.get(src)\n\n for(var i in get_neighbours) {\n // if the neighbor hasn't been visited\n if(!visited[get_neighbours[i]]) {\n // go down the path & determine if dest has been reached\n let reached = this.getPathUtil(get_neighbours[i], dest,visited); \n // return true if dest has been reached\n if(reached) return true; \n }\n }\n return false;\n }", "title": "" }, { "docid": "f09136d021b8d26127c3cb0be8711a28", "score": "0.59739673", "text": "topological_sort(prereqs, vertices, start, visited, result){\n let current = start;\n visited.push(current);\n let adjacent = prereqs[current];\n for(let i of adjacent){\n if(!visited.includes(i)){\n result = this.topological_sort(prereqs, vertices, i, visited, result);\n }\n }\n result.push(current);\n if(visited.length !== vertices.length){\n for(let v of vertices){\n if(!visited.includes(v)){\n result = this.topological_sort(prereqs, vertices, v, visited, result);\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "c26b5e1c7e2ca2e4996d6f8b62a926bf", "score": "0.59632427", "text": "bfs(start, colors = {white: '#ffffff', gray: '#efefef', black: '#3f3f3c'}) {\n\t // !!! IMPLEMENT ME\n\t \tconst queue = new Queue();\n\t \tconst visited = [];\n\t\n\t\tfor (let v in this.vertexes) {\n\t \t\t// if (!this.vertexes[v].color) this.vertexes[v].color = 'colors.white';\n\t \t\tthis.vertexes[v].color = 'colors.white';\n\t }\n\t\n\t\tstart.color = colors.gray;\n\t \tstart.parent = null;\n\t queue.enqueue(start);\n visited.push(start);\n\t\n\t while (!queue.isEmpty()) {\n\t let u = queue.next(); // Peek at head of queue, but do not dequeue!\n\t\t for (let v in u.edges) {\n\t\t if (u.edges[v].destination.color !== colors.black) {\n\t\t\t\t\tu.edges[v].color = colors.gray;\n\t\t\t\t\tu.edges[v].destination.parent = u;\n\t\t\t\t\tu.edges[v].destination.theme = 3;\n\t\n\t\t\t\t\tqueue.enqueue(u.edges[v].destination);\n\t\t\t\t\tvisited.push(u.edges[v].destination);\n\t }\n\t }\n\t\t\tqueue.dequeue();\n\t \t\tu.color = colors.black;\n\t\t}\n\n\t\treturn visited;\n\t}", "title": "" }, { "docid": "e88fa9213cad7fae2fc038c7f76ea2bc", "score": "0.5960514", "text": "depthFirstRecursive(vertex) {\n const result = []\n const visited = {}\n\n function dfs(vertex) {\n if (!vertex) return null\n visited[vertex] = true\n result.push(vertex)\n\n this.adjacencyList[vertex].forEach(neighbor => {\n if (!visited[neighbor]) return dfs(neighbor)\n })\n }\n\n dfs(vertex)\n\n return result\n }", "title": "" }, { "docid": "2a4211a53ff59c9afe7cb94d8e20b056", "score": "0.59540045", "text": "function recurse( vertex ){\n //console.debug( '\\t recursing into: ', vertex );\n search.discovered[ vertex.name ] = true;\n if( self.processFns.vertexEarly ){ self.processFns.vertexEarly.call( self, vertex, search ); }\n search.entryTimes[ vertex.name ] = time++;\n\n self.graph.eachAdjacent( vertex, discoverAdjacentVertices );\n\n if( self.processFns.vertexLate ){ self.processFns.vertexLate.call( self, vertex, search ); }\n search.exitTimes[ vertex.name ] = time++;\n }", "title": "" }, { "docid": "2514e3632e9fe9e2f2da1374cffca159", "score": "0.5937841", "text": "DFS() {\n // Mark all the vertices as not visited(set as\n var visited = new Array(this.V).fill(false);\n\n // Call the recursive helper\n // function to print DFS\n // traversal starting from\n // all vertices one by one\n for (var i = 0; i < this.V; ++i)\n if (visited[i] == false) this.DFSUtil(i, visited);\n }", "title": "" }, { "docid": "8dfcb06838b1ca4fa5cffa94a37f045b", "score": "0.592504", "text": "traverse(length, firstEdge) {\n // assert(firstEdge.head.node === this)\n let paths = [firstEdge]\n\n for ( ; length--; ) {\n let newPaths = []\n for (var i = paths.length; i--; ) {\n let path = paths[i]\n let begin = path ? path.head.node : this\n let edges = begin.edgesById\n let keys = Object.keys(edges)\n for (var j = keys.length; j--; ) {\n let edge = edges[keys[j]]\n newPaths.push(new Path(edge, path))\n }\n }\n paths = newPaths\n }\n return paths\n }", "title": "" }, { "docid": "13e4bd3f9faf7146294ae010dcf7c43b", "score": "0.5909228", "text": "function depth_limited_search(initial_state,depth_limit) {\r\n\r\n /***Your code for depth-limited search here!***/\r\n let closed = new Set();\r\n let result = DFS(initial_state, 0, [], [], closed, depth_limit);\r\n return result;\r\n \r\n /***DO NOT do repeated state or loop checking!***/\r\n \r\n /*\r\n Hint: You may implement DLS either iteratively (with open set) or recursively.\r\n \r\n In the iterative case, you will need to do similar to breadth-first search and augment\r\n the state. In addition to predecessor and action, you will also need to store depth.\r\n (You should be able to re-use your BFS code and only make a small amount of changes to\r\n accomplish this. Be sure to remove repeat checking!)\r\n\r\n In the recursive case, you don't need the above. Building the solution path is a little\r\n trickier, but I suggest you look into the Array.unshift() function.\r\n */\r\n}", "title": "" }, { "docid": "49dd9f874a55ac4428c7e1a85d76339b", "score": "0.58957195", "text": "pathFind (start){\n\n //Queue to keep nodes to be visited\n var Q = \"\";\n this.initializeArrays();\n\n //dist[source] := 0;\n this.dist[start]=0;\n //insert source into Q;\n Q=pushQ(Q, start);\n\n //while Q is not empty:\n while (Q !== \"\" ){\n\n //u := vertex in Q with smallest distance in this.dist[] and has not been visited;\n //gets 'start' in the first round (since this.dist[start] is 0), nearer tiles to it from the next round onwards.\n var u = this.findSmallestUnvisitedInDist();\n\n //there are unvisited nodes\n if (u !== \"none\" ){\n\n //remove u from Q;\n Q=popQ(Q,u);\n\n //visited[u] := true\n this.visited[u]=\"YES\";\n\n //for each neighbor v of u:\n //fill up distance to neighbors\n var neighbors = new Array();\n neighbors = this.findAdjacentTiles(u);\n for (var i = 0; i < neighbors.length; i++) {\n\n var v = neighbors[i];\n var altDist = this.dist[u] + distance(u, v);\n\n if ( altDist < this.dist[v] && this.visited[v] === \"NO\"){\n this.dist[v] = altDist;\n this.previous[v] = u;\n Q=pushQ(Q, v);\n }\n\n }\n }\n //all nodes visited\n else {\n Q=\"\";\n }\n }\n return 0;\n }", "title": "" }, { "docid": "6b9318c19f6d5afd56bc40a50ad16569", "score": "0.5866064", "text": "step() {\n if (this.pathFound) {\n return false;\n }\n\n if (this.minDist.length === 0) {\n // No path exists\n this.noPath = true;\n this.pathFound = true;\n return false;\n }\n\n let currentNode = this.minDist.shift();\n const checkedNodes = [];\n\n if (currentNode.isEnd) {\n // We are done calculate path and return.\n this.pathFound = true;\n\n this.path = [currentNode];\n\n do {\n const previousNode = currentNode.pathTo;\n this.path.unshift(previousNode);\n currentNode = previousNode;\n } while (!currentNode.isStart);\n\n return false;\n }\n\n currentNode.neighbours.forEach((neighbour) => {\n checkedNodes.push(neighbour);\n\n if (neighbour.dEnd === undefined) {\n neighbour.d = Infinity;\n neighbour.dEnd = hexDistanceBetween(\n [neighbour.row, neighbour.col],\n this.graph.end\n );\n }\n\n if (neighbour.dStart > currentNode.dStart + 1) {\n neighbour.dStart = currentNode.dStart + 1;\n neighbour.pathTo = currentNode;\n }\n\n if (neighbour.d !== neighbour.dStart + neighbour.dEnd * this.BIAS) {\n neighbour.d = neighbour.dStart + neighbour.dEnd * this.BIAS;\n if (this.minDist.includes(neighbour)) {\n this.minDist.sort((a, b) => a.d - b.d);\n } else {\n this.addToMinDist(neighbour);\n }\n }\n });\n\n return checkedNodes;\n }", "title": "" }, { "docid": "54b67c0290a70a6010adea82e720cc00", "score": "0.5863208", "text": "function dfs (vertex, visited) {\n visited[vertex] = true;\n console.log(\"Vertex \" + vertex + \" was visited\");\n // what we want to do, is check for each neighbor until it is\n // an unvisited vertex.\n for (var nbr = adjList[vertex].first(); nbr !== null; nbr = nbr.next) {\n // with first(), I want to grab the first vertex in the list\n if (!visited[nbr]) {\n dfs(nbr, visited);\n }\n }\n}", "title": "" }, { "docid": "95327d24a4da63728902de64cb664202", "score": "0.58607566", "text": "function search_path( mapGrid, startPos, endPos, isAttacker )\n{\n var height = mapGrid.length;\n var width = mapGrid[0].length;\n\n var begin = new SearchNode( startPos.x, startPos.y, 0, get_heuristic( startPos, endPos ), null );\n var frontier = [ begin ];\n var visited = [];\n while( frontier.length > 0 )\n {\n var current = frontier[0];\n frontier.shift();\n visited.push( current );\n\n if( current.x === endPos.x && current.y === endPos.y )\n {\n var move_path = [];\n while( current.parent != null )\n {\n move_path.push( new Pos( current.x, current.y ) );\n current = current.parent;\n }\n\n move_path.reverse();\n //console.log(\"path from \" + JSON.stringify(startPos) + \" to \" + JSON.stringify(endPos) + \" = \" + JSON.stringify(move_path) );\n return move_path;\n }\n\n var neighbors = get_neighbors( mapGrid, width, height, current, endPos, isAttacker );\n //console.log(\"neighbor of \" + JSON.stringify(current) + \" is \" + JSON.stringify(neighbors));\n for( var i = 0; i < neighbors.length; i++ )\n {\n var neighbor = neighbors[i];\n if (contains(visited, neighbor)) {\n continue;\n }\n\n if (contains(frontier, neighbor)) {\n var exist_node = get_element(frontier, neighbor);\n //console.log(\"think wich is better \" + JSON.stringify(exist_node) + \" to \" + JSON.stringify(neighbors[i]) );\n // if new way is better than the one in the frontier\n if (neighbor.costFrom < exist_node.costFrom) {\n exist_node.costFrom = neighbor.costFrom;\n exist_node.costTo = neighbor.costTo;\n exist_node.parent = current;\n }\n }\n else {\n frontier.push(neighbor);\n }\n }\n\n // sort by distance to the goal\n frontier.sort( function(a, b){return a.costFrom + a.costTo - b.costFrom - b.costTo } );\n }\n console.log(\"cant find the path.\");\n return [];\n}", "title": "" }, { "docid": "36bd4a64f1767c4fa79e1d10898ced38", "score": "0.5852633", "text": "function findRoute(graph, from, to) {\n // \n let work = [{at: from, route: []}];\n for (let i = 0; i < work.length; i++) {\n let {at, route} = work[i];\n // Search throught entire graph.\n for (let place of graph[at]) {\n // If the end point is the destination, \n if (place == to) return route.concat(place);\n // If the end point is not found before,\n // consider this end point as a passing point.\n if (!work.some(w => w.at == place)) {\n work.push({at: place, route: route.concat(place)});\n }\n }\n }\n}", "title": "" }, { "docid": "1b3fd7a33c20cd1d9f3231e58856008c", "score": "0.58377844", "text": "friendsOfRecursion(target, adjacencyList, visited, maxDistance, currentDistance) {\n if (currentDistance >= maxDistance) return;\n\n visited.add(target);\n\n for (let nextFriend of adjacencyList[target]) {\n friendsOfRecursion(nextFriend, adjacencyList, visited, maxDistance, currentDistance + 1);\n }\n\n}", "title": "" }, { "docid": "29f96898261d8efb51deb790b355b0ab", "score": "0.58280635", "text": "function dfs (at){\n if (visited[at]) return; //controls if visited or not, returns if alredy seen\n visited[at]=true\n let neighbours = g[at]\n //goes to check every neighbour\n neighbours.forEach(element => { \n return dfs(element) \n });\n}", "title": "" }, { "docid": "1f4c6830019851570f9f493f3c48e287", "score": "0.58231884", "text": "function traverser(node, path, state) {\n node.range && utils.catchup(node.range[0], state);\n traverse(node, path, state);\n node.range && utils.catchup(node.range[1], state);\n }", "title": "" }, { "docid": "7ff532742008e6cea9507f055705063c", "score": "0.58072215", "text": "depthFirstSearch(start, visited = new Set([start]), values = [start.value]) {\n for (const node of start.adjacent) {\n if (!visited.has(node)) {\n values.push(node.value);\n visited.add(node);\n this.depthFirstSearch(node, visited, values);\n }\n }\n return values;\n }", "title": "" }, { "docid": "912448c1418df0f2bf46a09af0533467", "score": "0.5801228", "text": "function depthFirst(graph) {\n let visited = new Set();\n\n for (let node in graph) {\n _depthFirstRecur(node, graph, visited);\n }\n}", "title": "" }, { "docid": "9ce92012e11688eec446922bb63c6fe1", "score": "0.5790234", "text": "function solution_1 (graph) {\n\n // SOLUTION 1 [O(e) time (where e is the number of edges), O(e?) space (not sure how big the stack will get, along with the path sizes)]:\n // initialize `output` depending on whether a direct connection from source to target exists. initialize a stack. perform DFS, where for each node you add its neighbors to the stack, along with\n // the ever increasing path associated with traveling to that neighbor\n\n const target = graph.length - 1;\n const output = graph[0].includes(target) ? [[0, target]] : []; // EDGE CASE: if a direct connection from source to target exists, preload that into `output`\n const stack = graph[0].filter(n => n !== target).map(n => [n, [0, n]]); // excluding any direct connections from source to target, initialize `stack` with those nodes and paths\n while (stack.length) {\n const [node, path] = stack.pop();\n for (const neighbor of graph[node]) { // iterate through all the `neighbor`s of `node`...\n if (neighbor === target) {\n output.push([...path, neighbor]); // ...if the `neighbor` is the `target`, push to `output`...\n } else {\n stack.push([neighbor, [...path, neighbor]]); // ...otherwise, format the `neighbor` and push to `stack`\n }\n }\n }\n return output;\n}", "title": "" }, { "docid": "707240568c8ef8260d9b2b4724a78c79", "score": "0.5785594", "text": "async function shortestPath(from, to){\n // INIT\n let vertices = await queries.getVertices()\n const SIZE = vertices.length // get count of vertices\n let start = findIndex(from, vertices); // finding index of start point\n let end = findIndex(to, vertices); // finding index of end point \n let ver = []; // array of previous vertices \n let distance = [SIZE]; // distance array\n let v = [SIZE]; // flag - a vertex is visited or not\n let temp, minindex, min; // temp is for calculating min distance to every vertex\n // min - current min distance, minindex- current index of vertex with min distance\n // distance for all bertices is infinity\n // all vertices are not visited yet\n for (let i = 0; i<SIZE; i++)\n {\n distance[i] = Infinity;\n v[i] = false;\n }\n // for start point distance is 0 in the algorithm\n distance[start] = 0; \n\n // cycle\n do {\n // reset values every step to \n // numbers about infinity\n minindex = Infinity; \n min = Infinity;\n \n // finding vertices are not visited with min distance between other adjacent vertices\n for (let i = 0; i<SIZE; i++) { // cycle perl all vertices\n if (!v[i] && (distance[i]<min)) { // if vertex is not visited yet and it has min distance\n min = distance[i]; // now it vertex has min distance\n minindex = i; // index of vertex with min distance\n\n }\n }\n\n // if minindex is found\n if (minindex != Infinity) {\n for (let i = 0; i<SIZE; i++) {\n if (matrix[minindex][i].length > 0) { // if vertices are connected(has weight between themselves) \n matrix[minindex][i].length += Math.floor(Math.random() * 10) -5; // store a time instead distance(speed is 50 for now) \n temp = min + matrix[minindex][i].length; // adding new weight\n if (temp < distance[i]) { // if calculated distance(temp) from start point to the vertex\n // < then distance to the vertex is already known(distance[i]), \n distance[i] = temp; // then new distance is calculated distance now\n \n // adding a vertex to array\n // there are looking for a connected vertex with the min distance. If its found - added it.\n // there is also pushing distance between this vertices, \n // 'cause after checking other vertices the distance maybe less than previous value\n ver.push({ \n index: i, \n previos: minindex, \n id: matrix[i][minindex].id,\n distance: matrix[i][minindex].length / 800\n })\n }\n }\n }\n // make flag that means the vertex is visited\n v[minindex] = true;\n }\n } while (minindex < Infinity);\n\n // finding path like array of vertices\n // deleting dublicates with the most length(distance)\n for (let i=0; i<ver.length; i++){\n for (let j=0; j<ver.length; j++){\n if (i != j && ver[i].index == ver[j].index){\n if (ver[i].distance > ver[j].distance){\n ver.splice(i,1)\n } else {\n ver.splice(j,1)\n }\n }\n }\n }\n // make a path: finding previous vertex and adding them to path\n let path = []\n let length = 0\n do {\n let item = ver.find(x => x.index == end)\n length += item.distance \n path.push(item.id)\n end = item.previos\n } while (end != start)\n\n console.log('shortest path found')\n return {length: length, path: await makePath(path)}\n}", "title": "" }, { "docid": "c8fdd6e0721478ff6165d8928fc01f77", "score": "0.57769346", "text": "function _graphDepthFirst(graph) {\n let visited = new Set();\n\n for (let node in graph) {\n _graphDepthFirstRecur(node, graph, visited);\n }\n}", "title": "" }, { "docid": "ef489b26d6784540beff9d5cadd2349e", "score": "0.577299", "text": "dfsForVertext(vertext){\n \n let visited = new Map();\n let dfsTraversalNodes = \"\";\n let dfsTraversal = (v,visited) => {\n \n visited.set(v, true);\n dfsTraversalNodes = dfsTraversalNodes + \" \" + v;\n \n let adjNodeList = this.adjList.get(v);\n \n for(let node of adjNodeList){\n \n //if not visited \n if(!visited.has(node)){\n \n dfsTraversal(node,visited);\n }\n \n }\n \n }\n \n dfsTraversal(vertext, visited);\n console.log(\"DFS Traversal => \", dfsTraversalNodes);\n }", "title": "" }, { "docid": "b5b55a6147cd0274d0745dc1c559e90b", "score": "0.5769902", "text": "DFSUtil(vert, visited)\n {\n visited[vert] = true;\n console.log(vert);\n\n var get_neighbours = this.AdjList.get(vert);\n\n for (var i in get_neighbours) {\n var get_elem = get_neighbours[i];\n if (!visited[get_elem])\n this.DFSUtil(get_elem, visited);\n }\n }", "title": "" }, { "docid": "9178683e9e6b8d0f954fb2b0742223a8", "score": "0.5749371", "text": "DFS(array) {\n array.push(this.value)\n // this.children.map(child => child.DFS(array));\n for (let child of this.children) {\n child.DFS(array)\n }\n return array;\n }", "title": "" }, { "docid": "79791b561a15592f95946a120b053453", "score": "0.5747883", "text": "dfsInOrderIterative() {\n const vals = []\n let toVisitQueue = []\n let current = this.root;\n\n while(current.left) {\n toVisitQueue.push(current.left)\n current = current.left\n }\n\n toVisitQueue.push(this.root)\n current = this.root;\n\n while(current.right) {\n toVisitQueue.push(current.right)\n current = current.right\n }\n\n console.log(toVisitQueue)\n\n\n }", "title": "" }, { "docid": "308d0ce5a9cb0241801fcc3f2da100ca", "score": "0.5736173", "text": "function findPath(from, to) {\n const queue = new Queue();\n // marks whether in already tried or not\n const visited = new Array(rows)\n .fill(null)\n .map(() => new Array(cols).fill(false));\n\n // add starting position to queue\n queue.enqueue([...from]);\n visited[from[0]][from[1]] = true;\n\n while (!queue.isEmpty()) {\n const [row, col] = queue.dequeue();\n // get all possible neighbours\n const neighbours = getNeighbours(row, col);\n\n for (let i = 0; i < neighbours.length; i += 1) {\n const [nrow, ncol, direction] = neighbours[i];\n if (visited[nrow][ncol]) {\n continue;\n }\n // add neighbour to queue\n queue.enqueue([nrow, ncol]);\n visited[nrow][ncol] = direction;\n\n // a valid path is found\n if (maze[nrow][ncol] === 'B') {\n return backtrackPath(from, to, visited);\n }\n }\n }\n throw new Error('No Path Found');\n }", "title": "" }, { "docid": "53a695ad5abe9dca747eccadabeebbed", "score": "0.5721698", "text": "function findPaths() {\n // The path being currently reviewed\n // A function that is called recursively\n // to find each path\n var path, buildPaths;\n\n // Set the recursive DFS\n // param: The current node\n // param: The current cumulative weight\n // param: Whether a starbucks currently exists\n buildPaths = function(node, weight, starbk) {\n // The string for the current path\n // The count of the node's edges\n // The edges index\n // The current edge's node\n // The new total path weight\n // The new starbucks value\n var edges, e, edge, newWeight, newStarbk;\n\n // If (weight is greater than max weight)\n // Then {end this path traversal}\n if (weight > max) {\n return;\n }\n\n // If (node is destination)\n // Then {add path to results and end traversal}\n if (node.val === end) {\n\n // Save string of path\n path.string = '[ ' +\n path.values.join(',') + ',' + end +\n ' ]';\n\n // Add path to final list of paths\n paths.list.push({\n val : path.string,\n starbk: starbk\n });\n // Adjust count of Starbucks paths\n paths.starbk += (starbk) ? 1 : 0;\n\n // End this path traversal\n return;\n }\n\n // Add node to current path\n path.nodes.push(node);\n path.values.push(node.val);\n\n // Save the node's count of edges\n edges = node.edges.length;\n // Traverse each path rooting with each edge\n e = -1;\n while (++e < edges) {\n // Save reference of edge's object\n edge = node.edges[e];\n // Set new weight total\n newWeight = weight + edge.weight;\n // Set new value for starbucks\n newStarbk = (starbk || edge.starbk);\n // Continue search\n buildPaths(edge.child, newWeight, newStarbk);\n }\n\n // Remove current node from path\n path.nodes.pop();\n path.values.pop();\n };\n\n // Set path to empty\n path = {\n nodes : [],\n values: [],\n string: ''\n };\n\n // Find the paths\n buildPaths(graph.verti[start], 0, false);\n }", "title": "" }, { "docid": "d93675f4b91af74911c6c62163d97478", "score": "0.57202727", "text": "depthFirstSearch(values=[]){\n if(this.left){\n console.log('step 1');\n values = this.left.depthFirstSearch(values);\n }\n values.push(this.values);\n if(this.right){\n console.log('step 2');\n values = this.right.depthFirstSearch(values);\n }\n return values;\n }", "title": "" }, { "docid": "1c110155be593d4ad830efddf358dc59", "score": "0.5718623", "text": "function depth_first_search(grid, start, end) {\n let startNode = grid[start.x][start.y];\n let openList = [startNode];\n startNode.visited = true;\n let numNodes = 0; // num of nodes considered, not really important (for extra information)\n\n while (Object.keys(openList).length > 0) {\n // get the first item\n let currentNode = openList.pop();\n\n currentNode.closed = true;\n\n currentNode.visited = true;\n\n numNodes++;\n // reach end\n if (currentNode.x === end.x && currentNode.y === end.y) {\n let path = getFinalPath(currentNode, grid, start);\n console.log(\"Number of nodes considered: \", numNodes);\n return path;\n }\n\n let neighbours = getNeighbourNodes(grid, currentNode, true);\n let neighbourLength = neighbours.length;\n\n for (let x = 0; x < neighbourLength; x++) {\n let neighbour = neighbours[x];\n\n // if neighbour is already considered or wall, continue to next neighbour\n if (neighbour.closed || neighbour.isWall) {\n continue;\n }\n // if the neighbour is visited very first time\n if (!neighbour.visited) {\n neighbour.parent = { x: currentNode.x, y: currentNode.y };\n openList.push(neighbour);\n }\n }\n }\n return [];\n}", "title": "" }, { "docid": "1f9364319a8e5a14b1fedc852bd9af02", "score": "0.5714422", "text": "BFS() {\n let queueFrontier = new Queue(\"object\");\n let visited = new Set();\n queueFrontier.enqueue(this.nodes[0]);\n queueFrontier.disableLogging();\n while (!queueFrontier.isEmpty()) {\n const currentNode = queueFrontier.dequeue();\n if (!visited.has(currentNode)) {\n visited.add(currentNode);\n console.log(\"Node: \", currentNode);\n this.edges[currentNode].forEach((neighbor) => {\n queueFrontier.enqueue(neighbor);\n });\n }\n }\n }", "title": "" }, { "docid": "8c4ecae20e8cbdd44d07f024046f7e1e", "score": "0.5698859", "text": "function BFS(board) {\n // Source (from) node\n var source = board.sourceNode;\n\n // Target (to) node\n var target = board.targetNode;\n\n // Queue for FILO (First in last out) collection\n var Q = [];\n var Q2 = [];\n\n // Source node added to the queue\n source.visited = true;\n target.visited = true;\n\n Q.unshift(source);\n Q2.unshift(target);\n\n\n // I introduced a variable running to help with stopping the loop\n // I also removed the old if statements because for some reason they do not\n // work well enough with bidirectional checks. So now I do a linear search\n // which works but is not the best solution. (.includes(node))\n let running = true;\n while (Q.length != 0 && Q2.length != 0 && running) {\n\n var forw = Q.pop();\n var back = Q2.pop();\n\n // Set check and put in animation sets.\n // Check is to avoid having to look through the\n // animation sets for a dup node, so we make check.\n // So that if the node is added to the sourceSet\n // and is looked on by the targetSet, then the function\n // will terminate because it is a dup node, meaning there is a path.\n forw.check = 'sourceSet';\n board.sourceSet.push(forw);\n back.check = 'targetSet';\n board.targetSet.push(back);\n\n getNeighboursFromRight(forw.id, board).forEach(nb => { \n if (nb.check === 'targetSet') {\n board.targetSet.splice(board.targetSet.length - 1, 1);\n board.sourceSet.push(forw);\n board.targetSet.push(nb);\n running = false; \n }\n if (!nb.visited) {\n nb.status = \"visited\";\n nb.visited = true;\n nb.prev = forw;\n Q.unshift(nb);\n\n }\n })\n\n getNeighboursFromLeft(back.id, board).forEach(nb2 => {\n if (nb2.check === 'sourceSet') {\n \n board.targetSet.splice(board.targetSet.length - 1, 1);\n board.targetSet.push(back);\n board.sourceSet.push(nb2);\n running = false;\n }\n if (!nb2.visited) {\n nb2.status = \"visited\";\n nb2.visited = true;\n nb2.prev = back;\n Q2.unshift(nb2);\n }\n })\n }\n console.log(board.sourceSet);\n console.log(board.targetSet)\n return [board.sourceSet[board.sourceSet.length - 1],\n board.targetSet[board.targetSet.length - 1]];\n}", "title": "" }, { "docid": "87bfc0ab6da535f1152d10c7239d41f8", "score": "0.5694002", "text": "dfsInOrder(node = this.root, visitedNodes = []) {\n if (node.left) this.dfsInOrder(node.left, visitedNodes) \n visitedNodes.push(node.val)\n if (node.right) this.dfsInOrder(node.right, visitedNodes) \n return visitedNodes\n }", "title": "" }, { "docid": "0ec51d01e1eafb4742e5e28a47254955", "score": "0.56918055", "text": "function dfs(G, v, depth, acc, cycles) {\n\tif (depth === 0) return;\n\n\tconst N = getNeighbors(G, v);\n\n\tfor (var i = 0; i < N.length; i++) {\n\t\tconst nextAcc = acc.slice(),\n\t\t edge = N[i],\n\t\t endpoint = edge._e;\n\n\t\tnextAcc.push(edge);\n\n\t\tif (acc.length > 0 && acc[0]._s === endpoint)\n\t\t\tas.add(cycles, nextAcc);\n\n\t\tdfs(G, endpoint, depth - 1, nextAcc, cycles);\n\t}\n}", "title": "" }, { "docid": "edbe9a88e0d99bc8fd7a549ba099e6b4", "score": "0.5679302", "text": "function findRoute(start, end, home, parent){\n var currentList = travelPathGraph[start];\n var tempList = [];\n\n //first we error handle if the user is trying to teleport to their end location from their start location\n if (start == end){\n \trouteFound = 1;\n\n\n }\n\n //now we check if the current city has a direct flight path to our destination\n if (currentList[end] == 1){\n finalRoute = ([parent]+[end]);\n\n //alert(finalRoute);\n\n findTravelTime(finalRoute, home);\n\n routeFound = 1;\n }\n //if it doesnt we now to to check the child nodes of our current city. \n else {\n for (var i = 0; i < currentList.length; i++){\n if (currentList[i] == 1){\n \t//for every spot we find a 1 in the row that means there is a travel path\n\n \t//we push the index of each 1 we find into a queue. this will tell us what rows we need to seach for our destination, and what order to search for them\n queList.push(i);\n\n //we also need to keep track of the parent nodes so we can remember the exact path we will have to take\n\n parentList.push(parent);\n\n }\n }\n \n //we have now created a list of cities we need to check, so we will soop though them or until we find our destination\n while (queList.length > 0 && routeFound == 0){\n \n //var j is created which is essentally the child node that we want to examine next. I just reverse the list twice cause I want to take it from the head of the list\n //by popping in the children in a first in first out style i use a breath first search which assures we find the fastest route possiable.\n queList.reverse();\n var j = queList.pop(0);\n queList.reverse();\n\n //the parentList is just a list that each element corrisponds to the same index of the queList.\n //it keeps track of all the previous parents of each element so that when we find our destination we also know the route\n parentList.reverse();\n prevParent = parentList.pop(0);\n parentList.reverse();\n\n\n\n\n //we now recursively call this function except passing in the child as the new parent, and the previous parents appened with the child.\n\n findRoute(j, end, home, [prevParent]+j);\n\n }\n\n\n \n }\n\n\n}", "title": "" }, { "docid": "4b11a07c1f71cf95ca325227f6823410", "score": "0.5671891", "text": "dfs(root, limit) {\n let visitedBoards = [];\n let queue = [root];\n\n let t0 = performance.now();\n \n while(queue.length != 0 && (performance.now() - t0) < TIMEOUT) {\n let newNode = queue.shift();\n if(this.checkAlreadyVisited(visitedBoards, newNode.board.toString())) {\n console.log(\"Already visited\");\n continue;\n }\n if(newNode.reachedFinalState) { \n console.log(\"Queue Size: \" + queue.length);\n console.log(\"Found a solution:\");\n console.log(this.buildSolution(newNode));\n return newNode;\n }\n\n if(newNode.currentDepth < limit || limit == null) {\n visitedBoards.push(newNode.board.toString());\n \n let children = newNode.expandUninformed();\n queue.unshift(...children);\n }\n }\n\n return -1;\n }", "title": "" }, { "docid": "37c12ebd2a74648d3ccfb0b931d001eb", "score": "0.5669343", "text": "breathFirstTraversal(callback, start = this.vertices[0]) {\n const visitedVertices = [start];\n const visitQueue = new Queue();\n visitQueue.enqueue(start);\n while (!visitQueue.isEmpty()) {\n const current = visitQueue.dequeue();\n callback(current);\n current.edges.forEach((edge) => {\n const neighbour = edge.end;\n if (!visitedVertices.includes(neighbour)) {\n visitedVertices.push(neighbour);\n visitQueue.enqueue(neighbour);\n }\n })\n }\n }", "title": "" }, { "docid": "5968ea56400dfcff86c2266dc5929134", "score": "0.56570435", "text": "advPath(explode = true) {\n this.match(pathSymbol);\n const path = this.path();\n let node;\n if (path) {\n node = this.tree.addVertex(new PathNode({ path }));\n }\n\n let childNodes = [];\n const isBranch = this.branch(childNodes);\n\n let pathNodes;\n if (node && explode) {\n pathNodes = this.explodeNode(node);\n }\n if (isBranch) {\n if (node) {\n if (!pathNodes) pathNodes = this.explodeNode(node);\n childNodes.forEach(c => {\n const cNodes = this.explodeNode(c);\n this.tree.addEdge(pathNodes[pathNodes.length - 1], cNodes[0]);\n });\n\n const node2 = this.advPath();\n\n if (node2 instanceof TreeVertex) {\n const pathNodes2 = this.explodeNode(node2);\n this.tree.addEdge(pathNodes[pathNodes.length - 1], pathNodes2[0]);\n } else if (Array.isArray(node2) && node2.length) {\n node2.forEach(c => {\n const cNodes = this.explodeNode(c);\n this.tree.addEdge(pathNodes[pathNodes.length - 1], cNodes[0]);\n });\n }\n } else if (childNodes.length > 0) {\n node = childNodes;\n }\n }\n\n return node;\n }", "title": "" }, { "docid": "4b4955fd377b44b61df68cf9ebc3edd3", "score": "0.56522053", "text": "async function passIO() {\n var count = TSS.nodes.length - 1;\n var traversed = 0;\n var curr_node = TSS.nodes[1];\n // initial rev node will not have an id match.\n // this gets set each loop\n var prev_node = { id: \"not a chance\" };\n\n // start at closest node to center\n while (traversed < count) {\n // add current node id to path\n TSS.path.push(curr_node.id);\n // get the next point\n var next_node = getNextNodeInPath(curr_node, prev_node);\n if (next_node) {\n // TODO: this condition shouldnt be necessary\n // set the master send and receive values\n curr_node.send_to = next_node.id;\n next_node.receive_from = curr_node.id;\n // set previous node for next loop\n prev_node = curr_node;\n // set current node for next loop\n curr_node = next_node;\n } else {\n console.warn(\"we here\", curr_node.tmp_snd.concat(curr_node.tmp_rec));\n }\n // increase traversed count\n traversed++;\n }\n\n // now we have our path.\n // step through the path, grab 5 points forward, determine shortest route for 2,3,4 to get between 1 and 5.\n // if so, update the values\n TSS.path = await traverseArray(TSS.path, 0);\n TSS.notify(\"Generated Path\", TSS.path);\n\n // very important. recalculate distance.\n for (var i = 1; i < TSS.nodes.length - 1; i++) {\n var node = TSS.nodes[i];\n if (node.send_to) {\n TSS.data.distances.optimized += UTIL.distanceToCenter(\n node,\n TSS.nodes[node.send_to]\n );\n }\n }\n\n // at this point, TSS.data.chains should be an array containing one array containing all of our values\n if (TSS.data.chains[0].length !== TSS.data.node_count + 1)\n console.warn(\"chain logic is broken\");\n }", "title": "" }, { "docid": "8f52ab5d40cebb3873f82c2952a1b9ba", "score": "0.5646807", "text": "function findRoute(graph, start, end) {\n\t// for all the nodes in the graph, set them to \"Unvisited\"\n\n\t// set the start node to be \"Visiting\"\n\t// add the start to the queue\n\n\t// while the queue is not empty\n\t\t// pop from queue\n\t\t// if something popped out\n\t\t\t// check if our destination is there\n\t\t\t// if it is, return true\n\t\t\t// if not, add all of the new nodes to the queue and set their state to visiting\n\t\t// after going through all the destination nodes, set the current state to visited\n}", "title": "" }, { "docid": "0d847c1e6a8f008b6c1e9c8321f2e535", "score": "0.564078", "text": "dfs(startingNode, target) {\n this.paths = [];\n this.target = target;\n var visited = [];\n for (var i = 0; i < this.noOfVertices; i++)\n visited[i] = false;\n\n this.path = {};\n this.path[startingNode] = [startingNode];\n\n this.DFSUtil(startingNode, visited, 1);\n // console.log(this.paths);\n }", "title": "" }, { "docid": "e510344fac0f5fa0e14988044358303a", "score": "0.56388074", "text": "dfs(vertex){\n // Check if vertex is in graph\n if (this.adjList[vertex]){\n // Initialize storage for visited\n // vertices\n const visited = {}\n\n // Begin recursion\n this.dfsUtil(vertex, visited, null)\n }\n }", "title": "" }, { "docid": "b5d496c1dee4a76903b298042383ccc3", "score": "0.56308794", "text": "dfs( startNode ) {\n\n let visited = [];\n for (let i = 0; i < this.noVerts; i++) {\n visited[i] = false;\n }\n\n this.DFSUtil(startNode, visited);\n }", "title": "" }, { "docid": "3ef3e93045f172d523f1713ea2581356", "score": "0.5628705", "text": "generateRecursiveBacktrack() {\n \n }", "title": "" }, { "docid": "420501c0bc1fc0a4cb7be476ac6eae2c", "score": "0.5625093", "text": "function DFS() {\r\n stackLoop: while (stack.length) {\r\n \r\n let node = stack[stack.length - 1];\r\n\r\n // Visit the unvisited nodes\r\n if (!node.visited) {\r\n node.visited = true;\r\n output.push(node);\r\n }\r\n\r\n // Retrieve the next node which we will be visiting\r\n for (let n of node.childNodes) {\r\n if (!n.visited) {\r\n stack.push(n);\r\n continue stackLoop;\r\n }\r\n }\r\n // Function to pop the node from the stack.\r\n stack.pop();\r\n }\r\n}", "title": "" }, { "docid": "9aee07a86f6cc6638ade585f138efeca", "score": "0.5618233", "text": "function findPath(start, end){ // start and end are node objects\n\tvar visited = [];\n\tvar distance = 0;\n\n\tpath = findPathRecursion(start, end, distance, visited);\n\n\tpath.path.reverse(); // turn it around so that the starting point is the first element\n\n\t// divide path into segments based on levels\n\n\tpathSegments = [];\n\tsegment = [];\n\tfor(var i = 0; i < path.path.length-1; i++){\n\t\tsegment.push(path.path[i]);\n\t\tif((path.path[i].name.substring(0,6) === \"stairs\" && path.path[i+1].name.substring(0,6) === \"stairs\" ) ||\n\t\t (path.path[i].name.substring(0,8) === \"elevator\" && path.path[i+1].name.substring(0,8) == \"elevator\")){\n\t\t\tpathSegments.push(segment);\n\t\t\tsegment = [];\n\t\t}\n\t}\n\tsegment.push(path.path[path.path.length-1]);\n\tpathSegments.push(segment);\n\n\t// remove stairs/elevators on floors where you don't otherwise travel\n\n\tfor(var i = 0; i < pathSegments.length; i++){\n\t\tif(pathSegments[i].length < 2){\n\t\t\tpathSegments.splice(i,1);\n\t\t\ti--;\n\t\t}\n\t}\n\n\t// package each segment labeled with the floor it's on\n\n\tpath = [];\n\n\tfor(segment of pathSegments){\n\t\tpath.push({level:getLevelOfNode(segment[0]), nodes:segment});\n\t}\n\n\treturn path;\n}", "title": "" }, { "docid": "f1a61f107340a287253ec2c0795a2af2", "score": "0.56136847", "text": "function dfsInOrder(){\n let visited = []\n let current = this.root \n\n function traverse(node){\n if(node.left) traverse(node.left)\n visited.push(node)\n if(node.right) traverse(node.right)\n }\n traverse(current)\n return visited\n}", "title": "" }, { "docid": "c15bf104351603eb1d0abef07a0326ae", "score": "0.5612443", "text": "function bfs(start, airportToFind) {\n const visited = new Set();\n const queue = [start];\n\n while (queue.length > 0) {\n const airport = queue.shift();\n const destinations = adjacenyList.get(airport);\n\n for (const destination of destinations) {\n if (destination === airportToFind) {\n console.log(`BFS found ${airportToFind}`);\n }\n\n if (!visited.has(destination)) {\n visited.add(destination);\n queue.push(destination);\n console.log(destination);\n }\n }\n }\n}", "title": "" }, { "docid": "4fbf0de7602135c26b195e5a58bce6cc", "score": "0.5612159", "text": "getPath(src,dest){\n console.log(\"here\",src,dest)\n var visited = [];\n return this.getPathUtil(src,dest,visited); \n }", "title": "" }, { "docid": "8e1b60c438753b73c576d728f7acb0b2", "score": "0.56119496", "text": "DFSI(start) {\n let stack = []; // * Stack to iterate left vertex\n let result = []; // * Result to hold final list of vertices\n let visited = {}; // * Object to hold visited vertex\n let currentElement; // * variable to help in iteration\n\n\n stack.push(start); // * Initialized input vertex as first element of Stack (line 78)\n visited[start] = true; // * Marked input vertex as visited (line 79)\n\n while(stack.length > 0){ // * Start looping till Stack has element left\n currentElement = stack.pop(); // * Take out element from Stack\n result.push(currentElement); // * Push that element in result holder array\n\n this.adjacentList[currentElement].forEach(neighbour => { // * Iterate over pop out vertex (line 88)\n if(!visited[neighbour]){ // * Check did we not visited to currentElement\n visited[neighbour] = true; // * Marked visited \n stack.push(neighbour); // * push it into Stack\n }\n })\n }\n\n return result; // * Finally return the result array ( line 79)\n }", "title": "" }, { "docid": "cbfb3fd2770531d0a8ab6f961360bb9c", "score": "0.56111646", "text": "calculatePath() {\n // create Nodes from the Start and End x,y coordinates\n const mypathStart = new Node(null, { x: this.pathStart[0], y: this.pathStart[1] }, this.worldWidth)\n const mypathEnd = new Node(null, { x: this.pathEnd[0], y: this.pathEnd[1] }, this.worldWidth)\n // create an array that will contain boolean values all world cells (if the path has been visited, it will be true)\n let visitedNodes = new Array(this.worldSize)\n // list of currently open Nodes\n let openNodes = [mypathStart]\n // list of closed Nodes\n let closedNodes = []\n // list of the final output array\n const result = []\n // reference to a Node (that is nearby)\n let myNeighbours\n // reference to a Node (that we are considering now)\n let myNode\n // reference to a Node (that starts a path in question)\n let myPath\n // temp integer variables used in the calculations\n let length, max, min, i, j\n // iterate through the open list until none are left\n while (openNodes.length > 0) {\n length = openNodes.length\n max = this.worldSize\n min = -1\n for (i = 0; i < length; i++) {\n if (openNodes[i].f < max) {\n max = openNodes[i].f\n min = i\n }\n }\n // grab the next node and remove it from Open array\n myNode = openNodes.splice(min, 1)[0]\n // is it the destination node?\n if (myNode.worldIndex === mypathEnd.worldIndex) {\n myPath = closedNodes[closedNodes.push(myNode) - 1]\n do {\n result.push(new Vector(myPath.x, myPath.y))\n myPath = myPath.parentNode\n }\n while (myPath != null)\n // clear the working arrays\n visitedNodes = closedNodes = openNodes = []\n // we want to return start to finish\n result.reverse()\n }\n else // not the destination\n {\n // find which nearby nodes are walkable\n myNeighbours = this.neighbors(myNode.x, myNode.y)\n // test each one that hasn't been tried already\n for (i = 0, j = myNeighbours.length; i < j; i++) {\n myPath = new Node(myNode, myNeighbours[i], this.worldWidth)\n if (!visitedNodes[myPath.worldIndex]) {\n // estimated cost of this particular route so far\n myPath.g = myNode.g + this.distanceFunction(myNeighbours[i], myNode)\n // estimated cost of entire guessed route to the destination\n myPath.f = myPath.g + this.distanceFunction(myNeighbours[i], mypathEnd)\n // remember this new path for testing above\n openNodes.push(myPath)\n // mark this node in the world graph as visited\n visitedNodes[myPath.worldIndex] = true\n }\n }\n // remember this route as having no more untested options\n closedNodes.push(myNode)\n }\n } // keep iterating until until the Open list is empty\n return result\n }", "title": "" }, { "docid": "684a1c0552bd0ac40f5597cd1269d3bc", "score": "0.5607355", "text": "function animateBFSConv(board) {\n let path = BFS(board);\n for (let i = 0; i <= board.sourceSet.length; i++) {\n if (i === board.sourceSet.length) {\n setTimeout(() => {\n animateShortestPathBFSConv(path);\n }, factortime(i, 10));\n return;\n }\n setTimeout(() => {\n const sourcy = board.sourceSet[i];\n const targety = board.targetSet[i];\n document.getElementById(sourcy.id).className = \"visited\";\n document.getElementById(targety.id).className = \"visited\";\n\n // The targetSet will always be 1 bigger so we get that last element here\n if (i+1 === board.sourceSet.length) {\n const targety = board.targetSet[board.targetSet.length - 1];\n document.getElementById(targety.id).className = \"visited\";\n }\n }, factortime(i, 10));\n }\n}", "title": "" }, { "docid": "c8e001abf7487872ff31414303c83973", "score": "0.5607275", "text": "function dfs(g,vs,order){if(!Array.isArray(vs)){vs=[vs]}var navigation=g.isDirected()?v=>g.successors(v):v=>g.neighbors(v);var orderFunc=order===\"post\"?postOrderDfs:preOrderDfs;var acc=[];var visited={};vs.forEach(v=>{if(!g.hasNode(v)){throw new Error(\"Graph does not have node: \"+v)}orderFunc(v,navigation,visited,acc)});return acc}", "title": "" }, { "docid": "56f8968085f970fbed88afe652779a64", "score": "0.56063473", "text": "static _recursiveRoomSearch(roomName, depth, maxDepth, visited) {\n if (visited[roomName] == undefined) {\n visited[roomName] = depth;\n }\n else {\n visited[roomName] = Math.min(depth, visited[roomName]);\n }\n let neighbors = _.values(Game.map.describeExits(roomName));\n if (depth < maxDepth) {\n for (let neighbor of neighbors) {\n // Visit the neighbor if not already done or if this would be a more direct route\n if (visited[neighbor] == undefined || depth + 1 < visited[neighbor]) {\n this._recursiveRoomSearch(neighbor, depth + 1, maxDepth, visited);\n }\n }\n }\n return visited;\n }", "title": "" }, { "docid": "ac0b13e5a14efebb9c84290dd0d0fc8d", "score": "0.56027704", "text": "function recursiveOneWayDepthFirstSearch($rootTask) {\n\n}", "title": "" }, { "docid": "e9e150ebc84ca769b2da1c86c11f7f21", "score": "0.55886626", "text": "function BreadthFirstSearch(walls, cols, rows) {\n var open = new Queue();\n let nodes = [];\n //Khoi tao 1 mang cac doi tuong node\n for (let i = 0; i < cols; i++) {\n nodes[i] = [];\n for (let j = 0; j < rows; j++) {\n nodes[i][j] = new Node(i, j, walls[i][j])\n }\n }\n this.test = function () {\n return nodes;\n }\n this.FindPath = function (start, goal) {\n let node;\n open = new Queue();\n open.enqueue(start);\n while (!open.isEmpty()) {\n node = open.dequeue();\n if (node) {\n if (node.x == goal.x && node.y == goal.y) {\n return getSol(node);\n }\n genMove(node);\n }\n else\n break;\n }\n return null\n }\n\n function genMove(node) {\n if (node.x < cols - 1) {\n addToOpen(node.x + 1, node.y, node);\n }\n if (node.y < rows - 1) {\n addToOpen(node.x, node.y + 1, node);\n }\n if (node.x > 0) {\n addToOpen(node.x - 1, node.y, node);\n }\n if (node.y > 0) {\n addToOpen(node.x, node.y - 1, node)\n }\n }\n\n function addToOpen(x, y, previous) {\n var node = nodes[x][y];\n if (node.value === BLANK) {\n node.value = VISITED;\n node.previous = previous;\n open.enqueue(node);\n }\n }\n\n function getSol(p) {\n var nodes = [];\n nodes.push(p);\n while (p.previous) {\n nodes.push(p.previous);\n p = p.previous;\n }\n return nodes;\n }\n}", "title": "" } ]
fb47b409b5762efec77d3e18f932ffd4
Bootstrap styling for the tag color of the device
[ { "docid": "3db5819fe7c73709e6ac0d722feadc42", "score": "0.65239066", "text": "function styleForTagColor(tagColor) {\n const prefix = \"form-control bg-form-box text-form-color border-\";\n if (tagColor !== null && tagColor !== undefined) {\n // eslint-disable-next-line default-case\n switch (tagColor) {\n case \"white\":\n return prefix + \"white\";\n case \"White\":\n return prefix + \"white\";\n case \"purple\":\n return prefix + \"indigo\";\n case \"Purple\":\n return prefix + \"indigo\";\n case \"red\":\n return prefix + \"danger\";\n case \"Red\":\n return prefix + \"danger\";\n case \"blue\":\n return prefix + \"primary\";\n case \"Blue\":\n return prefix + \"primary\";\n default:\n return prefix + \"dark\";\n }\n } else {\n return prefix + \"dark\";\n }\n }", "title": "" } ]
[ { "docid": "4a3e86cb36d0ac8f1566eea339f807ef", "score": "0.6095661", "text": "static get tag() {\n return \"simple-colors-demo-variables\";\n }", "title": "" }, { "docid": "d9f6ac91522a23262ba6789fda41018a", "score": "0.5733086", "text": "textColor() {\n return this.luminance() > 0.5 ? black : white;\n }", "title": "" }, { "docid": "11fbdde5ba274eb721622a311ea7899f", "score": "0.56913245", "text": "function resolveColor(tag) {\n const def = '#00C853';\n return colors[tag] ? colors[tag] : def;\n}", "title": "" }, { "docid": "11fbdde5ba274eb721622a311ea7899f", "score": "0.56913245", "text": "function resolveColor(tag) {\n const def = '#00C853';\n return colors[tag] ? colors[tag] : def;\n}", "title": "" }, { "docid": "25341728404920a9a0e42ae46c50d286", "score": "0.5678826", "text": "function obecnyKolor() {\n \n if( $(theSpan).hasClass('red') ) { return 'red'; }\n if( $(theSpan).hasClass('ora') ) { return 'ora'; }\n return 'gre';\n}", "title": "" }, { "docid": "b92c0d0f7e1d7a7b0bff709104ea5823", "score": "0.55982083", "text": "get color() {\n if (this.hasAttribute('color')) {\n return this.getAttribute('color');\n } else {\n return 'red';\n }\n }", "title": "" }, { "docid": "aaaf68f361aeeac50cb03889c2ec0117", "score": "0.5572207", "text": "function getChipColor() {\n return isLowCharge() ? classes.highlight : classes.normal;\n }", "title": "" }, { "docid": "47a3f44cceacaa7af2362bfe04ffd868", "score": "0.55461043", "text": "static get tag() {\n return \"learn-two-theme\";\n }", "title": "" }, { "docid": "5c1c0d8b2809d2b5457eb04f0edd900e", "score": "0.5475205", "text": "getColor() {\n return elements.color.value;\n }", "title": "" }, { "docid": "cc6e6ee7b8f8c4fbfe97087bbd31aa85", "score": "0.5461786", "text": "getColor() {\n if (this.temperature <= 15) {\n return \"blue\";\n } else if (this.temperature <= 30) {\n return \"orange\";\n } else {\n return \"red\";\n }\n }", "title": "" }, { "docid": "3e95d4d1b5a143e1ffa9bd91f0e35035", "score": "0.5433625", "text": "static get tag() {\n return \"agency-theme-band\";\n }", "title": "" }, { "docid": "74ea5ea0c7df5f7c1b2625241458cf77", "score": "0.5371024", "text": "get color() {\n return this._getOption('color');\n }", "title": "" }, { "docid": "45e631c80c998cbe8dc8edf354a5d597", "score": "0.53613055", "text": "get summaryLabelTextColor() {\n return brushToString(this.i.k5);\n }", "title": "" }, { "docid": "a0dbd02c9dad254c7ffad8d8d844679d", "score": "0.53438777", "text": "function setLabelColor() {\n\tif($(window).width() > '767') {\n\t\t$('.public-label').each(function(){\n\t\t\tif($(this).data('typeArticle') == \"review\") {\n\t\t\t\t$(this).css('background-color', 'rgba(245,57,101,0.5)');\n\t\t\t}\n\t\t\tif($(this).data('typeArticle') == \"useful\") {\n\t\t\t\t$(this).css('background-color', 'rgba(63,63,63,0.5)');\n\t\t\t}\n\t\t\tif($(this).data('typeArticle') == \"article\") {\n\t\t\t\t$(this).css('background-color', 'rgba(5,93,143,0.5)');\n\t\t\t}\n\t\t});\n\t} else {\n\t\t$('.public-label').each(function(){\n\t\t\t$(this).removeAttr('style');\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d184b388c9bae39b8db15d069363014b", "score": "0.53179103", "text": "get labelInnerColor() {\r\n return brushToString(this.i.ec);\r\n }", "title": "" }, { "docid": "616b040488b3b90304c16c50ba97daa7", "score": "0.5313429", "text": "get labelTextColor() {\n return brushToString(this.i.hk);\n }", "title": "" }, { "docid": "616b040488b3b90304c16c50ba97daa7", "score": "0.5313429", "text": "get labelTextColor() {\n return brushToString(this.i.hk);\n }", "title": "" }, { "docid": "0a5d830ea583a1de6aeb3258ccf85d83", "score": "0.5297643", "text": "function ColorSwatch({ color, label, isDark }) {\n return (\n <div\n className={classnames(\"color-swatch\", isDark ? 'dark' : 'light' )}\n style={{ background: color }}\n >\n <label>{label}</label>\n <label>{color}</label>\n </div>\n )\n}", "title": "" }, { "docid": "0d8c9b80eb200a46a17a30946dd3f153", "score": "0.52955735", "text": "normalize () {\n return 'color-adjust'\n }", "title": "" }, { "docid": "792a165a11af7bc5c749e4f1dbd9575d", "score": "0.52592903", "text": "function getColor(d) {\n let index = d.cat;\n if (d.ibgib === \"ib^gib\") {\n index = \"ibGib\";\n } else if (d.render && d.render === \"text\") {\n index = \"text\";\n } else if (d.render && d.render === \"image\") {\n index = \"image\";\n } else if (d.cat === \"rel8n\") {\n index = d.id;\n }\n return d3Colors[index] || d3Colors[\"default\"];\n }", "title": "" }, { "docid": "273cd322d2a85d06b1149a8ef3c0cddc", "score": "0.52471715", "text": "getColor() {\n\t\tif (this.props.votes >= 10) {\n\t\t\treturn '#4CAF50';\n\t\t} else if (this.props.votes >= 8) {\n\t\t\treturn '#8BC34A';\n\t\t} else if (this.props.votes >= 6) {\n\t\t\treturn '#CDDC39';\n\t\t} else if (this.props.votes >= 4) {\n\t\t\treturn '#FFEB3B';\n\t\t} else if (this.props.votes >= 2) {\n\t\t\treturn '#FFC107';\n\t\t} else if (this.props.votes >= 1) {\n\t\t\treturn '#FF9800';\n\t\t} else {\n\t\t\treturn '#f44336';\n\t\t}\n\t}", "title": "" }, { "docid": "8cf599f83503e5e65fa6fb84c598c1fd", "score": "0.523489", "text": "function getProductStyle() {\n return \"\" +\n \".material-background-nav-bar { \" +\n \" background-color : \" + appPrimaryColor + \" !important;\" +\n \" border-style : none;\" +\n \" background-image : url('img/background_cover_pixels.png') !important;\" +\n \" background-size : initial !important;\" +\n \"}\" +\n \".md-primary-color {\" +\n \" color : \" + appPrimaryColor + \" !important;\" +\n \"}\";\n }// End create custom style for product view.", "title": "" }, { "docid": "1a4c8bf00371e84ba16b5f9975a73ca7", "score": "0.52250725", "text": "getColor() {\n if (this.state.erasing) { // This ensures that upon erase tool selected, clicking will erase label and color\n return null;\n } else {\n return this.colorBarRef.current.state.color;\n }\n }", "title": "" }, { "docid": "ccd5fa36da5b00c61b1a79cf5ae2ce58", "score": "0.5224094", "text": "get summarySectionLabelTextColor() {\n return brushToString(this.i.vl);\n }", "title": "" }, { "docid": "79fbb0a586cc47070d6a6f93adaab34a", "score": "0.5219525", "text": "get summaryRootLabelTextColor() {\n return brushToString(this.i.vh);\n }", "title": "" }, { "docid": "491eba1f32348ee5450d5145715b610e", "score": "0.5211604", "text": "function styyle(feature) {return {color: \"#00FF00\", weight: 1.5, fillColor: '#0B610B', fillOpacity: .5};}", "title": "" }, { "docid": "9bd9c67c959faa5072dea066d133d7a0", "score": "0.5204694", "text": "static st(tag, msg, color) {\n if (color) {\n console.log(tag, colors[color](`|----------- ${msg} -----------|`));\n }\n else {\n console.log(tag, `|----------- ${msg} -----------|`);\n }\n }", "title": "" }, { "docid": "74aa576b5466263feded702381206d9d", "score": "0.51983035", "text": "_colorUpdate() {\n if(this.value){\n this.updateStyles({\n '--l2t-paper-color-indicator-icon': this.value,\n '--l2t-paper-color-indicator-icon-display': 'block',\n });\n } else {\n this.updateStyles({\n '--l2t-paper-color-indicator-icon': 'transparent',\n '--l2t-paper-color-indicator-icon-display': 'none',\n });\n }\n }", "title": "" }, { "docid": "49b0e54fbcea83b45d9868c6ff3e148c", "score": "0.51908606", "text": "getColor(){\n\t\tswitch (this.state) {\n\t\t case 'stem':\n\t\t\tthis.color = colorStem;\n\t\t\tbreak;\n\t\t case 'young':\n\t\t\tthis.color = colorYoung;\n\t\t\tbreak;\n\t\t case 'diff':\n\t\t\tthis.color = colorDiff;\n\t\t\tbreak;\n\t\t case 'quiescent':\n\t\t\tthis.color = colorQuie;\n\t\t\tbreak;\n\t\t case 'dead':\n\t\t\tthis.color = colorDead;\n\t\t\tbreak;\n\t\t}\t \n\t}", "title": "" }, { "docid": "11f051a038e000e9c4d534970f21c62e", "score": "0.5180195", "text": "getClassName() {\n return 'Color4';\n }", "title": "" }, { "docid": "63b64a5e316854e0d8a79b907f7ee432", "score": "0.51715875", "text": "getColor(){\n\t\tswitch (this.props.index % 7) {\n\t\tcase 0:\n\t\t\treturn 'deep-purple ';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\treturn 'blue ';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\treturn 'teal ';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\treturn 'amber ';\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\treturn 'red ';\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\treturn 'green ';\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\treturn 'cyan ';\n\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "88115b1f12ffc05973b993b82c731a7d", "score": "0.51708955", "text": "get summaryLabelTextColor() {\n return brushToString(this.i.fj);\n }", "title": "" }, { "docid": "85efa56056318b891608d8f299bb356f", "score": "0.51704586", "text": "function update_shroom_color(mycolor, element_tag) {\n d3.select(element_tag)\n .transition()\n .duration(700)\n .style('fill', mycolor)\n \n }", "title": "" }, { "docid": "d864a002d547cef8b98e2e45f162ade1", "score": "0.5167846", "text": "function colorMeRed() {\r\n\r\n document.querySelector('.col-12.border.border-danger').style.color = 'white';\r\n document.querySelector('.col-12.border.border-danger').style.backgroundColor = 'red';\r\n}", "title": "" }, { "docid": "611afd8b8815256bd302097e778b27d0", "score": "0.5152994", "text": "getColor() {\n return this.remoteMsg[CordovaRemoteMessage.NOTIFICATION.COLOR];\n }", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.51518214", "text": "function DebugStyling() { }", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.51518214", "text": "function DebugStyling() { }", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.51518214", "text": "function DebugStyling() { }", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.51518214", "text": "function DebugStyling() { }", "title": "" }, { "docid": "d0cab48cbe2cd93b4ae90a35cc28de9b", "score": "0.51425153", "text": "get color() {}", "title": "" }, { "docid": "d0cab48cbe2cd93b4ae90a35cc28de9b", "score": "0.51425153", "text": "get color() {}", "title": "" }, { "docid": "179911a74dd5974349e912dfc753a2d4", "score": "0.5140323", "text": "rgbAsCSS() {\n return `rgb(${this.red}, ${this.green}, ${this.blue})`;\n }", "title": "" }, { "docid": "9401f02ca1fae375818af4efa4488ef4", "score": "0.51333123", "text": "setBackgroundColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal(\"BackgroundColor\"));let resolverInfo=this.__objectResolvers.get(\"backgroundColor\");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue);this.__objectResolvers.set(\"backgroundColor\",{resolver:resolver,watchCallback:this.__onResolverForBackgroundColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForBackgroundColorWatchCallback)})}", "title": "" }, { "docid": "7191f77d1d2b5534fc276d7ef1612c9f", "score": "0.51328754", "text": "getStyle() {\n return {\n // An icon displayed to app users when selecting their authentication method \n icon: KeycatLogo,\n // Name displayed to app users\n text: 'Keycat',\n // Background color displayed to app users who select your authenticator\n background: '#000000',\n // Color of text used on top the `backgound` property above\n textColor: '#FFFFFF',\n };\n }", "title": "" }, { "docid": "0e326ce19badea2dea9b85a009f6f8df", "score": "0.51324457", "text": "getButtonPlateColor() {\n return this.menuBtn.primaryClr;\n }", "title": "" }, { "docid": "d16c2f86e9dc04f5fe88c556b40beb70", "score": "0.5126314", "text": "function DebugStyling() {}", "title": "" }, { "docid": "32f2e136e0f3721eb973a9d40099ef94", "score": "0.5122661", "text": "colorHtml() {\n return '';\n // delete the empty return above and uncomment the return below to restore the option for picking the color scheme\n /*\n return `Coloring Scheme: <select id=\"ColoringScheme\">\n <option value=\"rainbow\">Rainbow</option></select>`;\n //new option goes here if added\n */\n }", "title": "" }, { "docid": "46fa8c1de84f42a8c6b6fa75181a59e0", "score": "0.5108816", "text": "function color(value) {\n // just return the color value if no value is given\n if (value == null)\n return Interface.config.color;\n\n // set to config\n Interface.config.color = value.replace('#', '');\n\n // style element\n var custom = $('body style#custom');\n if (custom.length == 0) {\n custom = $('<style type=\"text/css\" id=\"custom\"></style>');\n $('body').prepend(custom);\n }\n\n // custom styles\n\t\tvar lightColor = tinycolor.desaturate(tinycolor.lighten(value));\n\t\tvar darkColor = tinycolor.desaturate(tinycolor.darken(value));\n var style = \".text-color { color: \" + value + \"; }\\n\"\n + \".bg-color { background-color: \" + value + \"; }\\n\"\n + \".bg-color-light { background-color: \" + lightColor + \"; }\\n\"\n + \".bg-color-dark { background-color: \" + darkColor + \"; }\\n\"\n + \".border-color { border-color: \" + value + \" transparent; }\\n\"\n + \".border-color-light { border-color: \" + lightColor + \" transparent; }\\n\";\n\n // add to body\n custom.html(style);\n }", "title": "" }, { "docid": "bd607d6762b8be828a6e7e1f4c482c39", "score": "0.5104601", "text": "function plateStyle (feature) {\n return {\n fillColor: null,\n color: \"grey\",\n fillOpacity: 0\n };\n}", "title": "" }, { "docid": "f577a40014140b801e9bea7cd18afcad", "score": "0.51017153", "text": "get crosshairsColor() {\n\t\treturn this.nativeElement ? this.nativeElement.crosshairsColor : undefined;\n\t}", "title": "" }, { "docid": "6e80a54e01848b200038ad51a832336a", "score": "0.50948817", "text": "updateColor() {\n const hexVal = this.colorInput.value;\n const rgb = this.hexToRgb(hexVal);\n const rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';\n\n this.lightColorInput.value = rgbLightVal;\n\n const customStyles = document.getElementById('custom-styles');\n const oldColor = customStyles.getAttribute('data-color');\n const oldColorLight = customStyles.getAttribute('data-color-light');\n\n customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);\n customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);\n\n customStyles.setAttribute('data-color', hexVal);\n customStyles.setAttribute('data-color-light', rgbLightVal);\n }", "title": "" }, { "docid": "2d32c606b3abdb6087ff4ce8a973f54c", "score": "0.50933915", "text": "statusColor() {\n return SDG.colorScheme().find(option => option.colorName === this.status).tileColor\n }", "title": "" }, { "docid": "720bf8de0b192f9708931524cdc4667c", "score": "0.5091719", "text": "get rainbow () {\n return this.getAttribute('rainbow')\n }", "title": "" }, { "docid": "67a007283ada8cce086a301ac199192e", "score": "0.5087596", "text": "function changeStyling(tag, styling, color) {\n var tags = document.getElementsByTagName(tag);\n for (i = 0; i < tags.length; i++) {\n if (styling == \"color\")\n document.getElementsByTagName(tag)[i].style.color = color;\n if (styling == \"backgroundColor\")\n document.getElementsByTagName(tag)[i].style.backgroundColor = color;\n }\n}", "title": "" }, { "docid": "9e011369c5c51a84d595d81764ae5c09", "score": "0.5074316", "text": "getColor() {\n return this.color;\n }", "title": "" }, { "docid": "209c15aea463e678bda7a679bfdb1095", "score": "0.5070768", "text": "setTextColor(color) {\n bm.refs.container.style.color = color;\n }", "title": "" }, { "docid": "8059fc57c9b18007a4b55440fd558de3", "score": "0.50680995", "text": "getColor() {\n if (this.phantom) {\n return \"transparent\";\n } else if (this.color != null && Options.colorMap.hasOwnProperty(this.color)) {\n return Options.colorMap[this.color];\n } else {\n return this.color;\n }\n }", "title": "" }, { "docid": "d2c2e060acda25475bc966ce8a1d3a18", "score": "0.50502664", "text": "constructor() {\n super(\"background-color\");\n }", "title": "" }, { "docid": "bc1cb6d24c831ead20f0db16148955a6", "score": "0.50475895", "text": "function brickColoring(element, canvasName) {\n if( element == 0)\n color = \"white\"\n else if (element==1)\n color = \"rgb(244,199,62)\" // yellow\n else\n color = \"rgb(242,122,64)\" // red\n return color\n }", "title": "" }, { "docid": "c725d9a59a3d7bba6d6bfd31f38377da", "score": "0.50349325", "text": "static forceColor() {\n chalk_1.default.level = 1; // `1` - Basic 16 colors support.\n }", "title": "" }, { "docid": "951cf22ed3507aaf97dd5bd0f58aaf54", "score": "0.5034227", "text": "function checkColor(element) {\n var isRed = $(element).hasClass('redChip');\n var isBlue = $(element).hasClass('blueChip');\n if (isRed) {\n return 'red';\n } else if (isBlue) {\n return 'blue';\n } else {\n return 'gray';\n }\n}", "title": "" }, { "docid": "0f72a1b4310beab58d9eafa9fc515b08", "score": "0.5032314", "text": "constructor() {\n super(\"background-color\");\n }", "title": "" }, { "docid": "4574d45a77e4c0cad544117a0b87ee84", "score": "0.5030778", "text": "function colorBar(login) {\n const res = document.querySelectorAll(`[id$=${login}]`);\n res.forEach((ele) => ele.setAttribute(\"fill\", \"red\"));\n}", "title": "" }, { "docid": "fe9d38679c8a74fda246a257282f41a4", "score": "0.50258267", "text": "function getSocialNetworkStyle(socialColor) {\n return \"\" +\n \".material-background-nav-bar {\" +\n \" background : \" + socialColor + \" !important;\" +\n \" border-style : none;\" +\n \"} \" +\n \"md-ink-bar {\" +\n \" color : \" + socialColor + \" !important;\" +\n \" background : \" + socialColor + \" !important;\" +\n \"}\" +\n \"md-tab-item {\" +\n \" color : \" + socialColor + \" !important;\" +\n \"}\" +\n \" md-progress-circular.md-warn .md-inner .md-left .md-half-circle {\" +\n \" border-left-color : \" + socialColor + \" !important;\" +\n \"}\" +\n \" md-progress-circular.md-warn .md-inner .md-left .md-half-circle, md-progress-circular.md-warn .md-inner .md-right .md-half-circle {\" +\n \" border-top-color : \" + socialColor + \" !important;\" +\n \"}\" +\n \" md-progress-circular.md-warn .md-inner .md-gap {\" +\n \" border-top-color : \" + socialColor + \" !important;\" +\n \" border-bottom-color : \" + socialColor + \" !important;\" +\n \"}\" +\n \"md-progress-circular.md-warn .md-inner .md-right .md-half-circle {\" +\n \" border-right-color : \" + socialColor + \" !important;\" +\n \" }\" +\n \".spinner-android {\" +\n \" stroke : \" + socialColor + \" !important;\" +\n \"}\" +\n \".md-primary-color {\" +\n \" color : \" + socialColor + \" !important;\" +\n \"}\" +\n \"a.md-button.md-primary, .md-button.md-primary {\" +\n \" color : \" + socialColor + \" !important;\" +\n \"}\";\n }// End create custom style for Social Network view.", "title": "" }, { "docid": "94ac12d64b2803a726fa742d8322b273", "score": "0.5021355", "text": "function colorMobile() {\r\n\t$(\"td\").each(function() {\r\n\t\tif ($(this).children(\".mobile-event\").length > 0) {\r\n\t\t\t$(this).children(\".miami-label\").addClass(\"white\");\r\n\t\t}\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "41079dfc955ad197aeb19e49f260d823", "score": "0.50096565", "text": "function setColour(uuid){\n\tvar colours = 'red blue green teal hotpink yellow'.split(' ');//#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf'.split(' ');\n\tvar n = 0;\n\tfor(var i in uuid){\n\t\tn = (n + uuid.charCodeAt(i)) % colours.length;\n\t}\n\treturn colours[n];\n}", "title": "" }, { "docid": "34736c5320468bb42d4634c7fca72e8e", "score": "0.4994746", "text": "buildCSSClass() {\n return 'ntk-marker fa-stack vjs-control';\n }", "title": "" }, { "docid": "30af9db63d931d4c13b3dfd1f55bb3bf", "score": "0.49937993", "text": "get backgroundColor() {\n\t\treturn this.nativeElement ? this.nativeElement.backgroundColor : undefined;\n\t}", "title": "" }, { "docid": "d7f803135f3f7e3deeeda6a9f40bfb59", "score": "0.49861693", "text": "getColor() {\n if (this.phantom) {\n return \"transparent\";\n } else {\n return Options.colorMap[this.color] || this.color;\n }\n }", "title": "" }, { "docid": "578879dbf9230ce6c6d09d3c7f6d9acc", "score": "0.4984122", "text": "get color() {\n return this._color ||\n (this._datepickerInput ? this._datepickerInput.getThemePalette() : undefined);\n }", "title": "" }, { "docid": "1e362c23642087389d18d269784b8c42", "score": "0.49709713", "text": "get ARGB4444() {}", "title": "" }, { "docid": "02627475138461f14f647c88263360b6", "score": "0.49700907", "text": "get color() {\n\t\treturn this._picker.color;\n\t}", "title": "" }, { "docid": "f6299e0c109c37ef3737e61f797f96ca", "score": "0.4969633", "text": "bind(el){\n\n el.style.color=\"#\"+Math.random().toString().slice(2,8);\n\n\n\n }", "title": "" }, { "docid": "d71d80e5989e777361f12ec8f44410eb", "score": "0.49668345", "text": "get labelOuterColor() {\r\n return brushToString(this.i.ed);\r\n }", "title": "" }, { "docid": "f297439bfe10961800e1c613ed3dc1b1", "score": "0.49651417", "text": "skillColor( lvl ) {\n const idx = _skillLevelToIndex(lvl);\n const skillColors = (this.theme && this.theme.palette &&\n this.theme.palette.skillLevels) ||\n [ '#FFFFFF', '#5CB85C', '#F1C40F', '#428BCA', '#C00000' ];\n return skillColors[idx];\n }", "title": "" }, { "docid": "0943cb163489429aae75d0f8489048c6", "score": "0.4959262", "text": "function highlightTag() {\n var type = $(this).data('type')\n $('.tag').css('background-color', '#FFF')\n $('.' + type).css('background-color', \"#F00\") \n }", "title": "" }, { "docid": "c72508715c0bf6b71b5200e621fdeb88", "score": "0.49548912", "text": "function view_coloring(series_name){\n switch(series_name){\n case \"NovaSeq\":\n case \"HDD\":\n case \"RNA-Seq\":\n case \"Finished Library\":\n case \"BP bioinformatics\":\n return chroma('hotpink').hex();\n case \"All projects\":\n case \"MiSeq\":\n case \"WG-reseq\":\n case \"Application\":\n case \"total RNA\":\n case \"No BP bioinformatics\":\n case \"In-house\":\n return chroma('blue').hex();\n case \"NextSeq\":\n case \"GRUS\":\n case \"Target-reseq\":\n case \"Tissue\":\n case \"Special\":\n return chroma('green').hex();\n case \"Metagenomics\":\n case \"Genomic DNA\":\n return chroma('orange').hex();\n case \"de novo\":\n return chroma('purple').hex();\n case \"Epigenetics\":\n case \"Production\":\n return chroma('#CD3E10').hex();\n case \"Amplicon\":\n return chroma('turquoise').hex();\n case \"Human\":\n return chroma('#CD3E10').hex();\n default:\n return \"#ace600\";\n }\n}", "title": "" }, { "docid": "f93ff0d14becd30ebe9ec33fe4106603", "score": "0.49487162", "text": "get Color() { return this._color; }", "title": "" }, { "docid": "f949451fd451ca0c21bd0fb1ed8b5994", "score": "0.49475628", "text": "get backgroundColor() {\n let backgroundColor = 0xffffff;\n if (Store.getState()) {\n const tp = Store.getState().theme.options.type;\n if (tp === \"dark\") {\n backgroundColor = 0;\n }\n }\n return backgroundColor;\n }", "title": "" }, { "docid": "ad9013bedc35d70d03d49c094d22a30c", "score": "0.49415582", "text": "static Yellow() {\n return new Color4(1, 1, 0, 1);\n }", "title": "" }, { "docid": "4b00e22ffadc11804a67bc0f748e0e3f", "score": "0.49351862", "text": "function selectColor() {\n if (props.mediaType == \"Article\") {\n return styles.articleColor\n }\n else if (props.mediaType == \"Book\") {\n return styles.bookColor\n }\n else if (props.mediaType == \"Movie\") {\n return styles.movieColor\n }\n else if (props.mediaType == \"Song\") {\n return styles.songColor\n }\n else if (props.mediaType == \"TikTok\") {\n return styles.tiktokColor\n }\n else if (props.mediaType == \"YouTube\") {\n return styles.videoColor\n }\n}", "title": "" }, { "docid": "ed54b24f22ceea42d8498e7f7b285228", "score": "0.49351826", "text": "function selectBackgroundColor() {\n if (props.mediaType == \"Article\") {\n return styles.articleBackgroundColor\n }\n else if (props.mediaType == \"Book\") {\n return styles.bookBackgroundColor\n }\n else if (props.mediaType == \"Movie\") {\n return styles.movieBackgroundColor\n }\n else if (props.mediaType == \"Song\") {\n return styles.songBackgroundColor\n }\n else if (props.mediaType == \"TikTok\") {\n return styles.tiktokBackgroundColor\n }\n else if (props.mediaType == \"YouTube\") {\n return styles.videoBackgroundColor\n }\n}", "title": "" }, { "docid": "3606d7ff576c3d77750edb9a95a66074", "score": "0.49332345", "text": "function _g_scr_color() { \n\tvar sc=\"\";\n\tif (self.screen) {\n\t\tsc=screen.colorDepth+\"-bit\";\n\t}\n\treturn sc;\n}", "title": "" }, { "docid": "9b88b2c49d4f79b5ba15a0936bef43ff", "score": "0.4932946", "text": "get headerTextColor() {\n return brushToString(this.i.u4);\n }", "title": "" }, { "docid": "1bab4db936ac2efa353607cb7b33b7e7", "score": "0.49326783", "text": "function useColors(){// is webkit? http://stackoverflow.com/a/16459606/376773\n// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\nreturn typeof document!=='undefined'&&'WebkitAppearance'in document.documentElement.style||// is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console&&(console.firebug||console.exception&&console.table)||// is firefox >= v31?\n// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\nnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31;}", "title": "" }, { "docid": "46af9148c19105d970a65edf355d18bd", "score": "0.49302173", "text": "static get tag(){return\"md-block\"}", "title": "" }, { "docid": "4b2ecfdbc15ff3fcecbaca3cba234eea", "score": "0.4929295", "text": "function colorizeElement(domNode, options) {\n return __WEBPACK_IMPORTED_MODULE_8__colorizer_js__[\"a\" /* Colorizer */].colorizeElement(__WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__[\"b\" /* StaticServices */].standaloneThemeService.get(), __WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__[\"b\" /* StaticServices */].modeService.get(), domNode, options);\n}", "title": "" }, { "docid": "51ef7fb86f7b9eaafd07b3b530d9e55e", "score": "0.49279776", "text": "function lego(color) {\n $scope.showProduct = true;\n angular.element('.square').css(\"background-color\", color);\n }", "title": "" }, { "docid": "b572594d7a29f147ff90ac05eaf2ccdc", "score": "0.49230823", "text": "get textColor() {\n return brushToString(this.i.hn);\n }", "title": "" }, { "docid": "b572594d7a29f147ff90ac05eaf2ccdc", "score": "0.49230823", "text": "get textColor() {\n return brushToString(this.i.hn);\n }", "title": "" }, { "docid": "cceed58ceb52df5918df0b775c234fc6", "score": "0.49227476", "text": "function paintMerchPerHead() {\n if (merchPerHead >= 1) {\n return 'bg-success text-dark rounded';\n } else if (merchPerHead < 1 && merchPerHead > 0.75) {\n return 'bg-warning text-dark rounded';\n } else if (merchPerHead < 0.75) {\n return 'bg-danger rounded';\n }\n }", "title": "" }, { "docid": "66dc5302f600c01b690ac33871cb1bad", "score": "0.4918272", "text": "function colorCode() {\n values.forEach(function (element) {\n element.todoEl.css(\"height\", \"80px\");\n\n // Comparing each hour on the scheduler and current time in that day\n let eachHour = element.timeVal.format(\"H\");\n let currentTime = startDate.format(\"H\");\n\n // Comparing day on the scheduler and today\n let then = startDate.format(\"YYYY-MM-DD\");\n let now = moment().format(\"YYYY-MM-DD\");\n\n if ((eachHour - currentTime < 0 && now == then) || now > then == true) {\n element.todoEl.css(\"background-color\", \"#d3d3d3\");\n }\n else if (eachHour - currentTime == 0 && now == then) {\n element.todoEl.css(\"background-color\", \"#FF6347\");\n }\n else {\n element.todoEl.css(\"background-color\", \"#90ee90\");\n }\n })\n }", "title": "" }, { "docid": "f1c96193b3ff4c7112a6debe08452604", "score": "0.49159378", "text": "getRenderer(taggingMode) {\n return this.config.renderer ? this.config.renderer[taggingMode] : QuickNoteElement.defaultRenderer;\n }", "title": "" }, { "docid": "4541f064524a87d958c660e45c501de8", "score": "0.4910391", "text": "function node_color(d) {\r\n if (COLOR_MODE == \"DISTANCE\") {\r\n if (d.distance == undefined) return \"#333\";\r\n return COLOR_KEY_DISTANCE[d.distance % COLOR_KEY_DISTANCE.length];\r\n }\r\n // Default scheme: all dark grey\r\n return \"#333\";\r\n }", "title": "" }, { "docid": "f19e2bc567395f21b61129fe597bc7b4", "score": "0.49045217", "text": "getStyle() {\n return {\n // An icon displayed to app users when selecting their authentication method\n icon: TelosSignRoungLogo,\n // Name displayed to app users\n text: \"Telos Sign\",\n // Background color displayed to app users who select your authenticator\n background: \"#030238\",\n // Color of text used on top the `backgound` property above\n textColor: \"#FFFFFF\",\n };\n }", "title": "" }, { "docid": "f37d8b0bcf4e6fc76c02d13f114dada6", "score": "0.4901671", "text": "static get is() { return 'l2t-paper-color-dialog'; }", "title": "" }, { "docid": "c7c5d503d54cab8bcb8e5ca3f26686b7", "score": "0.48978668", "text": "function changeTag(target, color){\n $(target).css(\"background-color\", color);\n}", "title": "" }, { "docid": "2e714b1a0c525b6fc5774feaed024143", "score": "0.48975226", "text": "get summaryRootValueTextColor() {\n return brushToString(this.i.vj);\n }", "title": "" }, { "docid": "db44e364bdae34d2e7efd20b790298f1", "score": "0.48910856", "text": "get summarySectionValueTextColor() {\n return brushToString(this.i.vn);\n }", "title": "" }, { "docid": "679ae419cef720f6dc335bf9c7a80e36", "score": "0.48880446", "text": "function spanColor(bytes) {\r\n\tvar r_class;\r\n \r\n\tif ( bytes < (250 * MB) ) r_class = 'r50'; // dark green\r\n\t\telse if ( bytes < (500 * MB) ) r_class = 'r10'; // light green\r\n\t\telse if ( bytes < (1 * GB) ) r_class = 'r09'; // orange-yellow\r\n\t\telse if ( bytes < (2 * GB) ) r_class = 'r05'; // red-orange\r\n\t\telse r_class = 'r00'; // red\r\n \r\n return r_class;\r\n}", "title": "" } ]
d41b8f19a76d5df76a1af1a934952202
creacion de funcion funcion principal la cual pasara el arreglo correspondiente a mi textarea
[ { "docid": "7305ef0154bc80633a945318863f3cfd", "score": "0.0", "text": "function agregarResult(departamentoF,arreglop){\n \n departamentoF.addEventListener(\"mouseover\", function( event ) {\n \n cajaTexto.value = arreglop;\n \n }, false);\n \n departamentoF.addEventListener(\"mouseout\", function(event){\n cajaTexto.value= '';\n });\n\n}", "title": "" } ]
[ { "docid": "a985de46aca6a7bee12638853814cc96", "score": "0.7029544", "text": "function textArea(texto) {\n\n var t = document.querySelector('#ta');\n\n t.value = texto;\n\n }", "title": "" }, { "docid": "4116c162be32d1a2a7632eae688e931c", "score": "0.6701392", "text": "textArea(elem) {\n // Initiate process for TextArea.\n this.process(elem);\n }", "title": "" }, { "docid": "0a8baca10fbf1063bb1477e1146dab5f", "score": "0.6609905", "text": "function insere(){\r\n\r\n\t\t\tvar texte =\"<textarea cols='10' rows='2'\";\t\r\n\t\t\t// on sauve le contenu\r\n\t\t\ttexte+=\" onchange='lc[\" + this.l + \"][\" + this.c + \"].content=this.value;'>\";\t\t\t\r\n\t\t\ttexte+=this.content;\t\t\t\r\n\t\t\ttexte+=\"</textarea> \\n\";\t\r\n\t\t\treturn texte;\r\n\t\t}", "title": "" }, { "docid": "1516f0d28a11f13d561e6571b82c78e0", "score": "0.6297577", "text": "function expressMode(textarea_div){\n\n\n}", "title": "" }, { "docid": "a53de58e9ef97235c114172f74f2415f", "score": "0.6193769", "text": "function leerTexto(e) { //NOTA → ESTE CODIGO LO PODEMOS UTILIZAR EN TODOS NUESTROS FORMULARIOS\n // console.log('escribiendo...');\n //console.log(e.target.value);\n\n datos[e.target.id] = e.target.value; //rellenar el objeto con los datos del formulario. Tambien IMPORTANTE, que el id sea el mismo nombre del objeto datos\n\n\n //console.log(e.target);\n\n// console.log(datos);\n}", "title": "" }, { "docid": "92ec47a3a86109dbba5085a2df9a5183", "score": "0.6102888", "text": "function TextareaManipulation()\r\n\t{\r\n\t\tvar start_position = null, end_position = null, full_length = null, selection_text = null;\r\n\t\tvar our_element;\r\n\r\n\t\tthis.GetSelection = function(element)\r\n\t\t{\r\n\t\t\tour_element = document.getElementById(element);\r\n\r\n\t\t\tif((document.selection) && (document.selection.createRange) && (document.selection.createRange().parentElement))\r\n\t\t\t{\r\n\t\t\t\tour_element.focus();\r\n\r\n\t\t\t\tvar original = our_element.value.replace(/\\r\\n/g, \"\\n\");\r\n\t\t\t\tvar therange = document.selection.createRange();\r\n\r\n\t\t\t\tvar separator = Math.round(Math.random()*100*new Date()).toString(); //'#$%^%$#';\r\n\r\n\t\t\t\tselection_text = therange.text;\r\n\t\t\t\ttherange.text = separator;\r\n\t\t\t\tvar eitheror = our_element.value.split(separator);\r\n\r\n\t\t\t\tstart_position = eitheror[0].length;\r\n\t\t\t\ttherange.moveStart(\"character\", -separator.length);\r\n\r\n\t\t\t\ttherange.text = selection_text;\r\n\r\n\t\t\t\tend_position = our_element.value.length-eitheror[1].length;\r\n\t\t\t} else\r\n\t\t\tif(our_element.selectionStart >= 0)\r\n\t\t\t{\r\n\t\t\t\tstart_position = our_element.selectionStart;\r\n\t\t\t\tend_position = our_element.selectionEnd;\r\n\t\t\t\tselection_text = (our_element.value.substr(start_position, end_position-start_position));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.GetText = function()\r\n\t\t{\r\n\t\t\treturn(selection_text);\r\n\t\t}\r\n\r\n\t\tthis.Insert = function(text)\r\n\t\t{\r\n\t\t\tour_element.value = our_element.value.substr(0, start_position) + text + our_element.value.substr(end_position, our_element.value.length);\r\n\r\n\t\t\tthis.ResetCursor(start_position+text.length);\r\n\t\t}\r\n\r\n\t\tthis.GetVariables = function(element)\r\n\t\t{\r\n\t\t\tour_element = element;\r\n\t\t}\r\n\r\n\t\tthis.ResetCursor = function(position)\r\n\t\t{\r\n\t\t\tif(our_element.selectionStart)\r\n\t\t\t{\r\n\t\t\t\tour_element.focus();\r\n\t\t\t\tour_element.setSelectionRange(position, position);\r\n\t\t\t} else\r\n\t\t\tif(our_element.createTextRange)\r\n\t\t\t{\r\n\t\t\t\tvar range = our_element.createTextRange();\r\n\t\t\t\trange.move('character', position);\r\n\t\t\t\trange.select();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "629191920079028b3ca7084f13c4a429", "score": "0.6086001", "text": "function getText()\n {\n var pos = getCursorPosition($('#textarea'));\n\n var array = $('#textarea').val();\n var col = 0;\n for (var i=0; i<= pos;i++)\n {\n if(array[i] == '\\n')\n {\n col ++;\n }\n }\n //alert(col);\n if(col !=0){\n var codeArray = $('#textarea').val().split('\\n');\n var command = codeArray[col-1];\n //alert (code);\n //Invoke highlight function, value 1 is which line in text area,\n //value 2 is the original dot file,\n //value 3 is which graph.\n highlightDot(command,machinesDot,\"machines\");\n highlightDot(command,globalDot,\"global\");\n highlightDot(command,tsDot,\"ts\");\n }\n }", "title": "" }, { "docid": "c2dd5c1482ccad5a967ba76d81a24194", "score": "0.6014347", "text": "function codificar(){\n //obtener el texto del textarea\n document.getElementById(\"resultado\").innerHTML = cesar( document.getElementById(\"cadena\").value, 3,parseInt( document.getElementById(\"despla\").value), true);\n\n}", "title": "" }, { "docid": "e013c1a00961adf527626b176c68b19b", "score": "0.6002639", "text": "function subirDescripcionMico(event){\n //cogemos el evento para que no se cambie de pagina antes de hacer el push\n //a la base de datos y recibir el then en la promesa\n event.preventDefault()\n let headlineMico = document.getElementById('headlineMico').value\n var desarrolloMico = document.getElementById('desarrolloMico').value\n escribirHeadlineMico(headlineMico , desarrolloMico)\n}", "title": "" }, { "docid": "efd98c3b36445deb29a6b8e901961739", "score": "0.59917957", "text": "function setTextarea() {\n\t$('textarea').each(function () {\n\t\ttaskTitle = this.value;\n\t\ttaskColorPicker = $(this).parent().find('#colorpicker-icon');\n\t\tfor (var i = 0; i < tasks.length; i++) {\n\t\t\tif (tasks[i].title == taskTitle) {\n\t\t\t\tthis.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden; background-color:' + tasks[i].color +';');\n\t\t\t\ttaskColorPicker.val(tasks[i].color);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}).on('input', function () {\n\t\tthis.style.height = 'auto';\n\t\tthis.style.height = (this.scrollHeight) + 'px';\n\t});\n}", "title": "" }, { "docid": "6c376795aa9899d6fb936296f06ebe3e", "score": "0.596332", "text": "function textarea(content, attrib, placeholder) {\n let ta = make(\"textarea\", attrib);\n if (placeholder) ta.placeholder = placeholder;\n if (content) ta.value = content;\n return ta\n}", "title": "" }, { "docid": "666a65c5b2e92659c52a0c2ee643b407", "score": "0.59588844", "text": "function editTextForInputsFunc(e){\n let command = e.target.dataset.name;\n\n switch(command) {\n case 'fontSize': \n inputTools.forEach(item => item.style.border = 'none')\n iconTools.forEach(item => item.style.color = '#333')\n e.target.style.border = 'solid 1px rgb(198, 41, 80)';\n let fontsize = $.getElementById('fontsize').value;\n textarea.document.execCommand(command,true,fontsize);\n break;\n case 'foreColor':\n inputTools.forEach(item => item.style.border = 'none')\n iconTools.forEach(item => item.style.color = '#333')\n e.target.style.border = 'solid 1px rgb(198, 41, 80)';\n let fontcolor = $.getElementById('colorpicker').value;\n textarea.document.execCommand(command,true,fontcolor);\n break;\n \n }\n}", "title": "" }, { "docid": "08ce8eb6cc55e4636cb6673f7f8224ae", "score": "0.59473217", "text": "function textareaIfy(element) {\r\t\t\t\t\t\tvar textarea = \r\t\t\t\t\t\t\t$('<textarea>')\r\t\t\t\t\t\t\t\t.attr('cols', Math.round(user_data.scriptbar.editBoxCols / 9))\r\t\t\t\t\t\t\t\t.attr('rows', user_data.scriptbar.editBoxRows)\r\t\t\t\t\t\t\t\t.val($(element).val());\r\t\t\t\t\r\t\t\t\t\t\ttextarea.change(function () {\r\t\t\t\t\t\t\telement.val($(this).val());\r\t\t\t\t\t\t});\r\t\t\t\t\r\t\t\t\t\t\telement.before(textarea);\r\t\t\t\t\t\t$(element).hide();\r\t\t\t\t\t}", "title": "" }, { "docid": "00c2b205a768252a91d746832842f6f2", "score": "0.5923437", "text": "function Textarea_Sin_Enter($char, $id){\n //alert ($char);\n $textarea = document.getElementById($id);\n \n if($char == 13){\n $texto_escapado = escape($textarea.value);\n if(navigator.appName == \"Opera\" || navigator.appName == \"Microsoft Internet Explorer\") $texto_sin_enter = str_replace(\"%0D%0A\", \"\", $texto_escapado); \n else $texto_sin_enter = str_replace(\"%0A\", \"\", $texto_escapado); \n $textarea.value = unescape($texto_sin_enter); \n }\n}", "title": "" }, { "docid": "27e2c68cda82431d1df89afc0c2c243f", "score": "0.5913157", "text": "function edit(nombre_del_archivo, texto_a_agregar) {\n matrixTerminal.print(\"openning \" + nombre_del_archivo + \" for edition...\")\n //matrixTerminal.input(\"Input the new text: \", function (texto_a_agregar) {\n parametros_a_enviar = \"comando_a_enviar=edit-\" + nombre_del_archivo + \"-\" + texto_a_agregar;\n send_request_to_python(parametros_a_enviar);\n}", "title": "" }, { "docid": "ef40fcc7066128531c8429f7f484eea1", "score": "0.5873555", "text": "function noteToTextarea(){\n console.log(event.target.innerText)\n let noteObj = {\n title: event.target.innerText,\n body: null\n };\n let result = check_textExist(noteObj);\n exists = result[0];\n noteObj = result[1];\n if (exists) {\n // exists === false\n document.querySelector(\".note_field\").value=noteObj.body;\n }\n}", "title": "" }, { "docid": "c4f4225bf8e9ea724d8d89370dd0631b", "score": "0.58698744", "text": "function updateTextArea(id, typeOfTextFiled) {\n var updated_val = document.getElementById(id).value.split(\"\\n\").join(\"<br/>\");\n \n // .replace(regExForFindPtag, newLine)\n // .replace(regExForFingBRtag, newLine)\n // .replace(regExForFindAllSpaces, \"\");\n resetRichTextArea();\n $('#'+textEditorId).summernote({focus:true});\n $('#' + textEditorId).summernote('code', updated_val);\n // var data = $('#'+textEditorId).val();\n // var emoticon = ':)';\n $('#'+textEditorId).val();\n $('#'+textEditorId).focus();\n // $('.note-editable').find('[contenteditable]').placeCursorAtEnd();\n// var range = $('#'+textEditorId).summernote('createRange');\n// $('#'+textEditorId).summernote('saveRange');\n// // move cursor and select another\n// $('#'+textEditorId).summernote('restoreRange');\n // $('#' + textEditorId).find('[contenteditable]').placeCursorAtEnd();\nmoveCursorToEnd($(id));\n\n\n // var originalValue = updated_val.val();\n // updated_val.val('');\n // updated_val.blur().focus().val(originalValue);\n // var $el = document.getElementById('textEditorId').$el;\n// $el.find('[contenteditable]').placeCursorAtEnd();\n var richTextAreaObject = document.getElementById(textEditorId);\n\n setCustomeAttribute(richTextAreaObject,id,typeOfTextFiled);\n \n if (editor_object[zeroIndex].attributes.customAttr != undefined) {\n \tsetSelectedFieldTitleToEditArea(editor_object[zeroIndex].attributes.customAttr.value); \n }\n}", "title": "" }, { "docid": "5850f47c27c5671edc8094453af8c074", "score": "0.58280593", "text": "function textEditor(s) {\n\n}", "title": "" }, { "docid": "4cd99280d886327307af9414cd32dc45", "score": "0.5803489", "text": "function makovichLauncher() {\n document.getElementById(\"txtArea3\").value = malkovitchMap(captureTextArea());\n }", "title": "" }, { "docid": "f35dbade0890695a94230167588f1b04", "score": "0.5776014", "text": "function Controles(idInput, texto, posLetra) {\r\n\tvar inputUp1=$(\"<input></input>\").addClass(idInput).attr({id:\"text\"+idInput,type:\"text\",name:\"0-20\",value:texto, oninput:\"pintar(this)\"});\r\n\tvar colorLetraUp=$(\"<input></input>\").addClass(idInput).attr({id:\"colorLetraUp\"+idInput,type:\"color\",value:\"#ffffff\", oninput:\"pintar(this)\"});\r\n\tvar colorBordeLetraUp=$(\"<input></input>\").addClass(idInput).attr({id:\"colorBordeUp\"+idInput,type:\"color\",value:\"#000000\", oninput:\"pintar(this)\"});\r\n\tvar tamanoLetraUp=$(\"<input></input>\").addClass(idInput).attr({id:\"tamanoLetra\"+idInput,type:\"range\",min:\"10\",max:\"50\",step:\"1\", value:25, oninput:\"pintar(this)\"});\r\n\tvar tamanoBordeLetraUp=$(\"<input></input>\").addClass(idInput).attr({id:\"tamanoBordeUp\"+idInput,type:\"range\",min:\"0\",max:\"10\",step:\"1\",value:\"1\", oninput:\"pintar(this)\"});\r\n\tvar posLetra=$(\"<input></input>\").addClass(idInput).attr({id:\"posLetra\"+idInput,type:\"range\",min:\"30\",max:altoCanvas,step:\"1\", value:posLetra, oninput:\"pintar(this)\"});\r\n\tvar cbMayusculaUp=$(\"<input></input>\").addClass(idInput).attr({id:\"mayuscula\"+idInput,type:\"checkbox\",onchange:\"pintar(this)\"});\r\n\tvar arrayControles=[{Nombre:\"Texto\",Control:inputUp1},\r\n\t\t\t\t\t\t\t{Nombre:\"Color Letra\",Control:colorLetraUp},\r\n\t\t\t\t\t\t\t{Nombre:\"Color Borde\",Control:colorBordeLetraUp},\r\n\t\t\t\t\t\t\t{Nombre:\"Tamaño Letra\",Control:tamanoLetraUp},\r\n\t\t\t\t\t\t\t{Nombre:\"Tamaño Borde\",Control:tamanoBordeLetraUp},\r\n\t\t\t\t\t\t\t{Nombre:\"Posicion Letra\",Control:posLetra},\r\n\t\t\t\t\t\t\t{Nombre:\"Mayusculas cabecera\",Control:cbMayusculaUp}];\r\n\treturn arrayControles;\r\n}", "title": "" }, { "docid": "5011d1213304894b11d267121921b401", "score": "0.5739619", "text": "function agregarTarea(e) {\n e.preventDefault();\n console.log(\"formulario enviado\"); //DEBUG\n\n //leer valor del textArea\n const tarea = document.getElementById(\"tarea\").value;\n\n //crear boton de eliminar\n const botonDelete = document.createElement(\"a\");\n botonDelete.classList = \"borrar-tweet\";\n botonDelete.innerText = \"X\";\n\n //crear elemento y añadirlo a la lista\n const li = document.createElement(\"li\"); //ya es un elemento HTML\n li.innerText = tarea; //agrego el texto de tarea\n //agrego el botoncito de borrar\n li.appendChild(botonDelete);\n //ahora tomo el padre donde va a ir mi elemento li\n listaTareas.appendChild(li);\n\n //------------- Anadir a localStorage\n agregarTareaLocalStorage(tarea);\n}", "title": "" }, { "docid": "27a724e68b1709c7d8ab5ebdc216b26a", "score": "0.5730445", "text": "function addTextArea(text) {\n const textArea = document.createElement(\"div\");\n textArea.classList.add(\"text-area\")\n const content = document.createTextNode(text);\n textArea.appendChild(content);\n return textArea;\n }", "title": "" }, { "docid": "68c0d439588b7b842e1912b62a2d52c1", "score": "0.57302177", "text": "function subirTxtTipo(event){\n //cogemos el evento para que no se cambie de pagina antes de hacer el push\n //a la base de datos y recibir el then en la promesa\n event.preventDefault()\n var descripcionTipo = document.getElementById('descripcionTipo').value\n var tipo = selectTipo()\n escribirsubirTxtTipo(descripcionTipo,tipo)\n}", "title": "" }, { "docid": "f496163c1120ae5757f136f8bfda40fd", "score": "0.5726568", "text": "function getvalue(){\n document.getElementById('source_textarea').value;\n}", "title": "" }, { "docid": "2ab8fdf7e8c9a1915e612f59fba1dfed", "score": "0.5714677", "text": "recuperarall(){\n this.content = this.contentrecuperado;\n document.getElementById(\"textarea\").value=this.contentrecuperado;\n document.getElementById('contentScrapper').innerHTML='';\n document.getElementById(\"textarea\").innerHTML=this.contentrecuperado;\n document.getElementById('contentScrapper').innerHTML=this.contentrecuperado;\n this.recuperarcontent = true;\n }", "title": "" }, { "docid": "7193e4773394d96ff46eb7e1fb0d9175", "score": "0.5688372", "text": "function ButtonClicked() {\n console.log(\"Button Clicked\");\n //getElementByClass liefert eine Liste aller Elemente dieser Klasse\n var input = document.getElementsByClassName(\"input\");\n var textArea = doucment.getElementsByClassName(\"mytextarea\");\n var results = document.getElementById(\"text\");\n //input[0] ist das erste Element der Klassenliste\n results.innerHTML = input[0].value;\n\n}", "title": "" }, { "docid": "22043ef25f4be78a44796d31a6d9121a", "score": "0.5682058", "text": "function renderTxtArea() {\n\t\tfor (let i = 0; i < alltextarea.length; i++) {\n\t\t\tstoredItem = localStorage.getItem($(alltextarea[i]).attr(\"id\"));\n\t\t\t$(alltextarea[i]).val(storedItem);\n\t\t}\n\t}", "title": "" }, { "docid": "cd2f6eb3fc8ff0bededd43133625ad4a", "score": "0.5660513", "text": "function crearDescripcion() {\n\tdescr1 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion1').value));\n\tdescr2 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion2').value));\n\tdescr3 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion3').value));\n\tdescr4 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion4').value));\n\tdescr5 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion5').value));\n\tdescr6 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion6').value));\n\tdescr7 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion7').value));\n\tdescr8 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion8').value));\n\tdescr9 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion9').value));\n\tdescr10 = TrimDerecha(TrimIzquierda(document.getElementById('descripcion10').value));\n\n\ttexto1 = verificarTexto(descr1);\n\ttexto2 = verificarTexto(descr2);\n\ttexto3 = verificarTexto(descr3);\n\ttexto4 = verificarTexto(descr4);\n\ttexto5 = verificarTexto(descr5);\n\ttexto6 = verificarTexto(descr6);\n\ttexto7 = verificarTexto(descr7);\n\ttexto8 = verificarTexto(descr8);\n\ttexto9 = verificarTexto(descr9);\n\ttexto10 = verificarTexto(descr10);\n\n\ttexto_mostrar = texto1 + texto2 + texto3 + texto4 + texto5 + texto6 + texto7 + texto8 + texto9 + texto10;\n\tdescripcion = $(\"#datos_descripcion\");\n\tdescripcion.html(texto_mostrar);\n}", "title": "" }, { "docid": "598ccd8a0507f3ba9ea51fec0d203ac4", "score": "0.565122", "text": "function criarLembrete(){\r\n\tlet contentTextArea = document.querySelector(\"#text-area\").value;\r\n\r\n\tif(textoValido(contentTextArea) == false){\r\n\t\tmostrarError();\r\n\t}else{\r\n\t\tlimparError(); \t\r\n\r\n\t\t// Criando uma variável para o tempo\r\n\r\n\t\tlet refencia = new Date();\r\n\t\tlet id = referencia.getTime();\r\n\t\tlet data = referencia.toLocalDateString();\r\n\t\tlet text = contentTextArea;\r\n\r\n\t\t// JSON = Objetos de JavaScript\r\n\r\n\t\tconst lembrete = {\r\n\t\t\t\"id\": id,\r\n\t\t\t\"data\": data,\r\n\t\t\t\"texto\": text\r\n\t\t};\r\n\r\n\t\t// Function para comprovar se existe lembrete\r\n\r\n\t\tcomprovarLembrete(lembrete);\r\n\r\n\t}\r\n}", "title": "" }, { "docid": "819022d318ba57c40ba15bfb629d4e07", "score": "0.5645588", "text": "function elementToTextArea(id,text){\n if(id == 'query'){\n text = reformatQuery(text);\n }\n document.getElementById(id).value = text;\n}", "title": "" }, { "docid": "ee70ad7bb697266fc3dac158e84b0da9", "score": "0.56384486", "text": "create_editable_textareas() {\n var examples \t\t\t\t= \tdocument.querySelector('#rtj_multiple_edited_examples');\n\t\tvar content_id\t\t\t\t=\t\"rtj_content_\"+this.example_index;\n\t\tvar description_id \t=\t\"rtj_description_\"+this.example_index;\n\t\tvar css_text_area_id\t\t=\t\"rtj_css_edit_\"+this.example_index;\n\t\tvar code_text_area_id\t=\t\"rtj_code_edit_\"+this.example_index;\n\t\tvar reset_button_id =\t\"rtj_reset_\"+this.example_index;\n\t\tvar comment_begin\t\t\t=\t\"************************Begin Example \"+this.example_index+\"********************************\";\n\t\tvar comment_end \t\t=\t\"************************End Example \"+this.example_index+\"**********************************\";\n\n\t\tvar example_id\t\t\t\t= \"rtj_example_\"+this.example_index;\n\t\tvar example_container\t= \"<div id=\\\"\"+example_id+\"\\\" class=\\\"rtj_example\\\"></div>\"\n\t\t\n\t\t\n\t\tvar content\t\t=\t \"<div id=\\\"\"+description_id+\"\\\" class=\\\"rtj_description\\\"></div>\"\n\t\t\t\t\t\t\t\t+\"<section id=\\\"\"+content_id+\"\\\" class=\\\"rtj_content\\\">HOLMES</section>\"\n\t\t\t\t\t\t\t\t+\"<textarea id=\\\"\"+css_text_area_id+\"\\\" class=\\\"playable-css\\\"></textarea>\\n\"\n\t\t\t\t\t\t\t\t+\"<textarea id=\\\"\"+code_text_area_id+\"\\\" class=\\\"playable-html\\\"></textarea>\"\n\t\t\t\t\t\t\t\t+\"<div class=\\\"playable-buttons\\\">\"\n \t\t\t\t\t\t\t+\" <input id=\\\"\"+reset_button_id+\"\\\" type=\\\"button\\\" value=\\\"Reset Example \"+this.example_index+\"\\\">\"\n\t\t\t\t\t\t\t\t+\"</div>\";\n\t\t\n\t\t//examples.insertAdjacentText('beforeend',\"\\n...\\n\");\n\t\t\n\t\tthis.preElementBanneredComment(examples,comment_begin);\n\t\texamples.insertAdjacentHTML('beforeend',example_container);\n var example \t\t\t\t= \tdocument.querySelector('#'+example_id);\n\t\texample.insertAdjacentHTML('beforeend',content);\n\t\tthis.postElementBanneredComment(examples,comment_end);\n\n\n\t\t\n this.HTML \t\t\t\t= document.querySelector('#'+content_id);\n this.textareaHTML \t= document.querySelector('#'+code_text_area_id);\n this.textareaCSS \t= document.querySelector('#'+css_text_area_id);\t\t\n this.descriptionarea \t= document.querySelector('#'+description_id);\t\t\n\t\t\n }", "title": "" }, { "docid": "736902ce7027aff4b2209914bf0dc5b5", "score": "0.56358427", "text": "function AddElememt(){\n\tif(count < maxtextelems){\n\t\tcount++;\n\t\tdelnum++;\n\t\tprice += 100;//inc price\n\t\tUpdPrice();\n\t\t//create textarea\n\t\tvar doc = document;\n\t\tvar field = doc.getElementById('editorfield');\n\t\t//var color = window.getComputedStyle(field).backgroundColor;//get color from field\n\t\tvar elem = doc.createElement('div');\n\t\telem.setAttribute(\"id\", \"draggable\"+count+\"\");\n\t\telem.setAttribute(\"class\", \"textblock\");\n\t\tvar wrapped = doc.getElementById('editorfield');\n\t\telem.innerHTML = \"<textarea spellcheck=\\\"false\\\" onclick=RotateText(\"+count+\"); id=\\\"textarea\"+count+\"\\\" \\\n\t\tstyle=\\\"font-family:\"+ffamily+\"; \\\n\t\t\t\tfont-size:\"+fsize+\"px; \\\n\t\t\t\tborder: none; \\\n\t\t\t\tbackground: transparent;\\\" \\\n\t\t\t\tclass=\\\"ui-widget\\\">Редактируемый текст</textarea>\";\n\t wrapped.appendChild(elem);\n\t for(i=0;i<=maxtextelems;i++)\n\t {\n\t \t$(\"#draggable\"+i+\"\")\n\t \t.draggable({\n\t \t\tcontainment: \"parent\"\n\t \t})\n\t \t.resizable({\n\t\t alsoResize: \"#textarea\"+i+\"\",\n\t\t\t\tmaxWidth: 850,\n\t\t maxHeight: 450,\n\t\t handles: \"all\"\n\t\t })\n\t\t}\n\t\t//create tools for change font-family, font-size, color\n\t\tvar label = doc.createElement('div');\n\t\tlabel.setAttribute(\"id\",\"\"+count+\"label\");\n\t\tlabel.setAttribute(\"style\",\"display:inline-block;\");\n\t\tlabel.innerHTML = \"\"+count+\"\";\n\t\t$(\"#texttools\").append(label);\n\t\tvar select1 = doc.createElement('select');\n\t\tselect1.setAttribute(\"id\", \"\"+count+\"fs\");\n\t\tselect1.setAttribute(\"style\", \"background:crimson;\\\n\t\t\t\t\t\t\t\t\t color:white\");\n\t\tselect1.innerHTML = \"<option selected=\\\"selected\\\">Шрифт</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Arial\\\">Arial</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Arial Black\\\">Arial Black</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Tahoma\\\">Tahoma</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Lucida Sans Unicode\\\">Lucida Sans</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Trebuchet MS\\\">Trebuchet MS</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Mistral\\\">Mistral</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Monotype Corsiva\\\">Monotype Corsiva</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Lucida Console\\\">Lucida Console</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Verdana\\\">Verdana</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Impact\\\">Impact</option>\\\n\t\t\t\t\t\t\t<option value=\\\"Comic Sans MS\\\">Comic Sans MS</option>\";\n\t\tvar wrapped = doc.getElementById('texttools');\n\t\twrapped.appendChild(select1);\n\t\tvar select2 = doc.createElement('select');\n\t\tselect2.setAttribute(\"id\", \"\"+count+\"size\");\n\t\tselect2.setAttribute(\"style\", \"background:crimson;\\\n\t\t\t\t\t\t\t\t\t color:white\");\n\t\tselect2.innerHTML = \"<option selected=\\\"selected\\\">Размер</option>\\\n\t\t\t\t\t\t\t<option value=\\\"7px\\\">7px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"8px\\\">8px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"9px\\\">9px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"10px\\\">10px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"12px\\\">12px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"14px\\\">14px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"16px\\\">16px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"18px\\\">18px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"20px\\\">20px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"22px\\\">22px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"24px\\\">24px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"26px\\\">26px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"28px\\\">28px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"30px\\\">30px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"35px\\\">35px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"40px\\\">40px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"45px\\\">45px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"50px\\\">50px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"55px\\\">55px</option>\\\n\t\t\t\t\t\t\t<option value=\\\"60px\\\">60px</option>\";\n\t\twrapped.appendChild(select2);\n\t\tvar select3 = doc.createElement('select');\n\t\tselect3.setAttribute(\"id\", \"\"+count+\"col\");\n\t\tselect3.setAttribute(\"style\", \"background:crimson;\\\n\t\t\t\t\t\t\t\t\t color:white\");\n\t\tselect3.innerHTML = \"<option selected=\\\"selected\\\">Цвет</option>\\\n\t\t\t\t\t\t\t<option value=\\\"black\\\" style=\\\"background-color: black;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"red\\\" style=\\\"background-color: red;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"white\\\" style=\\\"background-color: white;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"orange\\\" style=\\\"background-color: orange;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"yellow\\\" style=\\\"background-color: yellow;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"lime\\\" style=\\\"background-color: lime;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"aqua\\\" style=\\\"background-color: aqua;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"blue\\\" style=\\\"background-color: blue;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"magenta\\\" style=\\\"background-color: magenta;\\\"></option>\\\n\t\t\t\t\t\t\t<option value=\\\"crimson\\\" style=\\\"background-color: crimson;\\\"></option>\";\n\t\twrapped.appendChild(select3);\n\t\tvar br = \"</br></br>\";\n\t\t$(\"#texttools\").append(br);\n\t\tvar textlayout = doc.createElement('p');\n\t\ttextlayout.setAttribute(\"id\",\"text\"+count+\"\");\n\t\ttextlayout.innerHTML = \"Текстовое поле \"+count+\"\";\n\t\t$(\"#rightmenu\").append(textlayout);\n\t}\n\telse\n\t{\n\t\talert(\"Количество блоков текста превышено\");\n\t}\n}", "title": "" }, { "docid": "7456582bbf3939fe5e0a47bb2fa60ed7", "score": "0.5628716", "text": "function ejercicio15(){\n\n\n\n\n document.getElementById('e15_frase').value;\n}", "title": "" }, { "docid": "7616c285b5feaaaa3c59f3f48a13da13", "score": "0.5627699", "text": "function setAreaDesc() {\n\tcap_area.areaDesc = $('textarea#areaDesc').val()\n}", "title": "" }, { "docid": "9e54b30f90cd19b18587aade1eae7515", "score": "0.5620908", "text": "function cambiarFase(idContenido, idImprimir, txtCodigo, txtImprimir, txtFase, txtParametros) {\n\n // si viene funcion de impresion se coloca el link de impresion\n var objImprimir = YAHOO.util.Dom.get(idImprimir);\n if (txtImprimir != \"\") {\n objImprimir.innerHTML = \"<a href='#' onClick='\" + txtImprimir + \"'>Imprimir el Formulario</a>\";\n } else {\n objImprimir.innerHTML = \"\";\n }\n\n // coloca en el formulario el valor de la fase actual\n var objFase = YAHOO.util.Dom.get(\"fase\");\n objFase.value = txtFase;\n\n // Carga el contenido de la fase \n cargarContenido(idContenido, txtCodigo, txtParametros, true);\n\n}", "title": "" }, { "docid": "3c49bf66d86ba204fb8a59ed2c94e363", "score": "0.5619098", "text": "function add(){\n\n //verifie si le contenu du textarea n'est pas vide\n if( $('textarea').val() !== \"\" ){\n\n //stockage et création de notre nouvel article que l'on veut ajouter\n let value = `<article class=\"contact\">\n <img src=\"img/profils1.png\" alt=\"profil1\">\n <h2>Profil 1</h2>\n <p>${$('textarea').val()}</p>\n <a href=\"#\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a>\n </article>`;\n\n //ajout à la fin de notre section qui a la classe content\n $('.content').append(value);\n }\n\n //remet le contenu du textarea a chaine de caracteres vides\n $('textarea').val(\"\");\n\n //actualisation du compteur\n counter();\n // on recupere les functionnalités de suppression qui sont appelées dans init\n init();\n}", "title": "" }, { "docid": "b769c7ad75d34e4cc8c861c05ef4af95", "score": "0.56087893", "text": "function maxLengthTextAreaControl( element ){\n\n $(element).keypress(function(event){\n var key = event.which;\n //todas as teclas incluindo enter\n if(key >= 33 || key == 13 || key == 32) {\n var maxLength = $(this).attr(\"length\");\n var length = this.value.length;\n if(length >= maxLength) {\n event.preventDefault();\n $(this).next('span').html( this.value.length + \" de \"+ maxLength + \" caracteres\" ).addClass( 'error' );\n }else{\n $(this).next('span').html( this.value.length + \" de \" + maxLength + \" caracteres\" ).removeClass( 'error' );\n }\n }\n var maxLength = $(this).attr(\"length\");\n if( this.value.length > maxLength )\n $(this).next('span').html( this.value.length + \" de \"+ maxLength + \" caracteres\" ).addClass( 'error' );\n else\n $(this).next('span').html( this.value.length + \" de \"+ maxLength + \" caracteres\" ).removeClass( 'error' );\n\n $(this).next('span').css({'padding-top':'5px', 'margin': '5px' , 'display' : 'block'});\n\n }).keypress();\n}", "title": "" }, { "docid": "d986d244122a69afce18b7a160a51544", "score": "0.56035244", "text": "function cargoCondnTextAreaBind() {\r\n $('.cargoCondnTextArea textarea').keyup(function() {\r\n var cargoTextVal = $(this).val(),\r\n exceptElement = [];\r\n if (cargoTextVal) {\r\n dirtyFlag = 1;\r\n exceptElement = $(this).closest('.blueAccElement');\r\n nsCargo.actionItem = $(this).closest('.blueAccElement').attr('data-tabnum');\r\n $('.blueAccElement .blueHeader').not($(this).closest('.blueAccElement').find('.blueHeader'))\r\n .addClass('disabled').next().hide();\r\n $('.blueAccElement .blueHeader').find('.icons_sprite').addClass('smallBottomArrowIcon');\r\n exceptElement.find('.blueHeader').find('.icons_sprite').removeClass('smallBottomArrowIcon');\r\n } else {\r\n dirtyFlag = 0;\r\n hideActionLists(this);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "45cd2f5259a683cf30a92a50d32dece0", "score": "0.56025916", "text": "function miFuncion(/*INFORMACION DE LO Q RECIBE LA FUNCION*/){/*CODIGO*/}", "title": "" }, { "docid": "468b10b7bc3fd60a00c20fc2c937920c", "score": "0.5592382", "text": "function editTextFunc(e){\nlet command = e.target.dataset.name;\nlet withoutValue = command === \"justifyCenter\" || command === \"justifyLeft\"||command === \"justifyRight\" || command === \"bold\"||command === \"copy\" ||command === \"cut\"||command === \"insertOrderedList\"||command === \"insertUnorderedList\"||command === \"subscript\"||command === \"superscript\"||command === \"redo\"||command === \"undo\"||command === \"underline\";\n\n if(withoutValue){\n textarea.document.execCommand(command,true)\n iconTools.forEach(item => item.style.color = '#333')\n inputTools.forEach(item => item.style.border = 'none')\n e.target.style.color = 'rgb(198, 41, 80)';\n \n } \n switch(command) {\n case 'createLink': \n iconTools.forEach(item => item.style.color = '#333')\n inputTools.forEach(item => item.style.border = 'none')\n e.target.style.color = 'rgb(198, 41, 80)';\n let userLink = prompt('Enter your Link',null);\n textarea.document.execCommand(command,true,userLink);\n e.target.style.display = 'none';\n $.getElementById('unlink').style.display = 'inline-block';\n break;\n case 'formatBlock': \n iconTools.forEach(item => item.style.color = '#333')\n inputTools.forEach(item => item.style.border = 'none')\n e.target.style.color = 'rgb(198, 41, 80)';\n textarea.document.execCommand(command,true,'H2');\n break;\n case 'unlink': \n iconTools.forEach(item => item.style.color = '#333')\n inputTools.forEach(item => item.style.border = 'none')\n e.target.style.color = 'rgb(198, 41, 80)';\n textarea.document.execCommand(command,true);\n $.getElementById('unlink').style.display = 'none';\n $.getElementById('linked').style.display = 'inline-block';\n break;\n case 'insertImage': \n iconTools.forEach(item => item.style.color = '#333')\n inputTools.forEach(item => item.style.border = 'none')\n e.target.style.color = 'rgb(198, 41, 80)';\n let imageUrl = prompt('Enter your Link',null);\n textarea.document.execCommand(command,true,imageUrl);\n break;\n\n }\n}", "title": "" }, { "docid": "ce758399a02af8f409dd88cdc045d920", "score": "0.55550987", "text": "createEditTextarea() {\n var that = this;\n\n // hide text node\n that.hide();\n that.getLayer().draw();\n\n // create textarea over canvas with absolute position\n // first we need to find position for textarea\n // how to find it?\n\n // at first lets find position of text node relative to the stage:\n var textPosition = that.absolutePosition();\n\n // then lets find position of stage container on the page:\n var stageBox = that.getStage().container().getBoundingClientRect();\n\n // so position of textarea will be the sum of positions above:\n var areaPosition = {\n x: stageBox.left + textPosition.x,\n y: stageBox.top + textPosition.y\n };\n\n // create textarea and style it\n var textarea = document.createElement('textarea');\n document.body.appendChild(textarea);\n\n // apply many styles to match text on canvas as close as possible\n // remember that text rendering on canvas and on the textarea can be different\n // and sometimes it is hard to make it 100% the same. But we will try...\n textarea.value = that.text();\n textarea.style.position = 'absolute';\n textarea.style.top = areaPosition.y + 'px';\n textarea.style.left = areaPosition.x + 'px';\n textarea.style.width = that.width() - that.padding() * 2 + 'px';\n textarea.style.height =\n that.height() - that.padding() * 2 + 5 + 'px';\n textarea.style.fontSize = that.fontSize() + 'px';\n textarea.style.border = 'none';\n textarea.style.padding = '0px';\n textarea.style.margin = '0px';\n textarea.style.overflow = 'hidden';\n textarea.style.background = 'none';\n textarea.style.outline = 'none';\n textarea.style.resize = 'none';\n textarea.style.lineHeight = that.lineHeight();\n textarea.style.fontFamily = that.fontFamily();\n textarea.style.transformOrigin = 'left top';\n textarea.style.textAlign = that.align();\n textarea.style.color = that.fill();\n var transform = '';\n\n var px = 0;\n // also we need to slightly move textarea on firefox\n // because it jumps a bit\n var isFirefox =\n navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n if (isFirefox) {\n px += 2 + Math.round(fontSize / 20);\n }\n transform += 'translateY(-' + px + 'px)';\n\n textarea.style.transform = transform;\n\n // reset height\n textarea.style.height = 'auto';\n // after browsers resized it we can set actual value\n textarea.style.height = textarea.scrollHeight + 3 + 'px';\n\n textarea.focus();\n textarea.select();\n\n that.textarea = textarea;\n\n function removeTextarea() {\n textarea.parentNode.removeChild(textarea);\n window.removeEventListener('click', handleOutsideClick);\n that.show();\n that.getLayer().draw();\n }\n\n function setTextareaWidth(newWidth) {\n if (!newWidth) {\n // set width for placeholder\n that.placeholder === undefined ? that.placeholder = \" \" : that.placeholder;\n newWidth = that.placeholder.length * that.fontSize();\n }\n // some extra fixes on different browsers\n var isSafari = /^((?!chrome|android).)*safari/i.test(\n navigator.userAgent\n );\n var isFirefox =\n navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n if (isSafari || isFirefox) {\n newWidth = Math.ceil(newWidth);\n }\n\n var isEdge =\n document.documentMode || /Edge/.test(navigator.userAgent);\n if (isEdge) {\n newWidth += 1;\n }\n textarea.style.width = newWidth + 'px';\n }\n\n textarea.addEventListener('keydown', function (e) {\n // hide on enter\n // but don't hide on shift + enter\n if (e.keyCode === 13 && !e.shiftKey) {\n that.text(that.onTextChange(textarea.value));\n removeTextarea();\n }\n // on esc do not set value back to node\n if (e.keyCode === 27) {\n removeTextarea();\n }\n\n var scale = that.getAbsoluteScale().x;\n setTextareaWidth(that.width() * scale);\n textarea.style.height = 'auto';\n textarea.style.height = textarea.scrollHeight + that.fontSize() + 'px';\n });\n\n textarea.addEventListener('keyup', function (e) {\n if (e.keyCode === 46 || e.keyCode === 8) {\n e.stopPropagation();\n }\n\n that.textarea.value = that.onTextChange(that.textarea.value);\n that.text(that.textarea.value);\n });\n\n function handleOutsideClick(e) {\n if (e.target !== textarea) {\n that.text(that.onTextChange(textarea.value));\n removeTextarea();\n }\n }\n setTimeout(() => {\n window.addEventListener('click', handleOutsideClick);\n });\n\n }", "title": "" }, { "docid": "be0ffa0146c0951d6edc7f253e4534f0", "score": "0.5550662", "text": "function funcAgregarTarea(e) {\n e.preventDefault();\n if (numPomodoros.value > 9) numPomodoros.value = 9;\n if (numPomodoros.value < 0) numPomodoros.value = 1;\n if (descripcionTarea.value != \"\" && numPomodoros.value != \"\") {\n let tarea = {\n nombre: descripcionTarea.value,\n cantPom: numPomodoros.value,\n terminados: 0,\n };\n guardarTareas(tarea);\n actualizarListaTareas();\n $(\"#agregarTarea\").modal(\"hide\");\n borrarModalTareas();\n }\n}", "title": "" }, { "docid": "34222d46f7307c3f88db61cc034b7717", "score": "0.5546973", "text": "guardarAlterações(){\n this.btnguardarAlterações.addEventListener('click', () => {\n let capitulo = document.querySelector('#capituloEditar')\n let titulo = document.querySelector('#titulo')\n let subtitulo = document.querySelector('#subtitulo')\n let imagem = document.querySelector('#imagem')\n let texto1 = document.querySelector('#texto1')\n let texto2 = document.querySelector('#texto2')\n\n this.infoControlador.guardarInformacao(capitulo.value, titulo.value, subtitulo.value, imagem.value, texto1.value, texto2.value)\n })\n }", "title": "" }, { "docid": "0aeff6acd81419d5a9fa939ee8a07d0d", "score": "0.5544417", "text": "function agregar() {\n var seleccion = document.getElementById(\"nombreOficios\").value;\n var combo = document.getElementById(\"nombreOficios\");\n var selected = combo.options[combo.selectedIndex].text;\n oficios.forEach(element => {\n if (element.indexOf(seleccion) == 0) {\n existe = true;\n }\n });\n\n if (!existe) {\n oficios.push(seleccion);\n var elemento = `<div class=\"row my-4\" id=\"${id}\">\n <div class=\"col-md-6\" id=\"izquierda\">\n <input type=\"text\" name=\"${(indice+50)}\" class=\"d-none\" value=\"${seleccion}\" >\n <label for=\"${(indice+100)}\" class=\"col-form-label\">${selected}:</label>\n </div>\n <div class=\"col-md-6\" id=\"derecha\">\n <textarea name=\"${(indice+100)}\" id=\"desc${(indice+100)}\" cols=\"30\" rows=\"2\" class=\"form-control\" required></textarea>\n </div>\n </div>`;\n indice++;\n id++;\n padre.innerHTML += elemento;\n }\n existe = false;\n\n }", "title": "" }, { "docid": "cf9e5d0a39cacb8818a34e153bd8ab1b", "score": "0.5543653", "text": "function insertarLinea2(boton, accion, detalle, php, valores) {\r\n\t/*\r\n\t.- boton\t-> referencia del boton (objeto)\r\n\t.- accion\t-> modulo\r\n\t.- detalle\t-> sufijo de los campos de la lista\r\n\t.- php\t\t-> indica si tomo el archivo con las funciones generales o si tomo el archivo con las funciones del modulo\r\n\t.- \r\n\t*/\r\n\tboton.disabled = true;\r\n\tvar nro = \"nro_\" + detalle;\r\n\tvar can = \"can_\" + detalle;\r\n\tvar sel = \"sel_\" + detalle;\r\n\tvar lista = \"lista_\" + detalle;\r\n\tvar nrodetalle = new Number($(\"#\"+nro).val()); nrodetalle++;\r\n\tvar candetalle = new Number($(\"#\"+can).val()); candetalle++;\r\n\t\r\n\t//\tdefino el path\r\n\tif (!php) var php_ajax = \"../lib/fphp_funciones_ajax.php\";\r\n\telse var php_ajax = \"lib/fphp_funciones_ajax.php\";\r\n\t\r\n\t//\tajax\r\n\t$.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: php_ajax,\r\n\t\tdata: \"accion=\"+accion+\"&nrodetalle=\"+nrodetalle+\"&candetalle=\"+candetalle+\"&\"+valores,\r\n\t\tasync: true,\r\n\t\tsuccess: function(resp) {\r\n\t\t\t$(\"#\"+nro).val(nrodetalle);\r\n\t\t\t$(\"#\"+can).val(candetalle);\r\n\t\t\tidtr = detalle + \"_\" + nrodetalle;\r\n\t\t\tvar newTr = document.createElement(\"tr\");\r\n\t\t\tnewTr.className = \"trListaBody\";\r\n\t\t\tnewTr.setAttribute(\"onclick\", \"mClk(this, '\"+sel+\"');\");\r\n\t\t\tnewTr.id = idtr\r\n\t\t\tdocument.getElementById(lista).appendChild(newTr);\r\n\t\t\tdocument.getElementById(idtr).innerHTML = resp;\r\n\t\t\tboton.disabled = false;\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "a32564c73445f0c6c7861ef3c894892f", "score": "0.55400705", "text": "function showTextareaForPosting(\n the_action,\n parameter_one,\n parameter_two\n ) {\n \n the_textarea_action = the_action;\n the_parameter_one = parameter_one;\n the_parameter_two = parameter_two;\n \n var headerTitle = document.getElementById(\"textarea_header_title\");\n var camera = document.getElementById(\"cameraButton\");\n \n // slides the div with the textarea .. \n the_textarea_div.style.top = \"40px\";\n \n // and show the textarea heading bar .. \n textarea_heading_bar.style.top = \"0px\";\n \n // some preliminary things we have to do .. \n // like toggling the textarea tabs or some manipulation on the entered text ..\n switch( the_action ) {\n case \"share_to_twitter\" :\n setTextareaTabs(\"twitter_only\");\n the_textarea_itself.value = parameter_one;\n break;\n case \"share_to_facebook\" :\n setTextareaTabs(\"facebook_only\");\n the_textarea_itself.value = parameter_one;\n break;\n case \"twitter_reply\" :\n setTextareaTabs(\"twitter_only\");\n the_textarea_itself.value = \"@\" + parameter_two + \" \";\n break;\n case \"twitter_direct_message\" :\n setTextareaTabs(\"twitter_only\");\n break;\n case \"facebook_comments\":\n headerTitle.innerText = \"Comment\";\n cameraButton.style.display = \"none\";\n setTextareaTabs(\"facebook_only\");\n break;\n default:\n setTextareaTabs(\"both\");\n break;\n }\n \n // we will focus the textarea after some time .. \n the_textarea_itself.focus();\n \n // and set the callback - when the user clicks \"done\" on the device keyboard .. \n the_textarea_itself.onblur = function() {\n //need to reset viewport here\n // reset the view port .. \n ScreenObject.resetViewPort();\n }\n \n return false;\n}", "title": "" }, { "docid": "b6348cdb381efaa1b35650cf7339f814", "score": "0.5533758", "text": "creaTextoPregunta(){ \n let textoMostrar=\"Por un quesito, una pregunta de : \"+ this.tipo + \"\\n\" + this.texto +\"\\n\";\n let opcionesMostrar=this.cambiaOpciones();\n for(const opcion in opcionesMostrar){\n textoMostrar+=(parseInt(opcion)+1) + \".-\" +opcionesMostrar[opcion] + \"\\n\";\n }\n return textoMostrar;\n }", "title": "" }, { "docid": "f15fe0aa4b82f838175598c8da2ae910", "score": "0.5528631", "text": "function pegaTexto(){\r\n\tvar desc =(document.getElementById(\"cxDesc\")).checked;\r\n\tdocument.getElementById(\"boxSaidaF\").value = \"\";\r\n\tvar texto = document.getElementById(\"boxEntradaF\").value.toUpperCase();\r\n\ttexto.split('');\r\n\tfor(let i = 0; i < texto.length; i++){\r\n\t\tif (desc === true){\r\n\t\t\tvar char = maqEnigma.descriptografar(texto[i]);\r\n\t\t\tdocument.getElementById(\"boxSaidaF\").value += char;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvar char = maqEnigma.criptografar(texto[i]);\r\n\t\t\tdocument.getElementById(\"boxSaidaF\").value += char;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\tconsole.log(maqEnigma.posicao1a, maqEnigma.posicao2a, maqEnigma.posicao3a)\r\n}", "title": "" }, { "docid": "80c85ed0ed415261044be7304a59162c", "score": "0.55199313", "text": "addTextArea(d3cell, text, colorBorder, backgroundColor, fulltext, cornerMode) {\n let ta = null;\n if (cornerMode) {\n switch (cornerMode) {\n case \"corner_row\":\n ta = d3cell.append(\"textarea\").attr(\"readonly\", \"\")\n .style(\"resize\", \"none\")\n .style(\"overflow\", \"hidden\")\n .style(\"border\", \"1px solid \" + colorBorder)\n .style(\"border-right\", \"none\")\n .style(\"width\", this.cell_px_width / 2).style(\"height\", this.cell_px_height)\n .style(\"background-color\", backgroundColor)\n .style(\"padding-left\", \"10px\")\n .style(\"text-align\", \"left\");\n break;\n case \"corner_col\":\n ta = d3cell.append(\"textarea\").attr(\"readonly\", \"\")\n .style(\"resize\", \"none\")\n .style(\"overflow\", \"hidden\")\n .style(\"border\", \"1px solid \" + colorBorder)\n .style(\"border-left\", \"none\")\n .style(\"width\", this.cell_px_width / 2).style(\"height\", this.cell_px_height)\n .style(\"background-color\", backgroundColor)\n .style(\"padding-right\", \"10px\")\n .style(\"text-align\", \"right\");\n break;\n }\n } else {\n ta = d3cell.append(\"textarea\").attr(\"readonly\", \"\")\n .style(\"resize\", \"none\")\n .style(\"overflow\", \"hidden\")\n .style(\"border\", \"1px solid \" + colorBorder)\n .style(\"width\", this.cell_px_width).style(\"height\", this.cell_px_height)\n .style(\"background-color\", backgroundColor)\n .style(\"text-align\", \"center\");\n }\n\n if (fulltext) {\n ta.attr(\"title\", fulltext);\n }\n\n ta.text(text);\n return ta;\n }", "title": "" }, { "docid": "c069465428d424ad9805d51d7e712e77", "score": "0.55156904", "text": "function creadorHerramienta(herramienta){\n\n ctrl.herramientas.push({});\n cantidadObjetos = ctrl.herramientas.length-1;\n ctrl.herramientas[cantidadObjetos].indice = cantidadObjetos;\n\n switch (herramienta) {\n\n case 'codigo':\n ctrl.herramientas[cantidadObjetos].html_tutorial = '<textarea elastic id=\"codigo\" ng-keydown=\"$ctrl.insertTab(' + cantidadObjetos + ', $event)\" spellcheck=\"false\" oninput=\"autosize(this)\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 codeinput\" ></textarea>';\n ctrl.herramientas[cantidadObjetos].html_view = '<textarea elastic id=\"codigo\" readonly spellcheck=\"false\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 codeinput\" ></textarea>';\n ctrl.herramientas[cantidadObjetos].label = 'code';\n break;\n\n case 'texto':\n ctrl.herramientas[cantidadObjetos].html_tutorial = '<textarea elastic id=\"texto\" spellcheck=\"false\" oninput=\"autosize(this)\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 textinput\"></textarea>';\n ctrl.herramientas[cantidadObjetos].html_view = '<textarea elastic id=\"texto\" readonly spellcheck=\"false\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 textinput\"></textarea>';\n ctrl.herramientas[cantidadObjetos].label = 'text';\n break;\n\n case 'url':\n ctrl.herramientas[cantidadObjetos].html_tutorial = '<input type=\"text\" autocomplete=\"off\" id=\"texto\" spellcheck=\"false\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 urlinput\"><button class=\"btn btn-sm mb-1 bg-light\" ng-click=\"$ctrl.openLink($ctrl.herramientas[' + cantidadObjetos + '].valor)\">Ir</button>';\n ctrl.herramientas[cantidadObjetos].html_view = '<input type=\"text\" id=\"texto\" readonly spellcheck=\"false\" ng-model=\"$ctrl.herramientas[' + cantidadObjetos + '].valor\" class=\"rounded m-1 urlinput\"><button class=\"btn btn-sm mb-1 bg-light\" ng-click=\"$ctrl.openLink($ctrl.herramientas[' + cantidadObjetos + '].valor)\">Ir</button>';\n ctrl.herramientas[cantidadObjetos].label = 'url';\n break;\n\n case 'image':\n ctrl.herramientas[cantidadObjetos].urlImagen = 'Imagenes/default_img.png';\n ctrl.herramientas[cantidadObjetos].valor = 'Imagenes/default_img.png';\n ctrl.herramientas[cantidadObjetos].html_tutorial = '<img id=\"image_display_' + cantidadObjetos + '\" class=\"img-thumbnail\" ng-src=\"{{$ctrl.herramientas[' + cantidadObjetos + '].imagenGuardada ? $ctrl.herramientas[' + cantidadObjetos + '].valor : $ctrl.herramientas[' + cantidadObjetos + '].urlImagen}}\" style=\"width:{{$ctrl.herramientas[' + cantidadObjetos + '].ancho}}px; height:{{$ctrl.herramientas[' + cantidadObjetos + '].alto}}px\" alt=\"user_image\"><button ng-click=\"$ctrl.imgActiva(' + cantidadObjetos + ')\" data-bs-toggle=\"modal\" data-bs-target=\"#exampleModal\" class=\"btn btn-sm btn-dark\">Add/Change Image</button>';\n ctrl.herramientas[cantidadObjetos].html_view = '<img id=\"image_display_' + cantidadObjetos + '\" class=\"img-thumbnail\" ng-src=\"{{$ctrl.herramientas[' + cantidadObjetos + '].valor}}\" style=\"width:{{$ctrl.herramientas[' + cantidadObjetos + '].ancho}}px; height:{{$ctrl.herramientas[' + cantidadObjetos + '].alto}}px\" alt=\"user_image\">';\n ctrl.herramientas[cantidadObjetos].label = 'image';\n ctrl.herramientas[cantidadObjetos].ancho = ctrl.ancho;\n ctrl.herramientas[cantidadObjetos].alto = ctrl.alto;\n ctrl.herramientas[cantidadObjetos].imagenGuardada = false;\n ctrl.imagenActiva = cantidadObjetos;\n break;\n \n default: \n break;\n\n }\n\n }", "title": "" }, { "docid": "f8d59ca3bbc8ff134773a27890ac1982", "score": "0.5502184", "text": "editcontent(){\n document.getElementById('errorfilter').style.display=\"none\";\n this.displayElement();\n document.getElementById(\"contentScrapper\").style.display=\"none\";\n document.getElementById(\"textacontent\").style.visibility=\"visible\";\n document.getElementById(\"textarea\").setAttribute(\"rows\", \"20\");\n this.content= document.getElementById('contentScrapper').innerHTML;\n if(this.recuperarcontent){\n document.getElementById(\"textarea\").value=this.contentrecuperado;\n this.recuperarcontent = false;\n }else{\n document.getElementById(\"textarea\").value=this.content;\n document.getElementById(\"textarea\").innerHTML=this.content;\n }\n }", "title": "" }, { "docid": "5375fcb00e9a28f3e9f57ce91f2da78f", "score": "0.5498221", "text": "function TextEditor() {}", "title": "" }, { "docid": "205478d2cfe8759bbf753e6c145d04bd", "score": "0.5498069", "text": "function myFunction(value) {\n console.log(value);\n str = document.getElementById(value).innerHTML;\n const el = document.createElement('textarea');\n el.value = str;\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n alert('Copied the text : ' + el.value);\n }", "title": "" }, { "docid": "e8050aa38aab0508743b2367a430286b", "score": "0.5492152", "text": "function main() {\r\n\tjQ(\"span.nick\").children(\":first-child\").click(function(event){\r\n\t\tevent.preventDefault();\r\n\t\ttext = jQ(\"textarea\").val();\r\n\t\tnew_text = \"@\"+jQ(this).html()+\"\\n\\r\"+text;\r\n\t\tjQ(\"textarea\").val(new_text);\r\n\t});\r\n\r\n\tjQ(\"a.color-inverse\").click(function(event){\r\n\t\tevent.preventDefault();\r\n\t\ttext = jQ(\"textarea.input-text\").val();\r\n\t\tnew_text = \"@\"+jQ(this).html()+\"\\n\\r\"+text;\r\n\t\tjQ(\"textarea.input-text\").val(new_text);\r\n\t});\r\n}", "title": "" }, { "docid": "7da85dd1dfa48ec1943ca9373d21a911", "score": "0.548568", "text": "function subirDescripcionConocenos(event){\n //cogemos el evento para que no se cambie de pagina antes de hacer el push\n //a la base de datos y recibir el then en la promesa\n event.preventDefault()\n var descripcionConocenos = document.getElementById('descripcionConocenos').value\n escribirDescripcionConocenos(descripcionConocenos)\n}", "title": "" }, { "docid": "e29dd8f2c106416c1572603524e4e494", "score": "0.54728884", "text": "function set_textarea_line(id, s, line)\n{\n var cur = document.getElementById(id).value;\n cur = cur.replace(/\\r\\n/, '\\n');\n var a = cur.split('\\n');\n a[line] = s;\n document.getElementById(id).value = a.join('\\n');\n}", "title": "" }, { "docid": "790184adc0230705fd86efa3a73634b9", "score": "0.547204", "text": "function respuesta_servidor(respuesta) {\n // alert(respuesta)\n //extraer de la respuesta codigo y mensaje (si tipo texto)\n // let codigo_respuesta = respuesta.substring(0, 2);\n // let mensaje = respuesta.substring(2);\n\n //extraer los datos e array\n let codigo_respuesta = respuesta[0];\n let mensaje = respuesta[1];\n\n if (codigo_respuesta == \"00\") {\n //enviar mensaje a textarea\n document.querySelector(\"#texto\").value = mensaje;\n } else {\n //enviar mensaje al span\n document.querySelector(\"#mensaje\").innerText = mensaje;\n }\n}", "title": "" }, { "docid": "52908d553aa0e871cea2d8705e66d3e9", "score": "0.54669654", "text": "function mascaraTexto(evento, mascara){ \n \n\t var campo, valor, i, tam, caracter; \n\t \n\t if (document.all) // Internet Explorer\n\t campo = evento.srcElement; \n\t else // Nestcape, Mozzila\n\t campo= evento.target; \n\t \n\t valor = campo.value; \n\t tam = valor.length; \n\t \n\t for(i=0;i<mascara.length;i++){ \n\t caracter = mascara.charAt(i); \n\t if(caracter!=\"9\") \n\t if(i<tam & caracter!=valor.charAt(i)) \n\t campo.value = valor.substring(0,i) + caracter + valor.substring(i,tam); \n\t \n\t } \n\t \n\t}", "title": "" }, { "docid": "360d7d7bde6917d3fa398f996a014b69", "score": "0.5465658", "text": "function buscarProyecto(txtNombreArchivo) {\n //alert (txtNombreArchivo);\n var objSeq = document.getElementById(\"myHidden\").value;\n //alert (objSeq);\n //var objNitConfirmacion = document.getElementById(\"buscaNitConfirmacion\");\n var objMensajes = document.getElementById(\"mensajes\");\n\n // Limpia los mensajes de la barra de mensajes\n objMensajes.innerHTML = \"\";\n\n // Valida que el campo NIT tenga algo\n /*if (objNit.value == \"\") {\n objMensajes.innerHTML += \"<li>Digite un n\" + String.fromCharCode(250) + \"mero de Nit v\" + String.fromCharCode(225) + \"lido\";\n }*/\n\n // Valida que haya algo en la confirmacion\n /*if (objNitConfirmacion.value == \"\") {\n objMensajes.innerHTML += \"<li>Debe confirmar el valor digitado</li>\";\n }*/\n\n // Valida que ambos valores sean iguales\n /*if (objNit.value != objNitConfirmacion.value) {\n objMensajes.innerHTML += \"<li>No coinciden los documentos digitados, verifique los datos</li>\";\n }*/\n\n if (objMensajes.innerHTML == \"\") {\n cargarContenido(\"formulario\", \"contenidos/\" + txtNombreArchivo + \".php\", \"nit=\" + objSeq, true);\n //alert (\"formulario, contenidos/\" + txtNombreArchivo + \".php, nit=\" + objSeq + \"true\");\n } else {\n objMensajes.className = \"msgError\";\n }\n}", "title": "" }, { "docid": "b0323aa1b3ae6bab4445932a713b19ab", "score": "0.5461075", "text": "function doTextArea () {\n\tdocument.f1.t1.value=\"\"\n\tstrTextArea = \"\"\n\n\tif (AllFive==0) {\n\t\tfor (i=0;i<6;i++) {\n\t\t\tif (boxClicked[i] != \"\") {\n\t\t\t\tstrTextArea = strTextArea + boxClicked[i] + '\\n'\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tstrTextArea = boxClicked[5]\n\n\t}\n\t\n\tdocument.f1.t1.value=strTextArea\n}", "title": "" }, { "docid": "3eb03135fa2fb738815c1427736007bb", "score": "0.54606885", "text": "function inicializaContadores() {\r\n\t/*O EVENTO DE CLIQUE\r\n\tAgora, quando o campo for clicado, teremos que \"fazer alguma coisa\".\r\n\tA ação de \"quando o campo for...\" faz referência à função on do jQuery, e como queremos o evento do clique no campo, passaremos \"click\" para a função:\r\n\tConseguiremos \"fazer algo\" quando o campo for clicado, passando um segundo parâmetro para a função on, no caso, uma função anônima, indicada pelos parênteses vazio:\r\n\r\n\tcampo.on(\"click\", function() { console.log(\"cliquei no campor\") }); //PEGANDO VALOR A CADA EVENTO DE CLIQUE\r\n\t*/\r\n\r\n\t/*O EVENTO INPUT\r\n\tNo entanto, para atualizar os contadores, temos sempre que clicar dentro do campo. O ideal seria que o contador fosse atualizado enquanto o usuário digita. E para isso existe um evento específico de quando digitamos, colocamos dados em um campo: input:\r\n\tvar campo = $(\".campo-digitacao\");\r\n\tcampo.on(\"input\", function() {\r\n\tObserve que à medida que digitarmos, o campo será atualizado. Era justamente esse o nosso objetivo.\r\n\t*/\r\n\r\n\t\t/*A DIFERENÇA ENRE .VAL E O .TEXT\r\n\t\tNo caso do textarea, o conteúdo não estará na propriedade text e sim no value, ou como é chamado pelo jQuery: val.\r\n\t\to val nos dá acesso ao que está dentro de uma tag de input, como as tags input e textarea. Já o text nos dá acesso ao que está dentro de uma tag de texto, como p, span e h1.\r\n\t\t*/\r\n\tcampo.on(\"input\", function() { //PEGANDO VALOR A CADA ENTRADA\r\n\t\tvar conteudo = campo.val();\r\n\t\tconsole.log(campo.val());\r\n\r\n\t\t// Selecionandor o span e alterarando o seu text, atribuindo a quantidade de CARACTERES a ele:\r\n\t\tvar qtdCaracteres = conteudo.length;\r\n\t\t$(\"#contador-caracteres\").text(qtdCaracteres);\r\n\r\n\t\t//Selecionando o span e alterarando o seu text, atribuindo a quantidade de PALAVRAS a ele:\r\n\t\t/*\r\n\t\t A expressão regular será responsável por buscar qualquer caractere, exceto espaço vazio: /\\S+/. ==>> Agora os espaços não são mais considerados como palavras.\r\n\t\t */\r\n\t\t var qtdPalavras = conteudo.split(/\\S+/).length-1;\r\n\t\t console.log(qtdPalavras);\r\n\t\t $(\"#contador-palavras\").text(qtdPalavras);\r\n\t\t})\r\n}", "title": "" }, { "docid": "6b12f556866d7777b30c413fc0622bf6", "score": "0.5459099", "text": "function newNote(e) {\r\n e.preventDefault();\r\n\r\n //leer el valor del texto en el textarea\r\n const note = document.getElementById('note').value;\r\n // document.getElementById('note').value = '';\r\n\r\n //agregando elemento a la lista con el valor del textarea\r\n addElementInList(note);\r\n\r\n //agregar la nota al localstorage\r\n addNoteToLocalstorage(note);\r\n this.reset();\r\n}", "title": "" }, { "docid": "d2a8b0c2535ce312d972b2388c526399", "score": "0.545868", "text": "function inputCommands()\n {\n\n var textarea = $('#textarea').val();\n if(textarea==null || textarea==\"\")\n {\n alert(\"Please input commands!\");\n return;\n }\n $.get(\"/textarea_ajax/\", {'textarea':textarea}, function(ret){\n\n }).done(function(res) {\n //Get file name from server.\n //In input page, file name is default.\n //In Example page, file name is the name of example which user clicked.\n //In upload page, file name is the name of file which user uploaded.\n file = res.toString();\n if(file !=null){\n getGraph();\n }\n\n });\n }", "title": "" }, { "docid": "2f75993b8f7cecbb625182ab7d8a55f6", "score": "0.5456211", "text": "function textAreaHTML(questionNum,questionText,rows,cols){\n\thtml = \"<p><hr><br>\" + questionNum + \". \" + questionText + \"<br>\" +\n\t'<textarea class=\"answer\" name=\"' +questionNum+ '\" rows=\"' + rows + 'cols= ' + cols + '\"></textarea>';\n\treturn html;\n}", "title": "" }, { "docid": "96f8f7aa06331b6db8759d3e8be2d97c", "score": "0.54526955", "text": "function dibujoPorClick()\n{\n\tnumeroLineas = parseInt(texto.value);\n\tcreateMalla(\"izquierda\",numeroLineas);\n\t// agregar lineas a los bordes izquierdo y inferior\n\tcreateLine(\"#F05\", 1, 1, 1, 300);\n\tcreateLine(\"#F05\", 1, 299, 299, 299);\n\n}", "title": "" }, { "docid": "aa3669b488e67df298b19bb8427a1588", "score": "0.5451837", "text": "function save_tarea_tema(id,txt,op,sec){\n if (op==1) {\n var camp = \"#sublistaction_\"+id+\" #txts_\"+id;\n var txto = $(\"#textoreunion_\"+id).val();\n }\n if (op==2) {\n var camp = \"#sublistaction_\"+id+\" #txt_\"+id;\n var txto = $(\"#textolist_activ_\"+id).val();\n }\n $(camp+\" div\").hide();\n $(camp+\" textarea\").hide();\n var htmlp='<div id=\"form_tarea_tema_'+id+'\" class=\"form_usr_w_asing\"><form action=\"#\" method=\"post\"><label for=\"\">nombre de la tarea</label><input type=\"text\" name=\"titulo-w\" value=\"'+txto+'\"/>';\n htmlp+='<label for=\"\">fecha</label><input type=\"text\" id=\"datepicker4\" name=\"fecha\" placeholder=\"fecha limite\" ><label for=\"\">usuario</label><input type=\"text\" id=\"adduser_listact\" onkeyup=\"share_usuarios(this.value,1,'+id+');\" />';\n htmlp+='<div id=\"jb_lista_usuarios\" class=\"list-share list-meeting\" style=\"display:none;z-index: 2;\"></div><div class=\"listaUsuarios listusract\" id=\"jb_lista_usuarios_click_tema\" style=\"display: block;\"></div>';\n htmlp+='<div class=\"chkmail-w\"><label for=\"\">Mail:</label><div class=\"slideThree\"><input type=\"checkbox\" id=\"slideThree\" name=\"mailsend\" value=\"1\" /><label for=\"slideThree\"></label></div> </div>';\n htmlp+='<input type=\"button\" id=\"sav_asing_w\" value=\"Asignar Tarea\" onclick=\"save_asing_wActv('+id+','+op+');\" style=\"display:inline;margin-left: 1em;width: 20%;\" /><input type=\"button\" value=\"Cancelar\" onclick=\"cancel_w_tema('+op+','+id+','+sec+');\" style=\"display:inline;margin-left: 1em;width: 20%;\"/></form></div>';\n \n $(camp).append(htmlp);\n $(\"body #datepicker4\").click();\n}", "title": "" }, { "docid": "54fac0c32dfed7932369458cc1109f6c", "score": "0.5449455", "text": "function cambiarEditorialActual() {\r\n let inputNuevoNombre = document.getElementById(\"nombreEditorial\");\r\n let inputJuego = document.getElementById(\"juegoEditorial\");\r\n\r\n let validaNuevoNombre = validarNombreCreador(inputNuevoNombre);\r\n let validaJuego = validarJuegoSeleccionado(inputJuego);\r\n\r\n if (validaNuevoNombre && validaJuego) {\r\n let nuevaEditorial = new Editorial(inputNuevoNombre.value);\r\n if (!listaEditoriales.includes(nuevaEditorial)) {\r\n listaEditoriales.push(nuevaEditorial);\r\n }\r\n let juego = juegos.find(juego => noEspacios(juego.titulo) === inputJuego.value);\r\n\r\n if (juego !== undefined) {\r\n juego.editorial = nuevaEditorial;\r\n let juegosSeleccionado = document.querySelector(`div[data-identificador = ${inputJuego.value}]`);\r\n let editorialActual = juegosSeleccionado.querySelector(\"p[data-identificador = editorial]\");\r\n editorialActual.innerHTML = `${nuevaEditorial}`;\r\n }\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "f2f62e44a5fcf44cda429d86048c1fa2", "score": "0.5446171", "text": "function ExpandableTextArea() { }", "title": "" }, { "docid": "9963302349d918749d2fcb97fd99106b", "score": "0.5442925", "text": "function add_area_text_label(svg,area,text){}", "title": "" }, { "docid": "a9fc9bae1192b34b27e02679d3bc3d82", "score": "0.544072", "text": "function save_tarea_subtema(id,txt,op,sec){\n var camp= \"\";\n var camp2 =\"\";\n var camp3 =\"\";\n if (op ==1) {\n var txto = $(\"#sub_listaction_\"+id+\" #textoreunion_\"+id).val();\n camp =\"#sub_listaction_\"+id+\" #txts_\"+id+\" div\";\n camp2=\"#sub_listaction_\"+id+\" #txts_\"+id+\" textarea\";\n camp3=\"#sub_listaction_\"+id+\" #txts_\"+id;\n }\n if (op ==2) {\n var txto = $(\"#sub_listaction_\"+id+\" #textoreunion_\"+id).val();\n camp =\"#sub_listaction_\"+id+\" #txt_\"+id+\" div\";\n camp2=\"#sub_listaction_\"+id+\" #txt_\"+id+\" textarea\";\n camp3=\"#sub_listaction_\"+id+\" #txt_\"+id;\n }\n $(camp).hide();\n $(camp2).hide();\n var htmlp='<div id=\"form_tarea_tema_'+id+'\" class=\"form_usr_w_asing\"><form action=\"#\" method=\"post\"><label for=\"\">nombre de la tarea</label><input type=\"text\" name=\"titulo-w\" value=\"'+txto+'\"/>';\n htmlp+='<label for=\"\">fecha</label><input type=\"text\" id=\"datepicker4\" name=\"fecha\" placeholder=\"fecha limite\" ><label for=\"\">usuario</label><input type=\"text\" id=\"adduser_listact\" onkeyup=\"share_usuarios(this.value,1);\" />';\n htmlp+='<div id=\"jb_lista_usuarios\" class=\"list-share list-meeting\" style=\"display:none;z-index: 2;\"></div><div class=\"listaUsuarios listusract\" id=\"jb_lista_usuarios_click_tema\" style=\"display: block;\"></div>';\n htmlp+='<div class=\"chkmail-w\"><label for=\"\">Mail:</label><div class=\"slideThree\"><input type=\"checkbox\" id=\"slideThree\" name=\"mailsend\" value=\"1\" /><label for=\"slideThree\"></label></div> </div>';\n htmlp+='<input type=\"button\" id=\"sav_asing_w\" value=\"Asignar Tarea\" onclick=\"save_asing_subactw('+id+','+op+');\" style=\"display:inline;margin-left: 1em;width: 20%;\" /><input type=\"button\" value=\"Cancelar\" onclick=\"cancel_w_subtema('+op+','+id+','+sec+');\" style=\"display:inline;margin-left: 1em;width: 20%;\"/></form></div>';\n \n $(camp3).append(htmlp);\n $(\"body #datepicker4\").click();\n}", "title": "" }, { "docid": "1942a3af417ad979a7403b8dc08a91fb", "score": "0.5431616", "text": "function workWithEntry(texts,n)\r\n {\r\n var texts = texts;\r\n if(typeof(n) != 'undefined')\r\n {\r\n var header = 'Persönlichen Text bearbeiten';\r\n var name = texts[n].name;\r\n var text = texts[n].value;\r\n }\r\n else\r\n {\r\n var header = 'نص جديد';\r\n var name = '';\r\n var text = '';\r\n }\r\n\r\n\r\n var table = document.createElement('table');\r\n table.setAttribute('id','user_texts_edit_entry');\r\n table.setAttribute('style','clear:both; position:absolute; z-index:121; border: 2px solid #804000; background:#efe6c9; top: 0px; left: -300px; ');\r\n\r\n var tr = document.createElement('tr');\r\n var th = document.createElement('th');\r\n th.setAttribute('colspan','2');\r\n\r\n th.appendChild(document.createTextNode(header));\r\n\r\n tr.appendChild(th);\r\n table.appendChild(tr);\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.appendChild(document.createTextNode('العنوان '));\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n var input = document.createElement('input');\r\n input.setAttribute('type','text');\r\n input.setAttribute('value',name);\r\n input.setAttribute('size',64);\r\n input.setAttribute('id','UserText_Name');\r\n td.appendChild(input);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.appendChild(document.createTextNode('نص:'));\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n var textarea = document.createElement('textarea');\r\n textarea.setAttribute('cols','40');\r\n textarea.setAttribute('rows','12');\r\n textarea.setAttribute('id','UserText_Text');\r\n textarea.appendChild(document.createTextNode(text));\r\n td.appendChild(textarea);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.setAttribute('class','tdbutton');\r\n td.appendChild(document.createTextNode('حفض'));\r\n td.addEventListener('click',function() {\r\n var data = {\r\n 'name' : document.getElementById('UserText_Name').value,\r\n 'value' : document.getElementById('UserText_Text').value };\r\n\r\n if(typeof(n) != 'undefined')\r\n {\r\n texts[n] = data;\r\n }\r\n else\r\n {\r\n texts.push(data);\r\n }\r\n\r\n setTexts(texts);\r\n this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);\r\n\r\n\r\n if(document.getElementById('user_texts'))\r\n {\r\n document.getElementById('user_texts').parentNode.removeChild(document.getElementById('user_texts'));\r\n }\r\n if(document.getElementById('user_texts_edit'))\r\n {\r\n document.getElementById('user_texts_edit').parentNode.removeChild(document.getElementById('user_texts_edit'));\r\n }\r\n show_userTextsBox(mainDiv);\r\n\r\n return false;\r\n },false);\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n td.setAttribute('class','tdbutton');\r\n td.appendChild(document.createTextNode('لغاء'));\r\n td.addEventListener('click',function() {\r\n this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);\r\n return false;\r\n },false);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n return table;\r\n }", "title": "" }, { "docid": "1942a3af417ad979a7403b8dc08a91fb", "score": "0.5431616", "text": "function workWithEntry(texts,n)\r\n {\r\n var texts = texts;\r\n if(typeof(n) != 'undefined')\r\n {\r\n var header = 'Persönlichen Text bearbeiten';\r\n var name = texts[n].name;\r\n var text = texts[n].value;\r\n }\r\n else\r\n {\r\n var header = 'نص جديد';\r\n var name = '';\r\n var text = '';\r\n }\r\n\r\n\r\n var table = document.createElement('table');\r\n table.setAttribute('id','user_texts_edit_entry');\r\n table.setAttribute('style','clear:both; position:absolute; z-index:121; border: 2px solid #804000; background:#efe6c9; top: 0px; left: -300px; ');\r\n\r\n var tr = document.createElement('tr');\r\n var th = document.createElement('th');\r\n th.setAttribute('colspan','2');\r\n\r\n th.appendChild(document.createTextNode(header));\r\n\r\n tr.appendChild(th);\r\n table.appendChild(tr);\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.appendChild(document.createTextNode('العنوان '));\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n var input = document.createElement('input');\r\n input.setAttribute('type','text');\r\n input.setAttribute('value',name);\r\n input.setAttribute('size',64);\r\n input.setAttribute('id','UserText_Name');\r\n td.appendChild(input);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.appendChild(document.createTextNode('نص:'));\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n var textarea = document.createElement('textarea');\r\n textarea.setAttribute('cols','40');\r\n textarea.setAttribute('rows','12');\r\n textarea.setAttribute('id','UserText_Text');\r\n textarea.appendChild(document.createTextNode(text));\r\n td.appendChild(textarea);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n\r\n var tr = document.createElement('tr');\r\n\r\n var td = document.createElement('td');\r\n td.setAttribute('class','tdbutton');\r\n td.appendChild(document.createTextNode('حفض'));\r\n td.addEventListener('click',function() {\r\n var data = {\r\n 'name' : document.getElementById('UserText_Name').value,\r\n 'value' : document.getElementById('UserText_Text').value };\r\n\r\n if(typeof(n) != 'undefined')\r\n {\r\n texts[n] = data;\r\n }\r\n else\r\n {\r\n texts.push(data);\r\n }\r\n\r\n setTexts(texts);\r\n this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);\r\n\r\n\r\n if(document.getElementById('user_texts'))\r\n {\r\n document.getElementById('user_texts').parentNode.removeChild(document.getElementById('user_texts'));\r\n }\r\n if(document.getElementById('user_texts_edit'))\r\n {\r\n document.getElementById('user_texts_edit').parentNode.removeChild(document.getElementById('user_texts_edit'));\r\n }\r\n show_userTextsBox(mainDiv);\r\n\r\n return false;\r\n },false);\r\n tr.appendChild(td);\r\n\r\n var td = document.createElement('td');\r\n td.setAttribute('class','tdbutton');\r\n td.appendChild(document.createTextNode('لغاء'));\r\n td.addEventListener('click',function() {\r\n this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);\r\n return false;\r\n },false);\r\n tr.appendChild(td);\r\n\r\n table.appendChild(tr);\r\n\r\n return table;\r\n }", "title": "" }, { "docid": "e7348633adeb0ff812f869000fc70eb8", "score": "0.54304", "text": "function insertarLinea(boton, accion, detalle, php) {\r\n\t/*\r\n\t.- boton\t-> referencia del boton (objeto)\r\n\t.- accion\t-> modulo\r\n\t.- detalle\t-> sufijo de los campos de la lista\r\n\t.- php\t\t-> indica si tomo el archivo con las funciones generales o si tomo el archivo con las funciones del modulo\r\n\t.- \r\n\t*/\r\n\tboton.disabled = true;\r\n\tvar nro = \"nro_\" + detalle;\r\n\tvar can = \"can_\" + detalle;\r\n\tvar sel = \"sel_\" + detalle;\r\n\tvar lista = \"lista_\" + detalle;\r\n\tvar nrodetalle = new Number(document.getElementById(nro).value); nrodetalle++;\r\n\tvar candetalle = new Number(document.getElementById(can).value); candetalle++;\r\n\t\r\n\tif (php == \"\") var php_ajax = \"../lib/fphp_funciones_ajax.php\";\r\n\telse var php_ajax = \"../lib/\"+php+\"_fphp_funciones_ajax.php\";\r\n\t//\tCREO UN OBJETO AJAX\r\n\tvar ajax=nuevoAjax();\r\n\tajax.open(\"POST\", php_ajax, true);\r\n\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\tajax.send(\"accion=\"+accion+\"&nrodetalle=\"+nrodetalle+\"&candetalle=\"+candetalle);\r\n\tajax.onreadystatechange=function() {\r\n\t\tif (ajax.readyState==4)\t{\r\n\t\t\tvar resp = ajax.responseText;\r\n\t\t\tdocument.getElementById(nro).value = nrodetalle;\r\n\t\t\tdocument.getElementById(can).value = candetalle;\r\n\t\t\tidtr = detalle + \"_\" + nrodetalle;\t\t\t\r\n\t\t\tvar newTr = document.createElement(\"tr\");\r\n\t\t\tnewTr.className = \"trListaBody\";\r\n\t\t\tnewTr.setAttribute(\"onclick\", \"mClk(this, '\"+sel+\"');\");\r\n\t\t\tnewTr.id = idtr\r\n\t\t\tdocument.getElementById(lista).appendChild(newTr);\r\n\t\t\tdocument.getElementById(idtr).innerHTML = resp;\r\n\t\t\tboton.disabled = false;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "0ed44101db260c68408e134b297da0c1", "score": "0.54302233", "text": "function editorCommand(editor, command, option) {\n// first we assign the content of the textarea to the variable mainField\n var mainField;\n mainField = document.getElementById(editor).contentWindow;\n // then we will use execCommand to execute the option on the textarea making sure the textarea stays in focus\n try {\n mainField.focus();\n mainField.document.execCommand(command, false, option);\n mainField.focus();\n } catch (e) { }\n}", "title": "" }, { "docid": "dd8188b0316398e1aef8fad72768e0b2", "score": "0.5428296", "text": "function getTextareaAnswers() {\n var textareas=$('textarea');\n if(textareas==null || textareas.length==0)\n return ;\n var answers='{';\n for(var i=0;i<textareas.length;i++) {\n if($(textareas[i]).val()!='')\n answers += $(textareas[i]).attr('id')+':'+$(textareas[i]).val() + ',';\n }\n answers += '}';\n return answers;\n}", "title": "" }, { "docid": "6896581738e2cb14bf6ec5eebe179014", "score": "0.5427278", "text": "function editText(event) {\n let target = event.target\n // Create new textarea Element\n let textareaElement = document.createElement(\"textarea\")\n // Insert content of the existing paragraph\n textareaElement.value = target.innerHTML\n // Add event to the textareaElement\n textareaElement.addEventListener('blur', saveText)\n // Select the welcomeWrapper element\n var parentDiv = target.parentNode;\n // Insert new textareaElement into the welcomeWrapper before paragraph\n parentDiv.insertBefore(textareaElement, target);\n // Remove the existing paragraph\n target.remove()\n textareaElement.focus()\n\n}", "title": "" }, { "docid": "67bf489161b0f907da2e2fbeb6198d35", "score": "0.542637", "text": "function inviaMessaggio (msg, txt) {\r\n if (txt != \"\") {\r\n // seleziona e clona l'elemento del messaggio\r\n var elemento = $(\".template .wrap_messaggio\").clone();\r\n // scrive nel clone il testo del messaggio preso dall'input\r\n elemento.find(\".text_messaggio\").text(txt);\r\n // scrive nel clone l'ora attuale\r\n elemento.find(\".ora_messaggio\").text(getOreMinuti());\r\n // aggiunge la classe per il tipo di messaggio (interno o esterno)\r\n elemento.addClass(msg);\r\n // appende l'elemento messaggio alla conversazione attiva\r\n $(\".conversazione_attiva\").append(elemento);\r\n // pulisce l'input del messaggio\r\n $(\".input_messaggio_new\").val(\"\");\r\n // SCROLL BAR: fa scorrere la scroll-bar barra verso il basso per visualizzare il nuovo messaggio\r\n var scrollVal = $(\".sideDX_main\").prop(\"scrollHeight\");\r\n $(\".sideDX_main\").scrollTop(scrollVal);\r\n }\r\n }", "title": "" }, { "docid": "1eedb4853ec01f1cf496a59912cf6976", "score": "0.5421665", "text": "function changeToTextarea() {\n var divHTML = jQuery(this).html(),\n $editableText = jQuery('<textarea>').css({\n width: '100%',\n height: '300px'\n });\n $editableText.html(divHTML);\n jQuery(this).replaceWith($editableText);\n $editableText.focus();\n $editableText.blur(revertDiv);\n }", "title": "" }, { "docid": "7e0e9296fb7bb28322fa927820908b83", "score": "0.54182595", "text": "function editableTextClicked() {\n var textContent = $jQ(this).html();\n var height = $jQ(this).height(); \n var width = $jQ(this).parent().width();\n var inputId = $jQ(this).attr( \"data-input-id\" );\n var editableTextarea = $jQ(\"<textarea />\",{ \"data-input-id\" : inputId,\n \t\t\t\"style\" : \"margin:0;padding:0 2px;max-width:none;max-height:none;width:\" + \n \t\t\twidth + \"px;height:\" + (height+4) + \"px\"});\n editableTextarea.val(textContent);\n // replace the span with textarea\n $jQ(this).replaceWith(editableTextarea);\n editableTextarea.focus();\n //ajust the size of textarea based on the content\n editableTextarea.keyup(ajustTextareaSize);\n // setup the blur event for new textarea\n editableTextarea.blur(editableTextBlurred);\n}", "title": "" }, { "docid": "34e61b3b913a30e7cdeaf420bacc45c7", "score": "0.5417449", "text": "function addNote(id,content,x,y,width,height) { //addNote to the view\n // setting default values\n\n if(typeof(content)==='undefined') content = \"\";\n if(typeof(x)==='undefined') x = \"150px\"; \n if(typeof(y)==='undefined') y = \"50px\";\n if(typeof(width)==='undefined') width = \"220px\"; \n if(typeof(height)==='undefined') height = \"120px\";\n\n\n // var $newNote = $('<div class=\"resize draggable post\" style=\"width: 200px; height: 200px;\"></div>');\n // var $newNote = $('<div class=\"resize draggable drag-drop\" style=\"width: 300px; height: 300px; margin-left: 310px;\"><textarea rows=\"8\" cols=\"50\"></textarea></div>');\n // $newNote.appendTo('.resize-container');\n\n // var $$newNote = $('<div contenteditable class=\"draggable resize post fa fa-times\" >' + content + '</div>');\n $newNote = $('<div class=\"post resize draggable\" >' + \n '<a href=\"javascript: ;\" class=\"delete\" ><img src=\"../../images/exit.png\" ></a>' +\n '<textarea >' + content + '</textarea></div>');\n $newNote[0].setAttribute('postId', id);\n\n $newNote.css({\n 'background': 'linear-gradient( #FDF98C, #fdee72)',\n 'width': width,\n 'overflow': 'auto',\n 'height': height,\n 'left': x,\n 'top': y\n });\n\n\n $newNote.appendTo('.resize-container');\n // $('textarea', $newNote).autosize({\n // callback: resizeParent\n // });\n\n // $('textarea', $newNote).on('change', function() {\n // console.log('working!');\n // });\n // $('.post textarea').elastic();\n\n}", "title": "" }, { "docid": "590d2c589c9f533c1721a51d7d54fd8b", "score": "0.5412593", "text": "editedcontent(){\n this.displayContent();\n this.content = document.getElementById(\"textarea\").value;\n document.getElementById('contentScrapper').innerHTML=this.content;\n }", "title": "" }, { "docid": "0b7c8cbd09a23873ddaf22ff11602804", "score": "0.5410724", "text": "function cargarContenidoMosaico( archivo, altura ) {\n\t$( \"#bloque_intermedio\" ).load( archivo, function() {\n\t\t\n\t\t$( \"#bloque_intermedio\" ).css( \"height\", altura + \"px\");\n\t\t$(\".mostrarModelo\").click( function() {\n\t\t\tconsole.log(this);\n\t\t\tindexModelo = parseInt( $( this ).attr( \"modelo\" ) );\n\t\t\t$.address.value( indexModelo );\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "07337f92723e1aa1c139cffdb552c8b7", "score": "0.5409153", "text": "function textareaExpand(day,task,subtask)\n{\n // resizing text area with that id\n let textarea = document.getElementById(`input-${day}-${task}-${subtask}`);\n textarea.style.height = \"\";\n textarea.style.height = textarea.scrollHeight + \"px\";\n if(textarea.style.height == \"26px\"||textarea.style.height == \"25px\")\n {\n textarea.style.height=\"\";\n }\n}", "title": "" }, { "docid": "8f0f37acedc0be7fd3069fbe3571af82", "score": "0.5406139", "text": "function setAllTextArea(val){\n var i = 0;\n $('.ta_tmce').each(function(){\n $(this).text(val[i])\n i++;\n })\n}", "title": "" }, { "docid": "b3e98ce04e664ef1344fb152428e8e8a", "score": "0.54028", "text": "async function todoTareas(charlaModelo) {\n\tconst charlaDicc= await PaApiDatos.charlaAdiccionario(charlaModelo,null,false);\n\tlogmsg('tareasYestado',{charlaDicc});\n\tconst Tareas= {};\n\tObject.entries(charlaDicc).forEach( ([orden, txt]) => {\n\t\tTareas[orden]= {consigna: txt.texto};\n\t});\n\tlogmsg('tareasYestado', {Tareas});\t\n\treturn Tareas;\n}", "title": "" }, { "docid": "a02b837430f788025bf9a8686a4fe121", "score": "0.53937155", "text": "function comment_add(text_area)\n{\n if (text_area.value.length>0)\n {\n var text_area_value = text_area.value ;\n var paragraph = '<p id=\"comment\">' + text_area_value + '</p>' ; \n var div = document.getElementById('adding_comments');\n div.innerHTML = paragraph + div.innerHTML ; \n var adding_comments = document.getElementById('comments_textarea'); \n adding_comments.value = adding_comments.defaultValue;\n }\n}", "title": "" }, { "docid": "af43a95d5f3e4ec5694cc794d8852d91", "score": "0.5393423", "text": "function actualizarNombre()\r\n{\r\n\t//Asignar a una variable el contenido del textarea\r\n\tcambio = $(\".oculto\").val() ;\r\n\r\n\tif(cambio.length==0){\r\n\t\tmostrarNombre();\r\n\t\tllenaelementoHTML(\"#mensaje\" , \"No podra hacer la actualizacion\");\r\n\t}\r\n\telse\r\n\t{\r\n\r\n\t//Darle una url que nos de el resultado de la accion en formato JSON\r\n\turl = now + \"index.php/api/misdatoscontrolador/actualizarNombre/format/json\";\r\n\t//Metodo para enviar el cambio de nombre\r\n\t$.post( url, { \"name\": cambio })\r\n \t\t.done(function( data ) {\r\n\t\t\t$( \".oculto\").hide();\r\n\t\t\t//Asignando a una variabl\r\n\t\t\t$( \"#nomPersona\" ).show();\r\n\t\t\tmostrarNombre();\r\n \t\t})\r\n \t.fail(function() {\r\n \talert( \"error\" );\r\n\t});\r\n\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "e936005d788a8964ba305ec7064e1260", "score": "0.5393273", "text": "function UpdateDisplay(MSGTA) {\n var textarea = document.getElementById(\"textarea\");\n textarea.value = MSGTA;\n}", "title": "" }, { "docid": "2bd1ce7f72dd52f729e00b126d8571d9", "score": "0.53926426", "text": "function genLisTarea(idw)\n{\n var idus = $(\"#idus\").val();\n var tx = \"selec=24&idusua=\"+idus+\"&idw=\"+idw;\n var ruta = \"funciones/funciones.php\";\n $.post(ruta,tx,function(data){\n if ($('.tareasIdeas #'+idw+' #segmain_'+idw+'').length > 0) {\n $('.tareasIdeas #'+idw+' #segmain_'+idw+'').empty();\n //$('.tareasIdeas #'+idw+' #segmain_'+idw+' div').remove();\n }\n\n $.each(data,function(k,v){\n var html='<div id=\"comn_tareas_'+v.idactw+'\" class=\"coment_w\"><label for=\"\">Comentario:</label><input type=\"text\" placeholder=\"escribe algun comentario\" />';\n html+='<div class=\"mensaje\" id=\"mensaje_'+v.idactw+'\" style=\"margin-top: 2em;font-size: 0.81em; width: 31%; overflow: hidden; position: relative; float: right;\"></div>';\n html+='<div style=\"width: 25%; display: inline-block;\"><label for=\"\">mail:</label><input type=\"checkbox\" id=\"mail-w\" name=\"mailsend\" value=\"1\" />';\n html+='</div>';\n html+='<div class=\"uparch_w\"><form enctype=\"multipart/form-data\" id=\"arch_upw_tar_'+v.idactw+'\" action=\"\" method=\"post\" accept-charset=\"utf-8\">';\n html+='<label class=\"up-archivo\">Agregar archivo<input name=\"archivo\" type=\"file\" onclick=\"selectarchwtar('+v.idactw+');\" id=\"archivo_tareasw_'+v.idactw+'\" class=\"up_acrh\"/></label><span id=\"arch_reunAct\" class=\"icon\" onclick=\"uparchivo(3,'+v.idactw+',0);\" style=\"font-size: 2em; margin-left: 0.4em;\">n</span>';\n html+='</form></div><input type=\"button\" value=\"Agregar\" onclick=\"savecomen_actw('+v.idactw+',0)\"/></div>';\n html+='<div class=\"listUserw\"><label for=\"\"><span class=\"icon\">L</span>Usuarios asignados: </label><ul>';\n var usrlis = v.usrAsing;\n $.each(usrlis,function(l,u){\n html+='<li>'+u.nombreEmp+'</li>';\n });\n html+='</ul></div>';\n html+='<div class=\"listTagw\"><label for=\"\"><span class=\"icon\">y</span>Etiquetas:</label><ul>';\n var tag = v.tagW;\n $.each(tag,function(k,t){\n html+='<li class=\"'+t.tipo+'\">'+t.tagName+'</li>';\n });\n html+='</ul></div>';\n html+='<div class=\"listarchw\"><label for=\"\"><span class=\"icon\">m</span> Archivos:</label><ul style=\"margin: 1px; font-size: 2.5em;\">';\n var arch = v.archivos;\n $.each(arch,function(k,a){\n if (typeof a !== \"undefined\" || a !== \"null\") {\n var img = isImage(a.tipo);\n if(img){\n html+='<li style=\"list-style: none; margin-right: 15px; display: inline;\"> <a href=\"\" download><img src=\"'+a.liga+'\" alt=\"50\" width=\"50\" /></a></li>';\n }else{\n html+='<li style=\"list-style: none; margin-right: 15px; display: inline;\"><a href=\"'+a.liga+'\" download><span class=\"icon\">Ø</span></a></li>';\n }\n }\n });\n html+='</ul></div>';\n html+='<div class=\"listacoment\"><label for=\"\"><span class=\"icon\">[</span> Comentarios:</label><ul>';\n var coment = v.comentarios;\n $.each(coment,function(k,c){\n c.fecha=c.fecha.substring(0, c.fecha.length-3);\n html+='<li id=\"coment_'+c.idcom+'\"><label><span class=\"icon\">O</span><strong>'+c.texto+'</strong> <span> Por:'+c.nomusr+' '+c.fecha+'</span></label></li>';\n });\n html+='</ul></div>';\n html+='</div>';\n $(\".tareasIdeas #\"+idw+\" #segmain_\"+idw).append(html);\n });\n });\n\n}", "title": "" }, { "docid": "7419e3e87e833ce876a9fcd209325fab", "score": "0.5387695", "text": "function tacharTarea(){\n\tvar tachado = nuevaTarea.addEventListener(\"click\",checkbox);\n\n}", "title": "" }, { "docid": "8c846fbdd3aa948988c69202c0ca66d4", "score": "0.5387353", "text": "function ponerDatosInputHtml(t,pos){\n document.getElementById(\"tituloInput\"+pos).innerHTML = t;\n}", "title": "" }, { "docid": "816f3585e0599823687a02d800d988e9", "score": "0.5373375", "text": "function textareaFunction(){\nvar r = document.createElement('span');\nvar y = document.createElement(\"TEXTAREA\");\nvar g = document.createElement(\"IMG\");\ny.setAttribute(\"cols\", \"17\");\ny.setAttribute(\"placeholder\", \"message..\");\ng.setAttribute(\"src\", \"delete.png\");\nincrement();\ny.setAttribute(\"Name\", \"textelement_\" + i);\nr.appendChild(y);\ng.setAttribute(\"onclick\", \"removeElement('myForm','id_\" + i + \"')\");\nr.appendChild(g);\nr.setAttribute(\"id\", \"id_\" + i);\ndocument.getElementById(\"myForm\").appendChild(r);\n}", "title": "" }, { "docid": "e18843e36d950c9c6a4b6aca41285080", "score": "0.5369431", "text": "function adiciona2(n, elem){\n elem[n].addEventListener(\"click\", function(){\n editar_atual = elem[n].id;\n document.getElementById(\"editar_conteudo\").className = \"visivel\";\n document.getElementById(\"cont_edit\").className = \"visivel\";\n document.getElementById(\"data_edit\").value = document.getElementById(\"data_evento_\"+editar_atual).innerText;\n document.getElementById(\"titulo_edit\").value = document.getElementById(\"titulo_evento_\"+editar_atual).innerText;\n document.getElementById(\"lembrete_edit\").value = document.getElementById(\"lem_evento_\"+editar_atual).innerHTML;\n });\n}", "title": "" }, { "docid": "9adad223ec415bfc3c05c6325be27f60", "score": "0.5368459", "text": "function subtopicact(id)\n{\n $(\"#topiclist_\"+id+\" #sublistaction_\"+id).empty();\n var html=\"\";\n html+='<div style=\"overflow: hidden; width: 75%; padding: 0px;\"><textarea name=\"\" id=\"texto_'+id+'\" class=\"Titulo-topic subtopic\" cols=\"30\" rows=\"10\" style=\"display: block;\"></textarea><input type=\"button\" value=\"Agregar\" onclick=\"savesubtopact('+id+');\" style=\"display: block;\"/><input type=\"button\" value=\"Cancelar\" onclick=\"cancel_subtem('+id+');\" style=\"display: block;\"/></div>';\n $(\"#topiclist_\"+id+\" #sublistaction_\"+id).append(html);\n}", "title": "" }, { "docid": "a78086541414cb1301fd0c74d4f37c26", "score": "0.53617376", "text": "function textarea(svg,caption, x, y,maxChars,lineHeight) {\r\n\tif (!maxChars) maxChars = 20;\r\n\tif (!lineHeight) lineHeight = 12;\r\n\r\n\tvar words = caption.split(\" \");\r\n\tvar line = \"\";\r\n\r\n\tfor (var n = 0; n < words.length; n++) {\r\n\t\tvar testLine = line + words[n] + \" \";\r\n\t\tif (testLine.length > maxChars || words[n]==\"|\")\r\n\t\t{\r\n\t\t\tsvg.append(\"tspan\")\r\n\t\t\t.attr(\"x\",x)\r\n\t\t\t.attr(\"y\",y)\r\n\t\t\t.text(line);\r\n\r\n\t\t\tif (words[n]==\"|\") words[n]=\"\";\r\n\r\n\t\t\tline = words[n] + \" \";\r\n\t\t\ty += lineHeight;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tline = testLine;\r\n\t\t}\r\n\t}\r\n\tsvg.append(\"tspan\")\r\n\t.attr(\"x\",x)\r\n\t.attr(\"y\",y)\r\n\t.text(line);\r\n}", "title": "" }, { "docid": "f29a763039fb06379b888e9e4fa96816", "score": "0.5342622", "text": "function inicializaContadores(){\n campo.on(\"input\", function(){ // evento no elemento input\n var conteudo = campo.val(); // a variavel conteudo possui o value do campo\n var qtdPalavras = conteudo.split(/\\S+/).length - 1; // variavel recebe quantidade de palavras com caracteres especiais e dá numero de palavras através do length\n $(\"#contador-palavras\").text(qtdPalavras); //variavel qtdPalavras representada no html agora.\n\n var conteudoSemEspaco = conteudo.replace(/\\s+/g,''); // corringo bug do espaco contar como caractere\n\n var qtdCaracteres = conteudoSemEspaco.length; // conteudo apresentando seu tamanho de string\n $(\"#contador-caracteres\").text(qtdCaracteres); // inserindo valor de tamnho da string no html\n });\n}", "title": "" }, { "docid": "f15ec5f2d433bd68786aa94999e9a7b0", "score": "0.53378344", "text": "function SubirTituloYexplicacionPedido(event){\n //cogemos el evento para que no se cambie de pagina antes de hacer el push\n //a la base de datos y recibir el then en la promesa\n event.preventDefault()\n let pedidoTitulo = document.getElementById('pedidoTitulo').value\n var pedidoInfo = document.getElementById('pedidoInfo').value\n escribirPedidoDescripcion(pedidoTitulo , pedidoInfo)\n}", "title": "" }, { "docid": "5deb756b2615297a70e95a657c3decb6", "score": "0.5330735", "text": "function TextareaControl(_ref) {\n var label = _ref.label,\n hideLabelFromVision = _ref.hideLabelFromVision,\n value = _ref.value,\n help = _ref.help,\n onChange = _ref.onChange,\n _ref$rows = _ref.rows,\n rows = _ref$rows === void 0 ? 4 : _ref$rows,\n className = _ref.className,\n props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(_ref, [\"label\", \"hideLabelFromVision\", \"value\", \"help\", \"onChange\", \"rows\", \"className\"]);\n\n var instanceId = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(TextareaControl);\n var id = \"inspector-textarea-control-\".concat(instanceId);\n\n var onChangeValue = function onChangeValue(event) {\n return onChange(event.target.value);\n };\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(_base_control__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"], {\n label: label,\n hideLabelFromVision: hideLabelFromVision,\n id: id,\n help: help,\n className: className\n }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"])(\"textarea\", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])({\n className: \"components-textarea-control__input\",\n id: id,\n rows: rows,\n onChange: onChangeValue,\n \"aria-describedby\": !!help ? id + '__help' : undefined,\n value: value\n }, props)));\n}", "title": "" }, { "docid": "4a1fa78a580c7ba793ce48bc4daa408c", "score": "0.5326655", "text": "function cambiarEstadoTarea(tarea, estado) {\n var idTarea = tarea.parentElement.parentElement.id.split(':')[1];\n //var nombreTarea = tarea.parentElement.parentElement.textContent;\n\n //llamado AJAX\n var xhr = new XMLHttpRequest();\n //informacion\n var datos = new FormData();\n datos.append('id', idTarea);\n datos.append('accion', 'actualizar');\n datos.append('estado', estado);\n //datos.append('tarea',nombreTarea);\n \n //abrir la conexion\n xhr.open('POST','includes/modelos/modelo-tareas.php', true);\n //console.log(...datos);//ver los datos enviados\n //on load\n xhr.onload = function(){\n if (this.status === 200) {\n var respuesta = JSON.parse(xhr.responseText);\n console.log(respuesta);\n acutalizarProgreso();\n }\n }\n //enviar la peticion\n xhr.send(datos);\n}", "title": "" }, { "docid": "3d3c9ce23b6ee9d7e228ab52d330ef1e", "score": "0.5326316", "text": "obtenerTarea({commit}, id){\n commit('tarea', id)\n }", "title": "" }, { "docid": "7917230d5f1d35fae76bfa4a3fb2971f", "score": "0.53253376", "text": "function updateAnimation() {\n q = document.getElementById(\"textarea\").value;\n}", "title": "" } ]
a6ac05353693924f48ff20118a027de6
Complete the method which accepts such an array, and returns that single different number. The input array will always be valid! (oddlength >= 3) Examples [1, 1, 2] ==> 2 [17, 17, 3, 17, 17, 17, 17] ==> 3
[ { "docid": "60bec9bf2de2ce101b3e9ea95fdaf536", "score": "0.0", "text": "function stray(numbers) {\n\nfor(let i = 0; i <numbers.length; i++){\n let lucky = numbers.filter(function(number) {\n return number !== numbers[i];\n});\n if(lucky.length === 1){\n return lucky[0];\n }\n}\n\n}", "title": "" } ]
[ { "docid": "a1f639847a887a113746ef3996e13aa4", "score": "0.6657333", "text": "function SumOddNumber(arr) {\n}", "title": "" }, { "docid": "c7f18329bd2261d578b44e3c3aa99b10", "score": "0.64031845", "text": "function verArray(array) {\n if (array.length == 0) {\n return 0;\n } else {\n return array[0] + sumAll(array.slice(1));\n }\n}", "title": "" }, { "docid": "5967d999053125516e1c8ef5cf163a36", "score": "0.635471", "text": "function findOdd(array)\n{\n\n let result = [];\n function helperRecursive(inputArray)\n {\n if(inputArray.length === 0)\n {\n return;\n }\n \n if(inputArray[0]%2 !== 0)\n {\n result.push(inputArray[0])\n }\n \n helperRecursive(inputArray.slice(1));\n }\n helperRecursive(array) //1st time calling\n return result;\n \n}", "title": "" }, { "docid": "daaca76735fc59437630a0a5c7105df4", "score": "0.6352353", "text": "function getNumber (array) {\n var arr1 =[];\n var arr2 =[];\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 === 0){\n arr1.push(array[i]);\n } else {\n arr2.push(array[i]);\n } \n } if (arr1.length > arr2.length){\n return arr2;\n } else {\n return arr1;\n }\n}", "title": "" }, { "docid": "6dbe6a196ea33e7e94456aefe29f780c", "score": "0.63079786", "text": "function arrayDouble(arr){\n //if array is empty, end function\n if(arr.length===0){\n return [];\n }\n //take the first number in the array and double it\n let num = arr[0]*2;\n //add that number to a new array\n //call the function again with the first number removed\n return [num, ...arrayDouble(arr.slice(1))];\n}", "title": "" }, { "docid": "38a4a5c616a359c485fc124b4659ddab", "score": "0.62774736", "text": "function doubleOddNumbers(arr) {\n //is an odd number?\n const odd = arr.filter(function(val){\n return val % 2 !== 0;\n })\n .map(function(val){\n return val * 2;\n });\n //yes -> double it and return it\n \n return odd;\n}", "title": "" }, { "docid": "2d62306aacae5eb794498d702b6e0027", "score": "0.62638545", "text": "function arrayDouble(arr=[]) {\n if (!arr.length) {\n return [];\n }\n const currentNo = arr[0] * 2;\n return [currentNo, ...arrayDouble(arr.slice(1))];\n}", "title": "" }, { "docid": "0495c5db5287c8834442f982a80d97d6", "score": "0.62401134", "text": "function collectOddValue(arr) {\n \n let result = [];\n\n function helper(helperInput) {\n if (helperInput.length === 0) { // base case if the array is at zero retutn \n return; \n }\n if (helperInput[0] % 2 !== 0) { // checking for odd elements.\n result.push(helperInput[0]) // pushing the first element of the array onto result array. \n }\n helper(helperInput.slice(1)) // if false ---> remove that first element, and copy the array. This is going to shrink the array.\n }\n\n helper(arr);\n\n return result;\n}", "title": "" }, { "docid": "bebd6f1a6f6edae8edd1faef49d72311", "score": "0.62117654", "text": "function returnAnother(arr){\r\n var odd = arr[0];\r\n for(var i=0; i<arr.length; i++){\r\n if(arr[i] % 2 == 1){\r\n odd = arr[i];\r\n break;\r\n }\r\n }\r\n console.log(arr[arr.length-1]);\r\n return odd;\r\n }", "title": "" }, { "docid": "934bdfcdaf0c9bff7f9e020f1df73951", "score": "0.6182728", "text": "function array_numbers(input) {\n //Returning all odd and then all even values sorted in the array\n var result = input.filter (x => x%2).sort().concat(input.filter (x => x%2 === 0).sort());\n \n return result;\n\n //Printing the second to last value in the array\n console.log([input.length-1]);\n}", "title": "" }, { "docid": "084f1d96b887237c75c04ad9c03bf4da", "score": "0.6120261", "text": "function oddLengths(array) {\n return array.reduce((accumulator, currentValue) => {\n let length = currentValue.length\n if(length % 2 === 1) {\n accumulator.push(length)\n }\n return accumulator\n }, [])\n}", "title": "" }, { "docid": "e1ff604b2d6be94911afeecc875db701", "score": "0.6110335", "text": "function solution(array) {\n //Organizing the array\n array.sort();\n \n //Case we found a gap\n for(let i = 0; i < array.length; i++){\n if(array[i + 1] - array[i] > 1){\n return array[i] + 1;\n }\n }\n\n //Case the last number is the lenght number\n if(array[array.length - 1] == array.length){\n return array[array.length - 1] + 1\n }\n \n //Case the first number is not one\n else if(array[0] != 1){\n return 1\n }\n \n //Case length is zero, then n + 1 = 1\n else if(array.length == 0){\n return 1\n }\n \n return array[0];\n \n}", "title": "" }, { "docid": "870aa2fa5aa1ab365ea77ffb68dca615", "score": "0.6095239", "text": "function find_single_number(arr) {\n let num = 0;\n for (i = 0; i < arr.length; i++) {\n num ^= arr[i];\n }\n return num;\n}", "title": "" }, { "docid": "a1888d6e3bcb4482f7a5a157eda1b6c6", "score": "0.6059183", "text": "function collectOddValuesPure(arr) {\n let newArr = []\n if(arr.length === 0){\n return newArr\n }\n if (arr[0] % 2 !== 0){\n newArr.push(arr[0])\n }\n\n newArr = newArr.concat(collectOddValuesPure(arr.slice(1)))\n return newArr\n}", "title": "" }, { "docid": "e1c3a1478f7a411fbb307b3e3c4593e7", "score": "0.6054583", "text": "function double(arr) {\n if (arr.length === 0) {\n return [];\n } else {\n const doubledNum = (arr[0] * 2)\n return [doubledNum, ...double(arr.slice(1))]\n }\n}", "title": "" }, { "docid": "3564a0744e27b8be58f4e8d39131502f", "score": "0.6032429", "text": "function question4(array) {\n // TODO:\n}", "title": "" }, { "docid": "b0ffa0cf1fbd534bc6b0666c03ea4bf0", "score": "0.6026261", "text": "function reduceArray(valueArray){\n let halfWay = 0;\n\n //Base Case: return two digits that are less than 10\n if(valueArray.length == 2 && valueArray[0] < 10 && valueArray[1] < 10){\n \treturn valueArray[0].toString()+valueArray[1].toString(); \n\t}else if(valueArray.length < 2){\n\t\treturn valueArray[0].toString();\n\t}\n\n\t//Find the \"halfway\" mark\n\tif(valueArray.length%2 === 0){\n\t\thalfWay = valueArray.length/2;\n\t}else{\n\t\thalfWay = Math.floor(valueArray.length/2)+1;\n\t}\n\n\tlet tempArray = [];\n\t//Split arrays with the length of two to single digits\n\tif(valueArray.length == 2){\n\t\tlet d = valueArray[0].toString() + valueArray[1].toString();\n\t\tlet s = d.split(\"\");\n\t\tfor(let a = 0; a < s.length; a++){\n\t\t\tvalueArray[a] = parseInt(s[a]);\n\t\t}\n\t}\n\t\n\t//Simultaneusly iterate the value array from left and right, add corresponding values in the process \n\tfor(let l = 0, r = valueArray.length-1; l < halfWay, r > halfWay-1; l++, r--){\n\t\tlet temp = 0;\n\t\ttemp = valueArray[l] + valueArray[r];\n\t\ttempArray.push(temp);\n\t\t\n\t\t//Get middle value when the length is odd\n\t\tif(valueArray.length%2 !== 0 && l+1 == r-1 && r != l){\n\t\t\ttemp = valueArray[l];\n\t\t\ttempArray.push(valueArray[l+1]);\n\t\t\treturn reduceArray(tempArray);\n\t\t}\n\t}\n\n\t//Reduce the array even futher\n\treturn reduceArray(tempArray);\n}", "title": "" }, { "docid": "93b7c05422af8509b73475a9ce8d4fae", "score": "0.6026112", "text": "oddOccurrences(array) {\n let result = 0\n array.forEach(num => {\n let counter = 0\n for (let i = 0; i < array.length; i++) {\n if (array[i] === num) {\n counter++\n }\n }\n if (counter % 2 !== 0) {\n result = num\n }\n })\n return result\n }", "title": "" }, { "docid": "f86b5552945306532dce0dce76a52868", "score": "0.60094476", "text": "function returnOddNumbers(array) {\n var result = [];\n var resultIndex = 0;\n for(var i = 0; i < array.length; i++) {\n if(typeof array[i] === 'number') {\n result[resultIndex] = array[i];\n resultIndex++;\n }\n }\n console.log(result);\n}", "title": "" }, { "docid": "8895d28a61639fccfa990d0fed6f6991", "score": "0.59869975", "text": "function collectOddValues(arr){\n let result = [];\n function helper(helperInput){\n if(helperInput.length === 0){\n return;\n }\n if(helperInput[0] % 2 !==0){\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1))\n }\n helper(arr)\n\n return result;\n}", "title": "" }, { "docid": "fde9137b0d5dc4546ff0ffc9dafc585e", "score": "0.59792674", "text": "function oddCollector(arr) {\n // check for empty input case \n if (arr.length === 0) {\n return console.error('Error: you enter empty array');\n }\n // assign result arr\n let result = [];\n //assign helper function\n function helper(inputs) {\n // check for arr length\n if (inputs.length === 0) {\n return\n }\n // if arr first element value is odd \n if (inputs[0] % 2 !== 0) {\n // add it to the result arr\n result.push(inputs[0])\n }\n\n // recursively call helper function for new array(without first element)\n helper(inputs.slice(1));\n }\n\n helper(arr);\n\n return result;\n}", "title": "" }, { "docid": "147046e9a29f2a2837d423f8aca60ba0", "score": "0.59747565", "text": "function firstNonConsecutive (arr) {\n if(Array.isArray(arr) && arr.length >=2 && arr.every(el => typeof el === 'number' && !(el !== el) )) {\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] + 1 !== arr[i + 1]) {\n return arr[i + 1];\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "3e273c7839fa989f21dec83cef05448c", "score": "0.59744024", "text": "function soDu(arr) {\n arr.splice()\n let result = []\n for (let i = 0; i < arr.length; i++) {\n result.push(arr[i] % 2)\n }\n return result\n}", "title": "" }, { "docid": "87786a5d3fb9d62de8453a8ffa00804a", "score": "0.59727", "text": "function collectOddValues(arr){\n let result = []\n\n function helper(helperInput){\n if(helperInput.length === 0){\n return\n }\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1))\n }\n helper(arr)\n\n return result\n}", "title": "" }, { "docid": "8936e8c0c909522f5951e00a381ba9ae", "score": "0.59698874", "text": "function oddOrEven(array) {\n //enter code here\n if (array.length === 0) {\n return \"even\";\n }\n let i = array.reduce((acc, cur) => acc + cur);\n\n if (i % 2 === 0) {\n return \"even\";\n } else {\n return \"odd\";\n }\n}", "title": "" }, { "docid": "086216b75a4a5a6e826a730dd4c479bb", "score": "0.5961407", "text": "function oddLengths(array) {\n let oddLength = array.map( string => string.length )\n .filter( length => length %2 !== 0 );\n\n return oddLength;\n}", "title": "" }, { "docid": "0cbbd00a60cee5b21e8cf89ac24fbb10", "score": "0.59517866", "text": "function filterArr(num) { if(num >=0 && num % 1 === 0) return num; }", "title": "" }, { "docid": "a497cf87d50952b09ac8917f1834fe6d", "score": "0.59476674", "text": "function productOfArray(arr){\n if( arr.length === 0 ) return 1\n return arr[0] * productOfArray(arr.slice(1))\n}", "title": "" }, { "docid": "f16a1a5e6591ba29686006843795d0d3", "score": "0.5939008", "text": "function strayNum (anArr){\n \n let numArr1 = anArr.filter(num1 => num1 === anArr[0]);\n let numArr2 = anArr.filter(num2 => num2 !== anArr[0]);\n\n if(numArr1.length === 1){\n return numArr1[0]\n } else {\n return numArr2[0]\n }\n\n}", "title": "" }, { "docid": "a5c5fc7930e286dd1a049f3414c75192", "score": "0.5930721", "text": "function makeEven(array) {\n var output = [];\n var middle = array.length / 2;\n\n if (array.length % 2 != 0) {\n for (var i = 0; i < array.length; i++) {\n if (i != Math.round(middle) - 1) {\n output.push(array[i]);\n }\n }\n } else if (array.length % 2 === 0) {\n for (var i=0; i < array.length;i ++) {\n var flag = true;\n if (i === array.length - 2 || i === 1) {\n flag = false;\n }\n\n if (flag) {\n output.push(array[i]);\n }\n }\n }\n return output;\n}", "title": "" }, { "docid": "8e56773c612ab7d8d954906e37db105f", "score": "0.59180367", "text": "function productOfArray(array){\n if(array.length === 0) return 1;\n return array[0] * productOfArray(array.slice(1));\n}", "title": "" }, { "docid": "0dc917536961be6cdad37a28f94b3314", "score": "0.5914069", "text": "function product(arrayNum){\n\n if(arrayNum.length === 0){\n return 1\n }\n\n return arrayNum[0] * product(arrayNum.slice(1))\n\n \n}", "title": "" }, { "docid": "25e53ddb1efe12fc345074ca3956c513", "score": "0.5910395", "text": "function collectOddVal(arr) {\n let result = []; // external data structure\n \n function helper(helperInput) { // nested function\n if (helperInput.length === 0) {\n return; // If equals 0 then stop \n }\n if (helperInput [0] % 2 !== 0) { // if is not even then push an event to result\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1)) // We call the array with a sub array again without excluded odd number\n }\n helper(arr)\n return result;\n}", "title": "" }, { "docid": "3e5bf1f26c8e0d1139df9dc138e4b034", "score": "0.5902449", "text": "function singleNumber(numbers) {\r\n for (let i = 0; i < numbers.length; i++) {\r\n for(let j = i+1; j < numbers.length; j++) {\r\n if(numbers[i] !== numbers[j]) {\r\n return numbers[j];\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b146432603834d1f595ad02ed32de064", "score": "0.58984286", "text": "function midNumber(arr) {\n\n}", "title": "" }, { "docid": "7afd04439c6aee3b5c3f280c4c2d8601", "score": "0.58860576", "text": "function collectOddValues(arr){\n\n let result = [];\n\n function helper (helperInput){\n if(helperInput.length === 0){\n return;\n }\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1))\n }\n helper(arr)\n return result;\n }", "title": "" }, { "docid": "7b14b94d4ecbab77fe7c408e15b59604", "score": "0.58777237", "text": "function countUniqueValue1(arr){\n let firstPoint = 0;\n let secondPoint = firstPoint + 1;\n var count = 1;\n if(arr.length === 0){\n return (0);\n }\n for(let i = 0; i < arr.length; i++){\n if(arr[i] !== arr[i+1] && (i+1) < arr.length){\n count++;\n };\n }\n return count;\n}", "title": "" }, { "docid": "16c2c777fcc082fa44e47d540a8aa4f5", "score": "0.58737373", "text": "function solution(arr) {\n\t// create an empty object to store the numbers\n\tlet numObj = {};\n\t// iterate over the array and add i to the object\n\tfor(let i = 0; i < arr.length; i++){\n\t\tlet item = arr[i];\n\t\tnumObj[item] = 1; // dummy variable\n\t}\n\tlet result = 1;\n\t// iterate from 1 to N+1 and return what item in the sequence that is not in the numObj\n\tfor(let i = 1; i <= arr.length+1; i++){\n\t\tif(numObj[i] === undefined) result = i;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "a249633931ae8b3af94bb803c5f9990c", "score": "0.5872317", "text": "function isOddLength(arr) {\n\n return arr.length % 2 === 1;\n\n}", "title": "" }, { "docid": "e09f5c5670436de8da01a56d1bf75b0b", "score": "0.5868959", "text": "function odd() {\n var array = [1, 2, 9, 2, 1, 5];\n for (var i = 0; i < array.length; i++) {\n if (array.length % 2 === 1) {\n return \"yes\";\n }\n }\n return \"no\";\n}", "title": "" }, { "docid": "5304e62b8334381d98778f6964663c04", "score": "0.58679074", "text": "function oddOneOut (arrayOfNumbers) {\n for (let i = 0; i < arrayOfNumbers.length; i++) {\n const currentNumber = arrayOfNumbers[i]\n if (arrayOfNumbers.indexOf(currentNumber) === arrayOfNumbers.lastIndexOf(currentNumber)) {\n return arrayOfNumbers[i]\n }\n }\n}", "title": "" }, { "docid": "06f1b88fb50bb2e41f948f61f570941f", "score": "0.58654493", "text": "function doubleArray(arr) {\n\tconsole.log('arr = ', arr);\n\n\tif (arr.length === 0) {\n\t\treturn [];\n\t}\n\treturn [(arr[0] * 2), ...doubleArray(arr.slice(1))];\n\n}", "title": "" }, { "docid": "d2000634d46c778cf6c8a8673bec496a", "score": "0.5861542", "text": "function OddOccurrenceInArrays2(Array) {\n Array.sort();\n for (let i = 0; i < Array.length;) {\n if (Array[i] === Array[i + 1]) {\n Array.splice(i, 2);\n } else {\n return Array[0]\n }\n }\n\n return Array[0]\n}", "title": "" }, { "docid": "14c0c585fdd9a9756c1ad984ed11c33f", "score": "0.58541566", "text": "function arrayManipulation(array) {\n\t// Validation of the array parameter\n\tif (!Array.isArray(array)) {\n\t\tconsole.error('Necesitas enviar un array en la función;');\n\t\treturn;\n\t}\n\n\t// Order the array asc\n\tarray.sort();\n\n\t// set the correct\n\tvar actual = null;\n\tvar conteo = 0;\n\tvar resultado = [];\n\n\t// Iterate all the items, when we have all the items, we push the result to the 'resultado' array\n\tfor (var i = 0; i < array.length; i++) {\n\t\t// Validates the actual item vs the iterated item\n\t\tif (array[i] !== actual) {\n\t\t\tif (conteo > 0) {\n\t\t\t\t// Push the result to the result\n\t\t\t\tresultado.push([ actual, conteo ]);\n\t\t\t}\n\t\t\t// Set the actual item based on the index\n\t\t\tactual = array[i];\n\t\t\t// Set the count to 1 if it'st the first time.\n\t\t\tconteo = 1;\n\t\t} else {\n\t\t\t// Set the count plus 1 if it's not the first time\n\t\t\tconteo++;\n\t\t}\n\t}\n\n\tif (conteo > 0) {\n\t\tresultado.push([ actual, conteo ]);\n\t}\n\t// Returns the result\n\treturn resultado;\n}", "title": "" }, { "docid": "86e219d290582dc464a3a725ad4154da", "score": "0.58499557", "text": "function mutateTheArray(n, a) {\n b = []\n\n // edge case 3\n if (a.length === 1){\n b.push(a[0])\n }\n\n // edge case 1\n if (a.length > 1){\n let firstNum = a[0] + a[1]\n b.push(firstNum)\n }\n\n // main case\n for(i=0; i < a.length-2; i++){\n if(a.length > 2){\n let mainNums = a[i] + a[i + 1] + a[i + 2]\n b.push(mainNums)\n }\n }\n\n // edge case 2\n if (a.length > 1 ){\n let lastNum = a[a.length-1] + a[a.length-2] // add last two indexs of array together\n b.push(lastNum)\n }\n\n return b\n}", "title": "" }, { "docid": "11fa842862027fd8767aef8bd3c9fb1f", "score": "0.58495826", "text": "function printNumberReturnOdd(array) {\n console.log(array[array.length - 2]);\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 !== 0) {\n var firstOdd = array[i];\n break;\n }\n }\n return firstOdd;\n}", "title": "" }, { "docid": "6f1aaf02e26c270492919ae3e1eebbe5", "score": "0.58431786", "text": "function oddFive(array) {\n\n}", "title": "" }, { "docid": "50fb28a6570f0a10f2fa17c89cf4fbcd", "score": "0.58431745", "text": "function prob2(array) {\r\n let result = new Array(array.length).fill(1);\r\n let temp = array[0];\r\n\r\n for (let i = 1; i < array.length; i++) {\r\n result[i] = temp;\r\n temp *= array[i];\r\n }\r\n\r\n temp = array[array.length - 1];\r\n\r\n for (let i = array.length - 2; i >= 0; i--) {\r\n result[i] = result[i] * temp;\r\n temp *= array[i];\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "3b14554f5c411d5f4869ca0eaf12070d", "score": "0.5834406", "text": "function productOfArray(arr) {\n if(arr.length === 0) return 1\n \n return arr[0] * productOfArray( arr.slice(1) );\n}", "title": "" }, { "docid": "f4e809ec5d1741d3afd11187def284cf", "score": "0.58283114", "text": "function printOneReturnOne(arr){\n var odd = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] % 2 !== 0){\n odd = arr[i];\n break;\n }\n }\n console.log(arr[arr.length-2]);\n return odd;\n}", "title": "" }, { "docid": "08d4ff7f7ed366cc643a172f62ad6e3a", "score": "0.581419", "text": "function veryOdd(arr){\n var newArray = [];\n for(var i=0; i<arr.length; i++){\n if(arr[i]%2){\n newArray.push(arr[i]);\n //newArray.push(num);\n }\n //newArray.push();\n }\n return newArray;\n}", "title": "" }, { "docid": "25c4c5f1eecb2efa2343698b3e468359", "score": "0.58136547", "text": "function arrayDouble (array){\n if (!array.length){\n return [];\n }\n else {\n array[0]=array[0]*2;\n return [array[0], ...arrayDouble(array.slice(1))];\n }\n}", "title": "" }, { "docid": "bb7289a19422747cebef86a0449e284f", "score": "0.58062655", "text": "function isItOdd(arr){\n return ((arr.length-1)%2 === 0)\n}", "title": "" }, { "docid": "837b8345d7f1c3fc3dcd5d4209f18cba", "score": "0.5796735", "text": "function getOdds(array){\n var oddNumbers = new Array();\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 === 0) {\n continue;\n } else {\n oddNumbers.push(array[i]);\n }\n }\n return oddNumbers;\n }", "title": "" }, { "docid": "5d4848f6761ea2a9026e1b51937b1a33", "score": "0.5796422", "text": "function singleNumber(arr) {\n arr = arr.sort((a,b) => a - b)\n\n let i = 0\n let j = 0\n\n while (j < arr.length) {\n if (arr[i] === arr[j]) {\n arr.splice(i, 2)\n }else{\n i += 1\n j += 1\n }\n }\n return arr\n}", "title": "" }, { "docid": "fbd6515a90b761116f0523da0646498a", "score": "0.57926375", "text": "function arrayConversion(inputArray) {\n\tlet flag = true;\n\tlet res = [...inputArray];\n\n\twhile (res.length !== 1) {\n\t\tif (flag) {\n\t\t\tres = getPairsSum(res);\n\t\t\tflag = false;\n\t\t} else {\n\t\t\tres = getPairsMul(res);\n\t\t\tflag = true;\n\t\t}\n\t}\n\n\treturn res;\n}", "title": "" }, { "docid": "5c20e6a89e484aade4b455d16b5a9a0e", "score": "0.5769008", "text": "function productOfArray(arr){\n if(arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "856ce6e668beaa3bd8966ac37e4e4599", "score": "0.57652116", "text": "function collectOddValues(arr) {\n let result = [];\n function helper(helperInput) {\n if (helperInput.length === 0) return;\n if (helperInput[0] % 2 !== 0) result.push(helperInput[0]);\n helper(helperInput.slice(1))\n }\n helper(arr);\n return result;\n}", "title": "" }, { "docid": "96a52b22f6f7e389aeac9ef28ec0143c", "score": "0.5765091", "text": "function doubleNumbers(arr){\n return arr.map(num=> num * 2);\n}", "title": "" }, { "docid": "7242811ed37e66182c11d34bf9457f05", "score": "0.57608646", "text": "function productOfArray(arr){\n if (arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "3f8256892e3ee25f079ecf6361b747f9", "score": "0.57513267", "text": "function productOfArray(arr){\n if(!arr) return 0;\n if(arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "127777d6e13605a06b426fdcf49af30f", "score": "0.5750403", "text": "function double(arr) {\n\n}", "title": "" }, { "docid": "23f5785792445ac6fe72738a496e8de2", "score": "0.5745527", "text": "function productOfArray(arr) {\n if (arr.length === 0) return 0;\n\n let product = 1;\n\n function helper(arr) {\n if (arr.length === 0) return product;\n product *= arr[0];\n return helper(arr.slice(1));\n }\n return helper(arr);\n}", "title": "" }, { "docid": "09348a030848bddfe0a784a9996f79cb", "score": "0.5742135", "text": "function double_vision(arr){\n newarr = [];\n for (var i = 0; i < arr.length; i++){\n newarr.push(arr[i] * 2);\n }\n return newarr;\n}", "title": "" }, { "docid": "db6f4250f9b426d8dfd267da25f7e9e3", "score": "0.5735056", "text": "function Array8(arr){\n for(var i = 0; i<arr.length; i++){\n if(i%2!==0){\n arr[i]+=1;\n }\n console.log(arr[i]);\n }\n return arr;\n}", "title": "" }, { "docid": "3b6f2a09c2d4122db012cff4518dc7a5", "score": "0.57342285", "text": "function oddLengths(arr) {\n arr = arr.map(str => str.length);\n return arr.filter(num => num % 2 === 1);\n}", "title": "" }, { "docid": "1ff7df7e7fdf016ce5c1da2d9ba0927e", "score": "0.57309747", "text": "function oddOrEven(array) {\n if (array.length >= 1) {\n var sum = array.reduce((a, n) => a + n)\n } else {\n return 'even'\n }\n\n if (sum % 2 === 0) {\n return 'even'\n } else {\n return 'odd'\n }\n}", "title": "" }, { "docid": "9f227954a643f9521666579da763af7c", "score": "0.5718012", "text": "function doubleTrouble(arr){\n newarr = []\n for (i=0; i<arr.length; i++) {\n newarr.push(arr[i]);\n newarr.push(arr[i]);\n }\n return newarr; \n}", "title": "" }, { "docid": "270fcbaaf05251d547b1a79c62699500", "score": "0.57178366", "text": "function doubleOddNumbers(arr){ //Listo\n return arr.filter(el => el%2 != 0).map(el => el * 2)\n}", "title": "" }, { "docid": "dfab8cac29dbae7e73ac7d4e70fc1fd2", "score": "0.5712711", "text": "function oddLengths(arr) {\n return arr.reduce(function(acc, elem) {\n if (elem.length % 2 !== 0) {\n acc.push(elem.length);\n }\n return acc;\n }, [])\n}", "title": "" }, { "docid": "ebc97161df279823fb734f6f63cfa955", "score": "0.57087", "text": "function equalizeArray(arr) {\r\n\t\r\n\t//ordenar\r\n\tarr.sort(sortNumber);\r\n var repsArr = [];\r\n \r\n //encontrar un array de repeticiones\r\n reps = 1;\r\n\tfor(var i = 0; i < arr.length ; i++){\r\n \r\n\t\tif(arr[i]==arr[i+1]&& i <arr.length)\r\n reps++;\r\n else{\r\n repsArr.push(reps);\r\n reps = 1;\r\n }\r\n\t}\r\n\t\r\n //encontrar el elemento maximo dentro de ese array: repMax\r\n var repMax = repsArr.reduce(findMax);\r\n\r\n\treturn arr.length - repMax;\r\n\r\n}", "title": "" }, { "docid": "e11d2a2bccffa41fd519a6f9020fe669", "score": "0.5694346", "text": "function oddOne(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] % 2 !== 0) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "e8a877037e7f7b07358a1a91a2560635", "score": "0.56916827", "text": "function returnOddArray() {\n var arreglo = []; //[1,3,5,7...,253,255]\n\n for (var i = 1; i <= 255; i += 2) { //i=1>3>5>7>9>11...>253>255>257\n arreglo.push(i);\n }\n //console.log(arreglo);//[1,3,5,7...,253,255]\n return arreglo\n\n}", "title": "" }, { "docid": "a217e7949f4a8f5b5c0025c12c6d6b22", "score": "0.5688281", "text": "function findOutliner(arr) {\n //if <0 - odd; >0 - even\n let arrType = {\n type: 0,\n };\n\n for (let i = 0; i < 2; i++) {\n if (arr[i] % 2 == 0) {\n arrType[\"type\"] = arrType[\"type\"] + 1;\n } else arrType[\"type\"] = arrType[\"type\"] - 1;\n }\n\n for (let j = 0; j < arr.length; j++) {\n if (arrType[\"type\"] > 0) {\n if (arr[j] % 2 != 0) {\n return arr[j];\n }\n } else {\n if (arr[j] % 2 == 0) {\n return arr[j];\n }\n }\n }\n return -1;\n}", "title": "" }, { "docid": "b89b343054e4905aae1a9c94c81fed10", "score": "0.5687126", "text": "function addOneToArray(arr) {\r\n\r\n let resultArr = [...arr];\r\n\r\n for (let i = resultArr.length - 1; i >= 0; i -= 1) {\r\n if (resultArr[i] !== 9) {\r\n resultArr[i] += 1;\r\n break;\r\n } else {\r\n resultArr[i] = 0;\r\n if (i === 0) {\r\n resultArr.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n return resultArr;\r\n}", "title": "" }, { "docid": "fa49b3cb16919080e492b2816419308d", "score": "0.56861293", "text": "function doubleOddNumbers(arr) {\n const newArr = arr.filter(function(num) {\n return num % 2 !== 0;\n }).map(function(item) {\n return item * 2;\n })\n return newArr;\n}", "title": "" }, { "docid": "77245c0df0cd99eb64541016873268d0", "score": "0.56829286", "text": "function superseder(arr) {\n\tlet result\n arr.forEach((e) => {\n if ((e || e === 0) && result === undefined) {\n result = e\n }\n })\n return result\n}", "title": "" }, { "docid": "696fa9ff13bfe230d9569edef05072bf", "score": "0.56804454", "text": "function squareEvenNumbers(array) {\n // TODO: Use at least 1 .reduce,\n // square ONLY the even numbers\n // & push the results into the return array\n return\n\n}", "title": "" }, { "docid": "3fac517ce0c8e3fec26c389df63df790", "score": "0.5679338", "text": "function arrayDouble(arr){\n //base case\n if(arr.length===0){\n return [];\n }\n\n //recursive\n return [arr[0]*2, ...arrayDouble(arr.slice(1))];\n}", "title": "" }, { "docid": "8efe4ec7ece1ae6325386fac71eee19e", "score": "0.5678806", "text": "function doubleTrouble(arr) {\n var newArr = [];\n for (let i = 0; i < arr.length; i++) {\n newArr.splice(arr[i]+1,0,arr[i]);\n i++;\n }\n return newArr;\n}", "title": "" }, { "docid": "c3bf58e586be9ec5c1c3234159a2413c", "score": "0.56755906", "text": "function isFinalNumberEven (array){\n return array[array.length-1] % 2 === 0;\n}", "title": "" }, { "docid": "260f798b37ad7e74fda4627b8378265a", "score": "0.5674177", "text": "function addOne(array) {\n var i=0;\n var array2=[];\n while(i<array.legnth){\n array2[i]=array[i]+1;\n i++;\n }\n return array2;\n}", "title": "" }, { "docid": "bc3a1f395a89937ba2e95551a6c3c646", "score": "0.5670154", "text": "function returnOddArray(){\n for(var i=1; i<255; i+=2) {\n console.log(i);\n }\n return i;\n }", "title": "" }, { "docid": "eb5303cd27adb0ab6e463562d5b4c646", "score": "0.5663808", "text": "function productOfArray(arr) {\n if(arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "edd947d7967c71834ba933406b03acae", "score": "0.5663416", "text": "function uniqueNum (arr) {\n\tvar unique = 0;\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tunique ^= arr[i];\n\t}\n\treturn unique;\n}", "title": "" }, { "docid": "de52dad89c26e94d430da854e23f3510", "score": "0.56604475", "text": "function printOneReturnAnother(arr) {\n var firstOdd = [];\n for (var i = 0; i <= a rr.length; i++) {\n if (i == a rr.length - 2) {\n console.log(arr[i]);\n }\n if (arr[i] % 2 == 1) {\n firstOdd.push(arr[i]);\n }\n if (firstOdd.length > 1) {\n firstOdd.pop();\n }\n }\n return firstOdd[0];\n}", "title": "" }, { "docid": "532f1c85153753a9c2a5654b6ed33c76", "score": "0.5656605", "text": "function productOfArray(arr){\n if(arr.length === 0) return 1;\n\treturn arr.shift() * productOfArray(arr);\n}", "title": "" }, { "docid": "070ecd5485d86090fd6c7c9365c9a952", "score": "0.56511813", "text": "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n // If there is only one element, the min. missing one will be one less\n if (A.length === 1) {\n if (A[0] < 1 ) return 1;\n if (A[0] === 1) return 2;\n return A[0] - 1;\n }\n \n // Sort the array\n A.sort(function(a, b){return a-b});\n \n var num1 = 0;\n var num2 = 0;\n \n // Find the first missing number starting with the second number\n for (i=0; i<A.length-1; i++) {\n \n // Skip all numbers that are < 1.\n if (A[i] < 0) continue;\n \n // We are either >= 1 at this point\n if (A[i] === 1 && i === A.length-1) return 2;\n \n num1 = A[i];\n num2 = A[i+1];\n \n// console.log(\"num1: \", num1, \"num2: \", num2);\n \n if (num2 - num1 > 1) {\n // We found the missing number\n return num1 + 1;\n }\n }\n \n return num2 + 1;\n\n}", "title": "" }, { "docid": "f2cbdd0edcd5ba47ac59b3f3ffbedda5", "score": "0.56452566", "text": "function almostIncreasingSequence(arr){\n\n}", "title": "" }, { "docid": "e2005a92f0b594374f6bdcb77da7e721", "score": "0.5644756", "text": "function oddArray(arr) {\n var odds = [];\n for (var i = 0; i<arr.length; i++){\n if (i%2 == 1)\n odds.push(i);\n }\n return odds;\n}", "title": "" }, { "docid": "aa34179280284da1f0ff1ef8e1eaa74f", "score": "0.56435287", "text": "function f(arr) {\n switch (true) {\n case Array.isArray(arr) != true:\n case arr.length !== 2:\n case typeof arr[0] != 'string':\n case typeof arr[1] != 'number':\n return undefined;\n break;\n case arr[1] < 1:\n return '';\n break;\n \n default:\n return arr[0].repeat(arr[1]);\n break;\n }\n}", "title": "" }, { "docid": "4ea3af118bd783c9dfc030a59cd83950", "score": "0.5643282", "text": "function cariModus(arr) {\n\n var arrModus = [];\n var iMixedNumber = 0;\n\n for (var i = 0; i < arr.length; i++) {\n for (var j = i + 1; j < arr.length; j++) {\n if (i !== j && arr[i] === arr[j]) {\n arrModus.push(arr[i]);\n } else {\n iMixedNumber++;\n }\n }\n }\n\n return (arrModus.length === 0 || iMixedNumber === 0) ? -1 : arrModus[0];\n}", "title": "" }, { "docid": "41076fa2f8ed4b68e88e7e692eeaa57f", "score": "0.5638124", "text": "function collectOddValuesFarhaan(arr) {\n let oddsArray = [];\n if (arr.length === 0) return oddsArray;\n if (arr[0] % 2 !== 0) oddsArray.push(arr[0])\n return oddsArray.concat(collectOddValuesFarhaan(arr.slice(1)));\n}", "title": "" }, { "docid": "a63962c3e9978fc6f452b9c3997a75f3", "score": "0.5637699", "text": "function printReturnAnother(array){\n console.log(secondToLastValue = array[array.length-1]);\n\n for(var i = 0; i < array.length; i++){\n if(array[i]%2 == 1){ // Find odd.\n return array[i]; // Return First Odd and terminate function.\n }\n }\n}", "title": "" }, { "docid": "035c7014eb69d250e1e30206bffd31a8", "score": "0.5634047", "text": "function productOfArray(arr) {\n if (arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.splice(1));\n}", "title": "" }, { "docid": "c3766ecac0ada91dfaaad1a746df7012", "score": "0.56322575", "text": "function productOfArray(arr) {\n // basecase: if the length of the array is 0, return everything back up\n if (arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "bf067f2b4d710a9c8dd1323ea4d6c91b", "score": "0.56316954", "text": "function double(array) {\n return array.map(n => n * 2);\n}", "title": "" }, { "docid": "4e893dd48de06bdfee6dda7a78315b1e", "score": "0.56301016", "text": "function createRandomNumber2(one,arrLength){\n\tlet randomNumber2=Math.floor(Math.random()*(arrLength));\n\tif(one===randomNumber2){\n\t\treturn createRandomNumber2(one,arrLength);\n\t}else{\n\t\treturn randomNumber2;\n\t}\n}", "title": "" }, { "docid": "0437745797a16b3aab6ac4f3699736f3", "score": "0.5628466", "text": "function productOfArray(arr) {\n if (arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "title": "" }, { "docid": "3dea2869470c592e1be68503aa7d6601", "score": "0.56275386", "text": "function firstTimesLast(array) {\n var result = null;\n\n if (array.length < 2) {\n return result;\n } else {\n result = array[0] * array[length-1];\n return result;\n }\n}", "title": "" }, { "docid": "7c04787c48b7c081ef9a28b349795346", "score": "0.562469", "text": "function EvenOdd(arr){\n var num = 0;\n for(var i = 0; i < arr.length; i++ ) {\n if( i % 2 == 0 )\n num += arr[i];\n else\n num *= arr[i];\n }\n\n return num;\n}", "title": "" } ]
fb3d45b28e2595ef83b2fba20d238453
_______________________________________________________ The Main Class. _______________________________________________________
[ { "docid": "b2e927e215746ee135cc04b3e0e3cb42", "score": "0.0", "text": "function TD() { \n \n var me = this;\n\n\n me.init = function() {\n me.objsCache();\n me.funcs();\n }\n \n }", "title": "" } ]
[ { "docid": "c2a7d244f4d992f39de67db83251f6a8", "score": "0.7312775", "text": "function Main(){}", "title": "" }, { "docid": "e3bd34d1c28426112f5c15c488f535a7", "score": "0.7251983", "text": "function _Main() {\n}", "title": "" }, { "docid": "c8eb13277c443e55ecfbdc4d32776610", "score": "0.7245208", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "c8eb13277c443e55ecfbdc4d32776610", "score": "0.7245208", "text": "function Main()\n {\n \n }", "title": "" }, { "docid": "9b49095cde8097b6c3fbbfc763f54e3c", "score": "0.7064288", "text": "function main() {\n \n }", "title": "" }, { "docid": "367bfc1f75c65636865ffa3ddee79f3e", "score": "0.7001446", "text": "function MAIN() {\n\n // You can print anything you want to The Console like this:\n console.log(\"Starting the application.\", \"Time is:\", Date())\n\n\n // The screen is blank! We need to show the first page.\n __________.show()\n\n\n // Add each meme in the above list to the thumbnail grid.\n __________.forEach( add_meme_thumbnail )\n\n\n // Now that everything's in place, let's listen for user actions\n // like clicking & typing...\n listen_for_user_actions()\n}", "title": "" }, { "docid": "7c5cfd73c702d4c287521fff57846697", "score": "0.68104136", "text": "function main () {\n //return box2();\n //return cover2().rotateY(180).translate([45,1.5,1.5]);\n //return lamp();\n //return lamp_side(); //return uselessBox();\n //return fanGrill80();\n //return clock();\n //return angle(); //17x9x40x1\n //return lipbox()\n //return sensorMagnet2()\n //return canyon()\n //return cableHolder()\n //return lego().scale(2.6);\n //return vasher()\n //return ring_cover()\n //return ring_button()\n //return sil()\n //return sil2()\n //return sil3()\n //return sil4()\n //return sil5()\n //return lampAround();\n //return cutCube();\n //return wireHolder();\n //return wireHolder2();\n //return wireHolder3();\n //return wireHolder4();\n //return mount1();\n //return ringInsert();\n //return tankGlassHolder();\n //return tankGlassHolder2();\n //return charger();\n //return wallHolder();\n //return stop1();\n //return cableHolder2();\n //return sil6()\n //return stopper()\n //return tubeConnector1()\n //return threadHolder()\n //return doorShim()\n //return knifeHandle()\n //return knifeHandle2()\n //return doorHolder()\n //return meshHolder()\n return table()\n}", "title": "" }, { "docid": "3c665442a1924539e7c9c707e93ee743", "score": "0.6766589", "text": "function main(){}", "title": "" }, { "docid": "1af315e6f86f552c8092031b696aa02c", "score": "0.6761642", "text": "function main() {\n Init();\n}", "title": "" }, { "docid": "0a264317b350477f81a21d80ba6948d6", "score": "0.6729252", "text": "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\t\t\thtmlModule.outputToContentDiv(\"Grading\");\n\t\t\t// Setup Form.\n\t\t\tgraderForm();\n\t\t}", "title": "" }, { "docid": "15a1a8cbfcea89ae0999d8a159b9c686", "score": "0.67025703", "text": "function MainAssistant() { }", "title": "" }, { "docid": "47bccdf70f038982e3286d012934f9ce", "score": "0.6661787", "text": "function main() {\n buildNav();\n navToggle();\n handleIntroScreen();\n watchForm();\n}", "title": "" }, { "docid": "a4c41c65ec58ca938be326f01ba635c8", "score": "0.6635661", "text": "main() {\n\t\tthis.Nav = new Nav(this);\n\t\tthis.FlashMessages = new FlashMessages(this);\n\t\t\n\t\tthis.Overlay = new Overlay(this, {\n\t\t\tcloseButtonIcon: '/icon/cross.svg',\n\t\t\tcloseButtonTitle: 'Close Overlay'\n\t\t});\n\t\t\n\t\t// this.Slider = new Slider(this);\n\t\tthis.LightBox = new LightBox(this, {\n\t\t\tselector: '#main img',\n\t\t\tprevTitle: 'zum vorherigem Bild',\n\t\t\tnextTitle: 'zum nächsten Bild',\n\t\t\tprevIcon: '/icon/chevron-left.svg',\n\t\t\tnextIcon: '/icon/chevron-right.svg'\n\t\t});\n\t\t\n\t\t// let lazyLoading = new LazyLoading();\n\t\t// lazyLoading.init();\n\t\t// let mapEl = document.querySelector('#map');\n\t\t// let map = new Map(mapEl);\n\t}", "title": "" }, { "docid": "69587aa096bd25d43cb51ce52a48c643", "score": "0.65718997", "text": "function main() {\n\t\t\thtmlModule = new htmlUtil(); // View creation / HTML logic\n\t\t\tarrModule = new arrMethods(); // Array Method shortcuts\n\t\t\tmsg = htmlModule.msg; // Logging\n\t\t\tmsg.set(\"Starting Module\");\n\t\t\thtmlModule.outputToContentDiv(\"Greatest Common Divisor\");\n\t\t\t// Setup Form.\n\t\t\tmathMinForm();\n\t\t}", "title": "" }, { "docid": "8e0d47c54af8e39572800bc9124ead10", "score": "0.65584195", "text": "initialize() { }", "title": "" }, { "docid": "8309a324742f48eba192b2219c45e813", "score": "0.65565", "text": "function Main() {\n console.log(`%c App Started...`, \"font-weight: bold; font-size: 20px;\");\n\n person.saysHello();\n console.log(person);\n\n\n student.studies();\n student.saysHello();\n console.log(student);\n }", "title": "" }, { "docid": "fb47070aef357f0c95de1182374763de", "score": "0.65366185", "text": "function main()\n{\n\tinit();\n\tloop();\n}", "title": "" }, { "docid": "fb47070aef357f0c95de1182374763de", "score": "0.65366185", "text": "function main()\n{\n\tinit();\n\tloop();\n}", "title": "" }, { "docid": "0c341903005ad9e94457a41d5d13d408", "score": "0.65363437", "text": "static main() {\n\n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.6519165", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "acaa54dd89e89b22700332ee8da032eb", "score": "0.64868057", "text": "function main()\r\n{\r\n \r\n}", "title": "" }, { "docid": "e3c6115869c0a5119fa949724923b037", "score": "0.64832735", "text": "function Main() {\n\n}", "title": "" }, { "docid": "3d0a436c439d34c0c516fea3d9d465e6", "score": "0.6478381", "text": "function main() {\n loadSettingsInPage();\n activateButtons();\n version();\n createIconDialog();\n}", "title": "" }, { "docid": "c387e0e78fb35da8b599689d3a92e909", "score": "0.64664096", "text": "function Main()\n\t\t{\n\t\t\t// Link Canvas\n\t\t\tcanvas = document.getElementById('HelloWorld');\n\t\t\tstage = new createjs.Stage(canvas);\n\t\t\tstage.mouseEventsEnabled = true; //mouse events are disabled by default\n\n\t\t\t// // Load GFX\n\t\t\t\n\t\t\tbgSrc.src = 'bg.png';\n\t\t\tbgSrc.name = 'bg';\n\t\t\tbgSrc.onload = loadGfx;\n\n\t\t\tbtnSrc.src = 'button.png';\n\t\t\tbtnSrc.name = 'button';\n\t\t\tbtnSrc.onload = loadGfx;\n\n\t\t\t\n\n\t\t\t// Ticker\n\t\t\tcreatejs.Ticker.setFPS(30);\n\t\t\tcreatejs.Ticker.addListener(stage);\n\t\t}", "title": "" }, { "docid": "744740849c3291854317861045079b73", "score": "0.6459124", "text": "function main(){\n\n\t// Tell player to start the game by pressing Enter\n\tdisplayPressEnter();\n\n\t// Getting necessary HTML elements-------------------------\n\tfruit = document.querySelector(\".fruit\");\n\tscore = document.querySelector(\".score\");\n\n\t// Stadium Creation\n\tcreateStadium(true);\n\n\t// Snake Creation\n\tsnake = new Snake();\n\n\t// Setting fruit at random position\n\tresetFruit();\n}", "title": "" }, { "docid": "17d0417ab813677287884e49870f11c3", "score": "0.64460623", "text": "function _run() {\n \n }", "title": "" }, { "docid": "b8fe7febd04478ab53175e6f8220078e", "score": "0.64346975", "text": "function main() {\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEntry(slideEls[currentSlideNumber], false)\n\n // Specific slide preparations\n prepareFillLoupe()\n underlinePlaygroundPosition({ target: document.querySelector('#upo-p') })\n underlinePlaygroundSize({ target: document.querySelector('#upo-s') })\n underlinePlaygroundClearing({ target: document.querySelector('#upo-c') })\n underlinePlaygroundOpacity({ target: document.querySelector('#upo-o') })\n document.querySelectorAll('label').forEach(function(el) { el.classList.remove('visible') })\n\n // Slide manipulation\n hyphenateSlides()\n setUpBetterPunctuation()\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "title": "" }, { "docid": "607669615ad4faf3f35b651455fb8eff", "score": "0.64239675", "text": "function Main() {\n this.onStoryParsed = __bind(this.onStoryParsed, this);\n\n this.addEventListeners = __bind(this.addEventListeners, this);\n\n this.addClasses = __bind(this.addClasses, this);\n\n this.initialise = __bind(this.initialise, this);\n this.$html = $('html');\n this.$body = $('body');\n this.$content = this.$body.find('#content');\n this.$splashscreen = this.$content.find('#splashscreen');\n this.$selection = this.$content.find('#selection');\n this.$story = this.$content.find('#story');\n return;\n }", "title": "" }, { "docid": "af7efdc31f0dc82475d299f4f5f0e03c", "score": "0.6408484", "text": "function main() {\n windowSetup();\n canvasSetup();\n currentState = states.Splash;\n document.body.appendChild(canvas);\n mech = new Mech();\n ships = new ShipsCollection();\n loadGraphics();\n}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6393414", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6393414", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6393414", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6393414", "text": "init() { }", "title": "" }, { "docid": "4b4f7a59eaa512ebe6d9772fb1a5de16", "score": "0.63653475", "text": "function Main() {\n console.log(`%c App Started...`, \"font-weight: bold; font-size: 20px;\");\n\n myObject.name = \"Tom\";\n myObject.age = 49;\n\n console.log(myObject);\n }", "title": "" }, { "docid": "79b83d3c87c69b566112b3623eff22e8", "score": "0.63652736", "text": "constructor() {\n super(\"main\");\n }", "title": "" }, { "docid": "10d5627078b78749ec09d72a3aae1520", "score": "0.636409", "text": "function() {\n\t\t//...\n\t}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.63605565", "text": "init () {}", "title": "" }, { "docid": "94148ddab6844950bbc231991dc195c3", "score": "0.63558733", "text": "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "title": "" }, { "docid": "0ed0cbc3ea0290ab30008c94fe7e9c9d", "score": "0.63475037", "text": "function main(){\n\tlog('Info: main(): start');\n\t//ncurses_test();\n\tdukglue_test();\n\tlog('Info: main(): end');\n\treturn 0;\n}", "title": "" }, { "docid": "5f79e3e6029038b568219de138ebda84", "score": "0.6339968", "text": "init(){\n \n\t}", "title": "" }, { "docid": "0186459e4ce622a72f71947a8077227c", "score": "0.63393486", "text": "init() {\n\n\t}", "title": "" }, { "docid": "351b65e3fac317f6ee23d29a3966fced", "score": "0.63369465", "text": "static main() {\n console.log(\">> main() ... :D \");\n //init game engine\n src_1.MfgInit.init();\n }", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.6330057", "text": "function init() { \n \n }", "title": "" }, { "docid": "94d3d74f39231d7112728b8ab0033b38", "score": "0.632504", "text": "constructor (){\n\n \n }", "title": "" }, { "docid": "a7dc535b91b1b2976a59977b2f252758", "score": "0.6319418", "text": "run(){\n\n\t}", "title": "" }, { "docid": "b3ecfed1f967fcf4ff361fd11922b9c8", "score": "0.6316075", "text": "function main() {\n\tlog.verbose( 'main', 'Begin' );\n\tui.init({main: Notification});\n}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6309362", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6309362", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6309362", "text": "initialize() {}", "title": "" }, { "docid": "3a170805528ca260f83227edf510daba", "score": "0.6299629", "text": "startup() {\n }", "title": "" }, { "docid": "719460288789946d4e983416097cd49a", "score": "0.62962574", "text": "function main() {\n init();\n enable();\n}", "title": "" }, { "docid": "16af8b75f143e5b423c2770ede961ef1", "score": "0.62931323", "text": "initialize () {\n\n }", "title": "" }, { "docid": "69f19fdb030299e98649fb480ae56d13", "score": "0.62890136", "text": "function Main(params) {\n\n}", "title": "" }, { "docid": "6fc191f083cce210c9c13f641fc7679b", "score": "0.6283689", "text": "function main() {\n drawMap();\n setupKeyboardControls();\n }", "title": "" }, { "docid": "9958bf2f52c8e4d77f99d0e2a6529b9b", "score": "0.62777865", "text": "function Main() {\n this.sub = new Subscriber_1.Subscriber();\n //this.server = new Server();\n this.sub.subscribe(Publisher_1.Publisher.getInstance());\n var msg = new TextMessage_1.TextMessage('Yo');\n Publisher_1.Publisher.getInstance().publish(msg);\n this.sub.receive().forEach(function (message) {\n console.log(message.content());\n });\n /*this.socket=new Socket(this.server.listen());\n this.socket.connect(Publisher.getInstance());*/\n }", "title": "" }, { "docid": "1f8951dc8e007d65f8c777090e63e67b", "score": "0.62770534", "text": "constructor( ) {\n }", "title": "" }, { "docid": "e3d7f19a35361f4985dd0007c6c6cd92", "score": "0.62730885", "text": "function main () {\n initialise (); // initialise\n render (); // draw geometry\n}", "title": "" }, { "docid": "982de72d44cfa72344073601362581c8", "score": "0.62681395", "text": "async main() {\n \n //May be call some other function Configs, \n //for example to init socket.io, DataBase ORM or View Engine\n\n hbs.registerPartials();\n //hbs.registerHelpers();\n\n this.configureServer();\n let start = await this.startServer(this.buildServer());\n console.log(start);\n }", "title": "" }, { "docid": "c1586d6bae3a6b8251caedbe062877af", "score": "0.6253423", "text": "function main() {\n disableDef();\n eventing();\n }", "title": "" }, { "docid": "4529a8bfb383074a93277ab50f7fd222", "score": "0.62512124", "text": "main() {\r\n\t\t\tconst self = this;\r\n\t\t\tif (this.introVideo && this.introText) {\r\n\t\t\t\tconsole.log(\"MAIN: initialized\");\r\n\t\t\t\tRuvenCore.body.addClass(\"app-loaded\");\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.projects();\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "be2f3b271b107e9b7c7a76fe27c80263", "score": "0.62457705", "text": "function main() {\n setupWebGL(); // set up the webGL environment\n setupShaders(); // setup the webGL shaders\n\n gl.viewport(0,0,gl.viewportWidth,gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n //loadTriangles(); // load in the triangles from tri file\n //loadSpheres(); // load in the triangles from spheres file\n\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n} // end main", "title": "" }, { "docid": "e41961eb0d33a22e2029d337524db497", "score": "0.6244885", "text": "function main(){\n \n}", "title": "" }, { "docid": "bce1e1a5ea7fb2211f0ee1cf3b4c265b", "score": "0.62400275", "text": "function main() {\n\t//Esta funcion se realizara al momento que la pagina completa haya cargado\n\tbutton();\n\tpreloadImages();\n}", "title": "" }, { "docid": "57002a9f277ef3266bce806676f61157", "score": "0.62308323", "text": "function main(){\n goRunning();\n \n }", "title": "" }, { "docid": "d0aeefb911b332a7ed00581e99fcfaf3", "score": "0.62165546", "text": "function main() {\n windowSetup();\n canvasSetup();\n currentState = states.Splash; // Game begins at the splash screen.\n document.body.appendChild(canvas); // Append the canvas we've created to the body element in our HTML document.\n bird = new Bird();\n corals = new CoralCollection();\n boom = new Boom();\n thud = new sound(\"sound/thud.wav\");\n thudPlay = 0;\n loadGraphics();\n}", "title": "" }, { "docid": "853548d594fb5b059ba015bc88182f29", "score": "0.62140024", "text": "function main() {\n start();\n}", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.6201471", "text": "initialize() {\n\n }", "title": "" } ]
41fd092411b7bf494aa9b57f145f500a
Array compacting. Copyright LoDash. MIT License:
[ { "docid": "f1d18b16260ba60e05d46b35a2600993", "score": "0.6743185", "text": "function compactSparseArray(array) {\r\n\t\t\tvar index = -1,\r\n\t\t\t\t\tlength = array ? array.length : 0,\r\n\t\t\t\t\tresult = [];\r\n\r\n\t\t\twhile (++index < length) {\r\n\t\t\t\tvar value = array[index];\r\n\r\n\t\t\t\tif (value) {\r\n\t\t\t\t\tresult.push(value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}", "title": "" } ]
[ { "docid": "e696f6c6136d6ab50086ed01389fb7c0", "score": "0.8137404", "text": "static compact(arr) {\r\n return Arrays.compact(arr)\r\n }", "title": "" }, { "docid": "f8a7c8682c75906abcc1be773b0342e1", "score": "0.7776863", "text": "function compact(array) {\n var result;\n if (array) {\n for (var i = 0; i < array.length; i++) {\n var v = array[i];\n if (result || !v) {\n if (!result) {\n result = array.slice(0, i);\n }\n if (v) {\n result.push(v);\n }\n }\n }\n }\n return result || array;\n }", "title": "" }, { "docid": "6013614d1d70f373be6bc8b2be14bf73", "score": "0.75186676", "text": "function compact(arr) {\r\n return arr.filter((ele) => !!ele);\r\n}", "title": "" }, { "docid": "b8eb09e209623f6a404619c0dc69bb68", "score": "0.7419377", "text": "function _compact(arr) {\n return _.chain(arr).map(function(item) {\n if (item === '') { return '\"\"'; }\n return item;\n }).filter(function(item) {\n if (item === 0) { return true; }\n if (item === '') { return true; }\n\n return item;\n }).value();\n}", "title": "" }, { "docid": "cdcb3a0338c0256da7556adb0c456096", "score": "0.721091", "text": "function compact(array) {\n\t return filter(array, Boolean);\n\t }", "title": "" }, { "docid": "cdcb3a0338c0256da7556adb0c456096", "score": "0.721091", "text": "function compact(array) {\n\t return filter(array, Boolean);\n\t }", "title": "" }, { "docid": "1bbae051681de16dd188705461f24f58", "score": "0.70260274", "text": "function compact(array) {\n return filter(array, Boolean);\n }", "title": "" }, { "docid": "1bbae051681de16dd188705461f24f58", "score": "0.70260274", "text": "function compact(array) {\n return filter(array, Boolean);\n }", "title": "" }, { "docid": "1bbae051681de16dd188705461f24f58", "score": "0.70260274", "text": "function compact(array) {\n return filter(array, Boolean);\n }", "title": "" }, { "docid": "1bbae051681de16dd188705461f24f58", "score": "0.70260274", "text": "function compact(array) {\n return filter(array, Boolean);\n }", "title": "" }, { "docid": "1bbae051681de16dd188705461f24f58", "score": "0.70260274", "text": "function compact(array) {\n return filter(array, Boolean);\n }", "title": "" }, { "docid": "c6f561c9a715692067bf4fb8c329ac07", "score": "0.6999765", "text": "function compact(array) {\n return filter(array, Boolean);\n}", "title": "" }, { "docid": "a559659c952b835ad1f0506944f7a5e9", "score": "0.67509586", "text": "function compact(array) {\n return (0,_filter_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(array, Boolean);\n}", "title": "" }, { "docid": "8b1117b522fb0aa774406a36f2eea559", "score": "0.6739418", "text": "function compactSparseArray(array) {\r\n\t\t\t\tvar index = -1,\r\n\t\t\t\t\t\tlength = array ? array.length : 0,\r\n\t\t\t\t\t\tresult = [];\r\n\r\n\t\t\t\twhile (++index < length) {\r\n\t\t\t\t\tvar value = array[index];\r\n\r\n\t\t\t\t\tif (value) {\r\n\t\t\t\t\t\tresult.push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}", "title": "" }, { "docid": "aefae6d3ca25272e50f7b195eecee5ab", "score": "0.6716792", "text": "function compact(array) {\n return Object(_filter_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(array, Boolean);\n}", "title": "" }, { "docid": "a08622c8a869bdeaf5ccd26a3b82a0d7", "score": "0.6688756", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t length = array ? array.length : 0,\n\t\t\t result = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "cff854ce4c095304ba42f8556fbaa685", "score": "0.6686489", "text": "function compactSparseArray(array) {\n\t\t\t\tvar index = -1,\n\t\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\t\tresult = [];\n\n\t\t\t\twhile (++index < length) {\n\t\t\t\t\tvar value = array[index];\n\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\tresult.push(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}", "title": "" }, { "docid": "edfdf35e9631b2a64c55baff5a25824c", "score": "0.6680103", "text": "function compactSparseArray (array) {\n\t var index = -1,\n\t length = array ? array.length : 0,\n\t result = [];\n\t\n\t while (++index < length) {\n\t var value = array[index];\n\t\n\t if (value) {\n\t result.push(value);\n\t }\n\t }\n\t\n\t return result;\n\t }", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "45ee638d30518224ae028d7a27cc2b94", "score": "0.66643566", "text": "function compactSparseArray(array) {\n\t\t\tvar index = -1,\n\t\t\t\t\tlength = array ? array.length : 0,\n\t\t\t\t\tresult = [];\n\n\t\t\twhile (++index < length) {\n\t\t\t\tvar value = array[index];\n\n\t\t\t\tif (value) {\n\t\t\t\t\tresult.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "216f50125034c1e4f9771eaa616fe9d1", "score": "0.6610187", "text": "function compact() {\n return this.filter(function (x) { return !!x; });\n}", "title": "" }, { "docid": "60aae09a4d6fe2936e8a87c3eeb09ef0", "score": "0.65788734", "text": "function compactSparseArray (array) {\n\t var index = -1,\n\t length = array ? array.length : 0,\n\t result = [];\n\n\t while (++index < length) {\n\t var value = array[index];\n\n\t if (value) {\n\t result.push(value);\n\t }\n\t }\n\n\t return result;\n\t }", "title": "" }, { "docid": "d835df52f749fa0da0bce54ba5b456ec", "score": "0.6552824", "text": "function compactSparseArray(array) {\n var index = -1,\n length = array ? array.length : 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (value) {\n result.push(value);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "8753b1ff85adf74d04b2ca4ed1038dbb", "score": "0.6522468", "text": "function compactSparseArray (array) {\n var index = -1,\n length = array ? array.length : 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (value) {\n result.push(value);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "8753b1ff85adf74d04b2ca4ed1038dbb", "score": "0.6522468", "text": "function compactSparseArray (array) {\n var index = -1,\n length = array ? array.length : 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (value) {\n result.push(value);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "8753b1ff85adf74d04b2ca4ed1038dbb", "score": "0.6522468", "text": "function compactSparseArray (array) {\n var index = -1,\n length = array ? array.length : 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (value) {\n result.push(value);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "802a6e343b371f20b9723622207a38bb", "score": "0.6495043", "text": "function consolidate(array) {\n return array.map(trim)\n}", "title": "" }, { "docid": "479de1840e9d0cef0786658c10fa13cb", "score": "0.6414474", "text": "function compaction(array){\n\n\tvar pos=0;\n\tfor (var i = 0; i < array.length-1; i++) {\n\t\tpos=i;\n\t\t\n\t\twhile(pos!=array.length){\n\n\t\t\tif(array[i]==array[pos+1]){\n\n\t\t\t\tarray=slice_array(array,0,pos+1) + slice_array(array,pos+2,array.length);\n\t\t\t\t--pos;\n\t\t\t}\n\n\t\t\tpos++;\n\t\t}\t\n\t}\n\n\treturn array;\n}", "title": "" }, { "docid": "cd09ef6469311daf1cb970bfe2ef1083", "score": "0.64043164", "text": "function compactArray(arr) {\n\t\t///<summary>\n\t\t/// Converts int[] into Object[], \n\t\t/// seqences of incremented ints [i,i+1,i+2] are converted to range object R(i,i+2)\n\t\t///</summary>\n\t\t// java code by zdenko capik (js rewrite)\n\t\tasrt(arr != null, \"Illegal Argument\");\n\n\t\tif (arr.length == 0) return [];\n\t\tarr = arr.slice(0);\n\t\tarr.sort(function(a, b) { return a - b; });\n\n\t\tvar TRESHOLD = 1,\n\t\t\tret = [],\n\t\t\tfirst = arr[0],\n\t\t\tlast = arr[0],\n\t\t\tready = false,\n\t\t\ti, j, l = arr.length, l1 = l - 1;\n\n\t\tfor (i = 0; i < l; i++) {\n\t\t\tif (arr[i] == (last + 1) || arr[i] == last) {\n\t\t\t\tlast = arr[i];\n\t\t\t\tready = false;\n\t\t\t} else {\n\t\t\t\tready = true;\n\t\t\t}\n\t\t\tif (ready || i == l1) {\n\t\t\t\tif (last > first) {\n\t\t\t\t\tif (last - first > TRESHOLD)\n\t\t\t\t\t\tret.push(R(first, last));\n\t\t\t\t\telse\n\t\t\t\t\t\tfor (j = first; j <= last; j++) ret.push(j);\n\t\t\t\t} else {\n\t\t\t\t\tret.push(last);\n\t\t\t\t}\n\n\t\t\t\tif (i == l1 && arr[i] != last) {\n\t\t\t\t\tret.push(arr[i]);\n\t\t\t\t}\n\t\t\t\tfirst = arr[i];\n\t\t\t\tlast = arr[i];\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "e39a92191303d2f1ed23182bd58365cf", "score": "0.634538", "text": "function flatten(arr){\n\n}", "title": "" }, { "docid": "046e8442f1ec0d325e5681b2b9fc58b2", "score": "0.63323665", "text": "function shortarr(arr1){\r\n\treturn (arr1.filter((item,index) => {return !arr1.includes(item,index+1)}))\r\n}", "title": "" }, { "docid": "2b605dcaaaba630a0472c011f0640e8c", "score": "0.6331971", "text": "function compact(fa) {\n return collect(x => x)(fa);\n}", "title": "" }, { "docid": "9e3b9d6caf411bbd3a81d269f97fc793", "score": "0.6323349", "text": "function compact(address, slice) {\n var s1 = [];\n var s2 = [];\n var i;\n for (i = 0; i < address.length; i++) {\n if (i < slice[0]) {\n s1.push(address[i]);\n }\n else if (i > slice[1]) {\n s2.push(address[i]);\n }\n }\n return s1.concat(['compact']).concat(s2);\n}", "title": "" }, { "docid": "ed7fe0031b4bf8e30ee77d0fd8e298cd", "score": "0.6320344", "text": "function removeNullsFromArray(arr) {\n var arr1 = arr;\n for (var k in arr1) {\n arr1[k] = removeNulls(arr1[k]);\n }\n return arr1;\n}", "title": "" }, { "docid": "05c40c8c3eed8e66e17f55fc884c3da8", "score": "0.6292224", "text": "function flattenArray(arrays) {}", "title": "" }, { "docid": "c14ad432762b438b19f1a69013d617c1", "score": "0.6281052", "text": "flattenArray(data) {\n for (let i = 0, l = data.length; i < l; i++) {\n if (Array.isArray(data[i]) && Array.isArray(data[i][0])) {\n let frag = data.splice(i, 1)[0];\n for (let index = frag.length; index--;) data.splice(i, 0, frag[index]);\n i--;\n l = data.length;\n continue;\n }\n }\n }", "title": "" }, { "docid": "4e5629ed54783175a42707c2d1bd404b", "score": "0.62670296", "text": "static flatten(arr) {\n return Array.prototype.concat(...arr).filter(x => x);\n }", "title": "" }, { "docid": "4e5629ed54783175a42707c2d1bd404b", "score": "0.62670296", "text": "static flatten(arr) {\n return Array.prototype.concat(...arr).filter(x => x);\n }", "title": "" }, { "docid": "4e5629ed54783175a42707c2d1bd404b", "score": "0.62670296", "text": "static flatten(arr) {\n return Array.prototype.concat(...arr).filter(x => x);\n }", "title": "" }, { "docid": "14fbb698077fd3b365d29f5dcd3bf640", "score": "0.62658143", "text": "function cleanArray(array) {\n\tarray = array.filter(n=>n);\n\t// fix indexes\n\tfor (var i = 0; i < array.length; i++) {\n\t\tarray[i].arrayIndex = i;\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "5846c49adbf272b768ebdaa4c3b05502", "score": "0.6261972", "text": "function compact (address, slice) {\n var s1 = [];\n var s2 = [];\n var i;\n\n for (i = 0; i < address.length; i++) {\n if (i < slice[0]) {\n s1.push(address[i]);\n } else if (i > slice[1]) {\n s2.push(address[i]);\n }\n }\n\n return s1.concat(['compact']).concat(s2);\n}", "title": "" }, { "docid": "2c3062c0a1e1eca425e7933d382293ea", "score": "0.6252499", "text": "function compact(array, callback) { //* ----- FUNCTION DECLARATION *\n const newArray = [];\n\n for (let value of array) {\n // console.log(Boolean(value));\n\n // if (Boolean(value)) newArray.push(value);\n callback(value, newArray);\n };\n\n return newArray;\n}", "title": "" }, { "docid": "a4ba21b44e063de5b98bb000bbfb94dc", "score": "0.62524426", "text": "function compact(address, slice) {\n var s1 = [];\n var s2 = [];\n var i;\n\n for (i = 0; i < address.length; i++) {\n if (i < slice[0]) {\n s1.push(address[i]);\n } else if (i > slice[1]) {\n s2.push(address[i]);\n }\n }\n\n return s1.concat(['compact']).concat(s2);\n}", "title": "" }, { "docid": "2b0f2bea038f6fdfd50641ba98193623", "score": "0.614432", "text": "function arrayFlattener(arr) {\r\n const arr1 = arr;\r\n\r\n return arr1.flat();\r\n\r\n}", "title": "" }, { "docid": "1366252533ab713de46f0dac6634186c", "score": "0.61155516", "text": "flatten(arr) {\n return arr.reduce((a, e) => a.concat(e instanceof Array ? Util.flatten(e) : e), []);\n }", "title": "" }, { "docid": "8caaf857839b12515d38ab73f93d3e56", "score": "0.6093596", "text": "function convertArray(){\n var arr = new Array();\n\n for(let i=0; i<7; i++){\n let l = collect[i+1].length;\n let t = new Array();\n\n for(let j=0; j<(7-l); j++)\n t.push(\" \");\n \n for(j = 0; j<l-1; j++){\n t.push(collect[i+1][j]);\n }\n arr[i] = t;\n }\n\n return zip(arr); \n}", "title": "" }, { "docid": "bb64d033c43abf437bf15aceee576759", "score": "0.6075875", "text": "function transformacionCompletaDelArray(array) {\n\tarray = vaciarPapelera(array);\n\tarray = agruparElementos(array);\n\tarray = ponerBonitasLasLetras(array);\n\tarray = ponerBonitosLosNumeros(array);\n//\tarray = ordenarArray(array);\n\tarray = arrayToString(array);\n\n\treturn array;\n}", "title": "" }, { "docid": "e1980f69f8e133e0002b17d64c2a24cc", "score": "0.60653824", "text": "function flatTwoDimensionalArray(array) {\n var result = [];\n \n array.forEach(function(internalArray) {\n internalArray.forEach(function(value) {\n if (!valueIncluded(value, result)) {\n result.push(value);\n }\n });\n });\n \n return result;\n}", "title": "" }, { "docid": "2439ebf3f3b4974c1fbaf8fe7f9c8bf5", "score": "0.6055913", "text": "function arrayRemover(array, index, count) {\n for (let i = index; i < (index+count); i++) {\n array[i] = '';\n }\n let dump = [];\n for (let j = 0; j < array.length; j++) {\n if (array[j] !== '')\n dump.push(array[j])\n }\n return dump;\n}", "title": "" }, { "docid": "3bee59c9fd50ea7c24d760b4499dbdf0", "score": "0.605252", "text": "function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}", "title": "" }, { "docid": "d8500805132191bca5f3e1a5db47ccaa", "score": "0.60516286", "text": "function takeOut(array2) {\n\n let cleanArray = [];\n let count = 0;\n\n\n for (let i = 0; i < array2.length; i++) {\n if (array2[i] !== null && typeof array2[i] == 'number') {\n cleanArray[count] = array2[i];\n count++;\n }\n }\n\n return cleanArray;\n}", "title": "" }, { "docid": "6069ffd951d9872225da4c88696552dc", "score": "0.6039136", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n }", "title": "" }, { "docid": "ae59b021520c5f12831e376b4c724a8b", "score": "0.6036232", "text": "function flatten(arr) {\t\t\n\treturn [].concat(...arr) \n}", "title": "" }, { "docid": "3fdf20f3275e82fe8dea54b753972acb", "score": "0.60323995", "text": "function arrayAwesomenator( array ) \r\n{\r\n\tarray = deleteRubbish( array );\r\n\tarray = arrangeElements( array );\r\n\tarray = beautifyLetters( array );\r\n\tarray = beautifyNumbers( array );\r\n\tarray = sortArray( array );\r\n\tarray = arrayToString( array );\r\n\r\n\treturn array;\r\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "9db99eeb1a94906624847e52719cb11a", "score": "0.5998025", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n}", "title": "" }, { "docid": "5021cf4e78ab093b2750807312478a95", "score": "0.5980178", "text": "function flatten(arr) {\r\n return arr.reduce(function (){\r\n var array = []\r\n return array.concat.apply([],arr)\r\n\r\n },[])\r\n\r\n}", "title": "" }, { "docid": "73e801a43f9c681e08390a53d5ca4dcc", "score": "0.59763736", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n }", "title": "" }, { "docid": "73e801a43f9c681e08390a53d5ca4dcc", "score": "0.59763736", "text": "function flatten(arr) {\n return Array.prototype.concat.apply([], arr);\n }", "title": "" }, { "docid": "01a4ecac051e7ca9a23b7c3695dc52f7", "score": "0.5974908", "text": "function qArrayOptimzer (arr) {\n // Temporarily stores the optimzed array\n const tempArr = []\n let counter = 0\n for (let i = 1; i <= 114; i++) {\n if (!tempArr[i - 1]) { tempArr[i - 1] = [] }\n for (let j = 1; j <= chaplength[i - 1]; j++) {\n tempArr[i - 1][j - 1] = arr[counter++]\n }\n }\n return tempArr\n}", "title": "" }, { "docid": "27352ad48c31faa13f3b33779dfb49f9", "score": "0.5962788", "text": "function cleanSet(arr) {\n return Array.from(new Set(arr))\n}", "title": "" }, { "docid": "38bdbaaaecaf6c9921a473bfd71f0aba", "score": "0.5949035", "text": "function flatten(arr) {\n return [].concat.apply([], arr);\n}", "title": "" }, { "docid": "38bdbaaaecaf6c9921a473bfd71f0aba", "score": "0.5949035", "text": "function flatten(arr) {\n return [].concat.apply([], arr);\n}", "title": "" }, { "docid": "e9019407367d51d036d2a045e8c72f9a", "score": "0.59337735", "text": "function makeItClean(arr){\n\tvar conArr = arr[0].concat(arr[1], arr[2]);\n\tconArr.sort();\n\tvar res = [conArr[0]]; \n for (var i = 1; i < conArr.length; i++) {\n if (conArr[i] != conArr[i-1]) {\n res.push(conArr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "3d0eacc6035af53bbe8bb0eb3e216503", "score": "0.5920973", "text": "function flatten(array) {\n return concat.apply([], array);\n}", "title": "" }, { "docid": "b80ef320a851d1a388095daccb850c9c", "score": "0.5914254", "text": "function removeBlankValues(array) {\n\t\tvar splicedArray = array.slice(0);\n\t\twhile (splicedArray.indexOf(\"\") !== -1) {\n\t\t\tvar index = splicedArray.indexOf(\"\");\n\t\t\tsplicedArray.splice(index, 1);\n\t\t}\n\t\t\n\t\treturn splicedArray;\n\t}", "title": "" }, { "docid": "da9fe334cf8574959c50195415e2271b", "score": "0.59091264", "text": "array_only(a,ks){ let b = jQuery.extend(true, {}, a); for(let k in a) { if (ks.indexOf(k) === -1) delete b[k]; } return b; }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "ea96c4dcf7f8a34c3f7450000abb18f3", "score": "0.5899034", "text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "title": "" }, { "docid": "81739d6e82d2271fb23268576970cadb", "score": "0.5894628", "text": "function consolidate(array) {\n return array.map(trim).join(' ')\n}", "title": "" }, { "docid": "c51f99dc4ce33c3021fd821edcbffaa8", "score": "0.5852518", "text": "function eliminaDuplicados(arr) {\n\tarr = [...new Set(arr)];\n\treturn arr\n}", "title": "" }, { "docid": "9a20866859dcd998b4cea9e52a8d626d", "score": "0.5845334", "text": "function utilArrayFlatten(a) {\n\t return a.reduce(function (acc, val) {\n\t return acc.concat(val);\n\t }, []);\n\t} // Groups the items of the Array according to the given key", "title": "" }, { "docid": "b86c0527d30d873f2b62aa6d80e02bc8", "score": "0.5838477", "text": "function filterOutFalsy(arr) {\n var newArray = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (!arr[i]) {\n\n continue;\n } else {\n\n newArray[newArray.length] = arr[i];\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "5b028355fd05d6e9ecc7efae0493ea85", "score": "0.5832747", "text": "stripFromDuplicates(arr) {\n const strippedArray = arr.reduce((x, y) => x.includes(y) ? x : [...x, y], []);\n return strippedArray;\n }", "title": "" }, { "docid": "17f36ee4782f360d187a2665bf1c3389", "score": "0.5823434", "text": "function uniteUnique(arr) {\n\t return arr;\n\t}", "title": "" }, { "docid": "17d91c1c84e046596a683918fcc19e57", "score": "0.5823418", "text": "function dedup(array) {\n \nvar newArray = [...new Set(array)];\nreturn newArray;\n\n}", "title": "" }, { "docid": "ae8fd2b6b44536aaee9aa18f4dff0739", "score": "0.580836", "text": "function noonerize(numbers) {\n let [a, b] = [numbers[0].toString(), numbers[1].toString()];\n let tempArr = [[b[0] + a.slice(1)], \n [a[0] + b.slice(1)]];\n console.log(tempArr)\n }", "title": "" }, { "docid": "b79670791f5e5c11e88a14ddfdec1495", "score": "0.5807682", "text": "function steamrollArray(arr) {\r\n return arr.flat(Infinity);\r\n }", "title": "" }, { "docid": "2a2ad6290fa61280f7d3016ec8b0e8ea", "score": "0.58067346", "text": "function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}", "title": "" }, { "docid": "ec98f226edeaa1b09dd02a0cd6271245", "score": "0.58060884", "text": "function remove_duplicates_es6(arr) {\n let s = new Set(arr);\n let it = s.values();\n return Array.from(it);\n }", "title": "" } ]
ca52d5241ef95cb2554b6c9d4dc3d70a
Displays checkmark while runFiller() is running
[ { "docid": "5d0ca3f6db23e6853b9530de8b453da0", "score": "0.0", "text": "function applied(){\n let appliedOverlay = document.createElement('div');\n appliedOverlay.id = \"appliedOverlay\";\n appliedOverlay.style = `\n height: 100vh;\n width: 100vw;\n z-index: 99;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.50);\n `\n appliedOverlay.innerHTML = `\n <img src=\"${chrome.runtime.getURL(\"images/checkmark.gif\")}\" style=\"display: block; margin-left: auto; margin-right: auto; margin-top: 100vh;\">`;\n document.getElementsByClassName('accordion-outer-wrapper')[0].prepend(appliedOverlay);\n setTimeout(function(){\n document.getElementById(\"appliedOverlay\").style.visibility = \"hidden\";\n }, 2500);\n}", "title": "" } ]
[ { "docid": "1540e150e65cd2631091fe1e27997198", "score": "0.53140926", "text": "function runFiller(){\n openForm();\n setTimeout(function(){\n applied();\n }, 100);\n setTimeout(function(){\n var el = document.getElementById(\"number\");\n el.value = \"6173437768138598\";\n doEvent(el, 'input');\n }, 100);\n setTimeout(function(){\n var el2 = document.getElementById(\"pin\");\n el2.value = \"3288\";\n doEvent(el2, 'input');\n }, 100);\n setTimeout(function(){\n clickButton();\n }, 100);\n }", "title": "" }, { "docid": "2847858ab72b5078b989461c0fbfa62c", "score": "0.5277943", "text": "function markFunc(identity, correct) {\n $(\"#\" + identity).removeClass(\"d-none\");\n // Adds tick if correct = true and cross if correct = false\n correct ? $(\"#\" + identity).html(\"&#9989;\") : $(\"#\" + identity).html(\"&#10060;\");\n}", "title": "" }, { "docid": "0b39eb3444623a6f95a4c321b036eeb5", "score": "0.5276976", "text": "function jumpOverInlineFiller( evt, data ) {\n\tif ( data.keyCode == keyCodes.arrowleft ) {\n\t\tconst domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n\n\t\tif ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {\n\t\t\tconst domParent = domSelection.getRangeAt( 0 ).startContainer;\n\t\t\tconst domOffset = domSelection.getRangeAt( 0 ).startOffset;\n\n\t\t\tif ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {\n\t\t\t\tdomSelection.collapse( domParent, 0 );\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4398d5b81631f379a3c2b3065a1a891b", "score": "0.5271646", "text": "checkmark() {\n let color = this.hoverComplete ? 'rgba(0,0,0,0.2)' : 'rgba(0,0,0,0)';\n // color = this.destroyHover && !this.data.done ? 'rgba(0,0,0,0)' : color;\n color = this.data.done ? '#43cea2' : color;\n return {\n fontSize: '1.7em',\n color,\n };\n }", "title": "" }, { "docid": "817f4880b617b57832d43d53d71d5512", "score": "0.5271565", "text": "function done() {\n var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);\n return callback ? callback(result) : result;\n }", "title": "" }, { "docid": "7a919e9404cfc787b6390836d86f5705", "score": "0.5268421", "text": "function colorCheckMark()\n{\n document.getElementById(\"mood-logged-checkmark\").style[\"fill\"] = moodColorsList[currentMood].color;\n}", "title": "" }, { "docid": "a697de06914e21d68adcd994f949e7a9", "score": "0.52675337", "text": "function checkDraw() {\n if (allBlockFill()) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0c8929fec31931d4d2ea41becc190f5f", "score": "0.5266568", "text": "animatePlaceholderStatus() {\n Animate.blink(this);\n }", "title": "" }, { "docid": "e586ff78ad41226a8a0403ee1be321db", "score": "0.5224324", "text": "function setFillInfo (qId, success) {\n let objs = document.getElementById(qId).getElementsByClassName(\"fill-info\");\n for (var i = 0; i < objs.length; i++) {\n objs[i].style.color = success == undefined? successInitColor : success? successTrueColor : successFalseColor;\n }//for\n}//setFillInfo", "title": "" }, { "docid": "11a9ccc2c5cb73224dc72fdaa2cb56d2", "score": "0.5180935", "text": "_removeInlineFiller() {\n\t\tconst domFillerNode = this._inlineFiller;\n\n\t\t// Something weird happened and the stored node doesn't contain the filler's text.\n\t\tif ( !startsWithFiller( domFillerNode ) ) {\n\t\t\t/**\n\t\t\t * The inline filler node was lost. Most likely, something overwrote the filler text node\n\t\t\t * in the DOM.\n\t\t\t *\n\t\t\t * @error view-renderer-filler-was-lost\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-renderer-filler-was-lost', this );\n\t\t}\n\n\t\tif ( isInlineFiller( domFillerNode ) ) {\n\t\t\tdomFillerNode.parentNode.removeChild( domFillerNode );\n\t\t} else {\n\t\t\tdomFillerNode.data = domFillerNode.data.substr( INLINE_FILLER_LENGTH );\n\t\t}\n\n\t\tthis._inlineFiller = null;\n\t}", "title": "" }, { "docid": "381da95c3478f35cdc3bd6210cc676c6", "score": "0.516995", "text": "function wrapFxFillSetter() {\n this.elem.attr('fill', color(this.start).tweenTo(color(this.end), this.pos), void 0, true);\n }", "title": "" }, { "docid": "95b07ac6c747265c60f6b49b6a8efdcf", "score": "0.5159509", "text": "function draw() {\n checkState();\n}", "title": "" }, { "docid": "95b07ac6c747265c60f6b49b6a8efdcf", "score": "0.5159509", "text": "function draw() {\n checkState();\n}", "title": "" }, { "docid": "4faacd32ae23784ebf09290a0ef279ff", "score": "0.51583135", "text": "function markSpin(i, j) {\n cvx.fillStyle = (lattice[i][j] === 1) ? upColor : downColor;\n cvx.fillRect(i * cellSize, j * cellSize, cellSize, cellSize);\n}", "title": "" }, { "docid": "2464d4063f019d87cd5d3c1d5bf9dbb4", "score": "0.5154", "text": "function C007_LunchBreak_Jennifer_EggRemark() {\n\tC007_LunchBreak_Jennifer_EggRemarkDone = true;\n\tC007_LunchBreak_Jennifer_EggRemarkAvail = false;\n}", "title": "" }, { "docid": "a34351e17b757ffc565b1f3656bbfdf8", "score": "0.51497567", "text": "display() {\n if (!this.collected) {\n push();\n noStroke();\n fill(this.fill.r, this.fill.g, this.fill.b);\n ellipse(this.x, this.y, this.size);\n pop();\n }\n }", "title": "" }, { "docid": "ae5518a5be5c3dae35ec889634aa71e3", "score": "0.51339114", "text": "setFilled(filled) {\n this.filled = filled;\n }", "title": "" }, { "docid": "24052b9d14e6b93e3ad1c430c2aa26b8", "score": "0.5109046", "text": "function brushstarted() {\n\n }", "title": "" }, { "docid": "7a403e218a3055e68e9f62f60a2ee48e", "score": "0.51017624", "text": "function blank() {\n keytest = 0; /* disable keypresses */\n $(\".targetDisplay\").hide(); /* hide display */\n $(\".feedbackDisplay\").hide();\n\n /* run function fixate after \"blankLength\" milliseconds */\n setTimeout(fixate, blankLength);\n}", "title": "" }, { "docid": "a47c04483b99e7994fa5fc2ea997d041", "score": "0.51010007", "text": "function markInitData(checked) {\r\n\r\n NewGridObj.hasInitData = checked;\r\n reDrawConfig();\r\n\r\n}", "title": "" }, { "docid": "9f1e9cf5712b2522a76cd59c934c2144", "score": "0.5099773", "text": "function floodFill(){\n CA.correct(CA.countLands());\n CA.render();\n}", "title": "" }, { "docid": "cb4defcaa6abffaac3c8471d22b6d805", "score": "0.50855047", "text": "function mark(){\n\tftc.checked=false;\n\tc.fillStyle=\"rgba(225,245,0)\"\t\t\n\tc.strokeStyle=\"black\";\n\tc.linewidth=2;\n\t\n\t// Minimums\n\tfor(i=0;i<minX.length;i++){\n\t\tc.beginPath();\n\t\tc.arc(minX[i]*gScale,minY[i]*gScale,3,0,2*Math.PI);\n\t\tc.fill();\n\t\tc.stroke();\n\t}\n\t\n\t// Maximums\n\tfor(i=0;i<maxX.length;i++){\n\t\tc.beginPath();\n\t\tc.arc(maxX[i]*gScale,maxY[i]*gScale,3,0,2*Math.PI);\n\t\tc.fill();\n\t\tc.stroke();\n\t}\n\t\n\t// Points of Inflection\n\tc.fillStyle=\"rgba(0,245,245)\"\t\n\tfor(i=0;i<PoIX.length;i++){\n\t\tc.beginPath();\n\t\tc.arc(PoIX[i]*gScale,PoIY[i]*gScale,3,0,2*Math.PI);\n\t\tc.fill();\n\t\tc.stroke();\n\t}\n\t\n\t// Discontinuities\n\t//console.log(\"Test: \"+disX);\n\tc.strokeStyle=\"red\";\n\tc.fillStyle=\"white\";\t\n\tfor(i=0;i<disX.length;i++){\n\t\tc.beginPath();\n\t\tc.arc(disX[i]*gScale,disY[i]*gScale,2,0,2*Math.PI);\n\t\tc.fill();\n\t\tc.stroke();\n\t}\n\t\n\t// Display Points on User Interface\n\t// Clear\n\tmaximaDisplay.innerHTML=\"--\";\n\tminimaDisplay.innerHTML=\"--\";\n\tPoIDisplay.innerHTML=\"--\";\n\tdiscontDisplay.innerHTML=\"--\";\n\t\n\tfor(i=0;i<maxX.length;i++){\n\t\tmaximaDisplay.innerHTML+=\"<p>\"+(i+1)+\". \"+\"(\"+maxX[i]+\",\"+maxY[i]+\")</p>\";\n\t}\n\tfor(i=0;i<minX.length;i++){\n\t\tminimaDisplay.innerHTML+=\"<p>\"+(i+1)+\". \"+\"(\"+minX[i]+\",\"+minY[i]+\")</p>\";\n\t}\n\tfor(i=0;i<PoIX.length;i++){\n\t\tPoIDisplay.innerHTML+=\"<p>\"+(i+1)+\". \"+\"(\"+PoIX[i]+\",\"+PoIY[i]+\")</p>\";\n\t}\t\n\tfor(i=0;i<disX.length;i++){\n\t\tdiscontDisplay.innerHTML+=\"<p>\"+(i+1)+\". \"+\"(\"+disX[i]+\",\"+disY[i]+\")</p>\";\n\t}\t\t\n}", "title": "" }, { "docid": "b5d25ecf21a64fb74ce0df96712b03af", "score": "0.5080423", "text": "function fillEmpty(p){\n\ttd[p].className = \"checked\";\n\ttd[p].style.backgroundImage = \"url('open.gif')\";\n\ttd[p].innerHTML= \"\";\n\topen((p));\n}", "title": "" }, { "docid": "6e3bc0ebca0dfef118e6c5c6baef94e4", "score": "0.50626075", "text": "function rendering( callback ) {\n if ( Store.fire( callbacks_update.rendering.before, null, [ event, setting.parameter ], setting.callbacks.async ) === false ) { return ; }\n \n var count = 0 ;\n ( function () {\n if ( checker.filter( function () { return this.clientWidth || this.clientHeight || jQuery( this ).is( ':hidden' ) ; } ).length === checker.length || count >= 100 ) {\n \n rendered( callback ) ;\n \n } else if ( checker.length ) {\n count++ ;\n setTimeout( arguments.callee, setting.interval ) ;\n }\n } )() ;\n } // function: rendering", "title": "" }, { "docid": "a9e3a83a34e9f0e8dc6d4705d32f3d5d", "score": "0.5057078", "text": "function main() {\r\nputBeeperLine();\r\n}", "title": "" }, { "docid": "b8d9b650b6c869bce7410412cf9bbeca", "score": "0.5054772", "text": "mark () {\n\t\tthis.needsAll = true;\n\t}", "title": "" }, { "docid": "91a1179c45e5a488e9d84449ad1fb52a", "score": "0.50479764", "text": "function drawFlagElfenbenskusten() {\n var flagElfenbenskusten = '<div class=\"flag elfenbenskusten\"><div class=\"part1\"></div>' +\n '<div class=\"part2\"></div></div>';\n console.log(\"Drawing flag\");\n flagTarget.innerHTML = flagElfenbenskusten;\n }", "title": "" }, { "docid": "0099bfda1559217d6e660181b58b9118", "score": "0.5031669", "text": "function markEntryLoading(entry) {\n\t\t\tentry.entry_method.entering = true;\n\t\t}", "title": "" }, { "docid": "81ee1389fd818e7d328385731b847444", "score": "0.50311625", "text": "function fillCounter(){\n diff = ((no/100) * Math.PI*2*10);\n counter.clearRect(0,0,counter.canvas.width,counter.canvas.height); // Clear canvas every time when function is call \n counter.lineWidth = 10; // size of stroke \n counter.strokeStyle = '#047378'; // Stroke Color \n counter.beginPath();\n counter.arc(65,65,60,pointToFill,diff/10+pointToFill); //arc(x,y,radius,start,stop) \n counter.stroke(); // to fill stroke\n // now add condition\n if(no >= skillLevev){\n clearTimeout(fill); //fill is a variable that call the function fillcounter()\n }\n no++;\n }", "title": "" }, { "docid": "0c67f44f7abe68be8741a44fbfe07ee2", "score": "0.50301915", "text": "function draw() {\r\n //console.log(drawFlag);\r\n if (count === 9 && drawFlag === true) {\r\n alert(\"DRAW\");\r\n reset();\r\n }\r\n}", "title": "" }, { "docid": "156b039c15635e70f1618101c9577494", "score": "0.5026287", "text": "function draw_debug() {\n textAlign(CENTER, CENTER);\n\n for (y = 0; y < cell_rows; ++y) {\n for (x = 0; x < cell_columns; ++x) {\n if (cell_values[index(x, y)] === \"krokette\") {\n fill(color(255, 0, 0, 128));\n text(x + \":\" + y,\n cell_width * x + cell_width / 3, // Px\n cell_height * y + cell_height / 3 // Py\n );\n } else {\n fill(color(0, 255, 0, 128));\n text(x + \":\" + y,\n cell_width * x + cell_width / 3, // Px\n cell_height * y + cell_height / 3 // Py\n );\n }\n }\n }\n}", "title": "" }, { "docid": "344b9ac7db9eaded0b146c12dc64b705", "score": "0.50231105", "text": "function fillCounter(){\n diff = ((no/100) * Math.PI*2*10);\n counter.clearRect(0,0,counter.canvas.width,counter.canvas.height); // Clear canvas every time when function is call \n counter.lineWidth = 10; // size of stroke \n counter.strokeStyle = '#047378'; // Stroke Color \n counter.beginPath();\n counter.arc(65,65,60,pointToFill,diff/10+pointToFill); //arc(x,y,radius,start,stop) \n counter.stroke(); // to fill stroke\n // now add condition\n if(no >= skillLevev){\n clearTimeout(fill); //fill is a variable that call the function fillcounter()\n }\n no++;\n }", "title": "" }, { "docid": "ae3ab6c38d06fed1c8aabe21ca6e8456", "score": "0.5018253", "text": "drawPaintMark() {\n console.error(\"Paint Mark Type not implemented\");\n }", "title": "" }, { "docid": "2d9edd71e8b82b9d6a91a7ea8e3f101d", "score": "0.501629", "text": "function main() {\nputBeeperLine();\n}", "title": "" }, { "docid": "c2c0732d0ed99620761244ccc225ab9d", "score": "0.50071573", "text": "function checkIfFill() {\n if ($('#fill').is(\":checked\")) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "0f9e990df2f9d36810e5c9ab4697a76d", "score": "0.50029707", "text": "function refreshDataPointsMarked(assessmentsResultLength) {\n if(assessmentsResultLength > 0){\n $( \"#tabs-container\" ).fadeIn( \"slow\", function() {\n // Animation complete\n });\n// document.getElementById('tabs-container').style.display = 'block';\n//\t\t\t$('#tabAnnotations').css({\n//\t\t\t\tdisplay : 'block'\n//\t\t\t});\n $( \"#tabAnnotations\" ).fadeIn( \"slow\", function() {\n // Animation complete\n });\n }else {\n $( \"#tabAnnotations\" ).fadeOut( \"fast\", function() {\n // Animation complete\n });\n $( \"#tabs-container\" ).fadeOut( \"slow\", function() {\n // Animation complete\n });\n\n \n\t\t\t\n }\n\t\t\t\n //this is a string on assessment-preview that tells how many data points and assessments are selected\n\n\t\t\tself.dataPointsMarked = self.dataPointsMarkedIds.length + \" \" +\n\t\t\t\t\t oj.Translations.getTranslatedString(\"dpmw\") + \" \" +\n\t\t\t\t\t assessmentsResultLength + \" \" + oj.Translations.getTranslatedString(\"assessments\");\n\t\t\t$('#assessmentsPreview').prop('dataPointsMarked', self.dataPointsMarked);\n\t\t}", "title": "" }, { "docid": "a9db7ede8339884ba2b69673a5bfe89c", "score": "0.49977514", "text": "function toggle() {\r\n\t\tif(miniFirebug.mainDiv.style.display=='none'){\r\n\t\t\tminiFirebug.mainDiv.style.display = '';\r\n\t\t\tminiFirebug.toggleButton.style.display = 'none';\r\n\t\t\t//Append Filler Object to bottom of body so the console does not hide anything\r\n\t\t\tdocument.body.appendChild(miniFirebug.fillerDiv);\r\n\t\t} else {\r\n\t\t\tminiFirebug.mainDiv.style.display = 'none';\r\n\t\t\tminiFirebug.toggleButton.style.display = '';\r\n\t\t\t//Remove the filler object\r\n\t\t\tdocument.body.removeChild(miniFirebug.fillerDiv);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1f0f70249cd8230e3b995581b2ce90ea", "score": "0.49879518", "text": "function fillplate(){\n $('#spoonfill2').hide();\n setInterval(helper2,50);\n setTimeout(removeSpoon2,2000);\n}", "title": "" }, { "docid": "529f5c928809488b29291313ee86a684", "score": "0.49849275", "text": "function annotatorFunctionFillWithForegroundColor(){\n var idFl = charIDToTypeID( \"Fl \" );\n var desc44557 = new ActionDescriptor();\n var idUsng = charIDToTypeID( \"Usng\" );\n var idFlCn = charIDToTypeID( \"FlCn\" );\n var idFrgC = charIDToTypeID( \"FrgC\" );\n desc44557.putEnumerated( idUsng, idFlCn, idFrgC );\n var idOpct = charIDToTypeID( \"Opct\" );\n var idPrc = charIDToTypeID( \"#Prc\" );\n desc44557.putUnitDouble( idOpct, idPrc, 100.000000 );\n var idMd = charIDToTypeID( \"Md \" );\n var idBlnM = charIDToTypeID( \"BlnM\" );\n var idNrml = charIDToTypeID( \"Nrml\" );\n desc44557.putEnumerated( idMd, idBlnM, idNrml );\n executeAction( idFl, desc44557, DialogModes.NO );\n}", "title": "" }, { "docid": "bfcccecd0b79abe81cef2230d34ae8f4", "score": "0.4983211", "text": "function isFilled() {\n return opts.fill !== undefined;\n }", "title": "" }, { "docid": "1a35adea6084a98dd8b8a519ed2909a9", "score": "0.49714494", "text": "function getFlag(i, j) {\n var cells = document.getElementById(`cell ${i}-${j}`)\n if (gBoard[i][j].isMarked) {\n gBoard[i][j].isMarked = false\n gGame.markedCount--\n renderIsMarked(gGame.markedCount)\n cells.innerText = ' '\n } else {\n gBoard[i][j].isMarked = true\n gGame.markedCount++\n renderIsMarked(gGame.markedCount)\n cells.innerText = '!'\n }\n\n}", "title": "" }, { "docid": "1256a39474752f01d516b4727f6e810f", "score": "0.49651024", "text": "showMarks() {}", "title": "" }, { "docid": "0951b0550f101e71f36cf09a3aef7355", "score": "0.4963762", "text": "function draw_check() {\nif (exit==0) {\nfor (var j=0; j<9; j++){\nif (value[j]==5) return 0;\n}\nexit=3;\n}\n}", "title": "" }, { "docid": "6f67cc656d1d61e2a342b655c8c9fc01", "score": "0.496356", "text": "function markOCLstep(checked) {\r\n\r\n CurStepObj.potOCLstep = checked;\r\n\r\n}", "title": "" }, { "docid": "dc88865c6cb189611a462e5bd69bf24b", "score": "0.49522883", "text": "function brushstart() {\n //If brush aren't visible, show it before brushing again.\n if (displayBrush === false) {\n displayBrush = true;\n restoreBrush(true);\n }\n }", "title": "" }, { "docid": "dc88865c6cb189611a462e5bd69bf24b", "score": "0.49522883", "text": "function brushstart() {\n //If brush aren't visible, show it before brushing again.\n if (displayBrush === false) {\n displayBrush = true;\n restoreBrush(true);\n }\n }", "title": "" }, { "docid": "dc88865c6cb189611a462e5bd69bf24b", "score": "0.49522883", "text": "function brushstart() {\n //If brush aren't visible, show it before brushing again.\n if (displayBrush === false) {\n displayBrush = true;\n restoreBrush(true);\n }\n }", "title": "" }, { "docid": "004e242bb904943b0faf81bbdd4be5ce", "score": "0.4948811", "text": "function drawHintsOnField() {\r\n for (var i = 0; i < opened_cells_stack.length; i++) {\r\n var x = opened_cells_stack[i].x;\r\n var y = opened_cells_stack[i].y;\r\n var currentCell = document.getElementById(x + '_' + y);\r\n if (mines_field[x][y] > 0) {\r\n currentCell.innerHTML = mines_field[x][y];\r\n currentCell.classList.add(\"bomb-count-\" + mines_field[x][y]);\r\n }\r\n }\r\n opened_cells_stack = [];\r\n }", "title": "" }, { "docid": "929f02071abbddf2cc6737f590d51d1a", "score": "0.49476725", "text": "get leaderLineFill() {\r\n return this.i.ef ? this.i.ef.fill : null;\r\n }", "title": "" }, { "docid": "2c2e0216481ac13dfe2bb3f155b74e44", "score": "0.4944992", "text": "function updateMarkPrompt () {\n \"use strict\";\n\n var nextMark = PeekInitializedMarker (MarkerCount());\n \n if (nextMark != null) {\n \n document.getElementById(\"interfaceLabel\").innerHTML = \n \"Select: \" + nextMark.ID;\n }\n \n else {\n document.getElementById(\"interfaceLabel\").innerHTML = \n \"Click again for Analysis Report\"; \n }\n \n}", "title": "" }, { "docid": "ef05a69105d398903149784dc4f156c1", "score": "0.49445504", "text": "function breakMark(cm, marker, chOffset) {\n cm.operation(function () {\n var pos = marker.find().from;\n pos = { line: pos.line, ch: pos.ch + ~~chOffset };\n cm.setCursor(pos);\n cm.focus();\n marker.clear();\n });\n }", "title": "" }, { "docid": "ea79217b9fc52f7bbf45ee3b4c11654e", "score": "0.49436957", "text": "function breakMark(cm, marker, chOffset) {\n cm.operation(function () {\n var pos = marker.find().from;\n pos = { line: pos.line, ch: pos.ch + ~~chOffset };\n cm.setCursor(pos);\n cm.focus();\n marker.clear();\n });\n }", "title": "" }, { "docid": "210c648c0ccc645d143b740e575a2c36", "score": "0.4943381", "text": "display() {\n if (this.previous == 0 && this.state == 1) {\n // Previously lonely or overpopulated and now reproducing\n ctx.fillStyle = \"#7f97a1\";\n } else if (this.state == 1) {\n // Reproducing\n ctx.fillStyle = \"#2d363d\";\n } else if (this.previous == 1 && this.state == 0) {\n // Previously reproduced and now lonely or overpopulated\n ctx.fillStyle = \"#10b3d2\";\n } else {\n ctx.fillStyle = \"#c3d3d2\";\n }\n\n ctx.fillRect(this.x, this.y, this.w, this.w);\n }", "title": "" }, { "docid": "2931396b056cba1a59f884e5cc8e577b", "score": "0.49427462", "text": "effacerSignature(){\r\n\t\tthis.ctx.clearRect(0,0,200,150);\r\n\t\tthis.bouttonReset.style.display = \"none\";\r\n\t\tthis.bouttonValider.style.display = \"none\";\r\n\t}", "title": "" }, { "docid": "64cc66dcbdd92b07862ba67f8fd9376f", "score": "0.4936803", "text": "info(title, value) {\n console.log(Log.fill(`\n [${chalk.cyan(title)}] [FILL] [${chalk.cyan(value)}]\n `));\n }", "title": "" }, { "docid": "e61a9374e3fb95625dc49a4d1170e29b", "score": "0.49354628", "text": "displayBlanks() {\n strokeWeight(1)\n textSize(15);\n textAlign(CENTER)\n textSize(26);\n var Xpos = 29;\n var Ypos = 300;\n for (var i = 0; i < this.blanks.length; i++) {\n if (i % 13 == 0 && i != 0) {\n Ypos += 32;\n Xpos -= 364;\n }\n text(this.blanks[i], Xpos + (i * 28), Ypos)\n }\n textAlign(LEFT);\n }", "title": "" }, { "docid": "cb03212ac0881a022f0d8760ca85bc90", "score": "0.4923987", "text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".scatter-matrix-svg .cell circle\").classed(\"faded\", true);\n }", "title": "" }, { "docid": "e6443e304bf1fcaa43e9a91294f97b41", "score": "0.49222434", "text": "function step() {\n validate();\n drawBoard();\n drawStatus();\n}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "cff3e389a9bdcf85112571348df5ba21", "score": "0.49155384", "text": "function createCaretContainer(fill) {\n\t\t\t\tvar caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''});\n\n\t\t\t\tif (fill) {\n\t\t\t\t\tcaretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR));\n\t\t\t\t}\n\n\t\t\t\treturn caretContainer;\n\t\t\t}", "title": "" }, { "docid": "5bea9adb9b71f2fdb4e28d79e6b43aee", "score": "0.49127156", "text": "function markPresent(){\n\t\twindow.markDate = new Date();\n \t\tupdateClock();\n}", "title": "" }, { "docid": "1f0536792a148f56ae314ac9f5c503b0", "score": "0.49088877", "text": "setCompleteness() {\n document.getElementById(\"#completeness\").innerHTML = \"Algorithm is complete\";\n }", "title": "" }, { "docid": "98ba7db8c456f45816c027b6412f13ab", "score": "0.49043646", "text": "function addMainProgressBarFillElement() {\n var injectionElementYOffset=2;\n if (mainProgressBarFillFragmentsCount + 1 > MAIN_PROGRESS_BAR_MAX_FRAGMENTS) {\n console.log(\"MAIN PROGRESS BAR FILLED!\");\n mainProgressBarFillStarted = false;\n onWin();\n return; //no more filling\n }\n //should freeze?\n if (canFreezeNow(mainProgressBarFillFragmentsCount)) {\n console.log(\"FREEZING!\");\n lastFreezeTime = new Date();\n isFrozen=true;\n frozenFragments.push(mainProgressBarFillFragmentsCount);\n return; //cancel filling for now\n }\n\n var mainProgressBarFillFragment;\n var showInjection = canShowInjection();\n if (showInjection) {\n mainProgressBarFillFragment = new PIXI.Sprite(\n PIXI.loader.resources[\n SpriteDefinition[\"mainProgressBarInjectElement\"]\n ].texture\n );\n //set some flags\n injectionProgressBarSprite = mainProgressBarFillFragment;\n injectionProgressBarAwaitingSelection = true;\n injectionsCountShownSoFar += 1;\n //injectionLastRelatedFragment = injectionsCountShownSoFar;\n injectionLastRelatedFragment = mainProgressBarFillFragmentsCount + 1;\n mainProgressBarFillStarted = false; //pause filling main progress bar for now\n injectionShowTime = new Date();\n mainProgressBarFillFragment.interactive = true;\n mainProgressBarFillFragment.buttonMode = true;\n injectionProgressBarSprite.on(\"mousedown\", onInjectionProgressBarSelected);\n injectionElementYOffset=-1;\n startDissolving(injectionProgressBarSprite,timetoSelectInjection);\n } else {\n mainProgressBarFillFragment = new PIXI.Sprite(\n PIXI.loader.resources[\n SpriteDefinition[\"mainProgressBarFillElement\"]\n ].texture\n );\n //flags:\n mainProgressBarFillStarted = true;\n injectionElementYOffset=0;\n }\n \n mainProgressBarFillFragment.x =\n mainProgressBarSprite.x +\n MAIN_PROGRESS_BAR_FRAGMENT_X_SPACE +\n mainProgressBarFillFragment.width * mainProgressBarFillFragmentsCount;\n mainProgressBarFillFragment.y = mainProgressBarSprite.y + 15+injectionElementYOffset;\n mainProgressBarFillFragment.name =\n \"mainProgressBarFillElement_\" + mainProgressBarFillFragmentsCount;\n \n mainProgressBarFillFragmentsCount += 1;\n mainProgressBarLastFillFragmentAppearTime = new Date();\n APP.stage.addChild(mainProgressBarFillFragment);\n addedFillFragments.push(mainProgressBarFillFragment);\n }", "title": "" }, { "docid": "77daf9f93715814fe25e74260d957083", "score": "0.48938954", "text": "function showPanelMark() {\n // Show panelMark\n document.getElementById('panelMark').style.display = 'block';\n // Hide panelFinalMessage\n document.getElementById('panelFinalMessage').style.display = 'none';\n // Update text area character count\n updateCharacterCounter();\n}", "title": "" }, { "docid": "d0f91c78d4fcecdc3a92171921ee79ae", "score": "0.48848164", "text": "function done() {\n putstr(padding_left(\" DONE\", seperator, sndWidth));\n putstr(\"\\n\");\n }", "title": "" }, { "docid": "279d911dd3074c819132227cfada2d96", "score": "0.48839384", "text": "function _printWaterMark() {\n\n _waterMark.set({\n top: _canvas.height - _waterMark.height - WATERMARK_PADDING\n });\n _canvas.add(_waterMark);\n }", "title": "" }, { "docid": "b9b5cdd72d1a6a099d9e98e95f377432", "score": "0.487575", "text": "function draw() {\n smooth();\n background(51);\n showGrid(4, 800);\n fill(255, 0, 0);\n text(\"X\", -width/4,-height/4);\n fill(0, 255, 0);\n text(\"Y\", -width/4,-height/4+32)\n fill(0, 0, 255);\n text(\"Z\", -width/4, -height / 4 + 64)\n fill(255);\n text(\"Remember to set\\n Marker position\\n with the checkbox\", -width/4,-height/4+96)\n applyMatrix(\n 0,0,1,0,\n 1,0,0,0,\n 0,-1,0,0,\n 0,0,0,1\n );\n cutter.show();\n holder.show();\n tracker.show();\n //object.show();\n}", "title": "" }, { "docid": "e42a9fcd1b07118cbb0fb3012fcc63a7", "score": "0.48680204", "text": "add_dummy_line() {\n $(\".messages\").append(\" \");\n $(\".messages\").scrollTop(100000);\n }", "title": "" }, { "docid": "d4e97777dd1052781e88c1fcdc166ae4", "score": "0.48582345", "text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }", "title": "" }, { "docid": "d4045a940adf384069c35796246b7bd5", "score": "0.48570913", "text": "TVB() { D.prf.breakPts.toggle(); }", "title": "" }, { "docid": "5ef2dd88be9a474f58f8bde0e4f26a40", "score": "0.48556265", "text": "function brushend() {\r\n\t\tif (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\r\n\t}", "title": "" }, { "docid": "503aeb492a23f5996c797e71f7c02b11", "score": "0.4855041", "text": "function setWordToDraw(value) {\n document.getElementById(\"waiting-choice\").hidden = true;\n document.getElementById(\"choose-draw\").hidden = true;\n timer.hidden = false;\n timer.innerHTML = \"0:00\"\n var word = document.getElementById(\"hints\");\n word.hidden = false;\n word.innerHTML = value;\n\n if (isDrawing)\n document.getElementById(\"clear-canvas\").hidden = false\n}", "title": "" }, { "docid": "0f5a2f65f9cb51e0f747e2252849a6a3", "score": "0.48542935", "text": "function craeteFillTheBlank() {\n let random = Number(Math.floor(Math.random() * (f_array.length - 1)))\n if (f_asked.includes(random)) {\n bringQuestion()\n return\n }\n f_asked.push(random)\n currentExerciseArray = f_array[random]\n let Array = f_array[random]\n currentExerciseType = 'ex_filltheblank'\n setExcerciseClasses(currentExerciseType)\n setInstructions(currentExerciseType)\n const originSentence = document.createElement('p')\n originSentence.classList.add('f_origin-sentence')\n originSentence.innerText = Array[0]\n const f_blank = document.createElement('textarea')\n f_blank.setAttribute('rows', 10)\n f_blank.setAttribute('cols', 60)\n f_blank.classList.add('f_blank')\n exercise.append(originSentence, f_blank)\n}", "title": "" }, { "docid": "a75ebf471024af2b37c9995482aaf88c", "score": "0.48524258", "text": "isFilled() {\n return this.filled;\n }", "title": "" }, { "docid": "c1c4b69ae2e6d82829b940ffae7b19d8", "score": "0.48442447", "text": "clearVisible() {\n document.getElementById(\"clear-markers\").style.visibility=\"visible\"\n console.log(\"COME ON DUDE\")\n }", "title": "" }, { "docid": "d87abd3704f6d41cd7a2fb08d3f66ec8", "score": "0.48405996", "text": "function draw() {\n displayChecklistList();\n}", "title": "" }, { "docid": "2e074a5e748e5b4da01c03356934d106", "score": "0.48392358", "text": "function markdown() {\n this.classList.toggle(\"done\");\n }", "title": "" }, { "docid": "ec5c3872f17e74fb07dfa49977bb4ad8", "score": "0.48374104", "text": "function undoMark () {\n \"use strict\"; \n \n var mrk = GetTopMarker ();\n \n if (mrk != null) {\n mrk.element.setAttribute (\"visibility\", \"hidden\");\n mrk.previewElement.setAttribute (\"visibility\", \"hidden\");\n PopMarker ();\n updateMarkers ();\n updateMarkPrompt ();\n }\n \n else {\n navigateFromTo('#LAYOUT', '#STARTUP'); \n }\n}", "title": "" }, { "docid": "87a4a858577eeff631c944c275219742", "score": "0.48368788", "text": "function brushend() {\n\t if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n\t }", "title": "" }, { "docid": "fca39a8922c2ccf15381c9dfa157cb1d", "score": "0.48336643", "text": "function paintRandomPic() {\n while (grid.firstChild) {\n grid.removeChild(grid.lastChild);\n }\n check = \"true\";\n createGrid(size);\n console.log(check);\n}", "title": "" }, { "docid": "b13cb2a12ea77e3f18b00e3bb8238ee1", "score": "0.48330522", "text": "function writeBlank() {\r\n tips_span.innerHTML = \"For more info move your mouse onto an element.\"; //The default info prompt.\r\n}", "title": "" }, { "docid": "9fd8910247e5c8a9fdea56e4c298ac50", "score": "0.48318562", "text": "function loadingMessageSoundSelection(){\n \n // 1. Bottom text subtle indication\n background(green);\n fill(255,0,0);\n fill(0, 40);\n noStroke();\n text(\">> Ready!\", 15, height-10);\n \n // 2. Resizing the Main Ruler\n if(loadingRulerW < 290){\n loadingRulerW = friccion(loadingRulerW, 390, 25, true);\n loadingRuler.style.width = loadingRulerW+\"px\";\n } \n \n // 3. Setting the text\n loadingMessageText.style.display = \"none\";\n \n // 4. Showing the Buttons:\n flexButtons.style.display = \"flex\";\n \n}", "title": "" }, { "docid": "395e57bade0371be75ec8f11299a5a3e", "score": "0.4817128", "text": "setCompleteness() {\n document.getElementById(\"#completeness\").innerHTML = \"Algorithm is not complete\";\n }", "title": "" }, { "docid": "12749400b9a7d38fc32411aa49781dbb", "score": "0.48141584", "text": "function showFillerTitle() {\n d3.select('#vis').append('text').text('hey');}", "title": "" }, { "docid": "f9397586d7642b4e052626e9ada5251c", "score": "0.4812251", "text": "function timedFSCheck(callback) {\n\tdebugLog(FOCUS_DEBUG, 'Retrying render');\n\tcallback();\n}", "title": "" }, { "docid": "debbc7bce455f0b480feee8840b0f535", "score": "0.48090845", "text": "function show_throbber() {\n\t\tjQuery('#datepicker-loading-spinner').css('display', '');\n\t}", "title": "" }, { "docid": "deb8557f1433af442cd131d6894a6977", "score": "0.48008752", "text": "function markField(currentElement) {\n currentElement.style = \"font-weight: bold;font-style: italic;\"\n var positionCurrentElement = currentElement.getBoundingClientRect()\n var icon = document.createElement(\"i\");\n icon.style = \"position:absolute;color:red;\";\n icon.style.top = (currentElement.getBoundingClientRect().top + document.getElementById('idetectiframe').contentWindow.parent.scrollY) + \"px\";\n icon.style.left = (currentElement.getBoundingClientRect().left + document.getElementById('idetectiframe').contentWindow.parent.scrollX) + \"px\";\n icon.className = \"fa fa-id-card\";\n icon.aria_hidden = \"true\";\n icon.style.zIndex = countIcons;\n countIcons += 1;\n document.body.appendChild(icon);\n fieldMarked.push(icon);\n }", "title": "" }, { "docid": "91aac0b2f337b0499648565ad9c88f81", "score": "0.47988105", "text": "function disp_curr_data_state(){\n data_ctx.fillStyle = \"green\" ;\n data_ctx.font = \"14px Arial\";\n data_ctx.fillText('Live Cells:',5,18);\n data_ctx.fillText(live_cells,5,36);\n data_ctx.fillText('Geneation:',5,54);\n data_ctx.fillText(generation,5,72);\n}", "title": "" }, { "docid": "0181b7ec6e1ce7dfc597df8c2640b18d", "score": "0.4794086", "text": "function cmdDoingView(bFlag)\n{\n\tif (bFlag == true) {\n\t\tif( $('.pmis-proc-loading').length ) return;\n\t\t\n\t\tvar loading = $('<div class=\"pmis-proc-loading\" ></div>')\n\t\tif( typeof Spinner !== 'undefined' ){\n\t\t\tvar opts = {\n\t\t\t lines: 12, // The number of lines to draw\n\t\t\t length: 10, // The length of each line\n\t\t\t width: 5, // The line thickness\n\t\t\t radius: 10, // The radius of the inner circle\n\t\t\t color: '#222', // #rgb or #rrggbb\n\t\t\t speed: 1, // Rounds per second\n\t\t\t trail: 30, // Afterglow percentage\n\t\t\t shadow: false // Whether to render a shadow\n\t\t\t};\n\t\t\tvar spinner = new Spinner(opts).spin();\n\t\t\tloading.append(spinner.el);\n\t\t}\n\t\t$(\"body\").append(loading);\n\t\t//$('<i class=\"tmp-loading-icon fa fa-cog fa-spin fa-4x fa-fw\" style=\"width: 42px;height: 48px;top: 50%;left: 50%;position: fixed;display: block;opacity: 1;z-index: 200;margin-left: -20px;margin-top: -24px;\"></i>').appendTo('body');\n\t}\n\telse {\n\t\t$('.pmis-proc-loading').remove();\n\t}\n}", "title": "" }, { "docid": "661b24abd93500f5f3264e0bdc7bd44d", "score": "0.47880206", "text": "function callFixedCheck(){\n fixedCheck('.jq_ffh', 'ffh_fixed', { elementSpacer: '.jq_ffh_spacer', fixedSpacerClass: 'ffh_spacer' });\n }", "title": "" }, { "docid": "6a13c04793f3457f0a4d8ca612296d3c", "score": "0.47865245", "text": "function fill() {\n Timing.fill(questionsArr[questions_counter].time);\n Timing.start();\n $('.options').css('background','#ffffff');\n $('#question').text(questionsArr[questions_counter].question);\n for(var i=0;i<questionsArr.length;i++){\n $('#'+i).text(questionsArr[questions_counter].answers[i]);\n }\n timeout =setTimeout(noAnswerReset,questionsArr[questions_counter].time_required);\n }", "title": "" }, { "docid": "f1b50f438373adcf629e89ffae339230", "score": "0.47839752", "text": "display() {\r\n if (!this.missing) {\r\n fill(TILE_COLOUR);\r\n rect(this.x, this.y, SCALE, SCALE);\r\n fill(TEXT_COLOUR);\r\n text(this.value, this.x + SCALE/2, this.y + SCALE/2);\r\n }\r\n }", "title": "" }, { "docid": "2438c464d8dcce4d18b57bfaa1cdc091", "score": "0.47816372", "text": "function ToggleLineDisplay( done ){\n\n var active = done.active ? false : true;\n var opacity = active ? 0 : 1;\n d3.select( '#line_' + done.key ).style( 'opacity', opacity );\n done.active = active;\n\n}", "title": "" }, { "docid": "e8d6eb14b7cf0bde50b8c01741b9c05f", "score": "0.4776673", "text": "function brushend() {\n if (brush.empty()) self.svgG.selectAll(\".hidden\").classed(\"hidden\", false);\n }", "title": "" }, { "docid": "5315cd24e65951339ecd62b0fb8a1c9b", "score": "0.47763583", "text": "function brush() {\n \t\n }", "title": "" } ]
c2c0f2525aa4dacd03fbdee9271214a7
declare functions to insert
[ { "docid": "31d178602408b550e16cc5963465f31d", "score": "0.0", "text": "function useReducerReplacement() {\n const dispatcher = resolveDispatcher();\n function reducerWithTracker(state, action) {\n const newState = reducer(state, action);\n timeTravelLList.tail.value.actionDispatched = true;\n window.postMessage({\n type: 'DISPATCH',\n data: {\n state: newState,\n action,\n },\n });\n return newState;\n }\n return dispatcher.useReducer(reducerWithTracker, initialArg, init);\n}", "title": "" } ]
[ { "docid": "e606f35645f4c19d4e82ca2e9c06957c", "score": "0.69985604", "text": "insert() { }", "title": "" }, { "docid": "96ce224af22e2fdb487d38609ad3f6b0", "score": "0.6804177", "text": "function insertQueries() {\n\n }", "title": "" }, { "docid": "0a076399dfe27ca6d741219f2eddbf73", "score": "0.65442127", "text": "Insert() {\n\n }", "title": "" }, { "docid": "2a735bcd8843abc21c5fc1b9a963084f", "score": "0.618318", "text": "function InsertNode() {}", "title": "" }, { "docid": "8a3b78e67c858c9afd0473c8d42e1743", "score": "0.6120212", "text": "function insertFunctions(line) {\n\t\tvar firstWord = line.split(\" \",1)[0];\n\t\tif(functions.indexOf(firstWord) == -1) {\n\t\t\tfor(var i = 0; i < mappings.length; i++) {\t//not functions.length so we don't deal with delay here.\n\t\t\t\tline = replaceValWhereNeeded(line, functions[i], \"\\ntype(\" + mappings[i] + \",false);\");\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var i = 0; i < mappings.length; i++) {\t//not functions.length so we don't deal with delay here.\n\t\t\t\tline = replaceValWhereNeeded(line, functions[i], \"\\ntype(\" + mappings[i] + \",false);\");\n\t\t\t}\n\n\t\t}\n\t\treturn line\n}", "title": "" }, { "docid": "c98fb6db832974bc478b2a4dd5bba5c2", "score": "0.5934519", "text": "insert() { return true; }", "title": "" }, { "docid": "854968b9084f2b14f297242b4e4572d3", "score": "0.58126247", "text": "Insert(int, IUpdate) {\n\n }", "title": "" }, { "docid": "68bb291eb0cba5b3da11a8bc81c4b886", "score": "0.58123225", "text": "static insertNew(to,t,p,cb){\n\t\tquery.execute(conn, 'echec','insert data {:cell'+to+' rdf:type <'+t+'> . :cell'+to+' rdf:type <'+p+'>}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\n\t\t\t//On lance l affichage\n\t\t\tinit.run(cb);\n\t\t}).catch(e=> {console.log(e);});\n\t}", "title": "" }, { "docid": "c763641b18d91a9e10bd584923c4d4c0", "score": "0.5762357", "text": "function User_Insert_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 30;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 31;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = categorie,ta_numero,ta_numero\n\n******************\n*/\n\n var Table=\"typeattribut\";\n var CleMaitre = TAB_COMPO_PPTES[28].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ta_nom=GetValAt(30);\n if (!ValiderChampsObligatoire(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ta_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ta_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ta_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "a4d8363407e3af52c557dca4455e48ef", "score": "0.5692489", "text": "function miFuncion (){}", "title": "" }, { "docid": "6f30728ce3edd950bfb16c468702b3ec", "score": "0.5688152", "text": "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "title": "" }, { "docid": "a7d79a8cc644429c48cc1f97b1040d94", "score": "0.5650832", "text": "function User_Insert_Types_de_journaux_Liste_des_types_de_journaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 201;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typejournal\";\n var CleMaitre = TAB_COMPO_PPTES[199].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tj_libelle=GetValAt(201);\n if (!ValiderChampsObligatoire(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tj_libelle\",TAB_GLOBAL_COMPO[201],tj_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tj_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tj_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tj_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "80cba8025ec915ba1629efb42f12b807", "score": "0.5636663", "text": "InsertRange() {\n\n }", "title": "" }, { "docid": "5203263ee75e56cb9af748a4d64aaadb", "score": "0.5616964", "text": "function write_insert_intos(filename, connection, table_names, field_names, callback) {\n if (table_names && table_names.length) {\n let name = table_names.shift()\n write_insert_into(filename, connection, name, field_names, (err) => {\n if (err) {\n console.log('Error making ' + name + ' insert into statement.')\n callback(err)\n }\n else {\n console.log('Made ' + name + ' insert into statement.')\n write_insert_intos(filename, connection, table_names, field_names, callback)\n }\n })\n }\n else {\n callback(null)\n }\n}", "title": "" }, { "docid": "7640a4b63abf0a49c32afefbfdd1173b", "score": "0.5613465", "text": "function agenda_insert() {\n\tdb.transaction(agenda_insert_db, errorDB, successDB);\n}", "title": "" }, { "docid": "5011e9202c5c2cc1e474c2834e008bcd", "score": "0.5608249", "text": "insert() {\n return true;\n }", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5599564", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5599564", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5599564", "text": "function miFuncion(){}", "title": "" }, { "docid": "3d915a842d742f608f2c14693197bae0", "score": "0.55988467", "text": "function registerFunction(name, ftype, operands, declar, asm, inline, varLength) {\n\t\tvar pos = -1;\n\t\tfor (var i = 0; i < functionTable.length; i++) {\n\t\t\tif (functionTable[i].name == name)\n\t\t\t\tpos = i;\n\t\t}\n\t\tif (pos >= 0 && functionTable[pos].declar == 1) {\n\t\t\tputError(lineCount, 0, name);\n\t\t\t//info(\"\" + lineCount + \" the function \" + name + \" has already been declared\");\n\t\t} else if (pos == -1) {\n\t\t\t//function name, return type, operands, whether a function is declared, whether a function is used, function code, whether to insert a function instead of a jump\n\t\t\tfunctionTable.push({\n\t\t\t\tname: name,\n\t\t\t\ttype: ftype,\n\t\t\t\toperands: operands,\n\t\t\t\tdeclar: declar,\n\t\t\t\tuse: 0,\n\t\t\t\tasm: asm,\n\t\t\t\tinline: inline,\n\t\t\t\tvarLength: varLength\n\t\t\t});\n\t\t} else {\n\t\t\tif (!(functionTable[pos].type == ftype)) {\n\t\t\t\tputError(lineCount, 1, name);\n\t\t\t\t//info(\"\" + lineCount + \" function \" + name + \" does not match the prototype\");\n\t\t\t}\n\t\t\tfunctionTable[pos].declar = declar;\n\t\t\tfunctionTable[pos].asm = asm;\n\t\t\tfunctionTable[pos].varLength = varLength;\n\t\t}\n\t}", "title": "" }, { "docid": "04c686d32955df88395ae918c7fc4bfc", "score": "0.5594465", "text": "function User_Insert_Types_de_personne_Liste_des_types_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 49;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typepersonne\";\n var CleMaitre = TAB_COMPO_PPTES[47].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tp_type=GetValAt(49);\n if (!ValiderChampsObligatoire(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tp_type\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tp_type==\"\" ? \"null\" : \"'\"+ValiderChaine(tp_type)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "978259ce89609ffcdb50f599ec0da180", "score": "0.5586953", "text": "function insertNewUser({ username, firstname, lastname, email, password, admin }) {\n}", "title": "" }, { "docid": "519d59b5e651646a9758c23cd5aa6f8d", "score": "0.5544738", "text": "function User_Insert_Etats_de_personne_Liste_des_états_de_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 1\n\nId dans le tab: 52;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"etatpersonne\";\n var CleMaitre = TAB_COMPO_PPTES[50].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ep_libelle=GetValAt(52);\n if (!ValiderChampsObligatoire(Table,\"ep_libelle\",TAB_GLOBAL_COMPO[52],ep_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ep_libelle\",TAB_GLOBAL_COMPO[52],ep_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ep_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ep_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(ep_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "ed8ce843009da99499f9e2548c34a3b3", "score": "0.55182844", "text": "addMutationFunction(types, tags, funcPtr, priority = 0) {\n if (priority < 0 || priority > 100) {\n throw Error('Priority should be in the range of [0, 100]');\n }\n\n types = types instanceof Array ? types : [types];\n tags = tags instanceof Array ? tags : [tags];\n\n types.map(type => {\n let relevantFunctionsList = this.typeToFuncsMap[type];\n if (!relevantFunctionsList) {\n throw Error('Type ' + type + ' is not supported!');\n }\n let normalizedIndex = (priority / 100) * relevantFunctionsList.length;\n relevantFunctionsList.insert(normalizedIndex, funcPtr);\n\n let normalizedIndexForAll = (priority / 100) * this.typeToFuncsMap['*'].length;\n this.typeToFuncsMap['*'].insert(normalizedIndex, funcPtr);\n });\n\n tags.map(tag => {\n let relevantFunctionsList = this.tagToFuncsMap[tag];\n if (!relevantFunctionsList) {\n throw Error('Tag ' + tag + ' is not supported!');\n }\n // In the tags, we do not discriminate one function to another\n relevantFunctionsList.push(funcPtr);\n this.tagToFuncsMap['*'].push(funcPtr);\n\n if (this.funcToTagsMap[funcPtr]) {\n this.funcToTagsMap[funcPtr].add(tag);\n } else {\n this.funcToTagsMap[funcPtr] = new Set().add(tag);\n }\n });\n }", "title": "" }, { "docid": "061dfb6490de592ae5d1fb7948b982a2", "score": "0.55152386", "text": "function addTable(posit) {\n var query = connection.query('insert into Position set ?', posit, function(err, result) {\n if (err) {\n console.error(err);\n return false;\n } else {\n console.log(query.sql)\n return true;\n }\n })\n}", "title": "" }, { "docid": "f7fb1f49fdda2b8402e3540462bca9c3", "score": "0.54943997", "text": "defineFn(name, words) {this.fnDefs[name] = words;}", "title": "" }, { "docid": "db4b3482ea232689b6c115254c832b1a", "score": "0.5490464", "text": "insert(i, item) {\n }", "title": "" }, { "docid": "4071c3e5f2d003e7a8b629dd69748672", "score": "0.54882836", "text": "function add() {}", "title": "" }, { "docid": "fcf596ef7edee1d9bc67b30673769dfb", "score": "0.5487529", "text": "function putFunction(head, body) {\n putData($(\"#functions-list\"), head, body);\n}", "title": "" }, { "docid": "7e08e503268f0cf67074de6a6ef7c194", "score": "0.54841644", "text": "function InsertarCuentos(Cuentos) {\n\n db.transaction(InsertCuentos, errorinsertCuentos, successinsertCuentos);\n\n var sql = \"INSERT OR REPLACE INTO Cuentos (NombreCuento,ID_Colecciones) \";\n sql += \"VALUES ('\" + Cuentos.Nombre + \"', '\" + Cuentos.Coleccion + \"')\";\n function InsertCuentos(tx) {\n tx.executeSql(sql);\n }\n\n function errorinsertCuentos(tx, err) {\n alert(\"Error al Insertar cuentos: \" + err);\n }\n\n function successinsertCuentos() {\n // alert(\"success_hecho!\");\n }\n\n}", "title": "" }, { "docid": "f4e06019463f8ae402b16c43eefe6bee", "score": "0.5438205", "text": "registerTableFunction(name, func){\n\t\tif(typeof this.table[name] === \"undefined\"){\n\t\t\tthis.table[name] = (...args) => {\n\t\t\t\tthis.table.initGuard(name);\n\t\t\t\t\n\t\t\t\treturn func(...args);\n\t\t\t};\n\t\t}else{\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\n\t\t}\n\t}", "title": "" }, { "docid": "e4e7805a21caeb98e1bf7c9056df22a4", "score": "0.5437535", "text": "registerTableFunction(name, func){\n\t\tif(typeof this.table[name] === \"undefined\"){\n\t\t\tthis.table[name] = func;\n\t\t}else{\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name)\n\t\t}\n\t}", "title": "" }, { "docid": "1af7da11a3aed98df322858a38711722", "score": "0.54366946", "text": "FunctionDeclaration() {\n pushContext();\n }", "title": "" }, { "docid": "713ba252f2ba43123b4bec54ba023e13", "score": "0.54200625", "text": "function addData(question,answer,option1,option2,option3,table){ \n\tvar createSql=\"create table if not exists \"+table+\"(question text,answer text,option1 text,option2 text,option3 text)\";\n\tvar insertSql=\"insert into \"+table+\" values(?,?,?,?,?)\";\n\n db.transaction(function(tx)\n\t{ \t\n\t \ttx.executeSql(createSql,[])\n\t\ttx.executeSql(insertSql,[question,answer,option1,option2,option3],onSuccess,onError)\t\t\n }); \n}", "title": "" }, { "docid": "434d03967511635f7c8d1089d11dfcf0", "score": "0.54179937", "text": "function beforeInsert(row, errors){\r\n beforeBoth(errors, row);\r\n}", "title": "" }, { "docid": "d84a5c7670b9447ae0be513d12798148", "score": "0.54001325", "text": "function User_Insert_Types_de_lien_Liste_des_types_de_lien_entre_personne0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 45;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 46;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"typelien\";\n var CleMaitre = TAB_COMPO_PPTES[43].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tl_libelle=GetValAt(45);\n if (!ValiderChampsObligatoire(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_libelle\",TAB_GLOBAL_COMPO[45],tl_libelle))\n \treturn -1;\n var tl_description=GetValAt(46);\n if (!ValiderChampsObligatoire(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tl_description\",TAB_GLOBAL_COMPO[46],tl_description))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",tl_libelle,tl_description\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(tl_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_libelle)+\"'\" )+\",\"+(tl_description==\"\" ? \"null\" : \"'\"+ValiderChaine(tl_description)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "afd86cd7704152da7724861272f81b3e", "score": "0.53926325", "text": "createTables(callback) {\n\t\tthis._connection.query(\n\t\t\tsql.merge(sql.users.create, sql.products.create, sql.addresses.create, sql.purchases.create, sql.paymethods.create),\n\t\t\tfunction(err, result) {\n\t\t\t\tif(typeof callback === 'function')\n\t\t\t\t\tcallback(err);\n\t\t\t});\n\t}", "title": "" }, { "docid": "574f47f045ad1b4e5ce7fb04997bbde9", "score": "0.53898156", "text": "function insertDB(tx, user) {\n // store the template SQL string\n var sql = 'INSERT INTO users (role, name, username, email, password, description) VALUES (?,?,?,?,?,?)';\n // execute the query with user information from the user object\n tx.executeSql(sql, [user.role, user.name, user.username, user.email, user.password, user.description], function(tx){registerSuccessDB(tx, user)}, errorCB);\n}", "title": "" }, { "docid": "615b739177005d19fdbae8c52e5a4070", "score": "0.5371349", "text": "function insertdb(user_name, user_password, user_email,fisrt_name,last_name, callback) {\n var sql=\"INSERT INTO user (user_name,user_password,user_email,fisrt_name,last_name) VALUES ('\" + user_name + \"','\" + user_password + \"','\" + user_email + \"','\"+ fisrt_name + \"','\" + last_name + \"' ) \";\n connection.query(sql, function(err, result, fields) {\n if (err) {\n console.log('this.sql', this.sql); //command/query\n callback(err, null);\n } else callback(null, result);\n });\n}", "title": "" }, { "docid": "952a2e4f6576e37e091e33abf8a104c3", "score": "0.53604424", "text": "insert(val, idx) {\n\n }", "title": "" }, { "docid": "37232ba5b19775b4f01be5a7efaf17f9", "score": "0.53598124", "text": "function insertTableValues(dynamicTableValues)\r\n{\r\n\tdb.transaction(function(transaction){ insertvalues(transaction, dynamicTableValues);}, errorCB, successCB);\r\n}", "title": "" }, { "docid": "2fab9cb3b7ebdb913fa2ff5564e9abac", "score": "0.5359177", "text": "function customFunction() {\n //Statements\n }", "title": "" }, { "docid": "088f45573487cbe8515761ac011b64d8", "score": "0.535325", "text": "function insert(e, ls){\r\n var inst = getInstance(Ord, typeOf(e));\r\n return insertBy(inst.compare, e, ls);\r\n}", "title": "" }, { "docid": "d70537b119e032dfaf26c7ee71dd8e56", "score": "0.5349351", "text": "function addCol(){\n\n}", "title": "" }, { "docid": "e8525b90bfd7a1a224c4dbe806167180", "score": "0.53409815", "text": "onInsert(callback) {\n return this.__internal.addInsertCallback(callback)\n }", "title": "" }, { "docid": "aadacadf0339e43382b154082a26a78c", "score": "0.53376794", "text": "function makeInsert(table, params, cb) {\n let sql = \"\";\n if (table == \"items\") {\n sql = \"insert into items (creatorid, name, description, starting_bid, deadline, contact, image, status, highest_bidder) values (\";\n sql += params.loginID + \",\\\"\" + params.name + \"\\\",\\\"\" + params.description + \"\\\",\" + params.starting_bid;\n sql += \",\\\"\" + params.deadline + \"\\\",\";\n sql += (params.contact != '') ? params.contact : \"0\";\n sql += \",\";\n sql += \"\\\"\" + params.image + \"\\\",\\\"N\\\", \" + params.loginID + \");\";\n } else {\n sql = \"insert into users (rno, name, pwd, pno) values (\\\"\" + params.rno + \"\\\", \\\"\";\n sql += params.name + \"\\\", \\\"\" + md5(params.pwd) + \"\\\", \" + params.pno + \");\";\n }\n queryInsert(sql, (res) => {\n cb(res);\n });\n}", "title": "" }, { "docid": "18e4631ebc2d0943f3560d5e0e4b7a37", "score": "0.5331636", "text": "static insert (confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime, callback) {\n const insertQuery = `INSERT INTO reservation(confNo, vtname, cellphone, dlicense, \n fromDate, fromTime, toDate, toTime) VALUES($1, $2, $3, $4, $5, $6, $7, $8) \n RETURNING *;`\n db.query(insertQuery, [confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime], (err, res) => {\n if (err.error)\n return callback(err);\n callback(res);\n });\n }", "title": "" }, { "docid": "f6d38ff9e7f4e5faeb39f40b2769ad92", "score": "0.53252345", "text": "function insertData(sqlQuery, obj, successFn, errFn){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n console.log(\"\\nObJ : \" + obj);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(successFn)successFn(obj, res.insertId);\r\n if(res != undefined)\r\n console.log('Last insert ID:', res.insertId);\r\n }, errFn);\r\n });\r\n}", "title": "" }, { "docid": "50dabcff5d7d6be50d5ef9924008ea37", "score": "0.53176755", "text": "function User_Insert_Villes_Liste_des_villes0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 126;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 127;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = canton,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"ville\";\n var CleMaitre = TAB_COMPO_PPTES[123].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var vi_nom=GetValAt(126);\n if (!ValiderChampsObligatoire(Table,\"vi_nom\",TAB_GLOBAL_COMPO[126],vi_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"vi_nom\",TAB_GLOBAL_COMPO[126],vi_nom))\n \treturn -1;\n var ct_numero=GetValAt(127);\n if (ct_numero==\"-1\")\n ct_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ct_numero\",TAB_GLOBAL_COMPO[127],ct_numero,true))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",vi_nom,ct_numero\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(vi_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(vi_nom)+\"'\" )+\",\"+ct_numero+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "aacde1e4133c029e7a34312c48ac6bb0", "score": "0.5295425", "text": "create(cols, vals, cb) {\n orm.insertOne(\n 'burgers',\n cols, vals, (res) => cb(res)\n );\n }", "title": "" }, { "docid": "ec04563374bd336ab0ca17a53d2ffb26", "score": "0.5277974", "text": "function EditLogItemInsert () {}", "title": "" }, { "docid": "19fd178c0ec2dac376a7fb20ab43e157", "score": "0.52726483", "text": "function functionDeclaration() {}", "title": "" }, { "docid": "52904690a7da24e63e145df023925e64", "score": "0.5258674", "text": "function _exec_funcdef(ast, context, debug) {\n var FRecord = new ObjectClass.SFunction();\n FRecord.closure_active_record = context;\n var funcName = \"\";\n for (var item in ast.sons) {\n if (ast.sons[item].type == \"NAME\"){\n funcName = ast.sons[item].value;\n FRecord.name = funcName;\n FRecord.ast = ast;\n }\n if (ast.sons[item].type == \"PARAMETERS\") {\n FRecord.argument_list = _exec_parameters(ast.sons[item],context);\n }\n }\n var func = new ObjectClass.SObject();\n func.type = \"Func\";\n func.value = FRecord;\n func.name = funcName;\n context.allEntry[funcName] = func;\n }", "title": "" }, { "docid": "2ce9aadf93dd9d4dcd070efa6b2528be", "score": "0.5254852", "text": "function addRow() {\n}", "title": "" }, { "docid": "29239ae7e8abebe9c0daf84766453c22", "score": "0.524346", "text": "function insertRecord(){\n\n var usernametemp = $('input:text[id=username]').val();\n\n var usernameemailtemp = $('input:text[id=useremail]').val();\n\n db.transaction(function (tx){ tx.executeSql(insertStatemen); });\n\n //tx.executeSql(SQL Query Statement,[ Parameters ] , Sucess Result Handler Function, Error Result Handler Function);\n}", "title": "" }, { "docid": "4b802d41c00850a53c70e948be1405cc", "score": "0.52380943", "text": "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "title": "" }, { "docid": "c6e2be200b536365aa5ce873382a8c5a", "score": "0.5237441", "text": "function pushAdditional(fn) {\n\t var child = new this.constructor(this.client, this.tableCompiler, this.columnBuilder);\n\t fn.call(child, (0, _tail3.default)(arguments));\n\t this.sequence.additional = (this.sequence.additional || []).concat(child.sequence);\n\t}", "title": "" }, { "docid": "4e78c8f0c09a289fc4bd2ab69dd69317", "score": "0.5233449", "text": "insert(h_query) {\n\n\t\t// ref insert list\n\t\tlet a_inserts = h_query.insert;\n\n\t\t// prep list of rows that have been observed from first element\n\t\tlet a_keys = Object.keys(a_inserts[0]);\n\n\t\t// build columns part of sql string\n\t\tlet s_keys = a_keys.map(s_key => `\"${s_key}\"`).join(',');\n\n\t\t// build values part of sql string\n\t\tlet a_rows = [];\n\n\t\t// each insert row\n\t\ta_inserts.forEach((h_row) => {\n\n\t\t\t// list of values to insert for this row\n\t\t\tlet a_values = [];\n\n\t\t\t// each key-value pair in row\n\t\t\tfor(let s_key in h_row) {\n\n\t\t\t\t// key is missing from accepted values section\n\t\t\t\tif(-1 === a_keys.indexOf(s_key)) {\n\t\t\t\t\treturn local.fail('new key \"${s_key}\" introduced after first element in insert chain');\n\t\t\t\t}\n\n\t\t\t\t// append to values\n\t\t\t\ta_values.push(valuify(h_row[s_key]));\n\t\t\t}\n\n\t\t\t// push row to values list\n\t\t\ta_rows.push(`(${a_values.join(',')})`);\n\t\t});\n\n\t\t//\n\t\tlet s_tail = '';\n\n\t\t//\n\t\tif(h_query.conflict_target && h_query.conflict_action) {\n\t\t\ts_tail += `on conflict ${h_query.conflict_target} ${h_query.conflict_action}`;\n\t\t}\n\n\t\t// prep sql query string\n\t\treturn `insert into \"${h_query.into}\" (${s_keys}) values ${a_rows.join(',')} ${s_tail}`;\n\t}", "title": "" }, { "docid": "8b7d8e5d989e1b83d3c0607b9999c64f", "score": "0.52304095", "text": "function addDWOperationFunctions() {\n\ttry {\n\t\tMM.BC.log(' ---- adding dw operations ---- ')\n\t\tif (globals.webKitWin.bcEndpoints) {\n\t\t\tglobals.webKitWin.bcEndpoints.openUrl = MM.BC.UI_UTILS.openPopupWindow;\n\t\t\tglobals.webKitWin.bcEndpoints.insertCode = function(code) {\n\t\t\t\twindow.close(); \n\t\t\t\tMM.BC.codeToInsert = code;\n\t if (typeof (dw.bcLog) == \"function\") {\n\t dw.bcLog(\"insert\");\n\t }\n\t\t\t}; \n\t\t\tglobals.webKitWin.bcEndpoints.onBrowseFile = onBrowseFile; \n\t\t\tglobals.webKitWin.bcEndpoints.closePopup = closePopup;\n\t\t\tglobals.webKitWin.bcEndpoints.getCurrentDocumentPath = MM.BC.UI_UTILS.getCurrentDocumentPath;\n\t\t\tglobals.webKitWin.bcEndpoints.showRetry = showCallFailed;\n\t\t\t\n\t\t\tsetWindowButtons();\n\t\t\t\n\t\t\t// Set focus to the small browser so the next tab key drills into the elements within//\n\t\t\tif (globals.browser) globals.browser.focus();\n\t\t}\n\t\n\t\n\t} catch (e) {\n\t\tlogMessage(REP_ITEM_NOTE, 'addDWOperationFunctions', 'error connecting to the web page end points');\n\t}\n}", "title": "" }, { "docid": "c7ac5527a632830d32d673aa185aebec", "score": "0.5229521", "text": "function import_funcs(funcs) {\n \"use strict\";\n Dum_Dum_Boom_Boom.common.base.eachs(funcs, function (name, func) {\n window[name] = func;\n });\n }", "title": "" }, { "docid": "429c55ad6c7fe3eed27f1fcd2c4f898c", "score": "0.5226985", "text": "function GuardarPagina(numpage){\n\n db.transaction(InsertPage,errorinsertPage, successinsertPage);\n\n var sql = \"INSERT INTO Paginas (ID_Paginas,ID_Cuento) \";\n sql += \"VALUES ('\"+ numpage +\"', '\"+ CuentoActual.ID.split('_')[1] +\"')\";\n function InsertPage(tx) {\n tx.executeSql(sql);\n }\n\n function errorinsertPage(tx, err) {\n alert(\"Error al guardar página: \"+err);\n }\n\n function successinsertPage() {\n }\n}", "title": "" }, { "docid": "dd9b83814d95db23a0e3cc0ec5b27960", "score": "0.52088517", "text": "function funcionPorDefinicion(){\n //Body\n }", "title": "" }, { "docid": "53cb5b11086809c484e61c5692161780", "score": "0.5207664", "text": "function Func_s() {\n}", "title": "" }, { "docid": "c59ea61c2dff915d3681daaca518125b", "score": "0.52004075", "text": "function creq()\r\n{\r\n\tvar tabla = document.getElementById('tabla_eq');\r\n\tvar oRow = tabla.insertRow(-1);\r\n\tvar oCell = oRow.insertCell(-1);\r\n\tvar oCell.innerHTML = 'funciona';\r\n}", "title": "" }, { "docid": "5422688bedf50ea15bffe3892b574023", "score": "0.5199296", "text": "static createInsert(queryObject){\n let prototype = 'INSERT INTO ' + queryObject.structure.table;\n if(queryObject.structure.insertColumns.length>0){\n prototype += '( '\n for(let i = 0; i < queryObject.structure.insertColumns.length; i++){\n prototype += queryObject.structure.insertColumns[i]\n if(i!=queryObject.structure.insertColumns.length-1){\n prototype+= ', '\n }\n else{\n prototype+= ' '\n }\n }\n prototype += ') '\n }\n else{\n prototype += ' '\n }\n prototype += 'VALUES'\n let queryString = [];\n for(let i = 0; i < queryObject.structure.insertValues.length; i++){\n let values = '( ';\n for(let j = 0; j < queryObject.structure.insertValues[i].length; j++){\n if(typeof(queryObject.structure.insertValues[i][j])==typeof(\"\")){\n values += \"'\"+queryObject.structure.insertValues[i][j]+\"'\";\n } else if(queryObject.structure.insertValues[i][j].isDate){\n values += `TO_DATE( '${queryObject.structure.insertValues[i][j].date}', '${queryObject.structure.insertValues[i][j].format}')`;\n } \n else{\n values += Query.checkForBooleans(queryObject.structure.insertValues[i][j]);\n }\n if(j!=queryObject.structure.insertValues[i].length-1){\n values+= ', '\n }\n else{\n values+= ' '\n }\n }\n values += ') ';\n queryString.push(prototype+values+(queryObject.structure.returnId?\"RETURN id INTO :id\":\"\"));\n }\n return queryString[0];\n }", "title": "" }, { "docid": "7d419ce6967e7256cee15b7474467133", "score": "0.51938635", "text": "function onInsertColumnAfter() {\n onInsertColumn(1);\n }", "title": "" }, { "docid": "5d6f9813eb9f0e21a774bc97e3a83080", "score": "0.51894325", "text": "function agenda_insert_db(tx) {\n\tvar nome = $(\"#agenda_nome\").val();\n\tvar tel = $(\"#agenda_telefone\").val();\n\ttx.executeSql('INSERT INTO Agenda (nome, tel) VALUES (\"' + nome + '\", \"' + tel + '\")');\n\tagenda_view();\n}", "title": "" }, { "docid": "a7153abbf53c70a54e1e1fb4f98ada57", "score": "0.51846534", "text": "function tableInsertionCallback(err) {\n if (err) {\n console.log(\"userdb; new user insertion error\", err);\n } else {\n console.log(\"userdb; new user insertion success\");\n }\n }", "title": "" }, { "docid": "ab8195e765d8d8a96c1bee9609fb2a3b", "score": "0.5184246", "text": "insertInfo(){\n var self = this;\n var str = \"\",\n length = self.column.length,\n table = self.table,\n last = self.column.length - 1;\n for(let x = 0; x < length ; x++){\n if( x === last){\n str += self.column[x];\n continue;\n }\n str += self.column[x]+\",\";\n }\n\n self.insert = `INSERT INTO ${table} (${str}) VALUES \\n`;\n\n}", "title": "" }, { "docid": "984dcfe3bb6489d8c98ad9e9a95ef031", "score": "0.51789576", "text": "function User_Insert_Cantons_Liste_des_cantons0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 140;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 141;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = ville,ct_numero,ct_numero\n\n******************\n*/\n\n var Table=\"canton\";\n var CleMaitre = TAB_COMPO_PPTES[137].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ct_nom=GetValAt(140);\n if (!ValiderChampsObligatoire(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ct_nom\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ct_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ct_nom)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "77d4ff6028a2ffe98e4d6e87a866624a", "score": "0.51778525", "text": "function registerPostParseFunction(fn){\r\n\tif (isFunction(fn)) {\r\n\t\tif (typeof fn == 'object') {\r\n\t\t\tpostParse = postParse.concat(fn);\r\n\t\t} else {\r\n\t\t\tpostParse[postParse.length++] = fn;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "cb596b84df13ecd5bf81a18e381b0cec", "score": "0.517323", "text": "insertNewEmployee() {\n return `INSERT INTO employee (first_name, last_name, role_id, manager_id)\n VALUES (?, ?, ?, ?);`\n}", "title": "" }, { "docid": "3d0fad8f4158b4b4d4c0947b5f0a3630", "score": "0.5172931", "text": "insertOne(cols, values, cb) {\n console.log(\"burgervals \" + values);\n orm.insertOne('burgers', cols, values, (res) => cb(res));\n }", "title": "" }, { "docid": "67bf6bcf07e54b5bb85672240f68c4c8", "score": "0.5165005", "text": "add({i, n, s, b, ph}, callback) {\r\n if (s < 0 || 2 < s)\r\n callback(new RangeError('Invalid s: s should between 0 and 2'));\r\n else\r\n pool.query('insert into empl values (?,?,?,?,?,default)',\r\n [i, n, s, b, ph],\r\n (e, r) => {\r\n if (e)\r\n if (e.code === 'ER_DUP_ENTRY') callback(0, 2);\r\n else callback(e);\r\n else callback(0, r.affectedRows);\r\n });\r\n }", "title": "" }, { "docid": "2c91d3a99ba0877c8621dd14f2a9ad06", "score": "0.51612985", "text": "custom(fn) {\r\n\t\treturn this.push('fn', [...arguments]);\r\n\t}", "title": "" }, { "docid": "e708f6cc8a6a1a7ffeb560e0c290395d", "score": "0.5152929", "text": "function ea(){}", "title": "" }, { "docid": "1254d578ccedbbd81b7c10f5ac8035bf", "score": "0.5147613", "text": "function afficheInsert(){\n\t\n\tinsert = Initxhr();\n\t\n\tvar url = 'insert.php';\n\n\tinsert.onreadystatechange = traiterInsert;\n\tinsert.open( \"GET\", url, true );\n\tinsert.send( null );\n}", "title": "" }, { "docid": "900e81c73b41409688013bee2a14e3e2", "score": "0.51420605", "text": "function add(tipo,cidade,bairro,data,horario,tmusicos,torganistas){\n\t\n\n\ndb = window.sqlitePlugin.openDatabase({name: 'DB', location: 'default'});\n\ndb.executeSql('INSERT INTO ensaios (tipo, cidade, bairro, data, horario, tmusicos, torganistas) VALUES (?,?,?,?,?,?,?)', [tipo, cidade, bairro, data, horario, tmusicos, torganistas]);\n\n\nreturn 'ok';\n\n\n}", "title": "" }, { "docid": "172816580472bd0e3e60f02216ec7df7", "score": "0.51380086", "text": "function User_Insert_Codes_postaux_Liste_des_codes_postaux0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 3\n\nId dans le tab: 131;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 132;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 135;\ncomplexe\nNbr Jointure: 2;\n Joint n° 0 = villecp,cp_numero,cp_numero\n Joint n° 1 = ville,vi_numero,vi_numero\n\n******************\n*/\n\n var Table=\"codepostal\";\n var CleMaitre = TAB_COMPO_PPTES[128].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var cp_codepostal=GetValAt(131);\n if (!ValiderChampsObligatoire(Table,\"cp_codepostal\",TAB_GLOBAL_COMPO[131],cp_codepostal,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cp_codepostal\",TAB_GLOBAL_COMPO[131],cp_codepostal))\n \treturn -1;\n var cp_bureau=GetValAt(132);\n if (!ValiderChampsObligatoire(Table,\"cp_bureau\",TAB_GLOBAL_COMPO[132],cp_bureau,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cp_bureau\",TAB_GLOBAL_COMPO[132],cp_bureau))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",cp_codepostal,cp_bureau\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(cp_codepostal==\"\" ? \"null\" : \"'\"+ValiderChaine(cp_codepostal)+\"'\" )+\",\"+(cp_bureau==\"\" ? \"null\" : \"'\"+ValiderChaine(cp_bureau)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\n\n/* table ville*/\nLstDouble_Exec_Req(GetSQLCompoAt(135),CleMaitre);\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "6aebaaab46a3072a2da04123f5385352", "score": "0.51378214", "text": "function gen_op_neon_insert_elt(param1, param2)\n{\n //gen_opparam_ptr.push(param1);\n //gen_opparam_ptr.push(param2);\n gen_opc_ptr.push({func:op_neon_insert_elt, param:param1, param2:param2});\n}", "title": "" }, { "docid": "0067f7446b817bf9f348d90404ab9370", "score": "0.51339746", "text": "function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return function(e,n){var r=e.selection.$from,o=r.pos.pos;return n(e.tr.insertText(t,o)),!0}}", "title": "" }, { "docid": "93070a4b7bd380260b755094013173fb", "score": "0.5131911", "text": "function add() {\n // TODO: your code here\n}", "title": "" }, { "docid": "1f40d88faca6b1906cec701024945aca", "score": "0.51312387", "text": "function insert() {\r\n let query = \"command=insert\"; //https://eia2-michel.herokuapp.com/command=insert&name=peter&punkte=100\r\n query += \"&name=\" + HabosHaihappen.spielerName;\r\n query += \"&punkte=\" + HabosHaihappen.highscore;\r\n sendRequest(query, handleInsertResponse);\r\n }", "title": "" }, { "docid": "569ecf93a973d85c40d9b9797ebba7aa", "score": "0.5130465", "text": "function quickinsertPERS( pFramedata )\r\n{\r\n var statements = [];\r\n\r\n if (pFramedata[\"PERSID\"] == undefined) \r\n {\r\n pFramedata[\"PERSID\"] = a.getNewUUID(); //Neue Person mit neuer ID anlegen\r\n \r\n var fields = [\"PERSID\", \"SALUTATION\", \"TITLE\", \"FIRSTNAME\", \"LASTNAME\", \"DATE_NEW\", \"USER_NEW\"];\r\n var types = a.getColumnTypes(\"PERS\", fields);\r\n statements.push([\"PERS\", fields, types, getColumnValues(fields, pFramedata)]);\r\n }\r\n \r\n pFramedata[\"STATUS\"] = \"1\";\r\n pFramedata[\"PERS_ID\"] = pFramedata[\"PERSID\"];\r\n pFramedata[\"PERSRELID\"] = a.sql(\"select RELATIONID from RELATION where ORG_ID = '\" + pFramedata[\"ORGID\"] + \"' and PERS_ID = '\" + pFramedata[\"PERSID\"] + \"'\"); \r\n pFramedata[\"STANDARD\"] = \"1\";\r\n pFramedata[\"ADDR_TYPE\"] = \"1\";\r\n \r\n if( pFramedata[\"PERSRELID\"] == \"\") \r\n {\r\n if ( pFramedata[\"ORGID\"] == \"0\") //Eine Privatperson\r\n {\r\n pFramedata[\"RELATIONID\"] = a.getNewUUID();\r\n pFramedata[\"RELATION_ID\"] = pFramedata[\"RELATIONID\"];\r\n pFramedata[\"PERSRELID\"] = pFramedata[\"RELATIONID\"];\r\n pFramedata[\"ADDRESSID\"] = a.getNewUUID();\r\n pFramedata[\"ADDRESS_ID\"] = pFramedata[\"ADDRESSID\"];\r\n pFramedata[\"ORG_ID\"] = pFramedata[\"ORGID\"];\r\n //Relation\r\n fields = [\"RELATIONID\", \"ORG_ID\", \"PERS_ID\", \"ADDRESS_ID\", \"LANG\", \"SOURCE\" ,\"DATE_NEW\", \"USER_NEW\"]; \r\n types = a.getColumnTypes(\"RELATION\", fields);\r\n statements.push([\"RELATION\", fields, types, getColumnValues(fields, pFramedata)]);\r\n \r\n //Adresse\r\n fields = new Array(\"ADDRESSID\", \"RELATION_ID\", \"ADDR_TYPE\", \"ADDRESS\", \"BUILDINGNO\", \"ZIP\", \"CITY\", \"COUNTRY\", \"DATE_NEW\", \"USER_NEW\");\r\n types = a.getColumnTypes( \"ADDRESS\", fields);\r\n statements.push([\"ADDRESS\", fields, types, getColumnValues(fields, pFramedata)]);\r\n \r\n }\r\n else //Person in Firma\r\n {\r\n // Pers-Relation\r\n pFramedata[\"PERSRELID\"] = a.getNewUUID();\r\n fields = [\"RELATIONID\", \"ORG_ID\", \"PERS_ID\", \"ADDRESS_ID\", \"STATUS\", \"LANG\", \"SOURCE\", \"DEPARTMENT\", \"RELTITLE\", \"DATE_NEW\", \"USER_NEW\"];\r\n types = a.getColumnTypes(\"RELATION\", fields);\r\n pFramedata[\"RELATIONID\"] = pFramedata[\"PERSRELID\"];\r\n statements.push([\"RELATION\", fields, types, getColumnValues(fields, pFramedata)]);\r\n }\r\n a.imagevar(\"$image.relpersid\", pFramedata[\"PERSRELID\"]);\r\n //COMM-Daten zu Person anlegen\r\n fields = [\"COMMID\", \"RELATION_ID\", \"MEDIUM_ID\", \"ADDR\", \"STANDARD\", \"DATE_NEW\", \"USER_NEW\", \"SEARCHADDR\"];\r\n types = a.getColumnTypes(\"COMM\", fields);\r\n\r\n pFramedata[\"RELATION_ID\"] = pFramedata[\"PERSRELID\"];\r\n if(pFramedata[\"TELEFON\"] != \"\" )\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"TELEFON\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"1\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"1\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Telefon\r\n }\r\n if(pFramedata[\"FAX\"] != \"\" && pFramedata[\"ORGID\"] == \"0\")\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"FAX\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"2\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"2\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Fax\r\n }\r\n if (pFramedata[\"EMAIL\"] != \"\" ) \r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"EMAIL\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"3\";\r\n pFramedata[\"SEARCHADDR\"] = \"\";\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Email\r\n }\r\n if (pFramedata[\"INTERNET\"] != \"\" && pFramedata[\"ORGID\"] == \"0\") \r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"INTERNET\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"4\"\r\n pFramedata[\"SEARCHADDR\"] = \"\";\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); // Internet \r\n }\r\n if(pFramedata[\"MOBIL\"] != \"\")\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"MOBIL\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"5\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"5\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Mobil\r\n }\r\n }\r\n a.sqlInsert(statements);\r\n if( a.hasvar(\"$image.nodupPers\") )\r\n { \r\n var nodupPers = a.valueofObj(\"$image.nodupPers\");\r\n for ( var i = 0; i < nodupPers.length; i++) noduplicate(pFramedata[\"PERSID\"], nodupPers[i]);\r\n }\r\n return pFramedata;\r\n}", "title": "" }, { "docid": "eb4b9693054b8f72fb3fa7ca2abb1658", "score": "0.51297146", "text": "insertOne(table,cols,vals,cb) {\n let query = `INSERT INTO ${table}`;\n query += ` (${cols.toString()}) `;\n query += ` VALUES (${printQuestionMarks(vals.length)})`;\n \n connection.query(query,vals,(err,result) =>{\n if(err) throw err;\n cb(result);\n });\n }", "title": "" }, { "docid": "8fe67378cbbba1dc256a6d294715a568", "score": "0.5129329", "text": "function insertChampionName(){\n\n}", "title": "" }, { "docid": "14ccdbca34f104a6fa828e7932d7a3b5", "score": "0.5122796", "text": "function insertSQL(table, obj) {\r\n // your code here\r\n let tableColumns = '(';\r\n let values = '(';\r\n for(var key in obj){\r\n tableColumns += String(key) + ',';\r\n values += String(obj[key]) + ',';\r\n }\r\n tableColumns -= ',';\r\n values -= ',';\r\n let statement = 'insert into ' + table + tableColumns +') values' + values + ')' ;\r\n statement += table;\r\n return statement;\r\n}", "title": "" }, { "docid": "889a2195b892e5a1dd89c42be615215d", "score": "0.5121914", "text": "function creation(request,response,table,params) {\n\tconst req=request.query\n\tconst query=\"INSERT INTO \"+table+\" SET ?\";\n\tvar params2=[];\n\tconst params3={nom:req.nom,surnom:req.surnom,qtte_heures:req.qtth,qtte_heures_sup:req.qtthsup}\n\tfor(var i = 0;i<params.length;i++){\n\t\tparams2.push(params[i]+':req.'+params[i]);\n\t}\n\tconsole.log(params2);\n\tconnection.query(query,params2,(err,result,fields) => {\n \t\tif(err) throw err;\n \t\tresponse.json({saved:result.affectedRows,inserted_id:result.insertId})\n\t});\n}", "title": "" }, { "docid": "61cf5950dbd14fb82d28e7065daa1009", "score": "0.5120213", "text": "insert(table) {\n return new DBInserter(this, table);\n }", "title": "" }, { "docid": "1bc0bef6dc2286ff42f45489ba8f65e4", "score": "0.5109038", "text": "function CustomSQLDo() {\n}", "title": "" }, { "docid": "6ce7a1aad1bfbfb2f86a8855a3b1d059", "score": "0.51077896", "text": "function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return function(t,n){var r=t.selection.$from,i=r.pos.pos;return n(t.tr.insertText(e,i)),!0}}", "title": "" }, { "docid": "e1220c36f12123bcd9130472e876e432", "score": "0.51073843", "text": "function insSQL(){\n var sql = 'INSERT INTO pim_transfers(';\n sql += 'user_id, manufacturer_id, from_id, to_id, products, status_id, delivery_date, type_id, notes)VALUES(';\n sql += '$1::integer, $2::integer, $3::integer, $4::integer, $5::json, $6::integer,';\n sql += ' $7::timestamp without time zone, $8::integer, $9::json) RETURNING id;';\n return sql;\n}", "title": "" }, { "docid": "757915b5785157ba69ab9e35ddbe1339", "score": "0.5090708", "text": "function addFunction() {\r\n element.appendChild(mouseSattelite);\r\n O$._mouseSatteliteTrackMouse(mouseSattelite);\r\n element.onmouseover = function () {\r\n O$._mouseSatteliteShow(mouseSattelite);\r\n };\r\n element.onmouseout = function () {\r\n O$._mouseSatteliteHide(mouseSattelite);\r\n };\r\n O$._bugFix_IEPng(mouseSattelite);\r\n }", "title": "" }, { "docid": "185adc11e99ef9bf0c8b556b349308a7", "score": "0.50883424", "text": "function addNewUser() {\n}", "title": "" }, { "docid": "8efadd7c26b926c6087430bfef4239f6", "score": "0.5076601", "text": "_register_callbacks() {\n this._sort.addEventListener(\"drop\", drop.bind(this));\n\n this._sort.addEventListener(\"dragend\", dragend.bind(this));\n\n this._sort.addEventListener(\"dragenter\", dragenter.bind(this));\n\n this._sort.addEventListener(\"dragover\", dragover.bind(this));\n\n this._sort.addEventListener(\"dragleave\", dragleave.bind(this));\n\n this._row_pivots.addEventListener(\"drop\", drop.bind(this));\n\n this._row_pivots.addEventListener(\"dragend\", dragend.bind(this));\n\n this._row_pivots.addEventListener(\"dragenter\", dragenter.bind(this));\n\n this._row_pivots.addEventListener(\"dragover\", dragover.bind(this));\n\n this._row_pivots.addEventListener(\"dragleave\", dragleave.bind(this));\n\n this._column_pivots.addEventListener(\"drop\", drop.bind(this));\n\n this._column_pivots.addEventListener(\"dragend\", dragend.bind(this));\n\n this._column_pivots.addEventListener(\"dragenter\", dragenter.bind(this));\n\n this._column_pivots.addEventListener(\"dragover\", dragover.bind(this));\n\n this._column_pivots.addEventListener(\"dragleave\", dragleave.bind(this));\n\n this._filters.addEventListener(\"drop\", drop.bind(this));\n\n this._filters.addEventListener(\"dragend\", dragend.bind(this));\n\n this._filters.addEventListener(\"dragenter\", dragenter.bind(this));\n\n this._filters.addEventListener(\"dragover\", dragover.bind(this));\n\n this._filters.addEventListener(\"dragleave\", dragleave.bind(this));\n\n this._active_columns.addEventListener(\"drop\", column_drop.bind(this));\n\n this._active_columns.addEventListener(\"dragenter\", dragenter.bind(this));\n\n this._active_columns.addEventListener(\"dragend\", column_dragend.bind(this));\n\n this._active_columns.addEventListener(\"dragover\", column_dragover.bind(this));\n\n this._active_columns.addEventListener(\"dragleave\", column_dragleave.bind(this));\n\n this._add_expression_button.addEventListener(\"click\", this._open_expression_editor.bind(this));\n\n this._add_expression_button.addEventListener(\"-perspective-close-expression\", this._close_expression_editor.bind(this));\n\n this._transpose_button.addEventListener(\"click\", this._transpose.bind(this));\n\n this._vis_selector.addEventListener(\"change\", this._vis_selector_changed.bind(this));\n\n this._vieux.addEventListener(\"perspective-vieux-reset\", () => this.reset());\n\n this._vieux.addEventListener(\"perspective-vieux-resize\", () => this._plugin.resize.call(this));\n\n this._vieux.addEventListener(\"-perspective-add-expression\", ({\n detail\n }) => this._save_expression(detail));\n\n this._plugin_information_action.addEventListener(\"click\", () => {\n this._debounce_update({\n ignore_size_check: true,\n limit_points: false\n });\n\n this._plugin_information.classList.add(\"hidden\");\n\n this._plugin.render_warning = false;\n });\n }", "title": "" }, { "docid": "f1a084d65b12cc9f16d72ad86fadc9f5", "score": "0.5075197", "text": "insert(coupon, callback) {\n return super.insert(coupon, callback);\n }", "title": "" }, { "docid": "0deee74f115d0ea3a57245aa4382695d", "score": "0.5073227", "text": "insert() {\n // Prepare collection with bundle schema.\n this.collection.simpleSchema = () => {\n return this.schema;\n };\n return this.collection.insert.apply(this.collection, arguments);\n }", "title": "" }, { "docid": "0afedb137db7acd70167dbc16a4ce799", "score": "0.5073101", "text": "function register(name, fn, checkArgs, returns) {\n\t MISC_FUNCTIONS[name] = {\n\t checkArguments: checkArgs,\n\t evaluatedArgs: true,\n\t evaluate: fn,\n\t type: returns\n\t };\n\t }", "title": "" }, { "docid": "1304c3a8fba673e59d92bf6e7b12618c", "score": "0.50673556", "text": "function addUserFunction(userFunctionEdn) {\n userFunctions.push(userFunctionEdn);\n}", "title": "" }, { "docid": "384397ae04927cfbe657fe0399b6521c", "score": "0.50669783", "text": "insert(it){\n var range = this.getSelection().getRangeAt(0);\n\n if(it instanceof $) {\n it.each((index, node) =>{\n range.insertNode(node);\n })\n } else if (typeof it == \"string\"){\n this.insert($(it));\n\n } else {\n range.insertNode(it);\n }\n }", "title": "" }, { "docid": "32a1b861abedd312cbc7a70a59eb809f", "score": "0.50551546", "text": "function User_Insert_Profils_de_droits_Liste_des_profils_de_droits0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 90;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 91;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = droit,dp_numero,dp_numero\n\n******************\n*/\n\n var Table=\"droitprofil\";\n var CleMaitre = TAB_COMPO_PPTES[88].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var dp_libelle=GetValAt(90);\n if (!ValiderChampsObligatoire(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dp_libelle\",TAB_GLOBAL_COMPO[90],dp_libelle))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",dp_libelle\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(dp_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(dp_libelle)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" } ]
a19d4a9362d0fd7bb9644c982632ae8d
Optionally provide categoryData which can contain any number of valid keys.
[ { "docid": "8e3c3dd039954a4ae5b9ca0f051b2071", "score": "0.55593336", "text": "function setCategoryData(category, categoryData) {\n if (!isValidCategoryOrCategoryData(category)) return;\n\n const categoryMonthKey = getValidCategoryMonthKey(category);\n if (!categoryMonthKey) return;\n const categoryId = getCategoryId(category);\n\n const newCategoryData = getInitialCategoryData(category);\n if (categoryData) {\n for (const [key, value] of Object.entries(categoryData)) {\n newCategoryData[key] = value;\n }\n }\n\n categoriesObject[categoryMonthKey][categoryId] = newCategoryData;\n}", "title": "" } ]
[ { "docid": "b692e2037e7aaa0d6767c4b85b4530b4", "score": "0.5923815", "text": "function init_setion_category(section, category_key) {\n\tif (!all_products[section]) {\n\t\tall_products[section] = {};\n\t}\n\tif (!all_products[section][category_key]) {\n\t\tall_products[section][category_key] = [];\n\t}\n}", "title": "" }, { "docid": "1a26e13c9daee954fae7eb77d1d973e6", "score": "0.59204614", "text": "setCategories(categories) {\n this.categoriesUnprocessed = categories;\n\n /*\n * Convert to an easier lookup object with a regexp.\n * Example before:\n * {\n * Accessibility: ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n * }\n *\n * Example after:\n * [\n * {\n * name: 'Accessibility',\n * keywords: {\n * keywords: ['a', 'b', 'c', 'd', 'e', 'f', 'g'],\n * regexp: /a|b|c|d|e|f|g/gi\n * }\n * }\n * ]\n */\n this.categories = (categories) ?\n R.compose(R.map(R.zipObj(['name', 'keywords'])), this._toCategoryPairs)(categories) :\n [];\n }", "title": "" }, { "docid": "c911850854bcae2d28c4a275a5ec30fc", "score": "0.5768574", "text": "putCategory(value) {\n this.getData().category = value;\n }", "title": "" }, { "docid": "2f66c00f939863a4e7659a19647db6e3", "score": "0.5703669", "text": "function getCategories(formData, queryData) {\n\n const c = formData.color_picker || { r: 0, g: 0, b: 0, a: 1 };\n const fixedColorRGBA = [c.r, c.g, c.b, 255 * c.a];\n const fixedColorHex = rgbaToHex(fixedColorRGBA);\n const categories = {};\n queryData.forEach((d) => {\n const featureProps = d.properties;\n if (featureProps.cat_color != null) {\n let color;\n if (!categories.hasOwnProperty(featureProps.cat_color)) {\n if (formData.dimension) {\n color = getColor(featureProps.cat_color, formData.color_scheme);\n } else {\n color = fixedColorHex;\n }\n categories[featureProps.cat_color] = {\n color: hexToRGB(color),\n hex: color,\n enabled: true,\n };\n }\n featureProps.color = categories[featureProps.cat_color].hex;\n }\n });\n return categories;\n}", "title": "" }, { "docid": "b1a981d740096f98e3e4901942158519", "score": "0.565372", "text": "getCategoriesFromParam(category = '') {\n let categoryArray = [];\n\n switch(category) {\n case 'dance':\n categoryArray = ['on_camera', 'dance', 'kids_teen', 'specialty_act'];\n break;\n case 'creative':\n categoryArray = ['choreography', 'stage_director', 'creative_director', 'production', 'designer', 'music_director', 'video_director'];\n break;\n case 'educators':\n categoryArray = ['speaker', 'master_instructor', 'instructor', 'sytycd'];\n break;\n }\n\n return categoryArray;\n }", "title": "" }, { "docid": "8f0c30871d066bd76168e5c7093fdf38", "score": "0.5593401", "text": "function _buildCategoryList(){\n $(\"div[data-category-name]\").each(function(i, item){\n var categoryName = $(item).data(\"categoryName\");\n\n if(vars.categories.indexOf(categoryName) < 0){\n vars.categories.push(categoryName);\n }\n });\n }", "title": "" }, { "docid": "bb486615a8f601fbe7caacdb22ec404a", "score": "0.5493113", "text": "getCategories(data) {\n return [...new Set(data.map(entry => entry.category))];\n }", "title": "" }, { "docid": "8ec59b54dadb84256edc92efd284b446", "score": "0.5474239", "text": "function _sanitizeDictionaryData(d) {\n var data = _.cloneDeep(d);\n var dictionaryData = {};\n\n // TODO: Cleanup below hardcoding but unfortunately now this is necessary\n delete data.clinical;\n\n var dictionaryKeys = _.keys(data);\n\n for (var i = 0; i < dictionaryKeys.length; i++) {\n var dictionaryName = dictionaryKeys[i];\n var dictionary = data[dictionaryName];\n var dictionaryCategory = _.get(dictionary, 'category');\n\n if (dictionaryName === 'case') {\n dictionary.category = 'case';\n }\n\n if (dictionaryName === 'annotation') {\n dictionary.category = 'annotation';\n }\n\n dictionaryData[dictionaryName] = dictionary;\n\n }\n\n return dictionaryData;\n }", "title": "" }, { "docid": "3505be8cda68ed32cf8c2b728181cf34", "score": "0.54311705", "text": "function addCategoryName(data){\n\tObject.keys(data).forEach(function(key) {\n\t\tObject.keys(data[key]).forEach(function(subkey){\n\t\t\tvar merchantCategoryNum = new Date(data[key][subkey]['merchantCategory']);\n\t\t\tdata[key][subkey]['merchantCategoryName'] = getCategory(merchantCategoryNum);\n\t\t})\n\t});\n\treturn data;\n}", "title": "" }, { "docid": "eb3038113b120d4b9ea65409360f2506", "score": "0.54297316", "text": "function Category(data) {\n\t\t\tdata = data || {};\n\n\t\t\t// PK\n\t\t\tthis.id = data.id || null;\n\n\t\t\t// Properties\n\t\t\tthis.description = data.description || null;\n\t\t\tthis.name = data.name || null;\n\t\t\tthis.goals = this.$$addGoals(data.goals);\n\t\t\tthis.order = this.$$setOrder(data.order);\n\t\t}", "title": "" }, { "docid": "4d84423d4051472798e81971b2b65d25", "score": "0.5373717", "text": "setCategoryData(state, payload) {\n return state.allCategoryObj = payload;\n\n }", "title": "" }, { "docid": "8e5163eea8c592bf740a2de2e26d674d", "score": "0.5339144", "text": "success(data) {\n handleData(data.categories);\n }", "title": "" }, { "docid": "d10ace8c6e722662ec1658165815ea3d", "score": "0.53045", "text": "function filterCattle(data) {\r\n return [\r\n {\r\n \"category\": \"cattle\",\r\n \"measure\": data[\"Cattle\"]\r\n },\r\n {\r\n \"category\": \"sheep\",\r\n \"measure\": data[\"Sheep\"]\r\n },\r\n {\r\n \"category\": \"goats\",\r\n measure: data[\"Goats\"]\r\n },\r\n {\r\n \"category\": \"camels\",\r\n \"measure\": data[\"Camels\"]\r\n },\r\n {\r\n \"category\": \"donkeys\",\r\n \"measure\": data[\"Donkeys\"]\r\n },\r\n {\r\n \"category\": \"pigs\",\r\n \"measure\": data[\"Pigs\"]\r\n },\r\n {\r\n \"category\": \"i. chicken\",\r\n \"measure\": data[\"Indigenous Chicken\"]\r\n },\r\n {\r\n \"category\": \"c. chicken\",\r\n \"measure\": data[\"Chicken Commercial\"]\r\n },\r\n {\r\n \"category\": \"bee hives\",\r\n \"measure\": data[\"Bee Hives\"]\r\n }\r\n ];\r\n}", "title": "" }, { "docid": "9c2b13b5eb3c71d2b5cb8a3bac7c0e94", "score": "0.52980703", "text": "function formatCategoryData(){\n\t\tif(($scope.categories).length>0){\n\t\t\t($scope.categories).forEach(function(c){\n\t\t\t\tc.id = parseInt(c.id);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c71e50401e5be701fd314dc1a1166f70", "score": "0.5249868", "text": "registerCategoricalDim(key, values) {\n console.log(values, this._categoricalScale(values).range());\n this.staticScales.set(key, this._categoricalScale(values));\n }", "title": "" }, { "docid": "8b45f27063b572eb93fb8794d946166c", "score": "0.5243065", "text": "function populateCategories(key)\n{\n\t$.ajax({\n\t\turl: \"http://api.sqoot.com/v2/categories?api_key=\"+key,\n\t\ttype: 'GET',\n\t\tdata: {},\n\t\tsuccess: function (res) {\n\t\t\tcategories = res.categories;\n\t\t\tfor (var i = 1; i <= categories.length; i++)\n\t\t\t{\n\t\t\t\tslugs.push(categories[i-1].category.slug);\n\t\t\t\tif(i%2 == 0)\n\t\t\t\t{\n\t\t\t\t\t$(\".category-right\").append('<div class=\"checkbox check-primary\"><input id=\"category'+(i-1)+'\" type=\"checkbox\" value=\"'+categories[i-1].category.slug+'\" onclick=\"applyCategoryfilter(this);\"><label for=\"category'+(i-1)+'\">'+categories[i-1].category.name+'</label></div>');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\".category-left\").append('<div class=\"checkbox check-primary\"><input id=\"category'+(i-1)+'\" type=\"checkbox\" value=\"'+categories[i-1].category.slug+'\" onclick=\"applyCategoryfilter(this);\"><label for=\"category'+(i-1)+'\" >'+categories[i-1].category.name+'</label></div>');\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*\n\t\t\tconsole.log(\"slugs\",slugs);\n\t\t\tconsole.log(\"types\",types);\n\t\t\tvar common = $.grep(slugs, function(element) {\n\t\t\t return $.inArray(element, types ) !== -1;\n\t\t\t});\n\t\t\tconsole.log(\"common\",common);\n\t\t\t*/\n\t\t}\n\t});\n}", "title": "" }, { "docid": "270dc0316255017cfb8206d8e1f26b9d", "score": "0.5241869", "text": "function categoryOptions() {\n var category = [];\n category.push(\"N/A\");\n category.push(\"TA\");\n category.push(\"Grader\");\n category.push(\"UTA\");\n return category;\n }", "title": "" }, { "docid": "b5e4f6da3bfe99c73519cc63f3fa2fe5", "score": "0.5209561", "text": "setCategory(value) {\n this.getData().category = value;\n }", "title": "" }, { "docid": "bb2f28fdf8ee629c81ad9f64548b8f26", "score": "0.518799", "text": "addCategory (item, type) {\n switch (type) {\n case 'Customs':\n if (item.type === 'Sigil') item.category = 'Sigils'\n else item.category = 'Skins'\n break\n\n case 'Drones':\n item.category = 'Misc'\n break\n\n case 'Flavour':\n if (item.name.includes('Sigil')) item.category = 'Sigils'\n else if (item.name.includes('Glyph')) item.category = 'Glyphs'\n else item.category = 'Skins'\n break\n\n case 'Gear':\n item.category = 'Gear'\n break\n\n case 'Keys':\n if (item.name.includes('Derelict')) item.category = 'Relics'\n else item.category = 'Quests'\n break\n\n case 'RelicArcane':\n if (!item.type === 'Relic') item.category = 'Arcanes'\n else item.category = 'Relics'\n break\n\n case 'Sentinels':\n if (item.type === 'Sentinel') item.category = 'Sentinels'\n else item.category = 'Pets'\n break\n\n case 'Upgrades':\n if (item.isRiven) item.category = 'Rivens'\n else if (item.isTransmuteCore) item.category = 'Misc'\n else item.category = 'Mods'\n break\n\n case 'Warframes':\n if (item.archwing) item.category = 'Archwing'\n else item.category = 'Warframes'\n break\n\n case 'Weapons':\n if(item.uniqueName.includes('SentinelWeapons')) item.category = 'Sentinel Primary'\n else if(item.uniqueName.includes('Archwing/Primary')) item.category = 'Archwing Primary'\n else if(item.uniqueName.includes('Archwing/Melee')) item.category = 'Archwing Melee'\n else if (item.slot === 5 && !item.name.includes('Zaw')) item.category = 'Melee'\n else if (item.slot === 0) item.category = 'Secondary'\n else if (item.slot === 1) item.category = 'Primary'\n else item.category = 'Misc'\n break\n\n case 'Resources':\n if (item.type === 'Pets') item.category = 'Pets'\n else if (item.type === 'Specter') item.category = 'Gear'\n else if (item.type === 'Resource') item.category = 'Resources'\n else if (item.type === 'Fish') item.category = 'Fish'\n else if (item.type === 'Ship Decoration') item.category = 'Skins'\n else if (item.type === 'Gem') item.category = 'Resources'\n else if (item.type === 'Plant') item.category = 'Resources'\n else item.category = 'Misc'\n }\n }", "title": "" }, { "docid": "7fbf877c37ab9b5b9f6fcb7ad7776b79", "score": "0.5150526", "text": "function initCats(categories, catName) {\n if (categories[catName]) {\n categories[catName].count++;\n } else {\n // check if we should ignore this category\n if (limitCategories && !qm_util.isInArray(limitCategories, catName)) { return; }\n // check if we should ignore this category\n categories[catName] = {\n name: catName,\n type: \"classification\",\n count: 1,\n target: new la.Vector({ mxVals: records.length })\n };\n }\n }", "title": "" }, { "docid": "7d30451a14dcf64aa64b8745abc78ab9", "score": "0.5139607", "text": "function filterCategoryData(category, dateRange) {\n let filtered = dateRange\n ? categoryData.filter(d => within(d.date, dateRange))\n : categoryData;\n filtered = filtered.map(row => {\n return category\n ? {\n date: row.date,\n [category]: row[category]\n }\n : row;\n });\n return filtered;\n}", "title": "" }, { "docid": "f5cb8d78a037433ddcb0a05e21734d86", "score": "0.51278883", "text": "function processCategories (parent) {\n\n //remove restricted services (categories) for which the user doesn't have a credential\n var i = parent.categories.length;\n while (i--) {\n var cat = parent.categories[i];\n if (cat.restricted) {\n var credential = root.credentials.find(function (cred) { //eslint-disable-line no-loop-func\n return cat.url && cat.url.indexOf(cred.server) === 0;\n });\n if (typeof credential === 'undefined') {\n //restricted service, and we don't have a credential for the server the service is on\n //drop it\n parent.categories.splice(i, 1);\n }\n }\n }\n\n //parent.categories now should just have available (unrestricted, or restricted+credential) categories\n parent.categories.forEach(function (category) {\n root.allCategories.push(category);\n category.parent = parent === root ? null : parent;\n category.layerDefs = category.layerIds.map(function (layerId) {\n return root.layerDefs.find(function (l) {\n return l.id === layerId;\n });\n }, this);\n\n category.layerDefs.forEach(function (l) {\n l.categories.push(category);\n });\n\n //not currently used, but this rolls up all layerDefs of this category and those of it's sub-categories.\n category.allLayerDefs = [];\n\n //our template for \"selectable\" items is shared between categories and layerDefs\n //so we bind the expand/collapsed icons based on separate, related properties, and \n //only show if there are sub-categories. \n //The layerDefs versions of these both return false.\n category._expanded = ko.observable(false);\n\n category.expanded = ko.pureComputed(function () {\n return category.categories.length > 0 && category._expanded();\n });\n\n category.collapsed = ko.pureComputed(function () {\n return category.categories.length > 0 && !category._expanded();\n });\n\n category.select = function () {\n //expand it if not expanded, collapse it if it's already the current category\n if (!category._expanded()) {\n category._expanded(true);\n } else if (root.currentCategory() === category) {\n category._expanded(false);\n }\n //expand its parent\n if (category.parent) {\n category.parent._expanded(true);\n }\n root.currentCategory(category);\n root.currentLayer(category.layerDefs.length > 0 ? category.layerDefs[0] : null);\n };\n\n\n category.isSelected = ko.pureComputed(function () {\n return root.currentCategory() === category;\n });\n\n category.loadService = function () {\n topic.publish('layerLoader/addLayerFromCategoryDef', category);\n root.layerBrowserDialog.hide();\n root.searchResultsDialog.hide();\n };\n\n if (category.categories && category.categories.length > 0) {\n processCategories(category);\n }\n\n }, this); // end forEach through available categories\n } // end processCategories inner function", "title": "" }, { "docid": "d8e76dbfdd89b16d643d0113906f9f91", "score": "0.5098195", "text": "function buildCategoryList(data) {\n return uniqueArry(data.map((course) => course.category));\n}", "title": "" }, { "docid": "7602aec8de2f877d85a3b2eececd1cbd", "score": "0.50894094", "text": "function Category () {\r\n this.categoryid = 0;\r\n this.name = STR.category_new_name;\r\n this.cardids = []; // [1, 2 ...]\r\n}", "title": "" }, { "docid": "59c9ac81ba083353a752f78f40aa2112", "score": "0.5047347", "text": "function getCategories() {\n var b, c, d, newCatObj, noOfCat = 0, categoriesinJson = [];\n for (b in $scope.data) {\n if ($scope.data.hasOwnProperty(b)) {\n for (c in $scope.data[b].categories) {\n if ($scope.data[b].categories.hasOwnProperty(c)) {\n if (categoriesinJson.indexOf($scope.data[b].categories[c]) < 0) {\n //if the dategory does not exist in the array, add it to the list\n noOfCat++;\n categoriesinJson.push($scope.data[b].categories[c]);\n }\n }\n }\n }\n }\n\n for (d in categoriesinJson) {\n if (categoriesinJson.hasOwnProperty(d)) {\n newCatObj = {\n \"value\": parseInt(d, 10) + 1,\n \"text\": categoriesinJson[d]\n };\n $scope.categories.push(newCatObj);\n }\n }\n }", "title": "" }, { "docid": "da631b6891b0bf1c95a704f8342bf042", "score": "0.5028872", "text": "function manipulateResponseData(input) {\n const temp = input.map((category) => {\n return {\n value: category.name,\n label: category.short_name,\n subcategories: category.subcategories\n }\n })\n setCategoriesList(temp)\n }", "title": "" }, { "docid": "67535544a849aa6e78aa37fb13ee86d0", "score": "0.5025568", "text": "function getDataForCategory(data, category, getDisplayText) {\n if (!category) {\n return [];\n }\n\n let entriesForCategory = data.filter(\n (entry) => entry[CATEGORY_COL].toLowerCase() == category.toLowerCase()\n );\n\n // Array of objects that look like this:\n // {name: \"Bangladesh\", Thematic Area Category: \"Sexual reproductive health\", Initiative Count: 13}\n let countryCategoryCount = entriesForCategory.reduce((result, entry) => {\n const country = getDisplayText\n ? getDisplayText(entry[COUNTRY_COL])\n : entry[COUNTRY_COL];\n\n // Add to count if country has aleady been seen\n for (let i = 0; i < result.length; i++) {\n if (result[i]['name'] == country) {\n result[i]['Initiative Count'] += 1;\n return result;\n }\n }\n // Push new object to array if country hasn't been seen yet\n result.push({ name: country, 'Initiative Count': 1 });\n return result;\n }, []);\n\n return countryCategoryCount;\n}", "title": "" }, { "docid": "4d2521418ff096060e0d60d98e1ebdf8", "score": "0.5011423", "text": "function findCategoryData (categories) {\n\tlet chosenCategory;\n\tArray.from(categories).forEach(function(category){\n\t\tif (category.id == 'diaper-categories') {\n\t\t\tcategory.data.forEach(function(cat){\n\t\t\t\tif (cat.name == state.item.category) {\n\t\t\t\t\tchosenCategory = cat\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\treturn chosenCategory\n}", "title": "" }, { "docid": "dedb3502719512ebf030bfa95e1ce26a", "score": "0.49990448", "text": "async function filterArrays(data, category){\n if(data != undefined && category != undefined ) {\n var albumArray = []\n var currentAlbumObject = {}\n category.forEach(categoryItem => {\n let temp = []\n temp = data.filter((dataItem) => {\n return dataItem.category.attributes.label == categoryItem \n })\n dataItems = data.filter((dataItem) => {\n return dataItem.category.attributes.label != categoryItem \n })\n currentAlbumObject = buildAlbumObject(categoryItem,temp)\n albumArray = [...albumArray,currentAlbumObject]\n })\n await dispatch({ type: actionTypes.UPDATE_DATA, payload: albumArray })\n }\n }", "title": "" }, { "docid": "bebaed5d9303fce152ee424219854230", "score": "0.49954697", "text": "async create(data) {\n try {\n const category = await categoryModelInstance.create(data);\n\n return category;\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "a7f9f041abb10347367d981017f78af8", "score": "0.4979138", "text": "function getSubCategoryOptions(mainCategory) {\n\tswitch(mainCategory) {\n\t\tcase 'cakes':\n\t\t\treturn CAKE_OPTIONS;\n\t\tcase 'cupcakes':\n\t\t\treturn CUPCAKE_OPTIONS;\n\t\tcase 'specialty':\n\t\t\treturn SPECIALTY_OPTIONS;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "bb4b6920139c9b69428500879837b923", "score": "0.49755672", "text": "_toCategoryPairs(categories) {\n return R.map((category) => {\n let regexp = categories[category];\n\n if (Array.isArray(regexp)) {\n regexp = regexp.join('\\\\b|\\\\b');\n }\n\n // Match both \"front end\" and \"front-end\".\n regexp = regexp.replace(' ', '(\\\\s|-)');\n\n const dontMatchEntities = '[^&]';\n regexp = new RegExp(`${dontMatchEntities}\\\\b${regexp}\\\\b`, 'gi');\n\n return [\n category,\n {\n keywords: categories[category],\n regexp\n }\n ];\n }, Object.keys(categories));\n }", "title": "" }, { "docid": "8c749e3849c8c6ddfa15d6133a5e2483", "score": "0.49718913", "text": "function putSubCategory(dt) {\n subcategos = dt;\n}", "title": "" }, { "docid": "e88a2e884c2c05560619fdc39a836571", "score": "0.49695638", "text": "function prepareCategorylist(imported_data_structure) {\n var categories = imported_data_structure.datasource.categories;\n for (const category_name in categories) {\n const category = categories[category_name];\n if (category.is_extractable_category) {\n removeParentCategory(category_name, imported_data_structure.datasource);\n addSubcategories(imported_data_structure);\n }\n }\n }", "title": "" }, { "docid": "f40fc70eaf27277fda87cc910a296dd3", "score": "0.49449325", "text": "putCategory(category) {\n let data = {\n id: category.id,\n name: category.name\n };\n return apiClient.put('/categories', data);\n }", "title": "" }, { "docid": "d2ebe199e8dd5dc6a2fcc4f7bc726b0e", "score": "0.49367875", "text": "unSetCategory() {\n const data = this.getData();\n delete data.category;\n }", "title": "" }, { "docid": "41c8cdb38a9dd75d1ff5df97426cd759", "score": "0.4936435", "text": "function addCategory(category) {\n var xfilters = getFiltersFromHash(true);\n var found = xfilters.categories.indexOf(category);\n\n !(found+1) && xfilters.categories.push(category) && setHashFromFilters(xfilters);\n }", "title": "" }, { "docid": "be9afe38d187ee68e8632c5f10c9b438", "score": "0.49323532", "text": "function getCategory(catId) {\n let cat = catId.data;\n // gets the amount of questions needed from the category\n let clues = _.sampleSize(cat, NUM_QUESTIONS_PER_CAT);\n // gets titles from categories\n let catData = {\n title: cat[0].category.title,\n clues: [],\n };\n // gets questions and answers from categories\n clues.map((arr) => {\n let cluesArr = {\n question: arr.question,\n answer: arr.answer,\n showing: null,\n };\n catData.clues.push(cluesArr);\n });\n // pushes data into categories array\n categories.push(catData);\n}", "title": "" }, { "docid": "5b4998b4bd0de810ce6e79620d4c6d98", "score": "0.49194738", "text": "function validateCategory(category) {\n const schema = Joi.object({\n type: Joi.string().min(3).required(),\n });\n\n return schema.validate(category);\n}", "title": "" }, { "docid": "c20d4387442e3c4aa6f275055d9f5dbe", "score": "0.4916739", "text": "getTags(data){\n\t\tlet category = [];\n\t\tfor (var i = 0; i < data.category.length; i++) {\n\t\t\tcategory[i] = data.category[i].term\n\t\t}\n\t\treturn category\n\t}", "title": "" }, { "docid": "8debaebeba5ebe7f727b38358596cfa8", "score": "0.49160162", "text": "function createCategories (data) {\n return $http.post('/categories', data);\n }", "title": "" }, { "docid": "0e832720c50b3c9b08f93b5a463b23d4", "score": "0.49037653", "text": "function create(categoryData, userId, cb) {\n let categories = _validateCategoryData(categoryData);\n\n let processedData = _processCategoryData(userId, categories);\n console.log\n Category.create(processedData, function (err, category) {\n if (err) {\n return cb(err, null);\n }\n\n cb(null, category);\n });\n\n}", "title": "" }, { "docid": "2513e5127f0fa3ddce1b31e850354010", "score": "0.4877846", "text": "function Category(data) {\n var self = this;\n var productsUrlBase = \"http://parkland-csc175.github.io/SP16-jwelander-finalproject/products-list.html\"\n\n this.id = ko.observable();\n this.name = ko.observable();\n this.linkUrl = ko.observable();\n\n if (data && data.id) {\n self.id(data.id);\n }\n\n if (data && data.name) {\n self.name(data.name);\n }\n self.linkUrl(productsUrlBase + \"?\" + data.id);\n }", "title": "" }, { "docid": "eb15683cec2570f64245d3ec77b0d83f", "score": "0.48691586", "text": "_getCategoriesFromText(text, categories) {\n const fnName = `${moduleName}/_getCategoriesFromText`;\n\n //winston.debug(`${fnName}: ${text}`);\n\n let cats = [];\n const categoriesCopy = categories || this.categories || [];\n\n cats = R.filter((category) => text && text.match(category.keywords.regexp))(categoriesCopy);\n\n cats = R.pluck('name', cats);\n\n return cats;\n }", "title": "" }, { "docid": "3b2f20b5723f5ddff31ef56fe0009d09", "score": "0.48635137", "text": "function validateCategory(category){\n if(category != \"none\")\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "773a35ac864b4dc6f744bd30f2e28aab", "score": "0.48591703", "text": "function FilterCategory()\n{\nconst[category,setCategory] = useState(\n [\n {\n image:\"https://k.nooncdn.com/cms/pages/20210609/ab5cd4c757d262915aae67797aa261f0/en_mb-category-01.png\",\n Category:\"Home&Kitchen\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-09.png\",\n Category:\"Appliance\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-15.png\",\n Category:\"Grocerries\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-10.png\",\n Category:\"Sports\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-12.png\",\n Category:\"Laptops\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-02.png\",\n Category:\"Women'sFashion\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-01.png\",\n Category:\"Men'sFashion\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-06.png\",\n Category:\"Beauty\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-14.png\",\n Category:\"fragrance\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210613/779b86493c723f8a40c50e064a439647/en_mb-category-14%20(1).png\",\n Category:\"SummerbabyBananza\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-03.png\",\n Category:\"Mobiles\"\n },\n {\n image:\"https://k.nooncdn.com/cms/pages/20210525/5e6536ce873b58ccd0cb4baf01ade972/en_mb-category-04.png\",\n Category:\"Electronics\"\n },\n ]\n)\n\nreturn(\n<div className=\"d-flex flex-wrap justify-content-sm-evenly m-0 p-4\">\n { category.map((e,i)=>{\nreturn(\n<div key={i} >\n<Category image={e.image} category={e.Category} />\n\n</div>\n)\n\n })}\n</div>\n)\n}", "title": "" }, { "docid": "d7af27dfa9654bb8e1ef0c9546a0072f", "score": "0.48567432", "text": "cataegoryFilter(category) {\n this.props.getCategoryFilter(category);\n }", "title": "" }, { "docid": "cc5b34f67c122b46a804db9dd20b63b2", "score": "0.4852794", "text": "getListOfCategories() {}", "title": "" }, { "docid": "86f9060ce6194a61214d4cda3d880e0b", "score": "0.48475486", "text": "function populate_categories(\n product_ingrdnts,\n product_pref_ingrdnts,\n highlighted_categories_names,\n n\n) {\n let categories_list = pick_top_n_categories(n);\n //push hilighting categories to defalt list\n for (let i = 0; i < highlighted_categories_names.length; i++) {\n if (!categories_list.includes(highlighted_categories_names[i]))\n categories_list.push(highlighted_categories_names[i]);\n }\n let categories = {};\n\n //set up the keys\n for (let i = 0; i < categories_list.length; i++)\n categories[categories_list[i]] = [];\n\n //mark the ingredients with selected categories\n //fill the ingredients in selected categories\n let marked = new Array(product_ingrdnts.length);\n for (let i = 0; i < categories_list.length; i++) {\n for (let j = 0; j < product_ingrdnts.length; j++) {\n if (\n has_category(\n product_ingrdnts[j],\n categories_list[i],\n product_ingrdnts,\n product_pref_ingrdnts\n )\n ) {\n categories[categories_list[i]].push(product_ingrdnts[j]);\n marked[j] = true;\n }\n }\n }\n //for not found\n for (let i = 0; i < product_ingrdnts.length; i++) {\n if (!marked[i]) {\n const pref_name = product_pref_ingrdnts[i];\n const ingrdnt = get_Ingrdnt_from_drugbank(pref_name, product_ingrdnts);\n //not reachable in database\n if (!ingrdnt) {\n if (!(\"Not Found\" in categories)) categories[\"Not Found\"] = [];\n categories[\"Not Found\"].push(product_ingrdnts[i]);\n } else {\n if (!(\"others\" in categories)) categories[\"others\"] = [];\n categories[\"others\"].push(product_ingrdnts[i]);\n }\n }\n }\n\n //delete categories which is empty\n for (let key in categories) {\n if (categories[key].length == 0) {\n delete categories[key];\n }\n }\n return categories;\n}", "title": "" }, { "docid": "f85d3e50a9853e152d488798d8fe05d5", "score": "0.48430187", "text": "function filterCategory(event) {\n const filter = event.target.dataset.filter;\n setFilter(filter);\n}", "title": "" }, { "docid": "b34cf43459a5a76810cd422d88d9a353", "score": "0.4837427", "text": "function count(data, category) {\n\t\t\tvar cnt = 0;\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tif (data[i][\"type\"] == category) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cnt;\n\t\t}", "title": "" }, { "docid": "dbd57d63c255140625a5437dd69d8341", "score": "0.48342928", "text": "function selectCategory(e) {\n setSelectedCat(e.target.value);\n\n let aux_cat = JSON.parse(e.target.value);\n\n let filters_ = { ...filters };\n filters_[\"category_id\"] = aux_cat.id;\n filters_[\"category\"] = aux_cat.name;\n\n setFilters({ ...filters, ...filters_, ...location });\n }", "title": "" }, { "docid": "3d8565440e2d74a8a25cb4b6c5628a16", "score": "0.48336858", "text": "function initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}", "title": "" }, { "docid": "2c4217237adf214c55507bcba4ff4311", "score": "0.48286492", "text": "function useCategoriesData () {\n\n //Estado local para el Custom Hook -> Las Categorías \n\n const [ categories, setCategories ] = useState ([])\n\n //Estado local para saber cuando estamos obteniendo información \n\n const [ loading, setLoading ] = useState( false );\n\n // Tendrá el efecto que hace el fetchin de datos\n\n useEffect ( function () {\n setLoading ( true );\n window.fetch('https://api.myjson.com/bins/ccoom')\n .then( res => res.json() )\n .then( response => {\n setCategories(response)\n setLoading( false )\n })\n }, [])\n\n // EL custom Hook debe devolver algo siempre -> Las categorias y el estado de loading\n\n return { categories, loading }\n}", "title": "" }, { "docid": "c84a18dea5fdc0e4ce215e391d4400aa", "score": "0.48249626", "text": "function buildCategory(data) {\n const categoryName = document.createElement(\"h2\");\n categoryName.classList.add(\"category\");\n categoryName.textContent = data.gsx$category.$t;\n document.querySelector(\"main\").appendChild(categoryName)\n \n const row = document.createElement(\"div\");\n row.classList.add(\"row\");\n let className = data.gsx$category.$t.replace(\" \", \"-\").toLowerCase();\n row.setAttribute(\"id\", className)\n document.querySelector(\"main\").appendChild(row)\n}", "title": "" }, { "docid": "abd237cfcc0c508320a0cd5a1c124d72", "score": "0.4823138", "text": "getCategory() {}", "title": "" }, { "docid": "fd3e0100db291411e58d30f2cba112c3", "score": "0.4806972", "text": "function getCategorySortedData(data, ads) {\n var categorySortedData = JSON.parse(JSON.stringify(data));;\n categorySortedData.result = [];\n //categorySortedData.resultSource = [];\n categorySortedData.entities.ads = {};\n categorySortedData.entities.labels = {};\n categorySortedData.entities.urls = {}; // not used\n categorySortedData.entities.advanced = {}; // not used\n \n var adProperty = 'userLabel';\n \n var alreadySeenCategorySlugs = [];\n \n ads.map( function( ad ) {\n \n var id;\n //var indexOfCategorySlug = alreadySeenCategorySlugs.indexOf( ad.categorySlug );\n \n //var labelGroup = s.match(/\\[(.*?)\\]/g);\n \n var regex = /(?:^\\[(.*)])?\\s?(.*)/;\n var matches = ad[adProperty].match(regex);\n \n var labelGroup = matches[1];\n var label = matches[2];\n \n var categorySlug = labelGroup ? labelGroup : label;\n \n //var indexOfCategorySlug = alreadySeenCategorySlugs.indexOf( ad[adProperty] );\n \n var indexOfCategorySlug = alreadySeenCategorySlugs.indexOf( categorySlug );\n\n if ( indexOfCategorySlug > -1 ) { // if match in array\n id = indexOfCategorySlug;\n } else {\n id = alreadySeenCategorySlugs.length;\n \n alreadySeenCategorySlugs.push( categorySlug );\n categorySortedData.result.push( id );\n \n categorySortedData.entities.ads[ id ] = {\n id: id,\n toSend: [] \n };\n categorySortedData.entities.labels[ id ] = {\n id: id,\n label: categorySlug,\n isGroup: true\n };\n \n // Not used but need to be non-empty\n categorySortedData.entities.urls[ id ] = {\n id: id,\n url: \"\"\n };\n // Not used but need to be non-empty\n categorySortedData.entities.advanced[ id ] = {\n id: id,\n params: {}\n };\n }\n \n categorySortedData.entities.ads[ id ].toSend.push( ad );\n })\n \n categorySortedData.result.map( function ( id ) {\n var sortedAds = categorySortedData.entities.ads[ id ].toSend.sort( dynamicSort(\"-timestamp\") );\n categorySortedData.entities.ads[ id ].toSend = sortedAds;\n })\n \n return categorySortedData;\n}", "title": "" }, { "docid": "a311cd520ae4dfee3952db42b55ac1ba", "score": "0.48005572", "text": "function processBundleData(categories){\r\n \t //var categories = bundle_data.bundles.categories;\r\n \t//traverse through the categories\r\n \t\t$.each(categories, function() {\r\n \t\t\tvar label = this.label;\r\n \t\t\tif(Array.isArray(label)){\r\n \t\t\t //traverse through each category labels\r\n\t\t\t\t$.each(label, function() {\r\n\t\t\t\t\tvar items = this.bundles;\r\n\t\t\t\t\t//traverse through each category labels' bundles\r\n\t\t\t\t\t$.each(items, function() {\r\n\t\t\t\t\t\tvar item = this;\r\n\t\t\t\t\t\tvar priceModels = item.bundle_price_models;\r\n\t\t\t\t\t\tpopulateItemNames(item.bundle_id, item.description, item.display_name, item.base_price, item.mrc_price);\r\n\t\t\t\t\t\t$.each(priceModels, function() {\r\n\t\t\t\t\t\t\tvar model = this;\r\n\t\t\t\t\t\t\tpopulatePrice_model(item.bundle_id, model.price_model.name);\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 }else{\r\n \t\t \tvar items = label.bundles;\r\n\t\t\t\t//traverse through each category labels' bundles\r\n\t\t\t\t$.each(items, function() {\r\n\t\t\t\t\tvar item = this;\r\n\t\t\t\t\tvar priceModels = item.bundle_price_models;\r\n\t\t\t\t\tpopulateItemNames(item.bundle_id, item.description, item.display_name, item.base_price, item.mrc_price);\r\n\t\t\t\t\t$.each(priceModels, function() {\r\n\t\t\t\t\t\tvar model = this;\r\n\t\t\t\t\t\tpopulatePrice_model(item.bundle_id, model.price_model.name);\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\t\r\n }", "title": "" }, { "docid": "c61d92d49782e0cba5ec61d67ae5149f", "score": "0.4793489", "text": "function prepareCategoryList(callback) {\n\tgetAxios(\"/admin/categoryAPI\", (err, data) => {\n\t\tif (err) {\n\t\t\tconsole.log(\":::\", err);\n\t\t\tmessager({\n\t\t\t\treplace: [\"success\", \"danger\"],\n\t\t\t\tmessage: \"Please Refresh. Problem loading Pages.\"\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tcallback(data);\n\t});\n}", "title": "" }, { "docid": "c5605bddf37e8a92d442cef7fe9363bd", "score": "0.47841728", "text": "function CategoryObject (ffcName) {\n this.categoryName = ffcName;\n this.categoryBudget = 0;\n\n categoryObjectArray.push(this);\n}", "title": "" }, { "docid": "81efc1d6b5417c2d5a510038c6f62156", "score": "0.4780251", "text": "function preparedata (data){\n\tvar args = {};\n\tvar k = 0;\n\n\t// Removes all tabulation in the data\n\tdata = data.replace(/\\t/g, '');\n\n\t// Loops line by line\n\tvar res = data.split(\"\\n\");\n\tfor (var i = 0; i<res.length;i++){\n\t\t\n\t\t// Resplit the line in parts using space\n\t\tvar argParts = res[i].split(\" \");\n\t\tfor (var j = 0; j<argParts.length;j++){\n\t\t\t// Removes the non T/F arguments\n\t\t\tif (argParts[j].includes(\"name=\") && (argParts[j+1].includes(\"true\")||argParts[j+1].includes(\"false\"))){\n\t\t\t\t\n\t\t\t\t//Format to get the argument name\n\t\t\t\tvar argName = argParts[j].replace(/\"/g,'');\n\t\t\t\targName = argName.replace('name=','');\n\t\t\t\t\n\t\t\t\tvar argCategory = findCategory(argName)\n\t\t\t\t\n\t\t\t\t/* Since a category has multiple arguments, we must add an array to the dict\n\t\t\t\t* The first time a category is added, we create the empty array */\n\t\t\t\tif (args[argCategory] == null){\n\t\t\t\t\targs[argCategory] = [];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\targs[argCategory].push (argName);\t\n\t\t\t}\n\t\t}\n\t}\n\treturn args;\n}", "title": "" }, { "docid": "95267d82be1565f299da840986e89084", "score": "0.4770985", "text": "filter(value, key, data, isArray = true) {\n if (!value) {\n return data\n }\n switch(key) {\n case 'actors':\n return data.filter(item => item.hasActor(value))\n case 'genre':\n return data.filter(item => item.hasGenre(value))\n case 'imdbRating':\n return data.filter(item => item.hasImdbRating(value))\n case 'averageRating':\n return data.filter(item => item.getAverageRating() === value)\n default:\n return data\n }\n }", "title": "" }, { "docid": "e256373e68cf30be20e1908ec0741fca", "score": "0.4770074", "text": "constructor(props) {\n super();this.state = {\n data: props.categories,\n }\n }", "title": "" }, { "docid": "b81eac1332cba9e0df4e2260428c4969", "score": "0.47488254", "text": "function getCleanSeriesData(categorizedData) {\n let cleanSeries = [];\n\n for (var category in categorizedData) {\n let values = [];\n for (var date in categorizedData[category]) {\n values.push(categorizedData[category][date]);\n }\n cleanSeries.push({\n name: category,\n data: values\n })\n }\n return cleanSeries;\n }", "title": "" }, { "docid": "cdc89ef5fade1caba0e22f890a2924fb", "score": "0.47487944", "text": "_getCategoryOptions() {\n\t\tlet categorySelected = this.props.options.find(option => {\n\t\t\treturn option.id === this.state.nextToken.id;\n\t\t});\n\n\t\tlet options = categorySelected.options;\n\n\t\t// default case for boolean data types\n\t\tif (categorySelected.type === 'boolean' && !options) {\n\t\t\treturn ['True', 'False'];\n\t\t}\n\n\t\treturn options;\n\t}", "title": "" }, { "docid": "b6032caefefef8fe6787a56e67d7144c", "score": "0.4746904", "text": "hasCategory() {\n return _.isStringNotEmpty(this.getCategory());\n }", "title": "" }, { "docid": "826f1dcd919173bdfb4deb6b02972be0", "score": "0.47458738", "text": "catsBuilder(apiObject, questionsArray, categoriesArray){\n for (let i = 0; i < apiObject.categoryAmt; i++){\n categoriesArray.push(questionsArray[i][0].category.title);\n }\n return categoriesArray;\n }", "title": "" }, { "docid": "d0cd80da809e92e025056d3f4b3feade", "score": "0.47441423", "text": "function setCategoryTopics(rules) {\n let categoryCount;\n $scope.categoryTopics = [];\n\n Categories.forEach((category) => {\n categoryCount = rules[category];\n if (categoryCount !== undefined && categoryCount > 0 && category !== 'all') {\n $scope.categoryTopics.push({\n id: category,\n count: categoryCount\n });\n }\n });\n }", "title": "" }, { "docid": "aa2d36cbd4999e49fbc98f286bf51321", "score": "0.47416452", "text": "function onSetItemCategoriesToDropDown(data) {\n\t\t$.each(data, function(i, item) {\n\t\t\t//\tconsole.log(item);\n\t\t\tvar data_str = JSON.stringify(item);\n\t\t\tvar option = $('<option value=\"' + item.id + '\">' + item.Itemcategory + '</option>').attr('data-item-category', data_str);\n\t\t\t$itemCategoryField.append(option);\n\t\t})\n\t\t$itemCategoryField.select2();\n\t}", "title": "" }, { "docid": "03266bf194b83a7987a9257ec9864ad4", "score": "0.47373453", "text": "function validateData(req, res, next) {\n let category = req.body.category;\n let deposit = req.body.deposit;\n // if data is invalid type or not present\n if (typeof req.body.category !== 'string' || typeof req.body.deposit !== 'number') {\n res.sendStatus(400);\n // If data is a blank string\n } else if (req.body.category.length === 0) {\n res.sendStatus(400);\n // if data includes script marker \n } else if (req.body.category.match(/(<script>)/i)) {\n res.sendStatus(400);\n // if category already exsists\n } else if (req.user.getEnvelopeByCategory(req.body.category)) {\n res.status(409).send(\"Category already exsists\");\n // Looks good!\n } else {\n next();\n }\n}", "title": "" }, { "docid": "a85c66eef752372aa828db9a316fad85", "score": "0.47274607", "text": "addCategory(categoryName) {\r\n let category = {}\r\n this._warehouse.push(category)\r\n category.Name = categoryName;\r\n category.items = [];\r\n }", "title": "" }, { "docid": "4a553c2ac3651eeac48352d3e78ef587", "score": "0.47246304", "text": "function aggregateCategory(data) {\n return d3.nest()\n .key(function(d) { return d.dac_category_name; })\n .rollup(function(v) { return d3.sum(v, function(d) { return d.constant_amount; }); })\n .entries(data);\n}", "title": "" }, { "docid": "3dfa0e5b8264a85ab9635edb1c15d764", "score": "0.47210288", "text": "function AlarmCategory(catId, name, desc, enableGeneric, nbGeneric) {\n this.catId = catId; // numeric\n this.name = name; // e.g. \"\"hGbeCard\"\n this.desc = desc; // e.g. \"Gbe Pro Card\"\n this.enableGeneric = enableGeneric; // whether we use generic alarms\n this.nbGeneric = nbGeneric; // used to create generic alarms. Example \"Slot alarm\"\n //this.alarms = {}; // map of AlarmType keyed on the alarmId\n this.toString = function() {\n return \"cat:\" + catId + \",\" + name;\n };\n}", "title": "" }, { "docid": "7436c393553ca1fbf9f17991d72359cd", "score": "0.47180384", "text": "function Category() {\n\t _super.call(this);\n\t this._range = [0, 1];\n\t this._d3Scale = d3.scale.ordinal();\n\t var d3InnerPadding = 0.3;\n\t this._innerPadding = Category._convertToPlottableInnerPadding(d3InnerPadding);\n\t this._outerPadding = Category._convertToPlottableOuterPadding(0.5, d3InnerPadding);\n\t }", "title": "" }, { "docid": "b10519f5f08f804bed2f2e5985487fcc", "score": "0.47030157", "text": "constructor(q, ctx) { \n super(q, ctx, 'objList')\n this.categories = q\n this.keys = Object.keys(this.categories)\n }", "title": "" }, { "docid": "8a2f113fc07001ebd797574e1baba243", "score": "0.47006428", "text": "function setCategories(){\n\tfor (var index=0; index < info_list_of_options.length; index++){\n\t\tfor(position = 0; position < info_fieldlist.length; position ++){\n\t\t\tif\t(\n\t\t\t\t\t(info_list_of_options[index][0] == info_fieldlist[position][0]) || \n\t\t\t\t\t(info_fieldlist[position][0].substr(0,info_list_of_options[index][0].length) == info_list_of_options[index][0])\n\t\t\t\t){\n\t\t\t\tinfo_fieldlist[position][7] = info_list_of_options[index][4];\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "56edb0961978da012125cc0024f65ec2", "score": "0.46929914", "text": "async function loadCategories() {\n const { data: allCate } = await getCategories();\n\n const indexArray = loadRandomIndex(allCate.length); // to get random indexes\n loadRandomCategories(allCate, indexArray); // to set random categories\n }", "title": "" }, { "docid": "f875d67fffb412470ad62357693f9d84", "score": "0.4686766", "text": "function addPickup(logger, categories, categoryName, categoryType, arr) {\n if (!rpcCategoryTransformer.validateCategoryArraySize(logger, 2, arr, categoryName)) {\n return;\n }\n var categoryEntry = {\n ien: arr[0],\n name: arr[1]\n };\n rpcCategoryTransformer.addCategoryDefaultEntry(logger, categories, categoryName, categoryType, arr, categoryEntry);\n}", "title": "" }, { "docid": "04a7e362bdab1545bb3b5bca511e2b96", "score": "0.46822146", "text": "function createCategory(newCategory) {\n var categories = new Array();\n chrome.storage.sync.get('categories', function(cat){\n if(!_.isEmpty(cat)) {\n console.debug(cat.categories);\n categories = cat.categories;\n }\n categories.push(newCategory);\n chrome.storage.sync.set({'categories': categories}, function(){});\n });\n // console.debug('added category. category array is now: ' + categories);\n}", "title": "" }, { "docid": "53dc00fbbfebab9acf2c92e7cc5fe9c5", "score": "0.46789694", "text": "function CategoryHandler() {\n this.APIUrls = {\n categoriesLoadPath: injector.resolve('config').api.basepath + '/categories'\n };\n this.categories = null;\n}", "title": "" }, { "docid": "0bb72f15d3662625b10fd794a7937bfe", "score": "0.46719843", "text": "function addToCategory(name, cat = \"Other\", type = \"custom\") \n{\n if (cat in viewer_categories[type])\n {\n viewer_categories[type][cat].push(name);\n }\n else\n {\n viewer_categories[type][cat] = [name];\n }\n}", "title": "" }, { "docid": "fcc437d94027b11a82f8b345d550b4b5", "score": "0.46662515", "text": "function onChangeCategory(e) {\n const category = e.target.getAttribute('value');\n\n if (category) {\n filters[CATEGORY_COL] = category;\n } else {\n delete filters[CATEGORY_COL];\n }\n\n updateTable('#table', dataset, filters);\n drawMap(category);\n}", "title": "" }, { "docid": "21ab91cb8635f6123d63aceca629076b", "score": "0.46651578", "text": "function addCategories() {\n axios.get('/api/categories')\n .then(res => manipulateResponseData(res.data))\n .catch(err => console.log(err))\n }", "title": "" }, { "docid": "519da8c80b15700e234c14324a72403f", "score": "0.4661815", "text": "function putSubCategory(dt) {\n //lsbc_id = dt[0].sbc_id;\n subcategos = dt;\n}", "title": "" }, { "docid": "039e12e93055227b6779e106607ba242", "score": "0.4659998", "text": "function categoryAdd(data) {\n return new Promise((resolve, reject) => {\n let category = new String();\n\n function nested(data, startId) {\n category += `<option id ='0' value = ' 0' > \n Ana Katagori\n </option>`; \n\n for(let i = 0; i < data.length; i++) {\n category += `<option id ='${data[i]._id}'\n value = ' ${data[i].category_id} ' > \n ${data[i].category_name}\n </option>`;\n\n }\n\n }\n nested(data, 0);\n \n resolve(category);\n });\n\n}", "title": "" }, { "docid": "e6056525a9f9b77ac92dd3f1087d349c", "score": "0.4655159", "text": "function getCategories() {\n\t\t\tDrinkService.getCategories($rootScope.userLogin.token).success(function (res) {\n\t\t\t\t$rootScope.list_categories = res;\n\t\t\t}).error(function (err, stt, res) {\n\t\t\t\tif (err.detail){\n toastr.error(err.detail);\n }\n for( var key in err){\n var x = 'err.'+key;\n toastr.error(key.toUpperCase()+\": \"+eval(x)[0]);\n }\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "2929e96f2831feafb453085f1ae77793", "score": "0.46435902", "text": "function isValidCategory(txt) {\n var found = true;\n if (categories.indexOf(txt) === -1) {\n found = false;\n }\n return found;\n}", "title": "" }, { "docid": "346d0c42d19fd6acc14dc3b83ab12ff2", "score": "0.46358246", "text": "createSearchIndices() {\n if (!this.categoriesData || this.categoriesData.length === 0) {\n return;\n }\n\n // Get the list of unique categories in the order they appeared\n // in the data.\n const categories = [...new Set(\n this.categoriesData.map(item => item.category))];\n\n // Remove existing indices.\n this.fuseInstances.clear();\n\n for (const category of categories) {\n // Filter records for the category and preprocess them.\n const indexableEmojis = this.preprocessDataForIndexing(\n this.categoriesData.filter(\n emojiGroup => emojiGroup.category === category));\n\n // Create a new index for the category.\n this.fuseInstances.set(category,\n new Fuse(indexableEmojis, this.fuseConfig));\n }\n this.needIndexing = false;\n }", "title": "" }, { "docid": "6d62882c430397ed1c31a14ab4dfbced", "score": "0.4632565", "text": "function onSelectCategory(d, i) {\n filterCategory = filterCategory === d ? null : d; // toggle the filter to go back to all categories\n let filtered = filterCategoryData(filterCategory, filterRange);\n d3.select(\"#stacked-area-chart\")\n .datum(filtered)\n .call(areachart);\n}", "title": "" }, { "docid": "3c22bd0f192dae7fe3706d04907f655f", "score": "0.46305862", "text": "function addCategoryEntry(logger, categories, categoryName, fields) {\n if (!fields && fields.length === 0) {\n throw new Error('fields must have at least one entry');\n }\n\n var categoryType = fields[0][0];\n fields[0] = fields[0].substring(1); //Remove the categoryType from the first entry\n\n if (categoryName === 'Priority') {\n addPriority(logger, categories, categoryName, categoryType, fields);\n }\n else if (categoryName === 'DispMsg') {\n addDispMsg(logger, categories, categoryName, categoryType, fields);\n }\n else if (categoryName === 'Refills') {\n addRefills(logger, categories, categoryName, categoryType, fields);\n }\n else if (categoryName === 'Pickup') {\n addPickup(logger, categories, categoryName, categoryType, fields);\n }\n else { //This is an unknown entry\n throw new Error('unknown category entry: ' + categoryName);\n }\n}", "title": "" }, { "docid": "3f97da1c5d30b220d356570577a52d70", "score": "0.4627526", "text": "function generateProducts(data){\n\n let items = new Map();\n\n for(index in data){\n let product = buildProduct(data[index]);\n let key = product.category;\n\n if(items.has(key)){\n items.get(key).push(product);\n }\n else {\n items.set(product.category, [product]);\n }\n }\n\n return items;\n}", "title": "" }, { "docid": "94c33c687346194f9032ca04292a89e7", "score": "0.46265358", "text": "function validateDataInternal(schema, data) {\n var type = schema[KEYWORD_TYPE];\n \n if (type === TYPE_BOOLEAN) {\n validateDataBoolean(schema, data);\n }\n else if (type === TYPE_NUMBER) {\n validateDataNumber(schema, data);\n }\n else if (type === TYPE_STRING) {\n validateDataString(schema, data);\n }\n else if (type === TYPE_OBJECT) {\n validateDataObject(schema, data);\n }\n else if (type === TYPE_ARRAY) {\n validateDataArray(schema, data);\n }\n else {\n schema[KEYWORD_CONCORDIA].validateData(data);\n }\n }", "title": "" }, { "docid": "a9ddb9b4de316090a9fffe1adf6c2e8e", "score": "0.4625", "text": "function testPostCategory() {\r\n testApiPOST('categories', EXAMPLE_CATEGORY, true);\r\n}", "title": "" }, { "docid": "c0870ad143bc7e1c120376b194d9b655", "score": "0.46230254", "text": "function _product_category(){\n _loading(0);\n _products_category_list();\n _submit_data_category();\n}", "title": "" }, { "docid": "67dc0dd05d1e7cf1b8634d8bec11964f", "score": "0.46221378", "text": "getEntryTitlesInCategory(data, category) {\n return data.filter(entry => entry.category === category).map(entry => entry.title);\n }", "title": "" }, { "docid": "488655b26cb111b92d0aedde82d2b5e3", "score": "0.46102837", "text": "_setIdFromCategoryName(categoryName)\n\t{\n\t\tthis._categoryId = categoryName;\n\n\t\t// Strip invalid characters\n\t\tvar pattern = /[^0-9a-zA-Z]/g;\n\t\tthis._categoryId = this._categoryId.replace(pattern, ' ');\n\n\t\t// Capitalize words\n\t\tvar words = this._categoryId.split(' ');\n\t\tthis._categoryId = '';\n\n\t\tfor (let i = 0; i < words.length; i++)\n\t\t{\n\t\t\tlet word = words[i];\n\t\t\tif (word.length > 0)\n\t\t\t\tthis._categoryId += (i > 0 ? word.substr(0,1).toUpperCase() : word.substr(0,1).toLowerCase()) + (word.length > 1 ? word.substr(1) : \"\");\n\t\t}\n\n\t\tif (this._categoryId.length == 0)\n\t\t\tthis._categoryId = this.DEFAULT_CATEGORY_ID;\n\t}", "title": "" }, { "docid": "8c1a191066b0ef405d0a2ad744466029", "score": "0.4609115", "text": "function initCategories() {\n var temperatureSensors = new SensorCategory(\"TEMP\", [], [\"TEMP\", \"AC\"]);\n var lightSensors = new SensorCategory(\"LIGHT\", [], [\"LIGHT\"]);\n var numberSensors = new SensorCategory(\"STATE\", [], [\"STATE\"]);\n var energySensors = new SensorCategory(\"ENERGY\", [], [\"ENERGY\"]);\n var soundSensors = new SensorCategory(\"SOUND\", [], [\"SOUND\"]);\n\n categories.LIGHT = lightSensors;\n categories.TEMP = temperatureSensors;\n categories.STATE = numberSensors;\n categories.ENERGY = energySensors;\n categories.SOUND = soundSensors;\n}", "title": "" }, { "docid": "f6ae4210be2d981772129392d0c8012f", "score": "0.46089587", "text": "function filterOnClick(data, program, category){\n if(category == 0){\n category = \"Company\";\n }\n else if (category == 1) {\n category = \"Profession\";\n }\n else{\n category = \"Skills\"\n }\n //Returns all alumni from 1 program\n var filteredData = matchAsData(data, [\"Education\"], program);\n //Filtrera på proff/company\n var array = {};\n //var arrayCOunter =\n filteredData.forEach(function(sin){\n if (typeof array[ sin[category] ] == 'undefined'){\n array[ sin[category] ] = 1;\n }\n else {\n array[ sin[category] ] = parseInt(array[ sin[category] ]) + 1;\n }\n });\n\n return array;\n}", "title": "" }, { "docid": "4201187910b133c894f0143dcfd6f129", "score": "0.4608699", "text": "function Category( options ) {\n if (typeof (options) == \"undefined\") {\n options = {};\n }\n\n this.name = options.name || \"newCategory name\";\n this.id = options.id || \"newCategoryId\";\n this.items = options.items || [];\n this.categoryFields = options.categoryFields || [];\n }", "title": "" }, { "docid": "172daf0f7866947127051f798fc3e2de", "score": "0.46083152", "text": "function apiCategory(id, urlDetail, ...postData){\n const category = new ApiCall(id, urlDetail, ...postData);\n return category;\n\n}", "title": "" } ]
d36e218ff88d436a029e80735afff228
function creates and returns XMLHttpRequest object. The XMLHttpRequest object can be used to request data from a web server.
[ { "docid": "4f9233ea53a8f7fb7bb5333ff62d0cca", "score": "0.8614952", "text": "function createObject() {\n return new XMLHttpRequest();\n }", "title": "" } ]
[ { "docid": "cb5f277a6959aace70a5af25fd8642b4", "score": "0.847699", "text": "function createXMLHttpRequest() {\n var xmlHttp=null;\n try {\n\t// Firefox, Opera 8.0+, Safari\n\txmlHttp=new XMLHttpRequest();\n } catch (e) {\n\t//Internet Explorer\n\t\n\ttry {\n\t xmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t} catch (e) {\n\t xmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n }\n return xmlHttp;\n}", "title": "" }, { "docid": "9876b0533654c0b45c8f4835d5f40981", "score": "0.83442485", "text": "function createRequestObject() {\n\tvar http;\n\tif (navigator.appName == \"Microsoft Internet Explorer\") {\n\t\thttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\telse {\n\t\thttp = new XMLHttpRequest();\n\t}\n\treturn http;\n}", "title": "" }, { "docid": "79eb3c1b98071f4b4edd68640971eafa", "score": "0.83226264", "text": "function createHttpRequest() {\r\n if( typeof XMLHttpRequest !== 'undefined') {\r\n return new XMLHttpRequest();\r\n }\r\n\r\n if(window.ActiveXObject) {\r\n var avers = [\"Microsoft.XmlHttp\", \"MSXML2.XmlHttp\", \"MSXML2.XmlHttp.3.0\", \"MSXML2.XmlHttp.4.0\", \"MSXML2.XmlHttp.5.0\"];\r\n var i;\r\n\r\n for(i = avers.length - 1; i >= 0; i--) {\r\n try {\r\n var httpObj = new ActiveXObject(avers[i]);\r\n return httpObj;\r\n } catch(e) {\r\n }\r\n }\r\n }\r\n\r\n throw new Error('XMLHttp (AJAX) not supported');\r\n}", "title": "" }, { "docid": "b81d9638a72d0074c531c117aad2ea1a", "score": "0.8307456", "text": "createRequest () {\n try {\n return new XMLHttpRequest ();\n } catch (trymicrosoft) {\n try {\n return new ActiveXObject(\"Msxm12.XMLHTTP\");\n } catch (othermicrosoft) {\n try {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (failed) {\n return null;\n }\n }\n }\n }", "title": "" }, { "docid": "07f1426109923a1c9a6d4c101592ee9d", "score": "0.8299286", "text": "function createHttpRequestObject() {\n\tvar xmlHttp;\n\n\t/*Code Source: Mozilla.org - Getting Started with Ajax*/\t\n\tif(window.ActiveXObject) {\n\t\ttry {\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tcatch(e) {\n\t\t\txmlHttp = false;\n\t\t}\t\t\t\n\t} \n\telse {\n\t\ttry {\n\t\t\txmlHttp = new XMLHttpRequest(); \n\t\t} catch(e) {\n\t\t\txmlHttp = false; \n\t\t}\n\t}\n\t\n\tif(!xmlHttp)\n\t\talert(\"Could not create XML Request\");\n\telse {\n\t\treturn xmlHttp; \n\t}\n}", "title": "" }, { "docid": "04c9fc6c1d4542b07f6a86a62a6df26d", "score": "0.8271887", "text": "function createXMLHttpRequest()\n{\n var xmlreq;\n\n try { // for Firefox, IE7, Opera\n xmlreq = new XMLHttpRequest();\n }\n catch (e) {\n try { // for IE6\n xmlreq = new ActiveXObject('MSXML2.XMLHTTP.5.0');\n }\n catch (e) {\n xmlreq = null;\n }\n }\n return xmlreq;\n}", "title": "" }, { "docid": "819d5e22712036f8351e8e7617fb94f3", "score": "0.8253018", "text": "function createRequest()\n\t\t\t{\n\t\t\t\tvar request;\n\t\t\t\ttry {\n\t\t\t\t\trequest = new XMLHttpRequest();\n\t\t\t\t} catch (trymicrosoft) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t\t\t\t} catch (othermicrosoft) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t\t\t} catch(nosupport) {\n\t\t\t\t\t\t\trequest = false;\n\t\t\t\t\t\t}// end try\n\t\t\t\t\t}// end try\n\t\t\t\t}// end try\n\n\t\t\t\tif (!request) {\n\t\t\t\t\tthrow 'Your browser does not support Ajax';\n\t\t\t\t}// end if\n\n\t\t\t\treturn request;\n\n\t\t\t}// end createRequest", "title": "" }, { "docid": "e4d24c92c075edfb93551f15a134f95a", "score": "0.8223784", "text": "function createXHR() {\n if (typeof XMLHttpRequest != \"undefined\") {\n return new XMLHttpRequest();\n } else if (typeof ActiveXObject != \"undefined\") {\n if (typeof arguments.callee.activeXString != \"string\") {\n var versions = [\"MSXML2.XMLHttp.6.0\", \"MSXML2.XMLHttp.3.0\", \"MSXML2.XMLHttp\"],\n i, len;\n for (i = 0, len = versions.lenght; i < len; i++) {\n try {\n new ActiveXObject(versions[i]);\n arguments.callee.activeXString = versions[i];\n break;\n } catch (ex) {}\n }\n }\n return new ActiveXObject(arguments.callee.activeXString);\n } else {\n throw new Error(\"No XHR object available\");\n }\n}", "title": "" }, { "docid": "05f170e2a7df405a137ef2fc767c6783", "score": "0.82043326", "text": "function createXMLHttpRequest() {\n var request = false;\n if (window.XMLHttpRequest) {\n if (typeof XMLHttpRequest != 'undefined')\n try {\n request = new XMLHttpRequest();\n } catch(e) {\n request = false;\n }\n } else if (window.ActiveXObject) {\n try {\n request = new ActiveXObject('Msxml2.XMLHTTP');\n } catch(e) {\n request = false;\n }\n }\n\n return request;\n}", "title": "" }, { "docid": "e2771d48e5ec64e5b69ddb0a236a0649", "score": "0.81773823", "text": "function creatXMLHttpRequestObj() {\n var xmlObject = null;\n try {\n xmlObject = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xmlObject = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (oc) {\n xmlObject = null;\n }\n }\n if (!xmlObject && typeof XMLHttpRequest != \"undefined\") {\n xmlObject = new XMLHttpRequest();\n }\n return xmlObject;\n }", "title": "" }, { "docid": "a94e28d466fed4ab045bb142a8da9c4b", "score": "0.8123549", "text": "function createRequest()\n{\n\tvar request = null;\n\n\ttry\n\t{\n\t\trequest = new XMLHttpRequest();\n\t}\n\tcatch (trymicrosoft)\n\t{\n\t\ttry\n\t\t{\n\t\t\trequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t}\n\t\tcatch (othermicrosoft)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\trequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t}\n\t\t\tcatch (failed)\n\t\t\t{\n\t\t\t\trequest = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (request == null)\n\t{\n\t\talert(\"Error Creating Ajax Object\");\n\t}\n\telse\n\t{\n\t\treturn request;\n\t}\n}", "title": "" }, { "docid": "f5e44692b79b3dbe0e5c67951530b7b5", "score": "0.81205827", "text": "function createXMLHTTPRequest(){\r\n\tvar xmlHTTPRequest = null;\r\n\t\r\n\t//revisamos si no esta definido el objeto nativamente(navegadores tipo mozilla)\r\n\tif (typeof XMLHttpRequest == \"undefined\" ){\r\n\t\t//Ahora revisamos si el motor es mayor o igual a MSIE 5.0 \r\n\t\t//(mayor que microsoft internet explorer 5.0)\r\n\t\tif(navigator.userAgent.indexOf(\"MSIE 5\") >= 0){\r\n\t\t\t// Si es así creamos un control activeX apartir de un objeto\r\n\t\t\t//ActiveXObject(\"Microsoft.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} else {\r\n\t\t\t//si no , o si es menor a MSIE 5.0 creamos otro control activeX\r\n\t\t\t// apartir de un objeto ActiveXObject(\"Msxml2.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t\t} \r\n\t} else {\r\n\t\t// en cambio si el objeto estaba definido nativamente, solo lo instanciamos\r\n\t\txmlHTTPRequest = new XMLHttpRequest();\r\n\t}\r\n\t\r\n\treturn xmlHTTPRequest;\r\n}", "title": "" }, { "docid": "f5e44692b79b3dbe0e5c67951530b7b5", "score": "0.81205827", "text": "function createXMLHTTPRequest(){\r\n\tvar xmlHTTPRequest = null;\r\n\t\r\n\t//revisamos si no esta definido el objeto nativamente(navegadores tipo mozilla)\r\n\tif (typeof XMLHttpRequest == \"undefined\" ){\r\n\t\t//Ahora revisamos si el motor es mayor o igual a MSIE 5.0 \r\n\t\t//(mayor que microsoft internet explorer 5.0)\r\n\t\tif(navigator.userAgent.indexOf(\"MSIE 5\") >= 0){\r\n\t\t\t// Si es así creamos un control activeX apartir de un objeto\r\n\t\t\t//ActiveXObject(\"Microsoft.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} else {\r\n\t\t\t//si no , o si es menor a MSIE 5.0 creamos otro control activeX\r\n\t\t\t// apartir de un objeto ActiveXObject(\"Msxml2.XMLHTTP\")\r\n\t\t\txmlHTTPRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t\t} \r\n\t} else {\r\n\t\t// en cambio si el objeto estaba definido nativamente, solo lo instanciamos\r\n\t\txmlHTTPRequest = new XMLHttpRequest();\r\n\t}\r\n\t\r\n\treturn xmlHTTPRequest;\r\n}", "title": "" }, { "docid": "4ba8dd50568d00d673da10969908baa4", "score": "0.8093097", "text": "function createXMLHttpRequest() {\r\n var xmlHttpOut;\r\n if (window.ActiveXObject) {\r\n xmlHttpOut = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } else if (window.XMLHttpRequest) {\r\n xmlHttpOut = new XMLHttpRequest();\r\n }\r\n return xmlHttpOut;\r\n}", "title": "" }, { "docid": "a2b04e82a5e05d916b79e0d1f560cc10", "score": "0.80908287", "text": "function createXMLHTTPObject() {\n var XMLHttpFactories = [\n function () {return new XMLHttpRequest();},\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\");},\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\");},\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\");}\n ];\n var xhr = false;\n for (var i = 0; i < XMLHttpFactories.length; i++) {\n try {\n xhr = XMLHttpFactories[i]();\n } catch(e) {\n continue;\n }\n break;\n }\n return xhr;\n }", "title": "" }, { "docid": "9b851c01b1d2185517d90fcec14b53d0", "score": "0.80698043", "text": "function create_xhr_object() {\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n }\n\n if (window.ActiveXObject) {\n var names = [\n \"Msxml2.XMLHTTP.6.0\", \"Msxml2.XMLHTTP.3.0\",\n \"Msxml2.XMLHTTP\", \"Microsoft.XMLHTTP\"\n ];\n\n for(var i in names) {\n try {\n return new ActiveXObject(names[i]);\n } catch (e) {}\n }\n }\n\n return null;\n }", "title": "" }, { "docid": "760c17d5d3539de70b935c4a1f0f983e", "score": "0.80695474", "text": "function createRequest() \n{\n\t\n\ttry \n\t{\n\tvar request = new XMLHttpRequest();\n\t} \n\tcatch (tryMS) \n\t{\n\t\ttry \n\t\t{\n\t\trequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} \n\t\tcatch (otherMS) \n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\trequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} \n\t\t\tcatch (failed) \n\t\t\t{\n\t\t\t\trequest = null;\n\t\t\t}\n\t\t}\n\t}\n\treturn request;\n}", "title": "" }, { "docid": "c269559c8e7ba880e4b90e9796ddab38", "score": "0.8063313", "text": "function inicializa_xhr()\n{\n\tif(window.XMLHttpRequest)\n\t{\n\t\tobjXHR=new XMLHttpRequest();\n\t\t//Navegador Microsoft\n\t}else if(window.ActiveXObject)\n\t{\n\t\tobjXHR=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\t\n\treturn objXHR;\n}", "title": "" }, { "docid": "a958643eab20cb78bd89d4826ef1647f", "score": "0.806243", "text": "function createXMLHTTPObject() {\n var XMLHttpFactories = [\n function () {return new XMLHttpRequest()},\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\n ];\n var xhr = false;\n for(var i=0; i<XMLHttpFactories.length; i++) {\n try {\n xhr = XMLHttpFactories[i]();\n } catch(e) {\n continue;\n }\n break;\n }\n return xhr;\n }", "title": "" }, { "docid": "98ede44ab8a7f4a0822fcee38eeb2f20", "score": "0.80504143", "text": "function createXHR () {\n if (typeof XMLHttpRequest != 'undefined') {\n createXHR = function () {\n return new XMLHttpRequest;\n };\n } else if (typeof ActiveXObject != 'undefined') {\n createXHR = function () {\n if(typeof arguments.callee.activeString != 'string') {\n var versions = [“MSXML2.XMLHttp.6.0”, “MSXML2.XMLHttp.3.0”, “MSXML2.XMLHttp”],\n i,\n len;\n for (i = 0, len = versions.length; i < len; i++){\n try{\n new ActiveXObject(versions[i]);\n arguments.callee.activeString = versions[i];\n break;\n } catch (ex) {\n // skip\n }\n }\n return newActiveXObject(versions[i]);\n }\n };\n } else {\n createXHR = function () {\n throw new Exception ('No XHR object is avaible.');\n };\n } \n}", "title": "" }, { "docid": "4fde62a647d38c0a73003ca99568b9c4", "score": "0.799946", "text": "function getXMLHttpRequest(){\n\tvar xmlHttp=null;\n\ttry{// Firefox, Opera 8.0+, Safari\n\t\txmlHttp = new XMLHttpRequest();\n\t}catch(e){\n\t\ttry{ // Internet Explorer\n \t\txmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n \t\t }catch(e){\n \t\t\txmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t\t }\n\t}\n\treturn xmlHttp;\n}", "title": "" }, { "docid": "3b4fdc015bee31136dcbbbc5a228c6fe", "score": "0.7998547", "text": "function createXmlHttp() {\n let xmlhttp;\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n if (!(xmlhttp)) {\n alert(\"Your browser does not support AJAX!\");\n }\n return xmlhttp;\n}", "title": "" }, { "docid": "a6709b511673b456edb63ac1e4f35cc8", "score": "0.7977979", "text": "function createXmlHttpRequestObject()\n{\n// will store the reference to the XMLHttpRequest object\nvar xmlHttp;\n// this should work for all browsers except IE6 and older\ntry\n{\n// try to create XMLHttpRequest object\nxmlHttp = new XMLHttpRequest();\n}\ncatch(e)\n{\n// assume IE6 or older\nvar XmlHttpVersions = new Array(\"MSXML2.XMLHTTP.6.0\",\n\"MSXML2.XMLHTTP.5.0\",\n\"MSXML2.XMLHTTP.4.0\",\n\"MSXML2.XMLHTTP.3.0\",\n\"MSXML2.XMLHTTP\",\n\"Microsoft.XMLHTTP\");\n// try every id until one works\nfor (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)\n{\ntry\n{\n// try to create XMLHttpRequest object\nxmlHttp = new ActiveXObject(XmlHttpVersions[i]);\n}\ncatch (e) {} // ignore potential error\n}\n}\n// return the created object or display an error message\nif (!xmlHttp)\ndisplayError(\"Error creating the XMLHttpRequest object.\");\nelse\nreturn xmlHttp;\n}", "title": "" }, { "docid": "b68ff195068b2fe7805f9235da47face", "score": "0.7966241", "text": "function createHttpRequestObj(){\n\tvar xmlHttpObj;\n\tif (window.XMLHttpRequest){\n\t\t// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\ttry{\n\t\t\txmlHttpObj = new XMLHttpRequest();\n\t\t}catch(e){\n\t\t\txmlHttpObj = false;\n\t\t}\n\t }\n\telse{\n\t\t// code for IE6, IE5\n\t\ttry{\n\t\t\txmlHttpObj=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}catch(e)\n\t\t{\n\t\t\txmlHttpObj =false;\n\t\t}\n\t}\n\t\n\tif(!xmlHttpObj)\n\t\t\talert (\"Cannot create the Http request object\")\n\telse\t{\n\t\treturn xmlHttpObj;\n\t}\n}", "title": "" }, { "docid": "7aafc47f9f234aa1f72ca22b966434c6", "score": "0.7965212", "text": "function createXHR() {\n\t\ttry { return new XMLHttpRequest(); } catch (e) { console.log(e) }\n\t\ttry { return new ActiveXObject(\"Msxml2.XMLHTTP.6.0\"); } catch (e) { console.log(e) }\n\t\ttry { return new ActiveXObject(\"Msxml2.XMLHTTP.3.0\"); } catch (e) { console.log(e) }\n\t\ttry { return new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch (e) { console.log(e) }\n\t\ttry { return new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch (e) { console.log(e) }\n\t\tconsole.log(\"XMLHttpRequest not supported\");\n\t\treturn null;\n\t}", "title": "" }, { "docid": "6a97cee038f1df4929aba9086c5b4304", "score": "0.7953018", "text": "function newXMLHttpRequest() {\n\n\t var xmlreq = false;\n\n\t // Create XMLHttpRequest object in non-Microsoft browsers\n\t if (window.XMLHttpRequest) {\n\t xmlreq = new XMLHttpRequest();\n\n\t } else if (window.ActiveXObject) {\n\n\t try {\n\t // Try to create XMLHttpRequest in later versions\n\t // of Internet Explorer\n\n\t xmlreq = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t \n\t } catch (e1) {\n\n\t // Failed to create required ActiveXObject\n\t \n\t try {\n\t // Try version supported by older versions\n\t // of Internet Explorer\n\t \n\t xmlreq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\n\t } catch (e2) {\n\n\t // Unable to create an XMLHttpRequest by any means\n\t xmlreq = false;\n\t }\n\t }\n\t }\n\n\treturn xmlreq;\n}", "title": "" }, { "docid": "f7e2a9d7a9a793503ef720a0c8d7e6a3", "score": "0.79508203", "text": "function createXMLHttp() {\r\n\tif (typeof XMLHttpRequest != \"undefined\") {\r\n\t\treturn new XMLHttpRequest();\r\n\t} else if (window.ActiveXObject) {\r\n\t\tvar aVersions = [\"MSXML2.XMLHttp.5.0\", \"MSXML2.XMLHttp.4.0\",\r\n\t\t\t\t\"MSXML2.XMLHttp.3.0\", \"MSXML2.XMLHttp\", \"Microsoft.XMLHttp\"];\r\n\t\tfor (var i = 0; i < aVersions.length; i++) {\r\n\t\t\ttry {\r\n\t\t\t\tvar oXmlHttp = new ActiveXObject(aVersions[i]);\r\n\t\t\t\treturn oXmlHttp;\r\n\t\t\t} catch (oError) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "0e7c2f5e8cab0c0bb9dc1a4cba1d484a", "score": "0.7940127", "text": "function newXMLHttpRequest() {\n var reqObj = false;\n /*@cc_on @*/\n /*@if (@_jscript_version >= 5)\n try {\n reqObj = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n reqObj = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (E) {\n reqObj = false;\n }\n }\n @else\n reqObj = false;\n @end @*/\n if (!reqObj) {\n try {\n reqObj = new XMLHttpRequest();\n }\n catch (e) {\n reqObj = false;\n }\n }\n return reqObj;\n}", "title": "" }, { "docid": "2ae60d8adf6c436bfd52a3039d49208c", "score": "0.79382044", "text": "function newXMLHttpRequest() {\r\n var xmlreq = false;\r\n if(window.XMLHttpRequest) {\r\n xmlreq = new XMLHttpRequest();\r\n } else if(window.ActiveXObject) {\r\n try {\r\n xmlreq = new ActiveXObject(\"MSxm12.XMLHTTP\");\r\n } catch(e1) {\r\n try {\r\n xmlreq = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch(e2) {\r\n xmlreq = false;\r\n }\r\n }\r\n }\r\n return xmlreq;\r\n}", "title": "" }, { "docid": "85faef357ad28d1d617bced78a70c6b0", "score": "0.7931032", "text": "function getXMLHttpRequestObject() {\r\n xmlhttp = 0;\r\n try {\r\n // Try to create object for Chrome, Firefox, Safari, IE7+, etc.\r\n xmlhttp = new XMLHttpRequest();\r\n }\r\n catch (e) {\r\n try {\r\n // Try to create object for later versions of IE.\r\n xmlhttp = new ActiveXObject('MSXML2.XMLHTTP');\r\n }\r\n catch (e) {\r\n try {\r\n // Try to create object for early versions of IE.\r\n xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');\r\n }\r\n catch (e) {\r\n // Could not create an XMLHttpRequest object.\r\n return false;\r\n }\r\n }\r\n }\r\n return xmlhttp;\r\n}", "title": "" }, { "docid": "3e5076f2325b49f58e5e14a5abd161b1", "score": "0.79218084", "text": "function createRequest() {\r\n var xhr = false; \r\n if (window.XMLHttpRequest) {\r\n xhr = new XMLHttpRequest();\r\n }\r\n else if (window.ActiveXObject) {\r\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n return xhr;\r\n} // end function createRequest()", "title": "" }, { "docid": "0c3c985f16d15e3093b6a5fa48879c64", "score": "0.790611", "text": "function createXHR() {\n if (typeof XMLHttpRequest != \"undefined\") {\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n var aVersions = [\"MSXML2.XMLHttp.6.0\", \"MSXML2.XMLHttp.3.0\"];\n\n for (var i = 0; i < aVersions.length; i++) {\n try {\n var oXHR = new ActiveXObject(aVersions[i]);\n return oXHR;\n } catch (oError) {\n //Do nothing\n }\n }\n }\n}", "title": "" }, { "docid": "71b605d3a747949ec3406bd077493826", "score": "0.78988355", "text": "function createRequestObject() {\r\n\tvar ro = null;\r\n\ttry {\r\n\t\tro = new ActiveXObject('Msxml2.XMLHTTP');\r\n\t} catch(e) {\r\n\t\ttry {\r\n\t\t\tro = new ActiveXObject('Microsoft.XMLHTTP');\r\n\t\t} catch(oc) {\r\n\t\t\tro = null;\r\n\t\t}\r\n\t}\r\n\tif (!ro && typeof XMLHttpRequest != 'undefined') {\r\n\t\tro = new XMLHttpRequest();\r\n\t}\r\n\treturn ro;\r\n}", "title": "" }, { "docid": "d121d9c8ebf25c090ad2930a259d1f66", "score": "0.78960514", "text": "function creaXMLHTTPRequest() {\n var xmlHttp;\n\n if (window.ActiveXObject) {\n // IE\n try {\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n xmlHttp = false;\n }\n } else {\n // Firefox, Chrome, etc..\n try {\n xmlHttp = new XMLHttpRequest();\n } catch(e) {\n xmlHttp = false;\n }\n }\n\n if (!xmlHttp) {\n alert(\"Impossibile creare l'oggetto XMLHttpRequest\");\n } else {\n return xmlHttp;\n }\n}", "title": "" }, { "docid": "2c7c0b6ba5dae2155ed349b52fbe1d4f", "score": "0.7895711", "text": "function getXMLHttpRequest(){\r\n\tvar xmlHttp=null;\r\n\ttry{// Firefox, Opera 8.0+, Safari\r\n\t\txmlHttp = new XMLHttpRequest();\r\n\t}catch(e){\r\n\t\ttry{ // Internet Explorer\r\n \t\txmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n \t\t }catch(e){\r\n \t\t\txmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \t\t }\r\n\t}\r\n\treturn xmlHttp;\r\n}", "title": "" }, { "docid": "7754016fd22d494e484e5033f1fa3733", "score": "0.7894477", "text": "function createXMLHttpRequestObject(){\n // xmlHttp will store the reference to the XMLHttpRequest object\n var xmlHttp;\n // try to instantiate the native XMLHttpRequest object\n try{\n // create an XMLHttpRequest object\n xmlHttp = new XMLHttpRequest();\n }\n catch(e){\n // assume IE6 or older\n try{\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHttp\");\n }\n catch(e) { }\n }\n // return the created object or display an error message\n if (!xmlHttp)\n alert(\"Error creating the XMLHttpRequest object.\");\n else \n return xmlHttp;\n}", "title": "" }, { "docid": "07b4d619a4d34f9c18d18859b75cc6fa", "score": "0.7881413", "text": "function createXmlHttpRequestObject() \n{\n\tvar xmlHttp;\n\n\tif(window.ActiveXObject) //If user is using internet Explorer\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.xmlHttp\");\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\txmlHttp=false;\n\t\t}\n\t}\n\telse //If user is NOT using internet Explorer but any other browser\n\t{\n\t\ttry\n\t\t{\n\t\t\txmlHttp = new XMLHttpRequest();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\txmlHttp=false;\n\t\t}\n\t}\n\n\tif(!xmlHttp) //If Object can not be initialized.\n\t\t{\n\t\t\talert(\"Can not create object\");\n\t\t}\n\telse\n\t{\n\t\treturn xmlHttp;\n\t}\n}", "title": "" }, { "docid": "78035e94fc754d767bf6ca5b82ccea7f", "score": "0.7880422", "text": "function getHTTPObject() {\n var xhr = false;\n\n if (window.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n try {\n xhr = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch(e) {\n try {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch(e) {\n xhr = false;\n }\n }\n }\n\n return xhr;\n }", "title": "" }, { "docid": "335bbc57714e3177f736b43ecc8d9960", "score": "0.7879323", "text": "function createStandardXHR() {\n\t try {\n\t return new window.XMLHttpRequest();\n\t } catch( e ) {}\n\t }", "title": "" }, { "docid": "bec225030ad4cc83ff2315996f330fc2", "score": "0.78646845", "text": "function createStandardXHR() {\r\n try {\r\n return new window.XMLHttpRequest();\r\n } catch( e ) {}\r\n }", "title": "" }, { "docid": "11d7f5d3d307a24009ca8e10ac893129", "score": "0.78603345", "text": "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n }", "title": "" }, { "docid": "40998425c92b619074b724744fc74bdd", "score": "0.7856292", "text": "function createStandardXHR() {\n\t\t\ttry {\n\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t} catch ( e ) {}\n\t\t}", "title": "" }, { "docid": "7592e8935f4d52e531a9358a721f6df2", "score": "0.78518206", "text": "function createXHR(){\n if( typeof XMLHttpRequest != \"undefined\"){\n return new XMLHttpRequest();\n }\n if(typeof ActiveXobject == \"undefined\"){\n throw new Error(\" not support, change browser maybe? Chrome for exmaple.\");\n }\n return new ActiveXobject(arguments.callee.activeString);\n}", "title": "" }, { "docid": "3572b91a11ed3a00f2c32e44c4356435", "score": "0.7849558", "text": "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch ( e ) {}\n }", "title": "" }, { "docid": "0c7f06ba02ae66408c7991820579ffe5", "score": "0.7844939", "text": "function createStandardXHR() {\r\n try {\r\n return new window.XMLHttpRequest();\r\n } catch (e) {}\r\n }", "title": "" }, { "docid": "d2ebb283b88724068fa7098be1ed8d6d", "score": "0.78429437", "text": "function getHTTPObject() {\n\n var xhr;\n\n if (window.XMLHttpRequest) { // check for support\n\n // if it's supported, use it becasuse it's better\n xhr = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // check for the IE 6 Ajaax\n\n // save it to xhr variable\n xhr = new ActiveXObject('Msxml2.XMLHTTP');\n }\n\n return xhr;\n}", "title": "" }, { "docid": "27846470f22760d17af36d12f9d0ed53", "score": "0.78419495", "text": "function createStandardXHR() {\n\t\t\ttry {\n\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t} catch (e) {}\n\t\t}", "title": "" }, { "docid": "27846470f22760d17af36d12f9d0ed53", "score": "0.78419495", "text": "function createStandardXHR() {\n\t\t\ttry {\n\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t} catch (e) {}\n\t\t}", "title": "" }, { "docid": "6925b67329d46c25a163ebfab6ab94c4", "score": "0.7839679", "text": "function createXmlHttpRequestObjectPatent()\n{\n var xmlHttpPatent;\n if (window.XMLHttpRequest)\n {\n xmlHttpPatent = new XMLHttpRequest();\n } else\n {\n xmlHttpPatent = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n return xmlHttpPatent;\n}", "title": "" }, { "docid": "53c1449d131d2a1feb3269104b303288", "score": "0.7836036", "text": "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch( e ) {}\n }", "title": "" }, { "docid": "f4d878d4d89066e718c899c535a7295f", "score": "0.78317505", "text": "function createRequest() {\n var request = null;\n try {\n request = new XMLHttpRequest();\n } catch (trymicrosoft) {\n try {\n request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (othermicrosoft) {\n try {\n request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (failed) {\n request = null;\n }\n }\n }\n\n if (request == null) {\n alert(\"Error creating request object!\");\n } else {\n return request;\n }\n}", "title": "" }, { "docid": "561ff2a93e7d8834b62a684e72122441", "score": "0.78092706", "text": "function RequestFactory() {\n // se XMLHttpRequest for disponível\n // retorne-o\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n // senão, se ActiveXObject estiver disponível\n // retorne-o e passe por parâmetro Microsoft.XMLHTTP\n } else if (window.ActiveXObject) {\n return ActiveXObject(\"Microsoft.XMLHTTP\");\n // caso nenhum desses seja disponível, emita um alerta e \n // retorne nulo\n } else {\n alert(\"Ajax não está disponível!\");\n return null;\n }\n }", "title": "" }, { "docid": "660a72010727241ea4bba9ac2d579994", "score": "0.7807562", "text": "function GetXmlHttpObject()\n\t\t{\n\t\t\tvar xmlHttp=null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Firefox, Opera 8.0+, Safari\n\t\t\t\txmlHttp = new XMLHttpRequest();\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\t//Internet Explorer\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\txmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t\t\t}\n\t\t\t\t//Google Chrome\n\t\t\t\tcatch(e)\n\t\t\t\t{\n\t\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn xmlHttp;\n }", "title": "" }, { "docid": "70ca31b04623ec7b905b6faa85d75454", "score": "0.78072536", "text": "function get_XmlHttp() {\n // create the variable that will contain the instance of the XMLHttpRequest object (initially with null value)\n var xmlHttp = null;\n\n if(window.XMLHttpRequest) {\t\t// for Forefox, IE7+, Opera, Safari, ...\n xmlHttp = new XMLHttpRequest();\n }\n else if(window.ActiveXObject) {\t// for Internet Explorer 5 or 6\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n return xmlHttp;\n}", "title": "" }, { "docid": "79236b483ccbed056c2108d91df2bc32", "score": "0.77985114", "text": "function createXmlHttpRequestObject() { //create object for communication\n\tvar xmlHttp;\n\t\n\tif(window.ActiveXObject) { //internet explorer\n\t\ttry{\n\t\t\txmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}catch(e){\n\t\t\txmlHttp = false;\n\t\t}\n\t}else{ //firefox, google chrome\n\t\ttry{\n\t\t\txmlHttp = new XMLHttpRequest();\n\t\t}catch(e){\n\t\t\txmlHttp = false;\n\t\t}\t\n\t}\n\t\n\tif(!xmlHttp) //if equal to false \n\t\talert(\"Cannot create object\");\n\telse\n\t\treturn xmlHttp;\n}", "title": "" }, { "docid": "024f1bc553e86c24b38ce8977c3d09a1", "score": "0.77936655", "text": "function getXmlHttp() {\n var xmlHttp = null; // will stere and return the XMLHttpRequest\n\n if(window.XMLHttpRequest) xmlHttp = new XMLHttpRequest(); // Forefox, Opera, Safari, ...\n else if(window.ActiveXObject) xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); // IE\n\n return xmlHttp;\n }", "title": "" }, { "docid": "39077329e4d04b53872ad03bbe4b8de6", "score": "0.7775461", "text": "function getXMLHttpRequest() {\n if (window.XMLHttpRequest && (window.location.protocol !== \"file:\" || !(\"ActiveXObject\" in window))) {\n return new XMLHttpRequest();\n } else {\n try {\n /*global ActiveXObject */\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n logger.error(\"browser doesn't support AJAX.\");\n return null;\n }\n }\n }", "title": "" }, { "docid": "52c5d8e25255e5d80ff18626fef24f18", "score": "0.7767644", "text": "function httpRequest() {\n\tif (window.XMLHttpRequest) {\n\t\treturn new XMLHttpRequest();\n\t} else if (window.ActiveXObject) {\n\t\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n}", "title": "" }, { "docid": "d2ef43acbfdc877772040447de8aed69", "score": "0.77581346", "text": "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch( e ) {}\n\t}", "title": "" }, { "docid": "d2ef43acbfdc877772040447de8aed69", "score": "0.77581346", "text": "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch( e ) {}\n\t}", "title": "" }, { "docid": "f8a3fd434a96102785eb3aa5efaba9c3", "score": "0.77519745", "text": "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch (e) {}\n\t}", "title": "" }, { "docid": "f8a3fd434a96102785eb3aa5efaba9c3", "score": "0.77519745", "text": "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch (e) {}\n\t}", "title": "" }, { "docid": "96b715fada9c32087aaf0917fd933309", "score": "0.7734137", "text": "function getHttpObject() {\n var http_request = false;\n if (window.XMLHttpRequest) { // Mozilla, Safari,...\n http_request = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // IE\n try {\n http_request = new ActiveXObject('Msxml2.XMLHTTP');\n } catch (e) {\n try {\n\thttp_request = new ActiveXObject('Microsoft.XMLHTTP');\n } catch (e) {}\n }\n }\n \n if (!http_request) {\n alert('Cannot create and instance of XMLHTTP');\n }\n return http_request;\n}", "title": "" }, { "docid": "360f787eba10b0be6bfbb641d86ce76a", "score": "0.77301544", "text": "function createXHR()\r\n{\r\n if (window.XMLHttpRequest)\r\n XHR = new XMLHttpRequest();//With Mozilla, Nescape, ...\r\n else\r\n if (window.ActiveXObject)\r\n XHR = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n}", "title": "" }, { "docid": "756fb5df8dbe740fde2a836f025cff23", "score": "0.77273965", "text": "function getXMLHttpRequest(){\n var xmlhttp=null;\n if (window.XMLHttpRequest){\n xmlhttp=new XMLHttpRequest();\n }\n else{\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n return xmlhttp;\n}", "title": "" }, { "docid": "4f13fb62a689118fe235cdb773f2cbf4", "score": "0.77182376", "text": "function getXmlHttpRequest() {\n var xhr = null;\n\n try {\n // Not-ancient browsers (Firefox, Opera 8+, Chrome, and IE 7+)\n // implement the standard XMLHttpRequest object. IE7's isn't quite\n // right, but let's ignore that for now.\n xhr = new XMLHttpRequest();\n }\n catch (e) {\n try {\n // Older versions of IE use ActiveX for XMLHttpRequests.\n // \"MSXML2\" refers to the current version of Microsoft's MSXML\n // library, whatever its number happens to be.\n xhr = new ActiveXObject('Msxml2.XMLHTTP');\n }\n catch (e) {\n // Some implementations of this function test for other kinds of\n // ActiveX objects in IE, but I'm leaving them out to avoid any\n // more try/catches. This should be good enough for class, and\n // in real life you should just use a library like jQuery to\n // handle this stuff. It's not worth your time.\n }\n }\n\n return xhr;\n }", "title": "" }, { "docid": "5a9ad73070238e081b0d3186e70d254a", "score": "0.77148336", "text": "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n }", "title": "" }, { "docid": "a9beb7938cbcedb5dca319e169b8b42b", "score": "0.771098", "text": "function GetXmlHttpObject()\n{\n\t//If we already have one, just return that.\n\tif (xmlHttp != null) return xmlHttp;\n\txmlHttp = new XMLHttpRequest();\n\treturn xmlHttp;\n}", "title": "" }, { "docid": "49e4f9fdf9bcb9a35726386355943402", "score": "0.77043945", "text": "function getHTTPObject() {\n\tvar xmlhttp;\n\tif (!xmlhttp && typeof XMLHttpRequest != 'undefined') {\n\t\ttry {\n\t\t\txmlhttp = new XMLHttpRequest();\n\t\t} catch (e) {\n\t\t\txmlhttp = false;\n \t}\n\t}\n\treturn xmlhttp;\n}", "title": "" }, { "docid": "883c8b7296b8c55ff7b71e86193bd458", "score": "0.7699098", "text": "function getXMLHttpRequestObject() {\n var ref = null;\n if (window.XMLHttpRequest) {\n ref = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // Older IE.\n ref = new ActiveXObject(\"MSXML2.XMLHTTP.3.0\");\n }\n return ref;\n }", "title": "" }, { "docid": "e11a77cea72547f524ca4c8e1d5638d8", "score": "0.7697409", "text": "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "title": "" }, { "docid": "e11a77cea72547f524ca4c8e1d5638d8", "score": "0.7697409", "text": "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "title": "" }, { "docid": "4465c6850cdfc9d238d05bfb88f0a286", "score": "0.76884276", "text": "function get_XmlHttp() {\n var xmlHttp = null; // will stere and return the XMLHttpRequest\n\n if(window.XMLHttpRequest) xmlHttp = new XMLHttpRequest(); // Forefox, Opera, Safari, ...\n else if(window.ActiveXObject) xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); // IE\n\n return xmlHttp;\n}", "title": "" }, { "docid": "acf78e8a8d7650fd3e5245318f6853ba", "score": "0.7682466", "text": "function GetXmlHttpObject(){\nvar xmlHttp=null;\ntry\n {\n // IE7+, Firefox, Opera 8.0+, Safari\n xmlHttp=new XMLHttpRequest();\n }\ncatch (e)\n {\n // Internet Explorer\n try\n {\n xmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n catch (e)\n {\n xmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n }\nreturn xmlHttp;\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" }, { "docid": "99889f00bc5167953831fac0f1086415", "score": "0.7680912", "text": "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "title": "" } ]
ef6c03c6c81b73ed572e8003e5473593
.on("dragstart", dragstartAll); For not moving after drag
[ { "docid": "9b20440a5d1e139ad290fcbcacab52b0", "score": "0.0", "text": "function dblclick(d) {\n d3.select(this).classed(\"fixed\", d.fixed = false);\n\n }", "title": "" } ]
[ { "docid": "a8b8ba847f0268b5e39b5c523d6efd91", "score": "0.7726741", "text": "onDragStart(pointer) { return false; }", "title": "" }, { "docid": "107688b5126d1af9d5c1b022530861fa", "score": "0.7333592", "text": "function dragstarted(){\n d3.event.sourceEvent.stopPropagation();\n d3.select(this).classed('dragged', true);\n }", "title": "" }, { "docid": "8f0cb95093f6d1ab2fa6f05bec82e08e", "score": "0.7211608", "text": "_handlePointerStart() {\n this.hasDragged = false;\n }", "title": "" }, { "docid": "0a717c30744a03f7102f91a64b2ee453", "score": "0.71634644", "text": "function dragstarted() {\n if (!d3.event.active) simulation.alphaTarget(1).restart();\n d3.event.subject.fx = transform.invertX(d3.event.x);\n d3.event.subject.fy = transform.invertY(d3.event.y);\n }", "title": "" }, { "docid": "e0bdae949d0e09ed0944aa5b2814d65c", "score": "0.71532464", "text": "function dragstart(d) {\n \t d3.event.sourceEvent.preventDefault();\n \t d3.event.sourceEvent.stopPropagation();\n \t}", "title": "" }, { "docid": "67d2505504aa7cc9a0e6dd05caab67ca", "score": "0.71512204", "text": "startDrag() {\n this.dragging = true;\n }", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.7148578", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.7148578", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "e47603f26af8d5a5f47347d710029ff9", "score": "0.7148578", "text": "function noDragStart() {\n return false;\n}", "title": "" }, { "docid": "6d420d62c493b7a66c3e4b106c87af5d", "score": "0.71382535", "text": "function svg_dragstarted(d) {\n\t\t\tmain.drag_ix = d3.event.x;\n\t\t\tmain.drag_iy = d3.event.y;\n\t\t}", "title": "" }, { "docid": "2ea20f0f026aee768fb18756203810f6", "score": "0.7118955", "text": "function onDragStart(event, uiWidget, $element){}", "title": "" }, { "docid": "16a3e44a6eed62122fa393a313e5189f", "score": "0.7108912", "text": "dragged(vm, dx, dy) {\n // left to implementations\n }", "title": "" }, { "docid": "8c22431eb5ad33f97bcd324a3360ff61", "score": "0.7087776", "text": "function DragHandler() { }", "title": "" }, { "docid": "2fdd223b92d677e554a6d6307efad65d", "score": "0.70515877", "text": "function drag() {\n\t\t$(\"img, a\").on(\"dragstart\", function(event) { event.preventDefault(); });\n\t}", "title": "" }, { "docid": "d0b225315a82bb1223dffe17f9acdf0b", "score": "0.70400953", "text": "function noDragStart(){return false;} // TODO replace this with a IE8 test", "title": "" }, { "docid": "4598b171a66059fd15b09e5876296160", "score": "0.703834", "text": "function dragstarted(d) {\n d3.event.sourceEvent.stopPropagation();\n d3.select(this).classed(\"dragging\", true);\n\n}", "title": "" }, { "docid": "6b1b9f11893a8b04d650c7d4abc212ad", "score": "0.70324266", "text": "function dragStart(event) {\n event.preventDefault();\n }", "title": "" }, { "docid": "45c9a9c22cef0c79528c5257f3a9603f", "score": "0.7016905", "text": "onDragBegin(p) {\n\t}", "title": "" }, { "docid": "e23858dfcd00936d2430930ac2c78564", "score": "0.7016532", "text": "dragstarted(d) {\n d.fx = event.x;\n d.fy = event.y;\n }", "title": "" }, { "docid": "05041627b79b2f4ac3a92d322208eb67", "score": "0.7007301", "text": "function noDragStart() {\n\t return false;\n\t}", "title": "" }, { "docid": "a5f7d6c8ed5dd4a696ba0fdb2db9227a", "score": "0.69955575", "text": "function Dragon() {\n}", "title": "" }, { "docid": "2767b7f8fe84bdd7174082280ab78147", "score": "0.6974471", "text": "onDragMove(pointer) {}", "title": "" }, { "docid": "97aa73449ed345e92f2715f2f3e18c8d", "score": "0.6948828", "text": "_onDrag(e) { e.preventDefault() }", "title": "" }, { "docid": "323d454b8738b316217be24657ffe714", "score": "0.6943349", "text": "dragStart(e) {\n e.stopPropagation();\n const me = this;\n const container = me.refs[containerRef];\n container.className = [baseCls,dragCls].join(' ');\n me._isDragging = true;\n //console.log('dragstart')\n }", "title": "" }, { "docid": "2f219a7353d249a9e5bf0273e283dc69", "score": "0.6935534", "text": "dragstarted(element, event, d) {\n this.isDragging = true\n if (!event.active) {\n this.simulation.alphaTarget(0.3).restart()\n }\n\n d.fx = d.x\n d.fy = d.y\n }", "title": "" }, { "docid": "7b22c6acfcdac93c7db335d5f5d58c57", "score": "0.6934643", "text": "function CdkDragMove() { }", "title": "" }, { "docid": "7b22c6acfcdac93c7db335d5f5d58c57", "score": "0.6934643", "text": "function CdkDragMove() { }", "title": "" }, { "docid": "6bcfefbe7be039d88453679cfd7da88d", "score": "0.6909331", "text": "function drag(e) {\n dragged = e.target;\n dragging = true;\n}", "title": "" }, { "docid": "a64475a9517602430a1889743b17320b", "score": "0.6878193", "text": "function dragmove() {\r\n\t\t\r\n\t //if not draggable\t\r\n if (!d3.select(this).classed(\"draggable\")) \r\n\t\t return;\r\n\t \r\n module_data.x = Math.round(currentEvent.x/grid_spacing) * grid_spacing;\r\n module_data.y = Math.round(currentEvent.y/grid_spacing) * grid_spacing;\r\n group.attr(\"transform\", \"translate(\" + module_data.x.toFixed() + \",\" + module_data.y.toFixed() + \")\");\r\n draw_wires();\r\n }", "title": "" }, { "docid": "e0670a41c0a04e03bab9066f94481cb8", "score": "0.68714416", "text": "function imgdragstart(){return false;}", "title": "" }, { "docid": "8b0f55a05e5154626a9b0a7bbecff8ac", "score": "0.6862494", "text": "function startDrag(){\r\n\tdragX = event.clientX;\r\n\tdragY = event.clientY;\r\n\tdragging = true;\r\n}", "title": "" }, { "docid": "adb8e0d84f52fa61c4ab098b9c8bd6d4", "score": "0.6857276", "text": "function drag(e) {\n\tif (active) {\n\t\te.preventDefault();\n\n\t\tcurrentX = e.clientX - initialX;\n\t\tcurrentY = e.clientY - initialY;\n\n\t\tif (checkIfBoundsAreCrossed(upperPosBound, lowerPosBound, currentX)) {\n\t\t\tcurrentX = getClosestNumber(currentX, lowerPosBound, upperPosBound);\n\t\t\tsetNewPositions();\n\t\t\tdragEnd(e);\n\t\t} else if (checkIfBoundsAreCrossed(upperPosBound, lowerPosBound, currentY)) {\n\t\t\tcurrentY = getClosestNumber(currentY, lowerPosBound, upperPosBound);\n\t\t\tsetNewPositions();\n\t\t\tdragEnd(e);\n\t\t} else {\n\t\t\tsetNewPositions();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "611abf4b9713531cb9571c8bf1688d15", "score": "0.6850754", "text": "function dragEnd() {\n console.log('drag end');\n }", "title": "" }, { "docid": "c5435004a95a8fbb379f9ba9ed94f2fe", "score": "0.6838384", "text": "attach() {\n this.draggable.on('drag:move', this[onDragMove]).on('drag:stop', this[onDragStop]);\n }", "title": "" }, { "docid": "8d15bb15af359081852ccc04dad355db", "score": "0.6838038", "text": "function startDrag(){\n\tdragOffset.x = doppler_effect_stage.mouseX - detector_container.x;\n\tdetector_container.addEventListener(\"pressmove\", moveDrag); \n}", "title": "" }, { "docid": "37439ecfa4b8cbb1ef49a9e273969bb0", "score": "0.6820544", "text": "onDragStart() {\n this._originalTargetCell = this._currentCell;\n this._dragging = true;\n\n this.root.classList.add('grabbed');\n this.root.classList.remove('grabbable');\n\n // Re-append element so it sorts above other elements while dragging\n SVG.addToRoot(this.root);\n }", "title": "" }, { "docid": "7ef6c2e602c6ab6e433fda9ab05e1c0b", "score": "0.6815573", "text": "onDragStop(pointer) {}", "title": "" }, { "docid": "fe8802fda5d84eaf7710f08ce27b548a", "score": "0.68150264", "text": "function CdkDragEnter() { }", "title": "" }, { "docid": "fe8802fda5d84eaf7710f08ce27b548a", "score": "0.68150264", "text": "function CdkDragEnter() { }", "title": "" }, { "docid": "01483d81ab3e926277612c9614fdaf72", "score": "0.68022317", "text": "function dragStart(event,d){\n // d3.select(this)\n // .style(\"stroke\", \"\") \n//\td3.select(this).raise();\n }", "title": "" }, { "docid": "36ef3654bc42aa36564e71714f0ac8e3", "score": "0.67866427", "text": "function editOnDragStart(editor){editor._internalDrag=!0,editor.setMode(\"drag\");}", "title": "" }, { "docid": "4ccd9a2eb8e5a7af3996ec0a47557ead", "score": "0.67859", "text": "function drag_start(d) {\n if (!d3.event.active)\n simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "b80e93af272966b90099a5e9903135ea", "score": "0.67826617", "text": "function mouseDragged() {\n return false;\n}", "title": "" }, { "docid": "51462d8cabc3d4ea65340dd02322c0b3", "score": "0.67612725", "text": "attach() {\n this.draggable\n .on('drag:start', this[onDragStart])\n .on('drag:move', this[onDragMove])\n .on('drag:stop', this[onDragStop]);\n }", "title": "" }, { "docid": "51462d8cabc3d4ea65340dd02322c0b3", "score": "0.67612725", "text": "attach() {\n this.draggable\n .on('drag:start', this[onDragStart])\n .on('drag:move', this[onDragMove])\n .on('drag:stop', this[onDragStop]);\n }", "title": "" }, { "docid": "d32cab329f9953b71b8ed6935a9d585c", "score": "0.6755192", "text": "function dragstarted() {\n d3.select(this)\n .raise().classed(\"active\", true);\n}", "title": "" }, { "docid": "1e7005a64d602c3fd67ba3da61830d1e", "score": "0.67425346", "text": "function onDrag(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n}", "title": "" }, { "docid": "e764e8136b287fc5dce55885745c4775", "score": "0.6739848", "text": "attach() {\n this.draggable.on('drag:start', this[onDragStart]).on('drag:move', this[onDragMove]).on('drag:stop', this[onDragStop]);\n }", "title": "" }, { "docid": "fc52e0c4d116bb9b8c4b0def25cc88ab", "score": "0.67385167", "text": "dragstart($event, v) {\n this.currentWidget = $event.currentTarget;\n $event.dataTransfer.effectAllowed = 'move';\n this.isDragstart = true;\n this.dragStartWidget = v;\n }", "title": "" }, { "docid": "2179072f393f9e87f89b0dee236905f8", "score": "0.6734178", "text": "function mouseDragged() {\r\n dragging = true;\r\n if (m) m.pan();\r\n}", "title": "" }, { "docid": "f79f86169f835a9c6d871987ecc5ac19", "score": "0.67315817", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3\t).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "3556eace6c34119b9022c6054467163e", "score": "0.67293215", "text": "onDragStart(event) {\n this.originX = event.clientX;\n this.originY = event.clientY;\n this.dragStarted = true;\n event.currentTarget.setPointerCapture(event.pointerId);\n event.currentTarget.style.transition = '' ;\n }", "title": "" }, { "docid": "3e2c05b2e9f6987eb11b969293b9100a", "score": "0.67279077", "text": "function drag (e) {\n\te.stopPropagation();\n\te.preventDefault();\n}", "title": "" }, { "docid": "1fc21a3cdb5f60575bf8da98f5581a78", "score": "0.670227", "text": "_onDragStart(event) {\n let stage = null;\n if (event.which === 3) {\n return;\n }\n stage = this._prepareDragging(event);\n this._drag.time = new Date().getTime();\n this._drag.target = event.target;\n this._drag.stage.start = stage;\n this._drag.stage.current = stage;\n this._drag.pointer = this._pointer(event);\n this.listenerMouseUp = this.renderer.listen(document, 'mouseup', this.bindOnDragEnd);\n this.listenerTouchEnd = this.renderer.listen(document, 'touchend', this.bindOnDragEnd);\n this.zone.runOutsideAngular(() => {\n this.listenerOneMouseMove = this.renderer.listen(document, 'mousemove', this.bindOneMouseTouchMove);\n this.listenerOneTouchMove = this.renderer.listen(document, 'touchmove', this.bindOneMouseTouchMove);\n });\n }", "title": "" }, { "docid": "1fc21a3cdb5f60575bf8da98f5581a78", "score": "0.670227", "text": "_onDragStart(event) {\n let stage = null;\n if (event.which === 3) {\n return;\n }\n stage = this._prepareDragging(event);\n this._drag.time = new Date().getTime();\n this._drag.target = event.target;\n this._drag.stage.start = stage;\n this._drag.stage.current = stage;\n this._drag.pointer = this._pointer(event);\n this.listenerMouseUp = this.renderer.listen(document, 'mouseup', this.bindOnDragEnd);\n this.listenerTouchEnd = this.renderer.listen(document, 'touchend', this.bindOnDragEnd);\n this.zone.runOutsideAngular(() => {\n this.listenerOneMouseMove = this.renderer.listen(document, 'mousemove', this.bindOneMouseTouchMove);\n this.listenerOneTouchMove = this.renderer.listen(document, 'touchmove', this.bindOneMouseTouchMove);\n });\n }", "title": "" }, { "docid": "1ca8685177cc126536dc651d76805787", "score": "0.6697396", "text": "function drag_start(d) {\n node.each(function (d_each) {\n if ( d_each != d) {\n d_each.fx = null\n d_each.fy = null\n }\n })\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "d524f201fcdc3f3904e95e4694aea6b8", "score": "0.6688948", "text": "function onDragged(event, uiWidget, $element){}", "title": "" }, { "docid": "aecb8d3b9a9e1542ad73a33535f58f63", "score": "0.66866076", "text": "enterDragging() {\n this.enter('dragging');\n this._trigger('drag');\n }", "title": "" }, { "docid": "aecb8d3b9a9e1542ad73a33535f58f63", "score": "0.66866076", "text": "enterDragging() {\n this.enter('dragging');\n this._trigger('drag');\n }", "title": "" }, { "docid": "2779479e725025f5cbaa03ec0b9b792b", "score": "0.6680021", "text": "function startDragging(d) {\n d3.select(this).raise().classed('active', true);\n }", "title": "" }, { "docid": "a7c2dd5192f4857a923a135857c26c5a", "score": "0.6678567", "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": "fd59f03104b4dfef2e7abac50b984594", "score": "0.66719955", "text": "function beforeDrag(treeId, treeNodes) {\n\t// return false;\n}", "title": "" }, { "docid": "ee881d543c5ba792da6e65b8c2c52886", "score": "0.6668356", "text": "function dragStart(e) {\n $(\".main-cont\").resizable({\n containment: \".main\",\n });\n $(\".main-cont\").draggable({\n containment: \".main\",\n });\n}", "title": "" }, { "docid": "0132a5241262cc6444b29c16b2de744d", "score": "0.6663916", "text": "function drag(ev) {\n\t\t\t\n\t\t\tconsole.log(\"Start-\"+ev.target.id);\n\t\t\t\n\t\t\tif( ev.target.id == \"drag2\"){\n\t\t\t\tev.dataTransfer.setData(\"O\", ev.target.id);\n\t\t\t\tdocument.getElementById('drag1').draggable = false;\n\n\t\t\t}else{\n\t\t\t ev.dataTransfer.setData(\"X\", ev.target.id);\n\t\t\t\tdocument.getElementById('drag2').draggable= false;\n\t\t\t\t}\n}", "title": "" }, { "docid": "8efeb47bea7cbded6f95eecebc9924c3", "score": "0.664752", "text": "function dragstarted(d) {\n is_dragging = true;\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "eb319357946f1ab2225d0031c9f934f3", "score": "0.6637082", "text": "function dragstarted(d) {\r\n\t\tif (!d3.event.active) simulation.alphaTarget(0.3).restart();\r\n\t\td.fx = d.x; d.fy = d.y;\r\n\t}", "title": "" }, { "docid": "39a72cad20af43b967cc4045a5a5c73a", "score": "0.6630545", "text": "function dragStart(event) {\n dragItem = event.target;\n}", "title": "" }, { "docid": "d65e35d8bab50fbdbaecdfeb2d8e4c47", "score": "0.6623448", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(.15).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "1094884c5a9a0d5486e150f61a96cc74", "score": "0.6622747", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(.03).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "d481be7f01003425fa13119dcc7021ad", "score": "0.66182816", "text": "function Draggable(){this.on('mousedown',this._dragStart,this);this.on('mousemove',this._drag,this);this.on('mouseup',this._dragEnd,this);this.on('globalout',this._dragEnd,this);// this._dropTarget = null;\n// this._draggingTarget = null;\n// this._x = 0;\n// this._y = 0;\n}", "title": "" }, { "docid": "81e1b995255c2313452ea113f70e9916", "score": "0.6616809", "text": "function dragstarted(d) {\n d3.event.sourceEvent.stopPropagation();\n if (!d3.event.active) graphLayout.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "39d800c1b2224b3e41a4f8bd0409160f", "score": "0.6613873", "text": "function dragstart_handler(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n ev.effectAllowed = \"move\";\n}", "title": "" }, { "docid": "0c101fed5e58fe1f966b57fdd67d7d80", "score": "0.661013", "text": "function totalDragstarted(d) {\n d3.select(this).raise().classed(\"active\", true);\n $(\".stand-graph\").css(\"cursor\", \"pointer\");\n }", "title": "" }, { "docid": "e7ce52c6d54a5500f06db23c4e7d6b63", "score": "0.6609686", "text": "function dragStart(event) {\n\t\tconsole.log('dragging',(this.id))\n\t\tevent.dataTransfer.setData(\"text/plain\", this.id);\n\t}", "title": "" }, { "docid": "846edc46b81771188673ebddcab38855", "score": "0.6598942", "text": "function BXDD_DragStart()\n{\n\tif (GLOBAL_bDisableDD)\n\t\treturn false;\n\n\tthis.BXOldPlacement = this.parentNode;\n\tvar id = this.id.substring(12);\n\trowMouseOut(viewArea('title_' + id));\n\trowMouseOut(viewArea('author_' + id));\n\trowMouseOut(viewArea('duration_' + id));\n\trowMouseOut(viewArea('location_' + id));\n\trowMouseOut(viewArea('image_' + id));\n\tGLOBAL_bDisableActions = true;\n\treturn true;\n}", "title": "" }, { "docid": "0bef84a8666014654bb5978c008a8eed", "score": "0.6596667", "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": "dcb4f8a47e87382a210f669e84dadf39", "score": "0.6588271", "text": "function editOnDragStart() {\n\t this._internalDrag = true;\n\t this.setMode('drag');\n\t}", "title": "" }, { "docid": "dcb4f8a47e87382a210f669e84dadf39", "score": "0.6588271", "text": "function editOnDragStart() {\n\t this._internalDrag = true;\n\t this.setMode('drag');\n\t}", "title": "" }, { "docid": "47493f05252a6032b3c0b9dea06a1bce", "score": "0.65870833", "text": "function dragStart(e) {\n if (e.target !== e.currentTarget) {\n active = true;\n // shape being dragged\n activeShape = e.target;\n\n if (activeShape !== null) {\n if (!activeShape.xOffset) {\n activeShape.xOffset = 0;\n }\n\n if (!activeShape.yOffset) {\n activeShape.yOffset = 0;\n }\n\n if (e.type === \"mousedown\") {\n console.log(\"Node dragging has begun!\");\n activeShape.initialX = e.clientX - activeShape.xOffset;\n\n activeShape.initialY = e.clientY - activeShape.yOffset;\n }\n }\n }\n}", "title": "" }, { "docid": "6da2ca100713ac3df898e6fb5b93c709", "score": "0.6585558", "text": "function dragstart_handler(ev) {\n // Add the target element's id to the data transfer object\n ev.dataTransfer.setData(\"text/plain\", ev.target.id);\n ev.dropEffect = \"move\";\n}", "title": "" }, { "docid": "3e5c05407efaade724c6a873f8810763", "score": "0.65850776", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(.03).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "5f9927a899b915e6128912d1987ae568", "score": "0.65705913", "text": "function DragAndDrop(){\n\tDraggable();\n\tDroppable();\n}", "title": "" }, { "docid": "7fc1c5a757540067e1fcff1b73904ca8", "score": "0.656725", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.1).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "42fd0f680f0a90552821c894b46b2431", "score": "0.656593", "text": "function addingEvent() {\n draggables.forEach((draggable) => {\n draggable.addEventListener(\"dragstart\", () => {\n draggable.classList.add(\"dragging\");\n currentdragging = \"notContentCreator\";\n });\n draggable.addEventListener(\"dragend\", () => {\n draggable.classList.remove(\"dragging\");\n });\n });\n}", "title": "" }, { "docid": "cd32bb5519d1f63afa6f8d2d83cb7f3a", "score": "0.6547664", "text": "function startDragging(e) {\n\tmousePos = getMousePos(e);\n\t//check first object under mouse\n\tfor (i=0;i<COLLIDABLE_OBJECTS.length;i++) {\n\t\tvar currentObj = COLLIDABLE_OBJECTS[i];\n\t\tif (\t\tmousePos.x>currentObj.x && \n\t\t\t\t\tmousePos.x<currentObj.x+currentObj.width &&\n\t\t\t\t\tmousePos.y>currentObj.y &&\n\t\t\t\t\tmousePos.y<currentObj.y+currentObj.height){\n\t\t\tDRAGGED_OBJECT = currentObj;\n\t\t\tcontinue;\n\t\t}\n\t}\n\t//if we find an object, save its color and set it as dragged\n\tif (DRAGGED_OBJECT!=null){\n\t\tDRAGGED_OBJECT_COLOR = DRAGGED_OBJECT.color;\n\t\tDRAGGED_OBJECT.color=\"#ffffff\";\n\t\tgameState = STATE_DRAGGING;\n\t\t$(\"#canvas\").mousemove(function(event) {\n\t\t\tmousePos = getMousePos(event);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "f7793c96594e8ff17b8e17c0855c34ac", "score": "0.65435016", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.5).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "title": "" }, { "docid": "282bf32136a094b940d62538f6792016", "score": "0.6543399", "text": "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "title": "" }, { "docid": "3bb1968b9f7d358e9d57d8d3c861970e", "score": "0.65379137", "text": "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();//alpha will go up to 0.3, keeping the graph active!!\n d.fx = d.x;//a node with a defined node.fx has node.x reset to this value and node.vx set to zero\n d.fy = d.y;\n}", "title": "" }, { "docid": "8d29cec1620c4a39ab5f1d44946c73d3", "score": "0.6537173", "text": "function dragLeave() {\n //console.log('dragleave');\n}", "title": "" }, { "docid": "6cd70e944a141b92f9eaa31edb4ff89f", "score": "0.65355", "text": "function dragstart(e) {\n marker.dragging.disable();\n}", "title": "" }, { "docid": "bc55a9a38e8ef26f48bfe5040dcc699c", "score": "0.6534846", "text": "_dragstart(e){\n if(e.target.className === \"draggable\") {\n e.target.scrollIntoView(false);\n e.dataTransfer.setData(WYSIWYG_DRAG_DATA, e.target.getElementsByTagName(\"span\")[0].innerHTML);\n e.dataTransfer.setDragImage(e.target, 0, 0);\n }\n }", "title": "" }, { "docid": "6c8b305c8c3836a1ec2cbb2df55bf96f", "score": "0.6526465", "text": "function dragOver(e) {\ne.preventDefault();\n}", "title": "" }, { "docid": "de2d6741a160c9de3341dfc9be7892a0", "score": "0.6526125", "text": "static dragMove() {\n return d3.behavior.drag()\n .origin(d => d)\n .on('dragstart', D3EventHandlers.startImageMove)\n .on('drag', D3EventHandlers.moveImageGhost)\n .on('dragend', D3EventHandlers.fixImagePosition);\n }", "title": "" }, { "docid": "07594c9c44130f58ab341a55af5ca63b", "score": "0.65253776", "text": "start() {\n this._draggingStarted();\n this._notifyReceivingSiblings();\n }", "title": "" }, { "docid": "8de8f498d441997f1f72101531a4b740", "score": "0.65237147", "text": "_onDragMove(event) {\n let stage;\n const stageOrExit = this.carouselService.defineNewCoordsDrag(event, this._drag);\n if (stageOrExit === false) {\n return;\n }\n stage = stageOrExit;\n event.preventDefault();\n this._drag.stage.current = stage;\n this._animate(stage.x - this._drag.stage.start.x);\n }", "title": "" }, { "docid": "8de8f498d441997f1f72101531a4b740", "score": "0.65237147", "text": "_onDragMove(event) {\n let stage;\n const stageOrExit = this.carouselService.defineNewCoordsDrag(event, this._drag);\n if (stageOrExit === false) {\n return;\n }\n stage = stageOrExit;\n event.preventDefault();\n this._drag.stage.current = stage;\n this._animate(stage.x - this._drag.stage.start.x);\n }", "title": "" }, { "docid": "a1e3cbc036b593322a957b818799a3e3", "score": "0.65230477", "text": "function dragOver(e){\n e.preventDefault();\n}", "title": "" }, { "docid": "a2f8371fc5f0020e9ecca1a367ee8bb4", "score": "0.65226024", "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": "a2f8371fc5f0020e9ecca1a367ee8bb4", "score": "0.65226024", "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": "4173712ebab097f0b59c9451eecb6a08", "score": "0.6508716", "text": "function dragenter(e) { e.preventDefault(); }", "title": "" }, { "docid": "57344f3784aa7825c62aa11d355d8a96", "score": "0.6501656", "text": "function drag() {\n var newStageX = self.mouseX - startX + oldStageX;\n var newStageY = self.mouseY - startY + oldStageY;\n\n if (newStageX != self.stageX || newStageY != self.stageY) {\n lastStageX2 = lastStageX;\n lastStageY2 = lastStageY;\n\n lastStageX = newStageX;\n lastStageY = newStageY;\n\n self.stageX = newStageX;\n self.stageY = newStageY;\n self.dispatch('drag');\n }\n }", "title": "" } ]
ef69c87dd39b39ec7af3b3eda97e1fed
Mix properties into target object.
[ { "docid": "85c81b4daab859373d6cf221c0d59ff7", "score": "0.0", "text": "function extend (to, _from) {\n for (var key in _from) {\n to[key] = _from[key];\n }\n return to\n}", "title": "" } ]
[ { "docid": "bf949b028f5191f5a72928f1b460302c", "score": "0.73263377", "text": "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "title": "" }, { "docid": "a11929e40181c809ca4210aa39beb17d", "score": "0.7214008", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "a11929e40181c809ca4210aa39beb17d", "score": "0.7214008", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "58cdfe15815f7f5a8af54746648c997a", "score": "0.71767485", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "title": "" }, { "docid": "273672c02d4426db2fa0ac4c0a782500", "score": "0.7018322", "text": "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.7012555", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.7012555", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "23d18414a78b318bc3ff881d52c27558", "score": "0.7012555", "text": "function fillProperties(target, source) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}", "title": "" }, { "docid": "4d2e121a1c35c9675f690fba253afb60", "score": "0.6955972", "text": "function mixin(target) {\n [].slice.call(arguments, 1).forEach(function (o) {\n Object.getOwnPropertyNames(o).forEach(function(attr) {\n var getter = Object.getOwnPropertyDescriptor(o, attr).get,\n setter = Object.getOwnPropertyDescriptor(o, attr).set;\n\n if (!getter && !setter) {\n target[attr] = o[attr];\n }\n else {\n Object.defineProperty(target, attr, {\n get: getter,\n set: setter\n });\n }\n });\n });\n\n return target;\n}", "title": "" }, { "docid": "5fda5f13b390ebf6865ba45828d7f015", "score": "0.68557614", "text": "function mixin(sourceObj, targetObj) {\r\n for (var key in sourceObj) {\r\n targetObj[key] = sourceObj[key];\r\n }\r\n\r\n return targetObj;\r\n}", "title": "" }, { "docid": "344a8465f30fda7e3faf77b783efe4a8", "score": "0.6805832", "text": "function mixin(target, source) {\n for (var key in source) {\n target[key] = source[key]\n }\n return target\n}", "title": "" }, { "docid": "4cac10c139fd5fefdd3d0c471a4556d9", "score": "0.6801735", "text": "function mixin(target /* ...sources */) {\n var from;\n var to = target;\n var index = 0;\n var total = arguments.length;\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n while (++index < total) {\n from = arguments[index];\n\n if (from !== null) {\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n }\n }\n\n return to;\n }", "title": "" }, { "docid": "035367aa6b4cf232b14461569e1707bb", "score": "0.6783546", "text": "function mixin(target, source){\n\tfor(var k in source){\n\t\ttarget[k] = source[k];\n\t}\n}", "title": "" }, { "docid": "df1df7c56a76a6c64ca62cb30f82de64", "score": "0.67794776", "text": "function mixin(destination, source) {\n if(Object.getOwnPropertyDescriptor) {\n Object.keys(source).forEach(function (property) {\n var descriptor = Object.getOwnPropertyDescriptor(source, property);\n Object.defineProperty(destination, property, descriptor);\n });\n } else {\n for(var property in source) {\n if(source.hasOwnProperty(property)) {\n destination[property] = source[property];\n }\n }\n }\n}", "title": "" }, { "docid": "d986d379876558da77de113a43ce4a2b", "score": "0.6658871", "text": "function _mergeProperties(target, source) {\n for(var property in source) {\n if(source.hasOwnProperty(property)) {\n if(source[property] instanceof Array) {\n target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n } else if(\n source[property] !== null &&\n typeof source[property] === \"object\" &&\n source[property].constructor === Object\n ) {\n target[property] = _mergeProperties(target[property] || {}, source[property]);\n } else {\n target[property] = source[property];\n }\n }\n }\n\n return target;\n}", "title": "" }, { "docid": "f95e2f93771ae0753fcdcba0b33bf3be", "score": "0.66572934", "text": "function _mergeProperties(target, source) {\n for (var property in source) {\n if (source.hasOwnProperty(property)) {\n if (source[property] instanceof Array) {\n target[property] = source[property].concat(\n target[property] instanceof Array ? target[property] : []\n )\n } else if (\n source[property] !== null &&\n typeof source[property] === 'object' &&\n source[property].constructor === Object\n ) {\n target[property] = _mergeProperties(target[property] || {}, source[property])\n } else {\n target[property] = source[property]\n }\n }\n }\n\n return target\n}", "title": "" }, { "docid": "9160eab32cfa8bfac63c9cdfadf53c26", "score": "0.6645683", "text": "function copyProperties(source, target) {\n _Object__WEBPACK_IMPORTED_MODULE_6__[/* each */ \"d\"](source, function (key, value) {\n // only if value is set\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[/* hasValue */ \"d\"](value)) {\n target[key] = value;\n }\n });\n return target;\n}", "title": "" }, { "docid": "767a02fb328579570b32fb0e7d702378", "score": "0.6643871", "text": "function _mergeProperties(target, source) {\n for (var property in source) {\n if (Object.prototype.hasOwnProperty.call(source, property)) {\n if (source[property] instanceof Array) {\n target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n } else if (\n source[property] !== null &&\n typeof source[property] === 'object' &&\n source[property].constructor === Object\n ) {\n target[property] = _mergeProperties(target[property] || {}, source[property]);\n } else {\n target[property] = source[property];\n }\n }\n }\n\n return target;\n}", "title": "" }, { "docid": "cf294188e16e4ca05fae7fffbabd6a3e", "score": "0.66395265", "text": "function extend(target, source) {\n for (var prop in source) {\n if (has(source, prop)) {\n target[prop] = source[prop];\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "cf294188e16e4ca05fae7fffbabd6a3e", "score": "0.66395265", "text": "function extend(target, source) {\n for (var prop in source) {\n if (has(source, prop)) {\n target[prop] = source[prop];\n }\n }\n\n return target;\n }", "title": "" }, { "docid": "5c74c76a76f576eaf52c8d56a891c679", "score": "0.66274345", "text": "function extend(target) {\n var sources = [].slice.call(arguments, 1);\n sources.forEach(function (source) {\n for (var prop in source) {\n if (!target.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n }\n }\n });\n return target;\n}", "title": "" }, { "docid": "59457dc23edb1ca030ac7da1f186ef85", "score": "0.65964943", "text": "function mixin(sourceObj, targetObj) {\r\n for (var key in sourceObj) {\r\n // only copy if not already present\r\n if (!(key in targetObj)) {\r\n targetObj[key] = sourceObj[key];\r\n }\r\n }\r\n\r\n return targetObj;\r\n}", "title": "" }, { "docid": "59457dc23edb1ca030ac7da1f186ef85", "score": "0.65964943", "text": "function mixin(sourceObj, targetObj) {\r\n for (var key in sourceObj) {\r\n // only copy if not already present\r\n if (!(key in targetObj)) {\r\n targetObj[key] = sourceObj[key];\r\n }\r\n }\r\n\r\n return targetObj;\r\n}", "title": "" }, { "docid": "b3f2b4ed27dbd2e6f81ed7260fcdb369", "score": "0.6537701", "text": "function extendRemove(target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] == null) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "b3f2b4ed27dbd2e6f81ed7260fcdb369", "score": "0.6537701", "text": "function extendRemove(target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] == null) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "b3f2b4ed27dbd2e6f81ed7260fcdb369", "score": "0.6537701", "text": "function extendRemove(target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] == null) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.65269744", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.65269744", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "af2701450d394f8af8e342cb7bd5538e", "score": "0.65269744", "text": "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "title": "" }, { "docid": "4fb847a81750a2d422a5d79ffdf35169", "score": "0.65206707", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] == null) {\n target[name] = props[name];\n }\n }\n return target;\n }", "title": "" }, { "docid": "d5286df34c32b162a1acec150823a11c", "score": "0.65165204", "text": "function copyOwnProperties(source, target) {\n var ignorePropertyNames = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];\n\n Object.getOwnPropertyNames(source).forEach(function (name) {\n if (ignorePropertyNames.indexOf(name) < 0) {\n var descriptor = Object.getOwnPropertyDescriptor(source, name);\n Object.defineProperty(target, name, descriptor);\n }\n });\n return target;\n}", "title": "" }, { "docid": "331147b8aeb0b1621317601e7a5e3363", "score": "0.65157974", "text": "function mixin(target, ... sources) {// '...' rest operator\n Object.assign(target, ...sources); // '...' spread operator\n}", "title": "" }, { "docid": "3c4311bf61bc1072460d7f146601ac16", "score": "0.650968", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] == null) {\n target[name] = props[name];\n }\n }\n return target;\n }", "title": "" }, { "docid": "099f2995cc6cdbf6d782491f4810f79a", "score": "0.6507042", "text": "function Extend(target, source){ \r\n if (typeof source === 'object') {\r\n var property;\r\n for(property in source) {\r\n if (source.hasOwnProperty(property)) {\r\n if (source[property] != null) {\r\n if (/Object/.test(source[property].constructor)) {\r\n if (property in target) void(0);\r\n else target[property] = {};\r\n Extend(target[property], source[property]); \r\n }\r\n else try { \r\n target[property] = source[property];\r\n } catch (exception) { ; }\r\n }\r\n }\r\n }\r\n }\r\n return target;\r\n}", "title": "" }, { "docid": "12651a8868019ce78208baf24d3918fc", "score": "0.6475192", "text": "function copyOwnProperties(source, target, ignorePropertyNames = []) {\n Object.getOwnPropertyNames(source).forEach(name => {\n if (ignorePropertyNames.indexOf(name) < 0) {\n let descriptor = Object.getOwnPropertyDescriptor(source, name);\n Object.defineProperty(target, name, descriptor);\n }\n });\n return target;\n}", "title": "" }, { "docid": "25fa63d1e877d75453d350433b555009", "score": "0.64696306", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] === null || props[name] === undefined) {\n target[name] = props[name];\n }\n }\n return target;\n }", "title": "" }, { "docid": "25fa63d1e877d75453d350433b555009", "score": "0.64696306", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props) {\n if (props[name] === null || props[name] === undefined) {\n target[name] = props[name];\n }\n }\n return target;\n }", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "e3c61bc9ff95b2dd8117e90dfdb716c5", "score": "0.6452717", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = props[name];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "a9a17230d0b62f32f9bf638a8bccb8a0", "score": "0.64442694", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n if (props[name] == null || props[name] == undefined)\n target[name] = props[name];\n return target;\n }", "title": "" }, { "docid": "a9a17230d0b62f32f9bf638a8bccb8a0", "score": "0.64442694", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n if (props[name] == null || props[name] == undefined)\n target[name] = props[name];\n return target;\n }", "title": "" }, { "docid": "57cddd15cd8a75ec98c1b0a8cd6bd5b2", "score": "0.6437641", "text": "function extend(target) {\n\tfor (var i = 1; i < arguments.length; i++) {\n\t\tfor (property in arguments[i]) {\n\t\t\ttarget[property] = arguments[i][property]\n\t\t}\n\t}\n\treturn target;\n}", "title": "" }, { "docid": "62231a9ce7eb8e44ec8171beb4d6d618", "score": "0.64074755", "text": "function extend(target) {\n for (var i = 1; i < arguments.length; i++) {\n target = _mergeProperties(target, arguments[i]);\n }\n\n return target;\n}", "title": "" }, { "docid": "3cfef3690e545936e502ce59326e2a30", "score": "0.6404928", "text": "function mixin(destination,source,overwrite){if(overwrite===void 0){overwrite=true;}if(!types_1.isObject(destination)){return source;}if(types_1.isObject(source)){Object.keys(source).forEach(function(key){if(key in destination){if(overwrite){if(types_1.isObject(destination[key])&&types_1.isObject(source[key])){mixin(destination[key],source[key],overwrite);}else{destination[key]=source[key];}}}else{destination[key]=source[key];}});}return destination;}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "8a761f00555c355ec6ce063e670aaa84", "score": "0.63962936", "text": "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props)\n\t\tif (props[name] == null || props[name] == undefined)\n\t\t\ttarget[name] = props[name];\n\treturn target;\n}", "title": "" }, { "docid": "aa7d2ee585640b6f03112eff8e0c06f4", "score": "0.6395999", "text": "function extend(target) {\n for(var i = 1; i < arguments.length; i++) {\n target = _mergeProperties(target, arguments[i]);\n }\n\n return target;\n}", "title": "" }, { "docid": "3c985f8cf4b6eb3331eae4a9ea9e3d26", "score": "0.6394188", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1c268494e386a5609805dea9a7476c1d", "score": "0.63904846", "text": "function mixin(obj, props) {\n obj = obj || {};\n try {\n Object.getOwnPropertyNames(props).forEach(function(n) {\n var pd = Object.getOwnPropertyDescriptor(props, n);\n if (pd) {\n Object.defineProperty(obj, n, pd);\n }\n });\n } catch(x) {\n }\n return obj;\n}", "title": "" }, { "docid": "812d488ed60334636fea1faae87cd198", "score": "0.63887954", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n if (props[name] == null || props[name] == undefined)\n target[name] = props[name];\n return target;\n}", "title": "" }, { "docid": "bc88655552dc6b6e8b64bf4552a48a3f", "score": "0.63885355", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n if (props[name] == null || props[name] == undefined) target[name] = props[name];\n return target;\n }", "title": "" }, { "docid": "cd41c6d7ba5e65d9755965894fa9abb1", "score": "0.6388222", "text": "function copyProperties(target) {\n var sources = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n sources[_i - 1] = arguments[_i];\n }\n sources.forEach(function (source) {\n Object.defineProperties(target, Object.getOwnPropertyNames(source).reduce(function (descriptors, key) {\n descriptors[key] = Object.getOwnPropertyDescriptor(source, key);\n return descriptors;\n }, {}));\n });\n return target;\n }", "title": "" }, { "docid": "a4c2cc609c177603c78bbb8700ce8e7b", "score": "0.6387217", "text": "function attachProps(context, target) {\n\t if (isObject(target)) {\n\t var keys = inheritedKeys(target);\n\t for (var i = 0, l = keys.length; i < l; ++i) {\n\t context[keys[i]] = clone(target[keys[i]]);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "b675ed585915d79cdd8bf5350cccc18c", "score": "0.63837475", "text": "function extendRemove(target, props) {\n $.extend(target, props);\n for (var name in props)\n \tif (props[name] == null || props[name] == undefined)\n \t\ttarget[name] = props[name];\n return target;\n }", "title": "" }, { "docid": "4a03350a36e2b15fa2e6efe1dc6347c6", "score": "0.6381596", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "b674b98a5af995736c8c22ec8ad51f1c", "score": "0.6377473", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "b674b98a5af995736c8c22ec8ad51f1c", "score": "0.6377473", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1354378a03a55f8b7fa0340e85855cea", "score": "0.63755906", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "title": "" }, { "docid": "1b00d5744673598ae6b126e9a8d4594d", "score": "0.6374043", "text": "function extend(target) {\n for (var i = 1; i < arguments.length; i++) {\n target = _mergeProperties(target, arguments[i])\n }\n\n return target\n}", "title": "" }, { "docid": "ec1699141ae0fefb3c70a624d9b483b6", "score": "0.63704437", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n }", "title": "" }, { "docid": "4dc5a8de700ae86bdfa80e2b2d9e12b6", "score": "0.63664556", "text": "function copyProps (src, dst) {\r\n for (var key in src) {\r\n dst[key] = src[key]\r\n }\r\n }", "title": "" }, { "docid": "4dc5a8de700ae86bdfa80e2b2d9e12b6", "score": "0.63664556", "text": "function copyProps (src, dst) {\r\n for (var key in src) {\r\n dst[key] = src[key]\r\n }\r\n }", "title": "" }, { "docid": "d3aa9fcc813bc0c209e1f292a4800a67", "score": "0.6353417", "text": "function mixin(targetObj, ...sources) { // rest operator, collect tất cả các param từ 2 trở đi, thành 1 array\n Object.assign(targetObj, ...sources); // spread operator, lấy nội dung bên trong array ra.\n}", "title": "" }, { "docid": "24e16ad7d3a0588c82ee1d7be58bdde1", "score": "0.63527316", "text": "function mixin(inObj/*, inProps, inMoreProps, ...*/) {\n var obj = inObj || {};\n for (var i = 1; i < arguments.length; i++) {\n var p = arguments[i];\n try {\n for (var n in p) {\n copyProperty(n, p, obj);\n }\n } catch(x) {\n }\n }\n return obj;\n }", "title": "" }, { "docid": "715dc61ba05777cd69e444f86422067b", "score": "0.63212717", "text": "function attachProps(context, target) {\n if (isObject(target)) {\n var keys = inheritedKeys(target);\n for (var i = 0, l = keys.length; i < l; ++i) {\n context[keys[i]] = clone(target[keys[i]]);\n }\n }\n}", "title": "" }, { "docid": "1a5103bd983512f5d447bce66411b541", "score": "0.6314243", "text": "function _extend(source, properties) {\n var property;\n for (property in properties) {\n if (properties.hasOwnProperty(property)) {\n source[property] = properties[property];\n }\n }\n return source;\n }", "title": "" }, { "docid": "d3bd3f5c2b2837e051dc4af17872b3a2", "score": "0.6308295", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "d3bd3f5c2b2837e051dc4af17872b3a2", "score": "0.6308295", "text": "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" }, { "docid": "6b33ca73a685f0dba977347820f17dbb", "score": "0.6292743", "text": "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "title": "" } ]
edeee50ebc19788258bfd70153c9181c
called by timeout once timeout is over
[ { "docid": "09890c02d86f35b6749ba741492c1754", "score": "0.0", "text": "function poller() {\n\tvar httpRequest = new XMLHttpRequest(); //makes new request\n\n\tif (!httpRequest) { //check to make sure it was created correctly\n\t\talert('Giving up :( Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\tvar chatRoomName = document.getElementById(\"chatName\").value\n\tconsole.log(chatRoomName);\n\tchatRoomName = chatRoomName.trim() \n\thttpRequest.onreadystatechange = function() { handlePoll(httpRequest) };\n\thttpRequest.open(\"GET\", \"/messages/\"+chatRoomName.trim());\n\thttpRequest.send();\n}", "title": "" } ]
[ { "docid": "3b0a09591eb31d91cce161f295489f4b", "score": "0.7001001", "text": "function onTimeout() {\n pending = new Set();\n maybeFinish();\n }", "title": "" }, { "docid": "31cb0ad6d55a9af1745dd85406a7cd3c", "score": "0.6819618", "text": "function timeoutCallback() {\n afterRAF ? requestAnimFrame(invokeCallback) : invokeCallback();\n }", "title": "" }, { "docid": "564d095efbdee3c4ee0794d36c70dbce", "score": "0.6690275", "text": "function onTimeout() {\n $scope.unlockTimeRemaining--;\n $scope.prettyUnlockTime = '2-step verification unlocked for ' + getPrettyTime($scope.unlockTimeRemaining);\n if ($scope.unlockTimeRemaining === 0) {\n $scope.prettyUnlockTime = '2-step verification unlocked';\n $timeout.cancel(timeOut);\n $scope.userUnlocked = false;\n return;\n }\n timeOut = $timeout(onTimeout, 1000);\n }", "title": "" }, { "docid": "e2e39402db795571aa67791a704d1b7e", "score": "0.66704327", "text": "_setTimeout () {\n if (this.timeout != null) {\n clearTimeout(this.timeout)\n }\n this.timeout = setTimeout(() => {\n if (this.p1 != null) {\n this.emit(\n 'error', new Error(`no data received in ${this._options.timeout}s`)\n )\n this.p1.close()\n }\n }, this._options.timeout * 1000)\n }", "title": "" }, { "docid": "62b3e3284e244ff1d30104820dffb38f", "score": "0.6668083", "text": "messageTimeout () {\n\t\tthis.messageCallback();\n\t}", "title": "" }, { "docid": "22e2a7b4884406fe0af49304e1c5330f", "score": "0.6659067", "text": "function handleTimeout()\n {\n locked = false;\n }", "title": "" }, { "docid": "4f8543ca1cd468b43fc802474ed6e239", "score": "0.6658567", "text": "function onInteractionTimeOuted() {\n $timeout(onInteraction);\n }", "title": "" }, { "docid": "f5b77be9314a3d3c8e9ff29a0c3f56dd", "score": "0.6650039", "text": "function settle (timeout, done) {\n setTimeout(done, timeout);\n }", "title": "" }, { "docid": "d994fc1d73515790fd5aa11c2863bc57", "score": "0.65800166", "text": "function registerTimeout() {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(function () { work(cm); }, 250);\n }", "title": "" }, { "docid": "92f62b4b0dc7a020df06f68e39f99e76", "score": "0.64285165", "text": "function clearExistingTimeout() {\n\t if (timeoutID) {\n\t clearTimeout(timeoutID);\n\t }\n\t } // Function to cancel next exec", "title": "" }, { "docid": "92f62b4b0dc7a020df06f68e39f99e76", "score": "0.64285165", "text": "function clearExistingTimeout() {\n\t if (timeoutID) {\n\t clearTimeout(timeoutID);\n\t }\n\t } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.64138436", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.64138436", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.64138436", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.64138436", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "f91134e28a7c8e69165f9fa4ae88bfcf", "score": "0.64138436", "text": "function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec", "title": "" }, { "docid": "abcd2c28288d1acb1cc8ad8fe6925164", "score": "0.63994175", "text": "function FakeTimeout() {}", "title": "" }, { "docid": "89db51d24f67eb5945f4e8cfff89f41b", "score": "0.6317969", "text": "function actually_setTimeout() {\n data.id = setTimeout( function(){ data.fn(); }, delay );\n }", "title": "" }, { "docid": "2d9b2dab9e5859a2f4b69bb9c55f5db9", "score": "0.6316192", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "b0187a3571bfeb093dc6f8f0f27c5d9b", "score": "0.6313372", "text": "function clear() {\n\t timeoutID = undefined;\n\t }", "title": "" }, { "docid": "b0187a3571bfeb093dc6f8f0f27c5d9b", "score": "0.6313372", "text": "function clear() {\n\t timeoutID = undefined;\n\t }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.6303686", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "7444306c6418101e1ab3acb9408cac68", "score": "0.6303686", "text": "function clear() {\n timeout_id = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.62740064", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.62740064", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.62740064", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.62740064", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "81fe56910526ce27c02e9faf6ffb89e6", "score": "0.62740064", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "3ef5d3d6833843a8aa3638b801d41947", "score": "0.62729514", "text": "timeout() {\n if (this.timeoutQueue.isEmpty() ) {\n return;\n }\n \n this._intervalID = setInterval( () => {\n while (this.timeoutQueue.first() && Date.now() > this.timeoutQueue.first().timeout) {\n const { id } = this.timeoutQueue.shift();\n this.emit('timeout', id);\n }\n }, 100);\n }", "title": "" }, { "docid": "97ff65940ba36e8d90d85bbe9905833d", "score": "0.6269316", "text": "function clear() {\n\t\t\t\ttimeoutID = undefined;\n\t\t\t}", "title": "" }, { "docid": "5a4c0a3d1f037dac99ec9aaaef23866b", "score": "0.6261", "text": "_handleTimeout() {\n\n let timedOut = (this.startTime + this.config.timeout) < Date.now();\n\n if(this.votes.length !== this.amountOfClients && this.isCoordinator) {\n if(timedOut) {\n\n let abort =\n Action.rollback +\",\"+\n this.clientId;\n\n this.websocket.send(abort)\n }\n }\n }", "title": "" }, { "docid": "4e6becdec600bcf7d97a4b375c87d9cd", "score": "0.6258444", "text": "if (!this.pollTimeoutId) {\n return\n }", "title": "" }, { "docid": "4e6becdec600bcf7d97a4b375c87d9cd", "score": "0.6258444", "text": "if (!this.pollTimeoutId) {\n return\n }", "title": "" }, { "docid": "078b7befbd068cddcfd824d33944ede3", "score": "0.6206168", "text": "function delayed() {\n // if we're executing at the end of the detection period\n if (!execAsap)\n func.apply(obj, args); // execute now\n // clear timeout handle\n timeout = null;\n }", "title": "" }, { "docid": "0ec2791718f9c7400527cd8882fbf033", "score": "0.62043244", "text": "function clear() {\n timeoutID = undefined;\n }", "title": "" }, { "docid": "f22906da794a25128e92f169422dfb17", "score": "0.62027836", "text": "function onTimeout() {\n finish(new Error(\"Connection Timed Out\"), socket, null, callback);\n }", "title": "" }, { "docid": "1297d598c514d3f9cb118ecd5ede6bc4", "score": "0.61931396", "text": "_setTimer() {\n\t\tlet time = this._queue.peek()[0]\n\t\tthis._timer = setTimeout(this._perform.bind(this, time), time - Date.now())\n\t}", "title": "" }, { "docid": "2fac34ed59662943e7eb5f465ba2650b", "score": "0.61783016", "text": "function clear() {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "4aa551a20d29d4905bc7ec2f05558215", "score": "0.61748415", "text": "function clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}", "title": "" }, { "docid": "c25cf30259ad2d269c26ffbcf50dbca3", "score": "0.6174268", "text": "function popcornTimeoutWrapper( e ) {\n _interruptLoad = true;\n _onTimeout( e );\n }", "title": "" }, { "docid": "ec90381fff38fec262ebb2ab50c10034", "score": "0.6173378", "text": "function readPositionTimeout() {\n if (_active)\n $timeout( function(){ readPosition(hposition, herror); }, 1000, false);\n }", "title": "" }, { "docid": "f3d162ba869923d352465b18cbf7e2dc", "score": "0.61525977", "text": "onHold() {\n }", "title": "" }, { "docid": "285cad85f4374a2a0805801a76295a28", "score": "0.61496115", "text": "function timeoutCallback() {\n // we'll use this as the handler for our non-Promise Timeouts\n alert('timeout reached');\n}", "title": "" }, { "docid": "d5e4f47bffd16aba126cc7e0765add2b", "score": "0.61488867", "text": "constructor(timeout_in_secs){\n this.initial_timeout_in_secs = timeout_in_secs\n\n this.reset()\n }", "title": "" }, { "docid": "7bb13e47e76eca416a6f39684b44887f", "score": "0.613806", "text": "function _on_call_request_timeout()\n {\n ClientLogger.info( 'Call timeout' );\n $rootScope.$emit( 'IncomingCallService:call_request_timeout' );\n vm.info_message = $translate.instant('cancel_call');\n vm.action_pending = false;\n _close();\n }", "title": "" }, { "docid": "545a041bb60c9b8491d467e04964cf77", "score": "0.61377203", "text": "_timeoutHandler(/*buffer, seqnbr*/) {\n return false;\n }", "title": "" }, { "docid": "f53568eef7fda60c043d8739ff2dae41", "score": "0.6134991", "text": "function bootstrapTimeout()\n\t\t\t{\n\t\t\t\ttimeoutCount = 0;\n\t\t\t\tif ( timeoutCancel ) {\n\t\t\t\t\t$timeout.cancel( timeoutCancel );\n\t\t\t\t}\n\n\t\t\t\ttimeoutLoop();\n\t\t\t}", "title": "" }, { "docid": "6aca6044f1ffdc1a52f95f001b16d85f", "score": "0.6122401", "text": "function TimeoutFunc(_game) {\n let timeInSeconds;\n refreshPlayground(_game);\n console.log(\"Timeout\");\n if (checkAllCardsPlayed(_game) === true) {\n timeInSeconds = Math.floor(Date.now() / 1000);\n _game.duration = timeInSeconds - _game.startTime;\n console.log(\"READY\");\n displayResult(game);\n }\n }", "title": "" }, { "docid": "170d1278153b132c14e42293f6f24995", "score": "0.6082432", "text": "trackTimeout( duration, error ) {\n\n\t\tthis._assertActiveRequestCount();\n\n\t\tthis._activeRequestCount--;\n\t\tthis._metrics.increment( \"timeout\" );\n\t\tthis._applyUpdates();\n\t\tthis._monitor.logTimeout( this.getSnapshot(), duration, error );\n\n\t}", "title": "" }, { "docid": "27dad4e432757e3633dffdf0eafedad4", "score": "0.60566986", "text": "loadtimeout () {\n this.storage.cdnFail()\n console.log(\"Time: \", Date.now(), 'load timeout');\n this.callbacks.onTimeout(this.stats, this.context, null);\n }", "title": "" }, { "docid": "460a8daed6f02fd85667f2b6c278f94e", "score": "0.6055863", "text": "function timeoutAnswerReveal(){\n incorrectAnswers++;\n answerReveal();\n}", "title": "" }, { "docid": "81739605603e054bb2808e09d4e01787", "score": "0.60532683", "text": "scheduleTimeout() {\n clearTimeout(this.timer)\n\n this.timer = setTimeout(() => {\n this.tries = this.tries + 1\n this.callback()\n }, this.timerCalc(this.tries + 1))\n }", "title": "" }, { "docid": "4f6ecca4f2a762c51dbf5c0982c8d4af", "score": "0.60501033", "text": "function setTimeout(toasty, time) {\n\t\t\t\ttoasty.timeout = $timeout(function() {\n\t\t\t\t\tclear(toasty.id);\n\t\t\t\t}, time);\n\t\t\t}", "title": "" }, { "docid": "c86d0f5360b9ece2bc23546886b64f5a", "score": "0.6047225", "text": "doSomethingThatMightTimeout () {\n fastAjax();\n Ember.run.later(() => {\n if (!this.get('gotCPUpdate')) {\n this.trigger('asyncOperationError');\n }\n }, 2000);\n }", "title": "" }, { "docid": "6b69484cbd5ea39ea1d090ea813be78e", "score": "0.6041335", "text": "resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(()=>{\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) this.pingTimeoutTimer.unref();\n }", "title": "" }, { "docid": "61bd3c7b745c9fa2256723c01d1bbd22", "score": "0.6037061", "text": "function afterSecondAcquire(err) {\n clock.restore();\n expect(err.name).to.equal('TimeoutError');\n expect(getChildrenCallback).to.not.throw();\n done();\n }", "title": "" }, { "docid": "61bd3c7b745c9fa2256723c01d1bbd22", "score": "0.6037061", "text": "function afterSecondAcquire(err) {\n clock.restore();\n expect(err.name).to.equal('TimeoutError');\n expect(getChildrenCallback).to.not.throw();\n done();\n }", "title": "" }, { "docid": "afb70f54b38fbbb8e81e40dd4a32faed", "score": "0.6026836", "text": "function startTimeout() {\n\n currentInterval = $interval(function() {\n\n currentNotificationController.currentTimeoutProgress += progressPercentageGap;\n\n if(currentNotificationController.currentTimeoutProgress > 100) {\n\n NotificationModel.splice(currentNotificationController.currentNotificationKey, 1);\n\n }\n }, intervalLimit, intervalIterationNumber);\n }", "title": "" }, { "docid": "d234707e1353a303b7da773e8fcff23f", "score": "0.60251033", "text": "scheduleTimeout(){\n clearTimeout(this.timer)\n\n this.timer = setTimeout(() => {\n this.tries = this.tries + 1\n this.callback()\n }, this.timerCalc(this.tries + 1))\n }", "title": "" }, { "docid": "03c9a65b8270cc81427319b4e48ddc78", "score": "0.6019874", "text": "safetyTimeout (time) {\n const self = this\n return setTimeout(function () {\n // IF onFailure exist fire it, else fire onSuccess\n self.onFailure ? self.onFailure() : self.onSuccess()\n }, time)\n }", "title": "" }, { "docid": "185ddf2f2cf427c819352ae92665f485", "score": "0.6017434", "text": "_handleResponseTimeout() {\n if (this._msgDone) return;\n\n // Addressing timeout\n if (this._addressing) {\n this.endMessage();\n }\n // Response message\n else if (this._msgOptions.responseMsg) {\n let dataDone = this._fillNextResponse();\n if (dataDone) {\n this.endMessage();\n } else {\n this._drainPromise.then(() => {\n this._restartResponseTimer();\n });\n }\n }\n }", "title": "" }, { "docid": "f0457364abe4085206fde7e5f85f5614", "score": "0.60171074", "text": "timerN() {\n this.logger.warn(`Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY.`);\n this.waitNotifyStop();\n if (this.delegate && this.delegate.onNotifyTimeout) {\n this.delegate.onNotifyTimeout();\n }\n }", "title": "" }, { "docid": "ef2da0a9fb2d153e395cb4f6572c5e38", "score": "0.600717", "text": "function onTimeout() {\n deferred.reject(errors); // complete overall\n }", "title": "" }, { "docid": "236acbe7522f69f99db5583ab996ecae", "score": "0.60059977", "text": "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "title": "" }, { "docid": "236acbe7522f69f99db5583ab996ecae", "score": "0.60059977", "text": "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "title": "" }, { "docid": "26ae994c40dd94f3638a1baa7503becf", "score": "0.6004296", "text": "_onTimeout( e ) {\n if ( typeof this._options.error === 'function' ) {\n this._options.error.call( this, this._xhr, 'The server did not send a response in time. Request aborted.' );\n }\n this._onComplete( '' );\n }", "title": "" }, { "docid": "9299954bec363470a98e6280a0b711c4", "score": "0.5996896", "text": "function timer() {\n timerFinished = true;\n}", "title": "" }, { "docid": "9d1b6dd8ff142e7ad41b9c8362ac7f58", "score": "0.59937036", "text": "idle() {\n const _now = this.msNow();\n if ((_now - this.sesTimeoutValue.value) > this.timeoutSecs) {\n this.sesTimeoutValue.set(_now);\n }\n }", "title": "" }, { "docid": "26bfdf7bfc9cc8deacb01b373eb45109", "score": "0.5992858", "text": "function resultBeforeGameOver() {\n setTimeout(function() {\n finalResults();\n resetValues();\n }, 2000);\n }", "title": "" }, { "docid": "f5ffe76e06fdef5a144a97ce88fde276", "score": "0.59898275", "text": "_onExpiry() {\n this._timeout = null;\n this._expiryCallback();\n }", "title": "" }, { "docid": "247de1dfb739841c188bfb796fb5849a", "score": "0.59841835", "text": "function timeoutHandler() {\n this.mousestop.coords = {\n start: startCoords,\n end: endCoords\n };\n this.windowObject.dispatchEvent(this.mousestop);\n this.startCoords = null;\n }", "title": "" }, { "docid": "334592b1cc5059a5a89784a38cb9fb2f", "score": "0.5978895", "text": "function timeOutSet(time) {\n timeout = setTimeout(compareTime, time)\n}", "title": "" }, { "docid": "ae37ef179711c7607a5359023da5061d", "score": "0.5978122", "text": "function finishedTimer() {\n $rootScope.$broadcast('finishedTimer');\n }", "title": "" }, { "docid": "cb39e44171ae99bb0bd70c527caeafa9", "score": "0.5977829", "text": "function displayTimeoutError()\n {\n }", "title": "" }, { "docid": "f2d49515cacab1b0293bf387d5d615c9", "score": "0.5967348", "text": "function questionChangeTimeout() {\n setTimeout(function(){\n\n // Show final score page when all questions have been shown\n if(totalQuestions === questionNumber){\n var total = 100 * ((wrong + unanswered) / correct);\n $('#question-container').empty();\n $('#question-container').append('<li id=\"game-reset-screen\" class=\"list-group-item\">Correct answers: ' +correct+ '<br>Wrong answers: ' +wrong+ '<br>Unanswered: ' +unanswered+ '<br>Total: ' +total+ '</li>')\n clearInterval();\n return\n }\n $('#question-container').empty()\n writeQuestion();\n writeSelections();\n intervalReset();\n clicked = false;\n writeQuestionNumber();\n }, 2000)\n }", "title": "" }, { "docid": "e97dd0f4d132e82e66e33d0eb8f78964", "score": "0.59648734", "text": "timerCallback() {\n if (!this.localStream.active) {\n return;\n }\n this.computeFrame();\n setTimeout(() => {\n this.timerCallback();\n }, 0);\n }", "title": "" }, { "docid": "6cfb0d56deb1fb791a2d0ab32023d67c", "score": "0.5949822", "text": "updateTimeOut() {\n if (this.parentObj.updateTimeOut) {\n this.parentObj.finalUpdate();\n this.parentObj.updateTimeOut();\n }\n else {\n let changeTime = setTimeout(this.parentObj.dataBind.bind(this.parentObj));\n let clearUpdate = () => {\n clearTimeout(changeTime);\n };\n this.finalUpdate = clearUpdate;\n }\n }", "title": "" }, { "docid": "6cfb0d56deb1fb791a2d0ab32023d67c", "score": "0.5949822", "text": "updateTimeOut() {\n if (this.parentObj.updateTimeOut) {\n this.parentObj.finalUpdate();\n this.parentObj.updateTimeOut();\n }\n else {\n let changeTime = setTimeout(this.parentObj.dataBind.bind(this.parentObj));\n let clearUpdate = () => {\n clearTimeout(changeTime);\n };\n this.finalUpdate = clearUpdate;\n }\n }", "title": "" }, { "docid": "6cfb0d56deb1fb791a2d0ab32023d67c", "score": "0.5949822", "text": "updateTimeOut() {\n if (this.parentObj.updateTimeOut) {\n this.parentObj.finalUpdate();\n this.parentObj.updateTimeOut();\n }\n else {\n let changeTime = setTimeout(this.parentObj.dataBind.bind(this.parentObj));\n let clearUpdate = () => {\n clearTimeout(changeTime);\n };\n this.finalUpdate = clearUpdate;\n }\n }", "title": "" }, { "docid": "36c22009e7a60c9a0309fbf5cf41780d", "score": "0.5949268", "text": "waitForDebounce (callback) {\n\t\tsetTimeout(callback, 3000);\n\t}", "title": "" }, { "docid": "8da595e84efe5d4af399e5f491a7a405", "score": "0.59459895", "text": "setRefreshTimeout() {\n const refresh = () => {\n let now = moment()\n this.props.fetchRoomsAvailableCount(this.props.api.available_rooms, now)\n this.setRefreshTimeout()\n this.setFlipCounter()\n }\n this.refresh_timeout = setTimeout(refresh, 2 * 60 * 1000)\n }", "title": "" }, { "docid": "3e290cacb643e4a6d93d1f2adcb4a579", "score": "0.5931601", "text": "function asap(target) {\n setTimeout(target, 0);\n }", "title": "" }, { "docid": "a464fc5db4851409184bcfa86a2bdced", "score": "0.59242237", "text": "function timeoutIncrement() {\n setTimeout(function() {\n incrementIndex();\n }, 2000);\n }", "title": "" } ]
1a123533b0eb70f948ac5c6cc59ca342
FOR TESTING ONLY ADD DEFAULT USER REMOVE BEFORE ADDING TO PRODUCTION
[ { "docid": "a1ee5d5b746b0c3dbeda4371325ce3f2", "score": "0.0", "text": "function addAccount(user) {\n bcrypt.hash(user.password, saltRounds).then((hash) => {\n User.create({\n email: user.email,\n hash,\n admin: user.admin,\n }).then(result => console.log(result));\n });\n }", "title": "" } ]
[ { "docid": "4d4cb0267fc55c5421774ad6e197f5c1", "score": "0.69032353", "text": "setDefaultUser(user) {\n this.defaultUser = user;\n }", "title": "" }, { "docid": "29f6984450684276ab1c02828af41692", "score": "0.6449005", "text": "function setDefaultUser (kontx, next) {\n var a = _.clone(kontx.args);\n\n if (a.length === 0) { //No args are sent in, set first to be user id\n a[0] = kontx.user._id;\n }\n else if (_.has(a[0], 'include') || _.has(a[0], 'exclude')) { // If first arg is options then reassign\n a[0] = kontx.user._id;\n a[1] = kontx.args[0];\n }\n\n kontx.args = a;\n next();\n }", "title": "" }, { "docid": "498a390fcc5f05c26265210ff572d773", "score": "0.64272666", "text": "defaults () {\n return {\n userId: '',\n userFirstname: '',\n userName: '',\n userDateInscription: '',\n userPass: '',\n userToken: 'onestlahein',\n userMail: '',\n userPhone: '',\n userPseudo: '',\n userDescription: '',\n userVisibility: 'public',\n userPicture: '',\n userAccountState: '',\n userNumberParty: 0\n }\n }", "title": "" }, { "docid": "e7ebddad85da9217ec0b0c584e8da94d", "score": "0.6288972", "text": "async function addDefaulUserToSiteLogin() {\n try {\n let User = db.models.user;\n\n // search default user 'root'.\n let user = await User.findOne({\n where: {\n username: CONFIG.server.defaultUser.username\n }\n });\n\n // if user is no exists find another users.\n if (!user) {\n let users = await User.all();\n\n // if there are no another users - create a default 'root' user.\n let hashPassword = db.getHashPass(CONFIG.server.defaultUser.password);\n const data = {\n username: CONFIG.server.defaultUser.username,\n password: hashPassword\n };\n\n const newUser = await User.create(data);\n\n // if new User isn't create throw error.\n if (!newUser)\n throw new Error(\"Can't create root user\");\n\n } else {\n // if user is nothing to do.\n };\n } catch (error) {\n console.error(\"Error on creating default site user\", error);\n // stop with error.\n process.exit(1);\n };\n}", "title": "" }, { "docid": "25b7d4840ed4dbccd00bf17b38102c84", "score": "0.62115085", "text": "defaultUserGenerator() {\n const { userData } = this.data\n const user = new User(userData)\n let newUser = {}\n\n // POPULATE DATA\n newUser.username = user.generateUsername()\n newUser.email = user.generateEmail(1)\n newUser.password = user.minCharPassword()\n newUser.age = user.generateAge()\n newUser.phoneNumber = user.generatePhoneNumber()\n\n return newUser\n }", "title": "" }, { "docid": "4d3635429505d04287fc4cea46abe37e", "score": "0.6109554", "text": "static constructDefaultUser() {\n let username = LoginProject.DEFAULT_USERNAME;\n let hashed_password = CryptoJS.SHA256(LoginProject.DEFAULT_PASSWORD).toString();\n return new User(username, hashed_password);\n }", "title": "" }, { "docid": "a10714c992bf8ffc1902b015a900b6b7", "score": "0.6035116", "text": "function deleteDefaultFirstUser(loginUserName, loginPassword) { \n let indel = Project.Variables.indel,\n userManagemant = indel.user_management,\n userList = userManagemant.userList;\n\n launchwithlogic.launchWithLogic();\n login.login(loginUserName, loginPassword);\n \n indel.PatientManagementWidget.groupBox.frame.pushButton_UserManage.ClickButton();\n \n if (userList.wRowCount > 0) {\n userManagemant.pushButton_DelUser.ClickButton();\n let userName = finditeminlist.getFieldValue(0, globalconstant.obj.userNameColumn, userList);\n if (strictEqual(userName, loginUserName)) {\n aqObject.CheckProperty(indel.user_delete_current_pop, \"Exists\", cmpEqual, true);\n indel.user_delete_current_pop.qt_msgbox_buttonbox.buttonOk.ClickButton();\n } else {\n Log.Error(`${Project.TestItems.Current.Name} Please login use our account`);\n }\n } else {\n Log.Error(`${Project.TestItems.Current.Name} there is no default user for deleting`);\n }\n\n userManagemant.pushButton_Exit.ClickButton();\n \n logout.logout();\n exitwithlogic.exitWithLogic()\n\n}", "title": "" }, { "docid": "e00cd4a8bf6e600a3c19ddde6ea39780", "score": "0.58866173", "text": "skip({login, data, imports}) {\n data.user = {}\n data.shared = imports.metadata.plugins.base.inputs({data, q: {}, account: \"bypass\"})\n for (const account of [\"user\", \"organization\"])\n postprocess?.[account]({login, data})\n data.account = \"bypass\"\n Object.assign(data.user, {\n databaseId: NaN,\n name: login,\n login,\n createdAt: new Date(),\n avatarUrl: `https://github.com/${login}.png`,\n websiteUrl: null,\n twitterUsername: login,\n repositories: {totalCount: NaN, totalDiskUsage: NaN, nodes: []},\n packages: {totalCount: NaN},\n repositoriesContributedTo: {totalCount: NaN, nodes: []},\n })\n }", "title": "" }, { "docid": "3b2a549e1f7cf848dc24cdd81178ef33", "score": "0.5861277", "text": "identifyUser() {}", "title": "" }, { "docid": "f9ae25a341d1c0cc591e04080234efba", "score": "0.5833513", "text": "function setup_user(){\n\t\toauth.get(redirect+\"/api/users/show.json\", function (data){\n\t\t\t\tuserinfo = data.text;\n\t\t\t\tconsole.log(userinfo);\n\t\t\t}, \n\t\t\tfunction(data){\n\t\t\t\t\tconsole.log(\"Api: Could not get userinfo\");\n\t\t\t\t});\t\t\t\n\t}", "title": "" }, { "docid": "254df3933ddfc46fd2336eae4cbbd9d1", "score": "0.5833209", "text": "__addLoginUser() {\n if (!this.userExists(this.user.username) && this.user.username !== null) {\n this.users.push(this.user);\n } else {\n const userIdx = this.users.findIndex(\n (userEl) => userEl.username == this.user.username\n );\n this.users[userIdx] = this.user;\n }\n }", "title": "" }, { "docid": "fbd6cacac04a6cb74cec1471bf5e3d62", "score": "0.581771", "text": "function addDefaultUser(addr) {\n addUser('INVESTOR', \"aaa\", 260000, 11, \"A\", addr);\n addUser('INVESTOR', \"bbb\", 220000, 22, \"B\", addr);\n addUser('INVESTOR', \"ccc\", 700000, 33, \"B\", addr);\n addUser('INVESTOR', \"ddd\", 250000, 11, \"B\", addr);\n addUser('INVESTOR', \"eee\", 1, 11, \"B\", addr);\n addUser('INVESTOR', \"fff\", 1, 11, \"C\", addr);\n addUser('INVESTOR', \"ggg\", 1, 11, \"B\", addr);\n // addUser('INVESTOR', \"施崇祐\", 260000, 11, \"A\", addr);\n // addUser('INVESTOR', \"陳姿妤\", 220000, 22, \"B\", addr);\n // addUser('INVESTOR', \"李昱廷\", 700000, 33, \"B\", addr);\n // addUser('INVESTOR', \"蔡英文\", 250000, 11, \"B\", addr);\n // addUser('INVESTOR', \"馬英九\", 1, 11, \"B\", addr);\n // addUser('INVESTOR', \"小紅帽\", 1, 11, \"C\", a);\n // addUser('INVESTOR', \"艾希\", 1, 11, \"B\");\n // addUser('INVESTOR', \"施崇祐\", 260000, 11, \"A\");\n // addUser('INVESTOR', \"陳姿妤\", 220000, 22, \"B\");\n // addUser('INVESTOR', \"李昱廷\", 700000, 33, \"B\");\n // addUser('INVESTOR', \"蔡英文\", 250000, 11, \"B\");\n // addUser('INVESTOR', \"馬英九\", 1, 11, \"B\");\n // addUser('INVESTOR', \"小紅帽\", 1, 11, \"C\");\n // addUser('INVESTOR', \"艾希\", 1, 11, \"B\");\n // addUser('INVESTOR', \"施崇祐\", 260000, 11, \"A\");\n // addUser('INVESTOR', \"陳姿妤\", 220000, 22, \"B\");\n // addUser('INVESTOR', \"李昱廷\", 700000, 33, \"B\");\n // addUser('INVESTOR', \"蔡英文\", 250000, 11, \"B\");\n // addUser('INVESTOR', \"馬英九\", 1, 11, \"B\");\n // addUser('INVESTOR', \"小紅帽\", 1, 11, \"C\");\n // addUser('INVESTOR', \"艾希\", 1, 11, \"B\");\n // addUser('INVESTOR', \"施崇祐\", 260000, 11, \"A\");\n // addUser('INVESTOR', \"陳姿妤\", 220000, 22, \"B\");\n // addUser('INVESTOR', \"李昱廷\", 700000, 33, \"B\");\n // addUser('INVESTOR', \"蔡英文\", 250000, 11, \"B\");\n // addUser('INVESTOR', \"馬英九\", 1, 11, \"B\");\n // addUser('INVESTOR', \"小紅帽\", 1, 11, \"C\");\n // addUser('INVESTOR', \"艾希\", 1, 11, \"B\");\n \n // addUser('INVESTOR', \"哈哈哈\", 6666, 11, \"A\", addr); \n // addUser('BORROWER', \"合和合\", 6666, 11, \"A\", addr);\n\n addUser('BORROWER', \"123\", 200000, 11, \"A\", addr);\n addUser('BORROWER', \"456\", 500000, 11, \"A\", addr);\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n // addUser('BORROWER', \"法洛士\", 200000, 11, \"A\");\n // addUser('BORROWER', \"咸蛋超人\", 500000, 11, \"A\");\n\n}", "title": "" }, { "docid": "068a3b7757816abe95fa8eb1f33b4df3", "score": "0.5801191", "text": "defaults() {\n return {\n id: null,\n username: '',\n email: '',\n role: '',\n firstname: '',\n lastname: '',\n }\n }", "title": "" }, { "docid": "423c7d735d1c47ac68937edb298b8ff4", "score": "0.57950693", "text": "function createUserData() {\n\n\t// Saves data for application storage \n\tEcwidApp.setAppStorage(initialConfig.private, function(value){\n\t\tconsole.log('Initial private user preferences saved!');\n\t});\n\n\t// Saves data for public app config\n\tEcwidApp.setAppPublicConfig(initialConfig.public, function(value){\n\t\tconsole.log('Initial public user preferences saved!');\n\t});\n\n\t// Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n\tsetValuesForPage(initialConfig);\n}", "title": "" }, { "docid": "4d1db59c1e9ab14824adb4fd3da31b01", "score": "0.5792254", "text": "function initFakeUsers() {\n fakeUsers = localStorage.getItem('fakeUsers') ? JSON.parse(localStorage.getItem('fakeUsers')) : allFakeUsers ;\n\n localStorage.setItem('fakeUsers', JSON.stringify(fakeUsers));\n }", "title": "" }, { "docid": "ce990d1d84edf1ac7ae58ef55a9652a3", "score": "0.57612795", "text": "randomNamedUser () {\n\t\treturn {\n\t\t\temail: this.randomEmail(),\n\t\t\tfullName: this.randomFullName()\n\t\t};\n\t}", "title": "" }, { "docid": "7f6d729066fa8198c20f077e70468063", "score": "0.57461643", "text": "initUser() {\n if (this.user) {\n return;\n }\n\n let user;\n if (this.storage) {\n user = this.storage.getItem('user');\n }\n\n if (!user) {\n user = window.prompt('Nom du participant ?');\n if (this.storage) {\n this.storage.setItem('user', user);\n }\n }\n\n this.user = user;\n }", "title": "" }, { "docid": "9526fbb32031476360fba6974dcdeeaf", "score": "0.57455164", "text": "function createUserManager(defaultUsername){\n return new userManager(defaultUsername);\n}", "title": "" }, { "docid": "8dce94e808c0977f845f4835709c0f8f", "score": "0.57406974", "text": "static getNamedUser() {\n return UrbanAirshipModule.getNamedUser();\n }", "title": "" }, { "docid": "764849613ecb78793f862064bf69e82f", "score": "0.5736524", "text": "function setMainUser(user) {\n mainUser = user;\n prepProfile(mainUser);\n}", "title": "" }, { "docid": "83ba17122d26693a3ec927a866860604", "score": "0.57225627", "text": "function resetBotUser() {\n const userVars = rs.getUservars(rs.currentUser());\n Object.keys(userVars).forEach(userVar => {\n rs.setUservar(rs.currentUser(), userVar, undefined);\n });\n}", "title": "" }, { "docid": "036fc38da24f309b8d7262c27e994a49", "score": "0.56992644", "text": "generateTestUser() {\n const testUserStr = String(this._testUser);\n this._testUser++;\n return {\n username: testUserStr,\n password: testUserStr,\n firstName: testUserStr,\n lastName: testUserStr,\n email: testUserStr + '@' + testUserStr + '.com',\n facebook: {\n id: testUserStr,\n token: testUserStr\n }\n }\n }", "title": "" }, { "docid": "82d2aa924c17cefc42a932549d93c630", "score": "0.5697935", "text": "beforeCreate(user) {\n if (user.hash) {\n user.salt = crypto.randomBytes(16).toString('hex');\n user.hash = crypto\n .pbkdf2Sync(user.hash, user.salt, 1000, 64, 'sha512')\n .toString('hex');\n }\n }", "title": "" }, { "docid": "3cd9d5ddcecdecb6a2f5da3ae6a2b87a", "score": "0.5678998", "text": "loadUserConfig() {\n requestLoadUserConfig();\n }", "title": "" }, { "docid": "3cd9d5ddcecdecb6a2f5da3ae6a2b87a", "score": "0.5678998", "text": "loadUserConfig() {\n requestLoadUserConfig();\n }", "title": "" }, { "docid": "f34ee404d03dab0b20405ac5a575775b", "score": "0.56775904", "text": "function initUser(name) {\n\tusersList[name] = {username: name, fgColor: '', bgColor: '', tag: '', icon: ''};\n}", "title": "" }, { "docid": "66cd5c1b5cd352f22cabad5f35ffbb2a", "score": "0.56747985", "text": "_initExternalUser() {\n if (!this.options.isLoggedIn) {\n this._userCard = false\n this._triggerRegistrationModal = true\n }\n }", "title": "" }, { "docid": "68ad9ad316be6a946794898bee4efb77", "score": "0.5659932", "text": "get requiresUsername() { return true; }", "title": "" }, { "docid": "4ae80065aa95d0bf469ee57d6226c736", "score": "0.5654332", "text": "function getOrgAdmin4Local() {\r\n\r\n\tvar keyPath = \"/root/aberic/crypto-config/peerOrganizations/vegetablesorg1.fssbc.com/users/[email protected]/msp/keystore\" ;\r\n\tvar keyPEM = Buffer.from(readAllFiles(keyPath)[0].toString());\r\n\tvar certPath = \"/root/aberic/crypto-config/peerOrganizations/vegetablesorg1.fssbc.com/users/[email protected]/msp/signcerts\";\r\n\tvar certPEM = readAllFiles(certPath)[0].toString();\r\n\r\n\treturn hfc.newDefaultKeyValueStore({\r\n\t\tpath:tempdir\r\n\t}).then((store) => {\r\n\t\tclient.setStateStore(store);\r\n\r\n\t\treturn client.createUser({\r\n\t\t\tusername: 'Admin',\r\n\t\t\tmspid: 'VegetablesOrg1MSP',\r\n\t\t\tcryptoContent: {\r\n\t\t\t\tprivateKeyPEM: keyPEM,\r\n\t\t\t\tsignedCertPEM: certPEM\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "title": "" }, { "docid": "0ea5f3257ecc2b78e604e52d63f4fe86", "score": "0.56348056", "text": "function buildUser(overrides = {}) {\n return {\n id: getOktaId(),\n avatarUrl: getImg(),\n email: getEmail(),\n name: getName(),\n address: getAddress(),\n city: getCity(),\n state: getState(),\n zip: getZipCode(),\n ...overrides,\n };\n}", "title": "" }, { "docid": "ae80890bfa444826a47cf3f3429e0e99", "score": "0.5630087", "text": "function NewUser(defaultValues) {\n var privateState = {};\n context[\"field\"] = \"addressLine1\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"addressLine1\"] : null);\n privateState.addressLine1 = defaultValues ?\n (defaultValues[\"addressLine1\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"addressLine1\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"addressLine2\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"addressLine2\"] : null);\n privateState.addressLine2 = defaultValues ?\n (defaultValues[\"addressLine2\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"addressLine2\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"annualIncome\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"annualIncome\"] : null);\n privateState.annualIncome = defaultValues ?\n (defaultValues[\"annualIncome\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"annualIncome\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"assets\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"assets\"] : null);\n privateState.assets = defaultValues ?\n (defaultValues[\"assets\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"assets\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"city\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"city\"] : null);\n privateState.city = defaultValues ?\n (defaultValues[\"city\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"city\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"company\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"company\"] : null);\n privateState.company = defaultValues ?\n (defaultValues[\"company\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"company\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"country\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"country\"] : null);\n privateState.country = defaultValues ?\n (defaultValues[\"country\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"country\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"countryCode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"countryCode\"] : null);\n privateState.countryCode = defaultValues ?\n (defaultValues[\"countryCode\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"countryCode\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"creditCheck\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"creditCheck\"] : null);\n privateState.creditCheck = defaultValues ?\n (defaultValues[\"creditCheck\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"creditCheck\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"dateOfBirth\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"dateOfBirth\"] : null);\n privateState.dateOfBirth = defaultValues ?\n (defaultValues[\"dateOfBirth\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"dateOfBirth\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"email\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"email\"] : null);\n privateState.email = defaultValues ?\n (defaultValues[\"email\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"email\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"employmentInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"employmentInfo\"] : null);\n privateState.employmentInfo = defaultValues ?\n (defaultValues[\"employmentInfo\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"employmentInfo\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"errmsg\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"errmsg\"] : null);\n privateState.errmsg = defaultValues ?\n (defaultValues[\"errmsg\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"errmsg\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"experience\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"experience\"] : null);\n privateState.experience = defaultValues ?\n (defaultValues[\"experience\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"experience\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"gender\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"gender\"] : null);\n privateState.gender = defaultValues ?\n (defaultValues[\"gender\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"gender\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"informationType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"informationType\"] : null);\n privateState.informationType = defaultValues ?\n (defaultValues[\"informationType\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"informationType\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"jobProfile\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"jobProfile\"] : null);\n privateState.jobProfile = defaultValues ?\n (defaultValues[\"jobProfile\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"jobProfile\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"maritalStatus\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"maritalStatus\"] : null);\n privateState.maritalStatus = defaultValues ?\n (defaultValues[\"maritalStatus\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"maritalStatus\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"montlyExpenditure\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"montlyExpenditure\"] : null);\n privateState.montlyExpenditure = defaultValues ?\n (defaultValues[\"montlyExpenditure\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"montlyExpenditure\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"noOfDependents\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"noOfDependents\"] : null);\n privateState.noOfDependents = defaultValues ?\n (defaultValues[\"noOfDependents\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"noOfDependents\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"password\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"password\"] : null);\n privateState.password = defaultValues ?\n (defaultValues[\"password\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"password\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"phone\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"phone\"] : null);\n privateState.phone = defaultValues ?\n (defaultValues[\"phone\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"phone\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"signatureImage\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"signatureImage\"] : null);\n privateState.signatureImage = defaultValues ?\n (defaultValues[\"signatureImage\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"signatureImage\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"spouseFirstName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"spouseFirstName\"] : null);\n privateState.spouseFirstName = defaultValues ?\n (defaultValues[\"spouseFirstName\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"spouseFirstName\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"spouseLastName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"spouseLastName\"] : null);\n privateState.spouseLastName = defaultValues ?\n (defaultValues[\"spouseLastName\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"spouseLastName\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"ssn\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"ssn\"] : null);\n privateState.ssn = defaultValues ?\n (defaultValues[\"ssn\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"ssn\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"state\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"state\"] : null);\n privateState.state = defaultValues ?\n (defaultValues[\"state\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"state\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"success\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"success\"] : null);\n privateState.success = defaultValues ?\n (defaultValues[\"success\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"success\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userEmploymentInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userEmploymentInfo\"] : null);\n privateState.userEmploymentInfo = defaultValues ?\n (defaultValues[\"userEmploymentInfo\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userEmploymentInfo\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userFinancialInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userFinancialInfo\"] : null);\n privateState.userFinancialInfo = defaultValues ?\n (defaultValues[\"userFinancialInfo\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userFinancialInfo\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userfirstname\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userfirstname\"] : null);\n privateState.userfirstname = defaultValues ?\n (defaultValues[\"userfirstname\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userfirstname\"], 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\"] = \"userlastname\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userlastname\"] : null);\n privateState.userlastname = defaultValues ?\n (defaultValues[\"userlastname\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userlastname\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userName\"] : null);\n privateState.userName = defaultValues ?\n (defaultValues[\"userName\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userName\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userPersonalInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userPersonalInfo\"] : null);\n privateState.userPersonalInfo = defaultValues ?\n (defaultValues[\"userPersonalInfo\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userPersonalInfo\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userProducts\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userProducts\"] : null);\n privateState.userProducts = defaultValues ?\n (defaultValues[\"userProducts\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userProducts\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"userSecurityQuestions\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userSecurityQuestions\"] : null);\n privateState.userSecurityQuestions = defaultValues ?\n (defaultValues[\"userSecurityQuestions\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userSecurityQuestions\"], context) :\n null) :\n null;\n\n context[\"field\"] = \"zipcode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"zipcode\"] : null);\n privateState.zipcode = defaultValues ?\n (defaultValues[\"zipcode\"] ?\n kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"zipcode\"], 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 \"addressLine1\": {\n get: function() {\n context[\"field\"] = \"addressLine1\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"addressLine1\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.addressLine1, context);\n },\n set: function(val) {\n setterFunctions['addressLine1'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"addressLine2\": {\n get: function() {\n context[\"field\"] = \"addressLine2\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"addressLine2\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.addressLine2, context);\n },\n set: function(val) {\n setterFunctions['addressLine2'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"annualIncome\": {\n get: function() {\n context[\"field\"] = \"annualIncome\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"annualIncome\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.annualIncome, context);\n },\n set: function(val) {\n setterFunctions['annualIncome'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"assets\": {\n get: function() {\n context[\"field\"] = \"assets\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"assets\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.assets, context);\n },\n set: function(val) {\n setterFunctions['assets'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"city\": {\n get: function() {\n context[\"field\"] = \"city\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"city\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.city, context);\n },\n set: function(val) {\n setterFunctions['city'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"company\": {\n get: function() {\n context[\"field\"] = \"company\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"company\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.company, context);\n },\n set: function(val) {\n setterFunctions['company'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"country\": {\n get: function() {\n context[\"field\"] = \"country\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"country\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.country, context);\n },\n set: function(val) {\n setterFunctions['country'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"countryCode\": {\n get: function() {\n context[\"field\"] = \"countryCode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"countryCode\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.countryCode, context);\n },\n set: function(val) {\n setterFunctions['countryCode'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"creditCheck\": {\n get: function() {\n context[\"field\"] = \"creditCheck\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"creditCheck\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.creditCheck, context);\n },\n set: function(val) {\n setterFunctions['creditCheck'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"dateOfBirth\": {\n get: function() {\n context[\"field\"] = \"dateOfBirth\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"dateOfBirth\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.dateOfBirth, context);\n },\n set: function(val) {\n setterFunctions['dateOfBirth'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"email\": {\n get: function() {\n context[\"field\"] = \"email\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"email\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.email, context);\n },\n set: function(val) {\n setterFunctions['email'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"employmentInfo\": {\n get: function() {\n context[\"field\"] = \"employmentInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"employmentInfo\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.employmentInfo, context);\n },\n set: function(val) {\n setterFunctions['employmentInfo'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"errmsg\": {\n get: function() {\n context[\"field\"] = \"errmsg\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"errmsg\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.errmsg, context);\n },\n set: function(val) {\n setterFunctions['errmsg'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"experience\": {\n get: function() {\n context[\"field\"] = \"experience\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"experience\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.experience, context);\n },\n set: function(val) {\n setterFunctions['experience'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"gender\": {\n get: function() {\n context[\"field\"] = \"gender\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"gender\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.gender, context);\n },\n set: function(val) {\n setterFunctions['gender'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"informationType\": {\n get: function() {\n context[\"field\"] = \"informationType\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"informationType\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.informationType, context);\n },\n set: function(val) {\n setterFunctions['informationType'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"jobProfile\": {\n get: function() {\n context[\"field\"] = \"jobProfile\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"jobProfile\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.jobProfile, context);\n },\n set: function(val) {\n setterFunctions['jobProfile'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"maritalStatus\": {\n get: function() {\n context[\"field\"] = \"maritalStatus\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"maritalStatus\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.maritalStatus, context);\n },\n set: function(val) {\n setterFunctions['maritalStatus'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"montlyExpenditure\": {\n get: function() {\n context[\"field\"] = \"montlyExpenditure\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"montlyExpenditure\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.montlyExpenditure, context);\n },\n set: function(val) {\n setterFunctions['montlyExpenditure'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"noOfDependents\": {\n get: function() {\n context[\"field\"] = \"noOfDependents\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"noOfDependents\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.noOfDependents, context);\n },\n set: function(val) {\n setterFunctions['noOfDependents'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"password\": {\n get: function() {\n context[\"field\"] = \"password\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"password\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.password, context);\n },\n set: function(val) {\n setterFunctions['password'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"phone\": {\n get: function() {\n context[\"field\"] = \"phone\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"phone\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.phone, context);\n },\n set: function(val) {\n setterFunctions['phone'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"signatureImage\": {\n get: function() {\n context[\"field\"] = \"signatureImage\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"signatureImage\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.signatureImage, context);\n },\n set: function(val) {\n setterFunctions['signatureImage'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"spouseFirstName\": {\n get: function() {\n context[\"field\"] = \"spouseFirstName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"spouseFirstName\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.spouseFirstName, context);\n },\n set: function(val) {\n setterFunctions['spouseFirstName'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"spouseLastName\": {\n get: function() {\n context[\"field\"] = \"spouseLastName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"spouseLastName\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.spouseLastName, context);\n },\n set: function(val) {\n setterFunctions['spouseLastName'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"ssn\": {\n get: function() {\n context[\"field\"] = \"ssn\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"ssn\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.ssn, context);\n },\n set: function(val) {\n setterFunctions['ssn'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"state\": {\n get: function() {\n context[\"field\"] = \"state\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"state\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.state, context);\n },\n set: function(val) {\n setterFunctions['state'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"success\": {\n get: function() {\n context[\"field\"] = \"success\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"success\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.success, context);\n },\n set: function(val) {\n setterFunctions['success'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userEmploymentInfo\": {\n get: function() {\n context[\"field\"] = \"userEmploymentInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userEmploymentInfo\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userEmploymentInfo, context);\n },\n set: function(val) {\n setterFunctions['userEmploymentInfo'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userFinancialInfo\": {\n get: function() {\n context[\"field\"] = \"userFinancialInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userFinancialInfo\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userFinancialInfo, context);\n },\n set: function(val) {\n setterFunctions['userFinancialInfo'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userfirstname\": {\n get: function() {\n context[\"field\"] = \"userfirstname\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userfirstname\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userfirstname, context);\n },\n set: function(val) {\n setterFunctions['userfirstname'].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 \"userlastname\": {\n get: function() {\n context[\"field\"] = \"userlastname\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userlastname\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userlastname, context);\n },\n set: function(val) {\n setterFunctions['userlastname'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userName\": {\n get: function() {\n context[\"field\"] = \"userName\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userName\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userName, context);\n },\n set: function(val) {\n setterFunctions['userName'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userPersonalInfo\": {\n get: function() {\n context[\"field\"] = \"userPersonalInfo\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userPersonalInfo\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userPersonalInfo, context);\n },\n set: function(val) {\n setterFunctions['userPersonalInfo'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userProducts\": {\n get: function() {\n context[\"field\"] = \"userProducts\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userProducts\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userProducts, context);\n },\n set: function(val) {\n setterFunctions['userProducts'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"userSecurityQuestions\": {\n get: function() {\n context[\"field\"] = \"userSecurityQuestions\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userSecurityQuestions\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.userSecurityQuestions, context);\n },\n set: function(val) {\n setterFunctions['userSecurityQuestions'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"zipcode\": {\n get: function() {\n context[\"field\"] = \"zipcode\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"zipcode\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.zipcode, context);\n },\n set: function(val) {\n setterFunctions['zipcode'].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.addressLine1 = value ? (value[\"addressLine1\"] ? value[\"addressLine1\"] : null) : null;\n privateState.addressLine2 = value ? (value[\"addressLine2\"] ? value[\"addressLine2\"] : null) : null;\n privateState.annualIncome = value ? (value[\"annualIncome\"] ? value[\"annualIncome\"] : null) : null;\n privateState.assets = value ? (value[\"assets\"] ? value[\"assets\"] : null) : null;\n privateState.city = value ? (value[\"city\"] ? value[\"city\"] : null) : null;\n privateState.company = value ? (value[\"company\"] ? value[\"company\"] : null) : null;\n privateState.country = value ? (value[\"country\"] ? value[\"country\"] : null) : null;\n privateState.countryCode = value ? (value[\"countryCode\"] ? value[\"countryCode\"] : null) : null;\n privateState.creditCheck = value ? (value[\"creditCheck\"] ? value[\"creditCheck\"] : null) : null;\n privateState.dateOfBirth = value ? (value[\"dateOfBirth\"] ? value[\"dateOfBirth\"] : null) : null;\n privateState.email = value ? (value[\"email\"] ? value[\"email\"] : null) : null;\n privateState.employmentInfo = value ? (value[\"employmentInfo\"] ? value[\"employmentInfo\"] : null) : null;\n privateState.errmsg = value ? (value[\"errmsg\"] ? value[\"errmsg\"] : null) : null;\n privateState.experience = value ? (value[\"experience\"] ? value[\"experience\"] : null) : null;\n privateState.gender = value ? (value[\"gender\"] ? value[\"gender\"] : null) : null;\n privateState.informationType = value ? (value[\"informationType\"] ? value[\"informationType\"] : null) : null;\n privateState.jobProfile = value ? (value[\"jobProfile\"] ? value[\"jobProfile\"] : null) : null;\n privateState.maritalStatus = value ? (value[\"maritalStatus\"] ? value[\"maritalStatus\"] : null) : null;\n privateState.montlyExpenditure = value ? (value[\"montlyExpenditure\"] ? value[\"montlyExpenditure\"] : null) : null;\n privateState.noOfDependents = value ? (value[\"noOfDependents\"] ? value[\"noOfDependents\"] : null) : null;\n privateState.password = value ? (value[\"password\"] ? value[\"password\"] : null) : null;\n privateState.phone = value ? (value[\"phone\"] ? value[\"phone\"] : null) : null;\n privateState.signatureImage = value ? (value[\"signatureImage\"] ? value[\"signatureImage\"] : null) : null;\n privateState.spouseFirstName = value ? (value[\"spouseFirstName\"] ? value[\"spouseFirstName\"] : null) : null;\n privateState.spouseLastName = value ? (value[\"spouseLastName\"] ? value[\"spouseLastName\"] : null) : null;\n privateState.ssn = value ? (value[\"ssn\"] ? value[\"ssn\"] : null) : null;\n privateState.state = value ? (value[\"state\"] ? value[\"state\"] : null) : null;\n privateState.success = value ? (value[\"success\"] ? value[\"success\"] : null) : null;\n privateState.userEmploymentInfo = value ? (value[\"userEmploymentInfo\"] ? value[\"userEmploymentInfo\"] : null) : null;\n privateState.userFinancialInfo = value ? (value[\"userFinancialInfo\"] ? value[\"userFinancialInfo\"] : null) : null;\n privateState.userfirstname = value ? (value[\"userfirstname\"] ? value[\"userfirstname\"] : null) : null;\n privateState.userId = value ? (value[\"userId\"] ? value[\"userId\"] : null) : null;\n privateState.userlastname = value ? (value[\"userlastname\"] ? value[\"userlastname\"] : null) : null;\n privateState.userName = value ? (value[\"userName\"] ? value[\"userName\"] : null) : null;\n privateState.userPersonalInfo = value ? (value[\"userPersonalInfo\"] ? value[\"userPersonalInfo\"] : null) : null;\n privateState.userProducts = value ? (value[\"userProducts\"] ? value[\"userProducts\"] : null) : null;\n privateState.userSecurityQuestions = value ? (value[\"userSecurityQuestions\"] ? value[\"userSecurityQuestions\"] : null) : null;\n privateState.zipcode = value ? (value[\"zipcode\"] ? value[\"zipcode\"] : null) : null;\n };\n }", "title": "" }, { "docid": "495c0714090ac2cb068c9a10948db070", "score": "0.56166136", "text": "function addMasterUser(){\n\treturn postUser(config.masterUser);\t\n}", "title": "" }, { "docid": "45a3db6dae87601b3bf1517d46c92ae1", "score": "0.5611072", "text": "function initializeUserIfNeeded(uid) {\n \n}", "title": "" }, { "docid": "3335dc7ae3d9641a70e6dc140a348e8c", "score": "0.55848616", "text": "function User() {\n\tthis.current = \"emby.settings.current.user\";\t\n\tthis.users;\n}", "title": "" }, { "docid": "496f962c7b15295c3bb08cbf7fb6fd99", "score": "0.5578956", "text": "async getDemoBundle(nickname) {\n return chainBundler.createUserBundle(nickname);\n }", "title": "" }, { "docid": "d4bbe094257ab20ea02ef7237afd48cc", "score": "0.5578232", "text": "function generateUser() {\n\treturn {\n\t\tusername: generateUsername(),\n\t\tpassword: generatePassword(),\n\t\tnickname: generateNickname(),\n\t\teventsCreated: [],//generateEventsCreated(),\n\t\teventsRsvp: []//generateEventsRsvp()\n\t}\n}", "title": "" }, { "docid": "cb04281c18a7224c039a1cd2158840d1", "score": "0.5548022", "text": "function generateUser() {\n user = new User(users[Math.floor(Math.random() * users.length)]);\n findPantryInfo();\n showWelcomeBanner();\n}", "title": "" }, { "docid": "718f49536a134e3890fa7e3119ac8f6f", "score": "0.55411077", "text": "created() {\n // Create default users if not existed\n createDefaultUsersIfEmpty();\n }", "title": "" }, { "docid": "96ebde36c8ff6e930da5ae7a61accd23", "score": "0.5534409", "text": "function initializeUserIfNeeded (usr, pwd, email, phoneNumber) {\n var user = {}\n user.username = usr\n user.password = pwd\n var userID = genUID()\n user.sellerID = userID\n user.userID = userID\n user.email = email\n user.number = phoneNumber\n allUser[userID] = user\n // var items = getItemsBought[user.userID]\n // if (items === undefined) {\n // putItemsBought(userID, [])\n // }\n fs.writeFileSync('allUser.txt', JSON.stringify(allUser))\n console.log(allUser[userID].userID)\n console.log(allUser)\n return allUser[userID].userID\n}", "title": "" }, { "docid": "16db5143e06c2e3783c8636c6d27c4d7", "score": "0.55312836", "text": "function removeCurrentUser() {\n userService.removeUser();\n }", "title": "" }, { "docid": "9ac92a26cfa4cdcf4297cf33169035aa", "score": "0.55161285", "text": "constructor(user){\n \n }", "title": "" }, { "docid": "aec3fb5a234315f6d41652c7efc62c92", "score": "0.5503833", "text": "async __before() {\n\n //TODO 在其他地方修改用户时 更新用户session\n await this.debug();\n\n await this.unlogin();\n }", "title": "" }, { "docid": "d0c87cca95dce245360a1415398ee231", "score": "0.5493777", "text": "function initializeUser(callback) {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n var userRef = firebase.database().ref(\"users\").child(user.uid);\n\n var onUpdatesComplete = userRef.once(\"value\", function (snap) {\n let userData = snap.val();\n\n if (userData === null) {\n userData = {\n \"name\": user.displayName,\n \"email\": user.email,\n \"lifespan\": 50,\n \"experience\": 0\n }\n userRef.update(userData);\n }\n localStorage.setItem(\"name\", user.displayName);\n });\n\n onUpdatesComplete.then(callback);\n }\n });\n}", "title": "" }, { "docid": "17d6a0de01451c46d23e2a32682faec3", "score": "0.54726183", "text": "get UserName() {\n try {\n return this.gitConfig[\"user.name\"].toString();\n }\n catch (error) {\n return \"\";\n }\n }", "title": "" }, { "docid": "c78f49ec881478477e2f09b88314776f", "score": "0.5456732", "text": "function getUser() {\n return user;\n}", "title": "" }, { "docid": "cf26a56d403e55ce5c71e80a23c3dc8e", "score": "0.5450295", "text": "function SCAUser(defaultValues) {\n var privateState = {};\n context[\"field\"] = \"userId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"userId\"] : null);\n privateState.userId = defaultValues ? (defaultValues[\"userId\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"userId\"], context) : null) : null;\n context[\"field\"] = \"otp\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"otp\"] : null);\n privateState.otp = defaultValues ? (defaultValues[\"otp\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"otp\"], context) : null) : null;\n context[\"field\"] = \"password\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"password\"] : null);\n privateState.password = defaultValues ? (defaultValues[\"password\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"password\"], context) : null) : null;\n context[\"field\"] = \"context\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"context\"] : null);\n privateState.context = defaultValues ? (defaultValues[\"context\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"context\"], context) : null) : null;\n context[\"field\"] = \"deviceId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"deviceId\"] : null);\n privateState.deviceId = defaultValues ? (defaultValues[\"deviceId\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"deviceId\"], context) : null) : null;\n context[\"field\"] = \"error_message\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"error_message\"] : null);\n privateState.error_message = defaultValues ? (defaultValues[\"error_message\"] ? kony.mvc.util.ProcessorUtils.applyFunction(preProcessorCallback, defaultValues[\"error_message\"], context) : null) : null;\n //Using parent constructor to create other properties req. to kony sdk\n BaseModel.call(this);\n //Defining Getter/Setters\n Object.defineProperties(this, {\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 \"otp\": {\n get: function() {\n context[\"field\"] = \"otp\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"otp\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.otp, context);\n },\n set: function(val) {\n setterFunctions['otp'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"password\": {\n get: function() {\n context[\"field\"] = \"password\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"password\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.password, context);\n },\n set: function(val) {\n setterFunctions['password'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"context\": {\n get: function() {\n context[\"field\"] = \"context\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"context\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.context, context);\n },\n set: function(val) {\n setterFunctions['context'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"deviceId\": {\n get: function() {\n context[\"field\"] = \"deviceId\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"deviceId\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.deviceId, context);\n },\n set: function(val) {\n setterFunctions['deviceId'].call(this, val, privateState);\n },\n enumerable: true,\n },\n \"error_message\": {\n get: function() {\n context[\"field\"] = \"error_message\";\n context[\"metadata\"] = (objectMetadata ? objectMetadata[\"error_message\"] : null);\n return kony.mvc.util.ProcessorUtils.applyFunction(postProcessorCallback, privateState.error_message, context);\n },\n set: function(val) {\n setterFunctions['error_message'].call(this, val, privateState);\n },\n enumerable: true,\n },\n });\n //converts model object to json object.\n this.toJsonInternal = function() {\n return Object.assign({}, privateState);\n };\n //overwrites object state with provided json value in argument.\n this.fromJsonInternal = function(value) {\n privateState.userId = value ? (value[\"userId\"] ? value[\"userId\"] : null) : null;\n privateState.otp = value ? (value[\"otp\"] ? value[\"otp\"] : null) : null;\n privateState.password = value ? (value[\"password\"] ? value[\"password\"] : null) : null;\n privateState.context = value ? (value[\"context\"] ? value[\"context\"] : null) : null;\n privateState.deviceId = value ? (value[\"deviceId\"] ? value[\"deviceId\"] : null) : null;\n privateState.error_message = value ? (value[\"error_message\"] ? value[\"error_message\"] : null) : null;\n };\n }", "title": "" }, { "docid": "86ff47c990e3932f8a3ddc466af1ab99", "score": "0.5444732", "text": "function addToUserProps() {\n var userProperties = PropertiesService.getUserProperties();\n var clientProperties = {\n CLIENT_ID: CLIENT_ID,\n CLIENT_SECRET: CLIENT_SECRET\n }\n userProperties.setProperties(clientProperties,true); // true argument deletes all other properties in the store\n}", "title": "" }, { "docid": "1be07980dd8e97d289cb9b35b9aa1874", "score": "0.5443218", "text": "function addIggyUser(event) {\n mlog(\"Adding user to ignore\");\n var newUser = event.target.previousSibling.innerHTML;\n var val = GM_getValue(\"iggyUsers\");\n mlog(\"Setting iggyUsers to \" + val + \"\\n\" + newUser);\n GM_setValue(\"iggyUsers\", val + \"\\n\" + newUser);\n // Reload the page so that new settings will be applied.\n document.location.reload();\n}", "title": "" }, { "docid": "d3f546eac04a39e014d911495d4c4569", "score": "0.5440079", "text": "static setNamedUser(namedUser) {\n UrbanAirshipModule.setNamedUser(namedUser);\n }", "title": "" }, { "docid": "a41db87ba9554e5576d8dbac33f93143", "score": "0.543571", "text": "function setUserId() {\n userId = $('#user-dropdown').find('img.avatar').attr('data-user-id');\n if (!userId)\n showMessage('Please login to use Dodo.', null);\n}", "title": "" }, { "docid": "b4bf4bd4ca4de665d2dc4be411399701", "score": "0.5432695", "text": "beforeCreate(user) {\n // user.user_password = bcrypt.hashSync(user.dataValues.user_password); // eslint-disable-line no-param-reassign\n }", "title": "" }, { "docid": "61b929e4b2aab45c01a002b131e430a5", "score": "0.5429192", "text": "function init() {\n\n // initialize default admin user\n User.find({ role: \"admin\" }, function(err, data) {\n if (err) {\n console.log(\"Error when finding the default admin user\")\n } else {\n\n // create the default admin user\n if (data.length == 0) {\n User.createUser(new User({\n email: \"[email protected]\",\n password: \"admin123\",\n displayName: \"Admin\",\n role: \"admin\"\n }))\n }\n }\n })\n\n // initialize default university staff\n User.find({ role: \"user\" }, function(err, data) {\n if (err) {\n console.log(\"Error when finding the user\")\n } else {\n\n // create the default user\n if (data.length == 0) {\n User.createUser(new User({\n email: \"[email protected]\",\n password: \"ntuniubi\",\n displayName: \"Frank Lee\",\n role: \"user\"\n }))\n }\n }\n })\n}", "title": "" }, { "docid": "b343b9cb7745bdac523eaf147ea2488a", "score": "0.5427701", "text": "function initUserData() {\n // user browser supports in localStorage\n if (localStorage) {\n // Retrieve the users data.\n var userGenresAndTagsDataStr = localStorage.getItem(LOCAL_STORAGE_GENRES_AND_TAGS_KEY);\n if (isObjectDefined(userGenresAndTagsDataStr)) { // exist/old user\n var userGenresAndTagsDataObj;\n try {\n userGenresAndTagsDataObj = JSON.parse(userGenresAndTagsDataStr);\n if (isValidUserGenresAndTagsDataObj(userGenresAndTagsDataObj)) {\n $rootScope.userGenresMap = userGenresAndTagsDataObj.genres;\n $rootScope.userTagsMap = userGenresAndTagsDataObj.tags;\n return;\n } else {\n // thu user has the an old data structure of userData\n // as new user\n setNewUserGenresAndTagsData();\n }\n } catch (e) {\n console.error(\"Error: \" + e + \" | Unable to parse local storage data. value: \" + userGenresAndTagsDataStr);\n }\n\n } else { // new user\n setNewUserGenresAndTagsData();\n }\n\n } else { // no local storage\n setNewUserGenresAndTagsData();\n }\n\n }", "title": "" }, { "docid": "91ef42c744b65efb8cdfe2e19aceebfe", "score": "0.5426459", "text": "function addUser(){\n\t\t\tuserFactory.getFBCurrentUser()\n\t\t\t.then( (user) => {\n\t\t\t\tuserFactory.userIsInFirebase(user.uid)\n\t\t\t\t.then((isInFirebase) => {\n\t\t\t\t\tif(isInFirebase === false) {\n\t\t\t\t\t\tif($scope.displayName === \"\"){\n\t\t\t\t\t\t\tlet userObj = {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplayName: user.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tuid: user.uid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tphotoURL: user.photoURL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttoggleSettings: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiTunes: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBeatport: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHeadlinerMusicClub: true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tuserFactory.addUserToFirebase(userObj);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tlet userObj = {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplayName: $scope.displayName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tuid: user.uid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tphotoURL: user.photoURL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttoggleSettings: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tiTunes: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tBeatport: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHeadlinerMusicClub: true\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\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t\t\tuserFactory.addUserToFirebase(userObj);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//show home view\n\t\t\t\t\t$window.location.href = \"#!/\";\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "df49936e86b95800a2395398c75f441b", "score": "0.5420311", "text": "function _generateUsername(){\n var newUsername;\n\n if(!self.usernameExists(self.defaultUsername)){\n newUsername = self.defaultUsername;\n } else {\n var i = 2;\n while(self.usernameExists(self.defaultUsername + i)){\n i++;\n }\n newUsername = self.defaultUsername + i;\n }\n\n return newUsername;\n }", "title": "" }, { "docid": "f6cf30aa18a78a0f844a2848be370ce7", "score": "0.5409221", "text": "function createUserData() {\n\n\t// Saves data for application storage \n\tEcwidApp.setAppStorage(initialConfig.private, function (value) {\n\t\tconsole.log('Initial private user preferences saved!');\n\t});\n\n\t// Saves data for public app config\n\tEcwidApp.setAppPublicConfig(initialConfig.public, function (value) {\n\t\tconsole.log('Initial public user preferences saved!');\n\t});\n\n\t// Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n\tsetValuesForPage(initialConfig);\n\n\tselected();\n\tsetInfo();\n\tloadReq();\n\n\tdocument.querySelector(\"#body\").style.display = 'block';\n}", "title": "" }, { "docid": "cff03859a2a94082424a213cb44c7f16", "score": "0.54033756", "text": "init () {\n if (localStorage.users === undefined) {\n // Set default user\n users = {\n 'userName': '',\n 'password': '',\n 'displayName': ''\n }\n localStorage.users = JSON.stringify(users)\n localStorage.encrypted = true\n } else {\n users = JSON.parse(localStorage.users)\n }\n }", "title": "" }, { "docid": "79ee09a42ed9d21afeb4d979711d62d9", "score": "0.5397734", "text": "async saveUser () {\n\t\tthis.log('NOTE: Creating user under one-user-per-org paradigm');\n\t\tthis.userCreator = new UserCreator({\n\t\t\trequest: this,\n\t\t\tnrUserId: this.nrUserId,\n\t\t\texistingUser: this.user\n\t\t});\n\t\tthis.user = await this.userCreator.createUser(this.userData);\n\t}", "title": "" }, { "docid": "6a4bf589b722200810ce483a02930aab", "score": "0.5390111", "text": "static upgradeUser(req, res) {\n mentors.push(req.user);\n const data = req.user;\n responseHelper.successMessage(200, 'User account changed to mentor', data, res);\n // res.status(200).json({\n // status: 200,\n // message: 'User account changed to mentor',\n // data: req.user,\n // });\n }", "title": "" }, { "docid": "2ebc77b379f9b2690322497dd557a1f2", "score": "0.5386182", "text": "function showDefault() {\n console.log(\n emojiExclamation +\n \" no arguments provided using the default email and password \" +\n emojiExclamation\n );\n \n // ! Create a file by the name of Credentials.json inside Utils\n id = credential[\"id\"];\n pass = credential[\"pass\"];\n}", "title": "" }, { "docid": "6c70b7c8bb2f880c72673a1ab705ee9f", "score": "0.538421", "text": "'register.user'(user) {\n\n // If this is the first user going into the database, make them an admin\n if (Meteor.users.find().count() === 0) {\n \n }\n //creating user\n Accounts.createUser({username:user.username,email:user.email,password:user.password}, (err) => {\n return err.reason;\n });\n \n }", "title": "" }, { "docid": "1c224b026aa7d4448b6f0a8bcca6d851", "score": "0.53831065", "text": "function createUserList() {\n\n web.users.list(function (err, info) { // slack api, info returns a current user listing in json\n\n\n if (err) {\n console.log('web.users.list.error: ', err);\n return;\n }\n\n var nameById = {}; /** !! THIS IS NOT BEING USED ANYWHERE !! same as line: 37 !! */\n\n fs.writeFile(USER_ID_PATH, JSON.stringify(info), (err) => {\n if (err) {\n console.log('start.js:error writing user list: ' + err)\n }\n\n debug.log('User list created at ' + USER_ID_PATH);\n })\n\n\n\n }); // eof web.users.list\n\n} // eof createUserList", "title": "" }, { "docid": "fa99e6bfdeefdbfe8c7efea90d1ac3e9", "score": "0.5380004", "text": "function newServiceXUser(req, res) {\n\n}", "title": "" }, { "docid": "fcac65463705ad625fcb68a77b15c403", "score": "0.53744775", "text": "function generateUser() {\n return {\n firstName: faker.name.firstName(),\n lastName: faker.name.lastName(),\n email: faker.internet.email(),\n password: faker.internet.password(),\n pantry: faker.company.bsNoun()\n }\n}", "title": "" }, { "docid": "60efb581afbd5e9a6c58517c2cb7c983", "score": "0.5373373", "text": "updateUserConfig(props) {\n if (!props || Object.keys(props).length == 0)\n return;\n let { user } = this._configuration;\n let model = user.clone();\n Object.keys(props).forEach(key => {\n let val = props[key];\n if (val === undefined) {\n model.removeValue(key);\n }\n else if (is_1.objectLiteral(val)) {\n for (let k of Object.keys(val)) {\n model.setValue(`${key}.${k}`, val[k]);\n }\n }\n else {\n model.setValue(key, val);\n }\n });\n this.changeConfiguration(types_1.ConfigurationTarget.User, model);\n }", "title": "" }, { "docid": "af70c340bde4f76fb810cb00da76a090", "score": "0.5368383", "text": "onNewUser() {\n this.client.on('guildMemberAdd', (member) => {\n \tconst user = member.user;\n \tconst channel = member.guild.defaultChannel;\n \tif (!user.bot) {\n channel.send(`Welcome to the server, <@${user.id}>!`);\n \t}\n });\n\t}", "title": "" }, { "docid": "bbcd0b9abcff4774e314f2c6190fd5b1", "score": "0.53603643", "text": "function cacheCurrentUser() {\n currentUser = $.PercNavigationManager.getUserName();\n }", "title": "" }, { "docid": "b0ef73f7e935f3dec29f3e0d3c140dec", "score": "0.53532946", "text": "function setUserProfile() {\n if (activeUser() != false) {\n $(user_profile).setProfile(activeUser().get('last_name').charAt(0) == '#' ? sb_('Account') : activeUser().name);\n }\n }", "title": "" }, { "docid": "acc2dc3daaa96da4216bc46ab84d68f7", "score": "0.53527015", "text": "getUser() {\n const userInformation = this.user;\n this.user ={};\n return userInformation;\n }", "title": "" }, { "docid": "810f70575c867b17eabafbd60eeeef43", "score": "0.534808", "text": "function setUserId(client) {\n var url = client.upgradeReq.url;\n client.id = url.query['colyseusid'] || _1.generateId();\n if (!url.query['colyseusid']) {\n Protocol_1.send(client, [Protocol_1.Protocol.USER_ID, client.id]);\n }\n}", "title": "" }, { "docid": "398250d7a98cd9b9796ae6033541b78e", "score": "0.5346858", "text": "setUpUser() {\n function setUp() {\n console.log('this is first time opening app. setting up')\n store\n .update('user', {\n dateJoined: new Date(),\n touchID: false\n })\n .catch(error => {\n console.log('error: \\n\\n' + error)\n })\n }\n store.get('user')\n .then(result => {\n if (result.dateJoined) {\n console.log('user has already been set up')\n } else {\n setUp()\n }\n })\n .catch(error => {\n console.log('error: \\n\\n' + error)\n setUp()\n })\n }", "title": "" }, { "docid": "6bba2cfef30dd6b98c7868f57777f4a5", "score": "0.53418845", "text": "function createUser(user) {\n\t\tlocalStorage.removeItem(\"user\");\n\t\tlocalStorage.setItem(\"user\", JSON.stringify(user));\n\t}", "title": "" }, { "docid": "2f15b6644556532a89b580c570aeff3a", "score": "0.5336747", "text": "setAliasUser() {}", "title": "" }, { "docid": "a9377fb7483302a04a391e2c910620ca", "score": "0.5333887", "text": "setUser(state, user) {\n state.user.user = user || {};\n if (state.user.noUser == true) {\n state.user.noUser = false;\n }\n }", "title": "" }, { "docid": "18cceaadaa64fcb96be72a2019aaa8c6", "score": "0.5330305", "text": "function registerUser() {\r\n clearError()\r\n addUser() \r\n }", "title": "" }, { "docid": "0eca568c15776303cdde4d282229960a", "score": "0.5320814", "text": "async function setupData(){\n return await controller.user.createUser({_email:\"[email protected]\",_username:\"super\",_password:\"Super\",_role: \"Super\",_profileImage:\"/server/Utils/Download\",_inChannel:[],_inGroup:[]})\n}", "title": "" }, { "docid": "569c4b7dabaf0655cab426d9c034462b", "score": "0.53204536", "text": "_registerUser() {\n }", "title": "" }, { "docid": "9ca134f63cf5e22e013d6c25380841c5", "score": "0.53109676", "text": "function constructDefaultUserPreference() {\n\n\tvar preferenceArray = new Object();\n\n\tfor(map in MAPPING) {\t\n\t\tpreferenceArray[MAPPING[map][0]] = MAPPING[map][1];\n\t}\n\treturn preferenceArray;\n}", "title": "" }, { "docid": "fdf9a3b1f52d89ecdd66347a1c101716", "score": "0.5294035", "text": "function initUserList() {\n var thisUser = W.loginManager.getLoggedInUser();\n var selectUser = getId(highlightEditor.getSelectId());\n var usrOption = document.createElement('option');\n var usrText = document.createTextNode(thisUser.userName + \" (\" + thisUser.rank + \")\");\n usrOption.setAttribute('value', thisUser.id);\n usrOption.appendChild(usrText);\n selectUser.appendChild(usrOption);\n}", "title": "" }, { "docid": "e139627e836410a5412d246d09f2bfe5", "score": "0.5286311", "text": "function loadUserData( data ) {\n _users = data;\n}", "title": "" }, { "docid": "d92bbac827a013724188db37a8957b87", "score": "0.5286019", "text": "prefillJohnUser() {\n this.usernameTarget.value = 'french_user'\n this.passwordTarget.value = 'kitten'\n }", "title": "" }, { "docid": "bbad3f928e5fdabe16ac640a7ba78ea7", "score": "0.52851427", "text": "function populate_default_roles() {\n db = db.getSiblingDB(\"argo_core\");\n print(\"INFO\\tOpened argo_core db\");\n db.roles.insert([\n {\n resource: \"topology_tags.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"topology_stats.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"latest.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"reports.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"reports.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"reports.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"reports.delete\", roles: [\"admin\", \"editor\"] },\n { resource: \"reports.update\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"metricProfiles.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"metricProfiles.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"metricProfiles.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"metricProfiles.delete\", roles: [\"admin\", \"editor\"] },\n { resource: \"metricProfiles.update\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"operationsProfiles.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"operationsProfiles.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"operationsProfiles.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"operationsProfiles.delete\", roles: [\"admin\", \"editor\"] },\n { resource: \"operationsProfiles.update\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"aggregationProfiles.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"aggregationProfiles.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"aggregationProfiles.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"aggregationProfiles.delete\", roles: [\"admin\", \"editor\"] },\n { resource: \"aggregationProfiles.update\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"thresholdsProfiles.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"thresholdsProfiles.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"thresholdsProfiles.update\", roles: [\"admin\", \"editor\"] },\n { resource: \"thresholdsProfiles.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"thresholdsProfiles.delete\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"weights.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"weights.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"weights.create\", roles: [\"admin\", \"editor\"] },\n { resource: \"weights.delete\", roles: [\"admin\", \"editor\"] },\n { resource: \"weights.update\", roles: [\"admin\", \"editor\"] },\n {\n resource: \"results.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"results.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"status.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"status.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"factors.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n { resource: \"tenants.get\", roles: [\"super_admin\"] },\n {\n resource: \"tenants.list\",\n roles: [\"super_admin\", \"super_admin_restricted\", \"super_admin_ui\"]\n },\n { resource: \"tenants.create\", roles: [\"super_admin\"] },\n { resource: \"tenants.delete\", roles: [\"super_admin\"] },\n { resource: \"tenants.update\", roles: [\"super_admin\"] },\n {\n resource: \"tenants.user_by_id\",\n roles: [\"super_admin\", \"super_admin_restricted\", \"super_admin_ui\"]\n },\n {\n resource: \"tenants.get_status\",\n roles: [\"super_admin\", \"super_admin_restricted\", \"super_admin_ui\"]\n },\n { resource: \"tenants.update_status\", roles: [\"super_admin\"] },\n { resource: \"tenants.create_user\", roles: [\"super_admin\"] },\n { resource: \"tenants.update_user\", roles: [\"super_admin\"] },\n { resource: \"tenants.user_refresh_token\", roles: [\"super_admin\"] },\n { resource: \"tenants.delete_user\", roles: [\"super_admin\"] },\n { resource: \"tenants.list_users\", roles: [\"super_admin\"] },\n { resource: \"tenants.get_user\", roles: [\"super_admin\"] },\n {\n resource: \"metricResult.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"recomputations.list\",\n roles: [\"admin\", \"editor\", \"admin_ui\"]\n },\n {\n resource: \"recomputations.get\",\n roles: [\"admin\", \"editor\", \"admin_ui\"]\n },\n {\n resource: \"recomputations.submit\",\n roles: [\"admin\", \"editor\", \"admin_ui\"]\n },\n {\n resource: \"recomputations.delete\",\n roles: [\"admin\", \"editor\", \"admin_ui\"]\n },\n {\n resource: \"recomputations.update\",\n roles: [\"admin\", \"editor\", \"admin_ui\"]\n },\n {\n resource: \"topology_endpoints.insert\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_endpoints.list\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_endpoints.delete\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_groups.insert\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_groups.list\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_groups.delete\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_groups_report.list\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_service_types.insert\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_service_types.list\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"topology_service_types.delete\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"feeds.topo.list\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"feeds.topo.update\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"issues.list_endpoints\",\n roles: [\"admin\", \"editor\", \"viewer\"]\n },\n {\n resource: \"issues.list_group_metrics\",\n roles: [\"admin\", \"editor\", \"viewer\"]\n },\n {\n resource: \"downtimes.list\",\n roles: [\"admin\", \"editor\", \"viewer\"]\n },\n {\n resource: \"downtimes.delete\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"downtimes.create\",\n roles: [\"admin\", \"editor\"]\n },\n {\n resource: \"trends.flapping_metrics\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.flapping_metrics_tags\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.flapping_endpoints\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.flapping_services\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.flapping_endpoint_groups\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.status_metrics\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.status_metrics_tags\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.status_endpoints\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.status_services\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"trends.status_endpoint_groups\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"metrics.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"metrics_report.get\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"metrics_admin.get\",\n roles: [\"super_admin\"]\n },\n {\n resource: \"metrics_admin.update\",\n roles: [\"super_admin\"]\n },\n {\n resource: \"v3.ar.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"v3.status.list\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n },\n {\n resource: \"v3.status.list-by-id\",\n roles: [\"admin\", \"editor\", \"viewer\", \"admin_ui\"]\n }\n ]);\n print(\"INFO\\tPolulated default roles in 'roles' collection\");\n}", "title": "" }, { "docid": "4484584fe801b227cfa94f608d03630c", "score": "0.5278313", "text": "function initUsers() {\n\n // Stop if data is already initialised.\n if(localStorage.getItem(USERS_KEY) !== null)\n return;\n\n // User data is hard-coded, passwords are in plain-text.\n const users = [];\n\n // Set data into local storage.\n localStorage.setItem(USERS_KEY, JSON.stringify(users));\n}", "title": "" }, { "docid": "2f39814d9e8eb23cffa9fb1eaa6ae74a", "score": "0.5277487", "text": "function getLoggedUser() {\r\n\treturn LOGGED_USER;\r\n}", "title": "" }, { "docid": "9e4e463faa4c0a9e7f2511e122c03257", "score": "0.5276345", "text": "makeUserData (callback) {\n\t\t// add dontSendEmail flag\n\t\tthis.noLastInviteType = this.noFirstInviteType = true;\n\t\tsuper.makeUserData(() => {\n\t\t\tthis.data.dontSendEmail = true;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "c18cbac4e86fa1f19a0e2a2fe0e54dbc", "score": "0.52745277", "text": "function setUsername() {\n\t\tusername = \"nobody\";\n\t\tg_socket.emit('add user', username);\n\t}", "title": "" }, { "docid": "c99380d658b4217d6a26c5c48fd84312", "score": "0.5272509", "text": "before (callback) {\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\t// in order to simulate user data coming from another server, we'll use the existing\n\t\t\t// \"current\" user, but change email to a random email, this should create a user with\n\t\t\t// the same user data, but with the randomly created email\n\t\t\tthis.data = { user: this.userFactory.getRandomUserData() };\n\t\t\tthis.data.user.searchableEmail = this.data.user.email.toLowerCase();\n\t\t\tthis.apiRequestOptions = {\n\t\t\t\theaders: {\n\t\t\t\t\t'X-CS-Auth-Secret': this.apiConfig.environmentGroupSecrets.requestAuth\n\t\t\t\t}\n\t\t\t};\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "f3cdc3cf560347781042c5712d43b36b", "score": "0.5268841", "text": "function createUser() {\n // check if user already exists \n User.filter({username: 'kenkang'}).run().then(function(result) {\n // if the user doesn't exist, save the default user\n if (result.length <= 0) {\n User.save([\n {firstName: \"Ken\", lastName: \"Kang\", username:\"kenkang\", password: createHash(\"bloomsky\")}\n ]).then(function(result) {\n console.log(\"RESULT\", result);\n }).error(function(error) {\n throw error; \n });\n }\n });\n}", "title": "" }, { "docid": "6d5d3aeb5ed4cb36e24a281cc22dc5b5", "score": "0.5262239", "text": "createUserQuery() {\n return models.User.create({ Id: null, kolonialUserId: null });\n }", "title": "" }, { "docid": "f8ef6e17c15fa1b131d360fda20befc5", "score": "0.52608895", "text": "loadUserByID() {\n return {id:-1};\n }", "title": "" }, { "docid": "d09aa940d06ba0ef94bccc3920c7407e", "score": "0.5259574", "text": "function createUser(name, password) {\n\n let USER = {\n id: users.length+1,\n name: name,\n password: password,\n notifications: [],\n achievements: [],\n imagePath: null,\n theme: 4\n }\n\n //setStorage(name + \"/\" + password, USER);\n users.push(USER);\n\n saveUserChanges();\n\n return USER;\n\n}", "title": "" }, { "docid": "266bb7cd98743df05df09935261a2c62", "score": "0.5257235", "text": "async function insertDefaultUser() {\n\n var users = await Human.find({})\n\n if (users.length) {\n console.log('found default user %o', users[0])\n return\n }\n\n\n var user = new Human({ name: 'Ben' })\n try {\n await user.save()\n } catch(err) {\n console.error('Error saving default user', err)\n }\n\n}", "title": "" }, { "docid": "cc6d38f3d93643f3affac155f907cf28", "score": "0.5256265", "text": "function initUser(){\n\tccInit();\n\tcheckList();\n\tindex();\n}", "title": "" }, { "docid": "75eba1db43e533d9656e5938759db103", "score": "0.52534115", "text": "function addUsers(database) {\n\tdatabase.addUser(\n\t\t{\n\t\t\tuser: db_admin_user,\n\t\t\tpwd: db_admin_pass,\n\t\t\troles: [ \"readWrite\", \"dbAdmin\" ]\n\t\t}\n\t);\n\n\tif (paas_env == \"prod\") {\n\t\tdatabase.user.insert({\"email\" : \"[email protected]\", \"fName\" : \"Pearson\", \"lName\" : \"admin\", \"name\" : \"pearsonadmin\", \"password\" : \"3f91c8f43e2e09cae33380ed856bf6cd\", \"roleValue\" : \"pearson-admin\", \"thumbnail\" : \"\", \"uid\" : \"padmin\", \"username\" : \"padmin\" });\n }\n\telse\n\t{\n\t\tdatabase.user.insert({\"email\" : \"[email protected]\", \"fName\" : \"Pearson\", \"lName\" : \"admin\", \"name\" : \"pearsonadmin\", \"password\" : \"0b230f462ea6a6b7b14590479a40398e\", \"roleValue\" : \"pearson-admin\", \"thumbnail\" : \"\", \"uid\" : \"padmin\", \"username\" : \"padmin\" });\n\t}\n\n\n//\tdatabase.addUser(\n//\t\t{\n//\t\t\tuser: rw_user,\n//\t\t\tpwd: rw_pass,\n//\t\t\troles: [\"readWrite\"]\n//\t\t}\n//\t);\n\n//\tdatabase.addUser(\n//\t\t{\n//\t\t\tuser: ro_user,\n//\t\t\tpwd: ro_pass,\n//\t\t\troles: [\"read\"]\n//\t\t}\n//\t);\n}", "title": "" }, { "docid": "cef8c2bb7e302dd368b3d898a0ee37af", "score": "0.52478534", "text": "static destination (user) {\n return { main: 'main', public: 'public', user: user.username }\n }", "title": "" }, { "docid": "346342bb2f11272e6697952bedcb5752", "score": "0.5239272", "text": "_updateLoginKey(user) {\n let userStore = this.userStore\n let newLoginKey = uuid()\n return userStore.updateUser(user.userId, {loginKey: newLoginKey})\n }", "title": "" }, { "docid": "c7ac5c17b54562edb70146a468260c63", "score": "0.5235687", "text": "async function resetDefaultAllData() {\n /** set user all redis */\n // get all user\n const usersDB = await User.find().select('-__v')\n await setAsync(`test_users`, JSON.stringify(usersDB))\n}", "title": "" }, { "docid": "b07060df94d09517a69c74c40f3b95e3", "score": "0.5232295", "text": "function addUser(user) {\n fileService.writeFileContents(\"../data/users.json\", user);\n}", "title": "" }, { "docid": "d97cb6b918de433ac07947b0f10f77be", "score": "0.52311796", "text": "_setCurrentUserData() {\n // do nothing as passed as params\n }", "title": "" }, { "docid": "62db950c363201179967a02cb86b7e8b", "score": "0.52300954", "text": "async function setDefaultAllData() {\n /** set user all redis */\n // get all user\n const usersDB = await User.find().select('-__v')\n // check if user all redis exist\n const usersRedisExist = await getAsync(`test_users`)\n if(!usersRedisExist) await setAsync(`test_users`, JSON.stringify(usersDB))\n}", "title": "" }, { "docid": "44e93bf49144f4382aa05462554197fa", "score": "0.522743", "text": "get TOPIC_USER_AUTHENTICATION() { return \"firefm-user-authentication\"; }", "title": "" } ]
e4967389f81fb4009f8d28e338f9047d
Assumes there is no parent namespace.
[ { "docid": "16c685ff344287192f7d6cef65d13682", "score": "0.0", "text": "function getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n case 'math':\n return MATH_NAMESPACE;\n default:\n return HTML_NAMESPACE;\n }\n}", "title": "" } ]
[ { "docid": "79b334d199cd3fdeada0661a79242fea", "score": "0.61212903", "text": "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "title": "" }, { "docid": "79b334d199cd3fdeada0661a79242fea", "score": "0.61212903", "text": "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "title": "" }, { "docid": "79b334d199cd3fdeada0661a79242fea", "score": "0.61212903", "text": "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "title": "" }, { "docid": "79b334d199cd3fdeada0661a79242fea", "score": "0.61212903", "text": "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "title": "" }, { "docid": "eeb95dae19a13e2b42b5ccf03c4483d9", "score": "0.60360384", "text": "function namespace(namespaceString, parent) {\r\n\t\tvar parts = namespaceString.split('.'), currentPart = '';\r\n\t\tif (!parent) {\r\n\t\t\tparent = window;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0, length = parts.length; i < length; i++) {\r\n\t\t\tcurrentPart = parts[i];\r\n\t\t\tparent[currentPart] = parent[currentPart] || {};\r\n\t\t\tparent = parent[currentPart];\r\n\t\t}\r\n\r\n\t\treturn parent;\r\n\t}", "title": "" }, { "docid": "b996997e214817d01b90842c26ca2e44", "score": "0.5881028", "text": "function getParentObject(){\n var obj = parent;\n if (namespace !== \"\") {\n for (var i = 0, ii = namespace.split(\".\"); i < ii.length; i++) {\n obj = obj[ii[i]];\n }\n }\n return obj.easyXDM;\n}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5838255", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5838255", "text": "function Parent() {}", "title": "" }, { "docid": "b81105025ff35462e9477bded56cad38", "score": "0.5813173", "text": "function findNamespaceOfIdentifier(id) {\n return id.parent && ts.isPropertyAccessExpression(id.parent) &&\n ts.isIdentifier(id.parent.expression) ?\n id.parent.expression :\n null;\n }", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.5788852", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.5788852", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "1278b1e8e7ee395bb12832a98ba7f4d9", "score": "0.5788852", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "f3308d8895be52a3093bcac48dc799f2", "score": "0.57438385", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "f3308d8895be52a3093bcac48dc799f2", "score": "0.57438385", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}", "title": "" }, { "docid": "93a4cb6d6229042e3b3518051905fbd7", "score": "0.5684691", "text": "function parent() { return exports.get( variable.resolveProperty( functions.fwd( exports.get, arguments ), exports.Property.Get.Parent ) ) }", "title": "" }, { "docid": "a537176d16529180611ad12db412ab7e", "score": "0.5672336", "text": "function _parentWins(parent, parentPath, subschema, vocab, keyword) {\n // Nothing to see here...\n}", "title": "" }, { "docid": "e96887cb13edb31f418c1a9b09c0403b", "score": "0.56103796", "text": "function namespace(namespace, root) {\n\t\tvar parts = namespace.split('.'), current = root || window;\n\t\tif(!(parts[0] in window)) {\n\t\t\twindow[parts[0]] = {};\n\t\t}\n\t\tfor(var part; parts.length && ( part = parts.shift()); ) {\n\t\t\tif(!current[part]) {\n\t\t\t\tcurrent[part] = {};\n\t\t\t}\n\n\t\t\tcurrent[part].$parentModule || (current[part].$parentModule = current);\n\t\t\tcurrent = current[part];\n\t\t\tcurrent.$moduleName = part;\n\t\t}\n\t\treturn current;\n\t}", "title": "" }, { "docid": "c674417555eede98b336d85fb0cdc917", "score": "0.56087595", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.5529733", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c315f3b4f6ef8196eeac6c3305c6e419", "score": "0.5529733", "text": "function interiorNamespace(element){\n if (\n element &&\n element.namespaceURI === svgNamespace &&\n !svgHTMLIntegrationPoints[element.tagName]\n ) {\n return svgNamespace;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "1f25e9433908be3c076847a655f79c8e", "score": "0.55199105", "text": "function ParentWithStatic() {}", "title": "" }, { "docid": "06f91076654b48f4243abebb4f1edef7", "score": "0.5477558", "text": "arrangeNamespaces() {\n this.namespaces = [];\n let multisig = this.formData.multisigAccount.account.address;\n if(undefined !== this._DataStore.namespace.ownedBy[multisig]) {\n let namesArray = Object.keys(this._DataStore.namespace.ownedBy[multisig]);\n for (let k=0; k < namesArray.length; k++) {\n let namespace = this._DataStore.namespace.ownedBy[multisig][namesArray[k]].fqn;\n this.namespaces.push(namespace);\n }\n }\n //Filters Root Namespaces\n this.namespaces = this.namespaces.filter(namespace => !namespace.includes(\".\"));\n this.calculateFee();\n }", "title": "" }, { "docid": "230e28f87f52cc64f126e8ef90f60673", "score": "0.5460035", "text": "function path_parent() { return exports.location( functions.fwd( exports.parent, arguments ) ) }", "title": "" }, { "docid": "645c7535bab395a5c5b99c6d1538cf0f", "score": "0.5410278", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n }", "title": "" }, { "docid": "645c7535bab395a5c5b99c6d1538cf0f", "score": "0.5410278", "text": "function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n }", "title": "" }, { "docid": "937ace2f0ad747712389127b80229f9a", "score": "0.5408864", "text": "get NAMESPACE() {\n return NAMESPACE;\n }", "title": "" }, { "docid": "5ed2b1739de3f6132a1fbc5d8eae56b5", "score": "0.5397606", "text": "function ensureNamespace(namespace){\n var current = exports;\n namespace.split('.').forEach(function(name){\n if(typeof current[name] === 'undefined'){\n current[name] = {};\n }\n current = current[name];\n });\n }", "title": "" }, { "docid": "8f2b7ee2000409654792c401f483a7c6", "score": "0.53785473", "text": "arrangeNamespaces() {\n //Get Normal Namespaces\n if (!this._DataStore.namespace.ownedBy.hasOwnProperty(this._Wallet.currentAccount.address)) {\n this.skipNamespaces = true;\n return;\n }\n this.namespaces = [];\n const namespaces = Object.keys(this._DataStore.namespace.ownedBy[this._Wallet.currentAccount.address]);\n //Filters Root Namespaces\n this.namespaces = namespaces.filter(namespace => !namespace.includes(\".\"));\n this.skipNamespaces = this.namespaces.length === 0;\n this.namespaces.forEach(namespace => {\n this.includedNamespaces[namespace] = true;\n });\n //this.calculateFee();\n }", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.5320064", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.5320064", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.5320064", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.5320064", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "5cb9a6dd046c2faf5a604354c812f353", "score": "0.5320064", "text": "function getClassNamespace() {\n return NS;\n}", "title": "" }, { "docid": "7409619ec30343f13aeee23b1b5b3728", "score": "0.53075397", "text": "use(...levels) {\n\n if (levels.length <= 0)\n return window;\n\n _filter(...levels);\n\n let offset = levels.length;\n let namespace = null;\n if (levels.length > 0\n && typeof levels[0] === \"object\")\n namespace = levels.shift();\n offset -= levels.length;\n\n levels = levels.join(\".\");\n levels.split(Namespace.PATTERN_NAMESPACE_SEPARATOR).forEach((level, index, array) => {\n\n const pattern = index === 0 && namespace === null\n ? Namespace.PATTERN_NAMESPACE_LEVEL_START : Namespace.PATTERN_NAMESPACE_LEVEL;\n if (!level.match(pattern))\n throw new Error(`Invalid namespace at level ${index +1}${level && level.trim() ? \": \" + level.trim() : \"\"}`);\n\n // Composites use IDs which causes corresponding DOM objects\n // (Element) in the global namespace if there are no\n // corresponding data objects (models). Because namespaces are\n // based on data objects, if an element appears, we assume that\n // a data object does not exist and the recursive search is\n // aborted as unsuccessful.\n\n if (index === 0\n && namespace === null) {\n namespace = _populate(namespace, level);\n if (namespace !== undefined\n && !(namespace instanceof Element))\n return;\n namespace = window;\n }\n\n const item = _populate(namespace, level);\n const type = typeof item;\n if (type !== \"undefined\"\n && type !== \"object\")\n throw new TypeError(`Invalid namespace type at level ${index +1 +offset}: ${type}`);\n if (item === undefined\n || item === null\n || item instanceof Element)\n if (index < array.length -1\n && array[index +1].match(/^\\d+$/))\n namespace[level] = [];\n else namespace[level] = {};\n namespace = _populate(namespace, level);\n });\n\n return namespace;\n }", "title": "" }, { "docid": "f1547a07196d06f8f8e345e711aeeb61", "score": "0.5304122", "text": "function SmalltalkRoot() {}", "title": "" }, { "docid": "83e06776cfab62446c4321495af155eb", "score": "0.5301978", "text": "function fooNS() {\n return this;\n}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5295859", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "9cbc0b23eaeb23d6251de59705639a18", "score": "0.5295859", "text": "GetComponentsInParent() {}", "title": "" }, { "docid": "c632f7d41fdff1b197058ab937b99f46", "score": "0.5292263", "text": "function ensureNS(ns) {\n var nsAr = ns.split(\".\"),\n nsSoFar = \"\";\n\n for (var Nix in nsAr) {\n nsSoFar = nsSoFar + (Nix > 0 ? \".\" : \"\") + nsAr[Nix];\n eval (nsSoFar + \" = \" + nsSoFar + \" || {};\");\n }\n}", "title": "" }, { "docid": "7c57eb032dd875a07006ec800e377c08", "score": "0.5269832", "text": "function NamespaceBuilder(nsFullPath, nsChild) {\n var nsNode = nsFullPath.split('.')\n , usesRoot = (nsNode[0] === nsRootName)\n , isGlobal = (nsNode[0] === 'window')\n , isParent = (isGlobal && nsNode[1] === 'parent') || (nsNode[0] === 'parent')\n , node = (usesRoot) ? rootObj : (isParent) ? window.parent : (isGlobal) ? window : nsChild;\n\n var i = (isGlobal && isParent) ? 2 : (usesRoot || isParent) ? 1 : 0; \n\n for (var len = nsNode.length; i < len; i++) {\n var _node = nsNode[i];\n if(!_node) break;\n node = ( node[_node] = node[_node] || {} );\n if(typeof node !== 'object') break;\n if(!node.namespace) node.namespace = runNamespace;\n }\n\n return node;\n }", "title": "" }, { "docid": "e6b27390d8a4b89b3fb25e362bd3ef49", "score": "0.52696157", "text": "get parent() {return this._parent();}", "title": "" }, { "docid": "e6b27390d8a4b89b3fb25e362bd3ef49", "score": "0.52696157", "text": "get parent() {return this._parent();}", "title": "" }, { "docid": "92b037ebbedfcf3b38c7ff8505ad0555", "score": "0.5269091", "text": "function getNamespace(name, id){\n\tlet scope = Space.list[name] ??= {_waiting:[]};\n\n\tif(!(id in scope)){\n\t\tlet ref = scope.default;\n\t\tif(ref === void 0){\n\t\t\tref = scope.default = createRoot_({}, 'default', scope);\n\n\t\t\tif(id === 'default')\n\t\t\t\treturn ref;\n\t\t}\n\n\t\tscope[id] = createRoot_(ref.registered, id, scope);\n\t}\n\n\treturn scope[id];\n}", "title": "" }, { "docid": "c166ada75a0c4bf3fb90008003f81146", "score": "0.52625525", "text": "requireParent() : string {\n return 'SCServer';\n }", "title": "" }, { "docid": "5585249b06bb0115a8bf3ff8735cc553", "score": "0.5261048", "text": "get namespace() {\n return this.getStringAttribute('namespace');\n }", "title": "" }, { "docid": "562575bfbbb6d42765f07d6086562844", "score": "0.52591944", "text": "get ATTRIBUTE_NAMESPACE() {return \"namespace\";}", "title": "" }, { "docid": "56cdc6125c1f9042f73caa72e0f1de53", "score": "0.5229376", "text": "checkNamespaceIsOwned() {\n let namespaceToRemove = this.formData.namespaceRemoved;\n if (this.namespaces.includes(namespaceToRemove) ) return true;\n return false;\n }", "title": "" }, { "docid": "6d25cc1b369a77d547f8aae792ca66b0", "score": "0.5227447", "text": "parent(v){if(this.#isCompound){var parent=this.#parent[v];if(parent!==GRAPH_NODE){return parent}}}", "title": "" }, { "docid": "312064f6c7e00ca90a40c47a69b01e89", "score": "0.519048", "text": "function ICNamespace(ns, definition) {\n\n // Split the namespace around dots.\n ns = ns.split(\".\");\n\n // Get the root namespace from global scope and assign this to the topNS\n var topNS;\n var nsStack = ns[0];\n eval(\"if (typeof \" + ns[0] + \" == 'undefined') \" + ns[0] + \" = { _namespace: '\" + nsStack + \"' };\");\n eval(\"topNS = \" + ns[0]);\n\n // If there were more than one namespace level, start navigating the hierarchy from\n // the current top onwards.\n for (var i = 1; i < ns.length; i++) {\n nsStack += \".\" + ns[i];\n if (typeof topNS[ns[i]] == 'undefined')\n topNS[ns[i]] = { _namespace: nsStack };\n\n topNS = topNS[ns[i]];\n }\n\n // If there was a namespace definition, copy its contents to the topNS object.\n if (definition) {\n\n // If the definition is a function, use its return value as the real definition.\n if (typeof definition == 'function')\n definition = definition(topNS);\n\n // Declare a recursive utility method that adds the definition to the\n // current NS.\n var addObjectToNS = function(nsObj, defObj, nsStack) {\n\n for (var memberName in defObj) {\n var member = defObj[memberName];\n var currentNsStack = nsStack + \".\" + memberName;\n\n if (typeof member == 'object' && member.constructor != Array) {\n // The current member is an object so we'll add stuff recursively which\n // lets us set the _namespace field.\n\n if (typeof(nsObj[memberName]) != 'object')\n nsObj[memberName] = { _namespace: currentNsStack };\n\n addObjectToNS(nsObj[memberName], member, currentNsStack)\n } else {\n // If the member isn't an object or no one has referenced the \n // namespace we can safely just assign a new reference. \n nsObj[memberName] = member;\n }\n }\n }\n\n addObjectToNS(topNS, definition, nsStack);\n\n // If there is an initialize method, execute it.\n if (definition['initialize'])\n definition['initialize'](topNS);\n }\n\n return topNS;\n}", "title": "" }, { "docid": "58af9dda596a6093681fdba54a254a4d", "score": "0.51842356", "text": "function containsNamespace(e,a){for(var i=e.split(/[ ,]+/),n=String(a).toLowerCase(),t=0;t<i.length;t++){var o=i[t];if(o&&(\"*\"===o||o.toLowerCase()===n))return!0}return!1}", "title": "" }, { "docid": "8f71a520384091fed441ca7f4716122b", "score": "0.5181028", "text": "parentFunction(){\n return \"This is coming from the parent!\";\n }", "title": "" }, { "docid": "a84d908323d34df8fbe151b99c30e829", "score": "0.5172764", "text": "constructor(parentApp) {\n this.svgns = \"http://www.w3.org/2000/svg\";\n //this.parentApp = parentApp;\n }", "title": "" }, { "docid": "a32ba68c62250e5a034e7ea97c4b0edb", "score": "0.5149667", "text": "function _resyncParent() {\n if (this.parentPath) {\n this.parent = this.parentPath.node;\n }\n}", "title": "" }, { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.51457524", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "8edb169637677e7429a6c46b07cac352", "score": "0.51389563", "text": "function readOutputNamespacesFromNamespaceAwareDocument (oDocument) { \n\t oDocument = oDocument || document;\n\t\tvar nsList = oDocument.namespaces;\n\t\tfor(var i = 0; i < nsList.length; ++i) {\n\t\t\tthis.addOutputNamespace(nsList[i].name, nsList[i].urn); \t\t\n\t\t}\n\t}", "title": "" }, { "docid": "8ce2c992a667ffd34918ca3e299192e4", "score": "0.5137835", "text": "visitPackageOrTypeName(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "d21ee9e31d5634bae5422a5c5405704d", "score": "0.5102793", "text": "function _getOuterContainerOrSelf(node) {\n\t var view = node.view;\n\t while (_isNgContainer(node.parent, view)) {\n\t node = node.parent;\n\t }\n\t return node;\n\t }", "title": "" }, { "docid": "10cedd7b0f4ca803ad91b1baa259d4e0", "score": "0.5081589", "text": "function registerNameSpace(ns){\n var nsParts = ns.split(\".\");\n var root = window;\n var n = nsParts.length;\n \n for (var i = 0; i < n; i++) {\n if (typeof root[nsParts[i]] == \"undefined\") \n root[nsParts[i]] = new Object();\n \n root = root[nsParts[i]];\n }\n}", "title": "" }, { "docid": "2e0b6ef43e123c06be8904a7d7dee65e", "score": "0.50749063", "text": "requireParent(): string {\n return 'SCServer';\n }", "title": "" }, { "docid": "7b81482432e65409e474bafb2372e8ff", "score": "0.5062408", "text": "constructor(namespace) {\n this.namespace = namespace;\n }", "title": "" }, { "docid": "4e16f11ce0cb8a4dc13afa2f8cf2517f", "score": "0.5049489", "text": "getDefaultNamespaceName() {\n if (isObject(this) && this.constructor && this !== this.window) {\n var arr = this.constructor.toString().match(/function\\s*(\\w+)/);\n if (arr && arr.length === 2) {\n return arr[1];\n }\n }\n return \"GenericNamespace\";\n }", "title": "" }, { "docid": "f46a2e60c71cf0a73d33b691fadf4e98", "score": "0.5025219", "text": "function isHtmlNamespace(node) {\n var ns;\n return _typeof(node.namespaceURI) == UNDEF || (ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\";\n }", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.5022544", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "57922e5944dfde9161fed4e8f2ccc1d7", "score": "0.5022544", "text": "GetComponentInParent() {}", "title": "" }, { "docid": "2664ab25132c576de5de247856a464d5", "score": "0.5022021", "text": "parentFunction(){\n console.log(\"printing this from parent!\");\n }", "title": "" }, { "docid": "3ac32ba346e84541ee0fd4443ec765a6", "score": "0.50200653", "text": "function f(a){return\"_nativeNode\"in a?void 0:\"production\"!==c.env.NODE_ENV?i(!1,\"getParentInstance: Invalid argument.\"):i(!1),a._nativeParent}", "title": "" }, { "docid": "64c660195b7c2a62368c39606a889d98", "score": "0.5017396", "text": "function e(a,b){\"_nativeNode\"in a?void 0:\"production\"!==c.env.NODE_ENV?i(!1,\"isAncestor: Invalid argument.\"):i(!1),\"_nativeNode\"in b?void 0:\"production\"!==c.env.NODE_ENV?i(!1,\"isAncestor: Invalid argument.\"):i(!1);for(;b;){if(b===a)return!0;b=b._nativeParent}return!1}", "title": "" }, { "docid": "169123f5eaa339c8ea0d9790d17c13c3", "score": "0.50155526", "text": "get parent() { return this.$from.node(this.depth) }", "title": "" }, { "docid": "d6a8770281cf054ce896095d6bf071d9", "score": "0.5012306", "text": "function getExportNode(parent, node) {\n var declaration = ts.isVariableDeclaration(parent) ? parent : ts.isBindingElement(parent) ? ts.walkUpBindingElementsAndPatterns(parent) : undefined;\n if (declaration) {\n return parent.name !== node ? undefined :\n ts.isCatchClause(declaration.parent) ? undefined : ts.isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : undefined;\n }\n else {\n return parent;\n }\n }", "title": "" }, { "docid": "cdf9c843b805a8302eff8b2fb4bef8a4", "score": "0.50091946", "text": "function _getOuterContainerOrSelf(node){var view=node.view;while(_isNgContainer(node.parent,view)){node=node.parent;}return node;}", "title": "" }, { "docid": "cdf9c843b805a8302eff8b2fb4bef8a4", "score": "0.50091946", "text": "function _getOuterContainerOrSelf(node){var view=node.view;while(_isNgContainer(node.parent,view)){node=node.parent;}return node;}", "title": "" }, { "docid": "62d7078487a1f95849d458ce5fb8bf19", "score": "0.49974453", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4991204", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4991204", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4991204", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4991204", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "c8e8e8c3f7bf294ca8db59c4276fc893", "score": "0.4991204", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "a287a65553b7a92c8cbfd5510622990c", "score": "0.49893475", "text": "get base() {\n return this.parent ? this.parent.base : this;\n }", "title": "" }, { "docid": "067f7f42ea158dec6342aa617b063473", "score": "0.49881455", "text": "function somePackageGlobal_(){return( new package1.someOtherPackage.SomeOtherClass());}", "title": "" }, { "docid": "487cf565319d67b4a558872cd0e283dc", "score": "0.4987469", "text": "get qualifiedName() {\n return this.node.nodeName;\n }", "title": "" }, { "docid": "3d6eb442d0b08911ba8038a4c69b1488", "score": "0.49793062", "text": "function setNamespace(_namespace){\n namespace = getNamespace(_namespace); \n}", "title": "" }, { "docid": "2df387bfc40a06478355aaa541af19c8", "score": "0.4978937", "text": "initializing() {\n this.getParentProject();\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.4974179", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.4974179", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.4974179", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "37785db4595df1227c02f8cb1845246d", "score": "0.4974179", "text": "function isHtmlNamespace(node) {\r\n var ns;\r\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\r\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "d323665f5c6ba0a523bb5f48febae155", "score": "0.497409", "text": "function isHtmlNamespace(node) {\n var ns;\n return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\");\n }", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.49655047", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.49655047", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.49655047", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "e997563d9bf9b0a359f8e645dddeebb7", "score": "0.49655047", "text": "function getIntrinsicNamespace(type){switch(type){case'svg':return SVG_NAMESPACE;case'math':return MATH_NAMESPACE;default:return HTML_NAMESPACE;}}", "title": "" }, { "docid": "271a91660569ffdd0fe5d11824e2fe70", "score": "0.49648288", "text": "OpNamespace(op_code){\n\t\tthis.current_namespace = op_code.value;\n\t\treturn \"namespace \"+rtl.toString(op_code.value)+\";\";\n\t}", "title": "" }, { "docid": "9d817ba47a57d4dab74f240b8d580346", "score": "0.4947426", "text": "use(...levels) {\n\n\t\t\tif (levels.length <= 0)\n\t\t\t\treturn window;\n\n\t\t\t_filter(...levels);\n\n\t\t\tlet offset = levels.length;\n\t\t\tlet namespace = null;\n\t\t\tif (levels.length > 0\n\t\t\t\t\t&& typeof levels[0] === \"object\")\n\t\t\t\tnamespace = levels.shift();\n\t\t\toffset -= levels.length;\n\n\t\t\tlevels = levels.join(\".\");\n\t\t\tlevels.split(Namespace.PATTERN_NAMESPACE_SEPARATOR).forEach((level, index, array) => {\n\n\t\t\t\tconst pattern = index === 0 && namespace === null\n\t\t\t\t\t\t? Namespace.PATTERN_NAMESPACE_LEVEL_START : Namespace.PATTERN_NAMESPACE_LEVEL;\n\t\t\t\tif (!level.match(pattern))\n\t\t\t\t\tthrow new Error(`Invalid namespace at level ${index +1}${level && level.trim() ? \": \" + level.trim() : \"\"}`);\n\n\t\t\t\t// Composites use IDs which causes corresponding DOM objects\n\t\t\t\t// (Element) in the global namespace if there are no\n\t\t\t\t// corresponding data objects (models). Because namespaces are\n\t\t\t\t// based on data objects, if an element appears, we assume that\n\t\t\t\t// a data object does not exist and the recursive search is\n\t\t\t\t// aborted as unsuccessful.\n\n\t\t\t\tif (index === 0\n\t\t\t\t\t\t&& namespace === null) {\n\t\t\t\t\tnamespace = _populate(namespace, level);\n\t\t\t\t\tif (namespace !== undefined\n\t\t\t\t\t\t\t&& !(namespace instanceof Element))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tnamespace = window;\n\t\t\t\t}\n\n\t\t\t\tconst item = _populate(namespace, level);\n\t\t\t\tconst type = typeof item;\n\t\t\t\tif (type !== \"undefined\"\n\t\t\t\t\t\t&& type !== \"object\")\n\t\t\t\t\tthrow new TypeError(`Invalid namespace type at level ${index +1 +offset}: ${type}`);\n\t\t\t\tif (item === undefined\n\t\t\t\t\t\t|| item === null\n\t\t\t\t\t\t|| item instanceof Element)\n\t\t\t\t\tif (index < array.length -1\n\t\t\t\t\t\t\t&& array[index +1].match(/^\\d+$/))\n\t\t\t\t\t\tnamespace[level] = [];\n\t\t\t\t\telse namespace[level] = {};\n\t\t\t\tnamespace = _populate(namespace, level);\n\t\t\t});\n\n\t\t\treturn namespace;\n\t\t}", "title": "" }, { "docid": "6ce869afc12144adc31c4b42f233413c", "score": "0.4943631", "text": "function namespace() {\n\tvar i;\n\tfor ( i = 0; i < NAMESPACE.length; i++ ) {\n\t\tlogger.log( NAMESPACE[ i ].alias );\n\t}\n} // end FUNCTION namespace()", "title": "" }, { "docid": "f6b39e20aa5e74e03f45c9995ea1fe31", "score": "0.49379456", "text": "function defineChildren() {\n return undefined;\n }", "title": "" } ]
804e0bbef0080c7b3e30944aa9dadea5
=================================================================== from vm/instructions/Close.java =================================================================== Needed early: Instruction Needed late: rainbow.functions.Closure
[ { "docid": "8fd3741fbf28fffe93b98ced2ef56e77", "score": "0.6909981", "text": "function Close_Instruction() {\r\n}", "title": "" } ]
[ { "docid": "4736a3f1558fa169c194623ccccb22e8", "score": "0.6669253", "text": "function testClosure(){\n\tvar x = 4;\n\t\n\tfunction closeX(){\n\t\treturn x;\n\t}\n\treturn closeX\n}", "title": "" }, { "docid": "9b9967c4c703646177e76e6b6115e5b5", "score": "0.6388517", "text": "function Close_Builtin() {\r\n}", "title": "" }, { "docid": "58679bcc5f1128179e4702b3e863823f", "score": "0.63333124", "text": "function Closure() {\r\n}", "title": "" }, { "docid": "e579af521c6e47b5d3b8118f15c11ff2", "score": "0.63280827", "text": "function CloseEvent() {}", "title": "" }, { "docid": "e683823cd9dd15fe2e1f0e940841e87a", "score": "0.61498755", "text": "onClose() {\n\t\t}", "title": "" }, { "docid": "5b398afd62e2ae1e013bead55a2a29ba", "score": "0.6118659", "text": "function Close() {\n } // Close", "title": "" }, { "docid": "ebcaae57707291a9b4afbe79f575e318", "score": "0.60854155", "text": "onClose() {}", "title": "" }, { "docid": "ebcaae57707291a9b4afbe79f575e318", "score": "0.60854155", "text": "onClose() {}", "title": "" }, { "docid": "2a2c978cdb15aadbaec560c6e281c0ef", "score": "0.6053568", "text": "Close() {\n\n }", "title": "" }, { "docid": "7ce85e7aa264154b0b649ae596b01547", "score": "0.6039204", "text": "onClose(){}", "title": "" }, { "docid": "ee1f7f6e96f7404170a395ffbfc30129", "score": "0.6010138", "text": "function finalize(callback) {\n return function (source) { return source.lift(new FinallyOperator(callback)); };\n}", "title": "" }, { "docid": "8dcdcf69faf867ddda103c33309d42d3", "score": "0.5949662", "text": "_close() {\n // mark ourselves inactive without doing any work.\n this._active = false;\n }", "title": "" }, { "docid": "7183c8de2a0ef41cc39995e1f1a44398", "score": "0.5922234", "text": "onClose(removed) {}", "title": "" }, { "docid": "01b1322167cbce15e1cf00376a0125dc", "score": "0.59159887", "text": "function ForceClose() {\r\n}", "title": "" }, { "docid": "0fbcd307299b52397606eeb7ef6fbee0", "score": "0.59081054", "text": "dispose() {}", "title": "" }, { "docid": "0fbcd307299b52397606eeb7ef6fbee0", "score": "0.59081054", "text": "dispose() {}", "title": "" }, { "docid": "0fbcd307299b52397606eeb7ef6fbee0", "score": "0.59081054", "text": "dispose() {}", "title": "" }, { "docid": "0fbcd307299b52397606eeb7ef6fbee0", "score": "0.59081054", "text": "dispose() {}", "title": "" }, { "docid": "0fbcd307299b52397606eeb7ef6fbee0", "score": "0.59081054", "text": "dispose() {}", "title": "" }, { "docid": "f0fadba45382af2e3a0836357f6bbab8", "score": "0.5893254", "text": "function onClose() {\n\tmain( opts, done );\n}", "title": "" }, { "docid": "ef488eca86302250c31b073c82b59a80", "score": "0.5891581", "text": "\"ClassBody:exit\"() {\n stack.pop();\n }", "title": "" }, { "docid": "a0dd135466caefba6e94a64cc26fec25", "score": "0.58095413", "text": "onClosed() {\r\n // Stub\r\n }", "title": "" }, { "docid": "d3200d48d04c4f3ea0a53882d55dc324", "score": "0.5793214", "text": "end() {\n }", "title": "" }, { "docid": "d3200d48d04c4f3ea0a53882d55dc324", "score": "0.5793214", "text": "end() {\n }", "title": "" }, { "docid": "4435a7551968951e3b2c5e8b48ac0a2e", "score": "0.5778871", "text": "_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals : vals[0] || null);\n }\n\n this._destroyOutsideListener();\n }", "title": "" }, { "docid": "a1c26c733ce36e11532a0b7149035a49", "score": "0.5765335", "text": "exitA90(ctx) {\n\t}", "title": "" }, { "docid": "d82e949e7dbabeaf2f48ddab57772327", "score": "0.5757912", "text": "function close()\n{\n closeFrame();\n} // function close", "title": "" }, { "docid": "8e57e5946cbc5a0861c2d605fda4e9d8", "score": "0.57367146", "text": "dispose() { }", "title": "" }, { "docid": "9e4c9d391b83c11ed2f8c0d14dd54297", "score": "0.573089", "text": "exitBlock(ctx) {\n\t}", "title": "" }, { "docid": "6b93448b907be6a5d9810a4b2bde8705", "score": "0.5728645", "text": "close() {\n this.next = () => {};\n if (this.worker) {\n this.worker.next(true);\n }\n delete this.next;\n delete this.ctx;\n }", "title": "" }, { "docid": "f6e408b2e700c60aa39e4ef3391cf4c6", "score": "0.57281715", "text": "exitMacro(ctx) {\n\t}", "title": "" }, { "docid": "5f3bfba33eee6dd9eba60741a44d91c5", "score": "0.57059306", "text": "function fVolver(){\n window.close();\n }", "title": "" }, { "docid": "99c1b4e90c25f5974c065efd9a99d00d", "score": "0.57011217", "text": "function END() {}", "title": "" }, { "docid": "6920035d238174861710629cfffa399d", "score": "0.57004684", "text": "close() {\n return this[kInternalState].closePromise || this[kClose]();\n }", "title": "" }, { "docid": "6920035d238174861710629cfffa399d", "score": "0.57004684", "text": "close() {\n return this[kInternalState].closePromise || this[kClose]();\n }", "title": "" }, { "docid": "7268f5b6324b2b3c92bae027cc6c7532", "score": "0.56910557", "text": "exitComp_op(ctx) {\n\t}", "title": "" }, { "docid": "7f46f316bcfa9bfbef6082ac4c5a3057", "score": "0.5685296", "text": "function close() {\n var self = this;\n\n self._close.apply(self, arguments);\n}", "title": "" }, { "docid": "515ba33e70ee45a6227b5b28fe058141", "score": "0.5677871", "text": "close() {\n close(internalSlots.get(this));\n }", "title": "" }, { "docid": "588c3c6bc2df552a878857655eaea07e", "score": "0.56745434", "text": "closeWindow() {\r\n\r\n }", "title": "" }, { "docid": "5603c874b81dc6c52ce7d0327c430b95", "score": "0.5670427", "text": "function SnpDefineAppClosingHandler()\n{\n\t/**\n\t The context in which this snippet can run; Bridge must be running.\n\t @type String\n\t*/\n\tthis.requiredContext = \"\\tExecute against Bridge main engine.\\n\";\n}", "title": "" }, { "docid": "aa47015aab6d5a59500fd967aa376790", "score": "0.5669935", "text": "exitObj(ctx) {\n }", "title": "" }, { "docid": "6dfa750646737933fa74e56398de7d0b", "score": "0.56436414", "text": "closeOpenCalls() {\r\n\t\t\t\t\tvar action, condition;\r\n\t\t\t\t\tcondition = function(token, i) {\r\n\t\t\t\t\t\tvar ref;\r\n\t\t\t\t\t\treturn (ref = token[0]) === ')' || ref === 'CALL_END';\r\n\t\t\t\t\t};\r\n\t\t\t\t\taction = function(token, i) {\r\n\t\t\t\t\t\treturn token[0] = 'CALL_END';\r\n\t\t\t\t\t};\r\n\t\t\t\t\treturn this.scanTokens(function(token, i) {\r\n\t\t\t\t\t\tif (token[0] === 'CALL_START') {\r\n\t\t\t\t\t\t\tthis.detectEnd(i + 1, condition, action);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.56338865", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.56338865", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.56338865", "text": "finalize() {\n }", "title": "" }, { "docid": "9a57b4748adecee6cc89601f65d4d35f", "score": "0.56338865", "text": "finalize() {\n }", "title": "" }, { "docid": "9a45cdc619e970e9ee3d634e6eff07d3", "score": "0.56305707", "text": "_onClosed() {\n this.emit(\"closed\");\n }", "title": "" }, { "docid": "0c63afd484adca5e33f6ccee6339b7c9", "score": "0.5626024", "text": "exitA89(ctx) {\n\t}", "title": "" }, { "docid": "04ae3be0aaeb6977dc98c2445686569b", "score": "0.5618297", "text": "function close(n){\n\t\treturn barsAgo(CLOSE,n);\n\t}", "title": "" }, { "docid": "1e5872ab2423ad90fb20e12506ac9b38", "score": "0.5609151", "text": "function closeConditional() {\n return false;\n}", "title": "" }, { "docid": "1e5872ab2423ad90fb20e12506ac9b38", "score": "0.5609151", "text": "function closeConditional() {\n return false;\n}", "title": "" }, { "docid": "be94e70b82eb107710ec8d0b6d7e96dd", "score": "0.56069404", "text": "listenForClose(cb) {\n // let listener = (err, response) => {\n let listener = () => {\n delete window._FSBLCache.windows[this.name];\n delete window._FSBLCache.windowAttempts[this.name];\n //If the window that the wrap belongs to is the one calling close, just call the openfin method. Otherwise, some other window is trying to close it - so we send a message to that window, which will eventually close itself.\n for (let event in this.eventlistenerHandlerMap) {\n for (let i = 0; i < this.eventlistenerHandlerMap[event].length; i++) {\n this.eventlistenerHandlerMap[event][i].interceptor.removeAllListeners();\n }\n }\n this.eventManager.cleanup();\n routerClientInstance_1.default.removeListener(`${this.identifier.windowName}.close`, listener);\n // cb(response.data);\n cb();\n };\n this.eventManager.listenForRemoteEvent(\"closed\", listener);\n }", "title": "" }, { "docid": "cdcd50a01f1cb98fc1f5645f11eca335", "score": "0.5604253", "text": "end() { }", "title": "" }, { "docid": "51e5af5eae2b973b7f4d3886e8e27072", "score": "0.5597859", "text": "function exitFunctionExpression( path )\n{\n if( path.node.generator )\n return;\n\n const fun_id = path.node.id ? path.node.id : T.identifier( \"anon\" );\n path.replaceWith( funDefnHelper(\n fun_id, path.node.params, path.node.body, path.node.async ) );\n path.skip();\n}", "title": "" }, { "docid": "4b0517f6470b6459bf923b6132ffa663", "score": "0.55884296", "text": "exitYield_expr(ctx) {\n\t}", "title": "" }, { "docid": "9243f3f92effaf9411cf38e87c991ea2", "score": "0.5575157", "text": "exitLiteral(ctx) {\n\t}", "title": "" }, { "docid": "284cf6d54c0c885a16a66eca5e8fbbdd", "score": "0.5556074", "text": "function quit() { [native code] }", "title": "" }, { "docid": "65c3d2cfefef8dae23ea24abd782b1bc", "score": "0.555345", "text": "close() {\n const result = this.activateCallback('beforeClose');\n if (result !== undefined && !result) {\n return;\n }\n this.clearListeners();\n this.setMap(null);\n }", "title": "" }, { "docid": "0b026cad0749ca4d836570e77ade2a86", "score": "0.5547942", "text": "closeFile(){\r\n return \"}\";\r\n }", "title": "" }, { "docid": "4bafa813471e6df16f9667540392f4e4", "score": "0.55387783", "text": "close() {\n this.sendAction('close');\n }", "title": "" }, { "docid": "75b9bdbe09e9abc9dae342c7558ed161", "score": "0.5538702", "text": "function closeCs() {\n tl\n .to(close, .6, {\n height:'0', \n ease: Power3.easeOut\n });\n }", "title": "" }, { "docid": "18370b1b0a9efff8a6a96dfefc7b6700", "score": "0.55233276", "text": "function forcedClose_p () {\n// --------------------------------------------------------\n window_o.close(true);\n}", "title": "" }, { "docid": "e254350ed476282f9d85bb6ff325aa29", "score": "0.5520667", "text": "closeSyntax(form) {\n return new SyntacticClosure(this, [], form);\n }", "title": "" }, { "docid": "de0dcc7867e72a25d03304a122ac705e", "score": "0.5512568", "text": "function end(){\n return end;\n}", "title": "" }, { "docid": "a0b599edbc9421e084b8a358084fa5d2", "score": "0.55055964", "text": "function terminate() {\n\tt.murder(eventHandlers.cb);\n}", "title": "" }, { "docid": "b7d60637351622c18e10002855dcd345", "score": "0.5504514", "text": "exitDecorator(ctx) {\n\t}", "title": "" }, { "docid": "6cdcb145bf9dce159ae8201b8e51dc00", "score": "0.5500893", "text": "function close_NOW () {\n\t\t\tif (s.isClosed) // skip 'close' if already closed!\n\t\t\t\tbindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here?\n\t\t\telse if (!s.isMoving)\n\t\t\t\tclose(pane); // close will handle unbinding\n\t\t}", "title": "" }, { "docid": "c6ed8aa6eb1152a7d84c8e67921dd572", "score": "0.54966784", "text": "exitComp_for(ctx) {\n\t}", "title": "" }, { "docid": "53014543237e2f4abd9aa7d75f746672", "score": "0.54895735", "text": "close() {\n const result = this.activateCallback('beforeClose');\n if (result !== undefined && !result) {\n return;\n }\n this.clearListeners();\n this.setMap(null);\n }", "title": "" }, { "docid": "0fdc43311d60dae57b0048c762619d32", "score": "0.5488144", "text": "close() {\n if (!this.isOpen()) {\n return;\n }\n this.flyout_.hide();\n // TODO: We can remove the setVisible check when updating from ^10.0.0 to\n // ^11.\n if (this.workspace_.scrollbar &&\n /** @type {*} */ (this.workspace_.scrollbar).setVisible) {\n /** @type {*} */ (this.workspace_.scrollbar).setVisible(true);\n }\n Blockly.Events.fire(new BackpackOpen(false, this.workspace_.id));\n }", "title": "" }, { "docid": "4eafdda43c916a211e1a1b4e513b0fb6", "score": "0.54835355", "text": "close(callback) {\n if (callback)\n callback(null);\n }", "title": "" }, { "docid": "de86099ec24cd66009bbea3464d899ba", "score": "0.5470032", "text": "close()\n {\n this.makeUntouchable();\n Notif.closeByObject(this.object);\n }", "title": "" }, { "docid": "35f6121dc4d9b46d6c1d136c1e4372a9", "score": "0.5469748", "text": "function onClose() {\n\tprocess.exit( 0 );\n}", "title": "" }, { "docid": "35f6121dc4d9b46d6c1d136c1e4372a9", "score": "0.5469748", "text": "function onClose() {\n\tprocess.exit( 0 );\n}", "title": "" }, { "docid": "71abf2dd72d33643ded12ecd1b1f5b80", "score": "0.5466575", "text": "function FreeSym() {\r\n}", "title": "" }, { "docid": "89383b1ed770c4dbc26950861f5f171d", "score": "0.54645836", "text": "exitA87(ctx) {\n\t}", "title": "" }, { "docid": "74e00d57d80a695a59e5cc9acecce1f4", "score": "0.54604816", "text": "function quitFunction() {\n self.close();\n}", "title": "" }, { "docid": "368e3a10346d816a3226c2f1be816f47", "score": "0.5460067", "text": "exitA85(ctx) {\n\t}", "title": "" }, { "docid": "2bff745a957316eae4699ab56b838c8a", "score": "0.54547846", "text": "exitCallEnd(ctx) {\n\t}", "title": "" }, { "docid": "dc0925d013983f909e5e046af140c4b6", "score": "0.5451925", "text": "exitFuncdef(ctx) {\n\t}", "title": "" }, { "docid": "d5a3a23017bf72151cf57d04de01e940", "score": "0.5447288", "text": "exitYield_stmt(ctx) {\n\t}", "title": "" }, { "docid": "29738a1be8fb48b34f94c9a7f5ffff0f", "score": "0.5447114", "text": "exitFlow_stmt(ctx) {\n\t}", "title": "" }, { "docid": "61536bd101f7b9e1316c2be50cba301a", "score": "0.5444287", "text": "exitA114(ctx) {\n\t}", "title": "" }, { "docid": "22345ecf07dba28c175b0ca8bb907422", "score": "0.5441085", "text": "static exit() {\n return document[this.functions[2]]();\n }", "title": "" }, { "docid": "22345ecf07dba28c175b0ca8bb907422", "score": "0.5441085", "text": "static exit() {\n return document[this.functions[2]]();\n }", "title": "" }, { "docid": "0485cd0fb0d7a468acdcf257eb67f20e", "score": "0.5440451", "text": "exitA83(ctx) {\n\t}", "title": "" }, { "docid": "917c1d490ea858a86bd87c711a2ee479", "score": "0.5437824", "text": "close() {\n API.LMSGetValue(\"cmi.core._children\")\n API.LMSFinish(\"\");\n _init = false;\n }", "title": "" }, { "docid": "e6cf507c940f193b8691c53ac823f1d5", "score": "0.5435078", "text": "close() {\r\n this.native.close();\r\n }", "title": "" }, { "docid": "4aaab469d76c243fbc36b6b911488db7", "score": "0.54337835", "text": "[PRIVATE.$onDestroy] () {\n this[PRIVATE.callSymbols](PRIVATE.onDestroySymbols, []);\n }", "title": "" }, { "docid": "45641fe3d34531fef1ad2966ba9592a2", "score": "0.54275674", "text": "end(cb) {\n this.pcolInstance.end(cb);\n }", "title": "" }, { "docid": "b305b3a69cd2a16ad8195f6ddd135d41", "score": "0.54271126", "text": "function finalizerExit(f, __trace) {\n return (0, _makeExit.makeExit_)(T.unit, (_, e) => f(e), __trace);\n}", "title": "" }, { "docid": "224f2946906fd98c66a5fc509a3ccffd", "score": "0.54196256", "text": "function dispose() {}", "title": "" }, { "docid": "ca29177279544ce68692c969d68488be", "score": "0.5418793", "text": "exitOld_lambdef(ctx) {\n\t}", "title": "" }, { "docid": "bc715ca14893ab07499ccaf64bc5241f", "score": "0.54179823", "text": "function cust_exitFrame(tlref){\n \n}", "title": "" }, { "docid": "ce90fd2d0bef21dcd623356e5b8651a5", "score": "0.5416722", "text": "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "title": "" }, { "docid": "ce90fd2d0bef21dcd623356e5b8651a5", "score": "0.5416722", "text": "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "title": "" }, { "docid": "fec2a02c89b91643f5d96c08272e01a7", "score": "0.54074115", "text": "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "title": "" }, { "docid": "59a37c31d98ca6f0c41a7a068503c206", "score": "0.54005605", "text": "function OnBAEAModeFormsWindow_Close()\r\n{\r\n // Since we are referencing a global collection for our bindings,\r\n // make sure to call $.destroy() when you are done with the\r\n // controller/window. This will ensure that no memory is\r\n // leaked and that the bindings are properly released.\r\n $.destroy() ;\r\n}", "title": "" }, { "docid": "5a27c7aee629894fd3be89c63ec3f258", "score": "0.5398012", "text": "exitObject(ctx) {\n\t}", "title": "" }, { "docid": "a48d6309a403e38c494c3ab3d643786f", "score": "0.5397161", "text": "exitObj(ctx) {\n\t}", "title": "" } ]
89c439dbbeecaec360aabefc9c58eb05
functions for building nested timelines
[ { "docid": "9ce8314b25c251e922f97023e45c0048", "score": "0.0", "text": "function getSkewAnimation() {\n var skewTimeline = new TimelineLite();\n skewTimeline.from(skew, 0.3, {alpha:0})\n .to(skew, 0.5, {skewX:45})\n .to(skew, 0.8, {skewX:-45})\n .to(skew, 0.5, {skewX:5, skewY:-10})\n .to(skew, 0.5, {skewX:20, skewY:5})\n .to(skew, 0.5, {alpha:0});\n return skewTimeline; \n }", "title": "" } ]
[ { "docid": "c6e954bbc7af4c22a31d9cd4048a5dca", "score": "0.63806605", "text": "function buildPlanner(timestamp) {\n //for loop to create HTML list elements\n //in for loop, check timestamp to determine color of list element\n\n //sample obj= {\n // ts1: [task 1, task 2] \n // ts2: \n // }\n\n }", "title": "" }, { "docid": "300aa7b1acb5bf84b87a44c54667db97", "score": "0.61961544", "text": "function makeLine(index) {\n\tvar datetimearr = courses[index].datetimearr;\n\t//converted times back\n\tvar dtmap = new Map([]);\n\tfor (var i = 0; i < datetimearr.length; i++) {\n\t\tdatetimearr[i][1][0] = moment(datetimearr[i][1][0], [\"HH:mm\"]).format(\"h:mm a\");\n\t\tdatetimearr[i][1][1] = moment(datetimearr[i][1][1], [\"HH:mm\"]).format(\"h:mm a\");\n\t}\n\tfor (var i = 0; i < datetimearr.length; i++) {\n\t\tif (dtmap.has(String(datetimearr[i][1]))) {\n\t\t\tdtmap.set(String(datetimearr[i][1]), dtmap.get(String(datetimearr[i][1])) + datetimearr[i][0]);\n\t\t} else {\n\t\t\tdtmap.set(String(datetimearr[i][1]), datetimearr[i][0]);\n\t\t}\n\t}\n\tvar output = \"\";\n\tvar timearr = Array.from(dtmap.keys());\n\tvar dayarr = Array.from(dtmap.values());\n\n\tif (timearr.length == 0) {\n\t\toutput = \"<span style='font-size:medium;'>This class has no meeting times.</span>\"\n\t} else {\n\t\tfor (var i = 0; i < dayarr.length; i++) {\n\t\t\tvar place = findLoc(dayarr[i], timearr[i], datetimearr);\n\t\t\tvar building = place.substring(0, place.search(/\\d/) - 1);\n\t\t\tif (building == \"\") {\n\t\t\t\tbuilding = \"Undecided Location\";\n\t\t\t}\n\t\t\toutput += `<span style='display:inline-block;width: 20%;'>${dayarr[i]}:</span><span style='margin-left:10px;display:inline-block;width: 50%;text-align:center;'>${timearr[i].split(\",\")[0]} to ${timearr[i].split(\",\")[1]}</span><span style='float:right;display:inline-block;text-align:right;width: 25%;'><a target='_blank' style='color:#3c87a3;text-decoration:none;'href='https://maps.utexas.edu/buildings/UTM/${building}'>${place}</a></span><br>`;\n\t\t}\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "c4d84d693fde263022cce46757738a41", "score": "0.6106837", "text": "function drawTimeline() {\n for (var i = 0; i < times.length; i++) {\n // Main line\n var line = layer0.append(\"line\")\n .attr(\"id\", 'timeline' + i)\n .attr(\"x1\", i * hourSpace)\n .attr(\"y1\", 0)\n .attr(\"x2\", i * hourSpace)\n .attr(\"y2\", viewerHeight)\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", timeBoldLineStrokeWidth) // 1\n .attr(\"stroke\", \"gray\");\n\n timeLines.push(line);\n\n // Display time\n var text = layer0.append(\"text\")\n .attr(\"id\", 'timelinetext' + i)\n .text(times[i])\n .attr(\"x\", i * hourSpace)\n .attr(\"y\", -timeNameUpMargin)\n .style(\"font-size\", timeNameSize) //20\n .style(\"font-family\", \"Segoe UI\")\n .style(\"text-anchor\", \"middle\");\n\n timeNames.push(text);\n }\n\n for (var i = 0; i < times.length - 1; i++)\n for (var j = 1; j < 6; j++) {\n // Minor line\n var line = layer0.append(\"line\")\n .attr(\"x1\", i * hourSpace + j * tenMinSpace)\n .attr(\"y1\", 0)\n .attr(\"x2\", i * hourSpace + j * tenMinSpace)\n .attr(\"y2\", viewerHeight)\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", timeThinLineStrokeWidth) // 0.5\n .attr(\"stroke\", function () { return j != 3 ? \"lightgray\" : \"lightgreen\"; });\n\n timeLines.push(line);\n }\n}", "title": "" }, { "docid": "666abf30c1d3dad27a348e564f655d77", "score": "0.6015459", "text": "function timeLine(data) {\n const postsContainer = $('#postsContainer');\n const date = new Date(data.updatedAt);\n postDate = { year: date.getFullYear(), month: convertToMonth(date.getMonth() + 1) };\n //create time line for the first post \n if (!lastPostDate) {\n lastPostDate = postDate;\n const eTimeLine = eHtml({ class: 'eTimeLine non-select', container: postsContainer });\n eHtml({ class: 'timeLineYear', container: eTimeLine, text: lastPostDate.year });\n eHtml({ class: 'timeLineMonth', container: eTimeLine, text: ' - ' + lastPostDate.month });\n }\n //validate date last post and actual\n if (postDate.month != lastPostDate.month || postDate.year != lastPostDate.year) {\n lastPostDate = postDate;\n const eTimeLine = eHtml({ class: 'eTimeLine non-select', container: postsContainer });\n eHtml({ class: 'timeLineYear', container: eTimeLine, text: lastPostDate.year });\n eHtml({ class: 'timeLineMonth', container: eTimeLine, text: ' - ' + lastPostDate.month });\n }\n}", "title": "" }, { "docid": "e8b43431c606f000e31b98753b7cda30", "score": "0.59581405", "text": "buildAttrs(obj){\n var that = this\n var added = false;\n\n // code for the attributs startFrame and endFrame\n if(typeof obj.attrs.startFrame !== 'undefined' &&\n typeof obj.attrs.endFrame !== 'undefined' &&\n parseInt(obj.attrs.startFrame.value, 10) <= parseInt(obj.attrs.endFrame.value, 10)){\n\n // retrieve data for the timeLine\n this.timeLineData.forEach(function(element){\n if(!added && that.samePlace(element.intervals[0].stack)){\n element.intervals.push({\n index: parseInt(element.intervals[0].index, 10),\n start: obj.attrs.startFrame.value,\n end: obj.attrs.endFrame.value,\n id: that.count,\n isDisplayed : that.isDisplayed,\n // clone the stack\n stack: that.stack.slice(0),\n })\n that.count++;\n added = true\n }\n })\n if(!added){\n this.timeLineData.push({\n name:this.stack[this.stack.length - 1].tag,\n intervals:[{\n end: obj.attrs.endFrame.value,\n start: obj.attrs.startFrame.value,\n id: that.count,\n index: parseInt(that.timeLineData.length, 10),\n isDisplayed : that.isDisplayed,\n // clone the stack\n stack: this.stack.slice(0),\n }]\n })\n this.count++;\n }\n added = false\n }\n\n // code for the attribut timeId\n if(typeof obj.attrs.timeId !== 'undefined' &&\n (!isNaN(parseInt(obj.attrs.timeId.value)))){\n\n // retrieve data for the timeLine\n this.timeLineData.forEach(function(element){\n if(!added && that.samePlace(element.intervals[0].stack)){\n element.intervals.push({\n index: parseInt(element.intervals[0].index, 10),\n start: obj.attrs.timeId.value,\n end: obj.attrs.timeId.value,\n id: that.count,\n isDisplayed : that.isDisplayed,\n // clone the stack\n stack:that.stack.slice(0),\n })\n that.count++;\n added = true\n }\n })\n if(!added){\n this.timeLineData.push({\n name:this.stack[this.stack.length - 1].tag,\n intervals:[{\n index: parseInt(that.timeLineData.length, 10),\n start: obj.attrs.timeId.value,\n end: obj.attrs.timeId.value,\n id:that.count,\n isDisplayed : that.isDisplayed,\n // clone the stack\n stack: this.stack.slice(0)\n }]\n })\n this.count++;\n }\n added = false\n }\n }", "title": "" }, { "docid": "f5287594f032ccd3140bcbd497d728e3", "score": "0.58125645", "text": "function timeline(object_id, response, width, line_height, margin = [0, 0]){\n // initializing the timeline region with an svg\n // var svg = d3.select(object_id).append(\"svg\").attr(\"width\", width).attr(\"height\", height)\n var dt_from = \"1970-05-04\";\n var dt_to= \"2015-12-01\";\n\n for(g_id in response){\n let group = response[g_id]\n for(l_id in group.data){\n let label = group.data[l_id];\n for(d_id in label.data){\n let date = label.data[d_id].timeRange;\n date = date.map((x) => new Date(x));\n response[g_id].data[l_id].data[d_id].timeRange = date;\n }\n }\n }\n //margin left = 150\n //margin right = 440\n\n const vis = document.getElementById(object_id)\n vis.textContent = ''\n vis.onmouseover = ((x) => add_event_to_prov(\"over the chart\"));\n TimelinesChart()\n .width(width)\n .zQualitative(true)\n .maxLineHeight(line_height)\n .leftMargin(margin[0])\n .rightMargin(margin[1])\n .data(response)\n .onSegmentClick(function(segment){\n let paper_data = segment.srcElement.__data__.data;\n global_paper_data = paper_data;\n render_iframe(paper_data)\n add_event_to_prov(`segment clicked: ${paper_data.title}`)\n })\n .segmentTooltipContent(function(segment){\n let paper_data = segment.data;\n return paper_data.title;\n })\n .zColorScale(d3.scaleOrdinal()\n .domain([\"No Keywords\"])\n .range([\"steelblue\", \"orange\"])\n )\n (vis);\n}", "title": "" }, { "docid": "7cf691c268589795aff271027a47541b", "score": "0.5710715", "text": "function createTimeline (dataArray, scaleValue, scope, domainNestedData,\n nestedData, height, width, margin, yDomain) {\n const g = d3.select('#main_svg')\n .append('g')\n .attr('class', 'axis')\n .attr('transform', `translate(${((width / 2) + 3)},0)`);\n\n if (scope === null) {\n scope = defineScope(nestedData);\n yDomain = defineDomain(scope, scaleValue);\n }\n\n adjustDomain(scaleValue, yDomain);\n\n const yScale = d3.scaleTime()\n .domain(yDomain)\n .nice()\n .range([height, margin.top]);\n\n const yAxis = d3.axisLeft(yScale);\n\n createTicks(yAxis, scaleValue);\n\n updateStyleButtonUp(scaleValue, scope, yDomain);\n\n updateStyleButtonDown(scaleValue, scope, yDomain);\n\n g.call(yAxis);\n\n updateTicksPosition(g, scaleValue);\n\n domainNestedData = createDomainNestedData(domainNestedData, nestedData, yDomain);\n\n const circleContainer = createCircleContainer(domainNestedData, yDomain, scaleValue);\n\n const nestedDataDate = nestDataByDate(dataArray, scaleValue);\n\n eventButton(yDomain, scope, domainNestedData, scaleValue, nestedData,\n yAxis, yScale, width, height, margin, dataArray);\n\n addCircle(height, width, yScale, circleContainer, scaleValue, margin);\n zoomEvent(circleContainer, height, width, margin);\n addSmallPicture(nestedData, domainNestedData, width, yScale, scaleValue, height, margin);\n createWordcloud(domainNestedData, scaleValue, nestedDataDate,\n circleContainer, yScale, width, height, margin);\n}", "title": "" }, { "docid": "c59c22db863a7632a1de1fb1f9ffa638", "score": "0.562902", "text": "function init_series_line_chart(main_nested, other_nested, extent, ticks, svg, width, height, margin, title, format_pattern, top, color) {\n var g = svg.append('g')\n .attr('class', 'chart')\n .attr(\"transform\", \"translate(0,\" + top + \")\");\n\n // setup y-axis\n var tick_values = get_tick_values(extent, ticks, false);\n\n var data_scale = d3.scale.linear()\n .range([(height-margin-font_margin), margin])\n .domain(extent);\n\n var y_axis_data = d3.svg.axis()\n .scale(data_scale)\n .orient('left')\n .innerTickSize(-width+margin)\n .tickFormat(d3.format(format_pattern))\n .tickValues(tick_values);\n\n // draw y-axis first as it's showing dash lines\n // draw text and grid lines too\n g.append(\"g\")\n .attr(\"class\", \"y axis noline\")\n .attr('transform', \"translate(\" + margin + \",0)\")\n .call(y_axis_data);\n\n // setup and draw x-axis\n var main_period_dates = main_nested[0]['values']['period_data']\n .map(function(d){ return d['period']; });\n var period_scale = setup_year_scale_xaxis(g, main_period_dates, width, height, margin, true);\n\n // chart title\n g.append(\"text\")\n .attr(\"x\", width/2) \n .attr(\"y\", height - 5)\n .attr(\"text-anchor\", \"middle\") \n .text(title + ' Time Series');\n\n var line_func = d3.svg.line()\n .x(function(d) { return period_scale(d['period']); })\n .y(function(d) { return data_scale(d['datum']); });\n\n // loop through areas and plot line charts\n main_nested.forEach(function(obj) {\n var key_class = obj.key.replace(' ', '');\n var path = g.append('g')\n .attr('class', 'series')\n .append(\"path\")\n .attr(\"class\", 'series ' + key_class)\n .attr(\"d\", line_func(obj['values']['period_data']));\n });\n\n return {\n 'g': g,\n 'color': color,\n 'format_pattern': format_pattern,\n 'line_func': line_func,\n 'period_scale': period_scale,\n 'data_scale': data_scale,\n 'nested': other_nested\n };\n}", "title": "" }, { "docid": "500fe1a2f4717a3894da03470d452110", "score": "0.5600101", "text": "function initializeTimelines() {\n if (!self.symbology.isInteractive) {\n return;\n }\n\n var canvas = document.createElement('canvas');\n\n // find all symbology items and their parts\n ref.symbolItems = element.find(RV_SYMBOLOGY_ITEM_CLASS).toArray().map(function (domNode) {\n domNode = angular.element(domNode);\n\n return {\n container: domNode,\n image: domNode.find('rv-svg'),\n label: domNode.find(RV_SYMBOLOGY_ITEM_NAME_CLASS)\n };\n });\n\n ref.trigger = element.find(RV_SYMBOLOGY_ITEM_TRIGGER);\n\n // calculate maximum width of a symbology item based on image, label size and the main panel width\n // symbology item cannot be wider than the panel\n ref.maxItemWidth = Math.min(Math.max.apply(Math, _toConsumableArray(ref.symbolItems.map(function (symbolItem) {\n return Math.max(symbolItem.image.find('svg')[0].viewBox.baseVal.width,\n\n // TODO: need to use current font size\n // need to account for letter spacing (use 10 for now)\n // 32 accounts for paddding, need to get that from styles as well\n getTextWidth(canvas, symbolItem.label.text(), 'normal 14px Roboto') + 32 + 10);\n }))), ref.containerWidth);\n\n // set label width to maximum which was calculated\n ref.symbolItems.forEach(function (symbolItem) {\n return symbolItem.label.css('width', ref.maxItemWidth);\n });\n\n // console.log('ref.maxItemWidth', ref.maxItemWidth);\n\n ref.expandTimeline = makeExpandTimeline();\n ref.fanOutTimeline = makeWiggleTimeline();\n\n ref.isReady = true;\n }", "title": "" }, { "docid": "5cd3451ca909e39820f45205b4fa73ba", "score": "0.54805243", "text": "function buildTimeLine () {\n\n\t\t\tvar margin = {top: 10, right: 0, bottom: 0, left: 0},\n\t\t width = 550 - margin.left - margin.right,\n\t\t height = 30 - margin.top - margin.bottom,\n\t\t barPadding = 1,\n\t\t timelineLength;\n\n\t\t\tvar parseDate = d3.time.format(\"%Y_%m\").parse;\n\n\t\t\tvar x = d3.time.scale().range([0, width]),\n\t\t\t y = d3.scale.linear().range([height, 0]);\n\n\t\t\tvar xAxis = d3.svg.axis().scale(x).orient(\"bottom\").tickSize(2).tickSubdivide(1).tickPadding(0);\n\n\t\t\tvar brush = d3.svg.brush()\n\t\t\t .x(x)\n\t\t\t .on(\"brushstart\", function(d) {\n\t\t\t \tWSR.vars.map.trigger(\"clearLines\");\n\t\t\t })\n\t\t\t .on(\"brush\", brush);\n\n\t\t\tvar svg = d3.select(\"#timeControler #graph\").append(\"svg\")\n\t\t\t\t.attr(\"class\", \"timeline\")\n\t\t\t .attr(\"width\", width)\n\t\t\t .attr(\"height\", height + margin.top + margin.bottom);\n\n\t\t\tvar brushChart = svg.append(\"g\")\n\t\t\t .attr(\"transform\", \"translate(\" + margin.left + \",\"+margin.top+\" )\");\n\n\t\t\td3.json(\"Data/incidents/totalincidents.json\", function(data, error) {\n\n\t\t\t //Need to format the dates for chart\n\t\t\t data.forEach(function(d) {\n\t\t\t d.chartDate = parseDate(d.date);\n\t\t\t d.hits = +d.hits;\n\t\t\t });\n\n\t\t\t // get lengths for use by other functions\n\t\t\t timelineLength = data.length;\n\t\t\t var maxLength = 162 * width/timelineLength;\n\n\t\t\t //Once we have a date, now sort\n\t\t\t data.sort(function(a,b) { return a.chartDate-b.chartDate; });\n\n\t\t\t //Setting up the scales for the charts\n\t\t\t x.domain(d3.extent(data.map(function(d) { return d.chartDate; })));\n\t\t\t y.domain([0, d3.max(data.map(function(d) { return d.hits; }))]);\n\n\t\t\t // draw bars for each month\n\t\t\t brushChart.selectAll(\".brushBars\")\n\t\t\t .data(data)\n\t\t\t .enter().append(\"rect\")\n\t\t\t .attr(\"class\", \"brushbar\")\n\t\t\t .attr(\"fill\", \"black\")\n\t\t\t .attr(\"x\", function(d, i) { return i * (width/timelineLength);})\n\t\t\t .attr(\"width\",(width/timelineLength) - barPadding)\n\t\t\t .attr(\"y\", function(d) { return y(d.hits); })\n\t\t\t .attr(\"height\", function(d) { return height - y(d.hits); });\n\n\t\t\t // draw x axis\n\t\t\t d3.select(\"#timeControler\").insert(\"svg\",\"#toolbarbottom\")\n\t\t\t \t .attr(\"width\", width + margin.left + margin.right)\n\t\t\t \t .attr(\"height\", \"10\")\n\t\t\t \t .attr(\"transform\", \"translate(\" + margin.left + \", -20px)\") // + margin.top + \")\")\n\t\t\t .attr(\"class\", \"x axis\")\n\t\t\t .call(xAxis);\n\n\t\t\t // draw brushing\n\t\t\t brushChart.append(\"g\")\n\t\t\t .attr(\"class\", \"brush\") //was \"x brush\"\n\t\t\t .call(brush)\n\t\t\t .selectAll(\"rect\")\n\t\t\t .attr(\"y\", -16)\n\t\t\t .attr(\"height\", height + 17);\n\n\t\t\t // drag function for the play marker\n\t\t\t var markerMove = function(d) {\n\t\t\t \t\td3.select(\".brush\").call(brush.clear());\n\t\t\t \t\tdayLength = 0;\n\t\t\t \t\tvar point = d3.mouse(this);\n\t\t\t \t\tsvg.select(\".playposition\")\n\t\t\t \t \t\t.attr(\"x\", ((point[0] < 0)? 0 : ((point[0] > maxLength)? maxLength : point[0])));\n\t\t\t }; // END markerMove\n\n\t\t\t // update the time based on where the marker is when the user stops dragging\n\t\t\t var markerTime = function(d) {\n\t\t\t \t\tvar point = d3.mouse(this);\n\t\t\t \t\tvar xPoint = (point[0] < 0)? 0 : ((point[0] > maxLength)? maxLength : point[0]);\n\n\t\t\t \t \tvar timeDelta = Math.floor(xPoint * timelineLength/width);\t \t \t\n\t\t\t \t \tvar monthDelta = timeDelta % 12;\n\t\t\t \t \tvar yearDelta = Math.floor(timeDelta/12);\n\n\t\t\t \t \tvar newTime = String(1999 + yearDelta) + '_' + String(1 + monthDelta);\n\t\t\t \t \tupdateTime([newTime]);\n\t\t\t }; // END markerTime\n\n\t\t\t // define drag behavior\n\t\t\t var drag = d3.behavior.drag()\n\t\t\t \t\t\t\t.origin(Object)\n\t\t\t \t\t\t\t.on(\"drag\", markerMove)\n\t\t\t \t\t\t\t.on(\"dragend\", markerTime);\n\n\t\t\t // draw play position - default set at 2009_1\n\t\t\t var playMarker = brushChart.append(\"g\")\n\t\t\t \t .append(\"rect\")\n\t\t\t \t .attr(\"class\",\"playposition\")\n\t\t\t \t .attr(\"x\", function() { return 120 * (width/timelineLength); })\n\t\t\t \t .attr(\"y\", -16)\n\t\t\t \t .attr(\"height\", height + 17)\n\t\t\t \t .attr(\"width\", (width/timelineLength) - barPadding)\n\t\t\t \t .style(\"fill\",\"#ff9b3e\")\n\t\t\t \t .call(drag);\n\n\t\t\t}); // END json load\n\n\t\t\tfunction brush() {\n\n\t\t\t //Find out how many months there are between the brush extent\n\t\t\t var arrayOfDates = function( date1, date2 ) {\n\t\t\t //Make new dates from the given ones, set for first of the month year\n\t\t\t var d1 = new Date(date1.getFullYear(), date1.getMonth(), 1);\n\t\t\t var d2 = new Date(date2.getFullYear(), date2.getMonth(), 1);\n\t\t\t var one_month=1000*60*60*24*30;\n\n\n\t\t\t var monthsBetween = Math.floor(Math.abs(((d1 - d2)/one_month)));\n\n\t\t\t //Given the number of months btw the two dates construct an array with our date format\n\t\t\t var monthsArray = [];\n\n\t\t\t //We'll be incrementing over date one\n\t\t\t var month = d1.getMonth() + 1; //b/c this is index 0-11 \n\t\t\t var year = d1.getFullYear();\n\t\t\t var dateStr = year + \"_\" + month;\n\n\t\t\t //put in the first date\n\t\t\t monthsArray.push(dateStr);\n\n\t\t\t for (var i=0; i < monthsBetween; i++) {\n\t\t\t if (month != 12) {\n\t\t\t dateStr = year + '_' + ++month;\n\t\t\t }\n\t\t\t // increment year and set month to january\n\t\t\t else {\n\t\t\t dateStr = ++year + '_1';\n\t\t\t month = 1;\n\t\t\t }\n\t\t\t monthsArray.push(dateStr);\n\t\t\t }\n\t\t\t return monthsArray;\n\t\t\t }\n\n\t\t\t // get year_month format of time\n\t\t\t timeInterval = arrayOfDates(brush.extent()[0],brush.extent()[1]);\n\n\t\t\t // calculate small different between brushing and play marker position\n\t\t\t dayLength = ((width/timelineLength) / 30) * brush.extent()[0].getDate();\n\t\t\t if (Math.abs(Date.parse(brush.extent()[0]) - Date.parse(brush.extent()[1])) < 1) dayLength = 0;\n\n\t\t\t // filter based on new time selection\n\t\t\t updateTime(timeInterval);\n\n\t\t\t}//end of brush\n\n\t\t\tfunction clearBrushing() {\n\t\t\t\td3.select(\".brush\").call(brush.clear());\n\t\t\t\tdayLength = 0;\n\t\t\t}//end of clearBrushing\n\n\t\t\t// call function to reset brushing\n\t\t\t$(\".clearbrushingbutton\").on(\"click\", function(ev) {\n\t\t\t\tclearBrushing();\n\t\t\t\tWSR.vars.map.trigger(\"clearLines\");\n\t\t\t})\t\n\n\t\t\t// shift brush left or right\n\t\t\tmoveBrush = function (right) {\n\t\t\t\t// get current months\n\t\t\t\tvar leftDate = brush.extent()[0];\n\t\t\t\tvar rightDate = brush.extent()[1];\n\n\t\t\t\t// increment or decrement depending on whether 'right' is true\n\t\t\t\tbrush.extent()[0] = leftDate.setMonth( (right? leftDate.getMonth() + 1 : leftDate.getMonth() - 1) );\n\t\t\t\tbrush.extent()[1] = rightDate.setMonth( (right? rightDate.getMonth() + 1 : rightDate.getMonth() - 1) );\n\n\t\t\t\t// update brush\n\t\t\t\tsvg.select(\".brush\").call(brush.extent([leftDate, rightDate]));\n\n\t\t\t}; // END moveBrush\n\n\t\t\t// show marker play position\n\t\t\tshowPosition = function (month,year,day) {\n\t\t\t // calculate months and years away from 1999_1\n\t\t\t var yearDelta = year - 1999;\n\t\t\t var monthDelta = month - 1;\n\t\t\t var xDelta = yearDelta * 12 + monthDelta;\n\t\t\t // update play position marker\n\t\t\t svg.select(\".playposition\")\n\t\t\t \t .attr(\"x\", function() { return xDelta * width/timelineLength + day });\n\t\t\t}; // END showPosition\n\n\t\t}", "title": "" }, { "docid": "1759b637cbd1e76d63fd7d5d9823183c", "score": "0.54690945", "text": "function _getTimeline(property, track) {\n\treturn _PANELS.animations.timeline.template({\n\t\tDanimator: \t\tDanimator,\n\t\tTIME_FACTOR: \tTIME_FACTOR,\n\t\tproperty: \t\tproperty,\n\t\tranges: \t\ttrack.properties[property],\n\t\tslug: \t\t\tslug,\n\t\ttrack: \t\t\ttrack,\n\t\ttype: \t\t\ttrack.item.className,\n\t\tgetTrigger: \tfunction(range) { \n\t\t\tif(_normalizeTrigger(range.caller).length) {\n\t\t\t\treturn ' triggered';\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a6a831a2ddb24d796f5515910e8b6dc8", "score": "0.5422782", "text": "createTimeline(data) {\n\n if (data == null) return;\n\n var line = d3.shape.line()\n .x((d) => {return this.x(new Date(moment(d.date, 'YYYYMMDD')))})\n .y((d) => {return this.y(d.rest ? 0 : d.timeInMinutes)})\n .curve(d3.shape.curveLinear);\n\n var path = line([...data]);\n\n return this.createShape(path, graphColorTheme.main, null, 2);\n\n }", "title": "" }, { "docid": "6cda1a73924d0ae2a608251144dc541b", "score": "0.53841215", "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": "62de831f34f10bc8a687bf8a4bc8fb7e", "score": "0.53111273", "text": "function questTree_firstSchedule() {\n\n\tdocument.querySelectorAll(\"#quest_3\")[0].innerHTML = \"<section class=\\\"price price first_price\\\"><div class=\\\"bottom_price price_one\\\"></div></section><section class=\\\"price second_price\\\"><div class=\\\"bottom_price price_two\\\"></div></section>\";\n\n\n\tfunction questOne_firstSchedule() {\n\tdocument.querySelectorAll(\"#quest_3 .first_price\")[0].innerHTML = \"<div class=\\\"bottom_price price_one\\\"></div> <span class=\\\"time\\\">\" + second_set_time[0] + \"</span> <span class=\\\"time\\\">\" + second_set_time[1] + \"</span> <span class=\\\"time\\\">\" + second_set_time[2] + \"</span><span class=\\\"time\\\">\" + second_set_time[3] + \"</span><span class=\\\"time\\\">\" + second_set_time[4] + \"</span>\";\n\tsetPrice()\n\t}\n\n\tquestOne_secondSchedule();\n\n\n\tfunction questOne_secondSchedule() {\n\t\tdocument.querySelectorAll(\"#quest_3 .second_price\")[0].innerHTML = \"<div class=\\\"bottom_price price_tree\\\"></div> <span class=\\\"time\\\">\" + second_set_time[5] + \"</span><span class=\\\"time\\\">\" + second_set_time[6] + \"</span><span class=\\\"time\\\">\" + second_set_time[7] + \"</span><span class=\\\"time\\\">\" + second_set_time[8] + \"</span>\";\n\t\tsetPrice()\n\t}\n\n\tquestOne_firstSchedule();\n}", "title": "" }, { "docid": "b8523d0fc12d8732f621bce0504bd6f0", "score": "0.5308691", "text": "_initTimelines() {\n const overviewContainer = document.getElementById('overview');\n\n this._timeline =\n new vis.Timeline(this._timelineContainer, this._bookmarks, this._timelineOptions);\n this._centerTime = this._timeline.getCurrentTime();\n this._timeline.moveTo(this._centerTime, {\n animation: false,\n });\n\n this._timeline.addCustomTime(this._centerTime, this._timeId);\n this._timeline.on('mouseUp', this._onMouseUp.bind(this));\n this._timeline.on('mouseDown', () => this._dragDistance = 0);\n this._timeline.on('mouseMove', (e) => {this._dragDistance += Math.abs(e.event.movementX)});\n this._timeline.on('rangechange', this._timelineDragCallback.bind(this));\n this._timeline.on('rangechanged', this._timelineDragEndCallback.bind(this));\n this._timeline.on('itemover', this._itemOverCallback.bind(this));\n this._timeline.on('itemout', this._itemOutCallback.bind(this));\n\n // create overview timeline\n this._overviewTimeline =\n new vis.Timeline(overviewContainer, this._bookmarksOverview, this._overviewTimelineOptions);\n this._overviewTimeline.addCustomTime(this._timeline.getWindow().end, this._rightTimeId);\n this._overviewTimeline.addCustomTime(this._timeline.getWindow().start, this._leftTimeId);\n this._overviewTimeline.on('rangechange', this._overviewDragCallback.bind(this));\n this._overviewTimeline.on('mouseUp', this._onMouseUp.bind(this));\n this._overviewTimeline.on('mouseDown', () => this._dragDistance = 0);\n this._overviewTimeline.on(\n 'mouseMove', (e) => this._dragDistance += Math.abs(e.event.movementX));\n this._overviewTimeline.on('itemover', this._itemOverCallback.bind(this));\n this._overviewTimeline.on('itemout', this._itemOutCallback.bind(this));\n this._initialOverviewWindow(new Date(1950, 1), new Date(2030, 12));\n }", "title": "" }, { "docid": "3ccd6cbc506668274227d4ca0f547dcd", "score": "0.5287324", "text": "createTimelineMarks() {\n for (var hour = this.minHour; hour < this.maxHour; hour++) {\n var stepWidth = 1 / this.hourSpan * 100;\n var markLine = document.createElement('span');\n markLine.innerHTML = hour + \":00\";\n markLine.style.width = stepWidth + \"%\";\n document.getElementById('time-marks').appendChild(markLine);\n }\n }", "title": "" }, { "docid": "7b29494e89e5f8d17d32b8374e46a858", "score": "0.5276431", "text": "function processFileData(lines,startTime,countdown) {\n var data = [];\n var currEntry = 0;\n setInnerTextBase(\"Processing subtitles...\");\n var entryPosition = 0;\n for (i=0; i<lines.length; i++) {\n entryPosition += 1;\n if (lines[i] == \"\") {\n entryPosition = 0;\n }\n switch(entryPosition) {\n case 0: //Empty space\n break;\n case 1: //The index\n currEntry = Number(lines[i]);\n data.push({\n start: null,\n end: null,\n text: null,\n duration: null,\n pause: null\n });\n break;\n case 2: //The times\n var regex = new RegExp(\"(\\\\\\d\\\\\\d):(\\\\\\d\\\\\\d):(\\\\\\d\\\\\\d),(\\\\\\d\\\\\\d\\\\\\d) --> (\\\\\\d\\\\\\d):(\\\\\\d\\\\\\d):(\\\\\\d\\\\\\d),(\\\\\\d\\\\\\d\\\\\\d)\");\n var found = lines[i].match(regex);\n var startHours = Number(found[1]);\n var startMins = Number(found[2]) + 60*startHours;\n var startSecs = Number(found[3]) + 60*startMins;\n data[currEntry-1].start = Number(found[4]) + 1000*startSecs;\n var endHours = Number(found[5]);\n var endMins = Number(found[6]) + 60*endHours;\n var endSecs = Number(found[7]) + 60*endMins;\n data[currEntry-1].end = Number(found[8]) + 1000*endSecs;\n data[currEntry-1].duration = data[currEntry-1].end - data[currEntry-1].start;\n if (currEntry > 1) {\n var pause = data[currEntry - 1].start - data[currEntry - 2].end;\n if (pause > 0) data[currEntry - 2].pause = pause;\n }\n break;\n case 3: //First line of text\n data[currEntry-1].text = lines[i];\n break;\n default: //Subsequent lines of text\n data[currEntry-1].text += \"\\n\"+lines[i];\n break;\n }\n }\n //Calculate starting index\n var startIndex = 0;\n var startPause = data[0].start;\n if (startTime > 0) {\n while(data[startIndex].end < startTime) {\n startIndex++;\n }\n startPause = data[startIndex].start - startTime;\n }\n setInnerTextBase(\"Subtitles processed!\");\n countDown(countdown,data,startPause,startIndex);\n}", "title": "" }, { "docid": "c1994d2abed976fa4893332145615a8f", "score": "0.5253898", "text": "function setUpBlocks(start, end, thisDate){\n // console.log(thisDate.format(\"M\"));\n for(var i=start;i<=end;i++){ \n var timeOfDay=i; \n var displayTime=timeOfDay;\n var suff=\"<span class='time-suffix'>a.m.</span>\";\n if(displayTime>12){\n displayTime-=12;\n suff=\"<span class='time-suffix'>p.m.</span>\";\n }\n if(displayTime===12) suff=\"<span class='time-suffix'>p.m.</span>\";\n\n // The id will be set to the time of day, 24-hour time\n\n // But the time will be displayed in 12-hour time\n displayTime=displayTime.toString()+\":00 \"+suff;\n // $(\"#displayTime-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate).attr(\"id\", timeOfDay));\n $(\"#time-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate));\n populateEventText(timeOfDay, thisDate);\n }\n}", "title": "" }, { "docid": "12e8afb1d8aabdcc48a88a744767ef42", "score": "0.52318895", "text": "timeline() {\n // Loop through the collected ranges and output as elements\n //\n // Example: 10 years ago |----- Gap -----|----- Filled -----|----- Gap -----| Today\n // Imagine 10 years ago is 0% and today is 100%\n return this.ranges().map((range) => {\n const styles = {\n left: `${range.left}%`,\n width: `${Math.abs(range.width)}%`,\n }\n\n return (\n <div\n key={newGuid()}\n className=\"filled\"\n style={styles}\n data-from={extractDate(range.dates.from)}\n data-to={extractDate(range.dates.to)}\n />\n )\n })\n }", "title": "" }, { "docid": "74ccccb904ad1565e08876e60d3cab01", "score": "0.523092", "text": "function renderTimeIntervals(parentElm) {\n var timeTicksElm = document.createElement('ul'),\n ticksCount = Math.ceil((endHour - startHour) * 60 / timeInterval) + 1,\n i,\n tickHtml = '',\n tm = moment(),\n mins,\n top;\n\n timeTicksElm.className = 'singleDayCal-times';\n tm.hour(startHour);\n tm.minute(0);\n\n for (i = 0; i < ticksCount; i++) {\n mins = i * timeInterval;\n top = mins;\n\n if (mins % 60 === 0) {\n tickHtml += '<li style=\"top: ' + top + 'px\"><em>' + tm.format('h:mm') + '</em>' + tm.format('A') + '</li>';\n } else {\n tickHtml += '<li style=\"top: ' + top + 'px\">' + tm.format('h:mm') + '</li>';\n }\n\n tm.add('m', timeInterval);\n }\n\n timeTicksElm.innerHTML = tickHtml;\n parentElm.appendChild(timeTicksElm);\n\n return timeTicksElm;\n }", "title": "" }, { "docid": "ad3b544dfb7f43def54240e837645707", "score": "0.52043074", "text": "function gitGantt() {\n //the constructor should just create an empty gantt chart with height/width specs provided by dev. \n //the columns for the days of the week should be already there- just no tasks\n\n //this.width = width;\n //this.height = height;\n\n var tasks = document.createElement(\"ul\")\n tasks.id = \"tasks-list\"// can do this in add task though... don't need that in the constructor\n\n \n let days = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"]\n var chart_wrapper = document.createElement(\"div\")\n chart_wrapper.style = \"max-width: 1150px;padding: 0 10px;margin: 0 auto;background: #f5f7f8;font-size: 16px;font-family: didot;padding-top: 40px; box-sizing: border-box;\"\n var days_rows = document.createElement(\"ul\")\n days_rows.id = \"days-of-week\"\n days_rows.style = \"list-style: none;position: relative;display: flex;margin-bottom: 20px;font-weight: bold;font-size: 1.2rem;\"\n var first_sep = document.createElement(\"li\")\n first_sep.style = \"content: '';position: absolute;right: 0;height: 100%;border-right: 1px solid lightgrey;\"\n \n days.forEach(function(day) {\n var day_wrapper = document.createElement(\"li\")\n day_wrapper.id = day\n day_wrapper.style = \"flex: 1;min-width: 80px;text-align: center; position: relative;\"\n var day_sep = document.createElement(\"li\")\n day_sep.style = \"content: '';position: absolute;right: 0;height: 100%;border-right: 1px solid lightgrey;\"\n day_wrapper.appendChild(document.createTextNode(day))\n days_rows.appendChild(day_wrapper)\n day_wrapper.appendChild(day_sep)\n \n })\n days_rows.lastElementChild.removeChild(days_rows.lastElementChild.lastElementChild)\n chart_wrapper.appendChild(days_rows)\n chart_wrapper.lastElementChild.lastElementChild.style = \"flex: 1;min-width: 80px;text-align: center;\"\n //chart_wrapper.lastChild.style = \"flex: 1;min-width: 80px;text-align: center;\"\n this.tasks = tasks\n chart_wrapper.appendChild(this.tasks)\n console.log(this.tasks)\n this.chart_setup = chart_wrapper\n console.log(this.tasks)\n this.taskCounter = 0;\n\n \n \n}", "title": "" }, { "docid": "16f8b04479061afdf04193c1ab1a5ad4", "score": "0.5199735", "text": "function renderTimeControls() {\n const zoomLabels = copy[app.language].timeline.zooms;\n zoomLevels.forEach((level, i) => {\n level.label = zoomLabels[i];\n });\n\n // These controls on timeline svg\n dom.backwards.select('circle')\n .attr('transform', `translate(${scale.x.range()[0] + 20}, 62)`)\n .attr('r', 15);\n\n dom.backwards.select('path')\n .attr('d', d3.symbol().type(d3.symbolTriangle).size(80))\n .attr('transform', `translate(${scale.x.range()[0] + 20}, 62)rotate(270)`);\n\n dom.forward.select('circle')\n .attr('transform', `translate(${scale.x.range()[1] - 20}, 62)`)\n .attr('r', 15);\n\n dom.forward.select('path')\n .attr('d', d3.symbol().type(d3.symbolTriangle).size(80))\n .attr('transform', `translate(${scale.x.range()[1] - 20}, 62)rotate(90)`);\n\n dom.zooms.selectAll('text')\n .text(d => d.label)\n .attr('x', 60)\n .attr('y', (d, i) => (i * 15) + 20)\n .classed('active', level => level.active);\n\n dom.forward\n .on('click', () => moveTime('forward'));\n\n dom.backwards\n .on('click', () => moveTime('backwards'));\n\n dom.zooms.selectAll('text')\n .on('click', zoom => applyZoom(zoom));\n }", "title": "" }, { "docid": "a5a6fecd4f80a3aafa10166e70e20664", "score": "0.5195266", "text": "function eightLineDay(currentDayEntry){\n //This is a reset of the body\n var body = document.querySelector(\"body\");\n body.innerHTML = '';\n // Handeling line 1\n textOnlyH1(currentDayEntry[\"line1\"]);\n // Handeling line 2\n dateLine(currentDayEntry[\"line3\"][0]);//order is switched intentionally\n // Handeling line 3 \n if (currentDayEntry[\"line2\"].length <= 1){\n console.log(\"This currentDayEntry has no real entry for line2\");\n } else {\n sectionHeading(currentDayEntry[\"line2\"][0]);\n textOnly(currentDayEntry[\"line2\"][1]);\n console.log(currentDayEntry[\"line2\"]);\n console.log(currentDayEntry[\"line2\"].slice(1));\n }\n // Handeling line 4\n sectionHeading(\"Daily Scripture Lessions\");\n verseLine(currentDayEntry[\"line3\"].slice(1));\n // Handeling line 5\n sectionHeading(currentDayEntry[\"line4\"][0]);\n verseLine(currentDayEntry[\"line5\"]);\n // Handeling line 6\n sectionHeading(\"Watchword For the Day\");\n textOnly(currentDayEntry[\"line6\"]);\n // Handeling line 7\n sectionHeading(\"Doctrinal Text\");\n textOnly(currentDayEntry[\"line7\"]);\n // Handeling line 7\n sectionHeading(\"Prayer\");\n textOnly(currentDayEntry[\"line8\"]);\n}", "title": "" }, { "docid": "343a0149a30b152f2741177be3d30968", "score": "0.5183573", "text": "function renderPlanner() {\n\n // start from 00 to 23, this can be easily changed to 09 to 17\n let id=\"00\";\n let dayPart = [\"AM\", \"PM\"];\n for (let i=0; i<24; i++){\n // generetate id which will be assigned to all eleemnts in ONE row, represetns hour\n if (i < 10) {\n // for i = 0 1 2 3 ... 9, we need 00, 01, 02 ... 09\n id = (parseInt(i,10) + 100).toString().substring(1);\n } else {\n // this is to make sure this is a string\n id = i.toString();\n } \n\n // create DOM objects\n let row = $(\"<div></div>\");\n let columnLeft = $(\"<div></div>\");\n let columnMiddle = $(\"<div></div>\");\n let columntRight = $(\"<div></div>\");\n\n let leftTime= $(\"<p></p>\");\n let activityNote = $(\"<textarea></textarea>\");\n let saveButton = $(\"<button></button>\");\n\n // add classes to DOM objects\n row.addClass(\"row text-center\");\n columnLeft.addClass(\"col-sm-2 col-2 hour pr-0 text-right\");\n columnMiddle.addClass(\"col-sm-8 col-8 px-0\");\n columntRight.addClass(\"col-sm-2 col-2 pl-0\");\n activityNote.addClass(\"h-100\");\n saveButton.addClass(\"btn btn-primary saveBtn h-100 w-100 btn-block\"); \n \n // here we need to set different backgrounds\n if ( parseInt(id) < parseInt(moment().format('HH'))) {\n // this is past\n activityNote.addClass(\"past\");\n } else if (parseInt(id) === parseInt(moment().format('HH'))) {\n // this is present\n activityNote.addClass(\"present\");\n } else {\n // this is future\n activityNote.addClass(\"future\");\n }\n \n \n // add IDs to each element, each element from the same row will have same numeric part of ID\n // for example, row for time 03am will have the following DOM objects with ids:\n // r03, cl03,cm03,cr03,an03,sb03\n row.attr(\"id\",\"r\" + id);\n columnLeft.attr(\"id\",\"cl\" + id);\n columnMiddle.attr(\"id\",\"cm\" + id);\n columntRight.attr(\"id\",\"cr\" + id);\n activityNote.attr(\"id\",\"an\" + id);\n saveButton.attr(\"id\",\"sb\" + id);\n \n // add text to left columnt, we need to display AM and PM\n (parseInt(id) < 12 ) ? leftTime.text(id + \"AM\") : leftTime.text(id + \"PM\")\n // add text to each save button, add bootstrap type=button \n saveButton.text(\"SAVE\");\n saveButton.attr(\"type\",\"button\");\n // generate local storage key\n let lsID = \"an\" + id;\n // read from local storage\n let localNote = localStorage.getItem(lsID);\n // read and assign to activity note IF NOT NULL\n localNote !== \"null\" ? activityNote.val(localNote) : activityNote.val(\"\");\n\n // append DOM elements\n columnLeft.append(leftTime);\n columnMiddle.append(activityNote);\n columntRight.append(saveButton);\n // append DOM elements to one row\n row.append(columnLeft,columnMiddle,columntRight); \n // append row to the main container\n $(\".container\").append(row);\n \n }\n}", "title": "" }, { "docid": "e30cc8cd6aba9d551f8aeaef7645373d", "score": "0.5159538", "text": "function renderTimeEntries() {\n var timeEntries = (timeKeeper.TimeEntryManager != undefined) ? timeKeeper.TimeEntryManager.getTimeEntries() : [];\n var currentEntryGroupInterval = false;\n\n if (timeEntries) {\n document.getElementById('time-entries-wrapper').innerHTML = '<ul></ul>';\n\n var entry_markup = '';\n var entry_list_container = document.getElementById('time-entries-wrapper').getElementsByTagName('ul').item(0);\n\n var totalTimesByDate = [];\n var weekDays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n var monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n timeEntries.forEach(function(timeEntry, index, entriesList) {\n if (timeEntry instanceof TimeEntry) {\n if (totalTimesByDate[timeEntry.date.toDateString()] == undefined) {\n totalTimesByDate[timeEntry.date.toDateString()] = {};\n totalTimesByDate[timeEntry.date.toDateString()].total_time = 0;\n }\n totalTimesByDate[timeEntry.date.toDateString()].total_time += timeEntry.total_time;\n }\n });\n\n timeEntries.forEach(function(timeEntry, index, entriesList) {\n if (timeEntry instanceof TimeEntry) {\n // First item of a given group. Render group heading and remove it from\n // groups array.\n if (totalTimesByDate[timeEntry.date.toDateString()].rendered == undefined) {\n var totalTimeFormatted = formatTimeAsHoursAndMinutes(totalTimesByDate[timeEntry.date.toDateString()].total_time);\n var formattedGroupDate = weekDays[timeEntry.date.getDay()] + ', ' + padTimeComponentString(timeEntry.date.getDate()) + ' ' + monthNames[timeEntry.date.getMonth()];\n\n var groupNode = document.createElement('div');\n groupNode.dataset['time:entry:group'] = timeEntry.date.toDateString();\n groupNode.id = timeEntry.date.toDateString();\n groupNode.className = 'time-entry-wrapper time-entry-group';\n groupNode.innerHTML = '<div class=\"time-entry-group-heading\">' +\n '<div class=\"time-entry-group-info\">' +\n '<span class=\"time-entry-group-date\">' + formattedGroupDate + '</span>' +\n '</div>' +\n '<div class=\"time-entry-group-total\">' +\n '<span class=\"time-entry-group-total-spent\">' + totalTimeFormatted + '</span>' +\n '</div>' +\n '</div>';\n\n\n // Refresh total time every minute for current day (interval set to\n // every second).\n if (currentEntryGroupInterval === false) {\n var currentDayEntryGroupId = timeEntry.date.toDateString();\n currentEntryGroupInterval = setInterval(function() {\n var groupTotalTime = timeKeeper.TimeEntryManager.getTotalTimeForEntryGroup(currentDayEntryGroupId);\n var currentDayGroupElement = document.getElementById(currentDayEntryGroupId);\n\n // In case there was just one entry, and it was deleted, clear\n // the interval for the current day header update.\n if (currentDayGroupElement === null) {\n clearInterval(currentEntryGroupInterval);\n currentEntryGroupInterval = false;\n return;\n }\n document.getElementById(currentDayEntryGroupId).getElementsByClassName('time-entry-group-total-spent').item(0).innerHTML = groupTotalTime;\n }, 1000);\n }\n\n entry_list_container.appendChild(document.createElement('li')).appendChild(groupNode);\n totalTimesByDate[timeEntry.date.toDateString()].rendered = true;\n }\n\n\n entry_markup = timeEntry.render();\n entry_list_container.appendChild(document.createElement('li')).appendChild(entry_markup);\n }\n });\n }\n}", "title": "" }, { "docid": "cdb53667c25fbb41c316d1a27df194cc", "score": "0.51325506", "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": "" }, { "docid": "2091c00a9203d98a27d870c219ba805d", "score": "0.51125765", "text": "function createAllDates(timetable) {\n if (timetable) {\n return (\n <Typography>\n <Typography style={{fontWeight: \"bold\", fontSize: 18}}> All Dates:</Typography>\n {timetable.map((times) => {\n return (\n <Grid container direction=\"column\" alignItems=\"center\">\n <Typography> Day: {times.day} </Typography>\n <Typography> From: {times.time.from} </Typography>\n <Typography> To: {times.time.to}</Typography>\n <Typography> rhythm: {times.rhythm}</Typography>\n <Typography style={{fontWeight: \"bold\"}}> Duration: </Typography>\n <Typography> {Object.keys(times.duration).indexOf(\"from\") < 0 ? times.duration : \"from \" + times.duration.from + \" to \" + times.duration.to}</Typography>\n <br/>\n </Grid>\n );\n })}\n </Typography>\n );\n } else {\n return <Typography style={{fontWeight: \"bold\", fontSize: 18}}> All Dates:</Typography>;\n }\n}", "title": "" }, { "docid": "2b67208d1b38c32fc012444b89d3e629", "score": "0.5111809", "text": "function updateTimeline (nestedData, oldDomainNestedData, domainNestedData,\n scaleValue, yAxis, yScale, yDomain, width, height, margin, dataArray) {\n const sameDomainData = [];\n const oldDomainData = [];\n const newDomainData = [];\n\n oldDomainNestedData.forEach((d) => {\n if (domainNestedData.indexOf(d.key) !== -1) {\n sameDomainData.push(getDateFormat(scaleValue)(d.key));\n } else {\n oldDomainData.push(getDateFormat(scaleValue)(new Date(Date.parse(d.key))));\n }\n });\n\n domainNestedData.forEach((d) => {\n if (oldDomainNestedData.indexOf(d.key) === -1) {\n newDomainData.push(d);\n }\n });\n\n sameDomainData.forEach((d) => {\n d3.select(`#c${d}`)\n .attr('transform', 'translate(-100, 0)');\n });\n\n oldDomainData.forEach((d) => {\n if (scaleValue === 'Month') {\n d3.select(`#cc${d.replace('/', '')}`).remove();\n } else if (scaleValue === 'Week') {\n d3.select(`#cc${d.replace(/[\\s.]/g, '')}`).remove();\n } else {\n d3.select(`#cc${d}`).remove();\n }\n });\n\n yScale.domain(yDomain).nice();\n d3.select('.axis').call(yAxis);\n updateTicksPosition(d3.select('.axis'), scaleValue);\n\n newDomainData.forEach(() => {\n const circleContainer = createCircleContainer(domainNestedData, yDomain, scaleValue);\n const nestedDataDate = nestDataByDate(dataArray, scaleValue);\n addCircle(height, width, yScale, circleContainer, scaleValue, margin);\n zoomEvent(circleContainer, height, width, margin);\n addSmallPicture(nestedData, domainNestedData, width, yScale, scaleValue, height, margin);\n createWordcloud(domainNestedData, scaleValue, nestedDataDate,\n circleContainer, yScale, width, height, margin);\n });\n}", "title": "" }, { "docid": "48b28d448f4347fe147cefa3de258669", "score": "0.5099925", "text": "function timeline(timelineData) {\n\n timelineOptions.node.append('<table class=\"timelineTable\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">' +\n '<tr id=\"yearGraph\" class=\"yearGraph\"></tr>' +\n '<tr id=\"timeline\" class=\"timeline\"></tr>' +\n '</table>');\n\n var timeObj = getMonthRanges(timelineData.totalTime.startDate, timelineData.totalTime.endDate),\n startDate = new Date(timelineData.totalTime.startDate),\n endDate = new Date(timelineData.totalTime.endDate),\n counter = 1;\n\n for (var i = 1; i <= timeObj.startMonths; i++) {\n // appendMonthGraph(i === 1, (timeObj.startYear - 1).toString().substring(2), 'leftYear');\n appendMonthGraph(false);\n }\n\n for (var i = timeObj.startYear; i <= timeObj.endYear; i++) {\n if (i === timeObj.endYear && timeObj.endMonths === 0) {\n appendMonthGraph(true, i.toString().substring(2), 'rightYear');\n } else if (i === timeObj.startYear && timeObj.startMonths === 0) {\n appendMonthGraph(true, i.toString().substring(2), 'leftYear');\n } else {\n appendMonthGraph(true, i.toString().substring(2));\n }\n if (i != timeObj.endYear) {\n var j = 0;\n while (j < 11) {\n appendMonthGraph(false);\n j++;\n }\n }\n }\n\n for (var i = timelineData.totalTime.months - timeObj.endMonths; i <= timelineData.totalTime.months - 1; i++) {\n appendMonthGraph(false);\n }\n\n for (var i = 0; i < timelineData.totalTime.months; i++) {\n timelineOptions.node.find('.timeline').append('<td class=\"timelineMonth\"><span>-</span></td>');\n }\n\n }", "title": "" }, { "docid": "a1f91fdf3a8a589ef5ca0340b99ec3ec", "score": "0.5096758", "text": "function manipulate(root) {\n\t\n\t// Fill the title\n\t$('#title',root).text(data['title']);\n\t\n\t// Remove example lines\n\tvar lineNumber = 1;\n\twhile (lineNumber <=6) {\n\t\t$('#textLine' + lineNumber,root).replaceWith(\"\");\n\t\tlineNumber += 1;\n\t}\n\t\n\t// Now fill the lines from text\n\tvar index = 0;\n\tvar text = data['text'];\n\tvar line;\n\tvar lineLength = 56;\n\tvar endOfLine = 0;\n\tlineNumber = 1;\n\tvar lines = new Array();\n\t\n\twhile (index < text.length) {\n\t\t// prepare next line\n\t\tline = text.slice(index, index + lineLength);\n\t\t// Is the remaining text too long to fit the line ?\n\t\tif (text.length - index > lineLength) {\n\t\t\t// Then cut the line at its last space\n\t\t\tendOfLine = line.lastIndexOf(\" \");\n\t\t\t// BTW is there a space in this line ?\n\t\t\tif (endOfLine > 0) {\n\t\t\t\t// if so, then do cut\n\t\t\t\tline = line.slice(0, endOfLine);\n\t\t\t};\n\t\t}\n\t\t// This line is ready, keep it.\n\t\tlines.push(line);\n\t\t// Get ready for next line (if any)\n\t\tindex += line.length;\n\t\tlineNumber += 1;\n\t};\n\n // Add the lines to the templates in new tspans\n\t\n var numberOfLines = lineNumber - 1;\n\tlineNumber = 1;\n\t\n\tvar tspan;\n\tvar tspanId;\n\tvar tspanYMin = 111.66666;\n\tvar tspanYMax = 591.66663;\n\tvar tspanY;\n\tvar colorIndex;\n\tvar colors = new Array (\"#ff0000\", \"#00ff00\", \"#0000ff\");\n\tvar tspanColor;\n\tvar svgText = svg.createText();\n\n\twhile (lineNumber <= numberOfLines) {\n\t\t// Prepare a tspan in the template for this line\n\t\tline = lines.pop();\n\t\t// What will its ID be ?\n\t\ttspanId = \"textLine\" + lineNumber;\n\t\t// What's the vertical position it should have ?\n\t\ttspanY = tspanYMin + (tspanYMax - tspanYMin) / (numberOfLines - 1) * (numberOfLines - lineNumber);\n\t\t// What's its color ?\n\t\tcolorIndex = Math.round(((lineNumber / 3) - Math.floor(lineNumber / 3)) * 3) - 1;\n\t\ttspanColor = colors[colorIndex + 1];\n\t\ttspan = '<svg:tspan id=\"' + tspanId + '\" ';\n\t\ttspan += 'sodipodi:role=\"line\" x=\"18.78125\" ';\n\t\ttspan += 'y=\"' + tspanY + '\" ';\n\t\ttspan += 'style=\"fill:' + tspanColor + '\">';\n\t\ttspan += line + '</svg:tspan>';\n\t\t// Add the tspan to this template\n\t\t\tsvgText = svgText.span(line, {id: tspanId, x: \"18.78125\", y: tspanY, fill: tspanColor});\n\t\tlineNumber += 1;\n\t};\n\tsvg.text(null, \"18.78125\", \"111.66666\", svgText, {style: \"font-size:28px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:300%;writing-mode:lr-tb;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial;-inkscape-font-specification:Arial\"});\n}", "title": "" }, { "docid": "07cc628c366ccdb5f3129f5b69ac8b23", "score": "0.50939167", "text": "function pgr_depart_time () {\n let ctx = create('depart-flex', 'depart-comp', 'departments');\n var caption = `Comparison between the timeliness of the departments to which complaints were filed between ${city.name} and the average of ULBs with populations of ${average.name}`;\n let title_text = 'Timeliness of PGR Departments';\n let labels = [];\n let dataset1 = {}; //for the city\n let dataset2 = {}; //for the grade\n dataset1.label = city.name;\n dataset2.label = average.name;\n dataset1.values = [];\n dataset2.values = [];\n\n //allowance needs to be made for the fact that all departments may not be represented in the ULB chosen at random, and so a proper comparison needs to be made\n var form_labels = [];\n var functions = [];\n var ids = [];\n var button_functions = [];\n\n for (var key in city.services[\"PGR\"].departments) {\n labels.push(key);\n // list of datasets\n dataset1.values.push(city.services[\"PGR\"].departments[key].time);\n dataset2.values.push(average.services[\"PGR\"].departments[key].time);\n form_labels.push(`${key} Timeliness`);\n\n //to add the functions that will allow for the range input forms to alter their values\n switch(key) {\n case \"Engineering\":\n functions.push(time_eng);\n ids.push('eng'); //the ids for the range inputs\n button_functions.push(eng_deep); //onclick functions for the deep_dive buttons\n break;\n case \"PHS\":\n functions.push(time_phs);\n ids.push('phs');\n button_functions.push(phs_deep);\n break;\n case \"Town Planning\":\n functions.push(time_tpl);\n ids.push('tpl');\n button_functions.push(tpl_deep);\n break;\n case \"UPA\":\n functions.push(time_upa);\n ids.push('upa');\n button_functions.push(upa_deep);\n break;\n case \"Administration\":\n functions.push(time_admin);\n ids.push('admin');\n button_functions.push(admin_deep);\n break;\n default:\n functions.push(time_rev);\n ids.push('rev');\n button_functions.push(rev_deep)\n break;\n }\n\n }\n\n // for (let i = 0; i < city.services[0].departments.length; i++) {\n // labels.push(city.services[0].departments[i].name);\n // // list of datasets\n // dataset1.values.push(city.services[0].departments[i].time);\n // dataset2.values.push(average.services[0].departments[i].time);\n // }\n draw(ctx, title_text, labels, dataset1, dataset2);\n // form_labels = [\"Engineering Timeliness\", \"PHS Timeliness\", \"Town Planning Timeliness\", \"UPA Timeliness\", \"Administration Timeliness\", \"Revenue Timeliness\"];\n // functions = [time_eng, time_phs, time_tpl, time_upa, time_admin, time_rev];\n form_values = dataset1.values;\n add_form(caption, form_labels, form_values, functions, ids, 'caption4', 'depart-selector', 'depart-flex'); //these functions are those found in updates.js\n add_buttons('time', labels, button_functions, 'depart-select', 'departments');\n}", "title": "" }, { "docid": "859a5dfaf47ce3902a28ab4783a67eeb", "score": "0.50939", "text": "function ready(datapoints) {\n console.log('Data is', datapoints)\n\n datapoints.forEach(function(d) {\n d.datetime = parseTime(d.month)\n })\n\n // Get a list of dates and a list of prices\n let month = datapoints.map(d => d.datetime)\n\n xPositionScale.domain(d3.extent(month))\n\n let prices = datapoints.map(d => d.price)\n yPositionScale.domain(d3.extent(prices))\n\n // Group your data together\n var nested = d3\n .nest()\n .key(function(d) {\n return d.region\n })\n .entries(datapoints)\n console.log(nested)\n // Draw your lines\n svg\n .selectAll('.temp-line')\n .data(nested)\n .enter()\n .append('path')\n .attr('class', 'temp-line')\n .attr('d', d => {\n return line(d.values)\n })\n .attr('stroke-width', 2)\n .attr('fill', 'none')\n .attr('stroke', function(d) {\n return colorScale(d.key)\n })\n\n svg\n .selectAll('.end-circle')\n .data(nested)\n .enter()\n .append('circle')\n .attr('class', 'end-circle')\n .attr('r', 5)\n .attr('cx', function(d) {\n return xPositionScale(d.values[0].datetime)\n })\n .attr('cy', function(d) {\n return yPositionScale(d.values[0].price)\n })\n .attr('fill', function(d) {\n return colorScale(d.key)\n })\n\n // Add your text on the right-hand side\n\n svg\n .selectAll('.region-label')\n .data(nested)\n .enter()\n .append('text')\n .text(d => {\n console.log(d.region)\n return d.values[0].region\n })\n\n .attr('class', 'region-label')\n .attr('x', function(d) {\n return xPositionScale(d.values[0].datetime)\n })\n .attr('y', function(d) {\n return yPositionScale(d.values[0].price)\n })\n .attr('dx', 7)\n .attr('dy', 10)\n\n // Add your title\n svg\n .append('text')\n .text('U.S housing prices fall in winter')\n .attr('x', width - 310)\n .attr('y', height - 640)\n\n // Add the shaded rectangle\n\n var december_16 = parseTime('December-16')\n var february_17 = parseTime('February-17')\n\n svg\n .selectAll('.winter-rect')\n .data(datapoints)\n .enter()\n .append('rect')\n .attr('class', 'winter-rect')\n .attr('width', 10)\n .attr('height', height)\n .attr('fill', '#DCDCDC')\n .attr('y', yPositionScale(d3.max(prices)))\n .attr('x', xPositionScale(december_16))\n .attr('width', xPositionScale(february_17) - xPositionScale(december_16))\n .attr('opacity', 0.1)\n .lower()\n\n // Add your axes\n var xAxis = d3.axisBottom(xPositionScale).tickFormat(d3.timeFormat('%b %y'))\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3.axisLeft(yPositionScale)\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n}", "title": "" }, { "docid": "4176bbcebec98d68b3a81292d0e6709c", "score": "0.50834453", "text": "initTimeline_() {\n this.timeline_.setTimeRange(this.dateRange.min, this.dateRange.max);\n this.timeline_.initLaunches(\n goog.asserts.assert(this.launches), this.currentCategory.value);\n this.timeScale_ =\n this.timeline_.createTimeScale(this.currentChartSize);\n }", "title": "" }, { "docid": "984cba3e75a3220d628ced3fa4a908ed", "score": "0.5081555", "text": "function layOutDay(events)\n{\n\t//turn times into pixels\n\tvar start_time = 9;\n\tvar end_time = 21;\n\tfor(var x = 0;x<events.length;x++)\n\t{\n\t\tvar start_hour = parseInt(events[x]['start'].split(\":\")[0]);\n\t\tvar start_minutes = parseInt(events[x]['start'].split(\":\")[1]);\n\n\t\tvar end_hour = parseInt(events[x]['end'].split(\":\")[0]);\n\t\tvar end_minutes = parseInt(events[x]['end'].split(\":\")[1]);\n\n\t\tevents[x]['start'] = ((start_hour-start_time)*60)+start_minutes;\n\t\tevents[x]['end'] = ((end_hour-start_time)*60)+end_minutes;\n\t}\n\t\n\n\tvar iterate_list = events //list to iterate through\n\tvar aligned_list = new Array(); //already aligned\n\tvar unaligned_list = new Array(); //still to align\n\n\titerate_list.sort(function(a,b) { return a.start - b.start }); //sort based on start time\n\n\tdegree = 1; //all events start out as if they are the only one in that timeslot.\n\n\t//iterate through events until all of them have been aligned\n\twhile(iterate_list.length > 0)\n\t{\t\n\t\t//go through sorted events based on start time\n\t\tfor(var i=0;i<iterate_list.length;i++)\n\t\t{\n\t\t\tfor(var j=i;j<iterate_list.length;j++) //iterate onwards\n\t\t\t{\n\t\t\t\t//if already in the unaligned list, don't check.\n\t\t\t\tif(unaligned_list.indexOf(iterate_list[j])!=-1)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\tFirst event on that degree/level will always have a left-most position because it has been sorted on start time.(i==j)\n\t\t\t\tfind the first event that has a start time great than initial end time\n\t\t\t\t*/\n\t\t\t\tif(iterate_list[j]['start'] > iterate_list[i]['end'] || i==j) \n\t\t\t\t{\n\t\t\t\t\tif(aligned_list.indexOf(iterate_list[j])==-1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//add event to aligned list.\t\n\t\t\t\t\t\titerate_list[j]['degree'] = degree;\n\t\t\t\t\t\titerate_list[j]['position'] = degree;\n\n\t\t\t\t\t\t//iterate through aligned list to determine whether to increase the degree of the already aligned events.\n\t\t\t\t\t\tfor(var a = 0;a<aligned_list.length;a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(iterate_list[j]['start'] <= aligned_list[a]['end'] && iterate_list[j]['end'] >= aligned_list[a]['start'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\taligned_list[a]['degree'] = degree;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taligned_list.push(iterate_list[j]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//now continue checking onwards from this event.\n\t\t\t\t\t\ti=j-1\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//add event to unaligned list.\n\t\t\t\t\tunaligned_list.push(iterate_list[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\titerate_list = unaligned_list;\n\t\tunaligned_list = new Array();\n\t\tdegree++; //now start iterating on the level.\n\t}\n\n\t/*\n\tFinal recalibration.\n\tSome degrees are not properly calibrated because not all events overlap directly.\n\tLook back at the previous element and if it collides, change degree to match.\n\t*/\n\taligned_list.sort(function(a,b) { return a.start - b.start});\n\tfor(var i=1;i<aligned_list.length;i++)\n\t{\n\t\tif(aligned_list[i]['start'] <= aligned_list[i-1]['end'])\n\t\t{\n\t\t\tif(aligned_list[i]['degree'] < aligned_list[i-1]['degree'])\n\t\t\t{\n\t\t\t\taligned_list[i]['degree'] = aligned_list[i-1]['degree'];\n\t\t\t}\n\t\t\telse if(aligned_list[i]['degree'] > aligned_list[i-1]['degree'])\n\t\t\t{\n\t\t\t\taligned_list[i-1]['degree'] = aligned_list[i]['degree'];\n\t\t\t}\n\t\t}\n\t}\n\n\tvar c_width = 600; //calendar width\n\t//iterate through events and add width/left top positions.\n\tfor(var i in aligned_list)\n\t{\n\t\tevents[i]['top'] = aligned_list[i]['start']; //top pixel is the start time\n\t\tevents[i]['left'] = c_width/aligned_list[i]['degree']*(aligned_list[i]['position']-1); //Left most pixel\n\t\tevents[i]['width'] = c_width/aligned_list[i]['degree']-1;\n\t}\n\n\treturn events;\n}", "title": "" }, { "docid": "4d45ffa1e08db57990bc40dc4bcb6904", "score": "0.50777304", "text": "function showTimers() {\n \"use strict\";\n\n db.root.data.arrTasks.forEach( function(task) {\n \n if(task.arrChildTasks.length == 0) {\n var durationTotal = getSpentDuration(task.id);\n var hr = (durationTotal.hours() > 9) ? durationTotal.hours() : \"0\" + durationTotal.hours();\n var min = (durationTotal.minutes() > 9) ? durationTotal.minutes() : \"0\" + durationTotal.minutes();\n var sec = (durationTotal.seconds() > 9) ? durationTotal.seconds() : \"0\" + durationTotal.seconds();\n document.getElementById(\"divTimer_\" + task.id).innerText = hr + \":\" + min + \":\" + sec;\n }\n else {\n task.arrChildTasks.forEach( function(ctask) {\n var durationTotal = getSpentDuration(ctask.id);\n var hr = (durationTotal.hours() > 9) ? durationTotal.hours() : \"0\" + durationTotal.hours();\n var min = (durationTotal.minutes() > 9) ? durationTotal.minutes() : \"0\" + durationTotal.minutes();\n var sec = (durationTotal.seconds() > 9) ? durationTotal.seconds() : \"0\" + durationTotal.seconds();\n document.getElementById(\"divTimer_\" + ctask.id).innerText = hr + \":\" + min + \":\" + sec;\n });\n }\n });\n}", "title": "" }, { "docid": "26d8c2bea52746b5af3e6a2443285221", "score": "0.50724655", "text": "function createTimelineElement(event) {\n let $parentDiv = $('<div>');\n $parentDiv.addClass(\"cd-timeline-block\");\n let $childDiv = $('<div>');\n $childDiv.addClass(\"cd-timeline-img cd-picture\");\n let $iconImage = $('<img>');\n $iconImage.attr('src', '../' + event.imageurl);\n let $timelineContent = $('<div>');\n $timelineContent.addClass('cd-timeline-content');\n let $titleSection = $('<h2>');\n $titleSection.text(event.title);\n let $paragraph = $('<p>');\n $paragraph.text(event.story);\n let dateFormatted = moment(event.date).format(\"MMM Do YY\"); \n let $date = $('<span>');\n $date.addClass('cd-date');\n $date.text(dateFormatted);\n\n $parentDiv.append($childDiv);\n $childDiv.append($iconImage);\n $parentDiv.append($timelineContent);\n $timelineContent.append($titleSection, $paragraph, $date);\n\n return $parentDiv; \n}", "title": "" }, { "docid": "bf4ac16bf5cde624d77b8429cceeada1", "score": "0.504514", "text": "function timelineCount() {\n const containerStops = [mainProjectsContainer.offsetTop, mainContactContainer.offsetTop];\n const bodyHeight = Math.abs(document.body.getBoundingClientRect().y) +300;\n\n if (bodyHeight > containerStops[0] && bodyHeight < containerStops[1]) {\n timeline.firstElementChild.textContent = '2';\n } else if (bodyHeight > containerStops[1]) {\n timeline.firstElementChild.textContent = '3';\n } else {\n timeline.firstElementChild.textContent = '1';\n }\n }", "title": "" }, { "docid": "86ddf0290a45950f56ac589bf6376e16", "score": "0.50427276", "text": "timelineData(){\n return {\n content: this.name,\n start: this.start,\n end: this.end\n }\n }", "title": "" }, { "docid": "c28ed1a2b4de3a209da445e36f0f141c", "score": "0.5037345", "text": "function calculateFillTime(){\r\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\r\n\t\t\t// Si la produccion es 0, el tiempo es infinito\r\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\r\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\r\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\r\n\t\t\t\t\t\tif(getv2()!=1){\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (4-i)).title;} else{\r\n\t\t\t\t\t\tvar produccionHora = get('l' + (1+i)).title;}\r\n\t\t\t\t\t\tvar tiempoRestante = \"<span id='timeouta' style='font-weight:bold' noreload='1'>\" + formatear_tiempo(tiempo) + \"</span>\";\r\n\t\t\t\t\t\tvar celda = elem(\"span\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + calculateHighlight(produccionHora, tiempo, tiempoRestante) + ')</span>');\r\n\t\t\t\t\t\t//var celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\r\n\t\t\tif(getv2()!=1){\r\n\t\t\t\tvar a = get('l'+(4-i)).previousSibling;\r\n\t\t\t} else {\r\n\t\t\t\tvar a = get('l'+(1+i)).previousSibling;\r\n\t\t\t}\r\n\t\t\t// FIXME: Apanyo para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\r\n\t\t\ta.appendChild(celda);\r\n\t\t}\r\n\r\n\t\tget('l1').style.cssText = 'padding-bottom: 5px;';\r\n\t}", "title": "" }, { "docid": "2bf8116d4833bebba5ed19540ea7b79e", "score": "0.50371367", "text": "function BuildBody(TrainingsPlan){\n TrainingsPlan.forEach(TrainingWeek => { \n \n \n TrainingWeek.forEach(day => {\n\n // For each day push a element to weeklyprogram\n dayNames.push(\n [CreateDateDescription(day)],\n );\n dayHeader.push(CreateHeaderOfDay(day))\n dailyProgram.push([\n PopulateBody(day)\n ],\n ); \n });\n // For each week create a new table\n weeklyProgram.push(\n {\n text: 'WEEK ' + weekCounter, //Should be a weekCounter.\n style: 'header'\n\n },\n {\n style: 'tableExample',\n table: { \n // width specified for every table of a day | 7 days in a week.\n widths: ['14.2857142857%', '14.2857142857%','14.2857142857%', '14.2857142857%', '14.2857142857%', '14.2857142857%', '14.2857142857%',],\n //widths: [225, 225, 225, 225, 225, 225, 225],\n body: [\n dayNames,\n dayHeader,\n dailyProgram\n ]\n },\n layout: {\n //// remove all margins in all tables\n //defaultBorder: false,\n // hLineWidth: function(i, node) {\n // return (i === 0 || i === node.table.body.length) ? 0 : 1;\n // },\n // vLineWidth: function(i, node) {\n // return (i === 0 || i === node.table.widths.length) ? 1 : 1;\n // },\n hLineWidth: function (i, node) {\n return (i === 0 ) ? 0 : 1;\n },\n vLineWidth: function(i, node) {\n return (i === 0 ) ? 1 : 1;\n },\n paddingLeft: function(i, node) { return -1; },\n paddingRight: function(i, node) { return -1; },\n paddingTop: function(i, node) { return -1; },\n paddingBottom: function(i, node) { return -1; }\n },\n unbreakable: true\n },\n );\n dayHeader = []; \n dailyProgram = [];\n dayNames = [];\n weekCounter = weekCounter + 1;\n }); \n var formatted = weeklyProgram;\n return formatted;\n }", "title": "" }, { "docid": "9d1ff7a30bc8605c0b4c9f7cb0b416fe", "score": "0.5027197", "text": "function extendTimeline() {\n // node_top_offset = first_node.offsetTop - first_flexbox.offsetTop + 32\n parent_height = document.getElementsByClassName(\"timeline-container\")[0].scrollHeight - 32\n timeline.style.height = parent_height + \"px\";\n // timeline.style.marginTop = node_top_offset + \"px\"\n}", "title": "" }, { "docid": "6ab2cb1fdcc388cc37236837d57a03a4", "score": "0.5022582", "text": "function generateEventDataArray(boxesPerSide, yearID){\n var timelineDataPts = []; //array of points to be plotted on the timeline\n for(var i = 0; i < boxesPerSide; i++) {\n for(var j = 0; j < boxesPerSide; j++) {\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + yearID + \"<br>\"; //label for the year in which the events took place\n for(var numType = 0; numType < 9; numType++){ //check each square for a fill\n var typeSquare = document.getElementById(\"comparetype\" + numType + \"compareyear\" + yearID);\n var triangle = document.getElementById(\"comparetricomparetype\" + numType + \"compareyear\" + yearID); //the triangle occupying the type square. could be null\n //for number of colors\n for(var numClr = 1; numClr <= numColors; numClr++){ //check which color the fill is\n if(triangle != null){\n if(triangle.getAttribute(\"fill\") == arrayColors[numClr-1])\n {\n var country = countryNames[numClr-1];\n //9 if else statements for type of event. to avoid: would be nice to have an added attribute during makeGrid that is eventName\n if(numType == 0){\n //add data point object: year, color, text\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Beginning of war\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Beginning of war <br>\"; //using the color as a key, gets the corresponding country value from countries\n }\n else if(numType == 1){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Conquest, annexation, or union\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Conquest, annexation, or union <br>\";\n }\n else if(numType == 2){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Loss or disaster\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Loss or disaster <br>\";\n }\n else if(numType == 3){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Fall of state\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Fall of state <br>\";\n }\n else if(numType == 4){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Foundation or revolution\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Foundation or revolution <br>\";\n }\n else if(numType == 5){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Treaty or sundry\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Treaty or sundry <br>\";\n }\n else if(numType == 6){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Birth of remarkable individual\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Birth of remarkable individual <br>\";\n }\n else if(numType == 7){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Deed\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Deed <br>\";\n }\n else if(numType == 8){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Death of remarkable individual\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Death of remarkable individual <br>\";\n }\n } //end if triangle.getAttr\n } //end if triangle != null\n if(typeSquare.getAttribute(\"fill\") == arrayColors[numClr-1])\n {\n var country = countryNames[numClr-1];\n //9 if else statements for type of event. to avoid: would be nice to have an added attribute during makeGrid that is eventName\n if(numType == 0){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Beginning of war\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Beginning of war <br>\"; //using the color as a key, gets the corresponding country value from countries\n }\n if(numType == 1){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Conquest, annexation, or union\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Conquest, annexation, or union <br>\";\n }\n if(numType == 2){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Loss or disaster\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Loss or disaster <br>\";\n }\n if(numType == 3){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Fall of state\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Fall of state <br>\";\n }\n if(numType == 4){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Foundation or revolution\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Foundation or revolution <br>\";\n }\n if(numType == 5){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Treaty or sundry\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Treaty or sundry <br>\";\n }\n if(numType == 6){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Birth of remarkable individual\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Birth of remarkable individual <br>\";\n }\n if(numType == 7){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Deed\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Deed <br>\";\n }\n if(numType == 8){\n timelineDataPts.push({year: yearID, color: arrayColors[numClr-1], text: country + \": Death of remarkable individual\"});\n //document.getElementById(\"timeline\").innerHTML = document.getElementById(\"timeline\").innerHTML + country + \": Death of remarkable individual <br>\";\n }\n } //end if typeSquare\n } //end for numClr\n } //end for numType\n yearID = yearID + 1;\n }\n }\n return timelineDataPts;\n }", "title": "" }, { "docid": "e00e37c47b05de1ec9666d3956f5008e", "score": "0.50195795", "text": "add_timeline_block(node_id, node_type, node_name, is_error = false, error_msg = \"\"){\n var extra_class = node_type+\"-block\";\n if (is_error) {\n extra_class = \"error-block\"\n }\n //this.TIMELINE_TEXT.innerHTML = \"Workflow Done\";\n var block_to_add = document.createElement(\"div\");\n block_to_add.setAttribute(\"class\", \"timeline-block-inner \"+extra_class);\n block_to_add.setAttribute(\"data-value\", node_id);\n block_to_add.innerHTML = '<span class=\"tooltiptext\">'+node_name+'</span>';\n\n\n var starting_block = this.DOMS.WORKFLOW.START_BLOCK;\n var found = false;\n\n var dom_elems = document.getElementsByClassName('timeline-block-inner');\n var last_dom = this.DOMS.WORKFLOW.START_BLOCK;\n for (var i = 0; i < dom_elems.length; i++) {\n last_dom = dom_elems[i];\n if(last_dom.getAttribute('data-value') == node_id){\n found = true;\n }\n }\n if (!found) {\n //_insert_after(block_to_add,this.DOMS.WORKFLOW.START_BLOCK);\n _insert_after(block_to_add,last_dom);\n if (is_error) {\n var err_block_msg = document.createElement(\"div\");\n err_block_msg.setAttribute(\"class\", \"timeline-block-inner text-block\");\n err_block_msg.setAttribute(\"data-value\", node_id);\n err_block_msg.innerHTML = \"<label>\"+error_msg+\"</label>\";\n _insert_after(err_block_msg,block_to_add);\n }\n }\n\n\n\n function _insert_after(newNode, referenceNode) {\n referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\n }\n }", "title": "" }, { "docid": "972327d4f1e7056e8f901d781def520e", "score": "0.50103635", "text": "timeline () {\n // Loop through the collected ranges and output as elements\n //\n // Example: 10 years ago |----- Gap -----|----- Filled -----|----- Gap -----| Today\n // Imagine 10 years ago is 0% and today is 100%\n return this.ranges().map((range) => {\n const styles = {\n left: '' + range.left + '%',\n width: '' + range.width + '%'\n }\n return <div className=\"filled\" style={styles}></div>\n })\n }", "title": "" }, { "docid": "c27e583778b8c2d96235a621b491d18c", "score": "0.50072986", "text": "function createEventsSet_test(theSet){\r\n var singleRow = 1; //row \"height\" is 1 minutes\r\n var doubleRow = 2; //two rows is 10 minutes\r\n var events = [];\r\n var rowZeroColumnZero = moment({ years:2016, months:10, date:6, hours:2, minutes:0}); //11/7/16, 2 AM\r\n var prevDividerStart = rowZeroColumnZero;\r\n\r\n theSet.forEach(function(prof, i){\r\n var profName = prof.name;\r\n var profId = 'prof_' + prof.id;\r\n var mwId = 'mw_' + prof.id;\r\n var theStart = i == 0 ? rowZeroColumnZero : prevDividerStart.clone().add(1, 'm');\r\n var theEnd = theStart.clone().add(2, 'm');\r\n events.push(\r\n {\r\n title: profName.substr(0, profName.indexOf(',')+1) + '\\n'\r\n + profName.substr(profName.indexOf(' ')),\r\n start: theStart.toString().slice(16,24),\r\n end: theEnd.toString().slice(16,24),\r\n dow: [0], //dow means day of week -- this is a recurring event\r\n className: 'profName',\r\n order_by: 'A',\r\n color: '#194d96'\r\n },\r\n {\r\n title: 'MW',\r\n start: theStart.toString().slice(16,24),\r\n end: theEnd.toString().slice(16,24),\r\n dow: [0],\r\n className: 'days',\r\n order_by: 'B'\r\n },\r\n {\r\n title: \" \",\r\n start: theStart.clone().add(2, 'm').toString().slice(16,24),\r\n end: theEnd.clone().add(2,'m').toString().slice(16,24),\r\n dow: [0],\r\n className: 'event_placeholder',\r\n order_by: 'A'\r\n },\r\n {\r\n title: 'TTH',\r\n start: theStart.clone().add(2, 'm').toString().slice(16,24),\r\n end: theEnd.clone().add(2,'m').toString().slice(16,24),\r\n dow: [0],\r\n className: 'days',\r\n order_by: 'B'\r\n },\r\n {\r\n title: \" \",\r\n start: theStart.clone().add(4, 'm').toString().slice(16,24),\r\n end: theEnd.clone().add(4,'m').toString().slice(16,24),\r\n dow: [0],\r\n className: 'event_placeholder',\r\n order_by: 'A'\r\n },\r\n {\r\n title: 'MWF',\r\n start: theStart.clone().add(4, 'm').toString().slice(16,24),\r\n end: theEnd.clone().add(4,'m').toString().slice(16,24),\r\n dow: [0],\r\n className: 'days',\r\n order_by: 'B'\r\n }\r\n );\r\n var theCourseTitle;\r\n var theCourseStart;\r\n prof.timedCourses.forEach(function(course, j){\r\n theCourseTitle = course.courseTitle;\r\n theCourseStart = momentGenerator_test(course.startTime, course.courseDays, theStart.clone());\r\n var courseDuration = moment.duration(\r\n moment(course.endTime,'h:mm A').diff(moment(course.startTime, 'h:mm A'))\r\n ).asMinutes();\r\n var overPageBreak = isOverPageBreak(course.startTime, courseDuration);\r\n if (!overPageBreak){\r\n var startMoment = moment(course.startTime, 'h:mm A').format('h:mm A');\r\n var endMoment = moment(course.endTime, 'h:mm A').format('h:mm A');\r\n events.push(\r\n {\r\n title: theCourseTitle + '\\n' + startMoment + ' - ' + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart,\r\n end: theCourseStart.clone().add(1.95,'m'), //just shy of 2 puts a little gap between blocks\r\n className: 'classEvent',\r\n overPageBreak: overPageBreak,\r\n duration: courseDuration,\r\n online: false,\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n }\r\n );\r\n }else{\r\n var minOverPageBreak = getMinutesOverPageBreak(course.startTime, courseDuration);\r\n var startMoment = moment(course.startTime, 'h:mm A').format('h:mm A');\r\n var endMoment = moment(course.endTime, 'h:mm A').format('h:mm A');\r\n events.push(\r\n {\r\n title: theCourseTitle + ' >>>\\n' + startMoment + ' - ' + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart,\r\n end: theCourseStart.clone().add(1.95,'m'), //just shy of 2 puts a little gap between blocks\r\n className: 'classEvent',\r\n overPageBreak: overPageBreak,\r\n relativeToBreak: 'before',\r\n duration: courseDuration,\r\n online: false,\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n },\r\n {\r\n title: theCourseTitle + ' (cont.)\\n' + startMoment + ' - ' + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart.clone().add(2, 'd'),\r\n end: theCourseStart.clone().add(2,'d').add(1.95,'m'),\r\n className: 'classEvent',\r\n overPageBreak: overPageBreak,\r\n relativeToBreak: 'after',\r\n minOverBreak: minOverPageBreak,\r\n duration: courseDuration,\r\n online: false,\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n }\r\n );\r\n }\r\n\r\n });\r\n prof.onlineCourses.forEach(function(course, k){\r\n events.push(\r\n {\r\n title: course.courseTitle + ' -- Online --',\r\n courseTitle: course.courseTitle,\r\n start: theStart.clone().add((doubleRow * 3)+(singleRow * k),'m').toString().slice(16,24),\r\n end: theStart.clone().add((doubleRow * 3)+(singleRow * k)+ 0.95,'m').toString().slice(16,24),\r\n color: '#583372',\r\n className: 'online',\r\n dow: [0],\r\n courseName: course.courseName,\r\n online: true\r\n });\r\n });\r\n prof.nonStandardCourses.forEach(function(course, m){\r\n theCourseStart = momentGenerator_test(course.startTime, course.courseDays, theStart.clone());\r\n var courseDuration = moment.duration(\r\n moment(course.endTime,'h:mm A').diff(moment(course.startTime, 'h:mm A'))\r\n ).asMinutes();\r\n var overPageBreak = isOverPageBreak(course.startTime, courseDuration);\r\n if (!overPageBreak){\r\n var startMoment = moment(course.startTime, 'h:mm A').format('h:mm A');\r\n var endMoment = moment(course.endTime, 'h:mm A').format('h:mm A');\r\n //if (theCourseStart == undefined)\r\n events.push(\r\n {\r\n title: course.courseTitle + '\\n' + startMoment + ' - ' + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart,\r\n end: theCourseStart.clone().add(1.95, 'm'),\r\n duration: courseDuration,\r\n online: false,\r\n overPageBreak: overPageBreak,\r\n className: 'nonStandard',\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n }\r\n );\r\n }else{\r\n var minOverPageBreak = getMinutesOverPageBreak(course.startTime, courseDuration);\r\n startMoment = moment(course.startTime, 'h:mm A').format('h:mm A');\r\n endMoment = moment(course.endTime, 'h:mm A').format('h:mm A');\r\n events.push(\r\n {\r\n title: course.courseTitle + ' >>>\\n' + startMoment\r\n + ' - ' + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart,\r\n end: theCourseStart.clone().add(1.95,'m'), //just shy of 2 puts a little gap between blocks\r\n className: 'nonStandard',\r\n overPageBreak: overPageBreak,\r\n relativeToBreak: 'before',\r\n duration: courseDuration,\r\n online: false,\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n },\r\n {\r\n title: course.courseTitle + \" (cont.)\\n\" + startMoment + \" - \" + endMoment,\r\n courseTitle: course.courseTitle,\r\n start: theCourseStart.clone().add(2, 'd'),\r\n end: theCourseStart.clone().add(2,'d').add(1.95,'m'),\r\n className: 'nonStandard',\r\n overPageBreak: overPageBreak,\r\n relativeToBreak: 'after',\r\n minOverBreak: minOverPageBreak,\r\n duration: courseDuration,\r\n online: false,\r\n startTime: startMoment,\r\n endTime: endMoment,\r\n days: course.courseDays,\r\n courseName: course.courseName,\r\n campus: course.campus,\r\n building: course.building,\r\n room: course.room\r\n }\r\n );\r\n }\r\n\r\n });\r\n prevDividerStart = theStart.clone()\r\n .add((doubleRow * 3) + (singleRow * prof.onlineCourses.length) /*(10 * prof.nonStandardCourses.length)*/, 'm');\r\n\r\n for (i=0; i < 7; i++) {\r\n events.push(\r\n {\r\n title: \"\",\r\n start: prevDividerStart.clone().add(i, 'd').toString().slice(16,24),\r\n end: prevDividerStart.clone()\r\n .add(1, 'm')\r\n .add(i,'d').toString().slice(16,24),\r\n dow: [i],\r\n className: 'profDivider'\r\n });\r\n }\r\n });\r\n return events;\r\n}", "title": "" }, { "docid": "655167f7744b1fb6aef683d083ddd3b0", "score": "0.50070906", "text": "function update_timeline(){\n\n // Array of months to be used to display the correct name\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n // set up a date object we can use, at todays date and time\n var time = new Date();\n\n // set the time_label's text value to the current time in format \"07:21:01\"\n $(\"#time_label\").text(checktime( time.getHours()) + \":\" + checktime(time.getMinutes()) + \":\" + checktime(time.getSeconds()));\n\n // Set the date_labels date to todays date in format \"1st November 2015\"\n $(\"#date_label\").text(getDateFormatted( time.getDate() ) + \" \" + months[time.getMonth()] + \" \" + (time.getYear() + 1900));\n\n // update the position of each of the time_indicators to be relative to the current_time_indicator\n $(\".time_indicator\").each(function(){\n // variable to keep track of the time_indicators locations\n var j;\n $(this).css(\"left\", function(){\n j = $(this).data('left');\n var multiplier = 2.5;\n if (j <= 5 ){\n return \"calc(50% - \" + ( ( j * 60 * multiplier ) + ( time.getMinutes() * multiplier) ) + \"px)\";\n } else {\n return \"calc(50% + \" + ( ( (j % 6) * 60 * multiplier ) - ( time.getMinutes() * multiplier) ) + \"px)\";\n }\n }).find(\".timelabel\").text(function(){\n if (j <= 5 ){\n return ( time.getHours() - j + \":00\" ) ;\n } else {\n return ( time.getHours() + (j % 6) + \":00\" ) ;\n }\n });\n });\n\n // update the timeline every half a second\n setTimeout(update_timeline, 500);\n}", "title": "" }, { "docid": "d5b6d9ae36f9713834edf0b6681a89cf", "score": "0.500356", "text": "constructor(allComplaintsData) {\n\n this.divTimeLine = d3.select(\"#timeline\");\n\n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n\n // Get SVG Bounds and add SVG\n this.svgBounds = this.divTimeLine.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 350;\n this.height1 = 220;\n this.height2 = 50;\n\n this.legendSVG = this.divTimeLine\n .append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", 20);\n\n this.svg = this.divTimeLine\n .append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight);\n\n this.tooltipDiv = this.divTimeLine.append(\"div\")\n .attr(\"id\", \"timetool\")\n .style(\"opacity\", 0);\n\n this.tooltipSpan = this.tooltipDiv.append(\"span\");\n\n // Initializing the Time parser and Scales\n this.parseTime = d3.timeParse(\"%m/%d/%Y\");\n this.parseTimeContext = d3.timeParse(\"%m/%Y\");\n\n this.xScale = d3.scaleTime().range([0, this.svgWidth]);\n this.yScale = d3.scaleLinear().range([this.height1, 0]);\n this.x2Scale = d3.scaleTime().range([0, this.svgWidth]);\n this.y2Scale = d3.scaleLinear().range([this.height2, 0]);\n this.colorScale = d3.scaleOrdinal(d3.schemeCategory20c);\n this.channelScale = d3.scaleLinear()\n .domain([0,100])\n .range([0,100]);\n\n // Initializing the data for this chart\n\n this.data = d3.nest()\n .key(d => d[\"Date received\"])\n .rollup(function (d) {\n return {\n \"Total\": d3.sum(d, d => 1),\n \"TimelyResponse\": d3.sum(d, d => d[\"Timely response?\"] == \"Yes\" ? 1 : 0),\n \"Disputed\": d3.sum(d, d => d[\"Consumer disputed?\"] == \"Yes\" ? 1 : 0),\n \"Fax\": d3.sum(d, d => d[\"Submitted via\"] == \"Fax\" ? 1 : 0),\n \"Web\": d3.sum(d, d => d[\"Submitted via\"] == \"Web\" ? 1 : 0),\n \"Referral\": d3.sum(d, d => d[\"Submitted via\"] == \"Referral\" ? 1 : 0),\n \"Phone\": d3.sum(d, d => d[\"Submitted via\"] == \"Phone\" ? 1 : 0),\n \"Postal\": d3.sum(d, d => d[\"Submitted via\"] == \"Postal mail\" ? 1 : 0),\n \"Mail\": d3.sum(d, d => d[\"Submitted via\"] == \"Mail\" ? 1 : 0)\n }\n }).entries(allComplaintsData);\n\n this.contextdata = d3.nest()\n .key(function (d) {\n let splitDate = d[\"Date received\"].split(\"/\");\n return splitDate[0]+\"/\"+splitDate[2];\n })\n .rollup(function(d) {\n return {\n \"Total\": d3.sum(d, d => 1),\n \"TimelyResponse\": d3.sum(d, d => d[\"Timely response?\"]==\"Yes\" ? 1: 0 ),\n \"Disputed\": d3.sum(d, d => d[\"Consumer disputed?\"]==\"Yes\" ? 1: 0 ),\n \"Fax\": d3.sum(d, d => d[\"Submitted via\"]==\"Fax\" ? 1: 0 ),\n \"Web\": d3.sum(d, d => d[\"Submitted via\"]==\"Web\" ? 1: 0 ),\n \"Referral\": d3.sum(d, d => d[\"Submitted via\"]==\"Referral\" ? 1: 0 ),\n \"Phone\": d3.sum(d, d => d[\"Submitted via\"]==\"Phone\" ? 1: 0 ),\n \"Postal\": d3.sum(d, d => d[\"Submitted via\"]==\"Postal mail\" ? 1: 0 ),\n \"Mail\": d3.sum(d, d => d[\"Submitted via\"]==\"Mail\" ? 1: 0 )\n }\n }).entries(allComplaintsData);\n\n\n\n }", "title": "" }, { "docid": "a211801c7eeed4d8ec8171fef4eea4d7", "score": "0.5001015", "text": "function nestObj() {\r\n objCount++;\r\n taskObj[objCount] = {};\r\n taskObj[objCount].id = \"t\" + objCount;\r\n taskObj[objCount].date = dateEl.value;\r\n taskObj[objCount].make = [inputEl.value];\r\n dateEl.value = \"\";\r\n inputEl.value = \"\";\r\n}", "title": "" }, { "docid": "c296d276bf8303f4ac980c1902af405e", "score": "0.5000925", "text": "function renderTimeLine(data) {\n let items = new DataSet(data);\n\n let options = {\n type: 'background',\n editable: {\n add: true\n },\n minHeight: 300,\n zoomMin: 8.64e+6,\n zoomMax: 2.628e+9,\n onAdd: function (item, callback) {\n axios({\n method: 'post',\n url: 'api/consultations',\n data: {\n date: moment.utc(item.start).format()\n }\n })\n .then(function (response) {\n if (response.data.data) {\n Swal.fire(\n 'Successful booking!',\n 'We are expecting you on ' + moment(response.data.data.start).format('MMMM Do YYYY, h:mm:ss a'),\n 'success'\n );\n\n callback(response.data.data);\n } else {\n Swal.fire('Oops...', 'Response data is undefined', 'error');\n\n callback(null);\n }\n })\n .catch(function (error) {\n let title = 'Oops...';\n let message = '';\n let icon = 'error';\n\n if (error.response) {\n let errorData = error.response.data;\n\n if (errorData.errors.global[0] !== '') {\n title = 'Oh no...';\n message = errorData.errors.global[0];\n icon = 'info';\n } else {\n message = 'Something went wrong!';\n }\n } else {\n message = 'Something went wrong!';\n }\n\n Swal.fire(title, message, icon);\n\n callback(null);\n });\n }\n };\n\n let timeline = new Timeline(container, items, options);\n}", "title": "" }, { "docid": "850093cbfc0e4fea4b7cd7a9de15e599", "score": "0.4999587", "text": "function createStructure() {\n // loops over all 27 entries\n entireJSON.TEI.text.body.div.forEach(function(entry) {\n \t\t\t//console.log(entry);\n\n \t\t\t// loops over date and paragraph of each 27 \n \t\t\tentry.p.forEach(function(dp) {\n \t\t\t\t//console.log(dp);\n \t\t\t var singleEntry = document.createElement(\"div\");\n \t\t\t\t$(singleEntry).attr(\"class\", \"allEntries\");\n \t\t\t\tvar dateDiv = document.createElement(\"div\");\n \t\t\t\tvar dateCurr = dp.title;\n \t\t\t\tvar nameCurr = dp.__text;\n \t\t\t\tdateDiv.innerHTML = dateCurr;\n \t\t\t\tdateDiv.style.textDecoration=\"underline\";\n \t\t\t\tsingleEntry.innerHTML = nameCurr;\n \t\t\t\t//console.log(dateCurr)\n \t\t\t\tif (typeof(dateCurr) != \"undefined\") {\n \t\t\t\t\tdocument.body.appendChild(dateDiv);\n \t\t\t\t}\n \t\t\t\tif (typeof(nameCurr) != \"undefined\") {\n \t\t\t\t\tdocument.body.appendChild(singleEntry);\n \t\t\t\t}\n \t\t\t});\n\t\t});\n }", "title": "" }, { "docid": "c9cd0f57b7950c8304dcef16ed20914a", "score": "0.49905294", "text": "function updateTimeHeader() {\n //could define past and future first, which might make building a dynamically sized timeline easier:\n //var d = new Date();\n //var dateRange = 1; //define the number of days on either side of today\n //pastTime = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate() - dateRange));\n //futureTime = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate() + dateRange+1));\n //then use for to loop through the difference between the two dates to build the tables and assign headers\n\n /*position nowMarker*/\n var d = new Date();\n currentTime = new Date(d); //set current time for drawings\n var h = d.getUTCHours();\n var m = d.getUTCMinutes();\n document.getElementById(\"nowMarker\").setAttribute(\"style\", \"grid-column:\" + (startGridNum + 24 + h) + \";\");\n document.getElementById(\"nowLine\").style.left = (m / 60 * 100) + \"%\";\n /*date labels and time limit global variables*/\n document.getElementById(\"todayHeader\").innerHTML = formatDate(d);\n d.setUTCDate(d.getUTCDate() - 1);\n document.getElementById(\"yesterdayHeader\").innerHTML = formatDate(d);\n pastTime = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 0, 0));\n d.setUTCDate(d.getUTCDate() + 2);\n document.getElementById(\"tomorrowHeader\").innerHTML = formatDate(d);\n d.setUTCDate(d.getUTCDate() + 1);\n futureTime = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 0, 0));\n}", "title": "" }, { "docid": "4f74e8bf9882158f8e695c9afe22b46f", "score": "0.4990319", "text": "function getTimeline(){\r\n\tvar timelineTemplate = [\r\n\t'<div class=\"frst-timeline-block lab-item frst-timeline-completed\" data-animation=\"slideInUp\">',\r\n\t\t'<div class=\"lab-timeline-img\"><span></span></div>',\r\n\t\t'<!-- frst-timeline-img -->',\r\n\t\t'<div class=\"frst-timeline-content animated rotateInDownRight\" style=\"position: relative;\">',\r\n\t\t\t'<div class=\"frst-timeline-content-inner\">',\r\n\t\t\t\t'<span class=\"frst-date\">06/16/2017<br>9:00 - 10:00AM</span>',\r\n\t\t\t\t'<h2>9999</h2>',\r\n\t\t\t\t'<p>session: 1-abc</p>', \r\n\t\t\t\t'<p>score: 4141</p>', \r\n\t\t\t\t'<p>location: lab</p>',\r\n\t\t\t'</div>',\r\n\t\t\t'<!-- frst-timeline-content-inner -->',\r\n\t\t'</div>',\r\n\t\t'<!-- frst-timeline-content -->',\r\n\t'</div>'\r\n\t].join('');\r\n\tfor (i = 0; i < 1; i++) {\r\n\t\t$('#timeline').append(timelineTemplate)//most recent subject on top bar\r\n\t}\r\n}", "title": "" }, { "docid": "31631aafe63424596428a70dbb1ecb1c", "score": "0.49869624", "text": "function formatLine(text, extraData)\n{\n\tvar arrayOfText = dateTimeSplit(text);\n\tlet timeFormat = dateTimeFormat(arrayOfText, true);\n\textraData[\"lastLineSame\"] = checkIfTimeStampSame(arrayOfText, extraData, \"lastLine\");\n\textraData[\"nextLineSame\"] = checkIfTimeStampSame(arrayOfText, extraData, \"nextLine\");\n\tif(dateTextGroup !== \"false\" && extraData[\"lastLineSame\"])\n\t{\n\t\ttimeFormat = \"\";\n\t}\n\telse if (dateTextBold === \"true\")\n\t{\n\t\ttimeFormat = \"<b>\" + timeFormat + \"</b>\";\n\t}\n\n\tlet timePadding = \"<td style=\\\"width: \"+dateTimePadding+\"px;\\\" ></td>\";\n\tlet timePaddingAlternative = \"<span style=\\\"width: 5px; display: inline-block;\\\" ></span>\";\n\tlet timeTd = \"<td style=\\\"white-space:nowrap;width: 1%;\\\">\";\n\tlet lineTd = \"<td style=\\\"white-space: pre-wrap; padding: 0;\\\">\";\n\n\tif(dateTextFormatEnable === \"true\" && dateTextFormatColumn !== \"false\")\n\t{\n\t\tif((dateTextFormatColumn === \"true\" || (dateTextFormatColumn === \"auto\" && window.innerWidth > breakPointTwo)))\n\t\t{\n\t\t\tif(\"lineDisplay\" in extraData && extraData[\"lineDisplay\"] === \"true\")\n\t\t\t{\n\t\t\t\treturn timeTd + timeFormat + extraData[\"lineCount\"] + \"</td>\" + timePadding + lineTd + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n\t\t\t}\n\t\t\treturn timeTd + timeFormat + \"</td>\" + timePadding + lineTd + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(\"lineDisplay\" in extraData && extraData[\"lineDisplay\"] === \"true\")\n\t\t\t{\n\t\t\t\treturn timeTd + extraData[\"lineCount\"] + \"</td>\" + lineTd + timeFormat + timePaddingAlternative + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n\t\t\t}\n\t\t\treturn lineTd + timeFormat + timePaddingAlternative + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n\t\t}\n\t}\n\telse if(\"lineDisplay\" in extraData && extraData[\"lineDisplay\"] === \"true\")\n\t{\n\t\treturn timeTd + extraData[\"lineCount\"] + \"</td>\" + lineTd + timeFormat + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n\t}\n\treturn lineTd + timeFormat + formatMainMessage(arrayOfText[1], extraData) + \"</td>\";\n}", "title": "" }, { "docid": "d0671a5821aaadf5803802d2600a3bff", "score": "0.49799326", "text": "function multiLineChartFunc(values,divToShow,title){\n\n var svg = d3.select(divToShow),\n margin = {top: 20, right: 220, bottom: 40, left: 60},\n width = 1400 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n var formatDate = d3.time.format(\"%Y-%m-%d %H:%M:%S\").parse;\n\n var x = d3.time.scale().range([0, width]),\n y = d3.scale.linear().range([height, 0]);\n\n if (title.indexOf('separated')>=0) {\n var color = d3.scale.ordinal()\n .range([\"#ff7f0e\", \"#d62728\", \"#1f77b4\", \"#2ca02c\", \"#9467bd\", \"#bcbd22\", \"#17becf\", \"#e377c2\", \"#ffbb78\", \"#ff9896\", \"#aec7e8\", \"#98df8a\", \"#c5b0d5\", \"#dbdb8d\", \"#9edae5\", \"#f7b6d2\", '#000000', '#7f7f7f'])\n .domain(['evgen_running', 'pile_running', 'simul_running', 'recon_running', 'reprocessing_running', 'deriv_running', 'merge_running', 'eventIndex_running','evgen_waiting', 'pile_waiting', 'simul_waiting', 'recon_waiting', 'reprocessing_waiting', 'deriv_waiting', 'merge_waiting', 'eventIndex_waiting', 'total_running', 'total_waiting']);\n }\n else {\n var color = d3.scale.ordinal()\n .range([ \"#248F24\", \"#47D147\", \"#c7c7c7\"])\n .domain(['used', 'running', 'waiting']);\n }\n var line = d3.svg.line()\n .x(function(d) { return x(d.timestamp); })\n .y(function(d) { return y(d.nevents); });\n\n var data = values;\n\n // data structure:\n // [{'state1': ev_state1, 'values1': [{'date':parsed_date, 'nevents': nevents}, ...]}]\n\n nevents = [];\n for (var i=0; i<data.length; i++) {\n data[i].values.forEach(function (d) {\n d.timestamp = formatDate(d.timestamp);\n nevents.push(d.nevents)\n })\n }\n\n x.domain(d3.extent(data[0].values, function (d) { return d.timestamp; }));\n\n y.domain([ 0, d3.max(nevents) ]);\n\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickFormat(hFormat);\n\n var vis = svg\n\t.data([data])\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right )\n .attr(\"height\", height + margin.top + margin.bottom )\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n vis.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n vis.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(yAxis);\n vis.append(\"g\")\n .attr(\"transform\", \"rotate(-90)\")\n\t\t.append(\"text\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"N events\");\n\n vis.append(\"g\")\n .attr(\"transform\", \"translate(\" + ( (width)/2 ) + \",\" + ( -10 ) + \")\")\n .append(\"text\")\n .attr(\"class\", \"title\")\n .text(title);\n\n var evlines = vis.selectAll(\".state\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"state\");\n\n evlines.append(\"path\")\n .attr(\"class\", \"linenevents\")\n .attr(\"d\", function(d) { return line(d.values); })\n .style(\"stroke\", function(d) { return color(d.state); });\n\n\n var mouseG = vis.append(\"g\")\n .attr(\"class\", \"mouse-over-effects\");\n\n mouseG.append(\"path\") // this is the black vertical line to follow mouse\n .attr(\"class\", \"mouse-line\")\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n var lines = document.getElementsByClassName('linenevents');\n\n var mousePerLine = mouseG.selectAll('.mouse-per-line')\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"mouse-per-line\");\n\n mousePerLine.append(\"circle\")\n .attr(\"r\", 7)\n .style(\"stroke\", function(d) {\n return color(d.state);\n })\n .style(\"fill\", \"none\")\n .style(\"stroke-width\", \"1px\")\n .style(\"opacity\", \"0\");\n\n mousePerLine.append(\"text\")\n .attr(\"transform\", \"translate(10,3)\");\n\n mouseG.append('svg:rect') // append a rect to catch mouse movements on canvas\n .attr('width', width) // can't catch mouse events on a g element\n .attr('height', height)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .on('mouseout', function() { // on mouse out hide line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"0\");\n d3.selectAll(\".mouse-per-line circle\")\n .style(\"opacity\", \"0\");\n d3.selectAll(\".mouse-per-line text\")\n .style(\"opacity\", \"0\");\n })\n .on('mouseover', function() { // on mouse in show line, circles and text\n d3.select(\".mouse-line\")\n .style(\"opacity\", \"1\");\n d3.selectAll(\".mouse-per-line circle\")\n .style(\"opacity\", \"1\");\n d3.selectAll(\".mouse-per-line text\")\n .style(\"opacity\", \"1\");\n })\n .on('mousemove', function() { // mouse moving over canvas\n var mouse = d3.mouse(this);\n d3.select(\".mouse-line\")\n .attr(\"d\", function() {\n var d = \"M\" + mouse[0] + \",\" + height;\n d += \" \" + mouse[0] + \",\" + 0;\n return d;\n });\n\n d3.selectAll(\".mouse-per-line\")\n .attr(\"transform\", function(d, i) {\n // console.log(width/mouse[0])\n var xDate = x.invert(mouse[0]),\n bisect = d3.bisector(function(d) { return d.timestamp; }).right;\n idx = bisect(d.values, xDate);\n\n var beginning = 0,\n end = lines[i].getTotalLength(),\n target = null;\n\n while (true){\n target = Math.floor((beginning + end) / 2);\n pos = lines[i].getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mouse[0]) {\n break;\n }\n if (pos.x > mouse[0]) end = target;\n else if (pos.x < mouse[0]) beginning = target;\n else break; //position found\n }\n\n d3.select(this).select('text')\n .text(Humanize.compactInteger(y.invert(pos.y),2));\n\n\n\n return \"translate(\" + mouse[0] + \",\" + pos.y +\")\";\n });\n });\n\n var states = data.map(function (d) {\n return d.state;\n });\n\n var squareside = 15;\n var legend = vis.selectAll(\".legend\")\n .data(states.sort())\n .enter().append(\"g\")\n .attr(\"class\", \"legendoutpie\")\n .attr(\"transform\", function(d, i) {\n maxLegendWidth = 65;\n maxLegendHeight = Math.floor(i) * 20;\n return \"translate(\" + (width + maxLegendWidth) + \", \" + (maxLegendHeight) + \")\";\n });\n\n legend.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"width\", squareside)\n .attr(\"height\", squareside)\n .style(\"fill\", color)\n .style({\"stroke\":d3.rgb(color).darker(),'stroke-width':0.4});\n\n legend.append(\"text\")\n .attr(\"x\", squareside+5)\n .attr(\"y\", 12)\n .text(function(d) {\n return d;\n });\n\n}", "title": "" }, { "docid": "fd66f180fc235388ffa897ecf0be9d0d", "score": "0.49797547", "text": "function buildDailyPlanner() {\n //since planner will only contain work-day hours, need 9 rows (9-5)\n for (var hourOnPlanner = 9; hourOnPlanner < 18; hourOnPlanner++) {\n //1.A. add 9 rows to the planner, 1 for each day\n var $rowContainer = $(\"<div>\");\n $rowContainer.addClass(\"row\");\n $rowContainer.attr(\"index\", hourOnPlanner);\n\n //calls helper functions to add each portion of the daily planner rows and determines the color based on the time of day\n addTimeColumnToRow($rowContainer);\n addInputAbilityColumnToRow($rowContainer);\n addSaveButtonToRow($rowContainer);\n addColorToRows($rowContainer, hourOnPlanner);\n\n //Last step is to add the row and all its new contents to the daily planner\n $dailyPlanner.append($rowContainer);\n }\n}", "title": "" }, { "docid": "8695a1b2f1f7e1211687231e9952fb86", "score": "0.49749875", "text": "function makeTimeline([start,end]){\r\n\t\t\t\t\tlet knownEnd = 2298.549; //~38 min and 18 seconds\r\n\t\t\t\t\tlet w = (end-start)/knownEnd*150;\r\n\t\t\t\t\tlet l = start/knownEnd*150;\r\n\t\t\t\t\treturn\"<span class='seg-bg'> <span class='seg-fg' style='width:\"+w+\"px; left:\"+l+\"px;'></span></span>\"\r\n\t\t\t\t}", "title": "" }, { "docid": "cdb654dfc0dd32754165c9435d621f9a", "score": "0.49707022", "text": "initTimelineConfig() {\n var self = this;\n var color = self.colorRange;\n var stackList = {},\n maxStack = 0,\n minTime = 0,\n maxTime = 0,\n width = self.width - self.margin.left - self.margin.right,\n height = self.height - self.margin.top - self.margin.bottom;\n\n // count number of stack and calculate min time, max time from data\n if (self.stack || self.ending === 0 || self.starting === 0) {\n \n self.data.forEach(function (datum, index) {\n\n if (self.stack && Object.keys(stackList).indexOf(index) == -1) {\n stackList[index] = maxStack;\n maxStack++;\n }\n\n datum.times.forEach(function (time, i) {\n if(self.starting === 0)\n if (time.starting_time < minTime || minTime === 0)\n minTime = time.starting_time;\n if(self.ending === 0) {\n if (time.starting_time > maxTime)\n maxTime = time.starting_time;\n if (time.ending_time > maxTime)\n maxTime = time.ending_time;\n }\n });\n });\n\n if (self.ending === 0) {\n self.ending = maxTime;\n }\n if (self.starting === 0) {\n self.starting = minTime;\n }\n }\n\n self.maxStack = maxStack;\n var scale = width / (self.ending - self.starting);\n\n self.data.forEach( function(datum, index){\n var data = datum.times;\n //draw background\n if (self.backgroundColor) { \n var barYAxis = ((self.itemHeight + self.itemMargin) * stackList[index]);\n self.svg.selectAll(\"g\")\n .data(data).enter()\n .insert(\"rect\")\n .attr(\"class\", \"timeline-background-bar\")\n .attr(\"x\", 0)\n .attr(\"width\", width)\n .attr(\"y\", barYAxis)\n .attr(\"height\", self.itemHeight)\n .attr(\"fill\", self.backgroundColor instanceof Function ? self.backgroundColor(index) : self.backgroundColor);\n }\n\n //draw item\n self.svg.selectAll(\"g\")\n .data(data).enter()\n .append(function(d, i) {\n return document.createElementNS(d3.ns.prefix.svg, \"ending_time\" in d? \"rect\" : \"circle\");\n })\n .attr(\"x\", getXPos)\n .attr(\"y\", getStackPosition)\n .attr(\"width\", function (d, i) {\n return (d.ending_time - d.starting_time) * scale;\n })\n .attr(\"cy\", function(d, i) {\n return getStackPosition(d, i) + self.itemHeight / 2;\n })\n .attr(\"cx\", getXPos)\n .attr(\"r\", self.itemHeight / 2)\n .attr(\"height\", self.itemHeight)\n .style(\"fill\", color(index));\n\n //draw label inside item\n self.svg.selectAll(\"g\")\n .data(data).enter()\n .append(\"text\")\n .attr(\"x\", getXTextPos)\n .attr(\"y\", getStackTextPosition)\n .text(function(d) {\n return d.name;\n });\n\n if (self.rowSeparator && index < self.maxStack - 1) {\n var lineYAxis = ( self.itemHeight + self.itemMargin / 2 + (self.itemHeight + self.itemMargin) * stackList[index]);\n self.svg.append(\"svg:line\")\n .attr(\"class\", \"timeline-row-separator\")\n .attr(\"x1\", 0)\n .attr(\"x2\", width)\n .attr(\"y1\", lineYAxis)\n .attr(\"y2\", lineYAxis)\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", self.rowSeparator instanceof Function ? self.rowSeparator(index) : self.rowSeparator);\n }\n\n //draw the label left side item\n if (typeof(datum.name) !== \"undefined\") { \n var rowsDown = self.margin.top + (self.itemHeight + self.itemMargin) * (stackList[index] === undefined ? 0 : stackList[index]) + self.itemHeight * 0.75;\n\n d3.select(self.svg[0][0].parentNode).append(\"text\")\n .attr(\"class\", \"timeline-label\")\n .attr(\"transform\", \"translate(\" + self.labelMargin + \",\" + rowsDown + \")\")\n .text(datum.name);\n }\n //draw icon\n else if (typeof(datum.icon) !== \"undefined\") {\n d3.select(self.svg[0][0].parentNode).append(\"image\")\n .attr(\"class\", \"timeline-label\")\n .attr(\"transform\", \"translate(\"+ self.labelMargin +\",\"+ (self.margin.top + (self.itemHeight + self.itemMargin) * stackList[index])+\")\")\n .attr(\"xlink:href\", datum.icon)\n .attr(\"width\", self.itemHeight)\n .attr(\"height\", self.itemHeight);\n }\n\n function getStackPosition(d, i) {\n if (self.stack) {\n return (self.itemHeight + self.itemMargin) * stackList[index];\n }\n return 0;\n }\n function getStackTextPosition(d, i) {\n if (self.stack) {\n return (self.itemHeight + self.itemMargin) * stackList[index] + self.itemHeight * 0.75;\n }\n return self.itemHeight * 0.75;\n }\n });\n\n function getXPos(d, i) {\n return (d.starting_time - self.starting) * scale;\n }\n\n function getXTextPos(d, i) {\n return (d.starting_time - self.starting) * scale + 5;\n }\n }", "title": "" }, { "docid": "835a7f2394cc4cedb24a91954f7c513b", "score": "0.49646533", "text": "function sevenLineDay(currentDayEntry){\n //This is a reset of the body\n var body = document.querySelector(\"body\");\n body.innerHTML = '';\n // Handeling line 1\n textOnlyH1(currentDayEntry[\"line1\"][0]);\n // Handeling line 2\n dateLine(currentDayEntry[\"line3\"][0]);//order is switched intentionally\n // Handeling line 3\n if (currentDayEntry[\"line2\"].length == 2){\n sectionHeading(currentDayEntry[\"line2\"][0]);\n textOnly(currentDayEntry[\"line2\"][1]);\n } else {\n sectionHeading(\"Watchword for the Week\");\n textOnly(currentDayEntry[\"line2\"][0]);\n }\n \n // Handeling line 4\n sectionHeading(\"Daily Scripture Lessions\");\n verseLine(currentDayEntry[\"line4\"]);\n // Handeling line 5\n sectionHeading(\"Watchword For the Day\");\n textOnly(currentDayEntry[\"line5\"][0]);\n // Handeling line 6\n sectionHeading(\"Doctrinal Text\");\n textOnly(currentDayEntry[\"line6\"]);\n // Handeling line 7\n sectionHeading(\"Prayer\");\n textOnly(currentDayEntry[\"line7\"]);\n}", "title": "" }, { "docid": "83d1ce9e3df1f931fbeba0e02639ead5", "score": "0.4955004", "text": "function loadAndDrawTaskTimeline(div_id){\n var data = webData.TimelineData;\n for(var i in data){\n var startTime = tsToTime(parseInt(data[i][2]));\n var endTime = tsToTime(parseInt(data[i][3]));\n if (typeof (data[i][2]) == \"string\"){\n data[i][2] = new Date (\n startTime.year, startTime.mon, startTime.day, startTime.hour,\n startTime.minu, startTime.sec, startTime.mili);\n data[i][3] = new Date (\n endTime.year, endTime.mon, endTime.day, endTime.hour,\n endTime.minu, endTime.sec, endTime.mili);\n }\n }\n drawChartTaskTimeline(data, div_id);\n}", "title": "" }, { "docid": "dac9ed9b4a2760b8795a21531c606e22", "score": "0.4945051", "text": "function nineLineDay(currentDayEntry){\n //This is a reset of the body\n var body = document.querySelector(\"body\");\n body.innerHTML = '';\n // Handeling line 1\n textOnlyH1(currentDayEntry[\"line1\"][0]);\n // Handeling line 2\n dateLine(currentDayEntry[\"line3\"]);\n // Handeling line 3\n if (currentDayEntry[\"line1\"][0] === currentDayEntry[\"line2\"][0]){\n console.log(\"Line one and two are the same. Skipping line 2!\");\n }\n else if (currentDayEntry[\"line2\"].length <= 1){\n console.log(\"This currentDayEntry has no real entry for line2\");\n textOnlyH2(currentDayEntry[\"line2\"][0]);\n } else {\n sectionHeading(currentDayEntry[\"line2\"][0]);\n textOnly(currentDayEntry[\"line2\"][1]);\n }\n // Handeling line 4\n sectionHeading(\"Daily Scripture Lessions\");\n verseLine(currentDayEntry[\"line4\"]);\n // Handeling line 5\n sectionHeading(currentDayEntry[\"line5\"][0]);\n // Handeling line 6\n verseLine(currentDayEntry[\"line6\"]);\n // Handeling line 7\n sectionHeading(\"Watchword For the Day\");\n textOnly(currentDayEntry[\"line7\"][0]);\n // Handeling line 8\n sectionHeading(\"Doctrinal Text\");\n textOnly(currentDayEntry[\"line8\"][0]);\n // Handeling line 9\n sectionHeading(\"Prayer\");\n textOnly(currentDayEntry[\"line9\"][0]);\n}", "title": "" }, { "docid": "aa09944ab8b36d44e16ab7ddde0a129a", "score": "0.4938111", "text": "generateTimes(state, classes) {\n const height = state.end - state.start;\n const start = state.start;\n let getTop = (el, start, height) => ({ top: `${((timeToNum(el) - start) * 100 / height)}%` });\n let timeEls = [];\n let times = new Set();\n const get15B4 = (time) => {\n let s = time.split(':');\n let right = parseInt(s[1]);\n if (right < 15) {\n return `${parseInt(s[0]) - 1}:${60 + right - 15}`\n } else {\n let mins = right - 15;\n return `${s[0]}:${mins >= 10 ? mins : `0${mins}`}`;\n }\n }\n\n const get15After = (time) => {\n let s = time.split(':');\n let right = parseInt(s[1]);\n if (right >= 45) {\n let mins = right + 15 - 60;\n return `${parseInt(s[0]) + 1}:${mins >= 10 ? mins : `0${mins}`}`\n } else {\n let mins = right + 15;\n return `${s[0]}:${mins}`;\n }\n }\n\n //add intervals to set of times because we're just insane\n const getWithin = (time, times, interval = 5) => {\n return getIntervals(get15B4(time), get15After(time), interval);\n }\n\n classes.forEach(c => {\n\n if (c.schedule[0].days === \"TBA\") {\n return;\n }\n\n //since we prioritize starts of classes, we put them first\n c.schedule.forEach(s => {\n if (!times.has(s.startTime)) {\n timeEls.push(\n <div key={s.startTime}\n className=\"schedule-time\"\n style={getTop(s.startTime, start, height)}>\n {getNormalTime(s.startTime)}\n </div>\n );\n times.add(s.startTime);\n getWithin(s.startTime, times).forEach(t => times.add(t));\n }\n });\n });\n\n classes.forEach(c => {\n\n if (c.schedule[0].days === \"TBA\") {\n return;\n }\n\n c.schedule.forEach(s => {\n if (!times.has(s.endTime)) {\n timeEls.push(\n <div key={s.endTime}\n className=\"schedule-time\"\n style={getTop(s.endTime, start, height)}>\n {getNormalTime(s.endTime)}\n </div>\n );\n times.add(s.endTime);\n\n //this way we don't have collisions for night classes\n getWithin(s.endTime, times).forEach(t => times.add(t));\n }\n });\n });\n\n return timeEls;\n }", "title": "" }, { "docid": "1ad07e24f11883df4ad1273f16ff455b", "score": "0.49354932", "text": "function timeline(){\n\tgoogle.setOnLoadCallback(drawChart);\n\tfunction drawChart() {\n\n\t\tvar container = document.getElementById('timeline_chart');\n\t\tvar chart = new google.visualization.Timeline(container);\n\t\tvar dataTable = new google.visualization.DataTable();\n\t\tdataTable.addColumn({ type: 'string', id: 'Room' });\n\t\tdataTable.addColumn({ type: 'string', id: 'Name' });\n\t\tdataTable.addColumn({ type: 'date', id: 'Start' });\n\t\tdataTable.addColumn({ type: 'date', id: 'End' });\n\t\tdataTable.addRows([\n\t\t\t[ 'Wilson', 'Beginning JavaScript', new Date(0,0,0,12,0,0), new Date(0,0,0,13,30,0) ],\n\t\t\t[ 'Wilson', 'Intermediate JavaScript', new Date(0,0,0,14,0,0), new Date(0,0,0,15,30,0) ],\n\t\t\t[ 'Wilson', 'Advanced JavaScript', new Date(0,0,0,16,0,0), new Date(0,0,0,17,30,0) ],\n\t\t\t[ 'James', 'Beginning Ruby', new Date(0,0,0,12,30,0), new Date(0,0,0,14,0,0) ],\n\t\t\t[ 'James', 'Intermediate Ruby', new Date(0,0,0,14,30,0), new Date(0,0,0,16,0,0) ],\n\t\t\t[ 'James', 'Advanced Ruby', new Date(0,0,0,16,30,0), new Date(0,0,0,18,0,0) ]]);\n\n\t\tvar options = {\n\t\t\tlegend: {position: 'none'},\n\t\t\theight: '150',\n\t\t\tcolors: [$danger, $default_black, $info, $success, $warning],\n\t\t};\n\n\t\tchart.draw(dataTable, options);\n\t}\n}", "title": "" }, { "docid": "c651331fa70805a8f08cf901849cea96", "score": "0.49234715", "text": "function ready(datapoints) {\n // Convert your months to dates\n datapoints.forEach(d => {\n d.datetime = parseTime(d.month)\n })\n let dates = datapoints.map(function(d) {\n return d.datetime\n })\n // console.log(datapoints)\n\n xPositionScale.domain(d3.extent(dates))\n\n // Get a list of dates and a list of prices\n\n // Group your data together\n var nested = d3\n .nest()\n .key(d => d.region)\n .entries(datapoints)\n // console.log(nested)\n\n // Draw your lines\n\n svg\n .selectAll('.price-category')\n .data(nested)\n .enter()\n .append('path')\n .attr('class', 'price-category')\n .attr('d', function(d) {\n return line(d.values)\n })\n .attr('stroke', d => colorScale(d.key))\n .attr('stroke-width', 2)\n .attr('fill', 'none')\n .lower()\n\n svg\n .selectAll('.last-month')\n .data(nested)\n .enter()\n .append('circle')\n .attr('class', 'last-month')\n .attr('cy', d => yPositionScale(d.values[0].price))\n .attr('cx', d => xPositionScale(d.values[0].datetime))\n // This also works because all circles have same x position\n // .attr('cx', width)\n .attr('fill', d => colorScale(d.key))\n .attr('r', 3)\n\n // Add your text on the right-hand side\n svg\n .selectAll('.region-category')\n .data(nested)\n .enter()\n .append('text')\n .attr('class', 'region-category')\n .attr('y', d => yPositionScale(d.values[0].price))\n .attr('x', width)\n .attr('dx', 7)\n .attr('alignment-baseline', 'hanging')\n .attr('font-size', 12)\n // .attr('text-anchor', 'start')\n .text(d => d.key)\n\n // Add your title\n svg\n .append('text')\n .attr('x', width / 2)\n .attr('y', 0 - margin.top / 2)\n .attr('text-anchor', 'middle')\n // Style is same as attr here\n // But use Style in <div>\n .style('font-size', 18)\n // .style('text-decoration', 'underline')\n .text('U.S. Housing Prices Fall in Winter')\n\n // Add the shaded rectangle\n var december16 = parseTime('December-16')\n var february17 = parseTime('February-17')\n // var maxPrice = d3.max(datapoints, d => d.price)\n svg\n .append('rect')\n .attr('x', xPositionScale(december16))\n // .attr('y', yPositionScale(340))\n .attr('y', yPositionScale(340))\n .attr('width', xPositionScale(february17) - xPositionScale(december16))\n .attr('height', height)\n .attr('fill', 'lightgray')\n .attr('opacity', 0.5)\n\n // Add your axes\n var xAxis = d3\n .axisBottom(xPositionScale)\n .tickFormat(d3.timeFormat('%b %y'))\n .ticks(10)\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n\n var yAxis = d3\n .axisLeft(yPositionScale)\n .tickValues([200, 220, 240, 260, 280, 300, 320])\n\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n}", "title": "" }, { "docid": "e2e373bbb8a517dd5f5c50963793428c", "score": "0.49144903", "text": "async function formatSections(sections, event) {\n\n // List of items to add\n let items = [];\n\n // Iterates through all the sections\n for (var sectionIndex = 0; sectionIndex < 25; sectionIndex++) {\n var value = sectionIndex + parseInt(event.params.offset,10);\n if(value == sections.totalCount) {\n break;\n }\n\n // Gets all needed information for all the meeting times of a section\n var meetingTimes = [];\n var meetingLength = sections.data[sectionIndex].meetingsFaculty.length;\n \n for (var meetingIndex = 0; meetingIndex < meetingLength; meetingIndex++) {\n \n // Calculates how many weeks for each meeting time\n var start = sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.startDate;\n var end = sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.endDate;\n var diff = weekDiff(start, end);\n \n // Finds campus code for each meeting time\n var campus;\n\n var campusesLength = campuses.length;\n for(var index = 0; index < campusesLength; index++) {\n if(String(sections.data[sectionIndex].campusDescription).localeCompare(String(campuses[index].description)) == 0) {\n campus = campuses[index].code;\n }\n }\n \n // Gets faculty information for each meeting time\n var staff = [];\n var facultyLength = sections.data[sectionIndex].faculty.length;\n\n for(index = 0; index < facultyLength; index++) {\n staff.push(sections.data[sectionIndex].faculty[index].displayName);\n }\n \n // Gets start and end time for each meeting time\n let startTime;\n let finishTime;\n \n try {\n startTime = Number(sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.beginTime);\n } catch (err) {\n startTime = -1;\n }\n \n try {\n finishTime = Number(sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.endTime);\n } catch (err) {\n finishTime = -1;\n }\n \n // The meetingTimes format\n const items = {\n startTime: startTime,\n endTime: finishTime,\n startDate: String(sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.startDate),\n endDate: String(sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.endDate),\n building: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.building,\n room: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.room,\n instructors: staff,\n monday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.monday,\n tuesday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.tuesday,\n wednesday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.wednesday,\n thursday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.thursday,\n friday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.friday,\n saturday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.saturday,\n sunday: sections.data[sectionIndex].meetingsFaculty[meetingIndex].meetingTime.sunday,\n weeks: diff\n };\n meetingTimes.push(items);\n }\n\n // The section format\n const dbEntry = {\n PutRequest: {\n Item: {\n courseName: (String(sections.data[sectionIndex].subject) + '-' + String(sections.data[sectionIndex].courseNumber)),\n title: String(sections.data[sectionIndex].courseTitle),\n crn: Number(sections.data[sectionIndex].courseReferenceNumber),\n isOpen: sections.data[sectionIndex].openSection,\n campus: campus,\n campusName: String(sections.data[sectionIndex].campusDescription),\n attributes: sections.data[sectionIndex].sectionAttributes[0],\n meetingTimes: meetingTimes\n }\n }\n };\n\n // Adds dbEntry to list of items to be added\n items.push(dbEntry); \n\n }\n\n // Stores list of items\n let params = {\n RequestItems: {\n [`${event.school}-${event.term}`]: items\n }\n};\n\n // Calls function to log items into database\n await putIntoDB(params);\n}", "title": "" }, { "docid": "119ec40a879150d35702f687d4910506", "score": "0.4901158", "text": "function makeLines() {\n // *****************************************************************************\n // initialize values\n // *****************************************************************************\n\n // *****************************************************************************\n // add multilines\n // *****************************************************************************\n\n if (subkey == key) {\n // subcolor = \"#000000\"\n subAlpha = 100;\n }\n\n // *****************************************************************************\n // add lines\n // *****************************************************************************\n svg\n .selectAll(\"myLines\")\n .data(DROMIC_data.data[subkey][subDataKey])\n .enter()\n .append(\"path\")\n // CLIPS LINES OUTSIDE DOMAIN ////////////////////////////////\n .attr(\"clip-path\", \"url(#clip)\")\n ///////////////////////////////////////////\n .datum(DROMIC_data.data[subkey][subDataKey])\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", Hex2rgba(subcolor, subAlpha))\n .attr(\"stroke-width\", 2)\n .attr(\n \"d\",\n d3\n .line()\n .x(function (d) {\n return x(d.date);\n })\n .y(function (d) {\n return y(d.value);\n })\n );\n\n // *****************************************************************************\n // add points\n // *****************************************************************************\n var point = svg\n .selectAll(\"myCircles\")\n .data(DROMIC_data.data[subkey][subDataKey])\n .enter()\n .append(\"circle\")\n .attr(\"fill\", Hex2rgba(subcolor, subAlpha))\n .attr(\"stroke\", \"none\")\n .attr(\"cx\", function (d) {\n return x(d.date);\n })\n .attr(\"cy\", function (d) {\n return y(d.value);\n })\n .attr(\"r\", 3.5);\n\n // *****************************************************************************\n // TOOLTIP functions\n // *****************************************************************************\n\n function tooltip_text(d) {\n var br = \"<br>\";\n var str = \"\";\n var value = parseFloat(d.value);\n value = formatMoney(value, \"₱\");\n\n str += \"<b> Value: </b> \" + value + br;\n str += \"<b> Ref: </b>DROMIC Sitrep # \" + d.report_num + br;\n var date = new Date(d.date * 1000);\n str +=\n \"<b> Release date:</b> \" +\n date.getFullYear() +\n \"/\" +\n date.getMonth() +\n \"/\" +\n date.getDate() +\n \" \" +\n date.toLocaleString(\"en-US\", {\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: true,\n });\n\n return str;\n }\n\n function tooltip_modify(d, tooltip, subcolor) {\n tooltip\n .style(\"border\", \"solid\")\n .style(\"border-width\", \"1px\")\n .style(\"border-radius\", \"5px\")\n .style(\"padding\", \"5px\")\n .style(\"z-index\", \"10\")\n .style(\"position\", \"absolute\")\n .style(\"visibility\", \"visible\");\n return tooltip;\n }\n\n // *****************************************************************************\n // handle points mouse events\n // *****************************************************************************\n if (subkey == key) {\n var mouseover = function (d) {\n tooltip_modify(d, tooltip, subcolor);\n d3.select(this).style(\"stroke\", \"black\");\n };\n var mouseclick = function (d) {\n tooltip_modify(d, tooltip, subcolor);\n d3.select(this).style(\"stroke\", \"black\");\n };\n var mousemove = function (d) {\n tooltip.html(tooltip_text(d));\n tooltip\n .style(\"top\", event.pageY - 10 + \"px\")\n .style(\"left\", event.pageX + 10 + \"px\");\n return tooltip;\n };\n var mouseleave = function (d) {\n tooltip.style(\"visibility\", \"hidden\");\n d3.select(this).style(\"stroke\", \"none\");\n };\n\n point\n .on(\"mouseclick\", mouseclick)\n .on(\"mouseover\", mouseover)\n .on(\"mousemove\", mousemove)\n .on(\"mouseleave\", mouseleave);\n } // done key = subkey\n }", "title": "" }, { "docid": "60961d30882a636369c6ecbe523cf53e", "score": "0.4890813", "text": "function startGenerationCalendar(v) {\n // show the spinner\n showSpinnerLoader();\n if (v > 0) {\n console.log(v);\n assert(timetable);\n reactor.run(Infinity, true, function () {\n return startGenerationCalendar(v - 1);\n });\n } else {\n console.log(\"END\");\n // hide the spinner\n hideSpinnerLoader();\n for (var i = 0; i < timetable.tt.length; i++) {\n var start = timetable.tt[i].getStartLesson().toFixed(2);\n var arrayStart = start.split(\".\");\n var end = timetable.tt[i].getEndLesson().toFixed(2);\n var arrayEnd = end.split(\".\");\n var numDay = defineDayNumber(timetable.tt[i].getDay());\n var name = timetable.tt[i].getDiscipline().getName();\n var abb = timetable.tt[i].getDiscipline().getAbbreviation();\n var curriculum = '[' + timetable.tt[i].getDiscipline().getCurriculum() + '] - ';\n if (curriculum == '[undefined] - ') {\n curriculum = \"\"\n };\n var profs = timetable.tt[i].getDiscipline().getAllProfessor();\n var obb = timetable.tt[i].getDiscipline().getObligatory();\n var className = timetable.tt[i].getClassroom().getName();\n var classAddress = timetable.tt[i].getClassroom().getAddress()\n var newEvent = {\n start: createDate(numDay, arrayStart[0], arrayStart[1]),\n end: createDate(numDay, arrayEnd[0], arrayEnd[1]),\n title: abb + ' - ' + curriculum + className,\n content: \"<b>MATERIA:</b> \" + name + \"<br />\" +\n \"<b>INIZIO:</b> \" + start + \"<br />\" +\n \"<b>FINE:</b> \" + end + \"<br />\" +\n \"<b>CURRICULUM:</b> \" + curriculum + \"<br />\" +\n \"<b>PROFESSORE:</b> \" + profs + \"<br />\" +\n \"<b>OBBLIGATORIO:</b> \" + obb + \"<br /><br />\" +\n \"<b>AULA:</b> \" + className + \"<br />\" +\n \"<b>INDIRIZZO:</b> \" + classAddress + \"\",\n category: timetable.tt[i].getDiscipline().getCourse() + \" \" + timetable.tt[i].getDiscipline().getYear() + \" anno\",\n filter: timetable.tt[i].getDiscipline().getCourse().getId() + timetable.tt[i].getDiscipline().getYear()\n }\n newEvent.color = colorCategory(newEvent.category);\n // console.log(newEvent);\n events.push(newEvent);\n\n }\n // calendar.init();\n $('#calendar').fullCalendar('addEventSource', events);\n $(\"#generateCalendar\").prop(\"disabled\", true);\n $('#filterEvent').on('change', function () {\n $('#calendar').fullCalendar('rerenderEvents');\n })\n }\n\n\n}", "title": "" }, { "docid": "6cf2e9ca050b667211e3b7176bd8a967", "score": "0.4886937", "text": "function getTimeValueFormat(value, context, currentLevel, tTimeAxisBody){\n var texts = {};\n var levels = ObjectUtils.extend(true, [], TimeUtil.normalizeLevels(context.levels, tTimeAxisBody));\n if(currentLevel){\n currentLevel = TimeUtil.normalizeLevelName(currentLevel); \n if(currentLevel && levels.indexOf(currentLevel) === -1){ \n levels.push(currentLevel); \n levels.sort(levelComparator.bind(tTimeAxisBody)); \n } \n }\n var timeLevels = [];\n var index;\n if(levels.indexOf(\"second\") >= 0){\n index = levels.indexOf(\"minute\");\n if(index >= 0){\n levels.splice(index, 1);\n }\n index = levels.indexOf(\"hour\");\n if(index >= 0){\n levels.splice(index, 1);\n } \n }else if(levels.indexOf(\"minute\") >= 0){\n index = levels.indexOf(\"hour\");\n if(index >= 0){\n levels.splice(index, 1);\n }\n }\n \n if(levels.indexOf(\"day\") >= 0){\n index = levels.indexOf(\"month\");\n if(index >= 0){\n levels.splice(index, 1);\n }\n }\n \n if(['second','minute', 'hour'].indexOf(levels[0]) >= 0){\n timeLevels[0] = levels[0];\n levels.splice(0,1);\n \n }\n\n var currentInfo;\n var extraConfig;\n var prevInfo = getPrevInfo(null, null);\n \n var dayTexts = [];\n var timeTexts = [];\n var result;\n if(timeLevels.length > 0){\n timeLevels.forEach(function (lv){\n currentInfo = getCurrentInfo(value, lv, timeLevels, null);\n extraConfig = getExtraConfig(null, true);\n result = formatLabel(currentInfo, prevInfo, context, extraConfig);\n timeTexts.push(result.text);\n });\n }\n \n if(levels.length > 0){\n var timePattern = checkCombinedTimePattern(levels);\n result = null;\n if (timePattern.length > 0) {\n currentInfo = getCurrentInfo(value, timePattern[0].pattern, levels, null);\n extraConfig = getExtraConfig(true, true);\n result = formatLabel(currentInfo, prevInfo, context, extraConfig);\n }\n if(!result ){\n extraConfig = getExtraConfig(false, true);\n levels.forEach(function(lv){\n currentInfo = getCurrentInfo(value, lv, levels, null);\n result = formatLabel(currentInfo, prevInfo, context, extraConfig);\n dayTexts.push(result.text);\n });\n }else{\n dayTexts.push(result.text);\n }\n }\n\n result = [combineLabels(dayTexts, context), combineLabels(timeTexts, context)];\n return result;\n }", "title": "" }, { "docid": "6ff0680a041aaa889b53d289ffe54a48", "score": "0.488591", "text": "drawTimeLine(time, i, series) {\n // Current time informations\n const currentX = this.getInnerX(time.date);\n const lineTop = this.props.yBase;\n const lineBottom = this.props.yBase + this.props.height;\n\n const points = time.points.map(this.formatPoint.bind(this, time));\n\n // Last time informations\n let lastX = null;\n let lastPoints = null;\n const lastTime = series[i - 1];\n\n if (Boolean(lastTime)) {\n lastX = this.getInnerX(lastTime.date);\n lastPoints = lastTime.points.map(this.formatPoint.bind(this, lastTime));\n }\n\n return (\n <TimeLine key={i}\n currentX={currentX}\n lineTop={lineTop}\n lineBottom={lineBottom}\n points={points}\n lastX={lastX}\n lastPoints={lastPoints}\n setHovered={this.props.setHovered} />\n );\n }", "title": "" }, { "docid": "1ccfb8c857613490e6fefc0b6f621723", "score": "0.48857972", "text": "function drawTimeline () {\n var chart = new google.visualization.Timeline(document.getElementById('timeline'));\n var dataTable = new google.visualization.DataTable();\n\n dataTable.addColumn({ type: 'string', id: 'Category'})\n dataTable.addColumn({ type: 'string', id: 'Legislation'});\n dataTable.addColumn({ type: 'date', id: 'Start' });\n dataTable.addColumn({ type: 'date', id: 'End' });\n dataTable.addRows([\n [ 'Legislation','Chinese Exclusion Act', new Date(1882,0 ,0 ), new Date(1883, 0, 0) ],\n [ 'Legislation','Alien Contract Labor Laws', new Date(1885,0 ,0 ), new Date(1886,0 ,0) ],\n [ 'Legislation','Alien Contract Labor Laws (Again)', new Date(1887,0 ,0 ), new Date(1888,0 ,0) ],\n [ 'Legislation','Immigration Act of 1891', new Date(1891,0 ,0 ), new Date(1892,0 ,0) ],\n [ 'Event','Ellis Island Opens', new Date(1892,0 ,0 ), new Date(1893,0 ,0) ],\n [ 'Legislation','Migration Procedures Formalized', new Date(1893,0 ,0 ), new Date(1894,0 ,0) ],\n // [ 'Movement','Immigration Wave', new Date(1900,0 ,0), new Date(1920,0,0) ],\n [ 'Legislation','1903 Immigration Act', new Date(1903,0 ,0), new Date(1904,0,0) ],\n [ 'Legislation','Naturalization Act of 1906', new Date(1906,0 ,0), new Date(1907,0,0) ],\n [ 'Legislation','Immigration Act of 1917', new Date(1917,0 ,0), new Date(1918,0,0) ],\n [ 'Event','U.S. Enters World War One', new Date(1917, 4 ,0), new Date(1917,4,0) ],\n [ 'Event','1918 Presidential Proclamation', new Date(1918,0 ,0), new Date(1919,0,0) ],\n\n\n\n\n\n ]);\n\n var options = {\n colors: [ '#01579b', '#990000'],\n\n timeline: {\n groupByRowLabel: true,\n colorByRowLabel: true,\n // singleColor: '#a53336',\n\n rowLabelStyle: {\n fontName: 'Garamond',\n fontSize: 14,\n color: 'black',\n },\n barLabelStyle: {\n fontSize: 14,\n fontName: 'Helvetica',\n color: 'white',\n },\n },\n // backgroundColor: '#01579b',\n backgroundColor: 'white',\n\n };\n chart.draw(dataTable, options);\n }", "title": "" }, { "docid": "8ddd2bf2190e11382cbc5618ffe94d79", "score": "0.48749542", "text": "function formatTlData(data) {\n\t\t\t\t// console.log(\"data = \\n\", data);\n\t\t\t\tlet parseDate = d3.timeParse(\"%Y,\\ %m,\\ %d\");\n\t\t\t\t// let parseDate = d3.timeParse(\"%Y(,\\ ?%m)?(,\\ ?%d)?\");\n\t\t\t\t//.parse; must see about some regular expression for this\n\t\t\t\t// console.log(\"FORMATTING\\nd = \\n\", data);\n\t\t\t\tdata.forEach((d) => {\n\t\t\t\t\td.group = +d.group;\n\t\t\t\t\t// d.type;\n\t\t\t\t\td.start = parseDate(d.start);\n\t\t\t\t\tif (d.className != 'act') {\n\t\t\t\t\t\tif(d.end) {\n\t\t\t\t\t\t\td.end = parseDate(d.end);\n\t\t\t\t\t\t} else { // if (d.type && d.type in ['range', 'background']) {\n\t\t\t\t\t\t\td.end = new Date();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( d.className ) && \n\t\t\t\t\t\t\t( d.className.match(new RegExp('effected.*')) || \n\t\t\t\t\t\t \t d.className.match(new RegExp('enacted.*')))) {\n\t\t\t\t\t\td.act \t\t= +d.act;\n\t\t\t\t\t\td.census \t= +d.census;\n\t\t\t\t\t\tif ( d.className.match(new RegExp('effected.*')) ) {\n\t\t\t\t\t\t\t// d[\"id\"] = \"effected-act\" + d.act + \"-census\" + d.census;\n\t\t\t\t\t\t\td.className += \" effected-act\" + d.act + \"-census\" + d.census;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// d[\"id\"] = \"enacted-act\" + d.act + \"-census\" + d.census;\n\t\t\t\t\t\t\td.className += \" enacted-act\" + d.act + \"-census\" + d.census;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.subgroup \t= d.className;\n\t\t\t\t\t}\n\t\t\t\t\treturn d;\n\t\t\t\t});\n\t\t\t\treturn data;\n\t\t\t}", "title": "" }, { "docid": "fcce21cd7dd1ed7818170a8792134ae7", "score": "0.4871986", "text": "function callTide(){\n var summary = datatide[0].tide.tideSummaryStats[0]\n , sumHigh = Math.round(summary.maxheight,2)\n , sumLow = Math.round(summary.minheight,2)\n , details = datatide[0].tide.tideSummary\n ;\n\n $('.tide-content').append(\"<li class='summary'></li>\");\n $('.summary').append(\"<span class='sumHigh'>High: \"+sumHigh+\"</span>\");\n $('.summary').append(\"<span class='sumLow'>Low: \"+sumLow+\"</span>\");\n // $('.tide-content').append(\"<li class='tide-date-wrapper'></li>\");\n // $('.tide-date-wrapper').append(\"<span class=''>\"+tideMonth[0]+\"</span>\");\n for (counter = 1; counter<=5;counter++){\n $('.summary').append(\"<span class='select-date' id='select-date\"+counter+\"' data-date='\"+counter+\"'></span>\");\n }\n\n $('.select-date').each(function(){\n var count = $(this).data('date');\n $('#select-date'+count).on('click',function(){\n $('.tide-item'+count).css({'visibility':'visible'});\n $('.tide-content').animate({scrollTop:(225*(count-1))},\n '500', 'swing', function() {\n });\n });\n });\n\n var l = details.length;\n var tideTime = [];\n var tideItemHigh = [];\n var tideItemType = [];\n\n var tideHour = [];\n var tideMin = [];\n var tideDate = [];\n var tideMonth = [];\n var tideYear = [];\n var intDate = [];\n\n $('.tide-content').append(\"<ul class='details'></ul>\");\n for (i = 0; i <= l; i++){\n\n tideItemHigh[i] = details[i].data.height;\n tideItemType[i] = details[i].data.type;\n\n tideHour[i] = details[i].date.hour;\n tideMin[i] = details[i].date.min;\n tideDate[i] = details[i].date.mday;\n tideMonth[i] = details[i].date.mon;\n tideYear[i] = details[i].date.year;\n\n tideTime.push(tideTime[i]);\n tideItemHigh.push(tideItemHigh[i]);\n tideItemType.push(tideItemType[i]);\n\n tideHour.push(tideHour[i]);\n tideMin.push(tideMin[i]);\n tideDate.push(tideDate[i]);\n tideMonth.push(tideMonth[i]);\n tideYear.push(tideYear[i]);\n\n if(tideItemHigh[i]==\"\"){\n tideItemHigh[i]=\"n/a\";\n }\n\n var months = ['January','Febuary','March','April','May','June','July','August','September','October','November','December'];\n tideMonth[i] = parseInt(tideMonth[i]);\n tideMonth[i] = months[tideMonth[i]-1];\n console.log('tidemonth: '+tideMonth[1]);\n\n var counter=0;\n if((tideDate[i])-(tideDate[0]) == 0){\n counter=1;\n $('.details').append(\"<li id='tide-item\"+(i+1)+\"' class='tide-item\"+(counter)+\"'></li>\");\n $('#select-date'+counter).html(tideDate[i]);\n $('#select-date'+counter).data('date',tideDate[i]);\n }\n else if((tideDate[i])-(tideDate[0])==1){\n counter = 2;\n $('.details').append(\"<li id='tide-item\"+(i+1)+\"' class='tide-item\"+counter+\"'></li>\");\n $('#select-date'+counter).html(tideDate[i]);\n $('#select-date'+counter).data('date',tideDate[i]);\n }\n else if((tideDate[i])-(tideDate[0])==2){\n counter = 3;\n $('.details').append(\"<li id='tide-item\"+(i+1)+\"' class='tide-item\"+counter+\"'></li>\");\n $('#select-date'+counter).html(tideDate[i]);\n $('#select-date'+counter).data('date',tideDate[i]);\n }\n else if((tideDate[i])-(tideDate[0])==3){\n counter = 4;\n $('.details').append(\"<li id='tide-item\"+(i+1)+\"' class='tide-item\"+counter+\"'></li>\");\n $('#select-date'+counter).html(tideDate[i]);\n $('#select-date'+counter).data('date',tideDate[i]);\n }\n else if((tideDate[i])-(tideDate[0])==4){\n counter = 5;\n $('.details').append(\"<li id='tide-item\"+(i+1)+\"' class='tide-item\"+counter+\"'></li>\");\n $('#select-date'+counter).html(tideDate[i]);\n $('#select-date'+counter).data('date',tideDate[i]);\n }\n\n function setDateUp(tideDate){\n if((tideDate == 1)||(tideDate == 21)||(tideDate == 31)){\n tideDate = tideDate +'<span><sup>st</sup></span>';\n console.log('1');\n }\n else if((tideDate == 2)||(tideDate==22)){\n tideDate = tideDate+'<span><sup>nd</sup></span>';\n console.log('2');\n }\n else if((tideDate == 3)||(tideDate==23)){\n tideDate = tideDate +'<span><sup>rd</sup></span>';\n console.log('3');\n }\n else if(tideDate >=4 || tideDate<=20){\n tideDate = tideDate +'<span><sup>th</sup></span>';\n }\n }\n $('#tide-item'+(i+1)).append(\"<div class='tide-item-time'></div>\");\n $('#tide-item'+(i+1)).append(\"<div class='tide-item-high'></div>\");\n $('#tide-item'+(i+1)).append(\"<div class='tide-item-type'></div>\");\n\n $('#tide-item'+(i+1) +' .tide-item-time').html(tideHour[i]+\":\"+tideMin[i]+\" \"+ tideMonth[i]+\" \"+ tideDate[i]+ \", \"+ tideYear[i]);\n $('#tide-item'+(i+1) +' .tide-item-high').html(tideItemHigh[i]);\n $('#tide-item'+(i+1) +' .tide-item-type').html(tideItemType[i]);\n }\n }", "title": "" }, { "docid": "d313dda831468563aed7b87f24431d33", "score": "0.4858768", "text": "function Timeline() {\n /**\n * The total duration of the timeline in seconds.\n * @type {number}\n */\n this.duration = 0;\n\n /**\n * The name of the value that segments will use to read the time. Defaults to 'tTime'.\n * @type {string}\n */\n this.timeKey = 'tTime';\n\n this.segments = {};\n this.__key = 0;\n}", "title": "" }, { "docid": "dc26ac02538536232a81a0d4a33feb0f", "score": "0.4846967", "text": "function ready(datapoints) {\n const months = datapoints.map(d => +d.MONTH)\n\n xPositionScale.domain(d3.extent(months))\n yPositionScale.domain([0, 1])\n\n // Group your data together\n const nested = d3\n .nest()\n .key(d => d.City)\n .entries(datapoints)\n\n console.log('first nested is', nested[0])\n\n // contain it\n container\n .selectAll('svg')\n .data(nested)\n .enter()\n .append('svg')\n .attr('height', height + margin.top + margin.bottom)\n .attr('width', width + margin.left + margin.right)\n .append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')\n .each(function(d) {\n // console.log(d)\n const name = d.key\n const datapoints = d.values\n\n // What SVG are we in? Let's grab it.\n const svg = d3.select(this)\n svg\n .append('path')\n .datum(datapoints)\n .attr('d', lineBefore)\n .attr('fill', 'none')\n .attr('stroke', 'blue')\n .attr('stroke-width', 1.5)\n\n svg\n .append('path')\n .datum(datapoints)\n .attr('d', lineAfter)\n .attr('fill', 'none')\n .attr('stroke', 'orange')\n .attr('stroke-width', 1.5)\n .raise()\n\n svg\n .selectAll('.before-circle')\n .data(datapoints)\n .enter()\n .append('circle')\n .attr('cx', d => xPositionScale(d.MONTH))\n .attr('cy', d => yPositionScale(d.before))\n .attr('r', 2)\n .attr('fill', 'blue')\n\n svg\n .selectAll('.after-circle')\n .data(datapoints)\n .enter()\n .append('circle')\n .attr('cx', d => xPositionScale(d.MONTH))\n .attr('cy', d => yPositionScale(d.after))\n .attr('r', 2)\n .attr('fill', 'orange')\n\n svg\n .append('path')\n .datum(datapoints)\n .attr('d', lineAfter)\n .attr('fill', 'none')\n .attr('stroke', 'orange')\n .attr('stroke-width', 1.5)\n .raise()\n\n svg\n .append('text')\n .text(name)\n .attr('x', width / 2) // in the center\n .attr('text-anchor', 'middle') // center aligned\n // .attr('dy', -10)\n .attr('font-size', 13)\n .attr('fill', 'black')\n .attr('font-weight', 'bold')\n\n const xTickLabels = ['Feb', 'May', 'Aug', 'Nov']\n\n const xAxis = d3\n .axisBottom(xPositionScale)\n .tickValues([2, 5, 8, 11])\n .tickFormat(function(d, i) {\n return xTickLabels[i]\n })\n // .tickFormat(d3.format('d'))\n // .tickSize(-height)\n svg\n .append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(xAxis)\n svg.selectAll('.x-axis path').remove()\n\n const yAxis = d3\n .axisLeft(yPositionScale)\n .tickValues([0, 0.2, 0.4, 0.6, 0.8])\n // .tickFormat(d3.format('$,d'))\n .tickSize(-width)\n svg\n .append('g')\n .attr('class', 'axis y-axis')\n .call(yAxis)\n .selectAll('.tick line')\n // .attr('stroke-dasharray', '2 2')\n .attr('stroke', 'lightgrey')\n svg.selectAll('.y-axis path').remove()\n })\n}", "title": "" }, { "docid": "60b03df8a01a34563bd38d52199a6ae2", "score": "0.48449114", "text": "function Submission(first, last, date, timeFrom, timeTo, adults, children, infants, email, phone, comment) {\r\n this.firstName = first;\r\n this.lastName = last;\r\n this.day = date;\r\n this.timeFrom = timeFrom;\r\n this.timeTo = timeTo;\r\n this.adults = adults;\r\n this.children = children;\r\n this.infants = infants;\r\n this.email = email;\r\n this.phone = phone;\r\n this.comment = comment;\r\n this.visualize = function () {\r\n \r\n let div = document.createElement(\"div\");\r\n let wrapper = document.getElementsByClassName('timetable')[0];\r\n\r\n wrapper.appendChild(div);\r\n\r\n // make date calculable and visualize \r\n let dateConv = parseInt(date, 10) + 1;\r\n let dateCalc = dateConv +' / '+ (dateConv + 1);\r\n\r\n div.style.gridColumn = dateCalc.toString()\r\n \r\n // Hour + minute calculation and visualization. \r\n // Note that military time is 8 hours ahead of our schema.\r\n let interA = timeFrom.split(':');\r\n let interB = timeTo.split(':'); \r\n\r\n let interA_hour = parseInt(interA[0]);\r\n let interB_hour = parseInt(interB[0]);\r\n\r\n let interA_min = parseInt(interA[1]);\r\n let interB_min = parseInt(interB[1]);\r\n\r\n let hourinterval = interB_hour - interA_hour;\r\n\r\n let mininterval = interB_min - interA_min;\r\n \r\n // This part is hell. I highly suggest you skip it unless you're absolutely interested.\r\n if (interA_min === 0 && interB_min === 0 ) {\r\n console.log('case1')\r\n div.style.gridRow = (interA_hour - 8).toString() + ' / span ' + hourinterval\r\n div.style.backgroundColor = '#A10416';\r\n div.style.borderRadius = '10px';\r\n \r\n } else if (interA_min === 0 && interB_min > 0) {\r\n console.log('case2')\r\n div.style.gridRow = (interA_hour - 8).toString() + ' / span ' + hourinterval\r\n div.style.backgroundColor = '#A10416';\r\n div.style.borderTopLeftRadius = '10px';\r\n div.style.borderTopRightRadius = '10px';\r\n\r\n let div2 = document.createElement(\"div\");\r\n wrapper.appendChild(div2);\r\n div2.style.display = \"flex\";\r\n div2.style.backgroundColor = '#A10416';\r\n div2.style.gridColumn = dateCalc.toString()\r\n div2.style.gridRow = (interB_hour - 8).toString() +\" / \"+ (interB_hour - 7).toString();\r\n div2.style.height = (interB_min / 60 * 100) + \"%\";\r\n div2.style.borderBottomLeftRadius = '10px';\r\n div2.style.borderBottomRightRadius = '10px';\r\n \r\n } else if (interA_min > 0 && interB_min === 0) {\r\n console.log('case3')\r\n div.style.gridRow = (interA_hour - 7).toString() + ' / span ' + (hourinterval - 1);\r\n div.style.backgroundColor = '#A10416';\r\n div.style.borderBottomLeftRadius = '10px';\r\n div.style.borderBottomRightRadius = '10px';\r\n\r\n let div2 = document.createElement(\"div\");\r\n wrapper.appendChild(div2);\r\n div2.style.display = \"flex\";\r\n div2.style.backgroundColor = '#A10416';\r\n div2.style.gridColumn = dateCalc.toString()\r\n div2.style.gridRow = (interA_hour - 8).toString() +\" / \"+ (interA_hour - 7).toString();\r\n div2.style.height = 100 - (interA_min / 60 * 100) + \"%\";\r\n div2.style.alignSelf = 'flex-end';\r\n div2.style.borderTopLeftRadius = '10px';\r\n div2.style.borderTopRightRadius = '10px';\r\n\r\n } else if(interB_hour === interA_hour + 1 && interA_min === interB_min || interB_hour === interA_hour + 1 && interA_min < interB_min) {\r\n console.log('case4')\r\n let div2 = document.createElement(\"div\");\r\n wrapper.appendChild(div2);\r\n div2.style.display = \"flex\";\r\n div2.style.backgroundColor = '#A10416';\r\n div2.style.gridColumn = dateCalc.toString()\r\n div2.style.gridRow = (interB_hour - 8).toString() +\" / \"+ (interB_hour - 7).toString();\r\n div2.style.height = (interB_min / 60 * 100) + \"%\";\r\n div2.style.borderBottomLeftRadius = '10px';\r\n div2.style.borderBottomRightRadius = '10px';\r\n\r\n let div3 = document.createElement(\"div\");\r\n wrapper.appendChild(div3);\r\n div3.style.display = \"flex\";\r\n div3.style.backgroundColor = '#A10416';\r\n div3.style.gridColumn = dateCalc.toString()\r\n div3.style.gridRow = (interA_hour - 8).toString() +\" / \"+ (interA_hour - 7).toString();\r\n div3.style.height = 100 - (interA_min / 60 * 100) + \"%\";\r\n div3.style.alignSelf = 'flex-end';\r\n div3.style.borderTopLeftRadius = '10px';\r\n div3.style.borderTopRightRadius = '10px';\r\n\r\n } else if(interB_hour >= interA_hour + 2 && interA_min === interB_min || interA_min < interB_min) {\r\n console.log('case5')\r\n div.style.gridRow = (interA_hour - 7).toString() + ' / span ' + (hourinterval - 1);\r\n div.style.backgroundColor = '#A10416';\r\n let div2 = document.createElement(\"div\");\r\n wrapper.appendChild(div2);\r\n div2.style.display = \"flex\";\r\n div2.style.backgroundColor = '#A10416';\r\n div2.style.gridColumn = dateCalc.toString()\r\n div2.style.gridRow = (interB_hour - 8).toString() +\" / \"+ (interB_hour - 7).toString();\r\n div2.style.height = (interB_min / 60 * 100) + \"%\";\r\n div2.style.borderBottomLeftRadius = '10px';\r\n div2.style.borderBottomRightRadius = '10px';\r\n\r\n let div3 = document.createElement(\"div\");\r\n wrapper.appendChild(div3);\r\n div3.style.display = \"flex\";\r\n div3.style.backgroundColor = '#A10416';\r\n div3.style.gridColumn = dateCalc.toString()\r\n div3.style.gridRow = (interA_hour - 8).toString() +\" / \"+ (interA_hour - 7).toString();\r\n div3.style.height = 100 - (interA_min / 60 * 100) + \"%\";\r\n div3.style.alignSelf = 'flex-end';\r\n div3.style.borderTopLeftRadius = '10px';\r\n div3.style.borderTopRightRadius = '10px';\r\n \r\n \r\n } else if (interA_min > 0 && interB_min > 0) {\r\n console.log('case6')\r\n div.style.gridRow = (interA_hour - 7).toString() + ' / span ' + (hourinterval - 1);\r\n div.style.backgroundColor = '#A10416';\r\n\r\n let div2 = document.createElement(\"div\");\r\n wrapper.appendChild(div2);\r\n div2.style.display = \"flex\";\r\n div2.style.backgroundColor = '#A10416';\r\n div2.style.gridColumn = dateCalc.toString()\r\n div2.style.gridRow = (interB_hour - 8).toString() +\" / \"+ (interB_hour - 7).toString();\r\n div2.style.height = (interB_min / 60 * 100) + \"%\";\r\n div2.style.borderBottomLeftRadius = '10px';\r\n div2.style.borderBottomRightRadius = '10px';\r\n\r\n let div3 = document.createElement(\"div\");\r\n wrapper.appendChild(div3);\r\n div3.style.display = \"flex\";\r\n div3.style.backgroundColor = '#A10416';\r\n div3.style.gridColumn = dateCalc.toString()\r\n div3.style.gridRow = (interA_hour - 8).toString() +\" / \"+ (interA_hour - 7).toString();\r\n div3.style.height = 100 - (interA_min / 60 * 100) + \"%\";\r\n div3.style.alignSelf = 'flex-end';\r\n div3.style.borderTopLeftRadius = '10px';\r\n div3.style.borderTopRightRadius = '10px';\r\n }\r\n alert(`Thank you ${first} ${last} ! We confirm your booking from ${timeFrom} to ${timeTo}!`)\r\n\r\n };\r\n }", "title": "" }, { "docid": "3fa2647310c1af38f999df1cef402125", "score": "0.48402756", "text": "constructor(svg, title, unit, makeData){\n\t\tsuper(svg,title);\n\t\tthis.unit = unit;\n\t\tthis.maxY = 0;\n\t\tthis.makeData = makeData;\n\t\tthis.graphX = d3.scaleTime()\n \t\t.domain([0, 10]) // input\n \t\t.range([0, this.width]);\n\t\tthis.graphY = d3.scaleLinear()\n \t\t.domain([0, 100]) // input \n \t\t.range([this.height, 0]);\n\t\tthis.line = d3.line()\n \t\t.x(function(d) { return this.graphX(d.x); }) // set the x values for the line generator\n \t\t.y(function(d) { return this.graphY(d.y); }) // set the y values for the line generator \n \t\t.curve(d3.curveMonotoneX);\n\t\tthis.xAxis = this.svg.append(\"g\")\n \t\t.attr(\"class\", \"myXaxis\")\n \t\t.attr(\"transform\", \"translate(0,\" + this.height + \")\")\n \t\t.call(d3.axisBottom(this.graphX));\n\t\tthis.yAxis = this.svg.append(\"g\")\n \t\t\t.attr(\"class\", \"myYaxis\")\n\t\t\t\t.call(d3.axisLeft(this.graphY))\n\t\tthis.xLabel = this.svg.append(\"text\")\n\t\t .attr(\"transform\",\n\t\t\t\"translate(\" + (this.width/2) + \" ,\" + \n\t\t\t\t\t\t(this.height+this.margin.top-5) + \")\")\n\t\t .style(\"text-anchor\", \"middle\")\n\t\t .text(\"Time\");\n\t\tthis.yLabel = this.svg.append(\"text\")\n\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t .attr(\"y\", 0 - this.margin.left)\n\t\t .attr(\"x\",0 - (this.height / 2))\n\t\t .attr(\"dy\", \"1em\")\n\t\t .style(\"text-anchor\", \"middle\")\n\t\t .text(this.unit);\n\t\tthis.path = this.svg.append(\"path\") \n\t\t\t.attr(\"class\", \"line\");\n\t\tthis.timeMarkers = [];\n\t\t\n\t}", "title": "" }, { "docid": "79b4e08e5a6dd90cdd4eb0971aefb821", "score": "0.48399872", "text": "function parseSchedules(d) {\n for (var i = 0; i < d.length; i++) {\n for (var j = 0; j < d[i].slots.length; j++) {\n d[i].slots[j].text = d[i].slots[j].text.replace(/\\s*@br@\\s*/gi, \"<br>\");\n }\n }\n return d;\n }", "title": "" }, { "docid": "57616f5e4aaa066ad7fb83286ec80bdd", "score": "0.48154923", "text": "function parseJson(e,t,s){var n=e.schedule,i=[],o=[],a=0,r=0;n.forEach(function(e,t,s){var n=[];s[t].date=getDateString(e.date),s[t].tableid=\"table-\"+t,e.slots.forEach(function(e,i,o){var a=e.sessions;i===0&&(s[t].start=getIST(getTimeString(e.sessions[0].start))),i===o.length-1&&(s[t].end=getIST(getTimeString(e.sessions[a.length-1].end))),a.forEach(function(e,o){e.section_name&&e.section_name.toLowerCase().indexOf(\"workshop\")!==-1&&(s[t].type=\"workshop\"),e.room&&n.indexOf(e.room)===-1&&n.push(e.room),s[t].slots[i].sessions[o].start=getIST(getTimeString(e.start)),s[t].slots[i].sessions[o].end=getIST(getTimeString(e.end))}),s[t].type!==\"workshop\"&&(s[t].type=\"conference\")}),n.sort(),n.forEach(function(e,t,s){s[t]={name:e,title:getAudiTitle(e),shorttitle:getShortAudiTitle(e),track:t}}),s[t].rooms=n,e.slots.forEach(function(e,i){var o=e.sessions;o.forEach(function(e,o){e.room&&(s[t].slots[i].sessions[o].track=getTrack(e.room,n),s[t].slots[i].sessions[o].roomTitle=getAudiTitle(e.room))})}),s[t].type===\"conference\"?(o.push({date:s[t].date,tableid:s[t].tableid,rooms:s[t].rooms,start:s[t].start,end:s[t].end}),createTable(o[a]),a+=1):(i.push({date:s[t].date,rooms:s[t].rooms,start:s[t].start,end:s[t].end}),createTable(i[r]),r+=1)}),a=0,r=0,n.forEach(function(e){e.slots.forEach(function(e){e.sessions.length>1&&e.sessions.sort(function(e,t){return e.track-t.track})}),e.type===\"conference\"?(pushSessions(o[a],e.slots),addRowSpan(o[a]),checkColumns(o[a]),a+=1):(pushSessions(i[r],e.slots),addRowSpan(i[r]),checkColumns(i[r]),r+=1)}),t===\"conference\"?renderScheduleTable(o,\"conference\",s):renderScheduleTable(i,\"workshop\",s)}", "title": "" }, { "docid": "f620e28c5680c71a431620cf3e617394", "score": "0.48145506", "text": "function create_nested_table(parent) {\n\tparent.append(\"table\")\n\t\t.classed(\"workflowtbl\",true)\n\t\t.append(\"tbody\")\n\t\t\t.selectAll(\"tr\")\n\t\t\t.data(d3.values(parent[0][0].__data__))\n\t\t\t.enter()\n\t\t\t.append(\"tr\")\n\t\t\t\t.selectAll(\"td\")\n\t\t\t\t.data(function(d) { \n\t\t\t\t\treturn [d.id == 0 ? \"0\" : d.id || d.name || d.description, d.output_name || d.type]; \n\t\t\t\t})\n\t\t\t\t.enter()\n\t\t\t\t.append(\"td\")\n\t\t\t\t\t.text(function(d) { return d; });\n}", "title": "" }, { "docid": "26f181206025e0237f22613eda804e21", "score": "0.4811078", "text": "function tooltipTpl(description, type, _this, dimensions) {\n var timelineData = timelineOptions.data;\n var startD = \"\",\n endD = \"\";\n\n if (description.startDate !== undefined && (type == \"span\" || type == \"norecord\")) {\n startD = description.startDate.split(' ')[1].substring(0, 3) + \" \" + description.startDate.split(' ')[2];\n }\n if (description.endDate !== undefined && (type == \"span\" || type == \"norecord\")) {\n endD = description.endDate.split(' ')[1].substring(0, 3) + \" \" + description.endDate.split(' ')[2];\n }\n if ((new Date().getMonth() == new Date(description.endDate).getMonth()) && (new Date().getFullYear() == new Date(description.endDate).getFullYear()) && description.status !== undefined) {\n endD = \"Present\";\n }\n\n var timeDiff = toYears(monthDiff(description.startDate, description.endDate));\n\n switch (type) {\n case 'highlight':\n if ((dimensions.windowWidth - $(_this).offset().left) < dimensions.leftRightGap) {\n var tooltipCont = '<div class=\"timelineTooltip tltpLeft\">' +\n '<div class=\"spanName wrdWrap bold\">' + description.highlightTooltip + '</div>' +\n '<div class=\"exp\">' + description.highlightDate.substring(2) + '</div><em class=\"iconTltp arrowTopRight\"></em>' +\n '</div>';\n } else {\n var tooltipCont = '<div class=\"timelineTooltip tltpRight\">' +\n '<div class=\"spanName wrdWrap bold\">' + description.highlightTooltip + '</div>' +\n '<div class=\"exp\">' + description.highlightDate.substring(2) + '</div><em class=\"iconTltp arrowTopLeft\"></em>' +\n '</div>';\n }\n return tooltipCont;\n case 'span':\n if ((dimensions.windowWidth - $(_this).offset().left) < dimensions.leftRightGap) {\n var tooltipCont = '<div class=\"timelineTooltip tltpLeft\">' +\n '<div class=\"spanName wrdWrap bold\">' + description.tooltip + '</div>' +\n '<div class=\"exp\">' + startD + ' - ' + endD + ' (' + timeDiff + ')</div><em class=\"iconTltp arrowTopRight\"></em>' +\n '</div>';\n } else {\n var tooltipCont = '<div class=\"timelineTooltip tltpRight\">' +\n '<div class=\"spanName wrdWrap bold\">' + description.tooltip + '</div>' +\n '<div class=\"exp\">' + startD + ' - ' + endD + ' (' + timeDiff + ')</div><em class=\"iconTltp arrowTopLeft\"></em>' +\n '</div>';\n }\n return tooltipCont;\n case 'norecord':\n if (endD == startD) {\n endD = '';\n }\n\n if ((dimensions.windowWidth - $(_this).offset().left) < dimensions.leftRightGap) {\n var tooltipCont = '<div class=\"timelineTooltip tltpLeft\">' +\n '<div class=\"spanName\"><em class=\"iconTltp arrowTopRight\"></em>' + (timelineData.gapText ? timelineData.gapText : '<div class=\"bold\">No Record</div>') + '<div class=\"exp\">' + startD + (endD == '' ? '' : ' - ' + endD) + ' (' + timeDiff + ')</div></div>' +\n '</div>';\n } else {\n var tooltipCont = '<div class=\"timelineTooltip tltpRight\">' +\n '<div class=\"spanName\"><em class=\"iconTltp arrowTopLeft\"></em>' + (timelineData.gapText ? timelineData.gapText : '<div class=\"bold\">No Record</div>') + '<div class=\"exp\">' + startD + (endD == '' ? '' : ' - ' + endD) + ' (' + timeDiff + ')</div></div>' +\n '</div>';\n }\n return tooltipCont;\n }\n }", "title": "" }, { "docid": "55a30dec37c7426487dfab6b99e4b4e3", "score": "0.4809313", "text": "function f_displayTimeSelection(layer) {\n $('#container_time').append('<div id=\"time_' + layer.id + '\" class=\"container_time_layer hidden\">' +\n ' <div class=\"time_section time_steps\">' +\n ' <div class=\"time_title\">Timestamp for <b>' + layer.title + '</b></div>\\n' +\n ' <a href=\"#\" class=\"time_step\" title=\"previous\" onclick=\"f_timeStep(\\'' + layer.id + '\\', -1)\">&#x23f4;</a>' +\n ' <a href=\"#\" class=\"time_step\" title=\"first\" onclick=\"f_timeStep(\\'' + layer.id + '\\', -2)\">&#x23ee;</a>' +\n ' </div>' +\n ' <div class=\"time_section\" title=\"Hours\">\\n' +\n ' <div class=\"time_label\">H</div>\\n' +\n ' <div id=\"' + timeSelection[layer.id].selection[3].div_name + '\"></div>\\n' +\n ' </div>\\n' +\n ' <div class=\"time_section\" title=\"Minutes\">\\n' +\n ' <div class=\"time_label_adjust\">&nbsp;</div>\\n' +\n ' <div id=\"' + timeSelection[layer.id].selection[4].div_name + '\"></div>\\n' +\n ' <div class=\"time_label\">M</div>\\n' +\n ' </div>\\n' +\n ' <div class=\"time_section\" title=\"Day\">\\n' +\n ' <div class=\"time_label_adjust\">&nbsp;</div>\\n' +\n ' <div id=\"' + timeSelection[layer.id].selection[2].div_name + '\"></div>\\n' +\n ' <div class=\"time_label\">D</div>\\n' +\n ' </div>\\n' +\n ' <div class=\"time_section\" title=\"Month\">\\n' +\n ' <div class=\"time_label\">M</div>\\n' +\n ' <div id=\"' + timeSelection[layer.id].selection[1].div_name + '\"></div>\\n' +\n ' </div>\\n' +\n ' <div class=\"time_section\" title=\"Year\">\\n' +\n ' <div class=\"time_label_adjust\" >&nbsp;</div>\\n' +\n ' <div id=\"' + timeSelection[layer.id].selection[0].div_name + '\"></div>\\n' +\n ' <div class=\"time_label\">Y</div>\\n' +\n ' </div>\\n' +\n ' <div class=\"time_section time_steps\">' +\n ' <div class=\"time_label_adjust\">&nbsp;</div>\\n' +\n ' <a href=\"#\" class=\"time_step\" title=\"last\" onclick=\"f_timeStep(\\'' + layer.id + '\\', 2)\">&#x23ed;</a>' +\n ' <a href=\"#\" class=\"time_step\" title=\"next\" onclick=\"f_timeStep(\\'' + layer.id + '\\', 1)\">&#x23f5;</a>' +\n ' </div>' +\n '</div>');\n}", "title": "" }, { "docid": "96fd44e272254401ea599942b9b599f3", "score": "0.4809214", "text": "function calculateFillTime(){\r\n\t\t// Por cada tipo de recurso calcula el tiempo hasta el llenao\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tif (produccion[i] < 0) var tiempo = Math.round(actual[i] / -produccion[i]);\r\n\t\t\t// Si la produccion es 0, el tiempo es infinito\r\n\t\t\telse if (produccion[i] == 0) var tiempo = -1;\r\n\t\t\t// Si la produccion es negativa, se calcula el tiempo hasta el vaciado\r\n\t\t\telse var tiempo = Math.round((total[i] - actual[i]) / produccion[i]);\r\n\r\n\t\t\tvar produccionHora = get('l' + (i+1)).title;\r\n\t\t\tvar tiempoRestante = \"<span id='timeouta' style='font-weight:bold'>\" + formatear_tiempo(tiempo) + \"</span>\";\r\n\t\t\tvar celda = elem(\"DIV\", \"<span style='font-size:9px; color:#909090; position: absolute; top:13px; height: 20px; text-align:left;'>(\" + (produccionHora > 0 ? '+' : '') + produccionHora + ', ' + (produccionHora < 0 ? '<font color=\"#FF0000\">' + tiempoRestante + '</font>' : tiempoRestante) + ')</span>');\r\n\t\t\tvar a = get('l' + (i+1)).previousSibling;\r\n\t\t\t// FIXME: Apaño para Firefox. FF mete nodos de tipo texto vacios\r\n\t\t\tif (a.nodeName == '#text') a = a.previousSibling;\r\n\t\t\ta.appendChild(celda);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "98cc34ab81bb807512fe4b671d7bc513", "score": "0.48073903", "text": "drawSuite(name, parent, json) {\r\n let datetime, suiteEl;\r\n suiteEl = $(parent).find('.suite.hidden').clone().get(0);\r\n for (let spec of json.specs) {\r\n this.drawSpec(suiteEl, spec);\r\n }\r\n $(suiteEl).removeClass('hidden');\r\n $(parent).find('.suites').append(suiteEl);\r\n suiteEl.outerHTML = Mustache.render(suiteEl.outerHTML, {\r\n suite: name\r\n });\r\n datetime = json.created;\r\n return datetime;\r\n }", "title": "" }, { "docid": "32e29643bf7e7f08591c43694c111033", "score": "0.47916725", "text": "function TimeParent() {\n Calendar.View.apply(this, arguments);\n this.frames = new Calendar.Utils.OrderedMap();\n this._initEvents();\n }", "title": "" }, { "docid": "23b93616dc1e7086d698270f55402fe6", "score": "0.4789957", "text": "function luasRealTime(){\n var luas_realtime_json = JSON.parse(luas_realtime);\n\n // Declare variables\n var html_red = \"\";\n var html_green =\"\";\n var stops_array_green = [];\n var stops_array_red = [];\n\n // Iterator to generate arrival time\n for(var a in luas_realtime_json){\n var line = luas_realtime_json[a]['fields']['line'];\n var stop_id = luas_realtime_json[a]['fields']['stop_id'];\n var duetime = luas_realtime_json[a]['fields']['duetime'];\n var direction = luas_realtime_json[a]['fields']['direction'];\n\n var content = \"<li id='\"+ stop_id +\"'><div>\" +\n \"<h5 style='font-size: 1.1em;' class='bus_info' id='\"+ stop_id +\"N'>\"+ stop_id +\"<i class='fa fa-chevron-circle-down' aria-hidden='true'></i></h5>\" +\n \"<h6 class='bus_info_expand' id='\"+ stop_id +\"I'></h6>\" +\n \"</div></li>\"\n\n if(stops_array_green.includes(stop_id) != true && line == \"Green\"){\n stops_array_green.push(stop_id)\n html_green += content;\n }\n if(stops_array_red.includes(stop_id) != true && line == \"Red\"){\n stops_array_red.push(stop_id)\n html_red += content;\n }\n\n }\n\n // Display the newly generated information\n document.getElementById('timeline').innerHTML = html_green;\n document.getElementById('timeline2').innerHTML = html_red;\n\n var luas_stops_json = JSON.parse(luas_stops);\n for (var name in luas_stops_json){\n var stop_name = luas_stops_json[name]['fields']['stop_name'];\n document.getElementById(luas_stops_json[name]['fields']['stop_id']+\"N\").innerHTML = stop_name;\n }\n\n for(var a in luas_realtime_json) {\n var line = luas_realtime_json[a]['fields']['line'];\n var stop_id = luas_realtime_json[a]['fields']['stop_id'];\n var duetime = luas_realtime_json[a]['fields']['duetime'];\n var direction = luas_realtime_json[a]['fields']['direction'];\n\n var content_duetimes = \"<p>\"+ direction +\" Due:\"+ duetime +\"</p>\"\n var info = document.getElementById(stop_id+\"I\");\n info.insertAdjacentHTML('beforeend', content_duetimes);\n }\n}", "title": "" }, { "docid": "7bc4d338453df9833b63f7d5d9c0263c", "score": "0.47886863", "text": "function dailyschedule(props){\n// so for here are using the dummy data, but with the data i'll \n// got the start time and end time and using while loop to render \n// every half an hour. and map both the available data and book data\n// const time = props.timedata.map((timedata)=><ol>{timedata}</ol>)\n// const start = props.timedata.available.start\n// const end = props.timedatea.available.end\n return(\n <div className=\"col dailyset\">\n {/* dummy data */}\n <p>9:00</p>\n <p>9:30</p>\n <p>10:00</p>\n <p>10:30</p>\n <p>11:00</p>\n <p>11:30</p>\n <p>12:00</p>\n <p>12:30</p>\n {/* prepare for randering the time data from the backend */}\n {/* {time} */}\n </div>\n )\n}", "title": "" }, { "docid": "9e881f902ba5ed3d04b44aeb97c6ba57", "score": "0.4785357", "text": "function serializeTimeLbl() {\n\t\tvar gridLblTxtNum_ = 0, txt = null;\n\t\tfor(var ii = 0; ii < 2; ii++) {\n\t\t\tfor(var nn=0; nn<15; nn++) {\n\t\t\t\tif(gridLblTxtNum_ == 0) {\n\t\t\t\t\ttxt = '';\t\n\t\t\t\t} else if(gridLblTxtNum_ == 1) {\n\t\t\t\t\ttxt = gridLblTxtNum_ + ' s';\n\t\t\t\t} else {\n\t\t\t\t\ttxt = gridLblTxtNum_;\n\t\t\t\t}\n\t\t\t\tpatternContainers[ii].getChildAt(4).getChildAt(nn).text = txt;\n\t\t\t\tgridLblTxtNum_++;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d308399de0502cb9c3a42c5a7c0101cc", "score": "0.47847247", "text": "function BMTimeline() {}", "title": "" }, { "docid": "c15e9c6c9985114ab28992dd1bea0782", "score": "0.47839013", "text": "function renderTimeLabels() {\n dom.axis.label0\n .attr('x', 5)\n .attr('y', 15)\n .text(formatterWithYear(timerange[0]));\n\n dom.axis.label1\n .attr('x', WIDTH - 5)\n .attr('y', 15)\n .text(formatterWithYear(timerange[1]))\n .style('text-anchor', 'end');\n }", "title": "" }, { "docid": "35dd57791660932d4bfcd521f2c9b122", "score": "0.47831953", "text": "recalculate() {\n\n // console.log(this);\n\n if ('undefined' == typeof(this.items)) { // Version 1\n var timeSlice = this.target.selector.filter(function (item) {\n return item.type === \"FragmentSelector\";\n })[0].value;\n } else { // Version 2\n var timeSlice = this.items[0].items[0].items[0].target.selector.value;\n }\n timeSlice = timeSlice.replace('#t=npt:','t=');\n timeSlice = timeSlice.replace(\"t=\", \"\");\n\n /// Start time in seconds\n this.beginTime = parseFloat(timeSlice.split(\",\")[0]);\n /// End time in seconds\n this.endTime = parseFloat(timeSlice.split(\",\")[1]);\n // console.log('beginTime: ' + this.beginTime + ' endTime: ' + this.endTime);\n\n /// Extract tags from annotation\n if ('undefined' == typeof(this.items)) { // Version 1\n this.tags = this.body.filter(item => item.purpose === \"tagging\").map(item => item.value);\n } else { // Version 2\n this.tags = [];\n for (var j = 0; j < this.items[0].items[0].items[0].body.length; j++) {\n if (this.items[0].items[0].items[0].body[j].purpose != 'tagging') continue;\n if ('undefined' != typeof(this.items[0].items[0].items[0].body[j].value)) { // Basic tag\n this.tags.push(this.items[0].items[0].items[0].body[j].value);\n } else if ('undefined' != typeof(this.items[0].items[0].items[0].body[j].source)) { // Onomy tag\n this.tags.push(this.items[0].items[0].items[0].body[j].source.label['en']); // TODO: english hard-coded here\n }\n }\n }\n // console.log('Tags: ' + this.tags);\n\n // Start and end poly points\n this.polyStart = null;\n this.polyEnd = null;\n\n var pointsSelector = [];\n if ('undefined' == typeof(this.items)) { // Version 1\n pointsSelector = this.target.selector.filter(item => item.type === \"SvgSelector\");\n } else { // Version 2\n pointsSelector = ('undefined' != typeof(this.items[0].items[0].items[0].target.selector.refinedBy)) ? [this.items[0].items[0].items[0].target.selector.refinedBy] : [];\n }\n if (pointsSelector.length > 0) {\n let pointsSvg = pointsSelector[0].value;\n let regExString = new RegExp(\"(?:points=')(.*?)(?:')\", \"ig\");\n var pointsRE = regExString.exec(pointsSvg)[1];\n var pointsData = pointsRE.trim().split(\" \").map(item => item.split(\",\"));\n this.polyStart = pointsData;\n\n let parser = new DOMParser();\n let xmlDoc = parser.parseFromString(pointsSvg, \"text/xml\");\n if (xmlDoc.getElementsByTagName(\"animate\").length) { // If there is no animation element, create an \"animation\" from the static points\n pointsRE = xmlDoc.getElementsByTagName(\"animate\")[0].getAttribute(\"to\");\n pointsData = pointsRE.trim().split(\" \").map(item => item.split(\",\"));\n this.polyEnd = pointsData;\n }\n }\n }", "title": "" }, { "docid": "f7d2000e78ecb5e6e166e4509308cecb", "score": "0.4779321", "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": "6ac1e06aafc7e1066f7a9fdabd70a4e6", "score": "0.47792074", "text": "async function processChallengeTimelineTemplates () {\n // logger.debug('Loading challenge timelines')\n const challengeTypesFromDynamo = await challengeService.getChallengeTypesFromDynamo()\n const typeIds = map(challengeTypesFromDynamo, 'id')\n return challengeService.createChallengeTimelineMapping(typeIds)\n}", "title": "" }, { "docid": "567d291c8f5b9b589643ec7b4577e94d", "score": "0.47778738", "text": "function TimeLine(){\n var self = this;\n self.params = {\n gender: undefined,\n origin: undefined,\n name: undefined\n };\n self.history = [];\n $http.get('dialog.json').then(function(tree){\n self.tree = tree;\n });\n\n }", "title": "" }, { "docid": "78c6538f605f8baaab2c9bd4a164b909", "score": "0.47748646", "text": "function createWorkDay() {\n for (i = 0; i < 9; i++) {\n // create elements that make up time-block\n var workDayRow = $(\"<div>\").addClass(\"row time-block\");\n var timeBlockHr = $(\"<div>\").addClass(\"hour col-12 col-md-1\");\n var timeBlockDescription = $(\"<textarea>\").addClass(\"description col-12 col-md-10\");\n var timeBlockSaveBtn = $(\"<button>\").addClass(\"saveBtn col-12 col-md-1 fas fa-save\");\n timeBlockHr.text(moment(startHour).add(i, 'hours').format('h A'));\n if (scheduledItems[i]) {\n timeBlockDescription.text(scheduledItems[i].description);\n }\n\n // append time-block children to the time-block row\n workDayRow.append(timeBlockHr, timeBlockDescription, timeBlockSaveBtn);\n // set time-block id\n workDayRow.attr(\"id\", i);\n\n\n // append time-block row to container\n $(\".container\").append(workDayRow);\n }\n }", "title": "" }, { "docid": "2c88d6df0f9b3efd6030334a0ae71e81", "score": "0.4770611", "text": "function createTimeline(stopID, stopDate, stopTitle, stopPlace) {\n var stopList = document.getElementById('stop-list');\n item = stopList.appendChild(document.createElement('li'));\n \n $('#sidebar').addClass('timeline');\n \n item.innerHTML = \n '<div class=\"location-date\"><span class=\"location-id\" data-stop-id=\"'+ stopID + '\">Stop #' + stopID + '</span>' + \n '<span class=\"stop-date\">'+ stopDate + '</span></div>' +\n '<div class=\"location-name\"><a>' + stopTitle + '</a></div>' +\n '<div class=\"location-place\">' + stopPlace + '</div>';\n\n $(item).addClass('location');\n scrollSidebar.refresh();\n}", "title": "" }, { "docid": "46e4d91c74f55185e704f1c0b835f353", "score": "0.4766326", "text": "function create_nested_tool_state_table(parent) {\n\tvar text \t\t\t\t= \"\",\n\t\tsplit_text\t\t\t= [],\n\t\tre \t\t\t\t\t= null,\n\t\ttoolStateProperties\t= [], \n\t match \t\t\t\t= [], \n\t json_data\t\t\t= null,\n\t val \t\t\t\t= \"\",\n\t json_data\t\t\t= null,\n\t obj\t\t\t\t\t= null,\n\t td \t\t\t\t\t= null,\n\t nested_table \t\t= null;\n\n\ttext = parent[0][0].__data__;\n\n\t// prepare json\n\ttext = text.replace(/\\\\/g, \"\");\n\ttext = text.replace(/\\\"\\{\\\"/g, \"\\{\\\"\");\n\ttext = text.replace(/\\\"\\}\\\"/g, \"\\\"\\}\");\n\ttext = text.replace(/\\\"\\\"/g, \"\\\"\");\n\ttext = text.replace(/\\}\\\",/g, \"\\},\");\n\ttext = text.replace(/\\}\\\"/g, \"\\}\");\n\n\t// eliminate __xxxx__ parameters\t\n\ttext = text.replace(/\\\"__(\\S*)__\\\":\\s{1}\\d*(,\\s{1})?/g, \"\");\n\ttext = text.replace(/,\\s{1}\\}/g, \"\\}\");\n\n\t// transform to json object\n\tjson_data = JSON.parse (text);\n\tobj = d3.entries(json_data);\n\t\n\t// add nested table\t\n\ttd = parent.append(\"table\")\n\t\t.classed(\"table table-condensed\", true)\n\t\t.classed(\"table-bordered\", false)\n\t\t.append(\"tbody\").selectAll(\"tr\")\n\t\t\t.data(obj)\n\t\t\t.enter()\n\t\t\t// add table row\n\t\t\t.append(\"tr\")\n\t\t\t\t.selectAll(\"td\")\n\t\t\t\t.data(function(d) { return [d.key, d.value]})\n\t\t\t\t.enter()\n\t\t\t\t// add table data\n\t\t\t\t.append(\"td\");\n\n\t// if data data contains another nested object, call recursively\n\t// if not, just add the text to td\n\ttd.each( function (d) {\n\t\tif (typeof d === \"object\") { \n\t\t\tcreate_nested_recursive_tool_state_table(d3.select(this), d);\n\t\t} else {\n\t\t\td3.select(this).text( function (d) { return d;});\n\t\t}\t\t\n\t});\t\t\t\n}", "title": "" }, { "docid": "ad81708dc78343daf05cab4d625a11cd", "score": "0.47611117", "text": "function drawTimeline(left, right, ymid, yheight, mylo, myhi) {\n var zoom = Math.pow(G_config.tile_subsample, G_zoomLevel);\n\n setColor(COLOR_TIMELINE, 0.5);\n drawQuad(true,\n 0.0, ymid,\n 1.0, yheight);\n\n setColor(COLOR_TIMELINE);\n drawQuad(true,\n left, ymid,\n right - left, yheight);\n\n var considerMouseOverTimeline = ((G_mousePos && mylo <= G_mousePos.y && G_mousePos.y <= myhi) || G_mouseAction === MOUSE_PAN || G_mouseAction === MOUSE_CREATE_LABEL);\n\n if (G_config.start_time_ms) { // maybe unneeded check\n var SCALES = getScales(G_config.sample_rate);\n\n var scale = SCALES[0];\n for (var ii = 1; ii < SCALES.length; ++ ii) {\n if (G_xScale * (scale[2] / zoom) > 0.20) {\n break;\n }\n scale = SCALES[ii];\n }\n\n var elsc = scale[0];\n var elms = scale[1];\n var scalesmp = scale[2];\n\n var startSample = (G_config.start_time_ms + (1000 * 60 * 60 * 19)) * G_config.sample_rate / 1000; // TODO: offset?\n var startOffset = scalesmp - (startSample % scalesmp);\n\n var losmp = (((0.0 - X_OFFSET) / G_xScale) - G_xOffset) * zoom;\n losmp = Math.max(0, losmp);\n losmp = Math.floor(losmp / scalesmp) * scalesmp + startOffset;\n if (losmp >= scalesmp) {\n losmp -= scalesmp;\n }\n var hismp = losmp + (6 * scalesmp);\n hismp = Math.min(hismp, G_config.length - scalesmp / 4);\n\n setColor(COLOR_TIMELINE_TEXT);\n for (var smp = losmp; smp < hismp; smp += scalesmp) {\n var skip = false;\n var smpx = G_xScale * (G_xOffset + (smp / zoom)) + X_OFFSET;\n if (G_mousePos && smpx - 0.20 <= G_mousePos.x && G_mousePos.x <= smpx + 0.12 && left <= G_mousePos.x && G_mousePos.x <= right && considerMouseOverTimeline) {\n skip = true;\n }\n\n if (!skip) {\n drawTime(smp, elsc, elms, false, zoom, ymid, yheight, false, true);\n }\n }\n }\n\n if (G_mousePos && left <= G_mousePos.x && G_mousePos.x <= right && considerMouseOverTimeline) {\n var sample = Math.round(((G_mousePos.x - X_OFFSET) / G_xScale) - G_xOffset) * zoom;\n if (sample >= 0 && sample < G_config.length) {\n setColor(G_modeColorMap.yaxis);\n drawTime(sample, false, false, true, zoom, ymid, yheight, true, true);\n }\n }\n}", "title": "" }, { "docid": "aaef50698919af036683893c0ee19c03", "score": "0.47596344", "text": "function create_timeline_config() {\n\treturn {\n\t\twidth: '100%',\n\t\theight: '600px',\n\t\t//source: 'path_to_json/or_link_to_googlespreadsheet',\n\t\tembed_id: 'timeline-embed', //OPTIONAL USE A DIFFERENT DIV ID FOR EMBED\n\t\tstart_at_end: false, //OPTIONAL START AT LATEST DATE\n\t\tstart_at_slide: '0', //OPTIONAL START AT SPECIFIC SLIDE\n\t\tstart_zoom_adjust: '3', //OPTIONAL TWEAK THE DEFAULT ZOOM LEVEL\n\t\thash_bookmark: true, //OPTIONAL LOCATION BAR HASHES\n\t\tfont: 'Bevan-PotanoSans', //OPTIONAL FONT\n\t\tdebug: true, //OPTIONAL DEBUG TO CONSOLE\n\t\tlang: 'en', //OPTIONAL LANGUAGE\n\t\t//maptype: 'watercolor' //OPTIONAL MAP STYLE\n\t\t//css: 'path_to_css/timeline.css', //OPTIONAL PATH TO CSS\n\t\t//js: 'path_to_js/timeline-min.js' //OPTIONAL PATH TO JS\n\t}\n}", "title": "" }, { "docid": "6b26e6e209480adf15de8cc78501f252", "score": "0.47581863", "text": "function generateTDTimeline(data) {\n let pop = \"<h3 class='ui image header'>\";\n pop +=\n \"<img src='assets/heroes-talents/images/heroes/\" +\n Heroes.heroIcon(data.victim.hero) +\n \"' class='ui large circular image'>\";\n pop += \"<div class='content'>\" + data.victim.hero + \"<div class='sub header player-name'>Killed at \";\n pop += formatSeconds(data.time) + '</div></div></h3>';\n pop += \"<h3 class='ui header second'>Killed By</h3>\";\n pop += \"<div class='ui mini circular images'>\";\n\n for (let a in data.killers) {\n let k = data.killers[a];\n pop += \"<img class='ui image' src='assets/heroes-talents/images/heroes/\" + Heroes.heroIcon(k.hero) + \"'>\";\n }\n pop += '</div>';\n\n let text = '<div class=\"timeline-popup\" data-html=\"' + pop + '\">';\n text +=\n '<img src=\"assets/heroes-talents/images/heroes/' +\n Heroes.heroIcon(data.victim.hero) +\n '\" class=\"ui circular avatar image\">';\n text += data.victim.hero + '</div>';\n return text;\n}", "title": "" }, { "docid": "81123a51f8ba09dd1d73a2fb1ba97fe4", "score": "0.47495487", "text": "renderStructure() {\n /** First we remove the previous chart if one has been added already. */\n let existing = document.getElementById('github-logged-time-chart-root');\n\n if (existing) {\n existing.parentNode.removeChild(existing);\n existing = null;\n }\n\n const chartRoot = document.createElement('div');\n chartRoot.id = 'github-logged-time-chart-root';\n chartRoot.classList.add('discussion-sidebar-item', 'sidebar-assignee', 'js-discussion-sidebar-item');\n\n const stylingDiv = document.createElement('div');\n stylingDiv.classList.add('js-issue-sidebar-form');\n chartRoot.appendChild(stylingDiv);\n\n const detailsDiv = document.createElement('div');\n detailsDiv.classList.add(\n 'details-reset',\n 'details-overlay',\n 'select-menu',\n 'js-select-menu',\n 'js-dropdown-details',\n 'js-load-contents'\n );\n stylingDiv.appendChild(detailsDiv);\n\n const summaryDiv = document.createElement('div');\n summaryDiv.classList.add(\n 'text-bold',\n 'discussion-sidebar-heading',\n 'discussion-sidebar-toggle',\n 'github-logged-time-chart-wrapper-block'\n );\n detailsDiv.appendChild(summaryDiv);\n\n const titleSpan = document.createElement('span');\n titleSpan.innerText = 'Github Logged Time Chart';\n\n const chartContainer = document.createElement('div');\n chartContainer.id = 'chartContainer';\n chartContainer.style.height = '240px';\n chartContainer.style.width = '100%';\n\n const hourWrapper = document.createElement('div');\n hourWrapper.id = 'hour-wrapper';\n\n summaryDiv.appendChild(titleSpan);\n summaryDiv.appendChild(chartContainer);\n summaryDiv.appendChild(hourWrapper);\n\n const clockDiv = document.createElement('div');\n clockDiv.id = 'clock';\n clockDiv.appendChild(document.createElement('span'));\n clockDiv.appendChild(document.createElement('span'));\n clockDiv.appendChild(document.createElement('span'));\n\n hourWrapper.appendChild(clockDiv);\n\n const developersRoot = document.createElement('div');\n const developerList = document.createElement('ul');\n developerList.id = 'developer-list';\n developersRoot.appendChild(developerList);\n\n /** Append the finald structure to the DOM */\n document.getElementById('partial-discussion-sidebar')?.prepend(developersRoot);\n document.getElementById('partial-discussion-sidebar')?.prepend(chartRoot);\n }", "title": "" }, { "docid": "437bbbf172de1af8ad8d5895dc43bbc1", "score": "0.47473508", "text": "updateDependenciesForTimeSpan(timeSpanRecord, element, newResource = null) {\n const\n me = this,\n eventRecord = timeSpanRecord.isAssignment ? timeSpanRecord.event : timeSpanRecord,\n deps = me.dependencyStore.getTimeSpanDependencies(eventRecord),\n metaId = me.getMetaId(),\n scheduler = me.client,\n originalTaskRect = Rectangle.from(element, scheduler.timeAxisSubGridElement),\n row = newResource && scheduler.getRowFor(newResource);\n\n let bounds;\n\n deps.forEach(dep => {\n const assignments = this.getIteratableDependencyAssignments(dep);\n\n assignments.forEach(assignmentData => {\n const taskRect = originalTaskRect.clone();\n let startRectangle, endRectangle;\n\n if (row) {\n taskRect.rowTop = row.top;\n taskRect.rowBottom = row.bottom;\n }\n\n // If dragging one multi assigned event the others wont move until it is dropped. Prevent their dep\n // lines from updating by bailing out\n if (assignmentData && assignmentData.from !== timeSpanRecord && assignmentData.to !== timeSpanRecord) {\n return;\n }\n\n // Bail out if dependency is not visible (other end might be collapsed)\n if (!me.isDependencyVisible(dep, assignmentData)) {\n return;\n }\n\n if (me.getTimeSpanRecordFromDependency(dep, true) === eventRecord) {\n startRectangle = taskRect;\n\n // try to look into dependency cache first\n if ((bounds = dep.instanceMeta(metaId).bounds)) {\n endRectangle = bounds.endRectangle;\n }\n else {\n endRectangle = me.getBox(dep, false, assignmentData);\n }\n }\n else {\n // try to look into dependency cache first\n if ((bounds = dep.instanceMeta(metaId).bounds)) {\n startRectangle = bounds.startRectangle;\n }\n else {\n startRectangle = me.getBox(dep, true, assignmentData);\n }\n\n endRectangle = taskRect;\n }\n\n if (startRectangle && endRectangle) {\n me.drawDependency(dep, { startRectangle, endRectangle }, assignmentData);\n }\n });\n });\n }", "title": "" }, { "docid": "766e9c4ccae9404dc32c0f866ad7baef", "score": "0.47431034", "text": "function buildSidebar(tripObj) {\n $.each(tripObj.features, function(i) {\n var thisStop = tripObj.features[i];\n \n stopID = i + 1;\n stopTitle = thisStop.properties.title;\n stopPlace = thisStop.properties.place;\n stopDate = thisStop.properties.date;\n\n createTimeline(stopID, stopDate, stopTitle, stopPlace); \n });\n}", "title": "" } ]
2547fab650ec2aa15ea059695f15c5dd
Return CSS class for intent.
[ { "docid": "35a97290e522181d96a3eb58e7e562f3", "score": "0.70228297", "text": "function intentClass(intent) {\n if (intent == null || intent === _intent__WEBPACK_IMPORTED_MODULE_2__[\"Intent\"].NONE) {\n return undefined;\n }\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" } ]
[ { "docid": "aa73d033e461c86b7f57e29e28311645", "score": "0.70269835", "text": "function intentClass(intent) {\n if (intent == null || intent === intent_1.Intent.NONE) {\n return undefined;\n }\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "e9ebbf4d86f91f860cac969f31078140", "score": "0.6890989", "text": "function intentClass(intent) {\n if (intent === void 0) { intent = __WEBPACK_IMPORTED_MODULE_2__intent__[\"a\" /* Intent */].NONE; }\n if (intent == null || intent === __WEBPACK_IMPORTED_MODULE_2__intent__[\"a\" /* Intent */].NONE) {\n return undefined;\n }\n return NS + \"-intent-\" + intent.toLowerCase();\n}", "title": "" }, { "docid": "020830827bb95b35c9753947a4399d27", "score": "0.6550009", "text": "function getClass(type) {\n\n var className;\n\n if (type == \"incomingNotification\") {\n className=\"newStyle\";\n } else {\n className=\"message\";\n }\n\n return className;\n\n }", "title": "" }, { "docid": "10b140c9c95458898dddd717b04c4386", "score": "0.5879829", "text": "getClassName() {\n let className = this.props.isSecondary ? \"sgds-sec-button\" : \"sgds-button\";\n if (this.props.isPrimary) {\n className = className.concat(\" is-primary\");\n }\n if (this.props.isOutlined) {\n className = className.concat(\" is-outlined\");\n }\n if (this.props.isRounded) {\n className = className.concat(\" is-rounded\");\n }\n if (this.props.isLoading) {\n className = className.concat(\" is-loading\");\n }\n className = className.concat(this.getSize());\n className = className.concat(this.getColorType());\n\n return className.concat(` ${this.props.className || \"\"}`);\n }", "title": "" }, { "docid": "50bbbe0e1af547a5d1dd446e1cea9a0e", "score": "0.5834577", "text": "function whatClassName(element) {\n let className;\n switch (element) {\n case 'ingredients__list list':\n className = 'style--ingredients';\n break;\n case 'devices__list list':\n className = 'style--devices';\n break;\n case 'utensils__list list':\n className = 'style--utensils';\n break;\n }\n return className;\n}", "title": "" }, { "docid": "d73475552775383ddfd8e6af4ac34953", "score": "0.576619", "text": "getClassName() {\n let classes = \"badge m-2 badge-\";\n classes += (this.props.counter.value === 0) ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "d80c05a9d672c76ab1b6c7ec76ec1f59", "score": "0.5716602", "text": "function _actionClass() {\n var classesActions = this.classes.actions;\n var action = this.s.action;\n var wrapper = $(this.dom.wrapper);\n wrapper.removeClass([classesActions.create, classesActions.edit, classesActions.remove].join(' '));\n if (action === \"create\") {\n wrapper.addClass(classesActions.create);\n }\n else if (action === \"edit\") {\n wrapper.addClass(classesActions.edit);\n }\n else if (action === \"remove\") {\n wrapper.addClass(classesActions.remove);\n }\n}", "title": "" }, { "docid": "7cf54caa7899e3e1727eb0aa54ad6664", "score": "0.56972456", "text": "function getClickedSkillClassName(clickedSkill) {\n\n let listOfClass = clickedSkill.classList;\n let clickedSkillClassName = listOfClass[1];\n return clickedSkillClassName;\n}", "title": "" }, { "docid": "665695a6a3edc223ec29b0e79990675e", "score": "0.56723815", "text": "function iconClass(iconName) {\n if (iconName == null) {\n return undefined;\n }\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\n}", "title": "" }, { "docid": "665695a6a3edc223ec29b0e79990675e", "score": "0.56723815", "text": "function iconClass(iconName) {\n if (iconName == null) {\n return undefined;\n }\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\n}", "title": "" }, { "docid": "665695a6a3edc223ec29b0e79990675e", "score": "0.56723815", "text": "function iconClass(iconName) {\n if (iconName == null) {\n return undefined;\n }\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\n}", "title": "" }, { "docid": "665695a6a3edc223ec29b0e79990675e", "score": "0.56723815", "text": "function iconClass(iconName) {\n if (iconName == null) {\n return undefined;\n }\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\n}", "title": "" }, { "docid": "5ee442eea983fb1ea3f0adafc5492c84", "score": "0.5517614", "text": "iconClass(desc) {\n if(!desc) return\n return `icon icon-${desc.toLowerCase()}`\n }", "title": "" }, { "docid": "99015ba37d315dead85c6723dd450834", "score": "0.5475909", "text": "getCssClass() {\r\n return this.cssClass;\r\n }", "title": "" }, { "docid": "4ded9155bc2778b97c1bafe331e7ac3b", "score": "0.5464139", "text": "cssClass() {\n throw new Error('pure virtual function cssClass');\n }", "title": "" }, { "docid": "0747a8d5938d81523d7e6a71accfa515", "score": "0.5462551", "text": "dynamicClass() {\n const className = this.state.clicked ? \"stopAnimation\" : \"pulse-btn\";\n return className;\n }", "title": "" }, { "docid": "12ac4a653d622d01e6b66e84aae0f51f", "score": "0.54296726", "text": "seatClass() {\n let cssClass = 'vacant';\n\n if (this.reserved)\n {\n cssClass = 'reserved';\n }\n\n return cssClass;\n }", "title": "" }, { "docid": "d2f49ab8ef42582f801962fb7501f633", "score": "0.536958", "text": "getAlertClass(type) {\n\t\treturn `alert-${type}`;\n\t}", "title": "" }, { "docid": "1d2fbeacd896dac2f201a5fd1e2005d8", "score": "0.5353532", "text": "getClassName (isVisible) {\n const { event } = this.props;\n const current = this.isToday() ? ' Day--current' : '';\n const highlighted = event ? ` Day--${event.id}` : '';\n const weekend = this.isWeekend() ? ' Day--weekend' : '';\n const visibility = !isVisible ? ' Day--hidden' : '';\n\n return `Day${highlighted}${current}${weekend}${visibility}`;\n }", "title": "" }, { "docid": "1c31e37a0e52d1699c339bf5624f981e", "score": "0.5333327", "text": "getRatingClass(rating) {\n if (rating === 1) {\n return 'profile-rating rating-red';\n } else if (rating === 5) {\n return 'profile-rating rating-green';\n } else {\n return 'profile-rating';\n }\n }", "title": "" }, { "docid": "788b1375e04538a15464cc1fd9607ea9", "score": "0.5329836", "text": "function ECMS_include_class(node, i) {\r\n\t//var cl = ECMS_class_cache[i];\r\n\tvar cl = node.wbStyle;\r\n\treturn (cl ? ' class=\"' + cl + '\"' : '');\r\n}", "title": "" }, { "docid": "9cdc0808c289507aec3d2cb346e89eea", "score": "0.53279114", "text": "function getClasses(route) {\n return getRouteName(route) + ' ' + isCurrent(route);\n }", "title": "" }, { "docid": "166805a2e6af38d7ef99db193f92a7b0", "score": "0.5322152", "text": "get typeClasses() {\n return classNames(\n 'carbon-message__type', {\n 'carbon-message__type--rounded': this.props.roundedCorners\n }\n );\n }", "title": "" }, { "docid": "1f7fcad8fa433704455640636c62c159", "score": "0.529579", "text": "function getClassName(props) {\n var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n\n return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n}", "title": "" }, { "docid": "5c9a6c74440cf0d80884c8b3d82c403e", "score": "0.52853805", "text": "function className(lineCode: string): string {\n if (lineCode.split(/class /).length >= 2) {\n const textInTheRightOfClassKeyword = lineCode.split(/class /)[1].trim();\n if (textInTheRightOfClassKeyword.split(\" \").length > 0) {\n return textInTheRightOfClassKeyword.split(\" \")[0].replace(\"{\", \"\");\n } else {\n return textInTheRightOfClassKeyword.replace(\"{\", \"\");\n }\n }\n return \"\";\n}", "title": "" }, { "docid": "e23727c02c69b111321982f8e1a201c3", "score": "0.5275374", "text": "function getIconClassName(name) {\n var className = '';\n var icon = icons_1.getIcon(name);\n if (icon) {\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\"\n }\n }\n });\n }\n return className;\n}", "title": "" }, { "docid": "a7e0940d0e37181c0f875c4a740bbfbb", "score": "0.52657676", "text": "function getIconClassName(name) {\n var className = '';\n var icon = Object(_icons__WEBPACK_IMPORTED_MODULE_1__[\"getIcon\"])(name);\n if (icon) {\n className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_0__[\"mergeStyles\"])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\",\n },\n },\n });\n }\n return className;\n}", "title": "" }, { "docid": "b9525c1c218f1467154133933de15c01", "score": "0.52556485", "text": "function getIconClass(climate) { // je nach json return wird icon returned in die card\n if (climate == \"Clouds\") {\n return \"wi-day-cloudy\";\n }\n else if (climate == \"Thunderstorm\") {\n return \"wi-day-sleet-storm\";\n }\n else if (climate == \"Drizzle\") {\n return \"wi-day-sleet\";\n }\n else if (climate == \"Rain\") {\n return \"wi-day-rain\";\n }\n else if (climate == \"Snow\") {\n return \"wi-snowflake-cold\";\n }\n else if (climate == \"Atmosphere\") {\n return \"wi-dust\";\n }\n else if (climate == \"Clear\") {\n return \"wi-day-sunny\";\n }\n else if (climate == \"Extreme\") {\n return \"wi-meteor\";\n }\n return \"wi-day-cloudy\";\n }", "title": "" }, { "docid": "847e3dd97e2f2fd8078bee82c5fe9bc4", "score": "0.5254711", "text": "getClassName() {\n return \"Color3\";\n }", "title": "" }, { "docid": "2378ad2c8275fd16a680bbc70b37b81a", "score": "0.5252847", "text": "function getIconClassName(name) {\n var className = '';\n var icon = Object(_icons__WEBPACK_IMPORTED_MODULE_1__[\"getIcon\"])(name);\n if (icon) {\n className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_0__[\"mergeStyles\"])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\"\n }\n }\n });\n }\n return className;\n}", "title": "" }, { "docid": "2378ad2c8275fd16a680bbc70b37b81a", "score": "0.5252847", "text": "function getIconClassName(name) {\n var className = '';\n var icon = Object(_icons__WEBPACK_IMPORTED_MODULE_1__[\"getIcon\"])(name);\n if (icon) {\n className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_0__[\"mergeStyles\"])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\"\n }\n }\n });\n }\n return className;\n}", "title": "" }, { "docid": "2378ad2c8275fd16a680bbc70b37b81a", "score": "0.5252847", "text": "function getIconClassName(name) {\n var className = '';\n var icon = Object(_icons__WEBPACK_IMPORTED_MODULE_1__[\"getIcon\"])(name);\n if (icon) {\n className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_0__[\"mergeStyles\"])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\"\n }\n }\n });\n }\n return className;\n}", "title": "" }, { "docid": "b5f7bcb017bb73554306c41a8ac98672", "score": "0.5234634", "text": "function classname(el, type /* class1, class2... */) {\n var clsnames = el.className.trim();\n clsnames = (clsnames) ? clsnames.split(/\\s+/) : [];\n for (var a = 2, cls, idx; cls = arguments[a]; a++) {\n idx = clsnames.indexOf(cls);\n if (type === 'add' && idx < 0) clsnames.push(cls);\n if (type === 'rm' && idx >= 0) clsnames.splice(idx, 1);\n }\n el.className = clsnames.join(' ');\n return el;\n }", "title": "" }, { "docid": "f6ed0959c470c153a7f22733830f870a", "score": "0.5233022", "text": "function getContClassName (className, onTop, isVisible) {\n let res = className;\n\n if (isVisible) {\n if (onTop) {\n res += ` ${style.trackPreviewContVisibleTop}`;\n } else {\n res += ` ${style.trackPreviewContVisibleBottom}`;\n }\n }\n\n return onTop ? res + ` ${style.trackPreviewContTop}` : res;\n}", "title": "" }, { "docid": "0aa9611b6f7b1f64185b9fbc805eddc0", "score": "0.52291876", "text": "getClassName(element) {\n return element.className.split(' ')[0];\n }", "title": "" }, { "docid": "d6a1b1b051c0cd9cff091b477c670a97", "score": "0.5227964", "text": "function getEntryClass() {\n\t\treturn entry.cls;\n\t}", "title": "" }, { "docid": "8be688cafed284f3a2f6bf853c03ea4e", "score": "0.5223257", "text": "getAttribute(/* attributeName */) {\n return this.className;\n }", "title": "" }, { "docid": "c9c918d60695e67be1ac252090cf4eb5", "score": "0.5212862", "text": "inputClass () {\n let klass = ''\n\n if (!this.props.disabled) {\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n if (this.state.valid) {\n klass += ' usa-input-success'\n }\n }\n\n return klass.trim()\n }", "title": "" }, { "docid": "c9c918d60695e67be1ac252090cf4eb5", "score": "0.5212862", "text": "inputClass () {\n let klass = ''\n\n if (!this.props.disabled) {\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n if (this.state.valid) {\n klass += ' usa-input-success'\n }\n }\n\n return klass.trim()\n }", "title": "" }, { "docid": "1ca0096157d201b042d01efd62c3c3f4", "score": "0.52018", "text": "getClassname() {\n var def = \"main-view\";\n \n var location = this.props.location.pathname;\n var extra = \"\";\n\n extra = location.split(\"/\");\n if (extra) {\n extra = extra[1];\n }\n \n return `${def} ${extra}`;\n }", "title": "" }, { "docid": "cbb7a5ded7263371e2dbcc31ab119859", "score": "0.5193146", "text": "get class() {\n return this.prop('className');\n }", "title": "" }, { "docid": "4b3938d4dbdb61d09dd2542e6209db28", "score": "0.5191997", "text": "function themeClassname(index, css) {\n var cmatch = css.match(/(^|\\s)theme-\\S+/g);\n return (cmatch || []).join(' ');\n }", "title": "" }, { "docid": "f9143a5451a6ed7f2e75b63800216ad4", "score": "0.518542", "text": "function getIconClassName(name) {\n var className = '';\n var icon = Object(_icons__WEBPACK_IMPORTED_MODULE_1__[\"getIcon\"])(name);\n if (icon) {\n className = Object(_fluentui_merge_styles__WEBPACK_IMPORTED_MODULE_0__[\"mergeStyles\"])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\",\n },\n },\n });\n }\n return className;\n}", "title": "" }, { "docid": "2e4ffd03ed4b15e52dc308a7ed484a33", "score": "0.5184124", "text": "function ekFlexMenu_classNames() {}", "title": "" }, { "docid": "e3de3a557752483cb5689dc632abaddc", "score": "0.5163324", "text": "getClasses() {\n let classes = ['input-base'];\n\n if (this.props.disabled === true) {\n classes.push('disabled');\n }\n\n if (this.props.required === true) {\n classes.push('required');\n }\n\n if (this.state.invalid === true) {\n classes.push('invalid');\n }\n\n return classes.join(' ');\n }", "title": "" }, { "docid": "7837af223155af35065b386117c79085", "score": "0.5158237", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "7837af223155af35065b386117c79085", "score": "0.5158237", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "7837af223155af35065b386117c79085", "score": "0.5158237", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "18be5e4de233119e1cbd18ef2ca2877f", "score": "0.51567847", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if ((arg.hasOwnProperty('toString') && typeof (arg.toString) === 'function')) {\n classes.push(arg.toString());\n }\n else {\n // tslint:disable-next-line:no-any\n for (var key in arg) {\n // tslint:disable-next-line:no-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "53775e61ec268b0b53f3f81174aad4c9", "score": "0.51446915", "text": "function translateToCssClass(scope, element) {\n\t element.addClass(className);\n\t }", "title": "" }, { "docid": "77f63257f833a74deb7f455d8e32f991", "score": "0.5141955", "text": "className(index) {\n const { barClasses, currentStep } = this.props;\n let className = barClasses.step;\n if (index < currentStep) className = barClasses.done;\n if (index === currentStep) className = barClasses.current;\n return className;\n }", "title": "" }, { "docid": "fee946c05dce235e178ad8d52bccedee", "score": "0.51385015", "text": "getCellCSSClass(cell) {\n let cssClass = \"\";\n switch (cell.type) {\n case CellType.CLEAR:\n cssClass = \"clear\";\n break;\n case CellType.WALL:\n cssClass = \"wall\";\n break;\n case CellType.FOOD:\n cssClass = \"food\";\n break;\n case CellType.ANTHILL:\n cssClass = \"anthill\";\n break;\n }\n return cssClass;\n }", "title": "" }, { "docid": "5714ad47653b22becc47275264dd7865", "score": "0.5134534", "text": "function getClassName(type) {\n return document.getElementsByClassName(type)[0];\n}", "title": "" }, { "docid": "4b143658794ca69f5b9e3030039c1535", "score": "0.5132728", "text": "function translateToCssClass(scope, element) {\n element.addClass(className);\n }", "title": "" }, { "docid": "4b143658794ca69f5b9e3030039c1535", "score": "0.5132728", "text": "function translateToCssClass(scope, element) {\n element.addClass(className);\n }", "title": "" }, { "docid": "4b143658794ca69f5b9e3030039c1535", "score": "0.5132728", "text": "function translateToCssClass(scope, element) {\n element.addClass(className);\n }", "title": "" }, { "docid": "4b143658794ca69f5b9e3030039c1535", "score": "0.5132728", "text": "function translateToCssClass(scope, element) {\n element.addClass(className);\n }", "title": "" }, { "docid": "52dd206a64ae78b2601b62a988b18307", "score": "0.5121766", "text": "successStatusClass () {\n this.statusText.classList.add(this.settings.statusSuccessClass)\n }", "title": "" }, { "docid": "daa21895a02f3c75266f8bad44c16c04", "score": "0.51186776", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (var key in arg) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "daa21895a02f3c75266f8bad44c16c04", "score": "0.51186776", "text": "function css() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n if (arg) {\n if (typeof arg === 'string') {\n classes.push(arg);\n }\n else if (arg.hasOwnProperty('toString') && typeof arg.toString === 'function') {\n classes.push(arg.toString());\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (var key in arg) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n }\n return classes.join(' ');\n}", "title": "" }, { "docid": "5f3b1682c930ccd7eab3dd0b4ee76947", "score": "0.5115304", "text": "static reflectCssClass(e,t,o=null){document.querySelectorAll(\"form[ui-action=\\\"\"+e+\"\\\"] [type=\\\"submit\\\"], form[ui-action=\\\"\"+e+\"\\\"] button:not([type]), [ui-state=\\\"\"+e+\"\\\"]\").forEach(e=>c.setCssClass(e,t,o))}", "title": "" }, { "docid": "164cc40b8ca6582b99db0ee221e362ff", "score": "0.5113881", "text": "function cssClass(className) {\n return \"json-formatter-\" + className;\n}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.5112191", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.5112191", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.5112191", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.5112191", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "7ffbd70c7fada716ce74b575fcf17c3b", "score": "0.51036584", "text": "playModeClass(state){\n return playModes[state.playMode].icon\n }", "title": "" }, { "docid": "d77082280f4a5ec8dad7a56ae2c36a30", "score": "0.5096909", "text": "function translateToCssClass(scope, element) {\r\n element.addClass(className);\r\n }", "title": "" }, { "docid": "b230ea4d73bbbeefd40dcfd09c288ece", "score": "0.5081854", "text": "function getClass(){\n\tvar classes = ['варвар', 'монах', 'воин', 'паладин', 'вор', 'рейджер',\n\t'бард', 'чародей', 'колдун', 'волшебник', 'жрец', 'друид'];\n\treturn classes[Math.floor((Math.random() * classes.length) + 1)-1];\n}", "title": "" }, { "docid": "e83cc0308e094e77439aca8879d7ec38", "score": "0.50707316", "text": "function modalGetUserRoleIconClass() {\n // Get the role text\n let role = $('#modalUserRole').val();\n\n // Return the icon class for the role from the roleList global array\n return getRole(role).role_icon;\n}", "title": "" }, { "docid": "4325ddf53ea6160d1e6ca33ab928de79", "score": "0.50655127", "text": "function getClass(classType) {\n if (classType == 1) {\n return Mammal;\n } else {\n return Marsupial;\n }\n}", "title": "" }, { "docid": "805fff17c1585ebb87fee0072fff45a4", "score": "0.50642383", "text": "function getIconClass(status: boolean): string {\n return `material-icons online-icon ${status ? 'online' : 'offline'} user-status`;\n}", "title": "" }, { "docid": "d0b6f7bd02b8cf100beb1162e918bce2", "score": "0.50635463", "text": "function getLinkedinJobIconClass(position_title){\n position_title = position_title.toLowerCase();\n\n if(position_title.match(\".net\")){\n return \"icon-net-developer\";\n }\n else if (position_title.match(\"ember\")){\n return \"icon-javascript-developer\";\n }\n else if (position_title.match(\"node.js\")){\n return \"icon-javascript-developer\";\n }\n else if (position_title.match(\"front-end\")){\n return \"icon-frontend-developer\";\n }\n else if (position_title.match(\"stack\")){\n return \"icon-frontend-developer\";\n }\n else if (position_title.match(\"ios\")){\n return \"icon-mobile-developer\";\n }\n else if (position_title.match(\"mobile\")){\n return \"icon-mobile-developer\";\n }\n else if (position_title.match(\"ui\")){\n return \"icon-ui-designer\";\n }\n else if (position_title.match(\"ux\")){\n return \"icon-ux-designer\";\n }\n else if (position_title.match(\"pm\")){\n return \"icon-pm\";\n }\n else if (position_title.match(\"qa\")){\n return \"icon-qa-position\";\n }\n else if (position_title.match(\" \")){\n return \"icon-generic-position\";\n }\n}", "title": "" }, { "docid": "4155811a4ffe177150f30f18107fd42c", "score": "0.50559574", "text": "function determinecolor(characterclass){\n\t\n\tvar classname;\n\t\n\tswitch(characterclass){\n\t\t\n\t\tcase \"Necromancer\":\n\t\t\tclassname = \"green\"\n\t\t\tbreak;\n\t\tcase \"Ranger\":\n\t\t\tclassname = \"lightgreen\"\n\t\t\tbreak;\n\t\tcase \"Thief\":\n\t\t\tclassname = \"gray\"\n\t\t\tbreak;\n\t\tcase \"Elementalist\":\n\t\t\tclassname = \"red\"\n\t\t\tbreak;\n\t\tcase \"Mesmer\":\n\t\t\tclassname = \"purple\"\n\t\t\tbreak;\n\t\tcase \"Engineer\":\n\t\t\tclassname = \"orange\"\n\t\t\tbreak;\n\t\tcase \"Guardian\":\n\t\t\tclassname = \"blue\"\n\t\t\tbreak;\n\t\tcase \"Revenant\":\n\t\t\tclassname = \"redgrey\"\n\t\t\tbreak;\n\t\tcase \"Warrior\":\n\t\t\tclassname = \"yellow\"\n\t\t\tbreak;\n\t}\n\n\treturn classname;\n}", "title": "" }, { "docid": "b90106926fe6705d1c8207ba59d37917", "score": "0.5054766", "text": "get componentClasses() {\n return classNames(\n 'carbon-message',\n this.props.className,\n `carbon-message--${this.props.as}`,\n {\n 'carbon-message--rounded': this.props.roundedCorners,\n 'carbon-message--border': this.props.border,\n 'carbon-message--transparent': this.props.transparent,\n 'carbon-message--dismissable': this.props.onDismiss\n }\n );\n }", "title": "" }, { "docid": "ece197bb96d306b9a67458aa48befaf7", "score": "0.504221", "text": "getClassName() {\n return this.constructor.className;\n }", "title": "" }, { "docid": "ece197bb96d306b9a67458aa48befaf7", "score": "0.504221", "text": "getClassName() {\n return this.constructor.className;\n }", "title": "" }, { "docid": "6cdd6a0b9e8e3246098fb797945051c6", "score": "0.5036142", "text": "getclassname() {\n return \"Text\";\n }", "title": "" }, { "docid": "58b9b3b334fbb389384642faab213f24", "score": "0.50312334", "text": "getClassName() {\n return this.constructor\n .className;\n }", "title": "" }, { "docid": "f76c489d44a49435064a49bf00bc495b", "score": "0.50229496", "text": "function HasClass(e,c) {return e.className.match(new RegExp('(\\\\s|^)'+c+'(\\\\s|$)'));}", "title": "" }, { "docid": "890b6874b799b9ba5cf8ad6d5c48ec91", "score": "0.50220376", "text": "evaluateClasses () {\n let className = this.state.className\n\n if (this.props.type === 'columns') {\n className += ' columns'\n } else {\n className += ' rows'\n }\n\n if (this.props.direction === 'reverse') {\n className += ' reverse'\n }\n\n if (this.props.mode === 'spaced') {\n className += ' spaced'\n }\n\n if (this.props.borders) {\n className += ' borders'\n }\n\n return className\n }", "title": "" }, { "docid": "aebeb569b61d51617a1025ce9ddf6869", "score": "0.50119525", "text": "getFeedbackProgressClass(selfCtr) {\r\n var ctr = this.props.feedbackCounter;\r\n if (ctr === selfCtr) return \"glyphicon glyphicon-play text-primary text-11\";\r\n else if (ctr > selfCtr)\r\n return \"glyphicon glyphicon-ok text-success large-text\";\r\n else return \"glyphicon glyphicon-pause text-lightgrey2 text-11\";\r\n }", "title": "" }, { "docid": "e4b499695a7b5186ac56205c574c78b7", "score": "0.5002497", "text": "getClass(DSNode, name) {\n return DSNode.find(el => (el[\"sh:class\"] && this.rangesToString(el[\"sh:class\"]) === name)) || null;\n }", "title": "" }, { "docid": "ade8f78cb8136b9c3ee6707040061fa6", "score": "0.49896646", "text": "divClass () {\n let klass = this.props.className || ''\n\n if (!this.props.disabled) {\n if (this.state.error) {\n klass += ' usa-input-error'\n }\n }\n\n return klass.trim()\n }", "title": "" }, { "docid": "a25a374bd9d3615379a7acdbd7a57577", "score": "0.4987309", "text": "function get_class_name(a_class){\n if (typeof(a_class) == \"function\"){\n const src = a_class.toString()\n if (src.startsWith(\"class \")){\n const end_of_class_name_pos = src.indexOf(\"{\")\n let result = src.substring(6, end_of_class_name_pos)\n if (result.includes(\" extends \")) {\n let name_split = result.split(\" \")\n result = name_split[2] + \".\" + name_split[0]\n }\n return result.trim()\n }\n }\n return null\n}", "title": "" }, { "docid": "82e74ce2e03b98dce261a00bd87dabec", "score": "0.4978052", "text": "divClass () {\n let klass = (this.props.className || '')\n\n if (!this.props.disabled) {\n if (this.state.error) {\n klass += ' usa-input-error'\n }\n }\n\n return klass.trim()\n }", "title": "" }, { "docid": "a3ed3f3acf85ba12591301153284b9af", "score": "0.4966445", "text": "getClassName() {\n return \"Color4\";\n }", "title": "" }, { "docid": "b962bcacc141269ea1898fb189e51539", "score": "0.49651057", "text": "function getClass(el) {\n return el.className.baseVal === undefined ? el.className : el.className.baseVal;\n } // @function setOpacity(el: HTMLElement, opacity: Number)", "title": "" }, { "docid": "3836a1a0f07ab2c3178c2f0c27c8b838", "score": "0.49646023", "text": "static get className() {\r\n return \"CalandarLogModal\";\r\n }", "title": "" }, { "docid": "fa939be40648d4ece7810429a12ea8d2", "score": "0.49415615", "text": "function extractAnnimationClassname(_element, _action) {\n var _class = null;\n var _classIterator = _element.classList.values();\n for(var _value of _classIterator) {\n if(_value.includes(_showOnScroll)){\n var _r = _value.replace(_showOnScroll,'');\n if(_action == 'add') {\n _element.classList.add(_r);\n } else {\n _element.classList.remove(_r);\n }\n \n }\n \n }\n }", "title": "" }, { "docid": "ce851dded033beb7212536b9a2567f6d", "score": "0.49366537", "text": "get mainClasses() {\n return classNames(super.mainClasses);\n }", "title": "" }, { "docid": "bf5e116b6da4cea5818706f41e930007", "score": "0.4930831", "text": "function getFavoriteIconClass(isFavorite) {\n return isFavorite\n}", "title": "" }, { "docid": "14e6aa76b93d6835cb83e13d6f904129", "score": "0.49274054", "text": "function cssClass(mark) {\n return 'mark-' + mark.marktype\n + (mark.role ? ' role-' + mark.role : '')\n + (mark.name ? ' ' + mark.name : '');\n}", "title": "" }, { "docid": "14e6aa76b93d6835cb83e13d6f904129", "score": "0.49274054", "text": "function cssClass(mark) {\n return 'mark-' + mark.marktype\n + (mark.role ? ' role-' + mark.role : '')\n + (mark.name ? ' ' + mark.name : '');\n}", "title": "" }, { "docid": "14e6aa76b93d6835cb83e13d6f904129", "score": "0.49274054", "text": "function cssClass(mark) {\n return 'mark-' + mark.marktype\n + (mark.role ? ' role-' + mark.role : '')\n + (mark.name ? ' ' + mark.name : '');\n}", "title": "" }, { "docid": "5b87d41201edfb3432b5b536cc316a40", "score": "0.49038914", "text": "get classList() {\n return this.element.classList\n }", "title": "" }, { "docid": "6da34708c53a9706c0acf4a01aacf8a5", "score": "0.48999915", "text": "function classList(element) {\n return (' ' + (element && element.className || '') + ' ').replace(/\\s+/gi, ' ');\n }", "title": "" }, { "docid": "6da34708c53a9706c0acf4a01aacf8a5", "score": "0.48999915", "text": "function classList(element) {\n return (' ' + (element && element.className || '') + ' ').replace(/\\s+/gi, ' ');\n }", "title": "" }, { "docid": "5ecb1f4e02beeb260c5e45c066f86cb9", "score": "0.48959607", "text": "function classList(element) {\n return (' ' + (element && element.className || '') + ' ').replace(/\\s+/gi, ' ');\n }", "title": "" } ]
71b83a486052288fbfe01e29a93b9b92
Get an existing Bot resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
[ { "docid": "80fa0ffdb3d9447082375b28cbf3c530", "score": "0.59994096", "text": "static get(name, id, state, opts) {\n return new Bot(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" } ]
[ { "docid": "fbcff1dc898eb2aeb4a84d92a016706e", "score": "0.6128212", "text": "function findStateById(id){\n for(var i=0;i<statesCaching.length;i++){\n var state=statesCaching[i];\n if(state.state==id)\n return state;\n }\n}", "title": "" }, { "docid": "63f3d86cbfd984c2cd7e6be97d4fbe50", "score": "0.6076903", "text": "static get(name, id, state, opts) {\n return new ServiceLinkedRole(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "a0c1aadda1f15200385d9c6ee01c9634", "score": "0.5980341", "text": "static get(name, id, state, opts) {\n return new Role(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ff2ab29c4f638e01e3662f6db6ad71a6", "score": "0.58741343", "text": "function genesisStateById(id) {\n return genesisStates[genesisStates['names'][id]];\n}", "title": "" }, { "docid": "dfd65ad31cddac0bfb4d6c66480e665a", "score": "0.5791612", "text": "static get(name, id, state, opts) {\n return new Alias(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "60f4547e046a7c5a399f6ce5e0744b1d", "score": "0.57018906", "text": "static get(name, id, state, opts) {\n return new Trail(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "2df8cb38f3f2a4b0e0541bee1202c4b1", "score": "0.5685256", "text": "static get(name, id, state, opts) {\n return new AccessKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "6811e7d62b2ef88bea4762e57a2e90fd", "score": "0.5682936", "text": "static get(name, id, state, opts) {\n return new Record(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "6811e7d62b2ef88bea4762e57a2e90fd", "score": "0.5682936", "text": "static get(name, id, state, opts) {\n return new Record(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "5d6e9402245a9d689ce151870d1fd516", "score": "0.5673444", "text": "static get(name, id, state, opts) {\n return new Resolver(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "47a06b186c4d19345fd8a6c3e45f5a87", "score": "0.56716037", "text": "static get(name, id, state, opts) {\n return new Target(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "86009230406ba917e81f47f3fa89c025", "score": "0.5609058", "text": "static get(name, id, state, opts) {\n return new Instance(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "86009230406ba917e81f47f3fa89c025", "score": "0.5609058", "text": "static get(name, id, state, opts) {\n return new Instance(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "424160aa278827d1f54f2c766f910b3e", "score": "0.5597717", "text": "static get(name, id, state, opts) {\n return new Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "424160aa278827d1f54f2c766f910b3e", "score": "0.5597717", "text": "static get(name, id, state, opts) {\n return new Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "3bf885b81e33296fd5bfca0e59f49b46", "score": "0.55936813", "text": "static get(name, id, state, opts) {\n return new Key(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "2dc12daf7554263acaf04dcbd776657f", "score": "0.5477668", "text": "static get(name, id, state, opts) {\n return new Stack(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "9386eb272dc59c5465b7ce9baa82f3de", "score": "0.54602814", "text": "getState(id) {\n return getState(this.STATE_PATH + id);\n }", "title": "" }, { "docid": "9386eb272dc59c5465b7ce9baa82f3de", "score": "0.54602814", "text": "getState(id) {\n return getState(this.STATE_PATH + id);\n }", "title": "" }, { "docid": "9386eb272dc59c5465b7ce9baa82f3de", "score": "0.54602814", "text": "getState(id) {\n return getState(this.STATE_PATH + id);\n }", "title": "" }, { "docid": "4a0a5f79b00250495f9a41c8b1b7e0db", "score": "0.5452117", "text": "static get(name, id, state, opts) {\n return new Snapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "6b017ae4701ea047bec298443903dba1", "score": "0.53982383", "text": "static get(name, id, state, opts) {\n return new Environment(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "d2f86e38ab049534aca7aa26113685ec", "score": "0.53679156", "text": "static get(name, id, state, opts) {\n return new SpotFleetRequest(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ef67b85f2a1be7181550820a474521fb", "score": "0.5326131", "text": "static get(name, id, state, opts) {\n return new Route(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "9d1732c0fff0d2af66ff4493edf49e21", "score": "0.5226853", "text": "static get(name, id, state, opts) {\n return new NotificationRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "e3fd01809c69f4001298880da72c4ee5", "score": "0.5223939", "text": "static get(name, id, state, opts) {\n return new Table(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ea8cc7d31c07c33c35aaac5778681cb3", "score": "0.51152277", "text": "function genesisStateByName(name) {\n return genesisStates[name];\n}", "title": "" }, { "docid": "876033be96a7e7921abb7194727f78f5", "score": "0.50938356", "text": "stateByName(name) {\n var self = this.$router\n return self.states.find((state) => name == state.name)\n }", "title": "" }, { "docid": "6686ca08bb3d20be8cfbdf8eeb991c12", "score": "0.50909376", "text": "static get(name, id, state, opts) {\n return new JavaAppLayer(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "8e822fb584a94b943cf3c105ab55ade5", "score": "0.5078117", "text": "id(id: string) {\n const path = makePath(this.path.info, this);\n path.type = 'id';\n path.typeValue = id;\n return new HrStateWrapper(path);\n }", "title": "" }, { "docid": "0f9620317ac12fcb563c741162a1bb86", "score": "0.50754374", "text": "static get(name, id, state, opts) {\n return new NetworkAclRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "1f911148371f3282fd36a93e8e9e65f0", "score": "0.5069231", "text": "static get(name, id, state) {\n return new Domain(name, state, { id });\n }", "title": "" }, { "docid": "7f519f2fdf03d9b33dc688e31b3a9b8e", "score": "0.5066549", "text": "static get(name, id, state, opts) {\n return new UserLoginProfile(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "a15288513be97142aae53c51227bd356", "score": "0.50478244", "text": "static get(name, id, state, opts) {\n return new Crawler(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "61ceded45c6e2766c446a4a05f700ca8", "score": "0.50411654", "text": "prop(id, val) {\n if (val === undefined) {\n if (this._state[id] !== undefined) {\n return this._state[id];\n }\n throw new yngwie__WEBPACK_IMPORTED_MODULE_1__.Error(\"No property found for given ID\", id);\n } else {\n this._state[id] = val;\n }\n return this;\n }", "title": "" }, { "docid": "b936ed6e22a194ddeff2b815f9695d2b", "score": "0.5008055", "text": "getState(id) {\n id = this.id(id);\n return this.boards[id.board].getState(id.id);\n }", "title": "" }, { "docid": "61cdf11f608566024d2218a8aca308ac", "score": "0.4999963", "text": "static get(name, id, state, opts) {\n return new ContainerPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f101e1688a385245d7c3ad170845887c", "score": "0.49935466", "text": "static get(name, id, state, opts) {\n return new Domain(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "f738eb16626b6e64ec3babc4153a9b7f", "score": "0.49911943", "text": "static get(name, id, state, opts) {\n return new EipAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "997977ba296bf8eb068e134e8a152d8a", "score": "0.4984291", "text": "fetch(gameID, opts) {\r\n let result = {};\r\n if (opts.state) {\r\n result.state = this.state.get(gameID);\r\n }\r\n if (opts.metadata) {\r\n result.metadata = this.metadata.get(gameID);\r\n }\r\n if (opts.log) {\r\n result.log = this.log.get(gameID) || [];\r\n }\r\n if (opts.initialState) {\r\n result.initialState = this.initial.get(gameID);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "7e55566832aeda93c4bfa20564545030", "score": "0.4979391", "text": "static get(name, id, state, opts) {\n return new NetworkInterface(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "5e42a0b077ce820ff103b12ef57a8dfd", "score": "0.49782023", "text": "static get(name, id, state, opts) {\n return new SigningProfilePermission(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "15d1f3f00f905b78ace1c4e20e531148", "score": "0.496687", "text": "fetch(matchID, opts) {\r\n const result = {};\r\n if (opts.state) {\r\n result.state = this.state.get(matchID);\r\n }\r\n if (opts.metadata) {\r\n result.metadata = this.metadata.get(matchID);\r\n }\r\n if (opts.log) {\r\n result.log = this.log.get(matchID) || [];\r\n }\r\n if (opts.initialState) {\r\n result.initialState = this.initial.get(matchID);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "97a91302bd531ddfbbb75001fdfbf6be", "score": "0.49139845", "text": "getById(id) {\n return RoleDefinition(this, `getById(${id})`);\n }", "title": "" }, { "docid": "cc266bed69826c68de5d4fc0b9cc3ea6", "score": "0.49083984", "text": "function get(subStateName) {\n state.multiple = true;\n if (!state.subStates) {\n state.subStates = {};\n }\n let subState = state.subStates[subStateName];\n\n if (!subState) {\n state.subStates[subStateName] = subState = state.computed\n ? createState(...args)\n : createState(state.value ? state.value[subStateName] : undefined);\n subState.key = subStateName;\n subState.parent = state;\n }\n return subState;\n }", "title": "" }, { "docid": "8d18e8bce3da10cdc5a1a32d81801aca", "score": "0.48807338", "text": "resourceDefinition() {\n let state = this._registry.get('properties', 'state')\n return state.resourceDefinition\n }", "title": "" }, { "docid": "9ade35359aed7fd0ce8f942de75dba7f", "score": "0.4872323", "text": "static get(name, id, state, opts) {\n return new MountTarget(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "3eb43fe0ada00dd75435929ac4f08113", "score": "0.48711908", "text": "function getRandomState(id) {\n\t\tif(id) {\n\t\t\treturn states[id];\n\t\t}\n\t\treturn states[Math.floor(Math.random()*states.length)];\n\t}", "title": "" }, { "docid": "46d57178b5c208f890ab8eb7a5aaf081", "score": "0.4867754", "text": "static get(name, id, opts) {\n return new RelationshipLink(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "37cf1e370f7a00b2f5bce7771466c588", "score": "0.4863439", "text": "static get(name, id, state, opts) {\n return new LogSubscriptionFilter(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "5c523099297b955859bd47902552ed67", "score": "0.48392388", "text": "static get(name, id, state, opts) {\n return new CustomerGateway(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "faa6b2830078e8e7550f27dbdf60430f", "score": "0.4838894", "text": "get(id) {\n\t\treturn http.get<Recipe>(\"/profile/\" + id);\n\t}", "title": "" }, { "docid": "d6c26bde51a4a49170f740cf8f56fc6b", "score": "0.48258978", "text": "static get(name, id, state, opts) {\n return new VirtualNode(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "278e753111edb014c14c73132df15397", "score": "0.47845286", "text": "static get(name, id, state, opts) {\n return new ComputeEnvironment(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "33b674dba1f550ffd4ca64ae4d17c713", "score": "0.47833446", "text": "static get(name, id, state, opts) {\n return new Host(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "596bae6a4f5a3185dc4e940833096a66", "score": "0.47759837", "text": "async ReadIngredient(ctx, id) {\n const IngredientJSON = await ctx.stub.getState(id); // get the Ingredient from chaincode state\n if (!IngredientJSON || IngredientJSON.length === 0) {\n throw new Error(`The Ingredient ${id} does not exist`);\n }\n return IngredientJSON.toString();\n }", "title": "" }, { "docid": "3aa1adaa801dacde43041c5729dbee02", "score": "0.47545213", "text": "static get(name, id, state, opts) {\n return new ReplicationInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "e0c99697a330259aaac3320d045f7ade", "score": "0.47504207", "text": "function get(id) {\n var endpoint = BOOKS_URI + '/:id',\n Service = $resource(endpoint, { id: '@id' });\n\n return Service.get({ id: id }).$promise;\n }", "title": "" }, { "docid": "b5388514a2a829eccc523b2afaa182c4", "score": "0.47348285", "text": "findByState(id) {\n return db.many(`\n SELECT parks.id, parks.name, parks.state, states.name AS state\n FROM parks\n JOIN states\n ON states.code = parks.state\n WHERE parks.state = $1`, id);\n }", "title": "" }, { "docid": "729d4c3d25f7250ff1a1497110e33348", "score": "0.47285724", "text": "static get(name, id, state, opts) {\n return new VpnConnection(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "7701d0de8ff3b57908480cb3554af0cf", "score": "0.47231144", "text": "static get(name, id, state, opts) {\n return new AmiCopy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "1d14f6a88f24109f9bbbcceb769f820a", "score": "0.4699286", "text": "function get(id) {\n return bus.find(id);\n}", "title": "" }, { "docid": "9cd3c05cad2a4b2d340afb52fb475944", "score": "0.46886232", "text": "getStates(id) {\n return this.http.get(`${this.ip.ip}${this.site_port}/rest/v1/location/getStates/${id}`).pipe((catchError(this.errHandler.handleError)));\n }", "title": "" }, { "docid": "0f70b7e9495d2f76991c990778b4ec50", "score": "0.468147", "text": "getState(name, key, delmiter = '$') {\n if (typeof key !== 'undefined') {\n return this.state[name + delmiter + key];\n }\n\n let result = {},\n found = false;\n\n for (let key in this.state) {\n if (key.startsWith(`${name}${delmiter}`)) {\n result[key.split(`${delmiter}`).splice(-1)] = this.state[key];\n found = true;\n }\n }\n\n return found ? result : this.state[name];\n }", "title": "" }, { "docid": "042e76b0a9e3d0f0995d65ede9c8b6ff", "score": "0.46535406", "text": "static get(name, id, state, opts) {\n return new AnalyticsApplication(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "16321a86cc53964aeed4c3a7f34ccea0", "score": "0.46410808", "text": "getHouse({state}, id) {\n const url = `${baseUrl}/show/houses/${id}/`\n if (state.houses.length > 0) {\n const house = state.houses.find(house => {\n return house.name === id\n })\n if (house) {\n return Promise.resolve(house)\n }\n return axios.get(url).then((data) => data.data[0])\n }\n return axios.get(url).then((data) => data.data[0])\n }", "title": "" }, { "docid": "2d2997d7e30a1a24195f830cb7c3536f", "score": "0.46250212", "text": "function findStoredResource( id ) {\n\t\t\tlet\titm = itemById(model.resources,id);\n\t\t\tif( itm )\n\t\t\t\treturn itm\n\t\t\telse\n\t\t\t\tconsole.error(\"Did not find a resource with id '\"+id+\"'.\")\n\t\t}", "title": "" }, { "docid": "abd6ae607533e30912dcf1152fdd8f8d", "score": "0.46221775", "text": "function getState(state, choice) {\n if (state === choice) {\n return choice;\n }\n}", "title": "" }, { "docid": "8684d154f28daeb51e70f5667dc65712", "score": "0.46184552", "text": "function getStateByName(name) {\n\t\tif (typeof name == \"undefined\") {\n\t\t\treturn this.currentState;\n\t\t} else if (typeof this.states[name] == \"undefined\") {\n\t\t\tconsole.error(\"State Machine: No such state \" + name);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn this.states[name];\n\t\t}\n\t}", "title": "" }, { "docid": "f37cf1e0f29064ccdff4b3a750f76a5a", "score": "0.4615571", "text": "getById(id) {\r\n return getById.apply(this, arguments);\r\n }", "title": "" }, { "docid": "1d493f3cf9ec202cea7fa4d88ca5f987", "score": "0.46109608", "text": "lookupById (id) {\n this.emit('lookupById', id);\n\n return _.findWhere(this.data, { id: id });\n }", "title": "" }, { "docid": "8e1ae37fdf78f7568c1ca482a9a41e60", "score": "0.45817652", "text": "static async getOneByName(id){\n let result = await db.query(`\n SELECT * FROM resources \n WHERE id = $1\n `, [id])\n\n return result.rows[0]\n }", "title": "" }, { "docid": "218da913f1919e5fb239ac9fb28b865e", "score": "0.4575444", "text": "function getInfoAboutId (id, cb) {\n if (state.info[id]){\n // If the information is cached - use that insted.\n cb(null, state.info[id]);\n }\n else {\n api.call(\"getinfofor\", [id], function (err, data) {\n state.info[id] = data\n cb(err, state.info[id]);\n });\n }\n }", "title": "" }, { "docid": "c9cca1aa0877c25fa3b7febe477d7ec6", "score": "0.455459", "text": "static get(name, id, state, opts) {\n return new EncryptionConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "07934812282de4d23da813f4dda34b8b", "score": "0.45526737", "text": "getState(state) {\n return this.state[state];\n }", "title": "" }, { "docid": "f1fb03c34600da9b76a91121db02498f", "score": "0.45492527", "text": "function startResourceGet(id) {\n return { type: START_RESOURCE_GET,\n id: id};\n}", "title": "" }, { "docid": "9da4f14e97480211db9abdaeb25341a6", "score": "0.45461482", "text": "static get(name, id, state, opts) {\n return new UserGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "00d8c13970cb99da76bbc4c1c819d280", "score": "0.45295316", "text": "static getChoiceById(id) {\n\t\t// Loop through every choice\n\t\tfor (var i = 0; i < storyData.story.scene.choices.length; i++) {\n\t\t\tvar choice = storyData.story.scene.choices[i];\n\t\t\t// If the IDs match, return this choice\n\t\t\tif (choice.name == id) return choice;\n\t\t}\n\t}", "title": "" }, { "docid": "7a2cf78c5ed53fb321cfb86e864694ae", "score": "0.45181605", "text": "function getRoomState(voice_channel_id){\n var result = undefined\n var target_room = ROOMS.find((room) => room.channelID === voice_channel_id)\n if (target_room != undefined){\n result = target_room.state\n }\n return result\n}", "title": "" }, { "docid": "4024eeee8fd8c0e4be447c1f1997e5c2", "score": "0.450892", "text": "statusId( id ){\n return gtd.statusItem( gtd._byId( id ));\n }", "title": "" }, { "docid": "5589a1c83e77a114c2278c70c2f0d6d4", "score": "0.45047337", "text": "function findStatusById(id) {\r\n switch (id) {\r\n case 0: return \"waiting\"; break;\r\n case 1: return \"started\"; break;\r\n default: return \"finished\"; break;\r\n }\r\n return \"\";\r\n}", "title": "" }, { "docid": "29c27c31ae7f0c8dd1ebcef00c717f22", "score": "0.45033944", "text": "function lookupResource(id, res) {\n // look up resource via id sent in request\n const resource = resources.find(r => r.id === parseInt(id));\n // if not found, return 404\n if (!resource) res.status(404).send(`The resource with the id ${id} was not found.`);\n return resource;\n}", "title": "" }, { "docid": "6593da9176362bfa78d68db72a075274", "score": "0.4495819", "text": "get(id) {\n const info = this.state[APPROVALS_STORE_KEY][id];\n return info ? Object.assign({}, info) : undefined;\n }", "title": "" }, { "docid": "6c1d13a1fb68be4414d964664a63c92b", "score": "0.4494529", "text": "function getState(entity) {\n var options = {\n method: 'GET',\n headers: {\n \"Authorization\": `Bearer ${settings.hassToken}`,\n \"content-type\": \"application/json\",\n }\n };\n Bangle.http(`${settings.hassUrl}/api/states/${entity}`, options).then(event => {\n let data = JSON.parse(event.resp);\n updateEntityData(entity, data);\n });\n}", "title": "" }, { "docid": "7f1a546a3cf3bb4a9c63501cdba6fe98", "score": "0.4490036", "text": "static get(name, id, state, opts) {\n return new SecurityGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "a42386873b0788035562b0ae9a6acce1", "score": "0.44789368", "text": "findById(id) {\n return request.get(`/api/flows/${id}`);\n }", "title": "" }, { "docid": "8a3c6a52bf39d2338024866154c4f8c7", "score": "0.4474879", "text": "async function getLatestState() {\n try {\n let found = await State.find({});\n logger.info(JSON.stringify(found[0]));\n return found[0];\n } catch (err) {\n console.error(err.message);\n }\n}", "title": "" }, { "docid": "8178a6c10ef9a8ae957a68fe15a8d081", "score": "0.44743332", "text": "findById(id) {\n return db.one(`\n SELECT parks.id, parks.name, states.name AS state\n FROM parks\n JOIN states\n ON states.code = parks.state\n WHERE parks.id = $1`, id);\n }", "title": "" }, { "docid": "ac67bf62c900681c8d4c44162c8de2c5", "score": "0.44699088", "text": "getById(id) {\r\n return getById$1.apply(this, arguments);\r\n }", "title": "" }, { "docid": "ef888352b9d4f2607f44c44df5ff16c0", "score": "0.44657096", "text": "static get(name, id, state, opts) {\n return new ReplicationGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "ff74ee9529e217c77d592637c87adbdc", "score": "0.44646072", "text": "function get_ship(id){\n //returns undefined if id does not exist\n const key = datastore.key([SHIP, parseInt(id,10)]);\n //console.log(\"logging key\" + key);\n return datastore.get(key).then(results => {\n //returns entity if id does exist\n const entity = results[0];\n entity.id = id;\n return entity;\n });\n}", "title": "" }, { "docid": "c7f18d189f11f66e37b2fe08a8f8d4e5", "score": "0.44635952", "text": "static get(name, id, opts) {\n return new DisasterRecoveryConfig(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "7b358f680b095d105cfbbf700129ba6e", "score": "0.44553795", "text": "async updateState (req, res) {\n try {\n const {id, name} = req.body\n await OrderState.update({\n name: name,\n UpdatedAt: new Date()\n },\n {\n where: {\n id: id\n }\n })\n const state = await OrderState.findOne({\n where: {\n id: id\n }\n })\n res.send(state)\n } catch (err) {\n console.log(err)\n res.status(500).send({\n error: 'An error has occured during updating'\n })\n }\n }", "title": "" }, { "docid": "ea077c2e42ffb4f9807fba686f2500bd", "score": "0.4453274", "text": "constructor(id = null, state=null){\n\t\tthis.id = id\n\t\tthis.state = state\n\t}", "title": "" }, { "docid": "9a032ac4568221fa1b8ac912ca770203", "score": "0.4446587", "text": "getById(id) {\n return RoleAssignment(this).concat(`(${id})`);\n }", "title": "" }, { "docid": "93ccd15f28c6ea59974231b57af5ddcb", "score": "0.44437328", "text": "async getName(id){\n let request = \"getNameFromId/\" + id;\n let result = await Comm.get(request);\n return result.response.return;\n }", "title": "" }, { "docid": "b6ae7fcc86cc4419fd6ffbb155f45f29", "score": "0.44401824", "text": "function getMessage(state, id) {\n let players = state.players;\n\n if (players[state.turn].id == id) {\n return \"YOUR TURN\";\n }\n else if (state.spectators.includes(id)) {\n return \"YOU ARE SPECTATING\";\n }\n else {\n return \"OPPONENT'S TURN\";\n }\n}", "title": "" }, { "docid": "d855dc6c473d3645d55161fb24e01f1a", "score": "0.4439661", "text": "static get(name, id, state, opts) {\n return new VpcAssociationAuthorization(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "title": "" }, { "docid": "2c71109cc627ee6b3e91e5bd2b7500cc", "score": "0.4438509", "text": "get(identifier, config, cb) {\n const path = api.getPath(baseURL, identifier, null);\n api.get(path, config, cb);\n }", "title": "" }, { "docid": "1c17c3f2d2fc86421f800123ccb5e4b0", "score": "0.44234794", "text": "GetTheStatusRequestOfThisSLA(id) {\n let url = `/me/sla/${id}/status`;\n return this.client.request('GET', url);\n }", "title": "" } ]
067510c01221c94f89b6dbefe38bdfab
=============================================== ===== Public Functions ===== ===============================================
[ { "docid": "91918e62e95ebb09d3aa6f5903bc4d86", "score": "0.0", "text": "getUrlData(url) {\n const funcName = 'GetUrlData()';\n logger.debug(`${logPrefix} ${funcName}. Url param: `, url);\n\n return new Promise((resolve, reject) => {\n const http = require('http'),\n https = require('https');\n\n let client = http;\n\n if (url.toString().indexOf('https') === 0) {\n client = https;\n }\n\n client\n .get(url, (resp) => {\n let data = '';\n\n // A chunk of data has been recieved.\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n // The whole response has been received. Print out the result.\n resp.on('end', () => {\n resolve(data);\n });\n })\n .on('error', (err) => {\n logger.error(`${logPrefix} ${funcName}. Error: `, err);\n\n reject(err);\n });\n });\n }", "title": "" } ]
[ { "docid": "acffe366305a123ddf65c9f97713c0bb", "score": "0.74381596", "text": "function ___PRIVATE___(){}", "title": "" }, { "docid": "1e242092caff42f7cfca9bf6d99c7ead", "score": "0.56383157", "text": "function _0x57b9ae(_0x176273,_0x237b84){0x0;}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5635794", "text": "initialize() {}", "title": "" }, { "docid": "59d3beeaa84f482085e491e2542c80f9", "score": "0.5613684", "text": "constructor() {\n\t\t//\n\t}", "title": "" }, { "docid": "0186459e4ce622a72f71947a8077227c", "score": "0.5552884", "text": "init() {\n\n\t}", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.5542201", "text": "initalizing() {}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5491985", "text": "init() {\n\t}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.54867244", "text": "function Utils() {}", "title": "" }, { "docid": "28c85fcaf91a3df0d1b92481c75acce8", "score": "0.5459617", "text": "function UtilsOBM() {\n}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5435723", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "813007f4e986930bec5aa83f22e95ed6", "score": "0.54145265", "text": "function Utils() {\n\n\t}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.53889656", "text": "init() { }", "title": "" }, { "docid": "77c7382444bb1910defa23aa1355c188", "score": "0.5388316", "text": "function mifuncion() {}", "title": "" }, { "docid": "28ea76b92ede9ad186f59db950053d19", "score": "0.5379434", "text": "constructor(\r\n\r\n ) {\r\n \r\n }", "title": "" }, { "docid": "d2918dd681253e9051d4b34d9056a13b", "score": "0.53711414", "text": "getED() {}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.5342804", "text": "init () {}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.5342804", "text": "init () {}", "title": "" }, { "docid": "57c6224c7eea5c7fd0503f961d019027", "score": "0.5339441", "text": "_read() {\r\n\r\n }", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.53304356", "text": "prepare() {}", "title": "" }, { "docid": "43d2f6f90a1f67678bd758d6c7b20df2", "score": "0.53188455", "text": "fromSNF (parent = null) { throw new Error(\"Not implemented yet\"); }", "title": "" }, { "docid": "7c7cd2808ecab0cbd844549068f1c67e", "score": "0.53179723", "text": "function init() { \n \n }", "title": "" }, { "docid": "5252c9dccb3e8b690802703c30d0be2a", "score": "0.5303659", "text": "constructor(){\n\t\t\n\t}", "title": "" }, { "docid": "7e97ce3824cb1971b85843055792cba4", "score": "0.52989376", "text": "_read () {}", "title": "" }, { "docid": "a66a2878a75d9bf6583445adc247fd4f", "score": "0.52882355", "text": "function ActiveUtil (){}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.52858365", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.52858365", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "5330c402aafba5eec6be477f4407e8fd", "score": "0.5284463", "text": "compilable() {}", "title": "" }, { "docid": "5330c402aafba5eec6be477f4407e8fd", "score": "0.5284463", "text": "compilable() {}", "title": "" }, { "docid": "68696b86cf4922381678ad336febc65a", "score": "0.5280015", "text": "init() { \n \n }", "title": "" }, { "docid": "ceda034f6d8c5acac2cf55caedf2b46c", "score": "0.5272088", "text": "function WLUtils() {}", "title": "" }, { "docid": "db960b660c028d617a740716f337ab33", "score": "0.5270296", "text": "function FmUtil() {\r\n\r\n}", "title": "" }, { "docid": "115e8fa8aa80b265113d51772520f45f", "score": "0.5264744", "text": "function init() {// NOTE nothing to do here\n}", "title": "" }, { "docid": "1e590fc1e7ff21964a80335681e69fe9", "score": "0.5262832", "text": "function sbUtils()\n{\n}", "title": "" }, { "docid": "4607f77e0b77d064557277565ec8b11d", "score": "0.52586037", "text": "function api () {}", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.5241938", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "2e9e247743746e2e5c7e4e2648a24f89", "score": "0.5241862", "text": "function private_function()\n\t {\n\n\t }", "title": "" }, { "docid": "5078ef749f085d0a4b0075a1bbbb53a6", "score": "0.5238329", "text": "constructor() {\n // Unused class for now. Maybe in the future.\n }", "title": "" }, { "docid": "b016de4490d90d8ce92ac37fc0ca2ac8", "score": "0.52365726", "text": "_init() {\n\n }", "title": "" }, { "docid": "97f25759ff2312b34f735a2a774e7cd5", "score": "0.52270937", "text": "function util() {\n\n}", "title": "" }, { "docid": "fce035b66a53ff75a5c503fbea9da081", "score": "0.52218664", "text": "getInfo(){\n\t\n\t}", "title": "" }, { "docid": "8571ea7a6594c1c07486e8158bf384fa", "score": "0.5214296", "text": "_read() {}", "title": "" }, { "docid": "a92e7a566c0693bfee0f0aa764c85102", "score": "0.52119935", "text": "function accessesingData2() {\n\n}", "title": "" }, { "docid": "dc7586e9a971dffa4d38a62643528a32", "score": "0.52102625", "text": "_registered() {}", "title": "" }, { "docid": "61ca88693656d589c172066000bfffa2", "score": "0.51953125", "text": "initialize() {\n }", "title": "" }, { "docid": "24ab0123bb3f3fec3db5431bf8881ee8", "score": "0.5192479", "text": "function Wrabbit() {}", "title": "" }, { "docid": "54f07186ceacacff16f5b67f3ac6a7b7", "score": "0.51723695", "text": "function m_init() {return 0}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.5159058", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.5151421", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "70dc644c848be8b6b7d499b82293c880", "score": "0.51513684", "text": "contructor() {}", "title": "" }, { "docid": "30b6c3486f0643d1a32bcac38836b101", "score": "0.51490366", "text": "function Helpers(){}", "title": "" }, { "docid": "5a5b7d6b2410c463165db5f8cee75db9", "score": "0.5146599", "text": "initialize() {\n return null;\n }", "title": "" }, { "docid": "450415ee6ba669c85259ba82c85a6dc4", "score": "0.51435596", "text": "constructor() {\n\n\t\t\t//ALLOWS THE USE OF THIS WHEN EXTENDING TO ANOTHER CLASS\n\t\t\tsuper()\n\t\t\t\n\t\t}", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.51373726", "text": "constructor() {\n \n }", "title": "" } ]
51065140eab53db12be659a7ed33d908
Fetches for usertoken and calls phrases for that user if user !null
[ { "docid": "d65bb0756040eeda9b02cee0c194d15c", "score": "0.46594036", "text": "componentDidMount(){\n const token = localStorage.getItem('token')\n //Fetches for languages\n fetch('http://localhost:3000/api/v1/languages')\n .then(res => res.json())\n .then(languages => this.setState({languages: languages}))\n //Fetches for phrases\n fetch('http://localhost:3000/api/v1/phrases')\n .then(res=> res.json())\n .then(phrases => {\n this.setState({phrases: phrases})\n })\n if(token) {\n //Fetches for the token\n fetch('http://localhost:3000/api/v1/current_user', {\n headers: {\n Authenticate: token\n }\n })\n .then(resp => resp.json())\n .then(user => {\n if (!user.error) {\n this.setState({currentUser: user})\n }\n })\n }\n }", "title": "" } ]
[ { "docid": "833cccbb423b97621fcf5b84c88494b4", "score": "0.5460545", "text": "function listPRsForUser(msg, done) {\n const userId = getUserId(msg);\n const snippets = robot.brain.get(userId);\n if (!Array.isArray(snippets)) {\n return provideUsername(msg, done);\n }\n\n return listPRs(msg, done, userId);\n }", "title": "" }, { "docid": "677c3cb1705510922e35e0e1822efcc2", "score": "0.53567016", "text": "respondToPhrase(phrase, userData, botStorage) {\n return this.processResult(phrase, userData, botStorage)\n }", "title": "" }, { "docid": "5d41c01d5af4a528ce588446034610b1", "score": "0.5346574", "text": "function storeUser(user){\n username = user;\n if(user.filteredWords){\n teacherWords = user.filteredWords;\n }\n else{\n $http.get('/auth/teacher/'+user.teacherID)\n .then(function(data){\n teacherWords = data.data.filteredWords;\n });\n }\n }", "title": "" }, { "docid": "f9265d10cef61d60a8286ba7a64e6754", "score": "0.5216185", "text": "function handleUserSpeech(phrase) {\n\n // We check whether the user said what they were told to say\n // by comparing what annyang heard (phrase) with the\n // currentPhrase variable\n if (phrase === currentPhrase) {\n // If they said the right thing, we emphasise it...\n // (Note the use of backslash (\\) to \"escape\" the apostrophe in That's\n // so that it doesn't interfere with our string.)\n $('#command').text('That\\'s right. You are ' + phrase + '.');\n // Get a new thing for them to say\n currentPhrase = getNewPhrase();\n // And tell them to say it\n $('#command').append(' Now say \"I am ' + currentPhrase + '\".');\n }\n else {\n // If they said the wrong thing, correct them and demand\n // they say it.\n $('#command').text('That\\'s not right. Say \"I am ' + currentPhrase + '\".');\n }\n}", "title": "" }, { "docid": "9aa6229c33f3f4440fbe569278323932", "score": "0.51425976", "text": "loadPhrases(friendo) {\n this.phrasebook.populate(friendo)\n }", "title": "" }, { "docid": "c95912b7970fc50f53773696938cc7ea", "score": "0.5127964", "text": "function initialQuote() {\n //user was asked a yes/no question, get response\n getUseInput(function(data) {\n if (/^n$/i.test(data) || /^no$/i.test(data)) {\n deleteAllLines();\n displayString(\"In that case, I'll wait patiently until you need me.\", false);\n setTimeout(function() {\n deleteAllLines();\n displayString('Standing by...', 'main');\n }, 1500);\n } else if (/^y$/i.test(data) || /^yes$/i.test(data)) {\n deleteAllLines();\n getQuote(function() {\n //since this is first quote retrieved, inform user of tweeting ability\n displayString([\"If you would like to tweet this, please type tweet. Otherwise,\",\n \"as I mentioned earlier, feel free to type help to see what else I can do for you.\"].join(' '));\n });\n\n } else { //user has entered something other than yes/no\n deleteAllLines();\n displayString(\"You didn't answer my question. Nevermind. What is it you want?\", 'main');\n }\n });\n }", "title": "" }, { "docid": "0924b7ab0f31de1edd9833290a5081a7", "score": "0.51151943", "text": "searchUser(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz User: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchUserFuzzy(userQuery);\r\n }", "title": "" }, { "docid": "2c6f2048fe2e536a1cac8e0d2089a6eb", "score": "0.50844574", "text": "function proceed () {\n\t\t\t/*\n\t\t\t\tIf the user has been loaded determine where we should\n\t\t\t\tsend the user.\n\t\t\t*/\n\t\t\tif (store.getters.getBearerToken) {\n\t\t\t\tnext();\n\t\t\t} else {\n\t\t\t\t//user is not logged in\n\t\t\t\tconsole.log('you are not logged in');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4de67712dc9a87d7f1e8d6552e3c3b93", "score": "0.50413954", "text": "function checkToken(token, callback) {\n\tdb.query('SELECT users.userid, users.username FROM tokens, users WHERE tokens.tokenid = ? AND users.userid = tokens.userid;', [token], function(err, results, fields) {\n\t\tif (results.length > 0) {\n\t\t callback(results[0]);\n\t\t} else {\n callback(null);\n\t\t}\n });\n}", "title": "" }, { "docid": "78d5dca043a059043065d959a84393c4", "score": "0.5037814", "text": "function addUsernameToContextIfNeeded(bot, update, next) {\n const userText = update.message.text;\n const watsonUpdate = update.watsonUpdate;\n\n const changeUsernameIntentCondition = (watsonUpdate.intents.length > 0) &&\n (watsonUpdate.intents[0].intent === 'setUsername') &&\n (watsonUpdate.intents[0].confidence > 0.5);\n\n if ((!update.context.username || changeUsernameIntentCondition) &&\n watsonUpdate.output.text && watsonUpdate.output.text.join('').indexOf('{\"username\"}') > -1) {\n //return \"John....\";\n update.context.username = userText;\n store.updateContext(update.sender.id, update.context);\n console.log(\"are we heading here...\");\n next();\n \n /*\n return externalServices.nameExtractor.getNameFromText(userText)\n\n .then((nameBody) => {\n if (nameBody.Name) {\n update.context.username = nameBody.Name.coveredText;\n } else {\n // if we couldn't find the name, we fallback to entire first message'\n update.context.username = userText;\n }\n\n store.updateContext(update.sender.id, update.context);\n next();\n });\n */\n }\n\n return next();\n}", "title": "" }, { "docid": "2ac2242ebda15d171b417d241c5dda4b", "score": "0.5018367", "text": "function getUserSuggestion(user) {\n var suggestions = {};\n \n suggestDb.forEach(function(suggest) {\n if(suggest.userId === user.id){\n suggestions = suggest; \n }\n }, this);\n \n return suggestions;\n}", "title": "" }, { "docid": "0b2b69f5b139253e542836b61c1faced", "score": "0.49978414", "text": "function messageTextComplete() {\n var variable_list = common_data['variable_list'];\n $('.text_group .input_text_type, .textarea_box .readonly, textarea.terms_of_user_content').textcomplete([\n {\n match: /@(\\w*)$/,\n search: function (term, callback) {\n callback($.map(variable_list, function (element) {\n return element.indexOf(term) === 0 ? element : null;\n }));\n },\n index: 1,\n replace: function (element) {\n return ['\\{\\{' + element + '}}', ''];\n }\n }\n ], {\n maxCount: 1000\n }).on({\n 'textComplete:hide': function (e) {\n // getDataFromInput();\n if(message_type_bot) {\n getDataFromInput();\n } else {\n getDataUserFromInput();\n }\n }\n });\n}", "title": "" }, { "docid": "f3f1ff6f9bf93a2263086999c0e28d7d", "score": "0.49784392", "text": "list(user) {\r\n if (typeof user !== \"undefined\") {\r\n return this.init() \r\n .then(() => {\r\n return this.read();\r\n })\r\n .then(() => {\r\n if (typeof this.notes[user] === \"undefined\") { //we have if causes to return either an empty array or the user's notes\r\n return [];\r\n } else {\r\n return this.notes[user];\r\n }\r\n });\r\n } else { \r\n return this.init().then(() => {\r\n return this.read();\r\n });\r\n }\r\n }", "title": "" }, { "docid": "7503f257d55975ec316a553c70524d00", "score": "0.4969838", "text": "getUnscopedUserToken(username, passphrase, callback)\n\t{\n\t\tif(!r3IsSafeTypedEntity(callback, 'function')){\n\t\t\tconsole.error('callback parameter is wrong.');\n\t\t\treturn;\n\t\t}\n\t\tlet\terror;\n\t\tif(r3IsEmptyString(username, true)){\n\t\t\terror = new Error('username parameter is empty');\n\t\t\tconsole.error(error.message);\n\t\t\tcallback(error, null);\n\t\t\treturn;\n\t\t}\n\t\tlet\t_callback\t= callback;\n\t\tlet\t_username\t= username;\n\t\tlet\t_passphrase\t= r3IsEmptyString(passphrase, true) ? null : passphrase.trim();\t\t// allow empty passphrase\n\t\tlet _body\t\t= {\n\t\t\t'auth': {\n\t\t\t\t'tenantName': '',\n\t\t\t\t'passwordCredentials': {\n\t\t\t\t\t'username':\t_username,\n\t\t\t\t\t'password':\t_passphrase\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.startProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start progressing\n\n\t\tthis._post('/v1/user/tokens', null, this.tokenHeaderType.noUserToken, _body, true, (error, resobj) =>\n\t\t{\n\t\t\tthis.stopProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// stop progressing\n\n\t\t\tif(null !== error){\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!resobj.result){\n\t\t\t\tlet\terror = new Error('No result object.');\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(true !== resobj.result || false !== resobj.scoped){\n\t\t\t\terror = new Error('Response data is sonmething wrong: ' + JSON.stringify(resobj));\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t_callback(null, resobj.token);\n\t\t});\n\t}", "title": "" }, { "docid": "9dcc748e930386717a0c535c2f97aae0", "score": "0.49656674", "text": "function match(token, userChoice) {\n\n return token.lowerFace === userChoice\n}", "title": "" }, { "docid": "6bb7cdf57149779541b7e61eedd1045f", "score": "0.49570614", "text": "function phraseSearch(phrases) {\n phrases = phrases.join(\" OR \");\n params = {q: phrases, count: 100};\n return T.get('search/tweets', params);\n}", "title": "" }, { "docid": "2959d30a2f0fd2c3efb7f88082749ed5", "score": "0.49559215", "text": "authorizeWithAuthy(user, callback) {\n authy.request_sms(user.authyID, (err, res) => {\n if (err) {\n return callback(err);\n }\n\n callback(null, user);\n });\n }", "title": "" }, { "docid": "98bd98dac5dc6ecc285092bf6d551892", "score": "0.49450022", "text": "function luisprehandler(fullutterance)\n{\n var sentences = senttokenizer.tokenize(fullutterance);\n for (sent of sentences)\n {\n getLuisIntent(sent)\n }\n}", "title": "" }, { "docid": "4a0ce1306fc799d614889be340e99949", "score": "0.49299482", "text": "function callBackForUser(bool,localToken,userObj){\r\n \r\n if(bool==true){\r\n var token=userObj.token;\r\n var res=compareToken(localToken,token);\r\n let welcome = document.getElementById(\"welcome-user\");\r\n welcome.innerText = \"Welcome: \" + userObj.username;\r\n if(res==false){\r\n location.href=\"login.html\";\r\n }\r\n } \r\n}", "title": "" }, { "docid": "0ad37226cfc3024a35b205cbce9af22e", "score": "0.49190667", "text": "searchUserCallback(username) {\n Api.getRepos(username).then((data) => {\n this.setState({\n currentTerm: username,\n currentData: data\n });\n });\n }", "title": "" }, { "docid": "c90840cada0e47f80619954ca713dfca", "score": "0.489877", "text": "function getIntheamToken(bot, message, userID, cb) {\n controller.storage.users.get(userID, (err, user) => {\n if (!err && user && user.token && user.token.length > 0) {\n const token = user.token;\n bot.botkit.log('found user token in local storage', token)\n cb(token)\n } else {\n bot.botkit.log('error getting user or user token from storage', err)\n bot.removeReaction(message, 'thinking_face')\n bot.reply(message, 'Looks like we haven\\'t been introduced yet. I\\'m Slackwarrior and I\\'m here to help you manage your tasks. Please feel free to ask me for `help` any time. :robot_face:')\n }\n })\n}", "title": "" }, { "docid": "f1b6111c10e5ca44373f3d88a45915a2", "score": "0.48887992", "text": "function processUsernames() {\n\n $('.process-markdown').each(function() {\n str = $(this).html();\n\n // Check if there are any @ mentions in the post text\n var res = str.match(/@([a-z\\d']+\\s)/ig);\n\n // If we have any hits\n if(res) {\n // Loop through them\n $.each(res, function( index, value ) {\n // Get the user details from the server\n\n // Trim off the @\n var characterName = value.substring(1);\n\n // Query the username\n $.ajax({\n type : 'GET',\n url : '/users/username/'+characterName,\n dataType : 'json',\n encode : true\n })\n .done(function(data) {\n\n if(data.user) {\n // Successfully found user\n // Generate the link to their profile\n if(data.user.character_name) {\n var username = data.user.character_name.replace(' ', '');\n } else {\n var username = data.user.name;\n }\n\n var url = '/profile/'+data.user.id+'/'+username;\n // Construct the link\n var constructed = '<a class=\"badge username-mention\" href=\"'+url+'\">&raquo;&nbsp;'+username+'</a> ';\n\n // Grab the current text\n $('.process-markdown').each(function() {\n str = $(this).html();\n str = str.replace(value, constructed);\n $(this).html(str);\n });\n fPopLoadItem();\n }\n });\n });\n }\n });\n }", "title": "" }, { "docid": "668268e29849d08650bc083ae2bd5cbd", "score": "0.4883919", "text": "handleSelectUser(screenName) {\n // Split the tweet into words, and replace the partial screen name with selected user's name\n const tweetBodyWords = this.state.tweetBody.split(' ');\n tweetBodyWords.splice(this.state.screenNameIndex, 1, `@${screenName}`);\n const tweetBody = tweetBodyWords.join(' ');\n this.setState({ tweetBody, screenNameIndex: -1, selectedSuggestionIndex: 0 });\n }", "title": "" }, { "docid": "e1ceee9bf42c302a15af50fbe6ece060", "score": "0.48673278", "text": "function processAnswer(tokens, ID){\n console.log(\"processing answer\");\n \n}", "title": "" }, { "docid": "96bfd93ddf3802f364fe1cf9c38d497c", "score": "0.48659855", "text": "async function respond(event, user) {\n const senderID = event.sender.id;\n const message = event.message;\n const messageId = message.mid;\n const messageText = message.text;\n const messageAttachments = message.attachments;\n const messageQr = message.quick_reply;\n //Check if message is text or multi-media\n if (messageText) {\n //Leave message as seen for 1 second, then send typing bubble\n setTimeout(async function() {\n await fb.typing(senderID);\n //After typing bubble is sent, process the message in lex and determine a response\n let lexData;\n if (typeof messageQr == 'undefined') {\n lexData = await ops.lexify(messageText, senderID);\n } else {\n lexData = await ops.lexify(messageQr.payload, senderID);\n }\n if (lexData.multipleFound) {\n const intents = [];\n for (let i = 0; i < lexData.multiple.length; i++) {\n let qr = [];\n qr.push(lexData.multiple[i].intentName);\n qr.push(lexData.multiple[i].intentName);\n intents.push(qr);\n }\n await fb.sendQuickReplies(senderID, intents, 'I detected multiple questions! I can only handle one at a time. Were you asking about one of these topics?');\n } else {\n if (lexData.intentName == null) {\n //No intent has been found, ask the user to rephrase their message\n setTimeout(async function() {\n const greet = \"Hello, \" + user.first_name + \"!\";\n await fb.sendTextMessage(senderID, greet)\n await fb.sendTextMessage(senderID, \"I'm sorry, I wasn't quite able to understand you. I've made a note of this so someone can help teach me how to respond to this!\");\n fb.sendButton(senderID, { type: 'phone_number', title: 'Call Berkey Filters', payload: '1-800-350-4170' }, \"If I haven't been very helpful, please give us a call!\");\n }, 2000);\n } else {\n //Check if there are multiple messages to send, or just one\n if (typeof lexData.message.messages !== 'undefined') {\n //Send array of messages to user in proper order\n const greet = \"Hello, \" + user.first_name + \"!\";\n await fb.sendTextMessage(senderID, greet);\n setTimeout(async () => {\n await fb.sendMultipleMessages(senderID, lexData.message.messages);\n switch (lexData.intentName) {\n case ('Initialize'):\n await fb.sendGif(senderID, 'Greetings');\n await fb.sendQuickReplies(senderID, [\n ['Yes', 'Please link my account'],\n ['No', 'Do not link my account']\n ], 'Do you have a BerkeyFilters.com account?');\n break;\n case ('whyLink'):\n await fb.sendQuickReplies(senderID, [\n [\"I'm in!\", 'Please link my account'],\n ['No thanks', 'Do not link my account']\n ], 'Would you like to link your BerkeyFilters.com account?');\n break;\n case ('Help'):\n case ('HowAreYou'):\n break;\n default:\n await fb.sendQuickReplies(senderID, [\n ['This helped, thanks!', 'Thanks'],\n [\"This didn't help.\", 'I need a human']\n ], 'Was I able to help?');\n }\n let analytics = new dashData(messageText, senderID, event);\n analytics.intent = { \"name\": lexData.intentName };\n dashbot.logOutgoing(analytics);\n }, 2000);\n } else {\n setTimeout(async function() {\n //Send single message to user\n if (lexData.message !== 'linkingCompleted') {\n await fb.sendTextMessage(senderID, lexData.message);\n }\n //Switch based off intent to determine any further actions\n switch (lexData.intentName) {\n case ('Hi'):\n fb.sendGif(senderID, 'Hello');\n break;\n case ('Insult'):\n fb.sendGif(senderID, 'Sad');\n break;\n case ('Love'):\n fb.sendGif(senderID, 'Happy');\n break;\n case ('Bye'):\n fb.sendGif(senderID, 'Goodbye');\n break;\n case ('Joke'):\n fb.sendGif(senderID, 'Funny');\n break;\n case ('yesLink'):\n if (lexData.dialogState == 'ElicitSlot' && lexData.slotToElicit == 'email') {\n fb.sendQuickReplies(senderID, [\n ['email']\n ], 'If this is not your email address, please type it in!');\n } else if (lexData.dialogState == 'Fulfilled' && lexData.message == 'linkingCompleted') {\n //const storeData = await magento.getUserByEmail(lexData.slots);\n fb.sendTextMessage(senderID, 'Awesome, your account has been linked!');\n const req = await dynamo.linkUser(senderID);\n }\n break;\n case ('needHuman'):\n fb.sendButton(senderID, { type: 'phone_number', title: 'Call Berkey Filters', payload: '1-800-350-4170' }, 'Here you go!');\n break;\n case ('Thanks'):\n case ('GoAway'):\n case ('HowAreYou'):\n case ('noLink'):\n case ('whyLink'):\n case ('Humans'):\n case ('Sorry'):\n case ('OrderStatus'):\n break;\n default:\n await fb.sendQuickReplies(senderID, [\n ['This helped, thanks!', 'Thanks'],\n [\"This didn't help.\", 'I need a human']\n ], 'Was I able to help you today?');\n };\n let analytics = new dashData(messageText, senderID, event);\n analytics.intent = { \"name\": lexData.intentName };\n dashbot.logOutgoing(analytics);\n }, 2000);\n }\n }\n }\n }, 1000);\n } else if (messageAttachments) {\n //Respond to media with a thumbs up and a GIF\n setTimeout(async function() {\n await fb.typing(senderID);\n setTimeout(async function() {\n //Send unicode for thumbsup emoji as string\n await fb.sendTextMessage(senderID, \"\\ud83d\\udc4d\");\n fb.sendGif(senderID, 'Thumbs up');\n let analytics = new dashData(message.text, event.sender.id, msg);\n analytics.intent = { \"name\": 'MediaMessage' };\n dashbot.logIncoming(analytics);\n }, 1000);\n }, 1000);\n }\n}", "title": "" }, { "docid": "725c7f14c51626004cc1292d3740cbed", "score": "0.4865382", "text": "function rawGetScopedUserToken(unscopedtoken, username, userid, tenant, callback)\n{\n\tif(!apiutil.isSafeStrings(unscopedtoken, username, userid, tenant)){\n\t\tvar\terror = new Error('unscopedtoken or username or userid or tenant parameters are wrong');\n\t\tr3logger.elog(error.message);\n\t\t_callback(error, null);\n\t\treturn;\n\t}\n\n\tvar\t_unscopedtoken\t= unscopedtoken;\n\tvar\t_username\t\t= username;\n\tvar\t_userid\t\t\t= userid;\n\tvar\t_tenant\t\t\t= apiutil.isSafeString(tenant) ? tenant.toLowerCase() : '';\n\tvar\t_callback\t\t= callback;\n\n\t// get tenant list for check\n\tosapi.getUserTenantList(_unscopedtoken, _userid, function(err, jsonres)\n\t{\n\t\tvar\terror;\n\t\tif(null !== err){\n\t\t\terror = new Error('could not get tenant list for user ' + _username + '(token=' + _unscopedtoken + ') by ' + err.message);\n\t\t\tr3logger.elog(error.message);\n\t\t\t_callback(error, null);\n\t\t\treturn;\n\t\t}\n\t\t//r3logger.dlog('get user tenant list jsonres=\\n' + JSON.stringify(jsonres));\n\n\t\t// check tenants(and initialize tenants)\n\t\tvar\t_tenant_id\t\t= null;\n\t\tvar\t_tenant_name\t= null;\n\t\tvar\t_tenant_desc\t= null;\t\t\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\tvar\t_tenant_display\t= null;\t\t\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\tvar\t_tenant_list\t= new Array(0);\n\t\tfor(var cnt = 0; cnt < jsonres.length; ++cnt){\n\t\t\tif(!apiutil.isSafeEntity(jsonres[cnt])){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// over write\n\t\t\tvar\tresobj = k2hr3.initUserTenant(_username, _userid, _username, jsonres[cnt].name, jsonres[cnt].id, jsonres[cnt].description, jsonres[cnt].display);\n\t\t\tif(!resobj.result){\n\t\t\t\terror = new Error(resobj.message);\n\t\t\t\tr3logger.elog(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(apiutil.compareCaseString(jsonres[cnt].name, _tenant)){\n\t\t\t\t// find target tenant\n\t\t\t\t_tenant_id\t\t= jsonres[cnt].id;\n\t\t\t\t_tenant_name\t= jsonres[cnt].name;\n\t\t\t\t_tenant_desc\t= jsonres[cnt].description;\t\t\t// eslint-disable-line no-unused-vars\n\t\t\t\t_tenant_display\t= jsonres[cnt].display;\t\t\t\t// eslint-disable-line no-unused-vars\n\t\t\t}\n\t\t\t_tenant_list.push(jsonres[cnt].name);\n\t\t}\n\n\t\t// get and add local tenants\n\t\tvar\ttmpresobj = k2hr3.listLocalTenant(_username, true);\n\t\tif(!apiutil.isSafeEntity(tmpresobj) || !apiutil.isSafeEntity(tmpresobj.result) || false === tmpresobj.result){\n\t\t\tif(apiutil.isSafeEntity(tmpresobj) && apiutil.isSafeString(tmpresobj.message)){\n\t\t\t\tr3logger.wlog('failed to get local tenant list by ' + tmpresobj.message);\n\t\t\t}else{\n\t\t\t\tr3logger.wlog('failed to get local tenant list.');\n\t\t\t}\n\t\t}else{\n\t\t\tif(!apiutil.isEmptyArray(tmpresobj.tenants)){\n\t\t\t\tfor(var cnt2 = 0; cnt2 < tmpresobj.tenants.length; ++cnt2){\n\t\t\t\t\tvar\tone_tenant = tmpresobj.tenants[cnt2];\n\t\t\t\t\tif(!apiutil.isSafeEntity(tmpresobj.tenants[cnt2])){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(apiutil.compareCaseString(tmpresobj.tenants[cnt2].name, _tenant)){\n\t\t\t\t\t\t// find target tenant\n\t\t\t\t\t\t_tenant_id\t\t= tmpresobj.tenants[cnt2].id;\n\t\t\t\t\t\t_tenant_name\t= tmpresobj.tenants[cnt2].name;\n\t\t\t\t\t\t_tenant_desc\t= tmpresobj.tenants[cnt2].desc;\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\t\t\t\t\t_tenant_display\t= tmpresobj.tenants[cnt2].display;\t\t\t\t// eslint-disable-line no-unused-vars\n\t\t\t\t\t}\n\t\t\t\t\t_tenant_list.push(one_tenant);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check and remove old tenant for user\n\t\tif(!k2hr3.removeComprehensionByNewTenants(_username, _tenant_list)){\n\t\t\tr3logger.elog('failed to remove some tenant for user, but continue...');\n\t\t}\n\n\t\t// get scoped token\n\t\tosapi.getUserScopedToken(_unscopedtoken, _tenant_name, _tenant_id, function(err, jsonres)\n\t\t{\n\t\t\tvar\terror;\n\t\t\tif(null !== err){\n\t\t\t\terror = new Error('could not get scoped user token for user ' + _username + ' by ' + err.message);\n\t\t\t\tr3logger.elog(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//r3logger.dlog('get user scoped token jsonres=\\n' + JSON.stringify(jsonres));\n\n\t\t\tvar\ttoken_seed = apiutil.isSafeString(jsonres.token_seed) ? jsonres.token_seed : null;\n\t\t\tif(!rawSetUserToken(_username, _tenant_name, jsonres.token, jsonres.expire, jsonres.region, token_seed)){\n\t\t\t\terror = new Error('failed to set unscoped/scoped user token');\n\t\t\t\tr3logger.elog(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// succeed\n\t\t\t_callback(null, jsonres.token);\n\t\t\treturn;\n\t\t});\n\t});\n}", "title": "" }, { "docid": "89d7faabe8ecb9473efad22ca5d3ab6f", "score": "0.4864668", "text": "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "title": "" }, { "docid": "c051e63ddec26aa814d241c2299ab761", "score": "0.4863028", "text": "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "title": "" }, { "docid": "dacdf9a3c0528aa6e8acff1ac1a4ec7f", "score": "0.48604864", "text": "function addPopularTweetsFromUser(user, callback){\n\tT.get('search/tweets', { q: 'from:' + user, count: 1, result_type: 'popular' }, function(err, data, response) {\n\t var tweetsData = data.statuses;\n\t console.log(\"the number of tweets from user \" + user + \" is \" + tweetsData.length);\n\t for (var i = 0; i < tweetsData.length; i++) {\n\t \tvar tweet = {user: user, text: tweetsData[i].text};\n\t \tallTweets.push(tweet);\n\t }\n\t callback();\n\t})\n}", "title": "" }, { "docid": "d16dc509ac79fff4e69ba86977f6f7ce", "score": "0.4860395", "text": "function twitterCall() {\n\nvar twitterQuestion = [\n {\n type: 'input',\n name: 'twitterHandleInput',\n message: \"Input the Twitter Handle of the user's tweets to display\"\n }\n]\n\nfunction displayTweets() {\n inquirer.prompt(twitterQuestion).then(function(answers) {\n var twitterClient = new twitter( {\n consumer_key: twitterKeys.consumer_key,\n consumer_secret: twitterKeys.consumer_secret,\n access_token_key: twitterKeys.access_token_key,\n access_token_secret: twitterKeys.access_token_secret,\n })\n var twitterHandle = answers.twitterHandleInput;\n params = {screen_name: twitterHandle};\n twitterClient.get('statuses/user_timeline/', params, function(error, data, response) {\n\n if (!error) {\n for(var i = 0; i < data.length; i++) {\n var twitterResults =\n\t\t\t\t\t\"@\" + data[i].user.screen_name + \": \" +\n\t\t\t\t\tdata[i].text + \"\\r\\n\" +\n\t\t\t\t\tdata[i].created_at + \"\\r\\n\" +\n\t\t\t\t\t\"------------------------------ \" + i + \" ------------------------------\" + \"\\r\\n\";\n\t\t\t\t\tconsole.log(twitterResults);\n console.log(params);\n }\n } else {\n console.log(\"Error :\" + error);\n return;\n }\n\n })\n })\n }\n displayTweets()\n}", "title": "" }, { "docid": "18f2f7a57fe94a48720c68a32f49ea3f", "score": "0.4859094", "text": "function spotifyThis(user) {\n if (user.length === 0) {\n user = \"All the small things\";\n }\n // API\n spotify\n .search({ type: \"track\", query: user })\n .then(function(response) {\n console.log(\"\");\n console.log(\"===== SPOTIFY ==========[ Searched: \" + user + \" ]=====\");\n console.log(\"\");\n // Looping through the response items\n for (var i = 0; i < 5; i++) {\n var prevUrl = response.tracks.items[i].preview_url;\n if (prevUrl === null) {\n prevUrl = \"No Available Url\";\n }\n console.log('===================================================================================================================================');\n // * Artist(s)\n console.log('Artist Name: [ ' + response.tracks.items[i].artists[0].name + ' ]');\n // * The song's name\n console.log('Name of Song: [ ' + response.tracks.items[i].name + ' ]');\n // * The album that the song is from\n console.log('Album Name: [ ' + response.tracks.items[i].album.name + ' ]');\n // * A preview link of the song from Spotify\n console.log('Link: [ ' + prevUrl + ' ]');\n console.log('===================================================================================================================================');\n }\n })\n .catch(function(err) {\n console.log(\"ERROR\" + err);\n });\n}", "title": "" }, { "docid": "5a253e8ee9af6e3aa99154f9a153d67f", "score": "0.48242113", "text": "function qnamaker(session, userQuery, cb) {\n //var question = session.message.text\n //var question = session.privateConversationData.userQuery;\n console.log('line 4488',userQuery);\n var question = userQuery;\n jsonObject = JSON.stringify({\n \"question\": question,\n \"top\": 1\n });\n\n request.post({\n headers: {\n 'Content-type': 'application/json',\n 'Ocp-Apim-Subscription-Key': '45bf530d13f14afab04d29b4dbc54f18',\n 'Content-Length': Buffer.byteLength(jsonObject, 'utf8')\n },\n //0a74c1ec-6338-4a5f-9fb5-4939fa3efab3\n url: 'https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/' + '0a74c1ec-6338-4a5f-9fb5-4939fa3efab3' + '/generateAnswer',\n // method: 'POST',\n body: jsonObject\n }, function(error, response, body) {\n if (error) {\n //throw (error);\n console.log('3233', error);\n } else if (response.statusCode != 404) {\n console.log(\"\\nStatus: \", response.statusCode);\n console.log(\"\\nAdded new utterances to LUIS\");\n var data = JSON.parse(body)\n console.log(\"**************\", data);\n //console.log(\"MMMMM\",data.answers[0].answer);\n //\n if ((data.answers[0].answer) === \"No good match found in the KB\") {\n cb(\"No good match found in the KB\");\n } else {\n cb(data.answers[0].answer);\n }\n } else {\n console.log('got some connection error');\n }\n });\n\n}", "title": "" }, { "docid": "9bca0438e345e59362d4462237d23fa6", "score": "0.48144546", "text": "function tweeting() {\n let tweet = document.querySelector('#comment').value;\n if (tweet != '') {\n if (currPerson.tweets == null) {\n currPerson.tweets = [];\n }\n currPerson.tweets.push(tweet);\n renderProfile(currPerson);\n }\n}", "title": "" }, { "docid": "07c538f307f634de66e6bc869fbd4fbc", "score": "0.481361", "text": "function getUsersTwitter(twitteruser, callback){\n var result = https.get('https://api.provethisconcept.com/rallyapi/twitter_follower_reps/' + twitteruser, (res) => {\n console.log(\"StatusCode: \",res.statusCode);\n let mes = \"\";\n res.on(\"data\",data => {\n mes += data;\n });\n res.on(\"end\", () => {\n callback(JSON.parse(mes));\n });\n });\n}", "title": "" }, { "docid": "4e1681d94fd366631b3c0f7e481c4364", "score": "0.48084867", "text": "async getResult(phrase, userData, forget, explicit) {\n debug('Stepped into getResult with phrase', phrase)\n\n try {\n\n //debug('userData before standard result++++++++++++++', userData)\n let res = await this.standardResult(phrase, userData, explicit)\n //debug('userData after standard result---------------', userData)\n\n debug('returning from standard result')\n //debug(\"Before PhraseFrequencyData\")\n //Not totally sure why res.phrase would ever be undefined, but it is apparently.\n\n //causes untold problems\n /*if (this.statisticsFlag && res.phrase && !forget) {\n //debug('Adding PhraseFrequency Data')\n userData.phraseFrequency.addPhrase(res.phrase, res.confidence)\n \n debug('PhraseFrequency', userData.phraseFrequency)\n }*/\n\n //This generally means somebody is telling you some information\n if (res.dontRespond) {\n //Don't modify things further'\n return Promise.resolve(res)\n }\n\n debug('Add phrase', res)\n\n //If the confidence is low, just give it a failing grade\n //res.confidence = res.confidence ? res.confidence : 0.0;\n /*if (res.confidence < 0.2) {\n res.confidence = 0.0;\n res.success = false;\n }*/\n\n if (Helper.isFailResponse(res)) {\n res.response = Helper.selectRandom(Helper.defaultResponse)\n } else if (res.response == '') {\n //Reaches this point if '' was entered as the phrase (pressed enter)\n res.response = Helper.selectRandom(Helper.defaultResponse)\n }\n debug('Returning a good result', res)\n return res\n\n } catch (reason) {\n debug('Returning a bad result', reason)\n Logger.error(reason)\n let res = Helper.failResponse\n res.confidence = 0.0\n res.response = Helper.selectRandom(Helper.defaultResponse)\n return res\n }\n\n }", "title": "" }, { "docid": "0c981480a6c720dff153f8375f653fc3", "score": "0.48033798", "text": "function refreshRecommendations() {\n\t// only want to run these if we are on the home page\n\tif ($(\"#searchField\").length != 0) {\n\t\t$.ajax({\n\t\t\turl: \"/userInfo\",\n\t\t\tmethod: \"GET\",\n\t\t\tcache: false,\n\t\t\tsuccess: function(resp) {\n\t\t\t\t// would error if not logged in\n\t\t\t\tif (resp != \"error\") {\n\t\t\t\t\tcurrentLanguage = resp['language'];\n\t\t\t\t\tgetRecommended();\n\t\t\t\t\tgetWatched();\n\t\t\t\t\tgetSearch();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "bdecb7045bb069691f2f0088c75a5916", "score": "0.47987196", "text": "function searchForWord(userEntry, language) {\n\n const matchResults = [];\n\n if (language === 'TELUGU') {\n return wordRef.child(userEntry)\n .once('value')\n .then(snap => {\n\n /* Return array containing only userEntry if userEntry is an exact match */\n if (snap.exists()) {\n matchResults.type = 'EXACT';\n matchResults.push(userEntry);\n return matchResults;\n } \n \n /* Return array containing closest matchResults to userEntry otherwise */\n else {\n matchResults.type = 'ESTIMATE';\n return wordRef.orderByKey()\n .startAt(userEntry[0])\n .endAt(`${userEntry[0]}\\uf8ff`)\n .once('value')\n .then(snap => {\n \n const matchSet = FuzzySet();\n\n /* Add all words in query result to the FuzzySet */\n snap.forEach(word => {\n matchSet.add(word.key);\n });\n\n const resultArray = matchSet.get(userEntry);\n\n if (resultArray === null) {\n return matchResults;\n }\n \n /* Adds all results to matchResults */\n resultArray.forEach(result => {\n matchResults.push(result[1]);\n });\n\n return matchResults;\n\n })\n .catch(err => console.error(err));\n }\n\n })\n .catch(err => console.error(err));\n } else {\n return synonymRef.child(userEntry)\n .once('value')\n .then(snap => {\n \n /* Return array containing only userEntry if userEntry is an exact match */\n if (snap.exists()) {\n matchResults.type = 'EXACT';\n snap.forEach(teluguWord => {\n matchResults.push(teluguWord.val());\n });\n \n return matchResults;\n }\n \n /* Return array containing closest matchResults to userEntry otherwise */\n else {\n matchResults.type = 'ESTIMATE';\n return synonymRef.orderByKey()\n .startAt(userEntry[0])\n .endAt(`${userEntry[0]}\\uf8ff`)\n .once('value')\n .then(snap => {\n \n const matchSet = FuzzySet();\n\n /* Add all synonyms in query result to the FuzzySet */\n snap.forEach(synonym => {\n matchSet.add(synonym.key);\n });\n \n const closestSynonymArray = matchSet.get(userEntry);\n\n if (closestSynonymArray === null) {\n return matchResults;\n } \n \n /* Adds Telugu words associated to closestSynonym to matchResults */\n else {\n const closestSynonym = closestSynonymArray[0][1];\n return synonymRef.child(closestSynonym)\n .once('value')\n .then(snap => {\n snap.forEach(teluguWord => {\n matchResults.push(teluguWord.val());\n });\n return matchResults;\n })\n .catch(err => console.error(err));\n }\n })\n .catch(err => console.error(err));\n }\n\n })\n .catch(err => console.error(err));\n }\n}", "title": "" }, { "docid": "7bf2d22df7e841d2e2d19f2b35b4630e", "score": "0.47922853", "text": "function runLiri(appCommand, userSearch) {\n switch (appCommand) {\n case \"concert-this\":\n getBandsInTown(userSearch);\n break;\n\n case \"movie-this\":\n getOMDB(userSearch);\n break;\n\n case \"spotify-this-song\":\n getSpotify(userSearch);\n break;\n\n case \"do-what-it-says\":\n getRead();\n break;\n //If user doesn't enter anything\n default:\n console.log(\"YO! Buttercup! Enter one of the following PHRASES! concert-this, spotify-this-song, or movie-this! \")\n\n }\n\n}", "title": "" }, { "docid": "13caa5a77ebbac29da6916a4e565c0cd", "score": "0.4779695", "text": "function findTweet() {\n T.get('search/tweets', dadTweetSearch, function (error, data) {\n //Prints errors to log.\n console.log(error, data);\n //No errors\n if (!error) {\n //gets the text of the tweet as array of words\n var tweetTextArray = data.statuses[0].text.trim().split(\" \");\n \n //gets the index of \"I'm\"\n var indexIm = 0;\n for (var i=0; i<tweetTextArray.length; i++){\n if (tweetTextArray[i].match(\"I'm\")) {\n indexIm = i;\n break;\n }\n }\n \n //gets the word for the joke\n var jokeWord = tweetTextArray[indexIm+1];\n \n //Gets the ID of selected tweet.\n var tweetId = data.statuses[0].id_str;\n \n //Gets the useranme of the selected tweet.\n var username = data.statuses[0].user.screen_name;\n \n //code for the reply itself\n var reply = {\n status: '@' + username + \" Hi \" + jokeWord + \", I'm dad.\",\n in_reply_to_status_id: '' + tweetId\n };\n \n //Posting the reply\n T.post('statuses/update', reply, function(err, data, response) {\n console.log(data);\n })\n \n // If there is an error.\n } else {\n\t \t console.log('There was an error with your word search:', error);\n\t }\n })\n}", "title": "" }, { "docid": "f6997bc115420ee3de5933f4e6f8ee09", "score": "0.47713354", "text": "async function doit(username) {\n let token = await getToken(username, \"123456\");\n if (token) {\n console.log(await queryScore(token));\n await learn(token);\n await final_test(token);\n }\n}", "title": "" }, { "docid": "37e72ab79fde837b598d9d549ea985c2", "score": "0.47618642", "text": "findBotUser() {\n this.getUsers()\n .then(users => {\n const botUsers = users.members.filter(isBot);\n this.user = botUsers.find(user => isUserBot(user, this.name));\n let welcomeText;\n if (!this.user) {\n welcomeText = `:negative_squared_cross_mark: Cannot find bot user : ${this\n .name}!\\n_I cannot respond to messages until this is resolved_`;\n } else {\n welcomeText = `:tada: ${this.user\n .real_name} is reporting for duty!`;\n }\n\n const welcomeMessage = smb()\n .text(welcomeText)\n .json();\n this.respondInChannel('general', welcomeMessage);\n })\n .catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "98b586636a0f1df9d59f1fd6cb73849f", "score": "0.476009", "text": "function checkToken() {\n chrome.storage.local.get(\"token\", result => {\n var token = result.token;\n if (token != undefined) getUserId(token);\n else window.oauth2.start();\n });\n}", "title": "" }, { "docid": "3d66880f9d7381ae8bc39353445cf6d2", "score": "0.47416824", "text": "function resolveSecret(msg){\n //const tokens = msg.content.trim().toLowerCase().split(/ +/);\n text = msg.content.trim().toLowerCase();\n for(response of client.responses){\n for(let i = 0; i < response[1].triggers.length; i++){\n //console.log(token +' =?= '+ response[1].triggers[i].toLowerCase());\n if(text.includes(response[1].triggers[i].toLowerCase())){\n console.log(`Trigger: ${response[1].triggers[i].toLowerCase()}`);\n response[1].execute(msg, response[1].triggers[i].toLowerCase());\n }\n \n }\n }\n}", "title": "" }, { "docid": "88ce2faa0c9c973afb11cc5ec5248325", "score": "0.47387308", "text": "function token(user) {\n return getUserToken(buildUser(user));\n}", "title": "" }, { "docid": "8daf060ce4518f3727906b3fe912914d", "score": "0.47278067", "text": "async standardResult(phrase, userData, explicit) {\n debug('Stepped in tryResult with phrase', phrase)\n\n //Empty or whitespace check\n if (!phrase.match(Helper.tokenize)) {\n //They just hit enter by accident.\n return Promise.resolve({ response: '', success: true, confidence: 1.0 })\n }\n\n let newRes = await this.phrasex.getWildcardsAndMatch(phrase, this.keywords, userData)\n\n try {\n let ans = await this.processResult(newRes, userData, this.storage, false)\n return ans\n } catch (error) {\n return Helper.failResponse\n }\n }", "title": "" }, { "docid": "053876c824581d1bfb207e4aa145abce", "score": "0.4726236", "text": "function checkUser(myUser) {\n\t\t$.ajax({\n\t\t\turl: 'https://api.twitter.com/1/users/show.json', \n\t\t\tdata: {\n\t\t\t\tscreen_name: myUser,\n\t\t\t\tinclude_entities: true,\n\t\t\t\tsuppress_response_codes: true\n\t\t\t\t},\n\t\t\tdataType: 'jsonp',\n\t\t\tsuccess: function(data) {\n var html = \"\";\n\n if (data.error) {\n $('#error').html(\"Twitter doesn't know this username. Try another one.\");\n }\n\t\telse {\n\t\t\tvar created = new Date(data.created_at);\n\t\t\tvar name = data.name;\n\t\t\tvar username = data.screen_name;\n\t\t\tvar followersNumber = data.followers_count;\n\t\t\tvar tweetsNumber = data.statuses_count;\t\n\n\t\t\thtml += name + \" (@\" + username + \") joined Twitter on \" + created.toDateString() + \". \" + name.split(' ')[0] + \" currently has \" + followersNumber + \" followers and has published a total number of \" + tweetsNumber + \" tweets.\"; // test\n\n\t\t\t// Check if user has more than 3200 tweets which makes first one \n\t\t\t// inaccessible (restrictions of search_timeline)\n\t\t\tif (tweetsNumber > 3200) {\n\t\t\t\t$('#error').html(\"<p>Bummer. @\" + username + \" has published more than 3200 tweets. This means, Twitter can't find the first tweet :(</p>Note to devs: If you know of a way to dig up tweets older than that (we are hitting the limit of search_timeline), please help us out with a <a href='https://github.com/davidbauer/famous-first-tweets/'>pull request on Github</a>.</p>\");\n\t\t\t} else {\n\t\t\t\tgetFirstTweet(myUser, data.status.id);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$('.userinfo').html(html);\n\t\t\t\n\t\t}\n\t}\n\t});\n}", "title": "" }, { "docid": "104d2e01477310a66672c356cca218fa", "score": "0.47249502", "text": "fetchRecommendationsForUser (username, role, token) {\n axios.get(`${url_rec}/user/${username}/${role}/${token}`)\n .then((res) => {\n var products = res.data.output\n this.setRecommendationsUser(products)\n })\n .catch((error) => {\n console.error(error.message)\n })\n }", "title": "" }, { "docid": "0b9277febbe5abf7030e33bb1d6fe543", "score": "0.47186568", "text": "function responseUser (screen_name, text){\n\tconsole.log('Tweet Msg:' + text);\n\tconsole.log('Tweet from:' + '@' + screen_name);\n\n\tvar userInterest = getInterestedGenre(text);\n\tvar userSentiment = getSentiment(text);\n\tvar user = { 'screen_name' : screen_name,\n\t'user_interest' : userInterest};\n\n\tconsole.log(user);\n\t// Use connect method to connect to the server\n\tMongoClient.connect(url, function(err, db) {\n\t\tconsole.log(\"Connected successfully to server\");\n\t\tvar collection = db.collection('users');\n\t\tif (userSentiment == 'positive'){\n\t\t\tcollection.insertMany([user], function(err, result) {\n\t\t\t\tif (err){\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Inserted a user interest into the collection\");\n\t\t\t\t\tdb.close();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tcollection.deleteOne(user, function(err, result) {\n\t\t\t\t//console.log(err);\n\t\t\t\tconsole.log(\"Deleted a user interest from the collection\");\n\t\t\t\tdb.close();\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5f073e430b21e7bdd028fbaefc693dc5", "score": "0.47143048", "text": "function masterSearch(){\n switch (userCommand) {\n\n case \"my-tweets\":\n findTweets();\n break;\n\n case \"spotify-song\":\n spotifyNow();\n break;\n\n case \"movie-please\":\n movie();\n break;\n\n case \"directions-por-favor\":\n followDirections();\n break;\n }\n}", "title": "" }, { "docid": "f8a5392439e4db5d6400d4ce8f8e90c9", "score": "0.4702042", "text": "reply(tweet) {\n const replyTo = tweet.user.screen_name;\n const replyName = tweet.user.name;\n const id = tweet.id_str;\n const text = _.sample(responses);\n\n console.log(`Replying to @${replyTo}`);\n const message = `@${replyTo} Hi ${replyName}! ${text}`;\n\n // favorite each tweet so we know which ones we've processed already\n return this.twitter.favoriteTweet(id)\n .then((data) => {\n return this.tweet(message);\n });\n }", "title": "" }, { "docid": "6419b0e91c3c6811efbf1ae2edcd97ce", "score": "0.46993122", "text": "function asyncFuzzyTest(searchTerm, user, callback) {\n var hay = user.id.toLowerCase(), i = 0, n = -1, l;\n searchTerm = searchTerm.toLowerCase();\n for (; l = searchTerm[i++];) {\n if (!~(n = hay.indexOf(l, n + 1))) {\n return callback(false);\n }\n }\n return callback(true);\n }", "title": "" }, { "docid": "7797ad9eefdb3b693abd7cf0745903ea", "score": "0.46861446", "text": "function processReply(userInput){\r\n // console.log(userInput);\r\n var wordsInInput = userInput.split(\" \");\r\n var matchedIndex=-1;\r\n\r\n for(var i=0; i<wordsInInput.length; i++ ){\r\n //check in dictonary\r\n for(var j=0;j<dict.length;j++){\r\n if(dict[j].key.indexOf(wordsInInput[i]) > -1){\r\n //key found\r\n matchedIndex = j;\r\n }\r\n }\r\n }\r\n\r\n //get related response(phrase) according to the key\r\n if(matchedIndex === -1)\r\n {\r\n //no matchedIndex\r\n var notFoundMessages = [\"eee! Not sure what are you talking about!\", \"OOps! Help me understand please!\", \"Care to explain more?\"];\r\n var randomIndex = Math.floor(Math.random() * notFoundMessages.length);\r\n while (lastUsedNotFoundMessage == randomIndex) {\r\n randomIndex = Math.floor(Math.random() * notFoundMessages.length);\r\n }\r\n lastUsedNotFoundMessage = randomIndex;\r\n return notFoundMessages[randomIndex];\r\n\r\n }\r\n else{\r\n\r\n //get response for that key from dict.json\r\n var response = dict[matchedIndex].phrase;\r\n //req 3.a. remember response in the same session\r\n //checks for prev response history or if all the response are used then start afresh\r\n if (responseHistory.length == 0 || responseHistory[matchedIndex] == undefined || responseHistory[matchedIndex].length == response.length) {\r\n responseHistory[matchedIndex] = [];\r\n }\r\n //req 3.b. randomize response in sessions\r\n var randomIndex = Math.floor(Math.random() * response.length);\r\n while(responseHistory[matchedIndex].indexOf(randomIndex) > -1){\r\n randomIndex = Math.floor(Math.random() * response.length);\r\n }\r\n responseHistory[matchedIndex].push(randomIndex);\r\n return response[randomIndex];\r\n\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "5b35046ee56dd2c693c68ef09afd4288", "score": "0.46832654", "text": "function followUser() {\n if($rootScope.currentUser == null){\n vm.returnData = \"Log in to continue\";\n }else{\n NoteService\n .checkIfUserFollowed(vm.note.user.uid, $rootScope.currentUser._id)\n .then(function (response) {\n var followed = response.data;\n console.log(response.data);\n if(response.data == null || response.data == \"\"){\n NoteService\n .followUser(vm.note.user.uid)\n .then(function (response) {\n console.log(\"Successful\");\n vm.userFollowed = 1;\n });\n console.log(\"followed\" + vm.note.user.username);}\n else{\n for(i=0 ; i<followed.length ; i++){\n if(followed[i] == vm.note.user.uid){\n console.log(\"he has already followed him\");\n vm.userFollowed = 1;\n }\n }if(vm.userFollowed = 0){\n NoteService\n .followUser(vm.note.user.uid)\n .then(function (response) {\n console.log(\"Successful\");\n });\n }\n }\n }, function (error) {\n console.log(error);\n });\n }\n }", "title": "" }, { "docid": "eaae812583b7e8a5443b9ca15df58ca9", "score": "0.46780676", "text": "get(data, cb) {\n const { queryStringObject: { phone } } = data;\n // Check that the provided phone number is valid\n const validPhoneNumber = helpers.auditParam(phone, 'string', { requiredLength: 10, operator: '=='});\n if (validPhoneNumber) {\n // Get the token from the headers\n const { headers: { token } } = data;\n // Verify that the given token is linked to the given phone number\n _jsonSubMethods.tokens.verifyToken(token, phone, tokenIsValid => {\n if (tokenIsValid) {\n // Lookup the user\n _data.read('users', phone, (err, userData) => {\n if (!err && userData) {\n // User found\n // Remove the hashed password from the user object before returning it to the requester\n delete userData.hashedPassword;\n cb(200, userData);\n } else {\n cb(404);\n }\n });\n } else {\n cb(403, {Error: 'Missing required token in header, or token is invalid'});\n }\n });\n } else {\n cb(400, {Error: 'Missing required field'});\n }\n }", "title": "" }, { "docid": "17b12f0ee4f06958595324da4dbf4836", "score": "0.46768066", "text": "get(data, cb) {\n const { queryStringObject: { id } } = data;\n // Check that the provided phone number is valid\n const validId = helpers.auditParam(id, 'string', { requiredLength: 20, operator: '=='});\n if (validId) {\n // Lookup the token\n _data.read('tokens', id, (err, tokenData) => {\n if (!err && tokenData) {\n // User found\n cb(200, tokenData);\n } else {\n cb(404);\n }\n });\n } else {\n cb(400, {Error: 'Missing required field'});\n }\n }", "title": "" }, { "docid": "4fb3d9443acc0393a4a38cfa537b51b2", "score": "0.4676699", "text": "async function waitUserText(vm, text){\n next = false;\n pushWinterText(vm, text);\n waitingSelectInput = false; // reset var\n forward = await waitUserInput(vm);\n if(!forward){\n pushWinterText(vm, \"Got it boss. Pausing intent\");\n vm.openDialogQuery = true;\n return null;\n }\n return vm.stored_input_text;\n}", "title": "" }, { "docid": "9b2dd535c1d239c94ba804c86f6f70c7", "score": "0.46738595", "text": "function filter_tweet(user, tweet) {\n // user-name exclusion if any\n for (var i = 0; i < exclude_username.length; i++) {\n if (user == exclude_username[i]) {\n return false;\n }\n }\n // return true if hits for the keywords\n for (i = 0; i < keyword_list.length; i++) {\n if (keyword_list[i] != \"\" && tweet.indexOf(keyword_list[i]) != -1) {\n return true;\n }\n }\n // return true if hits for the regular expressions\n for (i = 0; i < regexp_list.length; i++) {\n if (regexp_list[i] == \"\") {\n continue;\n }\n var regexp = new RegExp(regexp_list[i]);\n if (tweet.match(regexp)) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "b0e3b183787263e7f43439aa852c2b9d", "score": "0.46730947", "text": "function twitter20(){\nconsole.log(msg.SimpleMessage);\n \nvar params = {screen_name: 'ninja_cbc'};\nclient.get('statuses/user_timeline', params, function(error, tweets, response) {\n if (!error) {\n console.log(tweets);\n }\n});\n\n//PSUEDO CODE:\n// find specific user's 20 recent tweets\n// Output data to console\n\n}", "title": "" }, { "docid": "de59963c8d57fd3b8f7d90229d39c125", "score": "0.46654236", "text": "function initFromUser(user) {\n // get latest user data\n user.fetch({\n success: function(user) {\n // Set username\n $('#loggedInUser').html(user.get('username'));\n\n // Populate availability status\n if (!user.get('available')) {\n $('input[name=available][value=no]').attr('checked',true);\n }\n\n // Generate a VoIP capability token\n Parse.Cloud.run('generateToken',null, {\n success: function(token) {\n // Configure our soft phone with a capability token which allows\n // for incoming phone calls.\n Twilio.Device.setup(token,{ debug: false, rtc: true });\n },\n error: function(message) {\n alert('token generation failed: ' + message);\n }\n });\n },\n error: function() {\n alert('problem fetching latest user data');\n }\n });\n }", "title": "" }, { "docid": "1b4a882ac5e8ced0c1fc5a65d7e84755", "score": "0.46620017", "text": "function loadMentorProfile() {\n linkedinID = getParameterByName('linkedinID');\n mentor = fingMentorByLinkedinID(linkedinID);\n}", "title": "" }, { "docid": "c3f20e8514ce17c25377e685d41afa73", "score": "0.46584094", "text": "constructor() {\n\t\tthis.missed = 0;\n\t\tthis.phrases = [{\n\t\t\tphrase: \"life is like a box of chocolates\"\n\t\t}, {\n\t\t\tphrase: \"there is no trying\"\n\t\t}, {\n\t\t\tphrase: \"may the force be with you\"\n\t\t}, {\n\t\t\tphrase: \"you have to see the matrix for yourself\"\n\t\t}, {\n\t\t\tphrase: \"you talking to me\"\n },\n ];\n\t\tthis.activePhrase = null;\n }", "title": "" }, { "docid": "2398d1abae574e19c119c50807359ac3", "score": "0.46529505", "text": "function searchUser(name) {\n\n if (system.searched.indexOf(name) === -1 || settings.tag_only) {\n searching = name;\n\n loadMore()\n }\n\n if (system.searched.indexOf(name) != -1 && !settings.tag_only) {\n system.searchingUsers = false;\n searchUsers()\n }\n }", "title": "" }, { "docid": "e0d2a806f16ac25d99519757eb03bb89", "score": "0.46527815", "text": "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "title": "" }, { "docid": "e0d2a806f16ac25d99519757eb03bb89", "score": "0.46527815", "text": "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "title": "" }, { "docid": "e0d2a806f16ac25d99519757eb03bb89", "score": "0.46527815", "text": "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "title": "" }, { "docid": "62b257c9909fa46a33176926eed59f7e", "score": "0.46513465", "text": "function tweetUser(tweetCounterClass) {\n let tname = document.getElementsByClassName(tweetCounterClass);\n\n tname[0].textContent = userFromLocal();\n}", "title": "" }, { "docid": "df3b568fca4b8b6f92f800f8edd9c17a", "score": "0.46457276", "text": "getMotivationalPhrase(won) {\n // Select either winner phrases or looser phrases\n let phrasesToUse = won ? this.winnerPhrasesToUse : this.looserPhrasesToUse;\n let phrases = won ? this.winnerPhrases : this.looserPhrases;\n\n // Refill the phrases to use in case they got empty\n if (phrasesToUse.length == 0) phrasesToUse = [...phrases];\n\n // Choose a random phrase, and then delete it from the phrasesToUse array,\n // so that next time doesn't repeat\n const randomNumber = Math.floor(Math.random() * phrasesToUse.length);\n const phraseToUse = phrasesToUse[randomNumber];\n phrasesToUse.splice(randomNumber, 1);\n\n return phraseToUse;\n }", "title": "" }, { "docid": "fcda4392d0b8f9630699520562046908", "score": "0.46451268", "text": "function sendUserText(text, context) {\n //setBotResponse('bot reply goes here');\n //setUserContext();\n $.ajax({\n type: \"GET\",\n url: baseUrl+\"query=\"+text+\"&lang=en-us&sessionId=\"+mysession,\n contentType: \"application/json\",\n dataType: \"json\",\n headers: {\n \"Authorization\": \"Bearer \" + accessToken\n },\n // data: JSON.stringify({ query: text, lang: \"en\", sessionId: \"somerandomthing\" }),\n success: function(data) {\n main(data);\n // console.log(data);\n },\n error: function(e) {\n console.log (e);\n }\n });\n }", "title": "" }, { "docid": "940b514b62886368cb85a881911104eb", "score": "0.46390358", "text": "function takeCurrentUser() {\n var clientContext = new SP.ClientContext.get_current();\n var website = clientContext.get_web();\n clientContext.load(website);\n currentUser = website.get_currentUser();\n\n clientContext.load(currentUser);\n clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);\n\n function onRequestSucceeded() {\n\n }\n\n function onRequestFailed(sender, args) {\n //alert('Error: ' + args.get_message());\n }\n}", "title": "" }, { "docid": "17b3bde8d77028a68c9855576c6a753b", "score": "0.46353725", "text": "function doExecute(user) {\n logController.log(user.userID + ' has expired');\n user.contactList.forEach(function (contact) {\n logController.log('Sending message \"' + user.message + '\" to ' + contact);\n // twilio.sendSMS(contact, user.message);\n //console.log(contact);\n });\n User.collection.remove(user);\n}", "title": "" }, { "docid": "0ed4abadbbf7dc016733f5743c7b035e", "score": "0.46351662", "text": "getMentions(hashtag) {\n return this.twitter.getMentions()\n .then((mentions) => {\n // filter by favorited flag/hashtag\n return _.filter(mentions, (m) => {\n return !m.favorited && m.text.includes(hashtag);\n });\n });\n }", "title": "" }, { "docid": "b26d31f5c298c031de613bdb460a0f81", "score": "0.46343002", "text": "attempt(username) {\n let query = 'SELECT+Id,+Name,+Username+FROM+User+WHERE+Name+LIKE+\\'%25' + username + '%25\\'+OR+Username+LIKE+\\'%25' + username + '%25\\'';\n\n ftClient.query(query,\n function(success) {\n console.log(success);\n let numberOfUserRecords = success.records.length;\n if(numberOfUserRecords < 1){\n addError([{\"message\":\"No user for your search exists.\"}]);\n } else if(numberOfUserRecords > 1){\n loginAsShowOptions(success.records);\n } else {\n var userId = success.records[0].Id;\n loginAsPerform(userId);\n }\n },\n function(error)\n {\n console.log(error);\n addError(error.responseJSON);\n }\n );\n }", "title": "" }, { "docid": "e755602ac334157320d6b034cfdb0879", "score": "0.46314412", "text": "function getTweets(callback1, callback2) {\n tweetResource.tweet.getTweets({name: $scope.username}, function (data) {\n $scope.tweets = data;\n $scope.search = true;\n callback1();\n callback2();\n }, function (error) {\n console.alert(error);\n });\n\n }", "title": "" }, { "docid": "0e211106f0dd7e714ff180e8482cdaef", "score": "0.462965", "text": "processMessage(session) {\n\n let messageText = session.message.text;\n let sender = session.message.address.conversation.id;\n let name=session.message.user.name;\n let username=name.toLowerCase();\n let roletest=\"\";\n console.log(session.message.user.name);\n\n if (messageText && sender) {\n\n console.log(sender, messageText);\n\n if (!this._sessionIds.has(sender)) {\n this._sessionIds.set(sender, uuid.v1());\n }\n\n let apiaiRequest = this._apiaiService.textRequest(messageText,\n {\n sessionId: this._sessionIds.get(sender),\n originalRequest: {\n data: session.message,\n source: \"skype\"\n }\n });\n\n //Gerer la reponse\n apiaiRequest.on('response', (response) => {\n if (this._botConfig.devConfig) {\n console.log(sender, \"Recevoir api.ai reponse\");\n }\n //verifier l'autorisation\n db.any(`SELECT name,role FROM role WHERE name='${username}'`)\n .then(data1=>{\n let role;\n try{\n role=data1[0].role;\n }catch (e) {\n role=\"\";\n }\n //Si le bot a compris la demande\n if (SkypeBot.isDefined(response.result) && SkypeBot.isDefined(response.result.fulfillment)) {\n let responseText = response.result.fulfillment.speech;\n let responseMessages = response.result.fulfillment.messages;\n let intentName=response.result.metadata.intentName;\n let responses;\n let text=\"\";\n let projet;\n let fonction;\n let personne;\n let jalon;\n let doc;\n let sujet;\n\n //Traiter la reponse pour chaque intent dans l'api.ai\n //Demande un nom.\n if(intentName===\"projet_fonction\") {\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n let projet1 = response.result.parameters.projet1;\n let projet2 = response.result.parameters.projet2;\n let projet3 = response.result.parameters.projet3;\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n fonction=fonction.toLowerCase();\n projet=projet.toLowerCase();\n db.any(`SELECT personne FROM projet WHERE projet='${projet}' AND fonction='${fonction}'`)\n .then(data => {\n console.log(data);\n for (var i in data){\n text=text+data[i].personne+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande les personnes qui travaillent sur un projet et ces fonctions\n else if(intentName===\"projet\"){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n if (projet2===\"\" && projet3===\"\"){\n projet=projet1;\n }else if (projet3===\"\"){\n projet=projet1+\" \"+projet2;\n }else {\n projet=projet1+\" \"+projet2+\" \"+projet3;\n }\n projet=projet.toLowerCase();\n db.any(`SELECT personne,fonction FROM projet WHERE projet='${projet}'`)\n .then(data => {\n for (var i in data){\n text=text+\"La personne: \"+data[i].personne+\" et ca fonction: \"+data[i].fonction+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande le role d'un personne\n else if (intentName===\"personne\"){\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n db.any(`SELECT projet,fonction FROM projet WHERE personne='${personne}'`)\n .then(data => {\n for (var i in data){\n text=text+\"Le projet: \"+data[i].projet+\" et ca fonction: \"+data[i].fonction+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Afficher les données dans la table projet\n else if (intentName===\"list\" && role) {\n let table=response.result.parameters.table1;\n table=table.toLowerCase();\n db.any(config.selectAll)\n .then(data => {\n for (var i in data){\n text=text+\"Le projet: \"+data[i].projet+\" et la fonction: \"+data[i].fonction+\" et le prenom nom: \"+data[i].personne+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Si je suis pas un admin\n else if(intentName===\"list\" && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Demande d'un signifie\n else if (intentName===\"signifie\"){\n let syno=response.result.parameters.syno1;\n syno=syno.toLowerCase();\n db.any(`SELECT def FROM synonyme WHERE synonyme='${syno}'`)\n .then(data => {\n for (var i in data){\n text=text+data[i].def+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Demande une date\n else if (intentName===\"date\"){\n let jalon1 = response.result.parameters.date1;\n let jalon2 = response.result.parameters.date2;\n let jalon3 = response.result.parameters.date3;\n let projet1 = response.result.parameters.nom1;\n let projet2 = response.result.parameters.nom2;\n let projet3 = response.result.parameters.nom3;\n if (jalon2 === \"\" && jalon3 === \"\") {\n jalon = jalon1;\n } else if (jalon3 === \"\") {\n jalon = jalon1 + \" \" + jalon2;\n } else {\n jalon = jalon1 + \" \" + jalon2 + \" \" + jalon3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n jalon=jalon.toLowerCase();\n projet=projet.toLowerCase();\n db.any(`SELECT date FROM date WHERE nomprojet='${projet}' AND jalon='${jalon}'`)\n .then(data => {\n for (var i in data){\n text=text+data[i].date+\" \";\n }\n if (text===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n this.doRichContentResponse(session,text);\n }\n\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n }\n //Ajoute une valeure dans la table projet\n else if (intentName===\"insert\" && role){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n fonction=fonction.toLowerCase();\n projet=projet.toLowerCase();\n if (personne===\"\" || fonction===\"\" || projet===\"\"){\n this.doRichContentResponse(session,config.messageError);\n } else {\n db.any(`SELECT personne FROM projet WHERE projet='${projet}' AND fonction='${fonction}' AND personne='${personne}'`)\n .then(data2 =>{\n for (var i in data2){\n text=data2[i].personne;\n }\n if(text===''){\n db.any(`INSERT INTO projet (projet,fonction,personne) VALUES ('${projet}','${fonction}','${personne}')`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else{\n this.doRichContentResponse(session,config.messageDoneesExistent);\n }\n })\n .catch(error =>{\n console.log('ERROR:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n }\n //Si je suis pas un admin\n else if (intentName==='insert' && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Delete une valeure dans la table projet\n else if (intentName==='delete' && role){\n let projet1=response.result.parameters.projet1;\n let projet2=response.result.parameters.projet2;\n let projet3=response.result.parameters.projet3;\n let prenom=response.result.parameters.prenom1;\n let nom=response.result.parameters.nom1;\n let fonction1 = response.result.parameters.fonction1;\n let fonction2 = response.result.parameters.fonction2;\n let fonction3 = response.result.parameters.fonction3;\n if (projet2 === \"\" && projet3 === \"\") {\n projet = projet1;\n } else if (projet3 === \"\") {\n projet = projet1 + \" \" + projet2;\n } else {\n projet = projet1 + \" \" + projet2 + \" \" + projet3;\n }\n if (fonction2 === \"\" && fonction3 === \"\") {\n fonction = fonction1;\n } else if (fonction3 === \"\") {\n fonction = fonction1 + \" \" + fonction2;\n } else {\n fonction = fonction1 + \" \" + fonction2 + \" \" + fonction3;\n }\n personne=prenom+\" \"+nom;\n personne=personne.toLowerCase();\n projet=projet.toLowerCase();\n fonction=fonction.toLowerCase();\n if (fonction===\"\" && personne===\" \"){\n db.any(`DELETE FROM projet WHERE projet='${projet}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else if (fonction===\"\"){\n db.any(`DELETE FROM projet WHERE projet='${projet}' AND personne='${personne}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n } else {\n db.any(`DELETE FROM projet WHERE projet='${projet}' AND fonction='${fonction}' AND personne='${personne}'`)\n .then(data=>{\n this.doRichContentResponse(session,responseText);\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n }\n //Si je suis pas un admin\n else if (intentName==='delete' && !role){\n this.doRichContentResponse(session,config.messageAccess);\n }\n //Demande une documentation\n else if (intentName==='documentation'){\n doc=response.result.parameters.doc1;\n doc=doc.toLowerCase();\n db.any(`SELECT chemin FROM doc WHERE nom='${doc}'`)\n .then(data=>{\n for (var i in data){\n text=text+data[i].chemin;\n }\n if(text===''){\n this.doRichContentResponse(session,config.messageError);\n }else{\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n //Demande les referents sur un sujet\n else if(intentName==='referents'){\n sujet=response.result.parameters.sujet1;\n sujet=sujet.toLowerCase();\n db.any(`SELECT contact FROM referents WHERE sujet='${sujet}'`)\n .then(data=>{\n for(var i in data){\n text=text+data[i].contact;\n }\n if(text===''){\n this.doRichContentResponse(session,config.messageError);\n }else{\n this.doRichContentResponse(session,text);\n }\n })\n .catch(error=>{\n console.log('ERROR:',error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n })\n }\n //Si api.ai a compris la demande\n else if (SkypeBot.isDefined(responseText)) {\n this.doRichContentResponse(session,responseText);\n } else {\n console.log(sender, 'Recevoir message vide');\n }\n } else {\n console.log(sender, 'Recevoir resulta vide');\n }\n\n })\n .catch(error =>{\n console.log('ERROR1:', error);\n this.doRichContentResponse(session,config.messageServeurErrer);\n });\n\n\n });\n\n apiaiRequest.on('error', (error) => {\n console.error(sender, 'Error quand essayer de connecter avec api.ai', error);\n });\n\n apiaiRequest.end();\n } else {\n console.log('Message vide');\n }\n }", "title": "" }, { "docid": "e66fd47cd4c2fddcddaea81c498f53e3", "score": "0.4629194", "text": "getRandomPhrase(){\n \t\tconst randomIndex = Math.floor(Math.random()*this.phrases.length)\n \t\treturn this.phrases[randomIndex];\n \t}", "title": "" }, { "docid": "2de87c5522f8e4b9f740945416b114e3", "score": "0.4628933", "text": "function userTweets(error, data, response) {\n for (var i = 0; i < data.length; i++) {\n console.log(\"========================================\");\n console.log(params.screen_name);\n console.log(data[i].created_at);\n console.log(data[i].text);\n }\n }", "title": "" }, { "docid": "97eda9c09c782f69ff0f8be5ba432fc4", "score": "0.46288714", "text": "function teamDetailsForUser(msg, done) {\n const userId = getUserId(msg);\n const snippets = robot.brain.get(userId);\n if (!Array.isArray(snippets)) {\n return provideUsername(msg, done);\n }\n\n msg.send(`Details:\\n${snippets.map(snippet => ` - ${snippet}`).join('\\n')}`, done);\n }", "title": "" }, { "docid": "ca03f7d3edaaa700b31220e51a0b85fe", "score": "0.46241188", "text": "getRandomPhrase(){\r\n const phraseIdx = Math.floor(Math.random() * this.phrases.length);\r\n return this.phrases[phraseIdx];\r\n }", "title": "" }, { "docid": "a2c9281f25cd8b5a01f0fda15e0f19dd", "score": "0.46190062", "text": "function doSearch() {\n twitter.getSearch({\n q: SEARCH_WORDS.join(\" \"),\n lang: \"en\",\n count: 15\n }, (err, response, body) => {\n console.error(\"SEARCH ERROR:\", err);\n }, (data) => {\n var response = JSON.parse(data);\n processTweets(response.statuses);\n });\n}", "title": "" }, { "docid": "46a9445e9f81432ce9bdbcc9aa8e386a", "score": "0.46186724", "text": "function check(u) {\n\tvar found = false;\n\tfor (var i in parsedjson.responses) {\n\t\tif (parsedjson.responses[i].userinput.indexOf(u) > -1 && !found) {\n\t\t\tfound = true;\n\t\t\ttvresponse = parsedjson.responses[i].response;\n\t\t\tresulttype = parsedjson.responses[i].resulttype;\n\t\t\tsuggestionsArray = parsedjson.responses[i].suggestions;\n\t\t\tbreak;\n\t\t} else {\n\t\t\ttvresponse = parsedjson.genericresponse;\n\t\t\tresulttype = \"single_string\";\n\t\t}\n\t}\n\tfound = false;\n}", "title": "" }, { "docid": "6de0d32e774c75eb4bc709594ca2190a", "score": "0.46149716", "text": "replyToMentions(hashtag) {\n return this.getMentions(hashtag)\n .then((mentions) => {\n // debug console.log('Filtered mentions:', mentions);\n return Promise.all(_.map(mentions, (t) => {\n return this.reply(t);\n }));\n });\n }", "title": "" }, { "docid": "9fc22b650992b27cc023f0c8891b84cf", "score": "0.46108016", "text": "function activateTupoint(phrases) {\n\n var message = {\n $$$tp: true,\n query: phrases,\n id: 'highlight',\n method: 'injectTupoint',\n clazz: 'searchword'\n };\n\n chrome.extension.sendMessage(message, function(response) {});\n}", "title": "" }, { "docid": "d5f4122bdecdc2d4b39afbd2f5724cf6", "score": "0.4610304", "text": "function getHotmailUser() {\r\n\t\t//\t\tvar strGreeting = \"\";\r\n\t\tWL.api(\r\n\t\t{\r\n\t\t\tpath: \"me\",\r\n\t\t\tmethod: \"GET\"\r\n\t\t},\r\n\t\tfunction (resp) {\r\n\t\t\tif (!resp.error) {\r\n\r\n\t\t\t\tWL.logout();\r\n\r\n\t\t\t\t$(document.body).data('oauth_login',{\r\n\t\t\t\t\t'id' : resp.id,\r\n\t\t\t\t\t'email' : resp.emails.preferred,\r\n\t\t\t\t\t'link' : resp.link,\r\n\t\t\t\t\t'type' : 'hotmail'\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcheckOauthAccount($(document.body).data('oauth_login'));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "b0528858e60babe10d1c9e6cf3e2473e", "score": "0.4604315", "text": "updateIncludedTags(user, data) {\n return new Promise(async (resolve, reject) => {\n\n // Get updated user\n if (data) user = await Server.fn.dbMethods.user.get(user.id)\n .catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t get user', 'get user updateIncludedTags() error', err)));\n\n let includedTags = [];\n let allTags = [];\n\n let nameTags = this.getIncludedTagsFromText(user.twitelo.name.content);\n let descriptionTags = this.getIncludedTagsFromText(user.twitelo.description.content);\n let locationTags = this.getIncludedTagsFromText(user.twitelo.location.content);\n\n if (!data) {\n let nameSize = await this.getProfileTextLength(user.id, user.twitelo.name.content, nameTags)\n .catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t get name size', 'getProfileTextLength() error', err)));\n let descriptionSize = await this.getProfileTextLength(user.id, user.twitelo.description.content, descriptionTags)\n .catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t get description size', 'getProfileTextLength() error', err)));\n let locationSize = await this.getProfileTextLength(user.id, user.twitelo.location.content, locationTags)\n .catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t get location size', 'getProfileTextLength() error', err)));\n\n if (nameSize > config.constant.twitterLimits.name) reject(Server.fn.api.jsonError(400, 'Too many characters in name'));\n if (descriptionSize > config.constant.twitterLimits.description) reject(Server.fn.api.jsonError(400, 'Too many characters in description'));\n if (locationSize > config.constant.twitterLimits.location) reject(Server.fn.api.jsonError(400, 'Too many characters in location'));\n }\n\n if (user.switch && user.disabled < config.constant.disabledAfter) {\n if (user.twitelo.name.status) includedTags = _.concat(includedTags, nameTags);\n if (user.twitelo.description.status) includedTags = _.concat(includedTags, descriptionTags);\n if (user.twitelo.location.status) includedTags = _.concat(includedTags, locationTags);\n }\n\n allTags = _.concat(nameTags, descriptionTags, locationTags);\n\n // Remove duplicate tags\n includedTags = _.uniq(includedTags);\n allTags = _.uniq(allTags);\n\n // Set all tags to not included\n await Server.fn.dbMethods.tag.updateByUserID(user.id, {\n included: false\n }).catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t update user\\'s tags', '[DB] updateIncludedTags() error', err)));\n\n // Set tags included tags to included\n await Server.fn.dbMethods.tag.updateByUserAndIDs(user.id, includedTags, {\n included: true\n }).catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t update user\\'s tags', '[DB] updateIncludedTags() error', err)));\n\n if (data) resolve(data);\n else {\n // Get all tags in profile\n Server.fn.dbMethods.tag.getByUserAndIDs(user.id, allTags)\n .then(tags => resolve({\n tags,\n profile: {\n name: user.twitelo.name.content,\n description: user.twitelo.description.content,\n location: user.twitelo.location.content\n }\n })).catch(err => reject(Server.fn.api.jsonError(500, 'Can\\'t get user\\'s tags', '[DB] updateIncludedTags() error', err)));\n }\n\n });\n }", "title": "" }, { "docid": "56fcb16338334027b08c836d923a3b03", "score": "0.460374", "text": "constructor() { \n this.missed = 0;\n this.phrases = [ // the array that holds all of the phrases that will evenutally display while the user is playing the game. \n new Phrase('Sinnerman'), \n new Phrase('What a Wonderful World'),\n new Phrase('Sittin on the Dock of the Bay'),\n new Phrase('Loveable'),\n new Phrase('A Song for you')\n ]\n this.activePhrase = null; // ensures that there is no phrase that is intially selected\n }", "title": "" }, { "docid": "0879c22095abd0ca1222d1ce68552f76", "score": "0.46017393", "text": "async function getRecommendations(msg) {\n const username = msg.from.username;\n if (!(await db.isRegistered(username))) {\n msg.reply.text('You are not registered. Please, type /register first');\n return;\n }\n let text = msg.text.split(' ');\n // get number of tracks to be recommended\n let limit = 3;\n if (text.length > 1) {\n if (isNaN(text[1])) {\n msg.reply.text('Wrong format; please see /help');\n return;\n }\n limit = parseInt(text[1]);\n limit = Math.min(limit, maxRecommendations);\n limit = Math.max(limit, 1);\n }\n\n\n // ask user based on what they want to get recommendations\n // options: 5 last listened tracks, 5 top tracks, 5 top artists\n\n // Inline keyboard markup\n const replyMarkup = bot.inlineKeyboard([\n [\n // First row with command callback button\n bot.inlineButton('5 last listened tracks', {callback: 'Q' + limit}) // key for callbackQuery is 'Q'\n ],\n [\n // Second row with regular command button\n bot.inlineButton('5 top tracks', {callback: 'W' + limit}) // key for callbackQuery is 'W'\n ],\n [\n // Second row with regular command button\n bot.inlineButton('5 top artists', {callback: 'E' + limit}) // key for callbackQuery is 'E'\n ]\n ]);\n\n // send keyboard buttons\n return bot.sendMessage(msg.from.id, 'Please choose based on what you want to get your recommended tracks', {replyMarkup});\n}", "title": "" }, { "docid": "0d54072ac37eed26894b8d856df66221", "score": "0.45976904", "text": "function proceed() {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if (store.getters.getUserLoadStatus == 2) {\n next();\n } else if (store.getters.getUserLoadStatus == 3) {\n //user is not logged in\n console.log('you are not logged in');\n }\n }", "title": "" }, { "docid": "b4781be4ec68f502897c4665c3ddd3a4", "score": "0.45965806", "text": "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "title": "" }, { "docid": "91853c8d77345fc491c479275a0c243f", "score": "0.45894802", "text": "function rawGetUserToken(user, passwd, tenant, callback)\n{\n\tvar\t_callback = callback;\n\n\tif(!apiutil.isSafeString(user)){\n\t\tvar\terror = new Error('user parameter is wrong');\n\t\tr3logger.elog(error.message);\n\t\t_callback(error, null);\n\t\treturn;\n\t}\n\n\tvar\t_tenant\t= apiutil.isSafeString(tenant) ? tenant.toLowerCase() : '';\n\tvar\t_user\t= user;\n\tvar\t_passwd\t= apiutil.isSafeString(passwd) ? passwd : '';\n\n\t// get unscoped token\n\trawGetUserUnscopedTokenWrap(_user, _passwd, function(err, jsonres)\n\t{\n\t\tvar\terror;\n\t\tif(null !== err){\n\t\t\terror = new Error('could not get user access token by ' + err.message);\n\t\t\tr3logger.elog(error.message);\n\t\t\t_callback(error, null);\n\t\t\treturn;\n\t\t}\n\n\t\t// save to local val\n\t\t_user\t\t\t\t= jsonres.user;\t\t\t\t\t\t\t\t// over write\n\t\tvar\t_userid\t\t\t= jsonres.userid;\n\t\tvar\t_username\t\t= jsonres.user;\n\t\tvar\t_unscopedtoken\t= jsonres.token;\n\t\tvar\t_tokenexpire\t= jsonres.expire;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\tvar\t_region\t\t\t= jsonres.region;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\n\t\t// break when unscoped token\n\t\tif(!apiutil.isSafeString(_tenant)){\n\t\t\t_callback(null, _unscopedtoken);\n\t\t\treturn;\n\t\t}\n\n\t\t// get scoped user token\n\t\treturn rawGetScopedUserToken(_unscopedtoken, _username, _userid, _tenant, _callback);\n\t});\n}", "title": "" }, { "docid": "4b90ecd71eb63de46e9f8e9e32d0041d", "score": "0.45706344", "text": "function checkTheTweetAboveThisTweet(tweet_id_str){\n const promise = new Promise((resolve, reject) => {\n T.get('statuses/show', {\n id: tweet_id_str\n }, (err, data, response) => {\n if( data.text === undefined || data.text.includes(USERNAME)){\n resolve(false)\n }else{\n resolve(true)\n }\n })\n })\n return promise\n}", "title": "" }, { "docid": "46df9773fe4671a537aa5f4c39826e08", "score": "0.45698288", "text": "getRandomPhrase() {\n const randomNumber = Math.floor(Math.random() * this.phrases.length);\n return this.phrases[randomNumber];\n }", "title": "" }, { "docid": "4059cc724cfc5ea0a3bc288ee7f8bc6f", "score": "0.45673284", "text": "constructor() {\n this.missed = 0;\n this.phrases = [\n new Phrase('I am practicing radical self love'),\n new Phrase('I am worthy of rest'),\n new Phrase('I am liberating myself from my inner critic'),\n new Phrase('I am enough and then some'),\n new Phrase('I can make a difference')\n ];\n this.activePhrase = null;\n }", "title": "" }, { "docid": "6349e053053b703f09bc402a22e48817", "score": "0.45663366", "text": "function fetch_user_token()\n{\n if(document.cookie.indexOf(\"_bn_ut\")>=0)\n return getCookie(\"_bn_ut\");\n else\n {\n var err = {\"responseText\":'INVALID_TOKEN',\"status\":403};\n error_response(err);\n }\n}", "title": "" }, { "docid": "9f7388de42f41571d7261402b96d15b8", "score": "0.45650658", "text": "function liriRun(appCommand, userSearch) {\n\n switch (appCommand) {\n case \"spotify-this-song\":\n getSpotify(userSearch);\n break;\n\n case \"concert-this\":\n getBranndsInTown(userSearch);\n break;\n\n case \"movie-this\":\n getOMDB(userSearch);\n break;\n\n case \"do-what-it-says\":\n getRandom();\n break;\n // if appCommand is left blank, return a default message to user\n\n default:\n console.log(\"Please enter one of the following commands: 'concert-this', 'spotify-this-song', 'movie-this' and 'do-what-it-says'\")\n }\n}", "title": "" }, { "docid": "685fad2f0635aa0b23e23db49d727a3d", "score": "0.45634112", "text": "function getUserChoice() {\n var $spinner = $('.spinner');\n var $form = $('#user-search');\n\n $form.on('submit', function(e){\n e.preventDefault();\n\n // places spinner on the middle of the page\n $spinner.append(\"<img src='/spinner.gif' />\")\n .css(\"top\", Math.max(0, (($(window).height()) / 2) + $(window).scrollTop()) + \"px\")\n .css(\"left\", Math.max(0, (($(window).width() - 375) / 2) + $(window).scrollLeft()) + \"px\").hide().fadeIn(200);\n\n $.ajax({\n url: '/user_choice',\n dataType: 'json',\n data: $(this).serialize(),\n success: function(data){\n $spinner.empty();\n $('#my-search').ScrollTo();\n\n var $tw_ul = $(\"#my-twitter-search-result\");\n var $tw_div = $(\"#tw-search-result\");\n var $tw_h1 = (\"<h1>Tweets About \" + data[3] + \"</h1>\");\n $tw_div.prepend($tw_h1);\n data[0].forEach(function(tweet){\n $(\"<li></li>\")\n .attr('class', 'tw-result')\n .append($(\"<a href='https://twitter.com/\"+ tweet.user.screen_name + \"/status/\" + tweet.id_str + \"' target='_blank'>\"+tweet['text']+\"</a>\"))\n .appendTo($tw_ul)\n })\n var $gs_ul = $(\"#my-guidestar-results\");\n var $gs_div = $(\"#gs-search-result\");\n var $gs_h1 = (\"<h1>GuideStar Results for \" + data[3] + \"</h1>\");\n $gs_div.prepend($gs_h1);\n if (data[1] != null){\n data[1].forEach(function(org){\n $(\"<li></li>\").attr('id', \"organization-\" + org[\"organization_id\"])\n .attr('class', 'gs-result')\n .append(\"<h3>\" + org[\"organization_name\"] + \"</h3>\")\n .appendTo($gs_ul)\n .append($(\"<div></div>\")\n .append(\"<p class='mission'>\" + org[\"mission\"] + \"</p>\"))\n }) \n }\n if (data[4] != null){\n data[4].forEach(function(org){\n var $statsArray = [{value: org[\"revenue_total\"], type: \"revenue total\"}, {value: org[\"income_total\"], type: \"income total\"}];\n var organization_id = \"svg-\" + org['organization_id'];\n \n var revenue = org[\"revenue_total\"];\n console.log(revenue)\n if (revenue == undefined || revenue == 0){\n var formattedRevenue = \"Information unavailable\";\n } else {\n revenue = \"$\" + org[\"revenue_total\"];\n var formattedRevenue = (revenue).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n }\n var income = org[\"income_total\"];\n if (income == undefined || income == 0){\n var formattedIncome = \"Information unavailable\";\n } else {\n income = \"$\" + org[\"income_total\"];\n var formattedIncome = (income).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n } \n\n if (formattedIncome == \"Information unavailable\" && formattedRevenue == \"Information unavailable\") {\n $('#organization-' + org['organization_id'])\n .append($(\"<p class='stats'></p>\").text(\"Revenue Total: \" + formattedRevenue))\n .append($(\"<p class='stats'></p>\").text(\"Income Total: \" + formattedIncome))\n } else {\n $('#organization-' + org['organization_id'])\n .append($(\"<p class='stats'></p>\").text(\"Revenue Total: \" + formattedRevenue))\n .append($(\"<p class='stats'></p>\").text(\"Income Total: \" + formattedIncome))\n .append('<svg class=\"stats-field\" id='+ organization_id+ '></svg>');\n };\n\n var setUpStats = function(stats){\n var height = 150;\n var width = 480;\n\n var minStat = d3.min(stats, function(d){return d.value;\n }); \n var maxStat = d3.max(stats, function(d){return d.value;\n });\n\n var scaleX = d3.scale.linear()\n .domain([0, maxStat])\n .range([0, maxStat/500])\n\n\n var svg = d3.select('#' + organization_id)\n .attr('width', width)\n .attr('height', height)\n \n svg.selectAll('rect')\n .data(stats)\n .exit()\n .remove();\n\n svg.selectAll('rect')\n .data(stats)\n .enter()\n .append('rect')\n\n svg.selectAll('rect')\n .attr('height', 30)\n .attr('width', function(d) { return scaleX(d.value)})\n .attr('x', function(d) { return -(scaleX(d.value))})\n .attr('y', function(d, i){ return 35 + (50 * i) })\n .style('fill', '#C7D353')\n .text(function(d) {return d.type})\n .transition()\n .duration(1000)\n .attr('x', 0)\n\n svg.selectAll('text')\n .data(stats)\n .exit()\n .remove();\n\n svg.selectAll('text')\n .data(stats)\n .enter()\n .append('text')\n\n svg.selectAll('text')\n .attr('height', 30)\n .attr('width', function(d) { return d.value /300})\n .attr('x', 0)\n .attr('y', function(d, i){ return 35 + (50 * i) })\n \n .text(function(d) {return d.type})\n .attr('font-family', 'Roboto')\n .style('fill', '#FFFFFF')\n\n }\n setUpStats($statsArray);\n })\n } \n }\n })\n })\n }", "title": "" }, { "docid": "e243d1d7d4b28748a9d2093173623944", "score": "0.45626655", "text": "async function getUserMentionPages(database, user) {\n const response = await notion.databases.query({\n database_id: database,\n filter: {\n \"property\": \"People\",\n \"people\": {\n \"contains\": user.id,\n },\n },\n });\n\n return response.results;\n}", "title": "" }, { "docid": "01b6bf5a3bad43a08fa54b4cf99a8f89", "score": "0.4561317", "text": "function renderPage(){\nif (userEntry.length > 0){\n apiCall(userEntry[0]);\n}\ninitializePastSearches();\n}", "title": "" }, { "docid": "46be0f89356b8e52de6dfc0b8e9fa9d5", "score": "0.45589918", "text": "getRandomPhrase() {\r\n let randomPhrase = this.phrases[Math.floor(Math\r\n .random() * this.phrases.length)];\r\n return randomPhrase;\r\n }", "title": "" }, { "docid": "bfe54f1086a6feca3ccae4edbd40c67c", "score": "0.45583355", "text": "function addUserText() {\n topics.push(userText);\n}", "title": "" }, { "docid": "4ad637cc7ac6382d4816b339d005d93f", "score": "0.45576414", "text": "getRandomPhrase() {\n var randomNumber = Math.floor(Math.random() * 5);\n return this.phrases[randomNumber]\n }", "title": "" } ]
9f386e62320c03b5ad3fced1199fab02
Move to helper library
[ { "docid": "d973eb8060f1838139d6dcdef291ac57", "score": "0.0", "text": "function splitPath(path) {\n const regex = /^(.+)\\/([^\\/]+)$/gm;\n let m;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n return m;\n }\n}", "title": "" } ]
[ { "docid": "2e3582a22a72c64130a4aa13afd3360c", "score": "0.7200016", "text": "function Helpers() {}", "title": "" }, { "docid": "30b6c3486f0643d1a32bcac38836b101", "score": "0.7160796", "text": "function Helpers(){}", "title": "" }, { "docid": "52554f6d0ed3ed926c96dd6cda5a532d", "score": "0.656588", "text": "function Utils() {\n }", "title": "" }, { "docid": "049b8d452993fc2891cdeb0d39276be3", "score": "0.6483827", "text": "function avataxHelper() {}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.6437279", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "250b014811d7113169507b60623f6f76", "score": "0.6425546", "text": "function Util() { }", "title": "" }, { "docid": "36d5e2e5de439336f38b3b12fdf77bde", "score": "0.63752097", "text": "function Utils() {\n}", "title": "" }, { "docid": "910c7dab37c966cce745b41a9caac21e", "score": "0.6221923", "text": "function TomatoUtils() {}", "title": "" }, { "docid": "b5df59f969b6f5ab619498188fcbfb1c", "score": "0.60377604", "text": "function Utility(){}", "title": "" }, { "docid": "b1afd331f19af517e3d3303d018ab206", "score": "0.59736323", "text": "function _fn(){ /*...*/ }\t\t//Funzioni private", "title": "" }, { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.59523493", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "6f09360fade27b02c80fe853447a6a18", "score": "0.58832574", "text": "function AddonInternal() {\n}", "title": "" }, { "docid": "a4d2a9855bf296f7690ca751f55d3fb4", "score": "0.58513796", "text": "function SIDatasHelper() {\n\n}", "title": "" }, { "docid": "21e3f202f91b68c56898488e1259bce5", "score": "0.57951987", "text": "function SERPTools() {\n}", "title": "" }, { "docid": "3a66f63d641590c38b99f3d9a3b551de", "score": "0.5764559", "text": "function RequestHelper() {}", "title": "" }, { "docid": "bfa016e992e68c22230b92b883f29d8c", "score": "0.57479095", "text": "function CMSUtil() {\n}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5654029", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5654029", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5654029", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5654029", "text": "function Wrapper() {}", "title": "" }, { "docid": "95b70191bc05bb0097b59d3cc45bc98c", "score": "0.5654029", "text": "function Wrapper() {}", "title": "" }, { "docid": "5a91e885241fd697fe059eda7cf112f0", "score": "0.56096023", "text": "function utility_t()\n{\n}", "title": "" }, { "docid": "1afba09ff8424555ced72331867197c1", "score": "0.55941683", "text": "function utils() {\n checkSizeHandler();\n checkScrollPos();\n checkForTouch();\n fixBannerImg();\n slideIntoPlace();\n}", "title": "" }, { "docid": "df9ed89c100ecd442f4a8380c4ab15f6", "score": "0.5573179", "text": "function utils () {\n checkSizeHandler()\n checkScrollPos()\n checkForTouch()\n fixBannerImg()\n slideIntoPlace()\n}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.54660225", "text": "function TMP() {}", "title": "" }, { "docid": "f7bea7835647caec6beba0ebc04dd4dd", "score": "0.5457883", "text": "function PublicWrapper() {\n}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.5444415", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.54391515", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "d140de93c4598cf91c04b029883f0940", "score": "0.54366326", "text": "function StackingUtil(){}", "title": "" }, { "docid": "7315b85e2b1e8ca5ca549e896c9c0ec4", "score": "0.5411125", "text": "function $_info() {}", "title": "" }, { "docid": "c8655ec22c15ac081e8f86d25a536cd5", "score": "0.53945065", "text": "get util () {\n return lib.Util\n }", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.5390953", "text": "function TMP(){}", "title": "" }, { "docid": "fc6a50e5957697a9f19d4e34166abb87", "score": "0.5387641", "text": "function xutils() { }", "title": "" }, { "docid": "1e141ab3582641d14f30dab44d2adb6d", "score": "0.5378058", "text": "getH() { throw new Error('Implement me') }", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.535577", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "f4bb834c5e1b55c51ea7eda44e309b8b", "score": "0.53547585", "text": "function InnerloLite() {}", "title": "" }, { "docid": "a2567f7675178c73ba9f17d35e652d72", "score": "0.5343973", "text": "function PathUtils () {\n}", "title": "" }, { "docid": "e75a37c608cb5230009e2f3050b01f8b", "score": "0.53221786", "text": "function BufferUtils() {}", "title": "" }, { "docid": "1eac1f5c7f96ad4479f9d04051b14faf", "score": "0.5274041", "text": "getW() { throw new Error('Implement me') }", "title": "" }, { "docid": "39741f95a7a241c1d6e2e65bdf369b37", "score": "0.525712", "text": "function ModuleWrapper() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.52452767", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.52452767", "text": "prepare() {}", "title": "" }, { "docid": "a3cc7c5e70da4671a3a904ef120d54a1", "score": "0.52452767", "text": "prepare() {}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.5244336", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "a65a3413dfc9c66eec5e0f75667653b5", "score": "0.52416164", "text": "function LoggerHelper(){}", "title": "" }, { "docid": "a7ea285f6e2f1eea3d586bd8336d7e57", "score": "0.5212606", "text": "function Library() {\r\n\r\n}", "title": "" }, { "docid": "ac71b6533dc6f9681d04903fc1b9d2a8", "score": "0.51744", "text": "function TMP() {\n return;\n }", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.5162825", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.51585716", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "ad35e0b2fdf40cfa33261b402e1b51eb", "score": "0.51458937", "text": "function KDfpDan_afja0WTIAvRulEg() {}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.5144347", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.51428086", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "c045c6da7c6bb24d6d1284656da98615", "score": "0.5131402", "text": "function Facade(){}", "title": "" }, { "docid": "7dd290d08678050443837960ed9be5b9", "score": "0.5120374", "text": "function FileUtil() {}", "title": "" }, { "docid": "c7a496a0a1abd803b1cb17a7af315a0e", "score": "0.509103", "text": "function _r(){}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.50831085", "text": "function __func(){}", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.5074115", "text": "_map_data() { }", "title": "" }, { "docid": "688a1c1cd5957ae81a03e76a3e4e53da", "score": "0.5072992", "text": "static extraProps() {}", "title": "" }, { "docid": "e2329a25e62e3100d9db7597f4de49a2", "score": "0.5072019", "text": "function setup() {}", "title": "" }, { "docid": "f08b7ba10eaebdf77d9c47a6e631b974", "score": "0.5068191", "text": "function DOMUtil() {\n}", "title": "" }, { "docid": "a0b2b8f8fd5d6a55db089741dc3ea47b", "score": "0.5054915", "text": "constructor() {\n throw new Error('The Utils class cannot be instantiated.');\n }", "title": "" }, { "docid": "9395b158d67482fdc76910b5ae5812b2", "score": "0.504662", "text": "function ArrayUtil() {}", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.50418127", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "856a5df74290558f488d8e89e94e649f", "score": "0.5040835", "text": "function SeleneseMapper() {\n}", "title": "" }, { "docid": "9e49bb40fcad1707a027d191108c35c3", "score": "0.50323176", "text": "function _HeaderUtilities() {\r\n\t\t/* Call constructor */\r\n\t\tHeaderUtilitiesConstructor.apply(this, arguments);\r\n\t}", "title": "" }, { "docid": "9ba6df1b943ce2ad3f4d91fea81e567a", "score": "0.501981", "text": "function PsdLib() {\n}", "title": "" }, { "docid": "e48e4b7a3aa71df35c483ced1e452129", "score": "0.5011923", "text": "function _2XEbHcHe2jmPYfmsOJUDbA(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.50091875", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.50091875", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.50091875", "text": "function miFuncion(){}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50074905", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50074905", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50074905", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.50074905", "text": "initialize() {}", "title": "" }, { "docid": "e8ef1c9d9f6bc53e42232d7792a2ac8b", "score": "0.5003539", "text": "function DisplayHelper() {\n}", "title": "" }, { "docid": "03cca946895dc3bf6ef1402a12276880", "score": "0.49966887", "text": "_setupSrc () { }", "title": "" }, { "docid": "c6d56508496a44303d751bb0677bf789", "score": "0.49876216", "text": "function miFuncion() {}", "title": "" }, { "docid": "c6d56508496a44303d751bb0677bf789", "score": "0.49876216", "text": "function miFuncion() {}", "title": "" }, { "docid": "5979e72d2e0062f06e3b50125e2b5f35", "score": "0.49846366", "text": "function extension() {\n}", "title": "" }, { "docid": "8c866f7d118465e6b7b7ec01e882378c", "score": "0.49843815", "text": "_init() {\n\n }", "title": "" }, { "docid": "834c81e84d222689296e36d12808d04c", "score": "0.4983934", "text": "function CookieUtils() { }", "title": "" }, { "docid": "253b9e82ad6cddeeef0c65d136b5e6ee", "score": "0.49765348", "text": "function tmp(){}", "title": "" }, { "docid": "c228173dfad9f7a2d2d02d630f24d788", "score": "0.4970985", "text": "function FileLib() {\r\n}", "title": "" }, { "docid": "d58a9805a75ab82ee593178b8069dea0", "score": "0.49665952", "text": "function utils() {\n checkSizeHandler();\n}", "title": "" }, { "docid": "8ff34cb7f5335720d18e7a28f81a99d9", "score": "0.49400735", "text": "function UrlUtil() {}", "title": "" }, { "docid": "fa7e3c3ac569eaaf70e15bdfd51c2344", "score": "0.49400294", "text": "function wrap(fn) {\n // tslint:disable-next-line: no-unsafe-any\n return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[\"wrap\"])(fn)();\n}", "title": "" }, { "docid": "2ee1409d6727c2d7d1ed59ffb16c415f", "score": "0.4938725", "text": "function lokiFileAdapter() {}", "title": "" }, { "docid": "2ee1409d6727c2d7d1ed59ffb16c415f", "score": "0.4938725", "text": "function lokiFileAdapter() {}", "title": "" }, { "docid": "e69726a18e36a186f93b269f085a9205", "score": "0.49365482", "text": "static func()\n {\n\n }", "title": "" }, { "docid": "8929614d90f0c8922aa0f32dc7734516", "score": "0.49361515", "text": "prepareWrapper() {\n //implemented by superclasses\n return false;\n }", "title": "" }, { "docid": "7027f75bcdbf1f5bd50d3779a22b8826", "score": "0.4929606", "text": "function Admantx() {}", "title": "" }, { "docid": "823c28b51c04cf909ab456bf3a633100", "score": "0.49264365", "text": "function ExampleProvider() { }", "title": "" }, { "docid": "dda6d3cdac8eb210741ee405614dfb5c", "score": "0.4923483", "text": "function TwebbieSource() {}", "title": "" }, { "docid": "1c15b63cf65f6d8b0853e2b9a1ba4f6e", "score": "0.49232998", "text": "function hc(){}", "title": "" }, { "docid": "d179a7d51685672b7f511b0ed618b736", "score": "0.4923004", "text": "function Pirelli() {}", "title": "" }, { "docid": "bb790e32e426404095c41f50d9e614cb", "score": "0.4914691", "text": "function exPrivateFunction() {\n\n }", "title": "" } ]
2c31f13485cb58bcc0dce83cdac28db5
Opens a modal window populated by the previous request, if one exists
[ { "docid": "3378d72316c0e143f9009ff945da4617", "score": "0.0", "text": "function voteProjectPublicDialog(json) {\n\n // Get the make project public dialog div from the page\n var div = document.getElementById('voteProjectPublicDialog');\n div.innerHTML = \"\";\n var otherParty = json.otherParty;\n\n var input = document.createElement('input');\n input.id = \"modalWinProjectId\";\n input.name = \"modalWinProjectId\";\n input.type = \"hidden\";\n input.value = json.projectId;\n div.appendChild(input);\n\n var input = document.createElement('input');\n input.id = \"modalWinUserId\";\n input.name = \"modalWinUserId\";\n input.type = \"hidden\";\n input.value = \"%\";\n div.appendChild(input);\n\n var input = document.createElement('input');\n input.id = \"rowId\";\n input.name = \"rowId\";\n input.type = \"hidden\";\n input.value = json.rowId;\n div.appendChild(input);\n\n var p = document.createElement('p');\n p.id = \"edit_only\";\n p.innerHTML = '<input type=\"radio\" name=\"modalWinLevelGroup\" value=\"edit\" checked>';\n div.appendChild(p);\n jQuery(\"#edit_only\").hide();\n\n var p = document.createElement('p');\n p.id = \"headerLabel\";\n p.className = \"boldface\";\n p.innerHTML = \"Select 'Yes' to make the project public or 'No' to keep it private.\";\n div.appendChild(p);\n\n var p = document.createElement('p');\n p.id = \"noteLabel\";\n p.className = \"boldface\";\n p.innerHTML = \"Note:\";\n div.appendChild(p);\n\n var p = document.createElement('p');\n p.id = \"notes\";\n var infoString = \"<ul><li>a public project can be accessed by anyone who is logged into DataShop.</li>\"\n + \"<li>once you make a project public, you can only make it private again by contacting DataShop staff.</li>\";\n if (otherParty != null) {\n infoString = infoString\n + \"<li>the \"\n + otherParty\n + \" must also agree to make this project public for this change to take effect.</li>\";\n }\n\n p.innerHTML = infoString + \"</ul>\";\n div.appendChild(p);\n\n jQuery('#voteProjectPublicDialog').dialog('open');\n}", "title": "" } ]
[ { "docid": "5940a6b3c3210775c842b6e20f7795ae", "score": "0.69936407", "text": "function openResultsModal(url) {\n url += \"?modal=1\";\n $(\"#indicator_modal_content\").empty();\n $(\"#modalmessages\").empty();\n $(\"#indicator_results_modal_content\").load(url);\n $(\"#indicator_results_div\").modal('show');\n} // Open the CollectDataUpdate (update results) form in a modal", "title": "" }, { "docid": "e1bb5a2fd1f327e98eae19ce246a852b", "score": "0.6907282", "text": "function open_model() {\n modal.style.display = \"block\";\n }", "title": "" }, { "docid": "dd7bb7512202d36ec999e0b09c539b70", "score": "0.6857661", "text": "function showModal() {\n\t\t \t\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t }", "title": "" }, { "docid": "7a1e1bbf1ef4adac906da3ca2409bba1", "score": "0.67448163", "text": "function openModal(opts){if(systemModal){return;// Only one modal at a time please\n}systemModal=$modal.open(opts);systemModal.result.finally(function(){systemModal=null;});}", "title": "" }, { "docid": "c1df8a40ce164fb85044783504c21e9f", "score": "0.66873425", "text": "function open_nmodel() {\n nmodal.style.display = \"block\";\n }", "title": "" }, { "docid": "6bbc316305d71695d8eedd52eb754616", "score": "0.66871864", "text": "function open_modal() {\n modal.style.display = 'block';\n }", "title": "" }, { "docid": "04e35f9dbfe20a1356b9d1bd42e0d8b8", "score": "0.6680023", "text": "function openFinderModal(){\n finderModal.style.display = 'block';\n}", "title": "" }, { "docid": "a6ebfad8849182788114b7c21c1e78f8", "score": "0.66748273", "text": "function openInfo() {\n toggleModal('modalInfo');\n getUserInfo('modal-window');\n}", "title": "" }, { "docid": "a953261b26cac343a82f023155aa14d2", "score": "0.66666526", "text": "function openModalLookupCreate() {\n\tsetModalLookupModus(true);\n\t\n\t$(\"#modal-lookup\").modal('show');\t\n}", "title": "" }, { "docid": "78d4cf3a42665c2dbe69b999f5c710d8", "score": "0.6666228", "text": "openModal() { \n // to open modal window set 'bShowModal' tarck value as true\n this.bShowModal = true;\n }", "title": "" }, { "docid": "6530fbb8761cc756b343d458dfaedac7", "score": "0.6659285", "text": "function createModal( params ) {\n\t\tvar id;\n\t\tvar htmlString;\n\t\tif ( params.id && $( '#' + params.id ).length ) {\n\t\t\tconsole.log( 'Cannot open modal window with duplicate id: ' + params.id );\n\t\t}\n\t\tif ( ! ensureModalContainerExists() ) {\n\t\t\treturn false;\n\t\t}\n\t\tid = void( 0 ) === params.id ? 'gwu-modal-' + numModalsCreated : params.id;\n\t\thtmlString = '<div id=\"' + id + '\" class=\"modal-window hidden\"><span class=\"close-modal\"></span><div class=\"modal-content\">' + params.htmlString + '</div></div>';\n\t\t$( '#modal-master-container' ).append( htmlString );\n\t\tnumModalsCreated++;\n\t\t//return true;\n\n\t\treturn this;\n\t}", "title": "" }, { "docid": "39a784fc57492a6e50f8e02931c64459", "score": "0.66571146", "text": "function openModalPopup()\n\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$(this).parent().addClass('selected');\n\t\t\t$(\"#shellHeader\").hide();\t\t\t\t\n\t\t\tref.globalThumb = $(this).parent();\t\t\t\n\t\t\t$(\".btnclose\").on('click', closePopup);\n\t\t\t$('#modalwrapper').show();\t\t\t\n\t\t\tref.modalID = $(this).parent().attr('id').split('_')[1];\n\t\t\t\t\t\n\t\t\tvar myid= parseInt(ref.modalID)+1;\n\t\t\t$('#disabled-click_'+ myid+'').hide();\n\t\t\t$('#disImg_'+ myid+'').hide();\t\t\n\t\t\t$(ref.container).find('#modalwrapper').show();\t\t\t\n\t\t\t$(ref.container).find('#modalwrapper').find(\"#mypopUpContent_\" + ref.modalID).fadeIn(\"slow\");\n\t\t\t$(ref.container).find('#modalwrapper').find(\"#mypopUpContent_\" + ref.modalID).siblings('div.popContent').hide();\t\t\n\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(ref.container).find('.modal-dialog').find('.modal-content').find('.modal-body').find('div').getNiceScroll().show();\t\t\t\t\n\t\t\t\t$(ref.container).find('.modal-dialog').find('.modal-content').find('.modal-body').find('div').getNiceScroll().resize();\n\t\t\t}, 500);\n\t\t\t\n\t\t\t//prevent native touch activity like scrolling\n\t\t\t$('.modal_bg').on('touchstart touchmove', function(e){ \t\t\t\t \n\t\t\t\t e.preventDefault(); \n\t\t\t});\n\t\t}", "title": "" }, { "docid": "aae03214fc35a5360ad66168a921af50", "score": "0.6647946", "text": "MODAL_OPEN({ commit }, data) {\t\t\n\t\tcommit(\"SET_MODAL_OPEN\", data);\n\t}", "title": "" }, { "docid": "bff4e5f9cbfe824d0a2672e4c5a8d2cb", "score": "0.6638393", "text": "function launchModalHandler() {\n setModalVisible(true);\n }", "title": "" }, { "docid": "fa0a322f8679fdde7075377157c404d0", "score": "0.661466", "text": "function launchModal(link) {\n emptyModal();\n populateModalDesc(link);\n populateAndToggleModal(link);\n }", "title": "" }, { "docid": "a770acf2a2f015163fefdeebf18ebaf7", "score": "0.6586675", "text": "function getInformation() {\n\tjQuery('#myModal').modal('show');\n}", "title": "" }, { "docid": "988da267aa88f23211d220eb33b23f8c", "score": "0.6573674", "text": "function windowOpen(url){\n var target = $('.mui_window_target')\n target.load(url, function(){\n if(windowStatus == 0){\n target.fadeIn();\n }\n $('.mui_focus:first').focus();\n windowStatus = 1;\n\t});\n}", "title": "" }, { "docid": "063f62c8e5d287bc4feeec64cbb753ba", "score": "0.6514055", "text": "function open() {\n\tCONFIG.view.add($.Wrapper);\n\t\n\t$.Modal.animate({\n\t\ttop: \"20dp\",\n\t\tduration: 250\n\t});\n}", "title": "" }, { "docid": "f16cd0ed11ffcb2f49c75fa7d80cb506", "score": "0.65106076", "text": "function ShowModal() {\n\n // first, check to see if we should serve the modal. Modals get served any time \n // the session_count is less than or equal to three, except when both the cbwmodal cookie\n // value is \"skip\" and the session hasn't changed.\n if (ServeData.session_count <= 3 && (GetCookie(\"cbwmodal\") != \"skip\" || SessionChanged)) {\n\n //var modal_message = \"<span style='font-size:24px;font-weight:bold;'>Big News!</span><br/>We're donating up to 20% of our sales to the {{placeholder}}, and you don't need to buy a thing! Click <img id='cbw-modal-message-img1' class='cbw-modal-message-img cbw-main-btn cbw-close-modal'> or <img id='cbw-modal-message-img2' class='cbw-modal-message-img cbw-main-btn cbw-close-modal'> on any page to learn more.\";\n\n var modal_message1 = \"<span style='font-size:24px;font-weight:bold;'>Welcome, friend of {{placeholder}}!</span><br/>We're donating 20% of your purchase to {{placeholder}}. Plus, click any <img id='cbw-modal-message-img2' class='cbw-modal-message-img cbw-main-btn cbw-close-modal'> tell your friends on Facebook and Twitter about us and we'll donate 20% of everything they buy!\";\n\n var modal_message2 = \"<span style='font-size:24px;font-weight:bold;'>Big News!</span><br/>We're donating up to 20% of our sales to the charitable cause of your choice, and you don't need to buy a thing! Click any <img id='cbw-modal-message-img2' class='cbw-modal-message-img cbw-main-btn cbw-close-modal'> to learn more.\";\n // now check to see if a cblink value was passed in and if so, use the default cause\n // for this serve in the modal message\n if (CBCauseID && CBCauseID != \"\") {\n modal_message = modal_message1.replace(/{{placeholder}}/g, ServeData.default_cause_name);\n // Fix duplicate \"the\"s, and the \"the a\"s\n // FixCauseNames(modal_message);\n } else {\n // otherwise, just use the standard messaging\n modal_message = modal_message2;\n }\n \n // add the div that contains the modal, then add the text, css, and close button to the modal div\n $(\"<div id=\\\"cbw-modal-div\\\" class=\\\"cbw-reset cbw\\\">\").html( \"<div id='cbw-modal-1' class='cbw-modal'></div>\" ).appendTo(div);\n $(\"#cbw-modal-1\").append( modal_message);\n //$(\"#cbw-modal-1\").text( modal_message );\n $(\"#cbw-modal-1\").css({\n position: 'fixed',\n top: ($(window).height() - $(\"#cbw-modal-1\").height())/2,\n left: ($(window).width() - $(\"#cbw-modal-1\").width())/2,\n zIndex: 10000\n });\n //$(\"#cbw-modal-1\").append(\"<img id='cbw-modal-message-img1' class='cbw-modal-message-img'> or <img id='cbw-modal-message-img2' class='cbw-modal-message-img'> on any page to learn more.\");\n //$(\"#cbw-modal-1\").append(\"<img id='cbw-modal-message-img2' class='cbw-modal-message-img'>\");\n //$(\"#cbw-modal-1\").append(\"more text here\");\n //closeButton = $('<a href=\"#close-modal\" rel=\"cbw-modal:close\" class=\"close-modal\">' + 'close text' + '</a>');\n closeButton = $('<div id=\"cbw-close-modal-icon\" class=\"cbw-close-modal\"></div>');\n $(\"#cbw-modal-1\").append(closeButton);\n\n // $(\"#cbw-modal-message-img\").attr('src', CBAssetsBase + 'cb-white-ltblue-15x123.svg');\n $(\"#cbw-modal-message-img1\").attr('src', CBAssetsBase + 'causebutton-160x40.png');\n $(\"#cbw-modal-message-img2\").attr('src', CBAssetsBase + 'cause-86x40.png');\n $(\".cbw-modal-message-img\").css(\"height\",\"30\");\n \n // now add the tranparant background div and give it the correct styles\n $(\"<div id=\\\"cbw-modal-blocker-div\\\">\").html('<div class=\"jquery-modal blocker\"></div>').appendTo(div);\n $(\"#cbw-modal-blocker-div\").css({\n top: 0, right: 0, bottom: 0, left: 0,\n width: \"100%\", height: \"100%\",\n position: \"fixed\",\n zIndex: 9999,\n background: \"#333\",\n opacity: .75\n });\n\n // show the modal dialog\n $('#cbw-modal-1').show();\n\n // finally, set the cbwmodal cookie value to skip so this modal doesn't get shown \n // for this serve for at least another 24 hours\n SetCookie(\"cbwmodal\", \"skip\", 1440, \"/\");\n\n }\n\n }", "title": "" }, { "docid": "ef2a3ff6aae7fca57dda32cc43dbb73c", "score": "0.6506938", "text": "function openModal() {\n modal.style.display = \"block\";\n modalWindow.style.display = \"grid\";\n}", "title": "" }, { "docid": "36323224c3bd53846b1bced5e92cc4dc", "score": "0.6472755", "text": "function launchModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "fa019b0d9cc64298ebd410862e984dc6", "score": "0.6442534", "text": "function appShowModal() {\n\t// Here you can fetch the desired content for the modal dialogue from an API\n\t// We'll use static text as an example.\n\tvar html = \"<p>Sample modal dialogue text.</p>\";\n\thtml += \"<p>Click the button to close the modal dialogue.</p>\";\n\thtml += \"<button onClick=appUtilModalHide();>Click me!</button>\";\n\n\tappUtilModalShow(html);\n}", "title": "" }, { "docid": "0ff82853805ac3f1d939463e590fe508", "score": "0.6414658", "text": "function lolOpenModal(){\n lolmodal.style.display = 'block';\n}", "title": "" }, { "docid": "47c959e16a343c162b917bd3f3bd2923", "score": "0.6409613", "text": "function getModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "a6094d7600f7708457ad1cb872fb5938", "score": "0.64088124", "text": "function trigger_win_modal() {\r\n\tconst MODAL = new bootstrap.Modal(document.getElementById(\"win_modal\"), {})\r\n\tMODAL.show();\r\n}", "title": "" }, { "docid": "fd054c1e7d2097a2ded06732985b46db", "score": "0.6397434", "text": "function openModal() {\n setModalOpen(true);\n }", "title": "" }, { "docid": "fd054c1e7d2097a2ded06732985b46db", "score": "0.6397434", "text": "function openModal() {\n setModalOpen(true);\n }", "title": "" }, { "docid": "f7c7f35401ef23f02d5a8c09f6e6dcb3", "score": "0.639403", "text": "actionModalDialog() {\n this.send(this.get('action'));\n this.set('showModal', false);\n }", "title": "" }, { "docid": "2d77a297b2b0b694286f146cb6adfa3c", "score": "0.63923895", "text": "function abreVentana(){\n\tmiPopup=window.open(\"lib/listas/lista_materia.php?frm=datos_basicos\", \"materias\",\"width=900,height=400,scrollbars=yes\")\n\tmiPopup.focus()\n}", "title": "" }, { "docid": "360c45cdcef4baa099074b6680c02c06", "score": "0.6391168", "text": "function showWinModal(){\n $('#win-modal').modal('show');\n}", "title": "" }, { "docid": "a06329fbfd5f27d6d26fc0dfcb7d4302", "score": "0.63852787", "text": "function open() {\n\tAPP.GlobalWrapper.add($.Wrapper);\n\t\n\t$.Modal.animate({\n\t\ttop: \"20dp\",\n\t\tduration: 250\n\t});\n}", "title": "" }, { "docid": "3373f0331bce9b5b4d9a4eee86f4e99a", "score": "0.6381559", "text": "function hwcOpenModal(){\n hwcmodal.style.display = 'block';\n}", "title": "" }, { "docid": "401b6cedb3bae3b35d98c1521d1ae266", "score": "0.636607", "text": "function openModal() {\n modal.style.display = \"block\"\n }", "title": "" }, { "docid": "6f01137a1ce7232016d782999bfe777d", "score": "0.6361924", "text": "function openModal(url){\n\t// console.log(url);\n\tif(window.screen.width<=500){\n\t\tvar win = window.open(url, '_blank');\n\t\twin.focus();\n\t\treturn;\n\t}\n\tvar modal = document.querySelector(\".modal\");\n\tvar iframe = document.querySelector(\"iframe\");\n\tvar openLinkTag = document.querySelector(\"#openLinkTag\");\n\n\tmodal.classList.add(\"show-modal\");\n\tiframe.setAttribute(\"src\", url);\n\topenLinkTag.setAttribute(\"href\", url);\n}", "title": "" }, { "docid": "f0aaa900466464d02d1ee48481b4c515", "score": "0.6357303", "text": "function openerClick() {\n const name = $(this).attr(openerAttribute);\n const $modal = $(`[${containerAttribute}=\"${name}\"]`);\n openModal($modal, name);\n}", "title": "" }, { "docid": "c4e70c6a7649e516f8e6b76cadc8d76f", "score": "0.63535374", "text": "function openCampModal(cmp_id) {\n\tvar xhttp;\n\tif (window.XMLHttpRequest) {\n\t\t// code for modern browsers\n\t\txhttp = new XMLHttpRequest();\n\t\t} else {\n\t\t// code for IE6, IE5\n\t\txhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txhttp.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\tdocument.getElementById('modal-content').innerHTML = this.responseText;\n\t\tmodal.style.display = \"block\";\n\t\t}\n\t};\n\txhttp.open(\"GET\", \"/wp-content/plugins/SRBC/camps_modal_query.php?camp_id=\"+cmp_id, true);\n\txhttp.send();\n\t\n}", "title": "" }, { "docid": "0693e3a846c4bb95f14ecd0f909beb6a", "score": "0.63471955", "text": "function openModal() {\n modal.style.display = \"block\";\n }", "title": "" }, { "docid": "0693e3a846c4bb95f14ecd0f909beb6a", "score": "0.63471955", "text": "function openModal() {\n modal.style.display = \"block\";\n }", "title": "" }, { "docid": "16ba6ef570af081ece3b5961f81f5742", "score": "0.63402003", "text": "function showNewScenario() {\n var newScenarioElement = $(\"#modal-new-szenario\");\n\n // keeps the page from reloading on enter\n newScenarioElement.submit(function(e){\n e.preventDefault();\n });\n\n // set focus to scenario name input field\n newScenarioElement.on(\"shown.bs.modal\", function () {\n $(\"#sname\").focus();\n });\n\n showModalWindow(newScenarioElement);\n}", "title": "" }, { "docid": "d032ca3e8e6e5a15677a15e95b10b277", "score": "0.63312036", "text": "function Open() {\n Create();\n InitializeEvents.call(me);\n /*\n * After adding elements to the DOM, use getComputedStyle\n * to force the browser to recalc and recognize the elements\n * that we just added. Now the CSS animation has a start point\n */\n var dummy = window.getComputedStyle(me.modal).height;\n\n me.modal.className = me.modal.className +\n (me.modal.offsetHeight > window.innerHeight ?\n \" mw-open mw-anchored\" : \" mw-open\");\n\n me.overlay.className = me.overlay.className + \" mw-open\";\n }", "title": "" }, { "docid": "121e7fdf7e3c17a34965b271b89609e2", "score": "0.6325568", "text": "function openPopup() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "32e4fca6963c627e7c6393b70d4e5001", "score": "0.63228244", "text": "function openNewSongPopup() {\n\tdocument.getElementById('addNewSongModal').style.display = \"block\";\n}", "title": "" }, { "docid": "42ce0a5d8d31017b9979d11aa9ba1318", "score": "0.63097614", "text": "function showWindow(){\n let over21 = localStorage.getItem(\"over21\")\n \n // Don't show the modal if the over21 localStorage value is set to PARTY\n if (over21 === \"PARTY\"){\n console.log(\" over21 IN SHOWWINDOW\", over21);\n return \n }\n \n // Lock the modal in place and stop scrolling\n $('#modalID').modal({backdrop: 'static', keyboard: false});\n $('html body').css('overflow','hidden');\n }", "title": "" }, { "docid": "2f4548186237f5a9aca0c9b27058a192", "score": "0.63074124", "text": "openAddInterviewerPopup() {\n let modalInstance;\n modalInstance = _this.$modal.open({\n controller: 'candidatePopupController',\n controllerAs: '$ctrl',\n templateUrl: 'candidate-popup',\n size: 'md',\n windowClass: 'written-popup default-tab-module question-bankpop adcandidate-form interviewer-tab-content',\n backdrop: 'static',\n keyboard: false,\n resolve: {\n mode: function () { \n return 'interviewer';\n }\n }\n });\n\n// modalInstance.rendered.then(() => {\n// _this.$timeout(() => {\n// $('#hiddenInterview').click();\n// });\n// });\n\n modalInstance.closed.then(i => {\n //Control display behavour of tabs in question bank popup\n _this.$timeout(() => {\n _this.linkedInterviewertableParams.reload();\n });\n });\n }", "title": "" }, { "docid": "da647d5df43a8fedb4f75153e9addc25", "score": "0.630296", "text": "function openGradeAddingModal() {\n modalReady = false;\n clearGradeAddingModal();\n\n var currentTab = getCurrentTab();\n\n $.get(\"/get-grade-modal-content/?ex=\" + currentTab, function (data) {\n createModalFields(data);\n }).done(function() {\n modalReady = true;\n });\n\n $(\".custom-modal .ex-name\").text(currentTab);\n var hiddenInput = '<input type=\"hidden\" name=\"ex_name\" value=\"' + currentTab + '\"/>';\n $(\"#add-grade-form\").append(hiddenInput);\n\n $(\"#grade-modal--add\").css(\"display\", \"block\");\n\n console.log(\"modal valmis\")\n //\n // $(\"#exercise\").empty();\n //\n // var options = getExerciseOptions();\n // if (options !== \"\") {\n // console.log(\"focused\");\n // $(\".select-container\").addClass(\"is-focused is-filled\");\n // } else {\n // $(\".select-container\").removeClass(\"is-focused\");\n // }\n // $(\"#exercise\").append(options);\n}", "title": "" }, { "docid": "177800a887b364354d474247d90347b1", "score": "0.6302593", "text": "function openquetrigonometri(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "030031aa67634359e0ffc074a2f90549", "score": "0.62995285", "text": "open() {\n this.modal.jQueryModalFade.addClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'block');\n this.jQueryName.focus();\n }", "title": "" }, { "docid": "b4e8ce0b9080673f41205252ec04ebdb", "score": "0.62988544", "text": "function surveylaunch(element) {\n $(\"#SurveyModal\").modal(\"show\");\n }", "title": "" }, { "docid": "e619ea968bf018f58fd0f64a6d36de1b", "score": "0.62953573", "text": "function openModal(id) {\n modal.style.display = \"block\";\n fetch(link)\n .then(res => res.json())\n .then(sheet => findBike(sheet, id));\n}", "title": "" }, { "docid": "fe25d00486a02dca02d21e3a64bd63ac", "score": "0.6277884", "text": "function openModal () {\n setVisablity(true)\n }", "title": "" }, { "docid": "fa7ac9dc3ea4c8a90dad83930a980ec3", "score": "0.6277368", "text": "function newTab() {\n window.open('../add_modal/add_data.php');\n}", "title": "" }, { "docid": "4c57fe817d6517742f4e91ebec0ee55d", "score": "0.6274721", "text": "function openModal() {\n setOpen(true)\n }", "title": "" }, { "docid": "e2aad6518bd1346645264f4190e94b7d", "score": "0.6258874", "text": "function openModal(){\r\n modal.style.display = 'block';\r\n}", "title": "" }, { "docid": "db39abd54f2a183c25d165b808eecaf6", "score": "0.6247558", "text": "function displayModal(list, index){\n \n currentIndex=index;\n let refresh=false;\n console.log(list[index].title, list[index].url, index);\n\n \n if (refresh){\n return false;\n }\n\n $(\"#popUp\").append($('<a/>', {'href':'#', 'class':'closePopUp', text: 'X', 'onclick': 'closeModal()'})\n .css('font-size','10px').append(\n $('<div/>', {'class':'container'}).append(\n $('<h1/>', {text: list[currentIndex].title}).css('font-size','10px').append(\n $('<p/>').append(\n $('<a/>', {/*href: list[index].url, target: \"_blank\",*/ class:'popUpAction', text: 'Read more from source'})\n .load(herokuProxy + list[index].url, '_blank')\n .click(function(){\n nextArticle(list,currentIndex);\n refresh = true;\n return false;\n })\n )\n )\n )\n )\n )\n openModal();\n\n}", "title": "" }, { "docid": "c9655e1ae796ec2d6b22635032de69ae", "score": "0.62468743", "text": "function openFeedbackModal() {\n\tjQuery('#FeedbackModal').modal('show');\n}", "title": "" }, { "docid": "7c9530750a1df718b536b17f8f001353", "score": "0.624638", "text": "function DoPopup(serverName) {\r\n\r\n var targetUrl = 'https://' + serverName + '/sheephousemanor/idxs.php?p=9&conditions=Accept';\r\n var windowName = 'newWindow00004';\r\n var browserParms = 'width=780,height=600,scrollbars=yes,copyhistory=no,status=no,resizable=yes';\r\n var newWindow = window.open(serverName, windowName, browserParms); \r\n newWindow.focus();\r\n}", "title": "" }, { "docid": "2dd2e55a6c1ed720d8c0ea18754e5d2d", "score": "0.6245681", "text": "openModal() {\n fireEvent(this.pageRef, 'open', this.repId)\n }", "title": "" }, { "docid": "30c09726c19f121a0a2c40fae3b34064", "score": "0.62429255", "text": "function stockOpenModal(){\n stockmodal.style.display = 'block';\n}", "title": "" }, { "docid": "3a5c8a279acb70014c6018c7d3b80968", "score": "0.62427676", "text": "function openDelModal(){\r\n\tdelModal.style.display = 'block';\r\n}", "title": "" }, { "docid": "9ee955e1a9e88e29b0e9135cff2c3453", "score": "0.6241195", "text": "function openModal(){\n modal.style.display='block';\n}", "title": "" }, { "docid": "9ee955e1a9e88e29b0e9135cff2c3453", "score": "0.6241195", "text": "function openModal(){\n modal.style.display='block';\n}", "title": "" }, { "docid": "9d17c59b03931743d09082623addcf2f", "score": "0.6240463", "text": "function openModal(){\r\n modal.style.display = \"block\";\r\n }", "title": "" }, { "docid": "bfa8193ab0df51dd321406567d749e3e", "score": "0.62391394", "text": "function dbOpenModal(){\n dbmodal.style.display = 'block';\n}", "title": "" }, { "docid": "eae208bcf62797bfbdb32539c8920812", "score": "0.6238995", "text": "function openWinnerModal() {\n winnerModal.style.display = 'block';\n}", "title": "" }, { "docid": "0ab981055e0e69ff5950045e26ff329b", "score": "0.62364656", "text": "function openModalCompraRapida() {\n\n var url = Inditex.generateUrl(\"ItxStandardOneClickPreviewCmd\", {\n \"storeId\": Inditex.iStoreId,\n \"langId\": Inditex.iLangId,\n \"catalogId\": Inditex.iCatalogId,\n \"viewname\": \"ItxStandardOneClickPreviewView\"\n }, true);\n\n var onReady = null;\n\n if (Inditex.iStoreJSON.countryCode == \"MX\") {\n\n onReady = function () {\n\n var paymentCodeName = $(\"#responseDataCcardPaymentCodeName\").val();\n\n var paymentCode = $(\"#responseDataCardPaymentCode\").val();\n\n var contenedorForm = $('#paymentData');\n\n if (paymentCode == \"1\")\n paymentCodeName = \"VISAInstallments\";\n if (paymentCode == \"2\")\n paymentCodeName = \"MasterCardInstallments\";\n if (paymentCodeName.indexOf('Installments') != -1)\n installmentsUpdate(contenedorForm, paymentCodeName);\n\n Inditex.trackPage( \"Cesta_de_Compra/Resumen/Compra_rapida\",true);\n };\n } else {\n onReady = function () {\n Inditex.trackPage( \"Cesta_de_Compra/Resumen/Compra_rapida\",true);\n };\n }\n\n openOneClickModal(url,null,onReady,null,0.8);\n}", "title": "" }, { "docid": "4d6e8bce9105465662ef667576c95e12", "score": "0.62355626", "text": "function open_form(){\n\t$('.view_stuff').hide();\n\t$('.back_btn').hide();\n\t$('.view_selecter').removeAttr('checked');\n\t$('.view_container').show();\n\t$('#myModal').modal('show');\n}", "title": "" }, { "docid": "d112fe48b28fef965317bb4575dcc3a4", "score": "0.6234648", "text": "_showNewEmailModal() {\n this.newEmailModal.show();\n }", "title": "" }, { "docid": "2a72f292fefd44c86119abf61d4e478d", "score": "0.6225627", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "2a72f292fefd44c86119abf61d4e478d", "score": "0.6225627", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "2a72f292fefd44c86119abf61d4e478d", "score": "0.6225627", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "45383a52bc501506c252498d9ebc33fe", "score": "0.62221617", "text": "function openModal(callingformobjectid, loadtemplate, resourceURI, inputID, triples) {\n \n // Modals\n var modal = '<div class=\"modal fade\" id=\"bfeditor-modal-modalID\" tabindex=\"' + tabIndices++ + '\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\"> \\\n <div class=\"modal-dialog\"> \\\n <div class=\"modal-content\"> \\\n <div class=\"modal-header\"> \\\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button> \\\n <h4 class=\"modal-title\" id=\"bfeditor-modaltitle-modalID\">Modal title</h4> \\\n </div> \\\n <div class=\"modal-body\" id=\"bfeditor-modalbody-modalID\"></div> \\\n <div class=\"modal-footer\"> \\\n <button type=\"button\" class=\"btn btn-default\" id=\"bfeditor-modalCancel-modalID\" data-dismiss=\"modal\">Close</button> \\\n <button type=\"button\" class=\"btn btn-primary\" id=\"bfeditor-modalSave-modalID\">Save changes</button> \\\n </div> \\\n </div> \\\n </div> \\\n </div> '\n \n bfelog.addMsg(new Error(), \"DEBUG\", \"Opening modal for resourceURI \" + resourceURI);\n bfelog.addMsg(new Error(), \"DEBUG\", \"inputID of DOM element / property when opening modal: \" + inputID);\n bfelog.addMsg(new Error(), \"DEBUG\", \"callingformobjectid when opening modal: \" + callingformobjectid);\n \n var useguid = guid();\n var triplespassed = [];\n if (triples.length === 0) {\n // This is a fresh Modal, so we need to seed the data.\n // This happens when one is *not* editing data; it is fresh.\n var callingformobject = _.where(forms, {\"id\": callingformobjectid});\n callingformobject = callingformobject[0];\n callingformobject.resourceTemplates.forEach(function(t) {\n var properties = _.where(t.propertyTemplates, {\"guid\": inputID})\n if ( properties[0] !== undefined ) {\n var triplepassed = {};\n triplepassed.s = t.defaulturi;\n triplepassed.p = properties[0].propertyURI; //instanceOF\n triplepassed.o = resourceURI;\n triplepassed.otype = \"uri\";\n triplespassed.push(triplepassed);\n \n triplepassed = {};\n triplepassed.s = resourceURI;\n triplepassed.rtID = loadtemplate.id;\n triplepassed.p = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\"; //rdf:type\n triplepassed.o = loadtemplate.resourceURI;\n triplepassed.otype = \"uri\";\n triplespassed.push(triplepassed);\n }\n });\n } else {\n // Just pass the triples on....\n triplespassed = triples;\n }\n bfelog.addMsg(new Error(), \"DEBUG\", \"triplespassed within modal\", triplespassed);\n var form = getForm([{\n templateGUID: useguid,\n resourceTemplateID: loadtemplate.id,\n resourceURI: resourceURI,\n embedType: \"modal\",\n data: triplespassed\n }]);\n \n var m = modal.replace(/modalID/g, form.formobject.id);\n m = $(m);\n $(editordiv).append(m);\n\n $('#bfeditor-modalbody-' + form.formobject.id).append(form.form);\n $('#bfeditor-modaltitle-' + form.formobject.id).html(loadtemplate.resourceLabel);\n \n $('#bfeditor-modal-' + form.formobject.id).modal('show');\n $('#bfeditor-modalCancel-' + form.formobject.id).attr(\"tabindex\", tabIndices++);\n \n $('#bfeditor-modalSave-' + form.formobject.id).click(function(){\n triples.forEach(function(triple) {\n removeTriple(callingformobjectid, inputID, triple);\n });\n setResourceFromModal(callingformobjectid, form.formobject.id, resourceURI, inputID, form.formobject.store);\n });\n $('#bfeditor-modalSave-' + form.formobject.id).attr(\"tabindex\", tabIndices++);\n $('#bfeditor-modalSaveLookup-' + form.formobject.id).click(function(){\n triples.forEach(function(triple) {\n removeTriple(callingformobjectid, inputID, triple);\n });\n setResourceFromModal(callingformobjectid, form.formobject.id, resourceURI, inputID, form.formobject.store);\n });\n $('#bfeditor-modal-' + form.formobject.id).on(\"hide.bs.modal\", function(e) {\n $(this).empty();\n });\n \n $( \".typeahead\", form.form ).each(function() {\n setTypeahead(this);\n });\n \n $(\"#bfeditor-debug\").html(JSON.stringify(bfestore.store, undefined, \" \"));\n }", "title": "" }, { "docid": "277d4cf02f6bcd632bc8d2d9b7326372", "score": "0.6220016", "text": "function openWordModal(){\n wordModal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.6217223", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "5f27a68cd97df34ea96deda6c561bd75", "score": "0.6217223", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "10a92e6068f08ef4aaf46d31558eab24", "score": "0.6213511", "text": "handleNewManifestWindow(){\n this.showNewManifestModal = true;\n }", "title": "" }, { "docid": "7eb39c74a82ead71457b5102d027eb3f", "score": "0.6207845", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "7eb39c74a82ead71457b5102d027eb3f", "score": "0.6207845", "text": "function openModal() {\n modal.style.display = \"block\";\n}", "title": "" }, { "docid": "1552f5c79a9c288862fe88d8bee5cf8f", "score": "0.6207191", "text": "function openModal(){\r\nmodal.style.display = 'block';\r\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6205972", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6205972", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6205972", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6205972", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "31a02ac45669ccc902be23dea703b682", "score": "0.6205972", "text": "function openModal() {\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "68973c58120e305b3cb6a8b4af88bb06", "score": "0.62019646", "text": "function openModal() {\n modal.style.display = \"block\"; \n}", "title": "" }, { "docid": "8c60162f84d6f0bbdeeb4b7da3dab4aa", "score": "0.61971974", "text": "function openAddStockPopUp(utransInvId) {\n document.getElementById('myModal' + utransInvId).style.display = \"block\";\n}", "title": "" }, { "docid": "ed990cc0d91e80b5242cfd3ffc68383e", "score": "0.61895376", "text": "function openModal(){\n modal.style.display= 'block';\n}", "title": "" }, { "docid": "650823c72631eda76762ce9815d7b812", "score": "0.61850923", "text": "function cpuOpenModal(){\n cpumodal.style.display = 'block';\n}", "title": "" }, { "docid": "62b2f2a2695a4b796f21068d7f6a7f08", "score": "0.6182837", "text": "function openTheModal() {\n var modal = document.getElementById('modal#'+this.id.split(\"#\")[1]);\n\n removeClass(modal, \"hide\");\n // this class is used in order to avoid starting listeners every time this button\n // is pressed this will make it so that the listeners are activated only once.\n if (checkForClass(this, 'not-pressed-once')) {\n activateSwitchTabsListeners(modal);\n activateFieldsValidation(modal);\n removeClass(this, 'not-pressed-once');\n }\n}", "title": "" }, { "docid": "7e308f52db84ffc70abcea172f43f821", "score": "0.6177002", "text": "openModal() { \n this.bShowModal = true;\n }", "title": "" }, { "docid": "a4a4b08f8dee0192e643d0c5057dd1a3", "score": "0.617557", "text": "function openModal() {\n document.getElementById(\"mymem-Modal\").style.display = \"block\";\n}", "title": "" }, { "docid": "0ade137aef9e58cfa4ef05252dbbf5ee", "score": "0.6174058", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "0ade137aef9e58cfa4ef05252dbbf5ee", "score": "0.6174058", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "0ade137aef9e58cfa4ef05252dbbf5ee", "score": "0.6174058", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "0ade137aef9e58cfa4ef05252dbbf5ee", "score": "0.6174058", "text": "function openModal(){\n modal.style.display = 'block';\n}", "title": "" }, { "docid": "7f2b1efbd29b818e3723e2f88652c820", "score": "0.61724836", "text": "function showNewCompany() {\n\n $.ajax({\n type: \"POST\",\n data: {\n },\n url: \"/jezzy-master/portal/masterEntries/showSaveCompany\",\n success: function(result) {\n $(\"#modal-recebe\").html(result);\n $('#myModal').modal('toggle');\n $('#myModal').modal('show');\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) {\n alert(\"Houve algume erro no processamento dos dados desse usuário, atualize a página e tente novamente!\");\n }\n });\n}", "title": "" }, { "docid": "830c712a2436acddb0919dd3ac1fb76d", "score": "0.61717963", "text": "function showInfo( label, url ){\t\t\n \t var jqModalContent = $('<iframe frameborder=\"0\" style=\"margin: 0; padding: 0; height: 150px; width: 100%\"></iframe>');\n // Open modal dialog and keep the dialog id\n var dialogId = ContentStationSdk.openModalDialog({\n title: label,\n width: 600,\n content: jqModalContent.attr('src', url ),\n contentNoPadding: true,\n buttons: [\n // Button defined as secondary with class 'pale'\n // Has no callback defined - will close the dialog.\n {\n label: 'Close',\n class: 'pale'\n },\n \n ]\n });\t\n }", "title": "" }, { "docid": "de65ef09284756a1af52b8c693d7c112", "score": "0.61696297", "text": "function openModal() {\n modal.style.display = \"block\";\n \n}", "title": "" }, { "docid": "5b53fe738319e4f2d6d686bd5f912457", "score": "0.6169469", "text": "function showModal(){\n\t\t$('#modal_result_zero').modal('show');\n\t}", "title": "" }, { "docid": "7bc52a7c048cf1fb4487a65d39fc7c5f", "score": "0.6164947", "text": "function modal(x) {\n var html = '<div id=\"myModal\" class=\"modal\">';\n html +=\n '<div class=\"modal-content\"><div class=\"modal-header\"><span class=\"close\" onclick=\"closemodel()\">&times;</span>';\n html +=\n '<h1 id=\"popup_name\">' + x.name + '</h1></div><div class=\"modal-body\">';\n html += '<p>Breed: ' + x.breed + '</p>';\n html += '<p>M/F: ' + x.male_female + '</p>';\n html +=\n '<p>Age: ' +\n x.age_year +\n ' year(s)\\n\\t' +\n x.age_month +\n ' month(s)\\n\\t' +\n x.age_week +\n ' week(s)</p>';\n html += '<p>Size: ' + x.size + '</p>';\n html += '<p>Color: ' + x.color + '</p>';\n html += '<p>With us since: ' + x.intake_date + '</p>';\n html += '<p>Location: ' + x.location + '</p>';\n html += '<p>House Trained: ' + x.houseTrained + '</p>';\n html += '<p>Declawed: ' + x.declawed + '</p>';\n html += '<p>Spayed or Neutured: ' + x.spayed_or_neutured + '</p></div>';\n html +=\n '<div class=\"modal-footer\"><button onclick=\"application(' +\n x.id +\n ')\">ADOPT</button></div> </div>';\n return html;\n}", "title": "" }, { "docid": "adce8073ffb224bb816c9542d01efb0f", "score": "0.6159395", "text": "function openLIRIModal(){\n liriModal.style.display = 'block';\n}", "title": "" }, { "docid": "8874f322b4565538666e64ee350cb4bc", "score": "0.61538696", "text": "function showModal(){\n $('#modalDownloadList').modal('show');\n}", "title": "" } ]
8a9c0591520e4312f6160dee73a4e394
Inserts a category into the current editor window
[ { "docid": "fb211960eb7987aacbba1216535b3f08", "score": "0.68034774", "text": "function insertCategory(id)\n{\n editor = jg_e_name;\n textlink = document.getElementById('jg_bu_category1').checked;\n\n if(textlink)\n {\n linkedtext = document.getElementById('jg_bu_category_linkedtext').value;\n if(!linkedtext)\n {\n alert(Joomla.JText._('COM_JOOMGALLERY_MINI_PLEASE_ENTER_TEXT'));\n document.getElementById('category_catid').selectedIndex = 0;\n return false;\n }\n\n tag = '<a href=\"joomplulink:' + id + ' view=category\">' + linkedtext + '</a>';\n }\n else\n {\n number = document.getElementById('jg_bu_thumbnail_number').value;\n columns = document.getElementById('jg_bu_thumbnail_columns').value;\n ordering = document.getElementById('jg_bu_thumbnail_ordering').value;\n\n tag = '{joomplucat:' + id;\n\n options = new Array();\n\n if(number)\n {\n options.push('limit=' + number);\n }\n\n if(columns && columns != 2)\n {\n options.push('columns=' + columns);\n }\n\n if(ordering != 0)\n {\n options.push('ordering=random')\n }\n\n if(options.length)\n {\n tag = tag + ' ' + options.join('|');\n }\n\n tag = tag + '}';\n }\n\n window.parent.jInsertEditorText(tag, editor);\n window.parent.SqueezeBox.close();\n}", "title": "" } ]
[ { "docid": "8530df604ec950ff22bc47a5505ca419", "score": "0.7048057", "text": "function createCategory(){\n guiHelper.showTextFieldEditorDialog(function(categoryName){\n flowCategoryManager.saveCategory({\n name: categoryName,\n parentKey: rootKey\n }, function(){\n rebuildCategoryTree();\n }, function(data){\n showErrorMsg(data);\n }, constants.WORKBENCH_PANEL);\n }, \"\", catPatrn,alpine.nls.newcat_dialog_title, alpine.nls.newcat_dialog_okbutton);\n }", "title": "" }, { "docid": "cb7c1d0eb6df4b6f248bd592c3105274", "score": "0.66719514", "text": "function addCateHandler() {\n let defaultCategory = {\n title: \"\",\n color: \"Blue\",\n checked: false\n };\n let mainPane = document.querySelector(\".category-box\");\n let newEntry = document.createElement(\"category-entry\");\n newEntry.category=defaultCategory;\n storage.addCategory(newEntry);\n mainPane.appendChild(newEntry);\n}", "title": "" }, { "docid": "6ea82b2a7db8ed3b109d4b5b60a619b9", "score": "0.6367939", "text": "function addCategory(){\r\n\r\n var entry=$('#entry');\r\n entry.append($('<div>Hello!</div>'));\r\n\r\n}", "title": "" }, { "docid": "c741c116f970c7093e17836f1bfdcfd9", "score": "0.6295054", "text": "function openAddCategoryDialog(){\r\n\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#uc_dialog_add_category\", function(){\r\n\t\t\t\r\n\t\t\tjQuery(\"#uc_dialog_add_category_catname\").val(\"\").focus();\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "342dd0328805d0c2b1e6434d0f6fef54", "score": "0.6091197", "text": "function addToCategory(itemName, category){\n\t//HTML for an item\n\tvar itinHTML = '<div class=\"itinerary-item\"><span class=\"title\">' + itemName + '</span><button class=\"btn btn-xs btn-danger remove btn-circle\">x</button></div>';\n\tvar categoryId = \"#\" + category;\n\tvar categoryKey = category + \"s\";\n\t//The array from the model for the category array of the current day\n\tvar dayItemModel = days[currentDay][categoryKey];\n\t//Add the HTML under its category\n\t$(categoryId).append(itinHTML);\n\tfitToBounds();\n\t//Add a click handler for the button of the category being added to the view\n\t$(categoryId).children(\":last-child\").children(\"button\").click(function(event){\n\t\tvar itemIndex = $(this).parent().index();\n\t\tvar thisMarker = dayItemModel[itemIndex].marker;\n\t\t//Remove marker from map\n\t\tthisMarker.setMap(null);\n\t\t//Remove item from model\n\t\tdayItemModel.splice(itemIndex, 1);\n\t\t//Remove item from itin\n\t\t$(event.currentTarget).parent().remove();\n\t\tfitToBounds();\t\n\t});\n}", "title": "" }, { "docid": "534daaef22f04fc2204af043a80c7ad5", "score": "0.6086891", "text": "function addCategory() {\n console.log(\"-------------------------------------------\");\n console.log(\"--> Try to add new category: \" + document.getElementById(\"categoryDescription\").value);\n // Add new Category (if not empty) to the list of categories\n if (document.getElementById(\"categoryDescription\").value !== '') {\n var newCat = listOfCategories.newCategory(document.getElementById(\"categoryDescription\").value);\n // Add the new category in the list of items in HTML\n if (typeof newCat !== 'undefined') {\n // Select directly new category\n selectedCategoryId = newCat.getId;\n console.log(\"Id of new category : \" + selectedCategoryId);\n selectCategoryByID(selectedCategoryId);\n };\n buildCategoryDisplay(updateAlsoTasksListValue);\n // Clear Category field\n document.getElementById(\"categoryDescription\").value = \"\";\n } else {\n alert('Please enter a description !');\n };\n}", "title": "" }, { "docid": "ad70310b3a8411f5e26efb95739edc37", "score": "0.60331315", "text": "function addCategoryClickHandler(e){\n var categoryId, category, tableId, table;\n // get category id\n categoryId = $(e.target).closest('.list-group-item').data('name');\n // get category\n category = _.findWhere(categories, {'name': categoryId});\n // get active table id\n tableId = $('#table-pane1').data('id');\n // get table obj\n table = _.findWhere(tables, {'id':tableId+''});\n // add category to unsaved categorys list\n table.unsavedCategories.push(category);\n // set category table\n category.table = table.name;\n // reload the table pane\n printTablePane(table);\n // print the categories\n printCategories();\n}", "title": "" }, { "docid": "ddaa5a31dc5ef2e2e9abd572ee82b3d2", "score": "0.60137755", "text": "function insertCategory(cat_name) {\n \n var db = getDatabase();\n var res = \"\";\n \n db.transaction(function(tx) {\n var rs = tx.executeSql('INSERT INTO category (cat_name) VALUES (?);', [cat_name]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n return res;\n }", "title": "" }, { "docid": "ad9e8f7f66655905022fba13243f3e53", "score": "0.59971225", "text": "function createBlankCategory() {\n section = document.createElement(\"section\");\n section.className = \"fav-section\";\n\n section.id = \"category-add\";\n\n div = document.createElement(\"div\");\n div.className = \"fav-category\";\n\n button = document.createElement(\"button\");\n button.className = \"category-add-button\"\n button.addEventListener(\"click\", function () { onOpenAddCategory() });\n\n var addCategoryDialog = document.getElementById('newCategoryDialog');\n addCategoryDialog.addEventListener(\"close\", function () { onCloseAddCategory() });\n\n icon = document.createElement(\"i\");\n icon.className = \"fas fa-plus\";\n button.appendChild(icon);\n\n div.appendChild(button);\n section.appendChild(div);\n\n let element = document.getElementById(\"fav-container\");\n element.appendChild(section)\n}", "title": "" }, { "docid": "dac81394c82d493f84c4ddfef9eec35e", "score": "0.59528613", "text": "onClickAddCategory({ commit }, val) {\n commit(consts.VIS_ADD_CATEGORY, val);\n }", "title": "" }, { "docid": "ab9c72762c8dd210ef8647f76aa2242d", "score": "0.5916986", "text": "function initAddCategoryDialog(){\r\n\t\t\r\n\t\tjQuery(\"#uc_dialog_add_category_action\").on(\"click\",addCategory);\r\n\t\t\r\n\t\t// set update title onenter function\r\n\t\tjQuery(\"#uc_dialog_add_category_catname\").keyup(function(event){\r\n\t\t\tif(event.keyCode == 13)\r\n\t\t\t\taddCategory();\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "e40647e7e546eac2ebfdd1c126e530a4", "score": "0.5855469", "text": "saveCategory() {\n let title = document.getElementById(\"title\").value;\n let parentCategory = document.getElementById(\"parentCategory\").value;\n let code = document.getElementById(\"code\").value;\n let description = document.getElementById(\"description\").value;\n\n if(parentCategory === \"\") {\n parentCategory = \"root\";\n }\n\n if (title !== \"\" && code !== \"\" && description !== \"\") {\n let p = Demoshop.Service.categoryService;\n p.addNewCategory(title, parentCategory, code, description).then(this.categoryAdded, this.displayError);\n } else {\n Demoshop.CategoryPopups.popup.addPopups();\n }\n }", "title": "" }, { "docid": "bc1d0a2ef6209b4cc05421e69e9027b8", "score": "0.5795505", "text": "insert() {\r\n // Before insert the editor we update the modal object title to avoid weird render display.\r\n this.updateTitle(this.modalDialogInstance);\r\n this.insertEditor(this.modalDialogInstance);\r\n }", "title": "" }, { "docid": "b59abd04f5771d2fe3e280eaf0846ee3", "score": "0.5789352", "text": "addCategory(cat) {\n const option = document.createElement(\"option\");\n option.setAttribute(\"value\", cat.name);\n categoryList.appendChild(option);\n }", "title": "" }, { "docid": "05eebf6f146fd69c17cd0cdcaf1997bf", "score": "0.5780689", "text": "function selectNewCategory(){\n\tcatNameText.disabled=false;\n\tcat.disabled=true;\n\tdeleteCat.disabled=true;\n\twhile ( cat.firstChild ) cat.removeChild( cat.firstChild );\n\t\n\tvar newOption = document.createElement('option');\n\tnewOption.innerHTML = 'Choose a category';\n\tcat.appendChild(newOption);\t\n\tchangeCatCheck.disabled=true;\n\tchangeCatCheck.checked=false;\n\tcategoryEditTxt.disabled=true;\n\tcategoryEditTxt.value = \"\";\n\thide('catDiv');\n\tselectNewrule();\n}", "title": "" }, { "docid": "31bb6db861c74274ac481cebbaf5983e", "score": "0.5773183", "text": "function onOpenAddCategory() {\n var addCategoryDialog = document.getElementById('newCategoryDialog');\n var categoryInput = document.getElementById('add-category-name');\n addCategoryDialog.showModal();\n}", "title": "" }, { "docid": "04a7e362bdab1545bb3b5bca511e2b96", "score": "0.57685775", "text": "function createCategory(newCategory) {\n var categories = new Array();\n chrome.storage.sync.get('categories', function(cat){\n if(!_.isEmpty(cat)) {\n console.debug(cat.categories);\n categories = cat.categories;\n }\n categories.push(newCategory);\n chrome.storage.sync.set({'categories': categories}, function(){});\n });\n // console.debug('added category. category array is now: ' + categories);\n}", "title": "" }, { "docid": "1344a8602d90b23d03bafc5b5cfe916a", "score": "0.56927204", "text": "function setCategoryHeader() {\n\t\tdocument.querySelector('.category').innerText = 'Category: ' + chosenCategory;\n\t}", "title": "" }, { "docid": "b136fc85305de7e8df35a53e523475c5", "score": "0.5674826", "text": "function setCategory() {\n\t$j( \"#editbox_category_setorselect\" ).hide();\n\tformEditReposition();\n\t$j( \"#editbox_category_set\" ).show();\n}", "title": "" }, { "docid": "1df5f6d8ca15a81df41a4d4bf5198989", "score": "0.56554115", "text": "function ManageCategory(){}", "title": "" }, { "docid": "667f75e65da1404b6d9a9cda3f7572ff", "score": "0.55870974", "text": "createOne(json, callback) {\n const newContent = [json.category];\n super.query('insert into category (category) values (?)', newContent, callback);\n }", "title": "" }, { "docid": "7abbbbe8ef01dc85de7636a948a44059", "score": "0.5584928", "text": "function updateCategoryTitle(){\r\n\t\t\r\n\t\tvar dialogEdit = jQuery(\"#uc_dialog_edit_category\");\r\n\t\t\r\n\t\tvar catID = dialogEdit.data(\"catid\");\t\t\r\n\t\t\r\n\t\tvar cat = getCatByID(catID);\r\n\t\t\t\t\r\n\t\tvar newTitle = jQuery(\"#uc_dialog_edit_category_title\").val();\r\n\t\tvar data = {\r\n\t\t\tcatID: catID,\r\n\t\t\ttitle: newTitle\r\n\t\t};\r\n\t\t\r\n\t\tif(g_objAjaxDataAdd && typeof(data) == \"object\"){\r\n\t\t\tjQuery.extend(data, g_objAjaxDataAdd);\r\n\t\t}\r\n\t\t\r\n\t\tg_ucAdmin.dialogAjaxRequest(\"uc_dialog_edit_category\", \"update_category\", data, function(response){\r\n\t\t\t\r\n\t\t\tt.updateTitle(catID, newTitle);\r\n\t\t});\r\n\t\t\r\n\t}", "title": "" }, { "docid": "2050f114a86e7f2474a55f51b95783be", "score": "0.55670565", "text": "function addCategoryRow(categoryId){\n if(!_.contains(selectedCategories, categoryId)){\n var category = NutriNinja.getCategory(categoryId);\n var row = \"<li id=\" + categoryId + \" style=\\\"background:#FFFFFF\\\" class=\\\"ui-state-default category-row\\\">\" + category.label \n + \"<img src=\\\"img/add.png\\\" class=\\\"add-category\\\">\" + \"</li>\" + closeButtonHTML;\n $(\"#categories-list\").append(row);\n selectedCategories.push(categoryId); \n }\n }", "title": "" }, { "docid": "4ed2a1a43b065577aa19712533da4ba8", "score": "0.5565166", "text": "function addGlossaryTerm(){\n\t//Create the base message.\n\tvar msg = '<div id=\"dialog-addGlossaryTerm\" title=\"Add New Term\"><p class=\"validateTips\">Complete the form to create your new glossary term.</p><input id=\"newTerm\" type=\"text\" value=\"New Term\" defaultValue=\"New Term\" style=\"width:100%;\"/><br/><div>Edit Definition:</div><div id=\"definitionEditText\" type=\"text\" contenteditable=\"true\" class=\"dialogInput\">Input defintion here.</div></div>';\n\t\n\t//Add to stage.\n\t$(\"#stage\").append(msg);\n\t\n\tCKEDITOR.inline( \"definitionEditText\", {\n\t\ttoolbar: contentToolbar,\n\t\ttoolbarGroups :contentToolgroup,\n\t\tenterMode : CKEDITOR.ENTER_BR,\n\t\tshiftEnterMode: CKEDITOR.ENTER_P,\n\t\textraPlugins: 'sourcedialog'\n\t});\t\n\n\t//Make it a dialog\n\t$(\"#dialog-addGlossaryTerm\").dialog({\n\t\tmodal: true,\n\t\twidth: 550,\n\t\tclose: function(event, ui){\n\t\t\t\t$(\"#dialog-addGlossaryTerm\").remove();\n\t\t\t},\n\t\tbuttons: {\n\t\t\tCancel: function () {\n $(this).dialog(\"close\");\n\t\t\t},\n\t\t\tAdd: function(){\n\t\t\t\tinsertGlossaryTerm($.trim($(\"#newTerm\").val()), CKEDITOR.instances.definitionEditText.getData());\n\t\t\t\tif (CKEDITOR.instances.definitionEditText) CKEDITOR.instances.definitionEditText.destroy();\t\t\t\t\n\t\t\t\t$(this).dialog(\"close\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "539e46fc7cd1916087fdcab20400cd6b", "score": "0.5545356", "text": "function displayCategories(category) {\n var categoryEl = document.getElementById(\"categories\");\n //document.createElement(\"btn\").setAttribute(\"id = cat-btn\");\n categoryEl.textContent = category;\n}", "title": "" }, { "docid": "ed76d6a616004fefa60dfa5ea5f3672a", "score": "0.55271477", "text": "function addCat(cat, index){\n // set id per template and add to HTML\n var template = makeTemplate().cloneNode(true);\n template.setAttribute('id', cat.id);\n template.className = 'hide';\n document.getElementById('item-' + cat.id).append(template);\n\n // get specific div to update cat\n var div = document.getElementById(cat.id);\n // div.setAttribute('style', 'display:none');\n\n // the button\n div.firstChild.setAttribute('id', 'btn-' + cat.id);\n // the image\n div.firstChild.firstChild.setAttribute('src', cat.image);\n div.firstChild.firstChild.setAttribute('alt', cat.alt);\n\n // the p\n div.lastChild.innerHTML = \"You have clicked this cat <span id='\" + cat.id + \"-count'>\" + cat.score + \"</span> times.\";\n}", "title": "" }, { "docid": "b95ff4706c2505810a3efc60f127d941", "score": "0.55209565", "text": "function selectCategory(id) {\r\n\r\n\t//Not sure why Russell was setting this to null, but it messed up adding a textarea\r\n\t//$(\"td.category-data\").html(\"\");\r\n\tgCategoryID = id;\r\n\t\r\n\t\r\n\tvar category = objGrammar.categories[id];\r\n\t\r\n\t$(\"#category_letter\").html(category.letter);\r\n\t\r\n\t$(\"#category_description\").html(category.description);\r\n\t$('textarea#cat_desc_text').val(category.description_text);\r\n\t\r\n\t//$(\"#category_description_text\").html(category.description_text);\r\n\t\t\r\n\t$(\"#category_genbank\").html(category.genbank_label);\r\n $(\"#category_icon\").html('<img style=\"padding-right: 10px;\" align=\"absmiddle\" width=\"24\" src=\"' + category.image_url + '\"/> ' + category.icon_name);\r\n\r\n if (gIsEditable) {\r\n \t$('#edit-detail').button('enable');\r\n \t$('#edit-detail').unbind('click');\r\n \t$('#edit-detail').click(function(){ editCategory(id); });\r\n \t\r\n \t$('#attributes').button('enable');\r\n \t$('#attributes').unbind('click');\r\n \t$('#attributes').click(function(){ editAttributes(id); });\r\n\r\n \tif (category.isDeletable == \"false\" || category.rules.length > 0 || category.references.length > 0) {\r\n \t\t$('#delete-category').button('disable');\r\n \t} else {\r\n \t\t$('#delete-category').button('enable').unbind('click').click(function(){ deleteCategory(id); });\r\n \t}\r\n \t\r\n \t\r\n } else {\r\n \t$('#edit-detail, #delete-category, #attributes').button('disable');\r\n \t$('#edit-detail, #delete-category, #attributes').unbind('click');\r\n }\r\n\r\n showCategoryRules(id);\r\n\r\n}", "title": "" }, { "docid": "d3ddff3fabd48f3ebf97bbfd5be26ff2", "score": "0.5510346", "text": "function chooseCategory () {\n startButton.style.display = 'none'\n nextButton.style.display = 'none'\n answerContainer.style.display = 'inline'\n var basicQs = '<div class=\"category\" id=\"celiac\">What is Celiac Disease?</div>'\n var foodQs = '<div class=\"category\" id=\"eat\">Can I Eat This?</div>'\n questionContainer.innerHTML = \"Choose which category you'd like to play:\"\n answerContainer.innerHTML = basicQs + '<br>' + foodQs\n answerContainer.addEventListener('click', setChosenCategoryQuestions)\n }", "title": "" }, { "docid": "c01990b6ab9532bdd538fee16b870d77", "score": "0.55083466", "text": "function initDeleteCategoryDialog(){\r\n\t\t\r\n\t\t// set update title onenter function\r\n\t\tjQuery(\"#uc_dialog_delete_category_action\").on(\"click\",deleteCategory);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "7e7097ae17744b377f127070523976a5", "score": "0.55029696", "text": "function handleCategory(name, category) {\n // Create category element\n let categoryContainer = document.createElement(\"div\");\n let id = \"module-cont-\" + name;\n categoryContainer.id = id;\n // Create category title\n let categoryTitle = document.createElement(\"h4\");\n categoryTitle.classList.add(\"module-category-title\");\n let displayName = properCaseOrDisplayModuleName(category, name);\n categoryTitle.innerText = displayName;\n categoryContainer.appendChild(categoryTitle);\n // Traverse modules to add\n let bHasModule = false;\n category.modules.forEach((module) => {\n let moduleElement = handleModule(module);\n if (moduleElement) {\n bHasModule = true;\n categoryContainer.appendChild(moduleElement);\n }\n });\n let categoryNavItem = document.createElement(\"li\");\n categoryNavItem.classList.add(\"nav-item\");\n let categoryNavLink = document.createElement(\"a\");\n categoryNavLink.classList.add(\"nav-link\");\n if (bSetModuleNavActive) {\n categoryNavLink.classList.add(\"active\");\n bSetModuleNavActive = false;\n }\n categoryNavLink.innerText = displayName;\n categoryNavLink.href = `#${id}`;\n categoryNavLink.addEventListener(\"click\", (e) => {\n let top = getRelativePos(categoryContainer).top;\n document.getElementById(\"modules-controls\").scrollTop = top;\n e.preventDefault();\n }, {\n passive: false\n })\n categoryNavItem.appendChild(categoryNavLink);\n // If we have a module in this category, show the whole category\n if (bHasModule) {\n return [categoryContainer, categoryNavItem];\n } else {\n return [null, null];\n }\n }", "title": "" }, { "docid": "1af7818657665a12c64b2a8218b5f080", "score": "0.5492215", "text": "[addCategory](category) {\n //super.notifyObserver(\"addCategory\",category);\n this.categories.push(category);\n super.notifyObservers(\"printCat\", category);\n }", "title": "" }, { "docid": "e1faa283fa32c75b08b579ef702876c6", "score": "0.5490499", "text": "function displayCategory (categoryName) {\n\t\t$('.phrase-container').empty();\n\n\t\tvar elements = [];\n\t\tgetAllActions().forEach( function(action) {\n\t\t\tif (categoryName.toLowerCase() === action.category) {\n\t\t \tvar element = $('<button ' + \n\t\t \t\t\t'class=\"phrase '+ action[\"category\"] + '\" ' +\n\t\t \t\t\t'id=\"'+ action[\"id\"] + '\" ' +\n\t\t \t\t\t'onclick=\"Diary.addToDiary(this.id)\"' + '>' +\n\t\t \t\t\t\taction[\"text\"][0] + \n\t\t \t\t'</button>');\n\n\t\t \telements.push(element);\n\t\t\t}\n\t\t\tif (categoryName.toLowerCase().includes(action.type)) {\n\t\t\t\tvar element = $('<button ' + \n\t\t\t\t\t\t'class=\"phrase '+ action[\"category\"] + '\" ' +\n\t\t\t\t\t\t'id=\"'+ action[\"id\"] + '\" ' +\n\t\t\t\t\t\t'onclick=\"Diary.addToDiary(this.id)\"' + '>' +\n\t\t\t\t\t\t\taction[\"text\"][0] + \n\t\t\t\t\t'</button>');\n\n\t\t\t\telements.push(element);\n\t\t\t}\n\t\t});\n\t\t$('.phrase-container').append(elements);\n\t}", "title": "" }, { "docid": "82791f74dd64be63505ca0948f81cfae", "score": "0.54840595", "text": "function setEmoticonCategory(categoryId) {\n selectedCategory = categories.filter(function (category) {\n return category.id === categoryId;\n })[0]; // Refresh the popup to update the emoticons in the popup view\n\n _refreshPopup();\n }", "title": "" }, { "docid": "8ea2a090f443a92dd44a13efa954456a", "score": "0.54804385", "text": "function insertTag (tag) {\r\n\tiframe.focus();\r\n\tvar selection = editor.selection.createRange();\r\n\tselection.pasteHTML(tag);\r\n\tiframe.focus();\r\n}", "title": "" }, { "docid": "57eac00f7cb4ad4fcd1aebe280ea6ea4", "score": "0.5461243", "text": "function initEditCategoryDialog(){\r\n\t\t\r\n\t\tvar objEditDialog = jQuery(\"#uc_dialog_edit_category\");\r\n\t\t\r\n\t\tif(objEditDialog.length == 0)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar isCustom = objEditDialog.data(\"custom\");\r\n\t\t\t\t\r\n\t\tif(isCustom)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\t// set update title onenter function\r\n\t\tjQuery(\"#uc_dialog_edit_category_action\").on(\"click\",updateCategoryTitle);\r\n\t\t\r\n\t\tjQuery(\"#uc_dialog_edit_category_title\").doOnEnter(updateCategoryTitle);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "c31df98dd3d309f042290699c25f3c1d", "score": "0.54479474", "text": "function selectCat() {\n var node = ldc.catTree.getSelected();\n var name = $(node).children('a').text();\n DEBUG(\"node \"+name);\n name = name.substring(1, name.length);\n ldc.form.setCat(name);\n if (IS_MODIF) {\n ldc.form.setAutocomplete();\n IS_MODIF = false;\n }\n $(SELECTOR).dialog('close');\n }", "title": "" }, { "docid": "0d0d4f73c47e5fc26d08cb2e07de8a75", "score": "0.543808", "text": "function addSuggestion(category, suggestion) {\n database.ref('/categories/' + category).push(suggestion);\n}", "title": "" }, { "docid": "5bf04aee2a12fa0d9f05f4fc29d34037", "score": "0.54237986", "text": "async function addCategory(category) {\n const newItem = getCategoryListNewItem(category);\n await updateCategory(newItem);\n}", "title": "" }, { "docid": "1d54e1f8255194c0332b12677e2ec05e", "score": "0.54080606", "text": "showCategoryOptionsDialog()\n {\n this.categoryOptionsDialog.getByName('title').text = this.selectedCategory;\n this.categoryOptionsDialog.visible = true;\n }", "title": "" }, { "docid": "c25dbb7cc3bba2fc210d754846788150", "score": "0.5404193", "text": "openEditCategoryDlg({ commit, rootState }, obj) {\n commit(consts.BEGIN_EDIT_CATEGORY, {\n vis: obj.vis,\n id: obj.id,\n contentLang: this.getters.getLangsContentSelected,\n names: this.getters.getCategoriesNamesToEdit\n });\n commit(consts.VIS_EDIT_CATEGORY, { vis: obj.vis });\n }", "title": "" }, { "docid": "177790b8d6ad6e72327eae748674376d", "score": "0.5388981", "text": "function addCategoryRow(categoryName, returnedCategoryId) {\r\n $('#editModal').modal('hide');\r\n \r\n var currentCategoryRow = $([\r\n { newCategoryName: categoryName, newCategoryId: returnedCategoryId, newCategoryType: categoryType }\r\n ].map(categoryTemplate).join('')).appendTo('#'+categoryType+'CategoriesBody');\r\n\r\n currentCategoryRow.slideDown('slow');\r\n}", "title": "" }, { "docid": "6b9fac01ed5a9c499584ec62fce93afa", "score": "0.53865933", "text": "function pageCategory()\n\t{\n\t\tcurState = 1;\n\t\tmoveBackground(SLIDE_STEP);\n\t\t\n\t\t// hide this state:\n\t\tstateHome.css('display','none');\n\t\tstateLevel.css('display','none');\n\t\t\n\t\t// Show category:\n\t\tstateCat.css('display','block');\n\t\tstateCat.find('.titleHeader .titleText').addClass('rightIn');\n\t\tsetTimeout(function()\n\t\t{\n\t\t\tstateCat.find('.buttonItems').addClass('popIn');\n\t\t},POPUP_TIME);\n\n\t\tsetToPosition();\n\t}", "title": "" }, { "docid": "b70b17c9851163ec3e9cbd0802b914cc", "score": "0.5382957", "text": "function deleteCategory(){\r\n\t\t \r\n\t\tvar dialogDelete = jQuery(\"#uc_dialog_delete_category\");\r\n\t\tvar catID = dialogDelete.data(\"catid\");\r\n\t\t\t\t\r\n\t\tvar data = {};\r\n\t\tdata.catID = catID;\r\n\t\t\r\n\t\tvar selectedCatID = t.getSelectedCatID();\r\n\t\t\r\n\t\t//get if selected category will be removed\r\n\t\tvar isSelectedRemoved = (catID == selectedCatID);\r\n\t\t\r\n\t\tif(g_objAjaxDataAdd && typeof(data) == \"object\"){\r\n\t\t\tjQuery.extend(data, g_objAjaxDataAdd);\r\n\t\t}\r\n\t\t\r\n\t\tg_ucAdmin.dialogAjaxRequest(\"uc_dialog_delete_category\", \"remove_category\", data, function(response){\r\n\t\t\t\r\n\t\t\tremoveCategoryFromHtml(catID);\r\n\t\t\t\r\n\t\t\t//update html cats select\r\n\t\t\tvar htmlSelectCats = response.htmlSelectCats;\r\n\t\t\tjQuery(\"#select_item_category\").html(htmlSelectCats);\r\n\t\t\t\r\n\t\t\t//clear the items panel\r\n\t\t\tif(isSelectedRemoved == true){\r\n\t\t\t\t\r\n\t\t\t\t//run event\r\n\t\t\t\tt.events.onRemoveSelectedCategory();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tt.selectFirstCategory();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//fire height change event\r\n\t\t\tt.events.onHeightChange();\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t\t\t\r\n\t}", "title": "" }, { "docid": "a9f036fc3e588a8f418de9f6e031ea4f", "score": "0.53587484", "text": "onCategoryClick ({ commit }, payload) {\n commit('SET_SELECTED_CATEGORY', payload.categoryId);\n commit('SET_SIDEBAR_OFF');\n }", "title": "" }, { "docid": "7c4dab62b2c4f5a46bdce59dc5c7de4f", "score": "0.5356108", "text": "function callbackUpdateActiveStoryAddedCategory(id, name) {\n\t\tconsole.log(\"CATEGORIES array updated in ActiveStory\");\n\t\tenvironment.active_story.categories.push({\"id\":id,\"name\":name});\t\n\t\tconsole.log(\"pushed into categories\" + id + name );\n\t\tconsole.log(environment.active_story);\n\t}", "title": "" }, { "docid": "c7d45686121a64b123e3dc7d33507752", "score": "0.5345228", "text": "function addAnotherMetaphorCategory() {\n\tvar nextMetaphorCategory = $('#categoryList').children('div').length;\n\tvar categoryDiv = '<div id=\"metaphor_new_category_' + nextMetaphorCategory + '\"><label for=\"metaphor_categories_attributes_' + nextMetaphorCategory + '_value\">Value: </label>';\n categoryDiv += '<input id=\"metaphor_categories_attributes_' + nextMetaphorCategory + '_value\" type=\"text\" size=\"40\" name=\"metaphor[categories_attributes][' +nextMetaphorCategory + '][value]\"/>';\n\tcategoryDiv += ' <label for=\"metaphor_categories_attributes_' + nextMetaphorCategory + '_clear\">Clear? </label>';\n//\tcategoryDiv += ' <label for=\"metaphor_categories_attributes_' + nextMetaphorCategory + '__delete\">Delete? </label>';\n//\tcategoryDiv += '<input type=\"hidden\" value=\"0\" name=\"metaphor[categories_attributes][' + nextMetaphorCategory + '][_delete]\"/>';\n//\tcategoryDiv += '<input id=\"metaphor_categories_attributes_' + nextMetaphorCategory + '__delete\" type=\"checkbox\" value=\"1\" name=\"metaphor[categories_attributes][' + nextMetaphorCategory + '][_delete]\"/>';\n\tcategoryDiv += '<input id=\"metaphor_categories_attributes_' + nextMetaphorCategory + '_clear\" type=\"checkbox\" value=\"0\" name=\"metaphor_categories_attributes_' + nextMetaphorCategory + '_clear\" onclick=\"clearAndHideMetaphorCategory(' + nextMetaphorCategory + ')\"/>';\n\tcategoryDiv += '</div>';\n\t$('#categoryList').append(categoryDiv);\n}", "title": "" }, { "docid": "b47e83ad3859e747696062ad162422e7", "score": "0.53436786", "text": "getCategory() { return Modifier.CATEGORY; }", "title": "" }, { "docid": "5ac0ac0bb542cc0fa2c4ece207c9d8bc", "score": "0.5336192", "text": "function addCategory(categoryId, categoryName) {\n\tlet category = new Category(categoryId, categoryName);\n categories.push(category);\n localStorage.setItem('categories', JSON.stringify(categories));\n // console.log(categories, categories.length);\n}", "title": "" }, { "docid": "77bb7175fd4788f4879e22c7cf5d760a", "score": "0.5329892", "text": "function insertSlide(kind)\n{\n var editfrm = document.getElementById(\"editWindow\");\n\n if (!editfrm)\n alert(\"couldn't find editor iframe object\");\n\n if (kind == \"title\")\n editfrm.src =\"/xwiki/presentation/title.html\";\n else if (kind == \"regular\")\n editfrm.src = \"/xwiki/presentation/regular.html\";\n\n // set selection field back to \"insert slide\"\n var select = document.getElementById(\"insert\");\n select.selectedIndex = 0;\n}", "title": "" }, { "docid": "a8c2e946d80f547483b34a39c8886e0f", "score": "0.5319882", "text": "function newItem(){\n sendRequest(\n 'articles',\n {\n 'action': 'getNewItemForm',\n \"id_menucategory\": $('#kategoria').val(),\n 'lang': $('#kategoria').find(\"option:selected\").parent().attr('title')\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n initTinyMce();\n initDatepickers();\n });\n}", "title": "" }, { "docid": "a07cc649b033bd4bba93624b14b7890f", "score": "0.53153735", "text": "newCategory(name) {\n let newcat = new Category(name);\n this._categoriesList.push(newcat);\n return newcat;\n }", "title": "" }, { "docid": "5fef863daf2505100b5d868e4ba7f0f0", "score": "0.531215", "text": "function onOpenEditCategory(divName) {\n var editCategoryDialog = document.getElementById('editCategoryDialog');\n editCategoryDialog.className = divName;\n // Fills Category name with existing one\n var editCategoryInput = document.getElementById(\"edit-category-name\");\n editCategoryInput.value = divName;\n\n editCategoryDialog.showModal();\n}", "title": "" }, { "docid": "bc7f1626979791829b4cec0239830758", "score": "0.5311689", "text": "function removeCategory() {\n\t$j( \"#editbox_category_enable\" ).hide();\n\tcategoryDone( '', '', false );\n}", "title": "" }, { "docid": "13435100c6bdc17206943e04c0cfda45", "score": "0.5305685", "text": "function insertNode(newNode) {\n try {\n var n, newText, offset;\n\n switch (this.startContainer.nodeType) {\n case Node.CDATA_SECTION_NODE:\n case Node.TEXT_NODE:\n newText = this.startContainer.splitText(this.startOffset);\n this.startContainer.parentNode.insertBefore(newNode, newText);\n break;\n default:\n if (this.startContainer.childNodes.length == 0) {\n offset = null;\n } else {\n offset = this.startContainer.childNodes(this.startOffset);\n }\n this.startContainer.insertBefore(newNode, offset);\n }\n } catch (e) {}\n }", "title": "" }, { "docid": "96c93736707d70dfd3743340d40895a6", "score": "0.5302199", "text": "insertNode(editor, node) {\n editor.insertNode(node);\n }", "title": "" }, { "docid": "465e1afa0d5668e208a2d06b518d3d78", "score": "0.5256017", "text": "function setCategory(selection, count) {\n\t\tchosenCategory = selection; // set global category to user's selection\n\t\tdocument.querySelector(\"#categoryMenu\").innerText = selection;\n\t\tdocument.querySelector(\"#categoryMenu + .dropdownList\").classList.toggle(\"show\");\n\t\tconsole.log(\"you clicked \" + selection);\n\t\t// document.querySelector('.questionCount').innerHTML = topicDataFilteredCategory[progressCounter].length + ' Questions'; // total number of questions\n\t\t// attach opening and closing tag to each topic captured from JSON\n\t\tvar u = []; // will hold unique categories\n\t\tvar location = topicData[topicPosition]['questions'];\n\t\tvar categoryCounter = 0;\n\t\tfor(var i = 0; i < location.length; i++) {\n\t\t\tif (location[i]['category'] == chosenCategory) {\n\t\t\t\tcategoryCounter++;\n\t\t\t}\n\t\t}\n\t\tif (chosenCategory == 'All') {\n\t\t\tdocument.querySelector('.questionCount').innerHTML = location.length + ' Questions';\n\t\t} else {\n\t\t\tdocument.querySelector('.questionCount').innerHTML = categoryCounter + ' Questions'; // total number of questions\n\t\t}\n\n\t}", "title": "" }, { "docid": "fcdeeeabba69ff4c2a90033a64c4977a", "score": "0.5249011", "text": "function showCategory(index, value) {\n var category = '<option value=\"' + value + '\">' + value + '</option>';\n jQuery('#categories').append(category);\n}", "title": "" }, { "docid": "2372f3f8d6954815fb28e111bbc62b28", "score": "0.5243864", "text": "submitNewCategory(event) {\n\t\tevent.preventDefault();\n\n\t\tconst name = ReactDOM.findDOMNode(this.refs.categoryNameInput).value.trim();\n\n\t\tMeteor.call('categories.insert', name, this.props.catType);\n\n\t\tReactDOM.findDOMNode(this.refs.categoryNameInput).value = '';\n\t}", "title": "" }, { "docid": "0e9505611dc44e6008f590568c390d75", "score": "0.5229042", "text": "function categorySelect(category) {\r\n document.getElementById(\"categoryheading\").innerHTML = document.getElementById(\"category\").option;\r\n}", "title": "" }, { "docid": "066cbda61dc144b860abdf7284ba080a", "score": "0.5225223", "text": "function insertSubCategory(id_category, sub_cat_name) {\n \n var db = getDatabase();\n var res = \"\";\n \n db.transaction(function(tx) {\n var rs = tx.executeSql('INSERT INTO sub_category (id_category, sub_cat_name) VALUES (?,?);', [id_category, sub_cat_name]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n \n return res;\n }", "title": "" }, { "docid": "9b69ca7e4ce130bd7bbad29acf27ef3f", "score": "0.52189445", "text": "'categories.insert'(title, body, isPrivate) {\n\n check(title, String);\n check(body, String);\n check(isPrivate, Boolean);\n\n if(! Meteor.userId()) {\n throw new Meteor.Error('insert-access-not-authorized');\n }\n\n Categories.insert({\n title,\n body,\n createdAt: new Date(),\n owner: Meteor.userId(),\n username: Meteor.user().username,\n private: isPrivate,\n editing: false,\n });\n }", "title": "" }, { "docid": "be8c0da1a5876d345f2fe1b8adf1cc5b", "score": "0.52168024", "text": "function startAddCategory(){\n vm.showSearch = false;\n vm.showCreateCategory = true;\n}", "title": "" }, { "docid": "d3bde1588d12d25643d7cbbcf42dfd06", "score": "0.5210179", "text": "function enableCategory() {\n\t$j( \"#editbox_category_enable\" ).hide();\n\tformEditReposition();\n\t$j( \"#editbox_category_setorselect\" ).show();\n}", "title": "" }, { "docid": "19d174e80e674eefac087286347c89cd", "score": "0.5206218", "text": "function getSelectedCategory(){\n\treturn categoryPane.getSelectionModel().getSelectedNode();\n}", "title": "" }, { "docid": "c03a4e802a6f6d36ea7a6febb9c3051a", "score": "0.5203922", "text": "insertText(editor, text) {\n editor.insertText(text);\n }", "title": "" }, { "docid": "c243f7262d12193a80f3e83b00b038cb", "score": "0.520314", "text": "function appendToDOM(item) {\n // item either goes into categories or into the right window\n const rightWindow = document.querySelector(\".right-window\");\n const categoryWindow = document.querySelector(\".categories-container\");\n // if its a todo object move it into the right window\n if (item.className === \"todo-object\") {\n rightWindow.appendChild(item);\n } else if (item.className === \"tag\") {\n categoryWindow.appendChild(item);\n } else {\n console.log(\"This shouldn't run\");\n }\n}", "title": "" }, { "docid": "966f385e667972b15ef75c040cbee4c7", "score": "0.5190097", "text": "function insertNewSubCategory(subCatName,idCategory){\n\n insertSubCategory(idCategory, subCatName);\n }", "title": "" }, { "docid": "50619a5d81b15d296e6ea9476b77ccad", "score": "0.5186015", "text": "function add_categorypreview_task( category, timestamp ) {\n\t// Remove the first part before the colon\n\tcategory = category.split( ':' );\n\tcategory.shift();\n\tcategory = category.join( ':' );\n\n\tif ( timestamp === '' ) {\n\t\t// No timestamp, no point in looking further\n\t\treturn;\n\t}\n\n\tfor ( var i = 0; i < gp_avoid_cats.length; i++ ) {\n\t\tvar s = gp_avoid_cats[i];\n\t\tif ( category.substr( 0, s.length ) === s ) return;\n\t}\n\n\tvar url = mw.util.wikiScript( 'api' ) + '?' + $.param({\n\t\tformat: 'xml',\n\t\taction: 'query',\n\t\tlist: 'categorymembers',\n\t\tcmlimit: 500,\n\t\tcmnamespace: 6,\n\t\tcmprop: 'ids|title|timestamp',\n\t\tcmtitle: 'Category:' + category\n\t});\n\ti = gp_xmlobjects.length;\n\tgp_left = gp_left + 1;\n\tgp_found = true;\n\tgp_xmlobjects.push( new XMLHttpRequest() );\n\tgp_xmlobjects[i].gallery = '';\n\tgp_xmlobjects[i].category = category;\n\tgp_xmlobjects[i].timestamp = timestamp;\n\tgp_xmlobjects[i].onreadystatechange = categorypreview_callback;\n\tgp_xmlobjects[i].running = true;\n\tgp_xmlobjects[i].open( 'GET', url, true );\n\tgp_xmlobjects[i].send( null );\n}", "title": "" }, { "docid": "1e9299394ed92d9ece1ec282eb46ea84", "score": "0.5183762", "text": "function addLanguageBox(language) {\n $('#languages').append(\n \"<div class='language' id='\" + currId + \"'><span>\" + language + \"</span><i class='material-icons tiny' onclick='remove(\" + currId + \")'>close</i></div>\"\n );\n}", "title": "" }, { "docid": "a3e510c6b8f719d872ee39d66fdd9d42", "score": "0.51797754", "text": "function categoriaController() {}", "title": "" }, { "docid": "80b539bdf19e426cc482b922502e53ff", "score": "0.51683277", "text": "showEditCategoriesModal() {\n this.props.dispatch({type: LocationActions.ActionTypes.LOCATION.SHOW_LOCATION_EDIT_CATEGORY_MODAL,\n actionType: 'add'});\n }", "title": "" }, { "docid": "3ce8a537d7e7a533e8facb3e4058fb31", "score": "0.51660776", "text": "async pushCategory({ commit }, payload) {\n commit(FETCHING_RESOURCES)\n const { category, cb } = payload || {}\n\n try {\n let response = null\n if (category.id) {\n response = await axios.put('/categories/'+category.id, category)\n } else {\n response = await axios.post('/categories', category)\n }\n commit(FETCHING_RESOURCES_DONE)\n cb && cb(response.data.data)\n } catch (err) {\n commit(FETCHING_RESOURCES_FAIL, err)\n }\n }", "title": "" }, { "docid": "b68b29049bbf40b863073077aa1be9e5", "score": "0.51640636", "text": "function chooseCategory() {\n // loop over category buttons add event listeners\n categoryButtons.forEach(function (button) {\n button.addEventListener('click', function (e) {\n // update value of selectedCategory\n selectedCategory = e.target.attributes[0].nodeValue;\n\n fadeOutCategoryWrapper(); // calls fadeOutCategoryWrapper()\n\n fadeInPlayingField(); // calls fadeInPlayingField()\n\n useCategoryTitle(); // calls useCategoryTitle()\n useRandomWord(); // calls useRandomWord()\n });\n });\n}", "title": "" }, { "docid": "ecee9098fc0ec9ba673e50d0733ebb48", "score": "0.51559365", "text": "function Window_ItemCategory() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "bc0156b9420c2c139bbea2cb4a449135", "score": "0.5149222", "text": "function insertContent() {\n detectPlugin('rasantrfile');\n if ($('#rasantrfile').val() !== '') {\n var container = '<div class=\"mceNonEditable pluginContainer antrfilePlugin antrfile' + align + '\" data-antrfile-plugin=\"1\"><div class=\"mceEditable\">';\n container += '<p>' + $('#rasantrfile').val() + '</p>';\n container += '</div></div>';\n\n container += '<br />';\n\n //this \"hack\" is to make tiny place cursor after plugin placeholder\n //container += '<p class=\"afterPluginSpace\"><span>aaa</span></p>';\n\n editorGlobal.insertContent(container);\n }\n popup.close();\n }", "title": "" }, { "docid": "f7f8534fd58f73e71e5d936404efd8be", "score": "0.5145274", "text": "function addCategoria(i, data) {\n let div = document.querySelector(\".theMenu\");\n let col = document.createElement(\"div\");\n col.className = \"col-xl-2 col-lg-2 col-md-2 col-sm-2 col-2\";\n let categoriaButton = document.createElement(\"button\");\n categoriaButton.className = \"btn menuItem\";\n categoriaButton.id = data[\"name\"];\n categoriaButton.innerHTML = data[\"name\"];\n categoriaButton.onclick = function () {\n cambiarCategoria(i, data);\n };\n\n col.appendChild(categoriaButton);\n div.appendChild(col);\n}", "title": "" }, { "docid": "d82cb484daa7d2bb3d5aa079d5a8416c", "score": "0.5143565", "text": "function addNewCat(newCat){\n let cat = new NewCategory(newCat, 0);\n arrCategory.push(cat);\n localStorage.setItem('ahCategories', JSON.stringify(arrCategory));\n }", "title": "" }, { "docid": "9bfcfc17a3511bd1a935fe6a4d3c1578", "score": "0.514086", "text": "openCategory(e) {\n let id = e.currentTarget.id;\n $(\"#categorylist li\").removeClass(\"active\");\n $(e.currentTarget).addClass(\"active\");\n let category = this[getCategoryById](id);\n\n super.notifyObservers(\"printCatItems\", category);\n }", "title": "" }, { "docid": "be4a9993432b5064076356d5c4b6efe3", "score": "0.5138705", "text": "function doDisplayCategory(selected)\r\n{\r\n\tlocation=selected;\r\n}", "title": "" }, { "docid": "b790713891391e2c80054036fa210ebd", "score": "0.5135462", "text": "function selectCatFromTree() {\n\tabWasteDefCatProController.abWasteDefProForm.show(false);\n\tvar curTreeNode = View.panels.get(\"abWasteDefCatProTree1\").lastNodeClicked;\n\tcurTreeNode.expand();\n\tvar category = curTreeNode.data['waste_categories.waste_category'];\n\tabWasteDefCatProController.category=category;\n\tvar catForm=abWasteDefCatProController.abWasteDefCatForm;\n\tcatForm.clear();\n\tcatForm.newRecord = false;\n\tvar restriction = new Ab.view.Restriction();\n\n\t//restriction record which has been clicked apply to details panel\n\trestriction.addClause('waste_categories.waste_category', category);\n\tcatForm.refresh(restriction);\n\n}", "title": "" }, { "docid": "db89ee52c7cd478657c0d0804b0ec902", "score": "0.51318693", "text": "function insertGlossaryTerm(_term, _definition){\n\tvar glossarySource;\n\tif(courseGlossary){\n\t\tglossarySource = $(courseData);\n\t}else{\n\t\tglossarySource = $(data);\n\t}\n\tvar noError = true;\n\tvar isLast = true;\n\tvar term = _term.toLowerCase();\n\tvar insertPoint = 0;\n\tvar isOnly = false;\n\tvar totalGlossary = glossarySource.find('glossaryitem').length;\n\tif(totalGlossary != 0){\n\t\tfor(var i = 0; i < totalGlossary; i++){\n\t\t\tvar testTerm = glossarySource.find('glossaryitem').eq(i).find('term').text().toLowerCase();\n\t\t\tinsertPoint = i;\n\t\t\tif(term < testTerm){\n\t\t\t\tisLast = false;\n\t\t\t\tbreak;\n\t\t\t}else if(term == testTerm){\n\t\t\t\tnoError = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tisOnly = true;\n\t}\t\n\t\n\t//IF doesn't exist already - create\n\tif(noError == true){\n\t\tif(isOnly == true){\n\t\t\tglossarySource.find(\"glossary\").append($('<glossaryitem>'));\n\t\t\t//Place the page title element\n\t\t\tglossarySource.find(\"glossaryitem\").eq(0).append($(\"<term>\"));\n\t\t\tvar newGlossaryTerm = new DOMParser().parseFromString('<term></term>', \"application/xml\");\n\t\t\tvar termCDATA = newGlossaryTerm.createCDATASection(_term);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(0).find(\"term\").append(termCDATA);\n\t\t\n\t\t\tglossarySource.find(\"glossaryitem\").eq(0).append($(\"<content>\"));\n\t\t\tvar newGlossaryDef = new DOMParser().parseFromString('<content></content>', \"application/xml\");\n\t\t\tvar defCDATA = newGlossaryDef.createCDATASection(_definition);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(0).find(\"content\").append(defCDATA);\n\t\t}else if(isLast == true){\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).after($('<glossaryitem></glossaryitem>'));\n\t\t\t//Place the page title element\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint + 1).append($(\"<term>\"));\n\t\t\tvar newGlossaryTerm = new DOMParser().parseFromString('<term></term>', \"application/xml\");\n\t\t\tvar termCDATA = newGlossaryTerm.createCDATASection(_term);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint + 1).find(\"term\").append(termCDATA);\n\t\t\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint + 1).append($(\"<content>\"));\n\t\t\tvar newGlossaryDef = new DOMParser().parseFromString('<content></content>', \"application/xml\");\n\t\t\tvar defCDATA = newGlossaryDef.createCDATASection(_definition);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint + 1).find(\"content\").append(defCDATA);\n\t\t}else{\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).before($('<glossaryitem></glossaryitem>'));\n\t\t\t//Place the page title element\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).append($(\"<term>\"));\n\t\t\tvar newGlossaryTerm = new DOMParser().parseFromString('<term></term>', \"application/xml\");\n\t\t\tvar termCDATA = newGlossaryTerm.createCDATASection(_term);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).find(\"term\").append(termCDATA);\n\t\t\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).append($(\"<content>\"));\n\t\t\tvar newGlossaryDef = new DOMParser().parseFromString('<content></content>', \"application/xml\");\n\t\t\tvar defCDATA = newGlossaryDef.createCDATASection(_definition);\n\t\t\tglossarySource.find(\"glossaryitem\").eq(insertPoint).find(\"content\").append(defCDATA);\n\t\t}\n\t\t\n\t\t//When done - update content.xml on the server.\n\t\tif(courseGlossary){\n\t\t\tsendCourseUpdate();\n\t\t}else{\n\t\t\tsendUpdateWithRefresh(\"glossary\");\n\t\t}\n\t}else{\n\t\t//Error about existing....\n\t\tvar msg = '<div id=\"dialog-addGlossaryTermError\" title=\"Term Already Exists\"><p class=\"validateTips\">This term is already entered in this glossary.</p><p>To edit this term, roll over it in the glossary list and select the edit button.</p></div>';\n\t\n\t\t//Add to stage.\n\t\t$(\"#stage\").append(msg);\n\t\n\t\t//Make it a dialog\n\t\t$(\"#dialog-addGlossaryTermError\").dialog({\n\t\t\tmodal: true,\n\t\t\twidth: 550,\n\t\t\tclose: function(event, ui){\n\t\t\t\t$(\"#dialog-addGlossaryTermError\").remove();\n\t\t\t},\n\t\t\tbuttons: {\n\t\t\t\tCancel: function () {\n $(this).dialog(\"close\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "bc0d87d4ec6942076404282305aa623f", "score": "0.51163805", "text": "function buildCategory(data) {\n const section = document.createElement(\"section\");\n const header = document.createElement(\"h1\");\n header.textContent = data;\n section.setAttribute(\"id\", data)\n section.appendChild(header);\n document.querySelector(\"main\").appendChild(section);\n}", "title": "" }, { "docid": "13d107805e070346fdb1516b200ecaf8", "score": "0.5113924", "text": "function WysiwygInsert(type, value, title, code) {\n\tif (typeof(tinyMCE) != 'undefined') {\n\t\tif (!tinyMCE.initialized) {\n\t\t\twindow.setTimeout(function() {\n\t\t\t\tWysiwygInsert(type, value, title, code);\n\t\t\t}, 500);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (type == 'smiley') tinyMCE.insertSmiley(value, title, code);\n\t\telse if (type == 'attachment') tinyMCE.insertAttachment(value);\n\t\telse if (type == 'text') tinyMCE.insertText(value);\n\t\telse if (type == 'bbcode') tinyMCE.insertBBCodes(value);\n\t}\n\telse {\n\t\t// TODO: insert plain text !? (to do this the function \"insertCode\" got to be in this default.js)\n\t}\n}", "title": "" }, { "docid": "0ec945ab46c58ebd2b1c956af46625f6", "score": "0.51121676", "text": "addCategory(addAfter){\n let newKey = `${cKey()}`;\n let new_storage = {};\n for( let kat in this.storage.checklist_items ){\n new_storage[kat] = this.storage.checklist_items[kat]\n if( kat == addAfter ) new_storage[newKey] = { title: newKey, items:[] }\n }\n this.storage.checklist_items = new_storage;\n this.save();\n return newKey;\n }", "title": "" }, { "docid": "1e17c4162171e081161205810b7588e6", "score": "0.51038235", "text": "function insertPopupItem(ed, popupItem) {\n\t let label = popupItem.label;\n\t let preLabel = popupItem.preLabel;\n\t let text = popupItem.text;\n\n\t let cur = ed.getCursor();\n\t let textBeforeCursor = ed.getText(cur.line).substring(0, cur.ch);\n\t let backwardsTextBeforeCursor = textBeforeCursor.split(\"\").reverse().join(\"\");\n\t let backwardsPreLabel = preLabel.split(\"\").reverse().join(\"\");\n\n\t // If there is additional text in the preLabel vs the line, then\n\t // just insert the entire autocomplete text. An example:\n\t // if you type 'a' and select '#about' from the autocomplete menu,\n\t // then the final text needs to the end up as '#about'.\n\t if (backwardsPreLabel.indexOf(backwardsTextBeforeCursor) === 0) {\n\t ed.replaceText(text, { line: cur.line, ch: 0 }, cur);\n\t } else {\n\t ed.replaceText(text.slice(preLabel.length), cur, cur);\n\t }\n\t}", "title": "" }, { "docid": "8703dc054fb840718ba9bb712c0b0b19", "score": "0.5103277", "text": "function insertTab(owner, widget, ref, after) {\r\n\t // Ensure the insert args are valid.\r\n\t validateInsertArgs(owner, widget, ref);\r\n\t // If the widget is the same as the ref, there's nothing to do.\r\n\t if (widget === ref) {\r\n\t return;\r\n\t }\r\n\t // Unparent the widget before performing the insert. This ensures\r\n\t // that structural changes to the dock panel occur before searching\r\n\t // for the insert location.\r\n\t widget.parent = null;\r\n\t // Find the index and tab panel for the insert operation.\r\n\t var index;\r\n\t var tabPanel;\r\n\t if (ref) {\r\n\t tabPanel = findTabPanel(ref);\r\n\t index = tabPanel.childIndex(ref) + (after ? 1 : 0);\r\n\t }\r\n\t else {\r\n\t tabPanel = ensureFirstTabPanel(owner);\r\n\t index = after ? tabPanel.childCount() : 0;\r\n\t }\r\n\t // Insert the widget into the tab panel at the proper location.\r\n\t tabPanel.insertChild(index, widget);\r\n\t }", "title": "" }, { "docid": "b312878ca3322f551aee6c637d4c2dd0", "score": "0.5099518", "text": "postCategory(category) {\n this.postData(category);\n }", "title": "" }, { "docid": "157357154f9fe82cea0e39570ae472d3", "score": "0.50931907", "text": "function addTermToCluster(clusterName) {\r\n saveLog(\"addTermToCluster\");\r\n\r\n var term = prompt(\"Add new term:\");\r\n\r\n if(term != null) {\r\n\r\n $('#selectable').selectable({ \r\n cancel: '.ui-selected' \r\n });\r\n\r\n // check if the term exists or not\r\n var terms = document.getElementById(clusterName).getElementsByClassName(\"sortable\");\r\n\r\n if(!termExists($(terms).children(), term)) {\r\n $(terms).append(\r\n \"<li class='ui-state-default ui-sortable-handle' onmousedown=\\\"wordMouseDown(event)\\\"><span class='terms'>\"+term+\"</span></li>\");\r\n }\r\n else {\r\n alert(\"This cluster already have \\\"\"+term+\"\\\"\");\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "0274c9bc3dddc0c012c87e1aff201679", "score": "0.506806", "text": "function makeCategory() {\n\t\tvar selectLi = ElId('select'),\n\t\t\tcreateSelect = document.createElement('select');\t\n\t\tcreateSelect.setAttribute(\"id\", \"categories\");\n\t\tfor (var i = 0, j = billCategories.length; i < j; i++) {\n\t\t\tvar makeOption = document.createElement('option'),\n\t\t\t\toptText = billCategories[i];\n\t\t\tmakeOption.setAttribute(\"value\", optText);\n\t\t\tmakeOption.innerHTML = optText;\n\t\t\tcreateSelect.appendChild(makeOption);\n\t\t}\n\t\tselectLi.appendChild(createSelect);\n\t}", "title": "" }, { "docid": "835b0a26dccfd4c4adf06222b13a24d1", "score": "0.5065733", "text": "function addNewSection() {\n section.addNewSection();\n menu.buildMenu();\n}", "title": "" }, { "docid": "e9da50ca31ae45d0be2260322756a90f", "score": "0.50580156", "text": "function openEditCategoryDialog(catID){\r\n\t\t\r\n\t\tif(catID == -1)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar cat = getCatByID(catID);\r\n\t\t\r\n\t\tif(cat.length == 0){\r\n\t\t\ttrace(\"category with id: \" + catID + \" don't exists\");\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\t\r\n\t\tif(jQuery.isNumeric(catID) == false)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\t//set data\r\n\t\tvar dialogEdit = jQuery(\"#uc_dialog_edit_category\");\r\n\t\tvar isCustom = dialogEdit.data(\"custom\");\r\n\t\t\t\r\n\t\tdialogEdit.data(\"catid\", catID);\r\n\t\t\r\n\t\t//update catid field\t\t\r\n\t\tif(!isCustom){\r\n\t\t\tjQuery(\"#span_catdialog_id\").html(catID);\r\n\t\t\t\r\n\t\t\tvar title = cat.data(\"title\");\r\n\t\t\tjQuery(\"#uc_dialog_edit_category_title\").val(title).focus();\r\n\t\t}\r\n\t\t\r\n\t\tvar options = {\r\n\t\t\t\tminWidth: 900\r\n\t\t};\r\n\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#uc_dialog_edit_category\", function(){\r\n\t\t\t\r\n\t\t\tif(!isCustom)\r\n\t\t\t\tjQuery(\"#uc_dialog_edit_category_title\").select();\r\n\t\t\telse{\r\n\t\t\t\tt.events.onOpenCategoryDialog(dialogEdit, catID);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},options);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "bd269a0850a63347016fa4cfc31b43b5", "score": "0.50577015", "text": "function setCategory (socket, category) {\n\n\t\tif (questions.categories.includes(category)) {\n\n\t\t\tround.category = category;\n\t\t\tevents.showCategory(io, category);\n\n\t\t} else {\n\t\t\tevents.err(socket, `Invalid category: ${category}.`);\n\t\t}\n\n\t}", "title": "" }, { "docid": "cfe13ebaef7f15ea776179e55d837f3c", "score": "0.5054495", "text": "saveCategory() {\n if ( !this.validInputs ) {\n return;\n }\n\n if ( -1 == this.props.editCategoryIndex ) {\n // If no category is being edited (editCategoryIndex == -1)\n // then the action is adding a category\n this.addCatgory();\n } else {\n // If a category is being edited (editCategoryIndex 1= -1)\n // then the action is editing a category\n this.editCategory();\n }\n\n this.props.dispatch({type: CategoryActions.ActionTypes.CATEGORY.HIDE_ADD_EDIT_MODAL_DIALOG});\n }", "title": "" }, { "docid": "697cf73f1d42fd5f43b8111c97a1384e", "score": "0.5051823", "text": "function addItem(newItem) {\n const newItemConfig = {\n title: newItem.title,\n type: 'component',\n componentName: newItem.name,\n componentState: newItem\n };\n let items = myLayout.root.getComponentsByName(newItem.name);\n // If this block is already open, don't open another one\n if (items.length === 0) {\n myLayout.root.contentItems[0].addChild(newItemConfig);\n }\n}", "title": "" }, { "docid": "d3d53f67ac45f473428f8d527b22cb8f", "score": "0.50459856", "text": "function openDeleteCategoryDialog(catID){\r\n\t\t\r\n\t\tif(catID == -1)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\tvar cat = getCatByID(catID);\r\n\t\t\r\n\t\tif(cat.length == 0){\r\n\t\t\ttrace(\"category with id: \" + catID + \" don't exists\");\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\t\r\n\t\t//set data\r\n\t\tvar dialogDelete = jQuery(\"#uc_dialog_delete_category\");\r\n\t\tdialogDelete.data(\"catid\", catID);\r\n\t\t\r\n\t\tvar title = cat.data(\"title\");\r\n\t\t\r\n\t\tjQuery(\"#uc_dialog_delete_category_catname\").html(title);\r\n\t\t\r\n\t\tg_ucAdmin.openCommonDialog(\"#uc_dialog_delete_category\");\r\n\t\t\r\n\t}", "title": "" }, { "docid": "4c6e5dd30963b55f020303e32ecb1047", "score": "0.5039547", "text": "function mostrarFomularioNuevaCategoria() {\n setCrearCategoria(true);\n }", "title": "" }, { "docid": "1f27429ad6912ebe08fa0853f7f56302", "score": "0.50298023", "text": "function insertTab(owner, widget, ref, after) {\n // Ensure the insert args are valid.\n validateInsertArgs(owner, widget, ref);\n // If the widget is the same as the ref, there's nothing to do.\n if (widget === ref) {\n return;\n }\n // Unparent the widget before performing the insert. This ensures\n // that structural changes to the dock panel occur before searching\n // for the insert location.\n widget.parent = null;\n // Find the index and tab panel for the insert operation.\n var index;\n var tabPanel;\n if (ref) {\n tabPanel = findTabPanel(ref);\n index = tabPanel.childIndex(ref) + (after ? 1 : 0);\n }\n else {\n tabPanel = ensureFirstTabPanel(owner);\n index = after ? tabPanel.childCount() : 0;\n }\n // Insert the widget into the tab panel at the proper location.\n tabPanel.insertChild(index, widget);\n }", "title": "" }, { "docid": "803fd1156cf433828591f10fe11971d4", "score": "0.5028504", "text": "function useCategoryTitle() {\n selectedCategoryTitle = categories[selectedCategory].title;\n selectedCategoryWrapper.children[1].innerText = selectedCategoryTitle;\n}", "title": "" }, { "docid": "7a118d60809a4497f4465180fc39a5b4", "score": "0.5022168", "text": "function addTagArea(e, batch) {\n // TODO: Test for potential XSS - is this escaped and if it is, where?\n\n // Check if we have a jQuery object or a numeric ID\n var id;\n if (e.hasOwnProperty('target')) {\n id = e.target.id.substring(11); // \"addTagArea-\".length == 11\n } else {\n id = e;\n }\n\n // Create the tag area for the relevant classification ID\n var name = arca.classifications[id].title;\n $('#tagAreaMiddle').append(\n '<div id=\"tagArea-' + id + '\" class=\"tagAreaSection\">' +\n '<span class=\"tagAreaTitle\">' + name + '</span>' +\n '<a href=\"javascript:removeTagArea(' + id + ')\" class=\"removeTagArea\">X</a>' +\n '<input class=\"childTags\" id=\"childTags-' + id + '\" name=\"childTags-' + id + '\" />' +\n '</div>'\n );\n $('#tagArea-' + id).click(selectTagArea);\n\n // Enable tag input on the element\n $('#childTags-' + id).tagsInput({\n interactive: false,\n width: '95%',\n height: '30px',\n onRemoveTag: updateTagMenu\n });\n\n // Select the given tag area\n if (!batch) {\n selectTagArea(id);\n }\n\n // Hide the tag area adding button for the ID\n $('#addTagArea-' + id).hide();\n}", "title": "" }, { "docid": "7c8e1dc6e098f716fa38478eed722b89", "score": "0.50201815", "text": "click() {\n this.sendAction('actionClick', this.get('category'));\n }", "title": "" } ]
1d522ce66fc4ad60d0c2f957493fb149
16. Linear equation is calculated as follows: ax + b = c. Write a function which calculates value of a linear equation, solveLinEquation.
[ { "docid": "940d8f00187c8b5e0534de9400fe6aa8", "score": "0.75193465", "text": "function solveLinEquation(a, b, c) {\n let x = (c - b) / a;\n return x;\n}", "title": "" } ]
[ { "docid": "32a52936a2836382a4b6b28b7434cd5c", "score": "0.8227029", "text": "function solveLinEquation(a=1,b=1,c=1)\n{\n return -c/a;\n}", "title": "" }, { "docid": "b23adcfe86ce139f24935fb0137867b3", "score": "0.70873505", "text": "function solveLinearEquation (a, b, c){\n\treturn ((b - c) / a);\n}", "title": "" }, { "docid": "1733234d5385efc98b36270f3ccb666f", "score": "0.6717358", "text": "function linearSolve(a, b) {\n return [-b / a];\n}", "title": "" }, { "docid": "2ecf2d922be0560105e52a9798ac8152", "score": "0.66049814", "text": "function calc_linLSQ_line(data) {\n let N=numeric.dim(data)[0]; //Number of data points\n let x=squeeze_to_vector(numeric.getBlock(data,[0, 0],[N-1, 0])); //Extract x (dependent) values\n let y=squeeze_to_vector(numeric.getBlock(data,[0, 1],[N-1, 1])); //Extract y (target) values\n //Note: x and y are both vectors, use them accordingly.\n //(For this homework x is a vector, but generally speaking it may not be!)\n\n //Setup matrices/vectors for calculation\n let A=numeric.rep([N,2],0); //Make an empty (all zero) Nx2 matrix\n let b=numeric.rep([N],0); //Make an empty N element vector\n for(let i=0;i<N;++i) {\n /***********************\n * TASK: Fill in A and b\n *\n * Refer to slide 11 (and 10) \n *\n * Hint: BE CAREFUL of the order, what do the columns of A refer and relate to?\n ***********************/\n// parameter array p, where p[0]=b and p[1]=a\n A[i][0]=1; \n A[i][1]=x[i];\n b[i]=y[i];\n }\n\n /***********************\n * TASK: Solve for parameters\n *\n * Refer to slides 18-19\n ***********************/\n // p= Inverse((Transpose(A)*A))* (Transpose(A)*b)\n let p = numeric.dot(numeric.inv(numeric.dot(numeric.transpose(A), A)), numeric.dot(numeric.transpose(A), b))\n // console.warn(p)\n let sse=0;\n for(let i=0;i<N;++i) {\n let model_out=eval_line_func(x[i],p); //The output of the model function on data point i using\n //parameters p\n sse += Math.pow((model_out-y[i]), 2);\n\n /***********************\n * TASK: Calculate the sum of squared error\n ***********************/\n }\n helper_log_write(\"SSE=\"+sse);\n \n return p;\n}", "title": "" }, { "docid": "e97d08f9d27c29b6971a7a018f6ecdd1", "score": "0.6342318", "text": "function getLinearEquationRoot(a, b) {\n //var expr = new Expression(\"x\");\n //expr = expr.subtract(a);\n //expr = expr.add(\"x\");\n //var eq = \"2x+3\";\n //var x = eq.sloveFor(\"x\");\n //var x = new Expression(\"x\");\n //console.log(\"234\");\n}", "title": "" }, { "docid": "b57ee240783018b6ebb2acdc48f776f2", "score": "0.6270312", "text": "function solveEquation(x,y){\n\n var ans =( 100*(Math.pow((Math.pow(x,2)-(y)),2)) + (Math.pow(1-(x),2)));\n \n\n return Number(ans)\n\n}", "title": "" }, { "docid": "a1e626deddabd313af91b8f35826226e", "score": "0.6253613", "text": "function calc_linLSQ_poly(data,order) {\n let N=numeric.dim(data)[0];\n let x=squeeze_to_vector(numeric.getBlock(data,[0, 0],[N-1, 0])); //Extract x (dependent) values\n let y=squeeze_to_vector(numeric.getBlock(data,[0, 1],[N-1, 1])); //Extract y (target) values\n \n let A=numeric.rep([N,order+1],0);\n let b=numeric.rep([N],0);\n for(let i=0;i<N;++i) {\n\t\t/***********************\n * TASK: Fill in A and b\n *\n * Refer to your previous code, as well as slide 22\n *\n * Hint: In the case where order==1, this should give the same result\n * as your calc_linLSQ_line() function\n ***********************/\n\n for(let j=0; j<order+1; j++){\n A[i][j]= x[i]**j\n }\n b[i]=y[i];\n }\n \n /***********************\n * TASK: Solve for parameters and calculate SSE\n *\n * Re-use the code from your calc_linLSQ_line(), this part should be identical\n * EXCEPT use instead the provided eval_poly_func(x,p) instead of eval_line_func\n */\n // p= Inverse((Transpose(A)*A))* (Transpose(A)*b)\n let p = numeric.dot(numeric.inv(numeric.dot(numeric.transpose(A), A)), numeric.dot(numeric.transpose(A), b))\n // console.warn(p)\n let sse=0;\n for(let i=0;i<N;++i) {\n let model_out=eval_poly_func(x[i],p); //The output of the model function on data point i using\n //parameters p\n sse += Math.pow((model_out-y[i]), 2);\n /***********************\n * TASK: Calculate the sum of squared error\n ***********************/\n }\n helper_log_write(\"SSE=\"+sse);\n\n return p;\n}", "title": "" }, { "docid": "7ecb69b9cea8e3ecc1dd62fe96603f4c", "score": "0.62079734", "text": "function linear_solved(A, b) {\n var plu = plu_decomposition(A);\n var d_array = matrix_multiply(plu.P, matrix_transpose(b));\n var d = []\n for (var i = 0; i < d_array.length; i++) {\n d.push(d_array[i][0])\n }\n var y = forward_substitution(plu.L, d)\n var x = backward_substitution(plu.U, y)\n return x\n}", "title": "" }, { "docid": "f0ffe2dcf1c39e279a5b47257207d169", "score": "0.6148335", "text": "function solveEquation(equation) {\n let arr = [], a, b, c, x1, x2, newArr = [];\n equation = equation.replace(/x/g, \"\");\n equation = equation.replace(\"^2\", \"\");\n equation = equation.replace(/\\*/g, \"\");\n \n arr = equation.split(/\\s+/);\n let len = arr.length;\n if(arr[0] == \"\") {\n arr[0] = 1;\n }\n else {\n arr[0] *= 1;\n }\n \n for(let i = 0; i < len; i++) {\n if (arr[i] == \"-\") {\n arr[i+1] *= -1;\n arr.splice(i, 1);\n }\n else if (arr[i] == \"+\") {\n arr[i+1] *= 1;\n arr.splice(i, 1);\n }\n }\n a = arr[0]; b = arr[1]; c = arr[2];\n \n let D = b*b - 4*(a*c);\n D = Math.sqrt(D);\n \n x1 = (-1*b - D)/(2*a);\n x2 = (-1*b + D)/(2*a);\n \n newArr[0] = Math.round(x1);\n newArr[1] = Math.round(x2);\n\n return newArr;\n\n}", "title": "" }, { "docid": "f4757778794163924e8283c3c5fd4b73", "score": "0.59737116", "text": "function solveEquation(a, b, c) {\n if (isNaN(a) || isNaN(b) || isNaN(c)) {\n return 'Not a number';\n } else {\n a = +a;\n b = +b;\n c = +c;\n var delta = (b * b) - (4 * a * c);\n var deltaIsZero = (delta === 0);\n var deltaIsPositive = (delta > 0);\n if (deltaIsZero) {\n return ('x = ' + ((b * -1) / (2 * a)));\n }\n else if (deltaIsPositive) {\n return ('x1 = ' + ((b * -1) + Math.sqrt(delta)) / (2 * a) +\n ' x2 = ' + (((b * -1) - Math.sqrt(delta)) / (2 * a)));\n }\n else {\n return 'No real roots.';\n }\n }\n}", "title": "" }, { "docid": "e2e5e982c9ec8f0c39a8868effbc9d08", "score": "0.58532983", "text": "function eChangeVariablesLinear(p, a, b) {\n // We let the coefficients of p(ax + b) be denoted by d_i in the code below. \n // d_i is calculated as d = T*c, where c are the original coefficients.\n const d = p.length - 1;\n if (d < 0) {\n return [];\n }\n // Initialize a zero matrix\n const t = [];\n for (let i = 0; i < d + 1; i++) {\n t.push(new Array(d + 1).fill([0]));\n }\n // Calculate the triangular matrix T\n t[0][0] = [1];\n for (let j = 1; j <= d; j++) {\n t[0][j] = e_change_variables_linear_scaleExpansion2(b, t[0][j - 1]);\n for (let i = 1; i <= j; i++) {\n t[i][j] = e_change_variables_linear_fastExpansionSum(e_change_variables_linear_scaleExpansion2(b, t[i][j - 1]), e_change_variables_linear_scaleExpansion2(a, t[i - 1][j - 1]));\n }\n }\n // Multiply\n const res = new Array(d + 1).fill([0]);\n for (let i = 0; i <= d; i++) {\n res[d - i] = [0];\n for (let j = i; j <= d; j++) {\n const acc = e_change_variables_linear_expansionProduct(t[i][j], p[d - j]);\n res[d - i] = e_change_variables_linear_fastExpansionSum(res[d - i], acc);\n }\n }\n return res;\n}", "title": "" }, { "docid": "531429ece804fb3f36c17f980f0b568b", "score": "0.5842456", "text": "function solve()\r\n{\r\n equation = eval(equation);\r\n document.getElementById(\"result\").value = equation;\r\n}", "title": "" }, { "docid": "fb09746b1a4be8c29dc6e95caf6aa727", "score": "0.5794286", "text": "function solveQuadraticEquation (a,b,c) {\n var D = (Math.pow(b,2)) - (4*a*c);\n var x1 = ((-b) - (Math.sqrt((Math.pow(b,2)) - (4*a*c))))/(2*a);\n var x2 = ((-b) + (Math.sqrt((Math.pow(b,2)) - (4*a*c))))/(2*a);\n\n if (D<0){\n console.log('no real roots');\n }\n else if (D===0){\n console.log('x1=x2=', x1);\n }\n else {\n console.log('x1=' + x1 + ';' + 'x2=' + x2);\n }\n}", "title": "" }, { "docid": "459fa84019da6111de4e28b1de54d855", "score": "0.5731612", "text": "function solve( A, b ) {\n\t/* Solve the linear system Ax = b\t*/\n\n\tvar tA = type(A);\n\n\tif ( tA == \"vector\" || tA == \"spvector\" || (tA == \"matrix\" && A.m == 1) ) {\n\t\t// One-dimensional least squares problem:\n\t\tvar AtA = mul(transpose(A),A);\n\t\tvar Atb = mul(transpose(A), b);\n\t\treturn Atb / AtA;\n\t}\n\n\tif ( tA == \"spmatrix\" ) {\n\t\t/*if ( A.m == A.n )\n\t\t\treturn spsolvecg(A, b); // assume A is positive definite\n\t\telse*/\n\t\treturn spcgnr(A, b);\n\t}\n\n\tif( type(b) == \"vector\" ) {\n\t\tif ( A.m == A.n )\n\t\t\treturn solveGaussianElimination(A, b) ;\n\t\telse\n\t\t\treturn solveWithQRcolumnpivoting(A, b) ;\n\t}\n\telse\n\t\treturn solveWithQRcolumnpivotingMultipleRHS(A, b) ; // b is a matrix\n}", "title": "" }, { "docid": "3cbf5230c3c1a5df9e97d36f8797b5d8", "score": "0.5643907", "text": "function calcLinear(data, x, y, minX, minY){\r\n/////////\r\n//SLOPE//\r\n/////////\r\n\r\n// Let n = the number of data points\r\nvar n = data.length;\r\n\r\n// Get just the points\r\nvar pts = [];\r\ndata.forEach(function(d,i){\r\n var obj = {};\r\n obj.x = d[x];\r\n obj.y = d[y];\r\n obj.mult = obj.x*obj.y;\r\n pts.push(obj);\r\n});\r\n\r\n// Let a equal n times the summation of all x-values multiplied by their corresponding y-values\r\n// Let b equal the sum of all x-values times the sum of all y-values\r\n// Let c equal n times the sum of all squared x-values\r\n// Let d equal the squared sum of all x-values\r\nvar sum = 0;\r\nvar xSum = 0;\r\nvar ySum = 0;\r\nvar sumSq = 0;\r\npts.forEach(function(pt){\r\n sum = sum + pt.mult;\r\n xSum = xSum + pt.x;\r\n ySum = ySum + pt.y;\r\n sumSq = sumSq + (pt.x * pt.x);\r\n});\r\nvar a = sum * n;\r\nvar b = xSum * ySum;\r\nvar c = sumSq * n;\r\nvar d = xSum * xSum;\r\n\r\n// Plug the values that you calculated for a, b, c, and d into the following equation to calculate the slope\r\n// slope = m = (a - b) / (c - d)\r\nvar m = (a - b) / (c - d);\r\n\r\n/////////////\r\n//INTERCEPT//\r\n/////////////\r\n\r\n// Let e equal the sum of all y-values\r\nvar e = ySum;\r\n\r\n// Let f equal the slope times the sum of all x-values\r\nvar f = m * xSum;\r\n\r\n// Plug the values you have calculated for e and f into the following equation for the y-intercept\r\n// y-intercept = b = (e - f) / n\r\nvar b = (e - f) / n;\r\n\r\n// Print the equation below the chart\r\n//\tdocument.getElementsByClassName(\"equation\")[0].innerHTML = \"y = \" + m + \"x + \" + b;\r\n//\tdocument.getElementsByClassName(\"equation\")[1].innerHTML = \"x = ( y - \" + b + \" ) / \" + m;\r\n\r\n// return an object of two points\r\n// each point is an object with an x and y coordinate\r\nreturn {\r\n ptA : {\r\n x: minX,\r\n y: m * minX + b\r\n },\r\n ptB : {\r\n y: minY,\r\n x: (minY - b) / m\r\n }\r\n}\r\n\r\n}", "title": "" }, { "docid": "552722e1146e2092fa6c335320d799fb", "score": "0.5584127", "text": "function ls_regression_slope(values_x, values_y) {\n\tvar sum_x = 0;\n\tvar sum_y = 0;\n\tvar sum_xy = 0;\n\tvar sum_xx = 0;\n\tvar count = 0;\n\t\n\t/*\n\t * We'll use those variables for faster read/write access.\n\t */\n\tvar x = 0;\n\tvar y = 0;\n\tvar values_length = values_x.length;\n\t\n\tif (values_length != values_y.length) {\n\t\tthrow new Error('The parameters values_x and values_y need to have same size!');\n\t}\n\t\n\t/*\n\t * Nothing to do.\n\t * LDP mod - Return 0. Consider an error state in the future.\n\t */\n\tif (values_length === 0) {\n\t\t// use this if you're interested in returning the line itself\n\t\t// return [[], []]\n\t\treturn 0;\n\t}\n\t\n\t/*\n\t* Calculate the sum for each of the parts necessary.\n\t*/\n\tfor (var v = 0; v < values_length; v++) {\n\t\tx = values_x[v];\n\t\ty = values_y[v];\n\t\tsum_x += x;\n\t\tsum_y += y;\n\t\tsum_xx += x*x;\n\t\tsum_xy += x*y;\n\t\tcount++;\n\t}\n\t\n\t/*\n\t * Calculate m and b for the formular:\n\t * y = x * m + b\n\t */\n\tvar m = (count*sum_xy - sum_x*sum_y) / (count*sum_xx - sum_x*sum_x);\n\treturn m;\n\t\n\t// use the following if you're interested in returning the line itself\n\t//var b = (sum_y/count) - (m*sum_x)/count;\n\t\t\n\t/*\n\t * We will make the x and y result line now\n\t */\n\t//var result_values_x = [];\n\t//var result_values_y = [];\n\t\n\t//for (var v = 0; v < values_length; v++) {\n\t//\tx = values_x[v];\n\t//\ty = x * m + b;\n\t//\tresult_values_x.push(x);\n\t//\tresult_values_y.push(y);\n\t//}\n\t\n\t//return [result_values_x, result_values_y];\n}", "title": "" }, { "docid": "b7e9ea97a82db3ea9aeedb3d62d73826", "score": "0.55691314", "text": "solveLinearSystem(b) {\r\n assertInst(Vector, b);\r\n const { L, U, P } = this.luDecomposition();\r\n const y = L.solveForwards(P.timesVector(b));\r\n const x = U.solveBackwards(y);\r\n return x;\r\n }", "title": "" }, { "docid": "ff4245ecd7ad4bb73ea90406c9faa6b2", "score": "0.555177", "text": "function solve_lineq(coefs, vec) {\n\tif (coefs.length != vec.length) {\n\t\terrorMsg('The dimension of the right-side vector must be '+\n\t\t\t'equal to the dimensions of the coefficient matrix, i.e. '+\n\t\t\t'if the matrix is 3x3 then the vector must have 3 elements.');\n\t\treturn false;\n\t}\n\tvar matrices = decomposeLU(coefs);\n/* alert('== L ==\\n'+matr2str(matrices['L'])+\n\t'\\n---\\n== U ==\\n'+matr2str(matrices['U']));*/\n\tvar y = solve_lineq_ltm(matrices['L'], multiplyMatr(matrices['P'], vec));\n\treturn solve_lineq_utm(matrices['U'], y);\n}", "title": "" }, { "docid": "89d67504d8d531d57d87ba97a75e1258", "score": "0.55145705", "text": "function findLineByLeastSquares(values_x, values_y) {\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_xx = 0;\n var count = 0;\n var x = 0;\n var y = 0;\n var values_length = values_x.length;\n\n if (values_length != values_y.length) {\n throw new Error('The parameters values_x and values_y need to have same size!');\n }\n\n if (values_length === 0) {\n return [[], []];\n } // Calculate the sum for each of the parts necessary.\n\n\n for (var v = 0; v < values_length; v++) {\n x = values_x[v];\n y = values_y[v];\n sum_x += x;\n sum_y += y;\n sum_xx += x * x;\n sum_xy += x * y;\n count++;\n }\n /*\n * Calculate m and b for the formula:\n * y = x * m + b\n */\n\n\n var m = (count * sum_xy - sum_x * sum_y) / (count * sum_xx - sum_x * sum_x);\n var b = sum_y / count - m * sum_x / count;\n /*\n * We will make the x and y result line now\n */\n\n var result_values_x = [];\n var result_values_y = [];\n\n for (var v = 0; v < values_length; v++) {\n x = values_x[v];\n y = x * m + b;\n result_values_x.push(x);\n result_values_y.push(y);\n }\n\n return [result_values_x, result_values_y];\n} //returns a regression line object - calls findLineByLeastSquares to calculate", "title": "" }, { "docid": "b2d4bf3a883bbbaea240bdfce6f533e4", "score": "0.5500939", "text": "function findLineByLeastSquares(values_x, values_y) {\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_xx = 0;\n var count = 0;\n\n /*\n * We'll use those variables for faster read/write access.\n */\n var x = 0;\n var y = 0;\n var values_length = values_x.length;\n\n if (values_length != values_y.length) {\n throw new Error('The parameters values_x and values_y need to have same size! ' + values_length + ' ' + values_y.length);\n }\n\n /*\n * Nothing to do.\n */\n if (values_length === 0) {\n return [[], []];\n }\n\n /*\n * Calculate the sum for each of the parts necessary.\n */\n for (var v = 0; v < values_length; v++) {\n x = values_x[v];\n y = values_y[v];\n sum_x += x;\n sum_y += y;\n sum_xx += x * x;\n sum_xy += x * y;\n count++;\n }\n\n /*\n * Calculate m and b for the formular:\n * y = x * m + b\n */\n var m = (count * sum_xy - sum_x * sum_y) / (count * sum_xx - sum_x * sum_x);\n var b = (sum_y / count) - (m * sum_x) / count;\n\n /*\n * We will make the x and y result line now\n */\n var result_values_x = [];\n var result_values_y = [];\n\n for (var v = 0; v < values_length; v++) {\n x = values_x[v];\n y = x * m + b;\n result_values_x.push(x);\n result_values_y.push(y);\n }\n\n //console.log([result_values_y]);\n\n return result_values_y;\n}", "title": "" }, { "docid": "907c8120a58271502d6ad9f302dafb4d", "score": "0.5491524", "text": "function linear_linear(t) {\n return +t;\n}", "title": "" }, { "docid": "280c00250ca38ca1e247dc0be2586a2d", "score": "0.54722303", "text": "function linear(t, b, c, d) {\n return c * (t /= d) * t + b;\n}", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "64781ec239f96f31cfc5f69bde81c745", "score": "0.5430128", "text": "function linear_regression() {\n var linreg = {},\n data = [];\n\n // Assign data to the model. Data is assumed to be an array.\n linreg.data = function(x) {\n if (!arguments.length) return data;\n data = x.slice();\n return linreg;\n };\n\n // Calculate the slope and y-intercept of the regression line\n // by calculating the least sum of squares\n linreg.mb = function() {\n var m, b;\n\n // Store data length in a local variable to reduce\n // repeated object property lookups\n var data_length = data.length;\n\n //if there's only one point, arbitrarily choose a slope of 0\n //and a y-intercept of whatever the y of the initial point is\n if (data_length === 1) {\n m = 0;\n b = data[0][1];\n } else {\n // Initialize our sums and scope the `m` and `b`\n // variables that define the line.\n var sum_x = 0, sum_y = 0,\n sum_xx = 0, sum_xy = 0;\n\n // Use local variables to grab point values\n // with minimal object property lookups\n var point, x, y;\n\n // Gather the sum of all x values, the sum of all\n // y values, and the sum of x^2 and (x*y) for each\n // value.\n //\n // In math notation, these would be SS_x, SS_y, SS_xx, and SS_xy\n for (var i = 0; i < data_length; i++) {\n point = data[i];\n x = point[0];\n y = point[1];\n\n sum_x += x;\n sum_y += y;\n\n sum_xx += x * x;\n sum_xy += x * y;\n }\n\n // `m` is the slope of the regression line\n m = ((data_length * sum_xy) - (sum_x * sum_y)) /\n ((data_length * sum_xx) - (sum_x * sum_x));\n\n // `b` is the y-intercept of the line.\n b = (sum_y / data_length) - ((m * sum_x) / data_length);\n }\n\n // Return both values as an object.\n return { m: m, b: b };\n };\n\n // a shortcut for simply getting the slope of the regression line\n linreg.m = function() {\n return linreg.mb().m;\n };\n\n // a shortcut for simply getting the y-intercept of the regression\n // line.\n linreg.b = function() {\n return linreg.mb().b;\n };\n\n // ## Fitting The Regression Line\n //\n // This is called after `.data()` and returns the\n // equation `y = f(x)` which gives the position\n // of the regression line at each point in `x`.\n linreg.line = function() {\n\n // Get the slope, `m`, and y-intercept, `b`, of the line.\n var mb = linreg.mb(),\n m = mb.m,\n b = mb.b;\n\n // Return a function that computes a `y` value for each\n // x value it is given, based on the values of `b` and `a`\n // that we just computed.\n return function(x) {\n return b + (m * x);\n };\n };\n\n return linreg;\n }", "title": "" }, { "docid": "2203155165cbd1dc388058d05089fa72", "score": "0.54297096", "text": "static linear(t, b, c, d) {\n return t / d * (b + c);\n }", "title": "" }, { "docid": "e94a6255a386e78e99647c89b5abbc5d", "score": "0.5419452", "text": "function linearRegression(y, x) {\n const n = y.length;\n let sx = 0;\n let sy = 0;\n let sxy = 0;\n let sxx = 0;\n let syy = 0;\n for (let i = 0; i < n; i++) {\n sx += x[i];\n sy += y[i];\n sxy += x[i] * y[i];\n sxx += x[i] * x[i];\n syy += y[i] * y[i];\n }\n const mx = sx / n;\n const my = sy / n;\n const yy = n * syy - sy * sy;\n const xx = n * sxx - sx * sx;\n const xy = n * sxy - sx * sy;\n const slope = xy / xx;\n const intercept = my - slope * mx;\n const r = xy / Math.sqrt(xx * yy);\n const r2 = Math.pow(r,2);\n let sst = 0;\n for (let i = 0; i < n; i++) {\n sst += Math.pow((y[i] - my), 2);\n }\n const sse = sst - r2 * sst;\n const see = Math.sqrt(sse / (n - 2));\n const ssr = sst - sse;\n return {slope, intercept, r, r2, sse, ssr, sst, sy, sx, see};\n }", "title": "" }, { "docid": "27e2c486d4ebd93b78b8844581327089", "score": "0.541825", "text": "function handleEquation(equation) {\n let firstNum;\n let operator;\n let secondNum;\n let operatorIndex;\n let result;\n\n equation = equation.split(' ');\n\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < operators.length; i++) {\n // loop through the operators array line 14\n // the operands in the array are indexed to follow BODMAS rule\n while (equation.includes(operators[i])) {\n operatorIndex = equation.findIndex(val => val === operators[i]); // find index of operator(s)\n firstNum = equation[operatorIndex - 1]; // the operand would be before the operator\n operator = equation[operatorIndex];\n secondNum = equation[operatorIndex + 1]; // the next operand would be after the operator\n result = solve(firstNum, operator, secondNum);\n // by splicing, the evaluation will continue until there are no more operators\n equation.splice(operatorIndex - 1, 3, result);\n }\n }\n return result;\n}", "title": "" }, { "docid": "42141f41f735aefc666380d8fa4eca80", "score": "0.54015964", "text": "function linear(t) { return t }", "title": "" }, { "docid": "78461e74d72e83a1bd830d601b2684cd", "score": "0.5397207", "text": "linear (t, b, c, d) {\n return c * t / d + b\n }", "title": "" }, { "docid": "d2d0d1b85bfb38f61a5abe688c44197e", "score": "0.53789335", "text": "function solve(x){\n console.log(\"current equation: \" + x);\n /* makes sure something entered */\n if(x == \"\") {\n return \"nothing entered\";\n }\n\n /* checks if we're down to one number */\n var sindex = x.search(/^\\-?\\d+\\.?\\d*$/);\n if(sindex > -1) {\n console.log(\"hit base case\");\n return x;\n }\n\n /* searches for parentheses */\n sindex = x.search(/\\(.+\\)/);\n if(sindex > -1){\n var oldX = parentheses(x, sindex);\n var newX = oldX.slice(1, -1);\n var answer = solve(newX);\n return solve(x.replace(oldX, answer));\n }\n\n /* checks whether multiplication or division happens first */\n var counter = 0;\n for(var i = 0; i < x.length; i++){\n if(x[i] == \"*\"){\n counter = 1;\n break;\n } else if(x[i] == \"/\"){\n break;\n }\n }\n\n /* searches for exponents */\n sindex = x.search(/\\-?\\d+\\.?\\d*\\^\\-?\\d+\\.?\\d*/);\n if(sindex > -1) {\n var oldX = (x.match(/\\-?\\d+\\.?\\d*\\^\\-?\\d+\\.?\\d*/))[0];\n var ans = exponent(oldX);\n return solve(x.replace(oldX, ans));\n }\n\n /* searches for multiplication */\n sindex = x.search(/\\-?\\d+\\.?\\d*\\*\\-?\\d+\\.?\\d*/);\n if(sindex > -1 && counter == 1) {\n var oldX = (x.match(/\\-?\\d+\\.?\\d*\\*\\-?\\d+\\.?\\d*/))[0];\n var ans = multiply(oldX);\n return solve(x.replace(oldX, ans));\n }\n\n /* searches for division */\n sindex = x.search(/\\-?\\d+\\.?\\d*\\/\\-?\\d+\\.?\\d*/);\n if(sindex > -1) {\n var oldX = (x.match(/\\-?\\d+\\.?\\d*\\/\\-?\\d+\\.?\\d*/))[0];\n var ans = divide(oldX);\n return solve(x.replace(oldX, ans));\n }\n\n /* checks whether addition or subtraction happens first */\n counter = 0;\n for(var i = 0; i < x.length; i++){\n if(x[i] == \"+\"){\n counter = 1;\n break;\n } else if(x[i] == \"-\" && /\\d/.test(x[i-1])){\n break;\n }\n }\n\n /* searches for addition */\n sindex = x.search(/\\-?\\d+\\.?\\d*\\+\\-?\\d+\\.?\\d*/);\n if(sindex > -1 && counter == 1) {\n var oldX = (x.match(/\\-?\\d+\\.?\\d*\\+\\-?\\d+\\.?\\d*/))[0];\n var ans = add(oldX);\n return solve(x.replace(oldX, ans));\n }\n\n /* searches for subtraction */\n sindex = x.search(/\\-?\\d+\\.?\\d*\\-\\-?\\d+\\.?\\d*/);\n if(sindex > -1) {\n var oldX = (x.match(/\\-?\\d+\\.?\\d*\\-\\-?\\d+\\.?\\d*/))[0];\n var ans = subtract(oldX);\n return solve(x.replace(oldX, ans));\n }\n\n /* the inputted equation has an error */\n $(\"#error2\").show();\n return \"error\";\n}", "title": "" }, { "docid": "6fa26788463be30dfe5d97585fc0496e", "score": "0.5348051", "text": "function solveMatrixEquation(A, b) {\n // console.log(b);\n var B = inv(A);\n\n var x = dot(B, b);\n \n //For Ax=B, x=inv(A)*B\n return x;\n}", "title": "" }, { "docid": "80240975bf144b277a962efbc1b898f9", "score": "0.53479284", "text": "function solve(equation) {\n while (equation.indexOf(\"(\") != -1) {\n const start = equation.lastIndexOf(\"(\");\n const end = equation.indexOf(\")\", start);\n if (start != -1) {\n equation = equation.substring(0, start)\n + solve(equation.substring(start + 1, end))\n + equation.substring(end + 1);\n }\n }\n equation = equation.replace(/''/g, '');\n equation = equation.replace(/0'/g, '1');\n equation = equation.replace(/1'/g, '0');\n for (let i = 0; i < equation.length - 1; i++) {\n if ((equation[i] == '0' || equation[i] == '1') && (equation[i + 1] == '0' || equation[i + 1] == '1')) {\n equation = equation.substring(0, i + 1) + '*' + equation.substring(i + 1, equation.length);\n }\n }\n try {\n const safeEval = eval;\n const answer = safeEval(equation);\n if (answer == 0) {\n return 0;\n }\n if (answer > 0) {\n return 1;\n }\n return '';\n } catch (e) {\n return '';\n }\n }", "title": "" }, { "docid": "f623d2d336aae19c1875c996411d201a", "score": "0.53231055", "text": "function getEquation(){\n let result = \"\";\n if(curReg == r.POLY){\n let i = 0;\n while(i < n - 1){\n if(i != 0) result += \" + \";\n let val = vars[i].dataSync();\n result += val + \" * x ^ \" + (n - 1 - i);\n i++;\n }\n let val = vars[i].dataSync();\n if(i != 0) result += \" + \";\n result += val;\n } else if(curReg == r.EXP){\n let a = vars[0].dataSync();\n let b = vars[1].dataSync();\n result = a + \" * \" + b + \" ^ x\"\n } else if(curReg == r.TRIG){\n let a = vars[0].dataSync();\n let b = vars[1].dataSync();\n let c = vars[2].dataSync();\n result = a + \" * cos(\" + b + \" * x) + \" + c;\n } else if(curReg == r.INV){\n let a = vars[0].dataSync();\n result = a + \" / x\";\n }\n return result;\n}", "title": "" }, { "docid": "beb3e4e7e7b839fe5c28347083fa84cb", "score": "0.53031254", "text": "static linear(t, b, c, d) {\n if ((t = 2 * t / d) <= 1) {\n return (1 - t) * c + b;\n }\n return (t - 1) * c + b;\n }", "title": "" }, { "docid": "3d955468d1213014f142a94f78477ad5", "score": "0.528733", "text": "function simpleEquation(a, b, c){\n\tif ((a+b)==c) return `${a}+${b}=${c}`\n\tif ((b*c)==a) return `${b}*${c}=${a}`\n\treturn''\n}", "title": "" }, { "docid": "83c5c18ac094a873f9a98ef238718fdc", "score": "0.5278205", "text": "function solve(formula) {\n let index = formula.indexOf(\"+\");\n while(index !== -1) {\n formula = formula.slice(0, index-1).concat(\n parseInt(formula[index-1]) + parseInt(formula[index+1]),\n formula.slice(index+2, index.length)\n );\n\n index = formula.indexOf(\"+\");\n }\n\n index = formula.indexOf(\"*\");\n while(index !== -1) {\n formula = formula.slice(0, index-1).concat(\n parseInt(formula[index-1]) * parseInt(formula[index+1]),\n formula.slice(index+2, index.length)\n );\n\n index = formula.indexOf(\"*\");\n }\n\n return Number(formula);\n}", "title": "" }, { "docid": "d5fb8bd2b8381552089a9fbf995d837f", "score": "0.52441674", "text": "function calculate(){ //Funcion que se encarga de verificar y corregir la sintaxis de la exprexion matematica, para que luego sea evaluada por la funcion \"sum\".\n\t\n\t\tvar arrayResultOfOperatorsAndNumbers = new Array();\n\t\tvar arrayRootxyTotal = new Array();\n\t\tvar numberx = \"\";\n\t\tvar numbery = \"\";\n\t\tvar statusNumber = true;\n\t\tvar statusPotentiation = false;\n\t\tvar statusPercentage = false;\n\t\tvar statusRootSquare = false;\n\t\tvar rootSquareTotal = 0;\n\t\tvar statusReciproc = false;\n var statusTrigonometricIdentities = '';\n\t\tvar statusOthersRoot = false;\n\t\tvar statusResidueDivision = false;\n\t\tvar statusRootxy = false;\n\n\t for(var i=0; i<arrayOperatorsAndFunctions.length; i++)\n\t\t {\n\t\t var isNumber = isNaN(arrayOperatorsAndFunctions[i]); //Verifica si el caracter es un numero ó no.\n\t\t \n\t\t\tif (isNumber == false || arrayOperatorsAndFunctions[i] == '.' || arrayOperatorsAndFunctions[i] == 'e' || arrayOperatorsAndFunctions[i] == '/') //Es un numero entero ó decimal ó numero euler.\n\t\t\t{ \n\t\t\t if (statusNumber == true)\n\t\t\t {\n\t\t\t numberx += arrayOperatorsAndFunctions[i]; //Almacena el numero base para la potenciacion.\n\t\t\t\tarrayResultOfOperatorsAndNumbers[arrayResultOfOperatorsAndNumbers.length] = arrayOperatorsAndFunctions[i];\n\t\t\t }\n\t\t\t \n\t\t else if(statusNumber == false)\n\t\t\t {\n\t\t\t numbery += arrayOperatorsAndFunctions[i]; //Almacena el numero exponente para la potenciacion.\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t else if(isNumber == true) //Es un operador.\n\t\t {\n\t\t\t if (arrayOperatorsAndFunctions[i] == \"^\") //Calcula la potencia de un numero.\n\t\t\t {\n\t\t\t arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t statusNumber = false;\n\t\t statusPotentiation = true;\n\t\t }\n\t\t\t \n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"%from\") //Calcula el porcentaje de un numero.\n\t\t\t {\t \n\t\t\t arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t statusNumber = false;\n\t\t statusPercentage = true; \n\t\t\t }\n\t\t\t \n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"1/\") //Obtiene el resultado de la division del numero 1 entre cualquier otro numero.\n\t\t\t {\n\t\t\t arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t statusNumber = false;\n\t\t statusReciproc = true;\n\t\t\t }\n\t\t\t \n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"Mod\") //Obtiene el residuo de la division.\n\t\t\t {\n\t\t\t arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t statusNumber = false;\n\t\t statusResidueDivision = true;\n\t\t }\n\t\t\t \n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"raiz\" || arrayOperatorsAndFunctions[i] == \"raiz_1\") //Obtiene la raiz cuadrada de un numero.\n\t\t\t {\n\t\t\t var arrayRoot = new Array();\n\t\t\t\tvar arrayRootInternal = new Array();\n\t\t\t\tvar arrayQuantifyingExpressionToResolve = new Array();\n\t\t\t\t\n\t\t\t for(var j=i; j<arrayOperatorsAndFunctions.length; j++) //Contabiliza el numero de raices cuadradas a calcular de un numero.\n\t\t {\n\t\t\t\t if(arrayOperatorsAndFunctions[j] == 'raiz' || arrayOperatorsAndFunctions[j] == \"raiz_1\")\n\t\t\t\t {\n\t\t\t\t rootSquareTotal++;\n\t\t\t\t\t statusNumber = false;\n\t\t\t\t }\n\t\t\t\t else\n {\n\t\t\t\t break;\n\t\t\t\t }\t\t\t\t \n\t\t }\n\t\t\t\t\n\t\t\t\ti += rootSquareTotal - 1; //Le suma a la variable 'i' del for principal el numero de elementos igual al name 'raiz'.\n\t\t\t\t\n\t\t\t\t if(arrayOperatorsAndFunctions[i+1] == '(') //Verifica si despues de la raiz ó de las raices, sigue el operador name '('.\n\t\t\t\t {\n\t\t\t\t var n = i+1;\n\t\t\t\t\t var m = 0;\n\t\t\t\t arrayQuantifyingExpressionToResolve = quantifyingExpressionToResolve(arrayOperatorsAndFunctions,n);\n\t\t\t\t\t var lettoverShapesOfTheExpression = arrayQuantifyingExpressionToResolve[arrayQuantifyingExpressionToResolve.length-1];\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(arrayQuantifyingExpressionToResolve.length-2,2); //Limpia el array.\n\n\t\t\t\t for(var p=i+2; p<arrayOperatorsAndFunctions.length; p++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis en la raiz.\n\t\t {\n\t\t\t\t\t m++;\n\t\t\t\t\t //Verifica si dentro de la raiz ó raices, hay una segunda raiz o funciones que resolver y si lo procede el operador name '('.\n\t\t\t\t\t if((arrayOperatorsAndFunctions[p] == 'raiz' || arrayOperatorsAndFunctions[p] == 'raiz_1') && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'sin' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'cos' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'tan' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'asin' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'acos' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'atan' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'log' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'ln' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'n!' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'raizxy' && arrayOperatorsAndFunctions[p+1] == '(')\n\t\t\t\t\t {\n\t\t\t\t\t var operationToApply = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t var shapesOfTheFunction = arrayQuantifyingExpressionToResolve[1];\n\t\t\t\t\t\t var h = 0;\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(0,2); //Limpia el array.\n\t\t\t\t\t\t \n\t\t\t\t\t for(var k=p+2; k<arrayOperatorsAndFunctions.length; k++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis de la segunda raiz o raices.\n\t\t {\n\t\t\t\t\t\t h++;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(h < shapesOfTheFunction + 1)\n\t\t\t\t\t {\n\t\t\t\t\t arrayRootInternal[arrayRootInternal.length] = arrayOperatorsAndFunctions[k]; // El array obtiene los numeros y operadores de la segunda raiz ó raices.\n\t\t\t\t\t\t\t p++; //Le suma a la variable 'p' del for anterior el numero de elementos 'name'.\n\t\t\t\t\t\t\t i++;\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t p += 2;\n\t\t\t\t\t\t\t i += 3;\n\t\t\t\t\t\t\t arrayRoot[arrayRoot.length] = operationToApply;\n\t\t\t\t\t arrayRoot[arrayRoot.length] = calculatePartial(arrayRootInternal);\n\t\t\t\t\t\t\t arrayRootInternal.splice(0,arrayRootInternal.length); //Limpia el array.\n\t\t\t\t\t break;\n\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\t else if(m < lettoverShapesOfTheExpression + 1) //Le suma 1 a la ultima variable para que el array pueda tomar todos los caracteres y luego lo pase a calcular en la siguiente instruccion.\n\t\t\t\t\t {\n\t\t\t\t\t arrayRoot[arrayRoot.length] = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t\t i++; //Le suma cada elemento que se encuentra dentro de la raiz a la variable 'i' del for principal, es decir, los elementos que se encuentran dentro de los parentesis.\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t i += 2;\n\t\t\t\t\t numbery = calculatePartial(arrayRoot);\n\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\n\t\t statusRootSquare = true;\n\t\t\t }\n\t\t\t //Realiza calculos relacionados con las identidades trigonometricas y otras funciones.\n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"sin\" || arrayOperatorsAndFunctions[i] == \"cos\" || arrayOperatorsAndFunctions[i] == \"tan\" || arrayOperatorsAndFunctions[i] == \"asin\" || \n\t\t\t arrayOperatorsAndFunctions[i] == \"acos\" || arrayOperatorsAndFunctions[i] == \"atan\" || arrayOperatorsAndFunctions[i] == \"log\" || arrayOperatorsAndFunctions[i] == \"ln\" || \n\t\t\t\t\t arrayOperatorsAndFunctions[i] == \"n!\")\n\t\t\t {\n\t\t\t var arrayRoot = new Array();\n\t\t\t\t var arrayRootInternal = new Array();\n\t\t\t\t var arrayQuantifyingExpressionToResolve = new Array();\n\t\t\t\t var TrigonometricIdentity = arrayOperatorsAndFunctions[i];\n\t\t\t\t\n\t\t\t if(arrayOperatorsAndFunctions[i+1] == '(') //Verifica si despues de la raiz ó de las raices, sigue el operador name '('.\n\t\t\t\t {\n\t\t\t\t var n = i+1;\n\t\t\t\t\t var m = 0;\n\t\t\t\t arrayQuantifyingExpressionToResolve = quantifyingExpressionToResolve(arrayOperatorsAndFunctions,n);\n\t\t\t\t\t var lettoverShapesOfTheExpression = arrayQuantifyingExpressionToResolve[arrayQuantifyingExpressionToResolve.length-1];\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(arrayQuantifyingExpressionToResolve.length-2,2); //Limpia el array.\n\n\t\t\t\t for(var p=i+2; p<arrayOperatorsAndFunctions.length; p++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis en la raiz.\n\t\t {\n\t\t\t\t\t m++;\n\t\t\t\t\t //Verifica si dentro de la raiz ó raices, hay una segunda raiz o funciones que resolver y si lo procede el operador name '('.\n\t\t\t\t\t if((arrayOperatorsAndFunctions[p] == 'raiz' || arrayOperatorsAndFunctions[p] == 'raiz_1') && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'sin' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'cos' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'tan' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'asin' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'acos' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'atan' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'log' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'ln' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'n!' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'raizxy' && arrayOperatorsAndFunctions[p+1] == '(')\n\t\t\t\t\t {\n\t\t\t\t\t var operationToApply = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t var shapesOfTheFunction = arrayQuantifyingExpressionToResolve[1];\n\t\t\t\t\t\t var h = 0;\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(0,2); //Limpia el array.\n\t\t\t\t\t\t \n\t\t\t\t\t for(var k=p+2; k<arrayOperatorsAndFunctions.length; k++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis de la segunda raiz o raices.\n\t\t {\n\t\t\t\t\t\t h++;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(h < shapesOfTheFunction + 1)\n\t\t\t\t\t {\n\t\t\t\t\t arrayRootInternal[arrayRootInternal.length] = arrayOperatorsAndFunctions[k]; // El array obtiene los numeros y operadores de la segunda raiz ó raices.\n\t\t\t\t\t\t\t p++; //Le suma a la variable 'p' del for anterior el numero de elementos 'name'.\n\t\t\t\t\t\t\t i++;\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t p += 2;\n\t\t\t\t\t\t\t i += 3;\n\t\t\t\t\t\t\t arrayRoot[arrayRoot.length] = operationToApply;\n\t\t\t\t\t arrayRoot[arrayRoot.length] = calculatePartial(arrayRootInternal);\n\t\t\t\t\t\t\t arrayRootInternal.splice(0,arrayRootInternal.length); //Limpia el array.\n\t\t\t\t\t break;\n\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\t else if(m < lettoverShapesOfTheExpression + 1) //Le suma 1 a la ultima variable para que el array pueda tomar todos los caracteres y luego lo pase a calcular en la siguiente instruccion.\n\t\t\t\t\t {\n\t\t\t\t\t arrayRoot[arrayRoot.length] = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t\t i++; //Le suma cada elemento que se encuentra dentro de la raiz a la variable 'i' del for principal, es decir, los elementos que se encuentran dentro de los parentesis.\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t i += 2;\n\t\t\t\t\t numbery = calculatePartial(arrayRoot);\n\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t \n\t\t\t\tif(TrigonometricIdentity == \"log\"){ //Verifica si existe un numero antes de la funcion logaritmica, y si existe, los elimina.\n\t\t\t\t arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t\t}\n\t\t\t\t\n\t\t\t statusNumber = false;\n\t\t statusTrigonometricIdentities = TrigonometricIdentity;\n\t\t }\n\t\t\t \n\t\t\telse if (arrayOperatorsAndFunctions[i] == \"raizxy\") //Calcula la raiz mayor ó igual a 3 de un numero.\n\t\t\t {\n\t\t\t var arrayRoot = new Array();\n\t\t\t\tvar arrayRootInternal = new Array();\n\t\t\t\tvar arrayQuantifyingExpressionToResolve = new Array();\n\t\t\t\t\n\t\t\t\tfor(var j=i; j<arrayOperatorsAndFunctions.length; j++) //Contabiliza el numero de raices cuadradas a calcular de un numero.\n\t\t {\n\t\t\t\t if(arrayOperatorsAndFunctions[j] == 'raizxy')\n\t\t\t\t {\n\t\t\t\t arrayRootxyTotal[arrayRootxyTotal.length] = arrayOperatorsAndFunctions[j-1];\n\t\t\t\t\t i++;\n\t\t\t\t\t statusNumber = false;\n\t\t\t\t }\n\t\t\t\t else\n {\n\t\t\t\t i--;\n\t\t\t\t break;\n\t\t\t\t }\t\t\t\t \n\t\t }\n\t\t\t\t\n\t\t\t\t if(arrayOperatorsAndFunctions[i+1] == '(') //Verifica si despues de la raiz ó de las raices, sigue el operador name '('.\n\t\t\t\t {\n\t\t\t\t var n = i+1;\n\t\t\t\t\t var m = 0;\n\t\t\t\t arrayQuantifyingExpressionToResolve = quantifyingExpressionToResolve(arrayOperatorsAndFunctions,n);\n\t\t\t\t\t var lettoverShapesOfTheExpression = arrayQuantifyingExpressionToResolve[arrayQuantifyingExpressionToResolve.length-1];\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(arrayQuantifyingExpressionToResolve.length-2,2); //Limpia el array.\n\n\t\t\t\t for(var p=i+2; p<arrayOperatorsAndFunctions.length; p++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis en la raiz.\n\t\t {\n\t\t\t\t\t m++;\n\t\t\t\t\t //Verifica si dentro de la raiz ó raices, hay una segunda raiz o funciones que resolver y si lo procede el operador name '('.\n\t\t\t\t\t if((arrayOperatorsAndFunctions[p] == 'raiz' || arrayOperatorsAndFunctions[p] == 'raiz_1') && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'sin' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'cos' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'tan' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'asin' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'acos' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'atan' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'log' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'ln' && arrayOperatorsAndFunctions[p+1] == '(' || arrayOperatorsAndFunctions[p] == 'n!' && arrayOperatorsAndFunctions[p+1] == '(' ||\n\t\t\t\t\t\t arrayOperatorsAndFunctions[p] == 'raizxy' && arrayOperatorsAndFunctions[p+1] == '(')\n\t\t\t\t\t {\n\t\t\t\t\t var operationToApply = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t var shapesOfTheFunction = arrayQuantifyingExpressionToResolve[1];\n\t\t\t\t\t\t var h = 0;\n\t\t\t\t\t arrayQuantifyingExpressionToResolve.splice(0,2); //Limpia el array.\n\t\t\t\t\t\t \n\t\t\t\t\t for(var k=p+2; k<arrayOperatorsAndFunctions.length; k++) //El array obtiene los numeros y operadores que se encuentran dentro del parentesis de la segunda raiz o raices.\n\t\t {\n\t\t\t\t\t\t h++;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(h < shapesOfTheFunction + 1)\n\t\t\t\t\t {\n\t\t\t\t\t arrayRootInternal[arrayRootInternal.length] = arrayOperatorsAndFunctions[k]; // El array obtiene los numeros y operadores de la segunda raiz ó raices.\n\t\t\t\t\t\t\t p++; //Le suma a la variable 'p' del for anterior el numero de elementos 'name'.\n\t\t\t\t\t\t\t i++;\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t\t p += 2;\n\t\t\t\t\t\t\t i += 3;\n\t\t\t\t\t\t\t arrayRoot[arrayRoot.length] = operationToApply;\n\t\t\t\t\t arrayRoot[arrayRoot.length] = calculatePartial(arrayRootInternal);\n\t\t\t\t\t\t\t arrayRootInternal.splice(0,arrayRootInternal.length); //Limpia el array.\n\t\t\t\t\t break;\n\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\t else if(m < lettoverShapesOfTheExpression + 1) //Le suma 1 a la ultima variable para que el array pueda tomar todos los caracteres y luego lo pase a calcular en la siguiente instruccion.\n\t\t\t\t\t {\n\t\t\t\t\t arrayRoot[arrayRoot.length] = arrayOperatorsAndFunctions[p];\n\t\t\t\t\t\t i++; //Le suma cada elemento que se encuentra dentro de la raiz a la variable 'i' del for principal, es decir, los elementos que se encuentran dentro de los parentesis.\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t i += 2;\n\t\t\t\t\t numbery = calculatePartial(arrayRoot);\n\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n arrayResultOfOperatorsAndNumbers = verifyArrayResultOfOperatorsAndNumbers(arrayResultOfOperatorsAndNumbers); //Verifica y corrige los elementos del array.\n\t\t\t statusNumber = false;\n\t\t statusRootxy = true;\n\t\t }\n\t\t\t \n\t\t else //Otros operadores.\n\t\t\t {\n\t\t\t \n\t\t //Funcion que realiza las operaciones matematicas.\t\t\t\t \n arrayResultOfOperatorsAndNumbers = resolveOperations(arrayResultOfOperatorsAndNumbers,numberx,numbery,statusPotentiation,statusPercentage,statusRootSquare,\n\t\t\t rootSquareTotal,statusReciproc,statusTrigonometricIdentities,statusResidueDivision,statusRootxy,arrayRootxyTotal);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n\t\t\t\t if (arrayOperatorsAndFunctions[i] == \"signo\") //A partir de aqui se adicionan los operadores.\n\t\t\t {\n\t\t\t arrayResultOfOperatorsAndNumbers[arrayResultOfOperatorsAndNumbers.length] = \"-\";\n\t\t\t }\n\t\t\t\t\t\n\t\t\t\t else if (arrayOperatorsAndFunctions[i] == \"pi\")\n\t\t\t {\n\t\t\t arrayResultOfOperatorsAndNumbers[arrayResultOfOperatorsAndNumbers.length] = \"3.14\";\n\t\t\t }\n\t\t\t\t\t\n\t\t\t else{\n\t\t\t arrayResultOfOperatorsAndNumbers[arrayResultOfOperatorsAndNumbers.length] = arrayOperatorsAndFunctions[i];\n\t\t\t\t numberx = \"\";\n\t\t\t }\n\n\t\t\t\t numberx = \"\";\n\t\t\t\t numbery = \"\";\n\t\t\t\t statusNumber = true;\n\t\t\t\t statusPotentiation = false;\n\t\t\t\t statusPercentage = false;\n\t\t\t\t statusRootSquare = false;\n\t\t\t\t rootSquareTotal = 0;\n\t\t\t\t statusReciproc = false;\n\t\t\t\t statusTrigonometricIdentities = '';\n\t\t\t\t statusResidueDivision = false;\n\t\t\t\t statusRootxy = false;\n\t\t }\n\t\t\t \n\t\t }\t\t\n\t\t }\n\n\t //Funcion que realiza las operaciones matematicas.\t\n\t arrayResultOfOperatorsAndNumbers = resolveOperations(arrayResultOfOperatorsAndNumbers,numberx,numbery,statusPotentiation,statusPercentage,statusRootSquare,\n\t\t rootSquareTotal,statusReciproc,statusTrigonometricIdentities,statusResidueDivision,statusRootxy,arrayRootxyTotal);\n\n\t //Verifica y corrige los signos de la expresion.\n\t\t arrayResultOfOperatorsAndNumbers = multiplicationSign(arrayResultOfOperatorsAndNumbers);\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\n\t //Pasa el array a la caja de texto \"screen\", para luego ser evaluada la expresion por la funcion \"eval\".\n\t\t for(var i=0; i<arrayResultOfOperatorsAndNumbers.length; i++)\n\t\t {\n\t screen.innerHTML += arrayResultOfOperatorsAndNumbers[i];\n\t\t }\n\n\t //Luego pasa el array a la caja de texto \"screen1\" para ser visualizado por el usuario.\n\t\t for(var i=0; i<arrayScreenContainer.length; i++)\n\t\t {\n\t\t screen1.innerHTML += arrayScreenContainer[i];\n\t\t }\n\t}", "title": "" }, { "docid": "44b1279d2beb0ff61eb6729a9cd7d6ed", "score": "0.5243096", "text": "function linear(t) {\n return t;\n}", "title": "" }, { "docid": "c52a834d2ecbaed7b8fef551f38b995d", "score": "0.5228355", "text": "function formulaLine(a, b) {\r\n if (a == undefined || b == undefined || isNaN(a) || isNaN(b))\r\n return 'undefined';\r\n var r = 'y = ';\r\n if (a == -1) {\r\n r += \"-x\";\r\n }\r\n else if (a == 1) {\r\n r += \"x\";\r\n }\r\n else if (a < 0) {\r\n r += \"-\" + -a + \"x\";\r\n }\r\n else if (a > 0) {\r\n r += a + \"x\";\r\n }\r\n if (a == 0) {\r\n r += \"\" + -b;\r\n }\r\n else if (b < 0) {\r\n r += \" - \" + -b;\r\n }\r\n else if (b > 0) {\r\n r += \" + \" + b;\r\n }\r\n return r;\r\n }", "title": "" }, { "docid": "4748919b7aedfacc04d93f410f6516a0", "score": "0.52282506", "text": "function solveQuadraticEquation(a, b, c) {\n let discriminant = b * b - 4 * a * c;\n\n if (discriminant > 0) {\n root1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n root2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n console.log(`The roots of quadratic equation are ${root1} and ${root2}`);\n } else if (discriminant == 0) {\n root1 = root2 = -b / (2 * a);\n console.log(`The roots of quadratic equation are ${root1} and ${root2}`);\n } else {\n let realPart = (-b / (2 * a)).toFixed(2);\n let imagPart = (Math.sqrt(-discriminant) / (2 * a)).toFixed(2);\n console.log(\n `The roots of quadratic equation are ${realPart} + ${imagPart}i and ${realPart} - ${imagPart}i`\n );\n }\n}", "title": "" }, { "docid": "bfdb8f2ac4d3c19c02a29fee355a32c6", "score": "0.5215801", "text": "function quadraticSolve(a, b, c) {\n if( a == 0 ) {\n // linear solve\n return linearSolve(b, c);\n }\n else {\n var delta = b*b - 4*a*c;\n if( delta < 0 )\n {\n return [];\n }\n else\n {\n return [(-b+Math.sqrt(delta))/(2.0*a), (-b-Math.sqrt(delta))/(2.0*a)];\n }\n }\n}", "title": "" }, { "docid": "4f4a9c10e27e268feca8ac466d0f326d", "score": "0.5212383", "text": "function solve()\n{\n let x = document.getElementById(\"result\").value\n let y = eval(x)\n document.getElementById(\"result\").value = y\n}", "title": "" }, { "docid": "03c7c597029354da231384b1a03491c1", "score": "0.5210513", "text": "function rsLissajous2(n, m, numLines, a, b)\n{\n drive = settings.Drive;\n s = 1;\n p = 1/4; // make parameter phaseDelta\n rsCurveWithRays(t => [s*rsSaturatedSine( n*t, drive), s*rsSaturatedSine( m*t+p, drive)], a, b, numLines);\n rsCurveWithRays(t => [s*rsSaturatedSine( m*t+p, drive), s*rsSaturatedSine( n*t, drive)], a, b, numLines);\n}", "title": "" }, { "docid": "6931eb32cc785e321a4b1191fa560903", "score": "0.5204643", "text": "function quadraticRegression(values) {\n //source: http://www.youtube.com/watch?v=b1Q79DbfR_8\n //values are an array of [x, y] arrays;\n if (values.length<=2) {\n return undefined;\n }\n var sumOfXs = 0;\n var sumOfX2s = 0;\n var sumOfX3s = 0;\n var sumOfX4s = 0;\n var sumOfYs = 0;\n var sumOfXYs = 0;\n var sumOfX2Ys = 0;\n for (i in values) {\n xi = values[i][0];\n yi = values[i][1];\n sumOfXs += xi;\n sumOfX2s += xi*xi;\n sumOfX3s += xi*xi*xi;\n sumOfX4s += xi*xi*xi*xi;\n sumOfYs += yi;\n sumOfXYs += xi*yi;\n sumOfX2Ys += xi*xi*yi;\n }\n var n = values.length;\n //store coefficient matrix vertically. each list is a column of the matrix. Actually, this matrix is the same as its transpose, but it'll be much easier to calculate this way.\n var e1 = [n, sumOfXs, sumOfX2s];\n var e2 = [sumOfXs, sumOfX2s, sumOfX3s];\n var e3 = [sumOfX2s, sumOfX3s, sumOfX4s];\n var c = [sumOfYs, sumOfXYs, sumOfX2Ys];\n //use kramer's rule\n var D = determinant(e1, e2, e3)*1.0;\n var Dc = determinant(c, e2, e3);\n var Db = determinant(e1, c, e3);\n var Da = determinant(e1, e2, c);\n var a = Da/D;\n var b = Db/D;\n var c = Dc/D;\n var error = 0;\n for (i in values) {\n xi = values[i][0];\n yi = values[i][1];\n error+= (yi-(a*xi*xi+b*xi+c))*(yi-(a*xi*xi+b*xi+c));\n }\n //average error so it doesn't look like error is constantly increasing\n error/=values.length;\n return [a, b, c, error];\n}", "title": "" }, { "docid": "816c3e8fcdf1803d8796c087b576d06a", "score": "0.5201495", "text": "function quadraticEquation(a, b, c) {\n\treturn (-b + Math.abs(b*b - 4*a*c))/(2*a);\n}", "title": "" }, { "docid": "1b187f6cc1a5d996b274a9430ce59338", "score": "0.51766396", "text": "function solveQuadEquation (a, b, c){\n\t// the quadratic equation can be solved by \n\t// x = (-b +- sqrt(b**2 -4ac)/2a)\n\t// let us consider the sqare root section to delta\n\t// because they can have positive, negative and zero value\n\n\tlet delta = (b **2) - (4 * (a * c));\n\n\tif(delta === 0) {\n\t\tlet result = -b / (2 * a);\n\t\treturn `the solution is ${result}`;\n\n\t} else if (delta > 0) {\n\t\tlet result1 = (-b + Math.sqrt(delta)) / (2*a);\n\t\tlet result2 = (-b - Math.sqrt(delta)) / (2*a);\n\t\treturn `there are two solutions: ${result1} and ${result2}`;\n\t\n\t}else{\n\t\treturn `the solution does not exist`;\n\t}\n\n}", "title": "" }, { "docid": "833a12cecb5d8666f32a7ce3c26a65f4", "score": "0.51744586", "text": "function linearRegression(y,x){\n\t\tvar lr = {};\n\t\tvar n = y.length;\n\t\tvar sum_x = 0;\n\t\tvar sum_y = 0;\n\t\tvar sum_xy = 0;\n\t\tvar sum_xx = 0;\n\t\tvar sum_yy = 0;\n\n\t\tfor (var i = 0; i < y.length; i++) {\n\n\t\t\tsum_x += x[i];\n\t\t\tsum_y += y[i];\n\t\t\tsum_xy += (x[i]*y[i]);\n\t\t\tsum_xx += (x[i]*x[i]);\n\t\t\tsum_yy += (y[i]*y[i]);\n\t\t}\n\n\t\tlr['slope'] = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);\n\t\tlr['intercept'] = (sum_y - lr.slope * sum_x)/n;\n\t\tlr['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);\n\n\t\treturn lr;\n}", "title": "" }, { "docid": "ffb702fec8000aafc2ce43c8bf970e6a", "score": "0.51648426", "text": "function equation(a, b, c) {\n a, b ,c == Number\n if (a === 0 && b === 0) {\n console.log(\"Phuong trinh vo nghiem\")\n }\n else if (a === 0 && b != 0) {\n console.log(\"Phuong trinh co 1 nghiem la:\", -c/b)\n }\n else if ((b*b - 4*a*c) < 0) {\n console.log(\"Phuong trinh vo nghiem\")\n }\n else {\n console.log(\"Phuong trinh co 2 nghiem la:\", (-b+Math.sqrt(delta))/(2*a),'va ', (-b-Math.sqrt(delta))/(2*a))\n }\n}", "title": "" }, { "docid": "c9bde7caca520ac09f72801b42cd5946", "score": "0.51605886", "text": "function equation2(a,b,c){\n if (a == 0){\n if (b == 0){\n if (c== 0){\n console.log(\"phuong trinh co vo so nghiem\")\n }\n else{\n console.log(\"phong trinh vo nghiem\")\n }\n }\n else{\n let x = -c/b\n console.log(\"phuong trinh co 1 nghiem la \", x)\n }\n }\n else{\n delta = b*b - 4*a*c\n if (delta <0){\n console.log(\"phuong trinh vo nghiem\")\n }\n else if (delta == 0 ){\n x = -b/(2*a)\n console.log(\"phuong trinh co nghiem kep la \", x)\n }\n else{\n x1 = (-b + Math.sqrt(delta))/(2*a)\n x2 = (-b - Math.sqrt(delta))/(2*a)\n console.log(\"phuong trinh co 2 nghiem la \", x1, \"va \", x2)\n }\n }\n}", "title": "" }, { "docid": "dfa2efbb1cde9f855690db680cd9879c", "score": "0.51323664", "text": "function linearRegression(x, y){\n\n\tvar regression = new Object();\n\tvar n = y.length;\n\tvar sum_x = 0;\n\tvar sum_y = 0;\n\tvar sum_xy = 0;\n\tvar sum_xx = 0;\n\tvar sum_yy = 0;\n\t\n\t//Sum all parameters\n\tfor (var i = 0; i < y.length; i++) {\n\t\tsum_x += x[i];\n\t\tsum_y += y[i];\n\t\tsum_xy += x[i] * y[i];\n\t\tsum_xx += x[i] * x[i];\n\t\tsum_yy += y[i] * y[i];\n\t} \n\t\n\t//Linear parameters (ax + b) and r2\n\tregression['slope'] = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);\n\tregression['intercept'] = (sum_y - regression.slope * sum_x)/n;\n\tregression['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);\n\t\n\treturn regression;\n}", "title": "" }, { "docid": "8e81acbfdeb58ae74d97569ea5d574f8", "score": "0.5117824", "text": "function solve(){\n\tlet x = document.getElementById(\"result\").value\n\tlet y = eval(x);\n\tdocument.getElementById(\"result\").value = y;\n}", "title": "" }, { "docid": "0288c28c85ed91d54967360592513819", "score": "0.511345", "text": "function func(x,y){\n let ans = x*y;\n return ans * ans -y\n}", "title": "" }, { "docid": "c565fc054b4a55b3c773d3caec724185", "score": "0.51087344", "text": "function _solve(/* Matrix */ L, /* Matrix */ U, /* Matrix or col vector */ b){\n\t\tvar d = [];\n\t\td[0] = b[0];\n\t\tfor(var i = 1; i < L.rows; i++){\n\t\t\tvar sum = 0;\n\t\t\tfor(var j = 0; j < i; j++){\n\t\t\t\tsum += L.m[i][j]*d[j];\n\t\t\t}\n\t\t\td[i] = b[i] - sum;\n\t\t}\n\n\t\tvar x = [];\n\t\tx[U.rows - 1] = d[L.rows - 1]/U.m[U.rows-1][U.rows-1];\n\t\tfor(i = U.rows - 2; i >= 0; i--){\n\t\t\tsum = 0;\n\t\t\tfor(j = U.rows - 1; j > i; j--){\n\t\t\t\tsum += U.m[i][j] * x[j];\n\t\t\t}\n\t\t\tx[i] = (d[i] - sum)/U.m[i][i];\n\t\t}\n\n\t\treturn x;\n\t}", "title": "" }, { "docid": "9bff80d7d1cbd739dd04455c8e02e221", "score": "0.5102501", "text": "function ln( y, pr ) {\r\n var c, c0, denom, e, num, rep, sd, sum, t, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xc = x['c'],\r\n Decimal = x['constructor'],\r\n one = Decimal['ONE'],\r\n rm = Decimal['rounding'],\r\n precision = Decimal['precision'];\r\n\r\n // x < 0 or +-Infinity/NaN or 0 or 1.\r\n if ( x['s'] < 0 || !xc || !xc[0] || !x['e'] && xc[0] == 1 && xc.length == 1 ) {\r\n\r\n return new Decimal( xc && !xc[0] ? -1 / 0 : x['s'] != 1 ? NaN : xc ? 0 : x );\r\n }\r\n\r\n if ( pr == null ) {\r\n external = false;\r\n sd = precision;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n Decimal['precision'] = sd += guard;\r\n\r\n c = coefficientToString(xc);\r\n c0 = c.charAt(0);\r\n\r\n if ( Math.abs( e = x['e'] ) < 1.5e15 ) {\r\n\r\n /*\r\n Argument reduction.\r\n The series converges faster the closer the argument is to 1, so using\r\n ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n multiply the argument by itself until the leading digits of the significand are 7, 8,\r\n 9, 10, 11, 12 or 13, recording the number of multiplications so the sum of the series\r\n can later be divided by this number, then separate out the power of 10 using\r\n ln(a*10^b) = ln(a) + b*ln(10).\r\n */\r\n\r\n // max n is 21 ( gives 0.9, 1.0 or 1.1 ) ( 9e15 / 21 = 4.2e14 ).\r\n //while ( c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1 ) {\r\n // max n is 6 ( gives 0.7 - 1.3 )\r\n while ( c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3 ) {\r\n x = x['times'](y);\r\n c = coefficientToString( x['c'] );\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x['e'];\r\n\r\n if ( c0 > 1 ) {\r\n x = new Decimal( '0.' + c );\r\n e++;\r\n } else {\r\n x = new Decimal( c0 + '.' + c.slice(1) );\r\n }\r\n } else {\r\n\r\n /*\r\n The argument reduction method above may result in overflow if the argument y is a\r\n massive number with exponent >= 1500000000000000 ( 9e15 / 6 = 1.5e15 ), so instead\r\n recall this function using ln(x*10^e) = ln(x) + e*ln(10).\r\n */\r\n x = new Decimal( c0 + '.' + c.slice(1) );\r\n\r\n if ( sd + 2 > LN10.length ) {\r\n ifExceptionsThrow( Decimal, 1, sd + 2, 'ln' );\r\n }\r\n\r\n x = ln( x, sd - guard )['plus'](\r\n new Decimal( LN10.slice( 0, sd + 2 ) )['times']( e + '' )\r\n );\r\n\r\n Decimal['precision'] = precision;\r\n\r\n return pr == null ? rnd( x, precision, rm, external = true ) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n /*\r\n Taylor series.\r\n ln(y) = ln( (1 + x)/(1 - x) ) = 2( x + x^3/3 + x^5/5 + x^7/7 + ... )\r\n where\r\n x = (y - 1)/(y + 1) ( |x| < 1 )\r\n */\r\n sum = num = x = div( x['minus'](one), x['plus'](one), sd, 1 );\r\n x2 = rnd( x['times'](x), sd, 1 );\r\n denom = 3;\r\n\r\n for ( ; ; ) {\r\n num = rnd( num['times'](x2), sd, 1 );\r\n t = sum['plus']( div( num, new Decimal(denom), sd, 1 ) );\r\n\r\n if ( coefficientToString( t['c'] ).slice( 0, sd ) ===\r\n coefficientToString( sum['c'] ).slice( 0, sd ) ) {\r\n sum = sum['times'](2);\r\n\r\n /*\r\n Reverse the argument reduction. Check that e is not 0 because, as well as\r\n preventing an unnecessary calculation, -0 + 0 = +0 and to ensure correct\r\n rounding later -0 needs to stay -0.\r\n */\r\n if ( e !== 0 ) {\r\n\r\n if ( sd + 2 > LN10.length ) {\r\n ifExceptionsThrow( Decimal, 1, sd + 2, 'ln' );\r\n }\r\n\r\n sum = sum['plus'](\r\n new Decimal( LN10.slice( 0, sd + 2 ) )['times']( e + '' )\r\n );\r\n }\r\n\r\n sum = div( sum, new Decimal(n), sd, 1 );\r\n\r\n /*\r\n Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n been repeated previously) and the first 4 rounding digits 9999?\r\n\r\n If so, restart the summation with a higher precision, otherwise\r\n e.g. with precision: 12, rounding: 1\r\n ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n\r\n sd - guard is the index of first rounding digit.\r\n */\r\n if ( pr == null ) {\r\n\r\n if ( checkRoundingDigits( sum['c'], sd - guard, rm, rep ) ) {\r\n Decimal['precision'] = sd += guard;\r\n t = num = x = div( x1['minus'](one), x1['plus'](one), sd, 1 );\r\n x2 = rnd( x['times'](x), sd, 1 );\r\n denom = rep = 1;\r\n } else {\r\n\r\n return rnd( sum, Decimal['precision'] = precision, rm, external = true );\r\n }\r\n } else {\r\n Decimal['precision'] = precision;\r\n\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denom += 2;\r\n }\r\n }", "title": "" }, { "docid": "9bff80d7d1cbd739dd04455c8e02e221", "score": "0.5102501", "text": "function ln( y, pr ) {\r\n var c, c0, denom, e, num, rep, sd, sum, t, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xc = x['c'],\r\n Decimal = x['constructor'],\r\n one = Decimal['ONE'],\r\n rm = Decimal['rounding'],\r\n precision = Decimal['precision'];\r\n\r\n // x < 0 or +-Infinity/NaN or 0 or 1.\r\n if ( x['s'] < 0 || !xc || !xc[0] || !x['e'] && xc[0] == 1 && xc.length == 1 ) {\r\n\r\n return new Decimal( xc && !xc[0] ? -1 / 0 : x['s'] != 1 ? NaN : xc ? 0 : x );\r\n }\r\n\r\n if ( pr == null ) {\r\n external = false;\r\n sd = precision;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n Decimal['precision'] = sd += guard;\r\n\r\n c = coefficientToString(xc);\r\n c0 = c.charAt(0);\r\n\r\n if ( Math.abs( e = x['e'] ) < 1.5e15 ) {\r\n\r\n /*\r\n Argument reduction.\r\n The series converges faster the closer the argument is to 1, so using\r\n ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n multiply the argument by itself until the leading digits of the significand are 7, 8,\r\n 9, 10, 11, 12 or 13, recording the number of multiplications so the sum of the series\r\n can later be divided by this number, then separate out the power of 10 using\r\n ln(a*10^b) = ln(a) + b*ln(10).\r\n */\r\n\r\n // max n is 21 ( gives 0.9, 1.0 or 1.1 ) ( 9e15 / 21 = 4.2e14 ).\r\n //while ( c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1 ) {\r\n // max n is 6 ( gives 0.7 - 1.3 )\r\n while ( c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3 ) {\r\n x = x['times'](y);\r\n c = coefficientToString( x['c'] );\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x['e'];\r\n\r\n if ( c0 > 1 ) {\r\n x = new Decimal( '0.' + c );\r\n e++;\r\n } else {\r\n x = new Decimal( c0 + '.' + c.slice(1) );\r\n }\r\n } else {\r\n\r\n /*\r\n The argument reduction method above may result in overflow if the argument y is a\r\n massive number with exponent >= 1500000000000000 ( 9e15 / 6 = 1.5e15 ), so instead\r\n recall this function using ln(x*10^e) = ln(x) + e*ln(10).\r\n */\r\n x = new Decimal( c0 + '.' + c.slice(1) );\r\n\r\n if ( sd + 2 > LN10.length ) {\r\n ifExceptionsThrow( Decimal, 1, sd + 2, 'ln' );\r\n }\r\n\r\n x = ln( x, sd - guard )['plus'](\r\n new Decimal( LN10.slice( 0, sd + 2 ) )['times']( e + '' )\r\n );\r\n\r\n Decimal['precision'] = precision;\r\n\r\n return pr == null ? rnd( x, precision, rm, external = true ) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n /*\r\n Taylor series.\r\n ln(y) = ln( (1 + x)/(1 - x) ) = 2( x + x^3/3 + x^5/5 + x^7/7 + ... )\r\n where\r\n x = (y - 1)/(y + 1) ( |x| < 1 )\r\n */\r\n sum = num = x = div( x['minus'](one), x['plus'](one), sd, 1 );\r\n x2 = rnd( x['times'](x), sd, 1 );\r\n denom = 3;\r\n\r\n for ( ; ; ) {\r\n num = rnd( num['times'](x2), sd, 1 );\r\n t = sum['plus']( div( num, new Decimal(denom), sd, 1 ) );\r\n\r\n if ( coefficientToString( t['c'] ).slice( 0, sd ) ===\r\n coefficientToString( sum['c'] ).slice( 0, sd ) ) {\r\n sum = sum['times'](2);\r\n\r\n /*\r\n Reverse the argument reduction. Check that e is not 0 because, as well as\r\n preventing an unnecessary calculation, -0 + 0 = +0 and to ensure correct\r\n rounding later -0 needs to stay -0.\r\n */\r\n if ( e !== 0 ) {\r\n\r\n if ( sd + 2 > LN10.length ) {\r\n ifExceptionsThrow( Decimal, 1, sd + 2, 'ln' );\r\n }\r\n\r\n sum = sum['plus'](\r\n new Decimal( LN10.slice( 0, sd + 2 ) )['times']( e + '' )\r\n );\r\n }\r\n\r\n sum = div( sum, new Decimal(n), sd, 1 );\r\n\r\n /*\r\n Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n been repeated previously) and the first 4 rounding digits 9999?\r\n\r\n If so, restart the summation with a higher precision, otherwise\r\n e.g. with precision: 12, rounding: 1\r\n ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n\r\n sd - guard is the index of first rounding digit.\r\n */\r\n if ( pr == null ) {\r\n\r\n if ( checkRoundingDigits( sum['c'], sd - guard, rm, rep ) ) {\r\n Decimal['precision'] = sd += guard;\r\n t = num = x = div( x1['minus'](one), x1['plus'](one), sd, 1 );\r\n x2 = rnd( x['times'](x), sd, 1 );\r\n denom = rep = 1;\r\n } else {\r\n\r\n return rnd( sum, Decimal['precision'] = precision, rm, external = true );\r\n }\r\n } else {\r\n Decimal['precision'] = precision;\r\n\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denom += 2;\r\n }\r\n }", "title": "" }, { "docid": "1f7bddd29744dd4db68e5fb56744a879", "score": "0.50972295", "text": "function linearRegression(x, y){\n let lr = {};\n let n = y.length;\n let sum_x = 0;\n let sum_y = 0;\n let sum_xy = 0;\n let sum_xx = 0;\n let sum_yy = 0;\n\n for (let i = 0; i < y.length; i++) {\n\n sum_x += x[i];\n sum_y += y[i];\n sum_xy += (x[i]*y[i]);\n sum_xx += (x[i]*x[i]);\n sum_yy += (y[i]*y[i]);\n };\n\n lr['slope'] = (n * sum_xy - sum_x * sum_y) / (n * sum_xx - sum_x * sum_x);\n lr['intercept'] = (sum_y - lr.slope * sum_x)/n;\n lr['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)\n *(n*sum_yy-sum_y*sum_y)),2);\n\n return lr;\n}", "title": "" }, { "docid": "5dab45cd400a57fb6ca5b725514a061c", "score": "0.5070864", "text": "function linearRegression(y,x){\n var lr = {};\n var n = y.length;\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_xx = 0;\n var sum_yy = 0;\n \n for (var i = 0; i < y.length; i++) {\n sum_x += x[i];\n sum_y += y[i];\n sum_xy += (x[i]*y[i]);\n sum_xx += (x[i]*x[i]);\n sum_yy += (y[i]*y[i]);\n } \n \n lr['slope'] = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);\n lr['intercept'] = (sum_y - lr.slope * sum_x)/n;\n lr['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);\n \n return lr;\n }", "title": "" }, { "docid": "1e021758a95f46ebd9d08801a6d452bf", "score": "0.5066917", "text": "function linearRegression(y, scatterPlot){\n // let lr = {}; defined globally\n let n = 0;\n let sum_x = 0;\n let sum_y = 0;\n let sum_xy = 0;\n let sum_xx = 0;\n let sum_yy = 0;\n\n for (i = 78; i < y.length; i++) {\n // skip days we didn't collect data\n if (!(isNaN(y[i]))){\n sum_x += day;\n sum_y += y[i];\n sum_xy += (day*y[i]);\n sum_xx += (day*day);\n sum_yy += (y[i]*y[i]);\n n += 1;\n\n scatterPlot.push({x: day, y: y[i]});\n }\n\n day += 1;\n }\n\n lr['slope'] = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);\n lr['intercept'] = (sum_y - lr.slope * sum_x)/n;\n lr['r2'] = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);\n }", "title": "" }, { "docid": "c14e36ddf754e875f5b4b8530b1c6eb3", "score": "0.5052253", "text": "function linreg(values_x, values_y) {\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_xx = 0;\n var count = 0;\n\n /*\n * We'll use those variables for faster read/write access.\n */\n var x = 0;\n var y = 0;\n var values_length = values_x.length;\n\n if (values_length != values_y.length) {\n throw new Error('The parameters values_x and values_y need to have same size!');\n }\n\n /*\n * Nothing to do.\n */\n if (values_length === 0) {\n return [ [], [] ];\n }\n\n /*\n * Calculate the sum for each of the parts necessary.\n */\n for (var v = 0; v < values_length; v++) {\n x = values_x[v];\n y = values_y[v];\n sum_x += x;\n sum_y += y;\n sum_xx += x*x;\n sum_xy += x*y;\n count++;\n }\n\n /*\n * Calculate m and b for the formular:\n * y = x * m + b\n */\n var m = (count*sum_xy - sum_x*sum_y) / (count*sum_xx - sum_x*sum_x);\n var b = (sum_y/count) - (m*sum_x)/count;\n\n return [m, b];\n}", "title": "" }, { "docid": "982263ecf5bdb58646c1650384c6cd6e", "score": "0.5036307", "text": "function solve() \n{ \n let x = document.getElementById(\"result\").value;\n let y = new Function(\"return \" + x)();\n document.getElementById(\"result\").value = y;\n}", "title": "" }, { "docid": "f52fb7fc3aa13d167cb9707066813c0a", "score": "0.5026242", "text": "function calculate(stringEquation) {\n\n // If first number is negetive add a zero in the begining\n // ex: (-5+5) => (0-5+5)\n if(stringEquation[0] === '-') {\n stringEquation = '0' + stringEquation;\n }\n\n // helper function for\n // do multiplication and devision from left to right\n const multiplyAndDivide = (ex) => { \n const operators = ex.split(/[0-9]+[.]*[0-9]*/);\n return ex.split(/[x|/]/).reduce( (prev, cur, idx) => (operators[idx] === 'x') ? Number(prev)*Number(cur) : Number(prev)/Number(cur) )\n }\n\n // 1. split the full equation by (+ or -) symbols into parts that only contain numbers and (x, /)symbols\n // ex: '1+2x3+4/5+6-7' => ['1', '2x3', '4/5', '6', '7']\n // 2. then map each element of the above array by multiplyAndDivide function\n // ex: '2x3' => '6'\n // ex: '4/5' => '0.8'\n // 3. then add and subtract from left to right\n const subtractAndAddAfterMultyplyAndDivide = (ex) => { \n const operators = ex.split(/[0-9]+[.]*[0-9]*/);\n return ex.split(/[+|-]/).map( (cur) => multiplyAndDivide(cur)).reduce( (prev, cur, idx) => (operators[idx] === '+') ? Number(prev)+Number(cur) : Number(prev)-Number(cur) )\n }\n\n return subtractAndAddAfterMultyplyAndDivide(stringEquation);\n }", "title": "" }, { "docid": "6323dae3fa47fb281403963308e7e015", "score": "0.5022618", "text": "function solve(operator, b, a){\n a = Number(a);\n b = Number(b);\n switch(operator){\n case '+':\n return a+b;\n case '-':\n return a-b;\n case '×':\n return a*b;\n case '/':\n if (b==0){\n alert(\"Can't devide by zero!!!\");\n return 0;\n }\n return a/b;\n default:\n alert(\"invalid operator in the expression!!!\");\n return 0;\n }\n}", "title": "" }, { "docid": "9983c3c9aded2c6c80afc0c5169f3303", "score": "0.5017098", "text": "evaluateFunction(){\r\n let equation = document.querySelector(\"#equation\");\r\n\r\n let func = equation.value;\r\n const node = math.parse(func);\r\n const code = node.compile();\r\n this.startY = code.evaluate({x: -8});\r\n this.endY = code.evaluate({x: 8});\r\n this.drawLine([-8, this.startY],[8, this.endY]);\r\n this.posX = this.startPos[0];\r\n this.posY = this.startPos[1];\r\n\r\n }", "title": "" }, { "docid": "ccea298eb9ef175e5b64d7360bb03545", "score": "0.50115377", "text": "function solveQuadEquation (a, b, c){\n // the quadratic equation can be solved by\n // x = (-b +- sqrt(b**2 -4ac)/2a)\n // let us consider the sqare root section to delta\n // because they can have positive, negative and zero value\n\n let delta = (b **2) - (4 * (a * c));\n\n if(delta === 0) {\n let result = -b / (2 * a);\n return `the solution is ${result}`;\n\n } else if (delta > 0) {\n let result1 = (-b + Math.sqrt(delta)) / (2*a);\n let result2 = (-b - Math.sqrt(delta)) / (2*a);\n return `there are two solutions: ${result1} and ${result2}`;\n \n }else{\n return `the solution does not exist`;\n }\n\n}", "title": "" }, { "docid": "812dc69a1a38c0c568fdc04922296485", "score": "0.50103927", "text": "function linear(t) {\r\n return +t;\r\n}", "title": "" }, { "docid": "812dc69a1a38c0c568fdc04922296485", "score": "0.50103927", "text": "function linear(t) {\r\n return +t;\r\n}", "title": "" }, { "docid": "a72d19d1ccc9d967eca343dc6c8b910e", "score": "0.5003764", "text": "function xLinearScale(val,iL,iH,oL,oH)\r\n{\r\n var m=(oH-oL)/(iH-iL);\r\n var b=oL-(iL*m);\r\n return m*val+b;\r\n}", "title": "" }, { "docid": "820b0ee4b76ae60cd915565aa627ed90", "score": "0.5000407", "text": "function linear(t) {\n return +t;\n}", "title": "" }, { "docid": "820b0ee4b76ae60cd915565aa627ed90", "score": "0.5000407", "text": "function linear(t) {\n return +t;\n}", "title": "" }, { "docid": "820b0ee4b76ae60cd915565aa627ed90", "score": "0.5000407", "text": "function linear(t) {\n return +t;\n}", "title": "" }, { "docid": "820b0ee4b76ae60cd915565aa627ed90", "score": "0.5000407", "text": "function linear(t) {\n return +t;\n}", "title": "" }, { "docid": "820b0ee4b76ae60cd915565aa627ed90", "score": "0.5000407", "text": "function linear(t) {\n return +t;\n}", "title": "" }, { "docid": "832bf250db2ade97b30ed5cfb9eeb444", "score": "0.4995784", "text": "function calculateEquation() {\n let number = 0;\n\n if (input[input.length - 1].operator === '+') {\n number = Number(input[input.length - 1].firstNumber) + Number(input[input.length - 1].secondNumber);\n } else if (input[input.length - 1].operator === '-') {\n number = input[input.length - 1].firstNumber - input[input.length - 1].secondNumber;\n } else if (input[input.length - 1].operator === '*') {\n number = input[input.length - 1].firstNumber * input[input.length - 1].secondNumber;\n } else if (input[input.length - 1].operator === '/') {\n number = input[input.length - 1].firstNumber / input[input.length - 1].secondNumber;\n }\n results.push(number);\n\n}", "title": "" }, { "docid": "4dd23880d4fc92e036c820b1c585be51", "score": "0.49927518", "text": "function lineval(s, e, x) {\n var sl = (e[1]-s[1])/(e[0]-s[0])\n return s[1] + sl * (x-s[0])\n}", "title": "" }, { "docid": "35c7da159cdc7a5d29f23bbd5d9d69d5", "score": "0.49887827", "text": "function solveQuadratic(a,b,c)\n{\n let discriminant = b*b - 4*a*c,x1,x2,realPart,imaginaryPart,root1,root2;\n if (discriminant>0) \n {\n x1 = (-b + Math.sqrt(discriminant)) / (2*a);\n x2 = (-b - Math.sqrt(discriminant)) / (2*a);\n return {x1,x2}\n }\n else if (discriminant == 0) \n {\n x1 = (-b + Math.sqrt(discriminant)) / (2*a);\n return x1 \n }\n else \n {\n realPart = -b/(2*a);\n imaginaryPart =Math.sqrt(-discriminant)/(2*a);\n root1=realPart+'+'+imaginaryPart+'i'\n root2=realPart+'-'+imaginaryPart+'i'\n return {root1,root2}\n }\n}", "title": "" }, { "docid": "6c1f3221853fb857e6897ed11494ab37", "score": "0.49683392", "text": "evaluateLine ( n, _cx, _cy, _cxx, _cxy ){\n // ############ TODO \n }", "title": "" }, { "docid": "42cd0e9efd004198470f87ed967e63a5", "score": "0.4955446", "text": "function equation (){\n let answer = (30+2)*20 /10**2\n console.log(answer);\n }", "title": "" }, { "docid": "824956ed94fa51983f1fba0127264ba6", "score": "0.49553204", "text": "function solve_Pell(d, is_m1) {\r\n\t;\r\n}", "title": "" }, { "docid": "bf2548ac17e775b81343803097ca1266", "score": "0.4946626", "text": "function QuadraticEquation(a, b, c) {\n\tconsole.log('Quadratic Equation');\n\t\n\tvar D = b*b - 4*a*c;\n\t\n\tif ((D) < 0) {\n\t\tconsole.log('No real roots.');\n\t}\n\telse if (D == 0) {\n\t\tconsole.log('x1 = x2 = ' + ( (-b)/(2*a)) );\n\t}\n\telse {\n\t\tvar x1 = (-b + Math.sqrt(D)) / (2 * a);\n\t\tvar x2 = (-b - Math.sqrt(D)) / (2 * a);\n\t\tconsole.log('x1 = ' + x1);\n\t\tconsole.log('x2 = ' + x2);\n\t}\n}", "title": "" }, { "docid": "43c1ef9e1a5ee659aab87d2bc3573fcd", "score": "0.49373952", "text": "function getTheModel() {\n // Lineal function.\n var a1 = calculateA(X, Y);\n var b1 = calculateB(X, Y);\n var r1 = calculateR(X, Y);\n $('#linA').text(Math.round(a1*100)/100);\n $('#linB').text(Math.round(b1*100)/100);\n $('#linR').text(Math.round(r1*1000000)/1000000);\n\n // Potential function.\n var ea2=0;//variable para hacer el cambio d evar e^A*\n \n var a2 = calculateA(lnX, lnY);\n var b2 = calculateB(lnX, lnY);\n var r2 = calculateR(lnX, lnY);\n ea2=Math.pow(Math.E,a2);\n $('#potA').text(Math.round(ea2*100)/100);\n $('#potB').text(Math.round(b2*100)/100);\n $('#potR').text(Math.round(r2*1000000)/1000000);\n\n // Logarithmic function.\n var a3 = calculateA(lnX, Y);\n var b3 = calculateB(lnX, Y);\n var r3 = calculateR(lnX, Y);\n $('#logA').text(Math.round(a3*100)/100);\n $('#logB').text(Math.round(b3*100)/100);\n $('#logR').text(Math.round(r3*1000000)/1000000);\n\n // Exponential function.\n var a4 = calculateA(X, lnY);\n var b4 = calculateB(X, lnY);\n var r4 = calculateR(X, lnY);\n var ea=0;//variable para hacer el cambio d evar e^A*\n ea=Math.pow(Math.E,a4);\n $('#expA').text(Math.round(ea*100)/100);\n $('#expB').text(Math.round(b4*100)/100);\n $('#expR').text(Math.round(r4*1000000)/1000000);\n\n if(Math.abs(1-r1)<Math.abs(1-r2) && Math.abs(1-r1)<Math.abs(1-r3) && Math.abs(1-r1)<Math.abs(1-r4)) {\n // It's selected the lineal model.\n $('#collapseDecisionTable').text('Se eligió el modelo lineal');\n calculateA(X, Y);\n calculateB(X, Y);\n linealFunctionPoints();\n\n var sa = Sa(a1, b1, X, Y);\n var sb = Sb(a1, b1, X, Y);\n $('#saValue').text(sa);\n $('#sbValue').text(sb);\n } else if(Math.abs(1-r2)<Math.abs(1-r1) && Math.abs(1-r2)<Math.abs(1-r3) && Math.abs(1-r2)<Math.abs(1-r4)) {\n // It's selected the potential model.\n $('#collapseDecisionTable').text('Se eligió el modelo potencial');\n calculateA(lnX, lnY);\n calculateB(lnX, lnY);\n potentialFunctionPoints();\n var sa = uncertaintyA(ea2,b2,lnX,lnY);\n var sb = uncertaintyB(ea2,b2,lnX,lnY);\n\n $('#saValue').text(sa);\n $('#sbValue').text(sb);\n $('#saValue2').text(Math.round(sa*100)/100);\n $('#sbValue2').text(Math.round(sb*100)/100);\n } else if(Math.abs(1-r3)<Math.abs(1-r1) && Math.abs(1-r3)<Math.abs(1-r2) && Math.abs(1-r3)<Math.abs(1-r4)) {\n // It's selected the logarithmic model.\n $('#collapseDecisionTable').text('Se eligió el modelo logarítmico');\n calculateA(lnX, Y);\n calculateB(lnX, Y);\n logarithmicFunctionPoints();\n } else if(Math.abs(1-r4)<Math.abs(1-r1) && Math.abs(1-r4)<Math.abs(1-r2) && Math.abs(1-r4)<Math.abs(1-r3)) {\n // It's selected the exponential model.\n $('#collapseDecisionTable').text('Se eligió el modelo exponencial');\n calculateA(X, lnY);\n calculateB(X, lnY);\n exponentialFunctionPoints();\n }\n }", "title": "" }, { "docid": "97747b58ccbde9310ea968534c33cd23", "score": "0.49371788", "text": "function lineSlope(l){\n\treturn slope(l.a,l.b);\n}", "title": "" }, { "docid": "bb85a953d546a404ecb56f3522fb04b0", "score": "0.49118236", "text": "function solveQuadratic(a, b, c) {\n var x0;\n var x1;\n var discr = b * b - 4 * a * c;\n if (discr < 0) {\n return [];\n } else if (discr === 0) {\n return [-0.5 * b / a];\n } else {\n var q = (b > 0) ?\n -0.5 * (b + Math.sqrt(discr)) :\n -0.5 * (b - Math.sqrt(discr));\n x0 = q / a;\n x1 = c / q;\n }\n if (x0 > x1) {\n var tmp = x0;\n x0 = x1;\n x1 = tmp;\n }\n return [x0, x1];\n}", "title": "" }, { "docid": "26d9f8de9922568e7af4c1e48e8af0ff", "score": "0.4902621", "text": "function solve() {\n function doOutput(nodeId, val, suffix) {\n if (typeof val == \"object\" && val.length == 2) { // Array\n setElementText(nodeId, formatNumber(val[0]) + suffix);\n setElementText(nodeId + \"2\", formatNumber(val[1]) + suffix);\n twosoln = true;\n } else if (typeof val == \"number\") {\n setElementText(nodeId, formatNumber(val) + suffix);\n setElementText(nodeId + \"2\", formatNumber(val) + suffix);\n } else\n throw \"Assertion error\";\n }\n\n try {\n // Get input and solve\n var a = getInputNumber(\"sideAin\");\n var b = getInputNumber(\"sideBin\");\n var c = getInputNumber(\"sideCin\");\n var A = getInputNumber(\"angleAin\");\n var B = getInputNumber(\"angleBin\");\n var C = getInputNumber(\"angleCin\");\n var answer = solveTriangle(a, b, c, A, B, C);\n solution = answer.slice(0, 6); // Global variable for mouse hover\n\n // Set outputs\n setElementText(\"status\", answer[7]);\n var twosoln = false; // Is set to true by doOutput() if any answer item is a length-2 array\n doOutput(\"sideAout\", answer[0], \"\");\n doOutput(\"sideBout\", answer[1], \"\");\n doOutput(\"sideCout\", answer[2], \"\");\n doOutput(\"angleAout\", answer[3], DEGREE);\n doOutput(\"angleBout\", answer[4], DEGREE);\n doOutput(\"angleCout\", answer[5], DEGREE);\n doOutput(\"areaout\", answer[6], \"\");\n if (twosoln)\n document.getElementById(\"formtable\").classList.remove(\"onesoln\");\n else\n document.getElementById(\"formtable\").classList.add(\"onesoln\");\n\n } catch (e) {\n clearOutputs();\n setElementText(\"status\", e);\n }\n}", "title": "" }, { "docid": "d411db6b011be30281894b1d910ddfe1", "score": "0.48996842", "text": "function solve(formula, index) {\n var multiplier = 1;\n element = '';\n for (var i = 0; i < formula.length; i++) {\n if (formula[i] === formula[i].toUpperCase() && isNaN(formula[i])) {\n if (element) {\n if (element in res) {\n res[element] += multiplier * index;\n } else {\n res[element] = multiplier * index;\n }\n element = '';\n multiplier = 1;\n }\n element += formula[i];\n } else if (\n formula[i] === formula[i].toLowerCase() &&\n element.length === 1 &&\n isNaN(formula[i])\n ) {\n element += formula[i];\n } else if (!isNaN(formula[i])) {\n multiplier = parseInt(formula[i]);\n if (element in res) {\n res[element] += multiplier * index;\n } else {\n res[element] = multiplier * index;\n }\n element = '';\n multiplier = 1;\n }\n }\n if (element) {\n if (element in res) {\n res[element] += multiplier * index;\n } else {\n res[element] = multiplier * index;\n }\n element = '';\n multiplier = 1;\n }\n }", "title": "" }, { "docid": "85f4acd704ffab2ca99b4172f8886020", "score": "0.48968256", "text": "function main()\n{\n // TODO: Deal with incorrect input\n// try\n// {\n var eq = formatEq(document.getElementById(\"eqInput\").value);\n var xMin = parseFloat(document.getElementById(\"xMinInput\").value);\n var xMax = parseFloat(document.getElementById(\"xMaxInput\").value);\n var xScale = parseFloat(document.getElementById(\"xScaleInput\").value);\n var yMin = parseFloat(document.getElementById(\"yMinInput\").value);\n var yMax = parseFloat(document.getElementById(\"yMaxInput\").value);\n var yScale = parseFloat(document.getElementById(\"yScaleInput\").value);\n \n drawGraph(xMin, xMax, xScale, yMin, yMax, yScale, eq);\n console.log(\"Eq: \" + eq);\n console.log(\"Re: \" + calcEq(eq));\n// }\n// \n// catch(e)\n// {\n// alert(\"Invalid Input!\");\n// }\n}", "title": "" }, { "docid": "afcad7766c8d785605c183e60c3068e2", "score": "0.48901716", "text": "function solve(){\r\n let x=document.getElementById(\"input\").value;\r\n let y=eval(x);\r\n document.getElementById(\"input\").value=y\r\n}", "title": "" }, { "docid": "5b3875c831dc9fd8a3636d655e9a37fe", "score": "0.48875928", "text": "function f(n)\n{\n\tfm = document.forms[1];\n\tvar eq = fm.equation.value;\n\treturn Parser.evaluate(eq, {x: n});\n}", "title": "" }, { "docid": "f5802020366e862f600b3bf11b6ef4a1", "score": "0.48845223", "text": "function invLinForm(a,b)\n{\n\tif ((a != null) && (b != null)) {\n\t\treturn function(y) {return (y-b)/a;};\n\t} else if (a != null) {\n\t\treturn function(y) {return y/a;};\n\t} \n\talert(\"invLinForm - bad args a = \"+a+\" b = \"+b);\n}", "title": "" }, { "docid": "ad3aaf5c6eafe8531b1ab5abd6a623d5", "score": "0.48697546", "text": "function convertLinear(val, from, to) {\r\n let v = -Infinity;\r\n \r\n \r\n \r\n //Get the object $set by searching the Units dataset for the FROM and TO short-hand units.\r\n let $set = getTypeofUnits(from, to);\r\n\r\n //If the set contains errors, display the errors in the log\r\n if ($set.errors.length > 0) {\r\n logError($set.errors);\r\n return -Infinity;\r\n }\r\n\r\n //At this point, we do not have errors and we have retrieved the FROM and TO dataset objects.\r\n //Calculate the converted value.\r\n\tif ($set.to.xval != null && $set.from.xval != null && !isNaN($set.to.xval) && !isNaN($set.from.xval)) {\r\n\t v = parseFloat(val * $set.to.xval / $set.from.xval);\r\n\t}\r\n \r\n\r\n //return the value\r\n return v;\r\n }", "title": "" }, { "docid": "67c4720de7841d4d9196c8397a288f76", "score": "0.48639342", "text": "function funcQuadratic() {\n var a = document.getElementById(\"numA06\").value * 1;\n var b = document.getElementById(\"numB06\").value * 1;\n var c = document.getElementById(\"numC06\").value * 1;\n var rootX1, rootX2;\n\n // Δ = b2 - 4ac\n var discriminant = (b * b) - (4 * a * c);\n\n //When Δ<0, there are no real roots, there are 2 complex roots x1=(-b+i√-Δ)/(2a) and x2=(-b-i√-Δ)/(2a).\n if (discriminant < 0) {\n console.log('no real roots');\n }\n // When Δ=0, there is one root x1=x2=-b/(2a).\n else if (discriminant === 0) {\n rootX1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n rootX2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n console.log('x1=x2=' + rootX1);\n }\n // When Δ>0, there are 2 real roots x1=(-b+√Δ)/(2a) and x2=(-b-√Δ)/(2a).\n else {\n rootX1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n rootX2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n console.log('x1=' + rootX2 + ';' + 'x2=' + rootX1);\n }\n}", "title": "" }, { "docid": "d98b4cec6779717059585d7296f30488", "score": "0.48619887", "text": "function calcLinearRegression(displacements, decimal_dates) {\n data = [];\n for (i = 0; i < decimal_dates.length; i++) {\n // data.push([displacements[i], decimal_dates[i]]);\n data.push([decimal_dates[i], displacements[i]]);\n }\n var result = regression('linear', data);\n return result;\n}", "title": "" }, { "docid": "71c03ed1a9d83fa5cdd94670e581223e", "score": "0.48505726", "text": "xn_1(x, y, a) {\n return Math.pow(x, 2) - Math.pow(y, 2) + a;\n }", "title": "" }, { "docid": "d4fbbd4929d3a5fe33ed4dcfa99f846a", "score": "0.48485628", "text": "function solve() {\n\n\n\n}", "title": "" }, { "docid": "5b41d32b69557e9888b804bede385095", "score": "0.48466256", "text": "function regLine(x) {\n return (parseFloat(x) * slope) + intercept;\n }", "title": "" }, { "docid": "8996677d401d01195e3f6ad994d827f8", "score": "0.48455402", "text": "function calcEclLon(ry) {\n var ret = 280.4603+360.00769*ry\n +(1.9146-0.00005*ry)*Math.sin((357.538+359.991*ry)*rpd)\n +0.0200*Math.sin((355.05+ 719.981*ry)*rpd)\n +0.0048*Math.sin((234.95+ 19.341*ry)*rpd)\n +0.0020*Math.sin((247.1 + 329.64 *ry)*rpd)\n +0.0018*Math.sin((297.8 +4452.67 *ry)*rpd)\n +0.0018*Math.sin((251.3 + 0.20 *ry)*rpd)\n +0.0015*Math.sin((343.2 + 450.37 *ry)*rpd)\n +0.0013*Math.sin(( 81.4 + 225.18 *ry)*rpd)\n +0.0008*Math.sin((132.5 + 659.29 *ry)*rpd)\n +0.0007*Math.sin((153.3 + 90.38 *ry)*rpd)\n +0.0007*Math.sin((206.8 + 30.35 *ry)*rpd)\n +0.0006*Math.sin(( 29.8 + 337.18 *ry)*rpd)\n +0.0005*Math.sin((207.4 + 1.50 *ry)*rpd)\n +0.0005*Math.sin((291.2 + 22.81 *ry)*rpd)\n +0.0004*Math.sin((234.9 + 315.56 *ry)*rpd)\n +0.0004*Math.sin((157.3 + 299.30 *ry)*rpd)\n +0.0004*Math.sin(( 21.1 + 720.02 *ry)*rpd)\n +0.0003*Math.sin((352.5 +1079.97 *ry)*rpd)\n +0.0003*Math.sin((329.7 + 44.43 *ry)*rpd);\n return ret - Math.floor(ret/360.0)*360.0;\n }", "title": "" }, { "docid": "5a7ae7f3af907e0198c1b5b471aa3810", "score": "0.48410347", "text": "function cylindPlot(){\n resetRotation();\n document.getElementById(\"errorString\").innerHTML=\"\"; //clear errors \n\n verts = new Float32Array(3*NUM_Z*PRECISION*2*RAD_PRECISION); //3 values for each point, 100 points\n //alert(verts.length);\n var index = 0; //keeps track of current vertex value\n var alg = new Algebra(document.getElementById(\"cylindrical-expression\").value);\n if(alg.isError()){\n console.log(\"r(\\u03b8): \"+alg.getErrorString());\n document.getElementById(\"errorString\").innerHTML=\"r(\\u03b8): \"+alg.getErrorString();\n }\n var expression = alg.getJS();\n //expression = expression.replace(new RegExp(\"tan\", \"g\"), \"TAN\")\n // .replace(new RegExp(\"sqrt\", \"g\"), \"SQRT\");\n\n for( t=0; t < PI*2-PI/RAD_PRECISION; t+=PI/RAD_PRECISION){\n for( z=0; z<NUM_Z; z+=1/PRECISION){\n var r = eval(expression);\n verts[index++] = r*cos(t);\n verts[index++] = z-NUM_Z*0.5;\n verts[index++] = r*sin(t);\n }\n }\n\n draw(gl, verts);\n}", "title": "" } ]
0c072e1fd2aa812dfeee0ac21fa2874b
This function is called after the html is loaded. To run any function after the html document is loaded call it inside the main function
[ { "docid": "e3b5f852b7539229e00add332bb53884", "score": "0.0", "text": "function main() {\n checkActive();\n scrollAnimate();\n}", "title": "" } ]
[ { "docid": "0324414ec663e80d2ff053b51865890d", "score": "0.69889146", "text": "function init(){\n awesome();\n wordBlanks();\n reusableFunction();\n timesFive();\n testStrictNotEqual();\n trueOrFalse();\n testGreaterThan();\n Apples();\n testLessThan();\n testLogicalAnd();\n testSize();\n switchOfStuff();\n\n // this doesn't do anything yet (except logging),\n // but the HTML file automatically calls it\n // whenever the \"body\" of the document is loaded\n\nconsole.log(\"The body of the page has loaded.\");\n\n}", "title": "" }, { "docid": "fbed17059534f130c053495165a8c2ee", "score": "0.66965544", "text": "function setup() {} // Only calls once, as soon as the page loads", "title": "" }, { "docid": "185cad311b2edff6566d4238e0fe5068", "score": "0.6684403", "text": "function init() {\n // Do this when a page loads.\n }", "title": "" }, { "docid": "37e0f5e94157f16c3b49039afc7be646", "score": "0.6648406", "text": "function runWhenDocumentReady(fn) {\n\t if (document.readyState !== \"loading\") {\n\t fn();\n\t }\n\t else {\n\t document.addEventListener(\"DOMContentLoaded\", fn);\n\t }\n\t}", "title": "" }, { "docid": "3e6ad44e21af2cdcd9992b0c2a1d5763", "score": "0.6554214", "text": "function init() {\n //var testE = document.querySelector(\"#header3\").innerHTML;\n console.log(\"Page load detected - testing last element on page...\");\n //console.log(\"Element text detected: \" + testE);\n}", "title": "" }, { "docid": "a9fb8998bd1ec6b2ea878b95e23424e0", "score": "0.6552718", "text": "function END_OF_MAIN()\n{\n\t\twindow.addEventListener(\"load\", main);\n}", "title": "" }, { "docid": "080d30025d8ed8f3d8ea11bede42ae10", "score": "0.65325004", "text": "function eltdfOnDocumentReady() {\n }", "title": "" }, { "docid": "a2a21cfea494213dd6e68b70a5026d85", "score": "0.65313727", "text": "function document_loaded()\n{\n console.log(\"document_loaded\");\n \n ////////////////////////////////////////////////////////////////////////////\n // now that everything is loaded and known, we can start\n // dicking with it:\n initialize_site(main);\n}", "title": "" }, { "docid": "180046d793560ed2724267c5aa11ed81", "score": "0.65295017", "text": "function ready() {\n if (\n document.attachEvent\n ? document.readyState === 'complete'\n : document.readyState !== 'loading'\n ) {\n main();\n } else document.addEventListener('DOMContentLoaded', main);\n}", "title": "" }, { "docid": "ce95b61653a64d5f8f6373089dba7710", "score": "0.64810723", "text": "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "title": "" }, { "docid": "d059534e3138f986ed475da34ae2c8e3", "score": "0.6475515", "text": "function main() {\n\t$('code').load(function() {\n\t\tconsole.log(\"code is loaded\");\n\t});\n\t$('code').each(function(index, it) {\n\t\tconsole.log(it);\n\t});\n}", "title": "" }, { "docid": "de730e3f5ca9d478964879f4293660e1", "score": "0.6467265", "text": "function page_loaded() {\n post_load_setup();\n}", "title": "" }, { "docid": "de730e3f5ca9d478964879f4293660e1", "score": "0.6467265", "text": "function page_loaded() {\n post_load_setup();\n}", "title": "" }, { "docid": "ecd43f19ec811da55f8fd293f1f02e5f", "score": "0.64475995", "text": "function mkdfOnDocumentReady() {\n mkdfHeaderBehaviour();\n mkdfSideArea();\n mkdfSideAreaScroll();\n mkdfInitMobileNavigation();\n mkdfMobileHeaderBehavior();\n mkdfSetDropDownMenuPosition();\n mkdfDropDownMenu();\n mkdfSearch();\n mkdfVerticalMenu().init();\n }", "title": "" }, { "docid": "729d46c9dcbf44cbd52eff4f4b288c9b", "score": "0.64434123", "text": "function documentLoad() {\n createApp();\n apresentarTarefas();\n}", "title": "" }, { "docid": "fc2bc314ec5a6940fc96ed940f3befc6", "score": "0.64178294", "text": "function eltdfOnDocumentReady() {\n\t\teltdfSetDropDownMenuPosition();\n\t\teltdfDropDownMenu();\n\t\teltdfSearch();\n\t\teltdfSideArea();\n\t\teltdfSideAreaScroll();\n\t}", "title": "" }, { "docid": "2b895b0f106f1c38e7cec9662eaffd5a", "score": "0.64071584", "text": "function onLoad()\n{\n\tfDebug(\"Hello World HTML Widget loaded!\");\n\tHello();\n}", "title": "" }, { "docid": "26b3c81b39e143461d887fdcb561c86a", "score": "0.6400639", "text": "function main() {\n initQuestions();\n\n window.addEventListener('load', setup);\n }", "title": "" }, { "docid": "6f5e10d5daf2bdd82c9a5a2b9234449b", "score": "0.6383025", "text": "function run() {\n init();\n\tanimate();\n\tlaunchPage();\n\ttestingD();\n\tmenuButonListener();\n}", "title": "" }, { "docid": "2c51ce89e146f7452fdac57ac550bf53", "score": "0.6376191", "text": "function mkdfOnDocumentReady() {\n mkdfInitAjax();\n }", "title": "" }, { "docid": "356e8b683378419cde2973a02c032931", "score": "0.6367126", "text": "function pageLoaded() {\n prepareHandles();\n addEventListeners();\n}", "title": "" }, { "docid": "794fca464e21f78605780d1fe219a8e2", "score": "0.63646674", "text": "function mainComplete() {\n console.log('it is all loaded up');\n Menu.initialize();\n }", "title": "" }, { "docid": "f74a23ad5f12cd5a15530996e20461de", "score": "0.6360832", "text": "function pageLoaded () {\n s.init();\n checkURL();\n }", "title": "" }, { "docid": "96a5e9c28509e39eee8ad6370a6657ec", "score": "0.6309672", "text": "function docReady() {\n init();\n setEvents();\n }", "title": "" }, { "docid": "cb4b7883a0b0216e4bb74fa50399646a", "score": "0.630155", "text": "function mkdfOnDocumentReady() {\n mkdfInitQuantityButtons();\n mkdfInitSelect2();\n mkdfInitSingleProductLightbox();\n mkdfInitTabsFollowLine();\n }", "title": "" }, { "docid": "56e0c3e737f873c129658b1f23132bca", "score": "0.6299718", "text": "function scriptLoadHandler() {\n main();\n }", "title": "" }, { "docid": "7bb6c954837f7ce094dd1e4657482d67", "score": "0.6289215", "text": "function qodeOnWindowLoad() {\n qodeInitElementorAccordion();\n }", "title": "" }, { "docid": "074da9a113241183c6ffbfe8ef821e0c", "score": "0.62739795", "text": "function qodeOnWindowLoad() {\n qodeElementorInteractiveLinks();\n }", "title": "" }, { "docid": "6b0c7c38dd5b9596775027e047862b0d", "score": "0.62681806", "text": "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tsetSelectMenuesValues(function(){\r\n\t\t\t\tgetXMLData(function(){\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n}", "title": "" }, { "docid": "f6b7bb3ff189594d0a5b7c299089b788", "score": "0.6267132", "text": "function mkdfOnDocumentReady() {\n mkdfInitCounter();\n mkdfInitProgressBars();\n mkdfInitCountdown();\n mkdfIcon().init();\n mkdfInitMessages();\n mkdfInitMessageHeight();\n mkdfInitTestimonials();\n mkdfInitCarousels();\n mkdfInitPieChart();\n mkdfInitPieChartDoughnut();\n mkdfInitTabs();\n mkdfInitTabIcons();\n blogCarousel();\n mkdfButton().init();\n mkdfInitBlogListMasonry();\n mkdfCustomFontResize();\n mkdfInitImageGallery();\n mkdfBlogSlider();\n mkdfInitAccordions();\n mkdfShowGoogleMap();\n mkdfSocialIconWidget().init();\n mkdfProcess().init();\n mkdfComparisonPricingTables().init();\n mkdfProgressBarVertical().init();\n mkdfIconProgressBar().init();\n emptySpaceResponsive().init();\n }", "title": "" }, { "docid": "a425045ff2c166d8034152ad8ca1aea9", "score": "0.6249034", "text": "function qodeOnDocumentReady() {\n qodeInteractiveLinks();\n }", "title": "" }, { "docid": "634276b6d66861febafa717c4e05c688", "score": "0.6244173", "text": "function onLoadHandler(){\n \n initElements();\n\n initEvents();\n\n }", "title": "" }, { "docid": "4b54011ea84418b00d02a46248ea6286", "score": "0.62360895", "text": "function loadContent() {\n loadDomElements()\n\n}", "title": "" }, { "docid": "24329393a3dc7f53a496b1c238c37104", "score": "0.6226668", "text": "function DOMContentLoaded() {\n setupModal();\n\n if (PageData.Comparing) {\n document.body.style.overflow = 'hidden';\n document.getElementById('menu').style.display = 'none';\n document.getElementById('image-controls').style.display = 'none';\n } else {\n setupMenu();\n\n setupOfflineIndicator();\n window.addEventListener('offline', updateMenu);\n window.addEventListener('online', updateMenu);\n\n if (!PageData.SavedDiagram) {\n loadFlags();\n\n // Remove leading / and trailing .htm\n PageData.Filename = window.location.pathname.slice(1, -4);\n\n PageData.Flagged = PageData.Flags.includes(PageData.Filename);\n }\n }\n\n setupImageControls();\n}", "title": "" }, { "docid": "b75d63942940678987260c3407f69a4e", "score": "0.6223595", "text": "function mkdfOnWindowLoad() {\n }", "title": "" }, { "docid": "a9e81fc4ea63dfc0f9d82edb27c28c16", "score": "0.6213835", "text": "function bodyOnload(){\n loadFunctionOptions('vermenigvuldiging');\n loadFunctionOptions('deling');\n}", "title": "" }, { "docid": "445522b5d689abd5004fa553b1258ea5", "score": "0.6194857", "text": "function eltdOnWindowLoad() {\n\n }", "title": "" }, { "docid": "8095fc8f0e544ff0930ee638ca3a9f50", "score": "0.61868566", "text": "function ready() {\n\tif (document.readyState != \"loading\") {\n\t\tquote_thread();\n\t\tadd_anchor_listeners();\n\t\tadd_change_listeners()\n\t\tadd_menu_listeners();\n\t\tadd_input_constraints();\n\t\tprepare_tegaki();\n\t} else {\n\t\tdocument.addEventListener(\"DOMContentLoaded\", quote_thread);\n\t\tdocument.addEventListener(\"DOMContentLoaded\", add_anchor_listeners);\n\t\tdocument.addEventListener(\"DOMContentLoaded\", add_change_listeners);\n\t\tdocument.addEventListener(\"DOMContentLoaded\", add_menu_listeners);\n\t\tdocument.addEventListener(\"DOMContentLoaded\", add_input_constraints);\n\t\tdocument.addEventListener(\"DOMContentLoaded\", prepare_tegaki);\n\t}\n}", "title": "" }, { "docid": "ff91ca1e0aceb308d6d4da9ab81ca1e4", "score": "0.6179728", "text": "function pageLoad() {\n // Page load safety check\n if (pageHasLoaded) {\n return;\n }\n pageHasLoaded = true;\n\n setupPage();\n }", "title": "" }, { "docid": "5d41ee211f6ede95386ab17ec4fdbf80", "score": "0.617732", "text": "function readyHandler(){n.domLoaded||(n.domLoaded=!0,e(o))}", "title": "" }, { "docid": "e5fdc500fe284add7dd5c3f3a05b160e", "score": "0.6177174", "text": "function mkdfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "e5fdc500fe284add7dd5c3f3a05b160e", "score": "0.6177174", "text": "function mkdfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "e5fdc500fe284add7dd5c3f3a05b160e", "score": "0.6177174", "text": "function mkdfOnWindowLoad() {\n\n }", "title": "" }, { "docid": "b81f2a268f800e2b6fd629de1be1e342", "score": "0.6163555", "text": "function qodeOnDocumentReady() {\r\n\r\n }", "title": "" }, { "docid": "fb7c43027330ca903856286403ff2e6b", "score": "0.6157216", "text": "function Initialization() {\n\t\tvar page = jQuery(document).find('body').attr('class');\n\t\tif (page == 'home') {\n\t\t\tsimpi_portfolio_performance();\n\t\t}\n\t\t// populateRunnningText();\n\t\t// simpi_portfolio_performance();\n\t\t// checkMenu();\n\t}", "title": "" }, { "docid": "aee26636157ab6b604ead7eb1350c7e6", "score": "0.6155792", "text": "function main() {\n\n\t// Locate parents on HTML page\n\tvar parents = Page.locateParents();\n\n\t// Get Canned Analyses of corresponding datasets\n\tvar cannedAnalysisInterfaces = API.main(Object.keys(parents));\n\tconsole.log(cannedAnalysisInterfaces);\n\n\t// Add Canned Analyses to the webpage\n\tPage.addInterfaces(parents, cannedAnalysisInterfaces);\n\n\t// Add event listeners for interactivity\n\teventListener.main(cannedAnalysisInterfaces);\n\n}", "title": "" }, { "docid": "b7a0fd89646a6d28ec7adac28c68fffc", "score": "0.61544347", "text": "function onWindowLoad() {\n divAjax = elementById('#div-ajax');\n divAjaxResponse = elementById('#div-ajax-response');\n selOutput = elementById('#outputType');\n frmMain = elementById('#mainForm');\n btnSubmit = elementById('#btnSubmit');\n\n // call triggers once to initialize\n selectStateChangedEvent();\n formChangedEvent();\n getCalculatedRate();\n}", "title": "" }, { "docid": "7cda86ae07c011c46e2dc08d83cee924", "score": "0.61536944", "text": "function run_when_document_ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n }\n else {\n document.addEventListener(\"DOMContentLoaded\", fn);\n }\n}", "title": "" }, { "docid": "f5e5f50ebb8ec0df008443367017b048", "score": "0.6143551", "text": "function main() {\n log('[TemplateApplication] onload');\n\n document.addEventListener('visibilitychange', function() {\n if(document.hidden){\n log('hidden');\n }\n else {\n log('visible');\n }\n });\n\n moveFocus(1);\n}", "title": "" }, { "docid": "31ca1d13ee321dddccc8ad71627fb346", "score": "0.6133735", "text": "function init() {\n htmlBase();\n manQuests();\n}", "title": "" }, { "docid": "f93f3651feed00f8e01e070bbfc14421", "score": "0.6133158", "text": "function pageload(){\n\tpopulateElementList();\n\n\treturn 0\n}", "title": "" }, { "docid": "862a8e7ab9c0920efa870260aaee9d52", "score": "0.61301154", "text": "function DOMContentLoaded() {\n if (isEmbedded()) {\n document.getElementById('menu').style.display = 'none';\n document.getElementById('cancel').style.display = 'none';\n }\n\n setupModal();\n setControlValues();\n setupEventListeners();\n}", "title": "" }, { "docid": "6d0be16f63e956293025bc190fb6dcf4", "score": "0.6117721", "text": "function setUpPage() {\n createEventListeners();\n populateFigures();\n \n}", "title": "" }, { "docid": "e305e7caf03118278aa5f013c26c7bc0", "score": "0.6108369", "text": "function eltdfOnDocumentReady() {\n\t\teltdfInitTestimonialsSplitType();\n\t}", "title": "" }, { "docid": "4ffec581ba4ea103df82d63c1acaab95", "score": "0.6107862", "text": "function document_Load()\n{\n document.removeEventListener('DOMContentLoaded', document_Load);\n init();\n}", "title": "" }, { "docid": "72c3b59a758ce6ef58438006f9c3351e", "score": "0.6106161", "text": "function onPageLoad() {\n if(test_browser_incompatible()) {\n show_incompatibility_nag();\n return;\n }\n \n window.onpopstate = onPopState;\n window.onkeydown = onKeyDownMain;\n init_tree();\n init_sb_resizer();\n load_page_via_url();\n init_index_edit();\n userHooks.onPageLoad();\n}", "title": "" }, { "docid": "3bb85c3e57fe6b221d88a90e37b63273", "score": "0.60990334", "text": "function pageReady() {\n initMasks();\n initSelectric();\n initValidations();\n initSlider();\n initPopup();\n initQuantity();\n initZoom();\n initMasonry();\n }", "title": "" }, { "docid": "661852094411534f5253ee92e53df696", "score": "0.6094356", "text": "function eltdfOnDocumentReady() {\n \teltdfTeamInfoBox();\n }", "title": "" }, { "docid": "946b383b1bf9892c90aa2c5f15d9c640", "score": "0.6091293", "text": "function mkdfOnDocumentReady() {\n mkdfTouchDeviceBodyClass();\n\t\tmkdfDisableSmoothScrollForMac();\n mkdfFluidVideo();\n mkdfPreloadBackgrounds();\n mkdfPrettyPhoto();\n mkdfInitElementsAnimations();\n mkdfInitAnchor().init();\n mkdfInitVideoBackground();\n mkdfInitVideoBackgroundSize();\n mkdfSetContentBottomMargin();\n //mkdfSmoothScroll();\n mkdfOwlSlider();\n mkdfInitSelfHostedVideoPlayer();\n mkdfSelfHostedVideoSize();\n mkdfInitBackToTop();\n mkdfBackButtonShowHide();\n\t\tmkdfInitCustomMenuDropdown();\n mkdfInitOrderingFollowLine();\n mkdfInitMembershipFollowLine();\n }", "title": "" }, { "docid": "7aed69d6d6fecb5750eac69971ed4dcf", "score": "0.6090709", "text": "function asyncLoad() {\n const listenMap = listenMapFrom(document);\n dimMapElementsFrom(document, areaData);\n calibrateFontSize(document);\n window.addEventListener(\"resize\", wrap(calibrateFontSize, document));\n // eslint, why do you think I'm using \"var\" instead of \"const\"?\n // It's so it's not block scoped, dummy\n setTimeInnerTextToTimeFrom(document);\n setIntervalWithArgument(setTimeInnerTextToTimeFrom, document, 999);\n setInterval(writeCurrents, 9999);\n listenMap(\"mouseover\", undimTarget);\n listenMap(\"mouseout\", dimTarget);\n listenMap(\"click\", writeData(document));\n}", "title": "" }, { "docid": "362be4566fb8914cb5607903db563706", "score": "0.6089815", "text": "function mainComplete() {\r\n\t\tconsole.log('Everything is loaded');\r\n\t\t\r\n\r\n\t\tMain.screen.initialize();\r\n\t\t// Main.main.initialize();\r\n\t}", "title": "" }, { "docid": "9d9a0d151cb6305f197fa35654ed0c69", "score": "0.60861427", "text": "function completed(){g.removeEventListener(\"DOMContentLoaded\",completed),e.removeEventListener(\"load\",completed),D.ready()}", "title": "" }, { "docid": "8e6813f234b18f490b95fc40531f2ead", "score": "0.60853094", "text": "function edgtfOnDocumentReady() {\n edgtfSideArea();\n edgtfSideAreaScroll();\n }", "title": "" }, { "docid": "0d539f51896c2acce4cd22442071d5fa", "score": "0.6082794", "text": "function init() {\n\n promptManager().then(() => promptMenu()).then(() => {\n console.log(\"You have finished entering data, generating web page...\");\n writeToFile(\"index.html\", pageCode.html(cardData));\n writeToFile(\"style.css\", pageCode.css);\n });\n\n}", "title": "" }, { "docid": "3e4d421faf6f8d1ee41a0936f9fdabb3", "score": "0.60717857", "text": "function eltdOnDocumentReady() {\n eltdLikes();\n }", "title": "" }, { "docid": "2a487c147cb6ad542ba6113b3b889759", "score": "0.6064627", "text": "function initialRun() {\n\tajaxServerCommand.loadAdditionalContent($(document.body).attr(\"href-link\"));\n}", "title": "" }, { "docid": "e504b8a51b428ebfa0dc45403f0a7275", "score": "0.6062929", "text": "function doWhenPageLoaded(f) {\n if (document.readyState == \"complete\")\n f();\n else\n window.addEventListener(\"load\", () => { f(); });\n}", "title": "" }, { "docid": "8e378674bf5a02de89c8a583821b4073", "score": "0.6061347", "text": "function setUpPage() {\n createEventListeners();\n populateFigures();\n}", "title": "" }, { "docid": "4a4e53ec49df7e6699673265e5c68390", "score": "0.6056328", "text": "function mkdfOnWindowLoad() {\n mkdfCheckHeaderStyleOnScroll(); //called on load since all content needs to be loaded in order to calculate row's position right\n mkdfInitParallax();\n mkdfSmoothTransition();\n }", "title": "" }, { "docid": "1edc2f78103d91e665dd5a824f23c4f5", "score": "0.6052561", "text": "function main() {\n \t\tsetupTopBar();\n \t\tshowReferences();\n \t\t\n \t\t// choose default translation\n \t\tchooseTranslation(\"NIV\");\n\n \t\tbindEvents();\n \t}", "title": "" }, { "docid": "204e76a454d2e4ec9755e46956b983d5", "score": "0.6050038", "text": "function main() {\r\n\t\r\n\tconsole.log('Main loaded');\r\n\t\r\n\tjQuery('<div/>', {\r\n\t id: 'cew'\r\n\t}).appendTo('body');\r\n\t\r\n\t$('#cew').html(\r\n\t\t'\t<div class=\"cew_btn cew_onThisSite\" style=\"\">5</div>'\r\n\t\t+'\t<div class=\"cew_btn cew_prefs\" style=\"\"></div>'\r\n\t\t+'\t<div class=\"cew_btn cew_onAllSites\" style=\"\">12</div>'\r\n\t\t+'\t<div class=\"cew_panel cew_prefs_panel\">Blabla tavu</div>'\r\n\t);\r\n\t\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "33ac0e87ca6aad1d017152fa7aaccbc6", "score": "0.60465056", "text": "function mkdfOnDocumentReady() {\n mkdfParallaxTitle();\n }", "title": "" }, { "docid": "23293e0282100ab33d88676309ae011f", "score": "0.604451", "text": "function setUpPage()\n{\n\tdocument.getElementById(\"test\").innerHTML = \"This page has loaded!\";\n\tdropDown();\n}", "title": "" }, { "docid": "19ff5b9126e20ffb6d28e537c6077557", "score": "0.6041706", "text": "function initializePage() {\n // Setup listeners.\n $(\"#add-entry-btn\").click(saveEntry);\n $(\"#remove-entry-btn\").click(removeEntry);\n $(\"#to-record\").click(toRecord);\n $(\"#to-log\").click(toLog);\n $(\"#question\").click(showHelp);\n $(\"#add-details-btn\").click(addDetails);\n $(\"#back-btn\").click(goBack);\n}", "title": "" }, { "docid": "2f34e2e95f09ee0ec574cd98b420517f", "score": "0.6040059", "text": "setUp () {\n if (document.readyState === 'complete') {\n this.start();\n } else {\n window.addEventListener('load', () => {\n this.start();\n });\n }\n }", "title": "" }, { "docid": "94bad050c7413ee84743d13c5cca117e", "score": "0.6035438", "text": "function documentReady() {\n fixPngs();\n\t//tableColors();\n\t//textClasses();\n\tdropdowns();\n\tbtnMenus();\n}", "title": "" }, { "docid": "6ae02615d8007a3e4ef547dd18783c6a", "score": "0.60253596", "text": "function setUpPage() {\n createEventListeners();\n generatePlaceholder();\n}", "title": "" }, { "docid": "1335634f4a975a36d8d617dafdf364ef", "score": "0.6024325", "text": "function pageReady() {\n legacySupport();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n _window.on('resize', debounce(initScrollMonitor, 300))\n initMasks();\n initScrollbars();\n \n initMap();\n\n }", "title": "" }, { "docid": "328f0ee656f2b15d6910819814aa2a2d", "score": "0.60237545", "text": "function eltdfOnWindowLoad() {\n }", "title": "" }, { "docid": "641f863216ca60edc625ef6c91be888a", "score": "0.6023743", "text": "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready()}", "title": "" }, { "docid": "19c439f8b6d6a22a66e0bff6b5dc5b1b", "score": "0.60115415", "text": "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t$('.jumbotron h1').text(\"Javascript is connected\");\n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n \n $('a#select').hide();\n $('#subBox').hide();\n //$('#subBox2').hide();\n $(\"a.thumbnail\").click(projectClick);\n //$(\"a.thumbnail\").click(openBox);\n}", "title": "" }, { "docid": "f2fe9d84b4fb4e6ca96a8036a0e00b2d", "score": "0.6009107", "text": "function initializePage() { //functions that require both league_array and results_array to be populated\n scheduleWrite(); //populates scoreboard/schedule \n buttonColor(); //changes start season button color based on league size\n weekPop(); //populates weeks menu in enter scores modal\n }", "title": "" }, { "docid": "5d3712b78ecee3c52af5461b6a6f9d2a", "score": "0.60058045", "text": "function loadFunc(){\n //Check to see if you are on the main search page\n if (onStudentCenterPage()){\n //constructFeedbackBox();\n //addTwitterBox();\n }\n //Check to see if you are on the view my grades page\n //If so add GPA Model\n\t\tif(onViewMyGradesPage()){\n\t\t\taddGPAModelBox();\n\t\t\taddGPAInterval = setInterval(function(){addGPAModelBox();},3000);\n\t\t}\n\t\telse{\n\t\t\tclearInterval(addGPAInterval);\n\t\t}\n\t\t//Check to see if you are on the search courses page\n\t\t//If so add autocomplete box in search field\n\t\tif(onCourseSearchPage()){\n\t\t\t\n\t\t\tconstructAutocompleteBox();\n\t\t\tmajorAutocomplete();\n\t\t\taddAutoCompleteInterval = setInterval(function(){\n\t\t\t\t\n\t\t\t\tconstructAutocompleteBox();\n\t\t\t\tmajorAutocomplete();\n\t\t\t}, 3000);\n\t\t}\n\t\n sisColorMod();\n addMouseOver();\n changeInputLimit();\n formatTopTabBar();\n removeOldHeader();\n constructHeader();\n constructFooter(); \n }", "title": "" }, { "docid": "5944f41b29a1eb2d72980a57940e7db9", "score": "0.60014564", "text": "function qodeOnWindowLoad() {\n qodeInitElementorToursFilter();\n }", "title": "" }, { "docid": "b4d6305065f1abfc4077e8df5f7ecf15", "score": "0.599771", "text": "function executeThisCodeAfterFileLoad () {\n const data = JSON.parse(this.responseText);\n console.log(\"data\", data);\n domString(data.animals);\n addEventListeners();\n\n}", "title": "" }, { "docid": "c1332f57f995a5221dca3b978963bee4", "score": "0.5991734", "text": "async function main() {\n\t// Have to wait for this to finish since commonMain loads the STORE and we need it to populate the page\n\tawait commonMain();\n\n\tSTORE.pagePrefix = 'links';\n\tSTORE.entriesPerPage = ENTRIES_PER_PAGE;\n\tSTORE.displayed = [];\n\n\t$('.menu').find('.links-link').addClass('current-page-link');\n\t$(ownPageLinkHandler);\n\t\n\t$(gotoPageHandler);\n\t// Search field handlers\n\t$(clearSearchHandler);\n\t$(searchHandler);\n\t$(searchSubmitHandler);\n\n\tdisplayPage( 0 );\n}", "title": "" }, { "docid": "c5ad31623dccd240a89ed91865edd727", "score": "0.59871423", "text": "function initializePage() {\n\t$(\"#testjs\").click(function(e) {\n\t\t\n \n\t});\n\n\t// Add any additional listeners here\n\t// example: $(\"#div-id\").click(functionToCall);\n // $(\"a.thumbnail\").click(projectClick);\n $(\"#submitBtn\").click(updateProject);\n $(\"#logoutBtn\").click(logout);\n $(\"#registerBtn\").click(goToRegister);\n $(\"#TopS\").click(goToTopStories);\n $(\"#NewsFeed\").click(goToNewsFeed);\n $(\"#Publish\").click(goToPublish);\n $(\"#Profile\").click(goToProfile);\n $(\"#story1\").click(goToStory1);\n $(\"#story2\").click(goToStory2);\n $(\"#story3\").click(goToStory3);\n $(\"#story4\").click(goToStory4);\n $(\"#story5\").click(goToStory5);\n $(\"#story6\").click(goToStory6);\n $(\"#newstory\").click(goToNewStory);\n $(\"#published\").click(goToPublished);\n}", "title": "" }, { "docid": "0b22f5f8918a4f8daae7ae12ba838c58", "score": "0.5986427", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "0b22f5f8918a4f8daae7ae12ba838c58", "score": "0.5986427", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "4b7e83afa2630ea78cd353c27562775d", "score": "0.59787655", "text": "function domReady() {\n\t\tfindElements(); // Find elements on the page so we can work with them.\n\n\t\t// Make sure we can do everything and that fndElements found what it needed.\n\t\tif ( ! checkRequirements() ) {\n\n\t\t\t// We must not have the right stuff on the screen like a search input, let's not do anything then.\n\t\t\treturn;\n\t\t}\n\n\t\t// We have what we need, lets......\n\t\tsetupResultsPopup(); // Create a results location that we can put our results in from AJAX.\n\t\tturnOffAutocomplete(); // Turn off that dropdown and fills in things you've typed before (it looks like our dropdown!).\n\t\tlistenForTypingAndSearchViaAjax(); // When someone types in the search input, do the AJAX request.\n\t}", "title": "" }, { "docid": "e59a343b6ba6352ba2661a01dfad55b8", "score": "0.5975635", "text": "function setUpPage() {\r\n createEventListeners();\r\n}", "title": "" }, { "docid": "d2b331fb1e04a18198684ac1ce98cf62", "score": "0.59741503", "text": "function siteLoad () {\n setLanding();\n showContent();\n showInfo();\n // create event listeners to close menu on section clicked\n closeMenu(document.getElementsByClassName('content'), document.getElementById('nav_toggle'));\n // control for reload\n // make sure the menu label is set properly and the random wikiviewer element is hidden on mobile if teh menu is open\n menuLabelToggel(document.getElementById('nav_toggle').checked, document.getElementById('menu_label'));\n randomWikiControl(document.getElementById('rotate_options'), document.getElementById('random_link'), document.getElementById('nav_toggle').checked);\n}", "title": "" }, { "docid": "ca905e2bb59d756f37ce296ffb4540e6", "score": "0.59722376", "text": "function transform_complete()\n {\n setTimeout(initialize_new_page, 200);\n }", "title": "" }, { "docid": "9d58eac8665afbe13cdd5072be7c5f3f", "score": "0.596687", "text": "function initializePage() {\n\t$('.project a').click(addProjectDetails);\n\n\t$('#colorBtn').click(randomizeColors);\n}", "title": "" }, { "docid": "9d58eac8665afbe13cdd5072be7c5f3f", "score": "0.596687", "text": "function initializePage() {\n\t$('.project a').click(addProjectDetails);\n\n\t$('#colorBtn').click(randomizeColors);\n}", "title": "" }, { "docid": "75be280fda7153a4d92a2d105375c421", "score": "0.5962857", "text": "function executeThisCodeAfterFileLoads(){\n const data = JSON.parse(this.responseText);\n rides = data.rides;\n domStringBuilder(data.rides);\n}", "title": "" }, { "docid": "17df80b5d89bcc8e3194e6e87b718916", "score": "0.59593374", "text": "function setUpAfterLoad() {\n attachIdsToAllElements();\n attachLinkListeners();\n attachImageListeners();\n attachFormListeners();\n}", "title": "" }, { "docid": "6b2857285b1aec2b8a4e50b797324d81", "score": "0.59570235", "text": "function initializePage() {\n\t$('.project a').click(addProjectDetails);\n\n\t$('#colorBtn').click(randomizeColors);\n\t$('#musicBtn').click(randomSongName);\n}", "title": "" }, { "docid": "977d36db90c4b9b40a9f47d970a00474", "score": "0.59540874", "text": "function findElementAndStartMain() {\n let mutationObserver = new MutationObserver(function(mutations) {\n let table = document.querySelector('div[class=\"question-list-base\"]');\n if (document.body.contains(table)) {\n mutationObserver.disconnect();\n main();\n }\n });\n mutationObserver.observe(document, {\n attributes: false,\n characterData: false,\n childList: true,\n subtree: true,\n attributeOldValue: false,\n characterDataOldValue: false\n });\n}", "title": "" }, { "docid": "5c3d5e3ed6b4fa5f1cdaa4dc6b287a90", "score": "0.5952687", "text": "function ready(fn) {\n if (document.readyState != 'loading'){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "title": "" }, { "docid": "a310c5cd280321fd63ae788e52875a60", "score": "0.5952069", "text": "function eltdfOnWindowLoad() {\n\t}", "title": "" } ]
3c7d3a059a5d6aa764af66a3a9b90e6d
returns an array with the winner(/winners if theres a tie)
[ { "docid": "6f93cd23e3ffd83b3220a607232a981c", "score": "0.7202241", "text": "function getWinner(scoreObj) {\n var winners = [];\n for (var id in scoreObj) {\n if (winners.length === 0) winners.push(id);\n else if (scoreObj[id] > scoreObj[winners[0]]) winners = [id];\n else if (scoreObj[id] === scoreObj[winners[0]]) winners.push(id);\n }\n return winners;\n }", "title": "" } ]
[ { "docid": "c4d34ba0ab30e8fbb24c41f93fe9cd69", "score": "0.7842176", "text": "function getWinners(){\n winners = [players[0]]; // List incase of a tied game (2+ winners)\n\n // Calculate winners\n for (let index = 1; index < players.length; index++) {\n // Player has higher score, replace all winners\n if(players[index].score > winners[0].score){\n winners = [players[index]];\n }\n // Player has same score, append to list (tie)\n else if(players[index].score == winners[0].score){\n winners.push(players[index]);\n }\n }\n return winners;\n}", "title": "" }, { "docid": "208cd153f4362f0ff2b7204752c54386", "score": "0.7460202", "text": "function findWinner(players) {\n var winnersArray = [];\n\n var highestScore = 0;\n for (var i = 0; i < players.length; i++) {\n getScore(players[i]);\n if (players[i].score > highestScore) {\n highestScore = players[i].score;\n winnersArray = [];\n winnersArray.push(players[i]);\n } else if (players[i].score === highestScore) {\n winnersArray.push(players[i]);\n }\n }\n return winnersArray;\n}", "title": "" }, { "docid": "66e8f3efa6dd5648bf6a819104bcb7bd", "score": "0.7460058", "text": "function checkForWinner(gameID) {\n for (var i = 0; i < 4; i++) {\n if (activeGames[gameID]['score'][i][1] == activeGames[gameID]['scoreToWin']) {\n return [true, activeGames[gameID]['score'][i][0]];\n }\n }\n return [false, \"\"];\n}", "title": "" }, { "docid": "1438e2e95a0818b0673b373827aa98d6", "score": "0.7288576", "text": "function winners() {\n\t\t\tfor(var i = 0; i < condition.length; i ++) {\n\t\t\t\tif(playing[condition[i][0]] === playing[condition[i][1]] && playing[condition[i][1]] === playing[condition[i][2]] && playing[condition[i][0]] !== 0 && playing[condition[i][1]] !== 0 && playing[condition[i][2]] !== 0) {\n\t\t\t\t\tscreens[3].color = player[actualplayer].color;\n\t\t\t\t\twinning(player[actualplayer].type, \"Winner : \"+player[actualplayer].name+\"!\",3500);\n\t\t\t\t\tplayer[actualplayer].point +=1;\n\t\t\t\t\twinner = i;\n\t\t\t\t\ttwinkle();\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (plays.length >= 9) {\n\t\t\t\t\tscreens[3].color = \"#54D17A\";\n\t\t\t\t\twinning(\"tie\", \"It's a draw\",1000);\n\t\t\t}\n\t\t}\n}", "title": "" }, { "docid": "04ee27e5c32545550ade6bcbaab19bba", "score": "0.71177804", "text": "getWinningPlayers()\n {\n const scoreToPlayers = {};\n\n globalState.get('score').forEach((score, player) => {\n if (! scoreToPlayers[score]) {\n scoreToPlayers[score] = [];\n }\n scoreToPlayers[score].push(player);\n });\n\n const sortedScores = this.getSortedScores();\n let winningPlayers = [];\n sortedScores.forEach(score => {\n if (winningPlayers.length === 0 && score >= this.getWinningScore()) {\n winningPlayers = scoreToPlayers[score];\n }\n });\n\n return winningPlayers;\n }", "title": "" }, { "docid": "ed87577663afc815ce571d6158b361d0", "score": "0.70633286", "text": "function getWinners(vote) {\n if(!vote) return [];\n\n const [a, b] = vote.get('pair');\n const aVotes = vote.getIn(['tally', a], 0);\n const bVotes = vote.getIn(['tally', b], 0);\n\n if(aVotes > bVotes) {\n return [a];\n } else if(aVotes < bVotes) {\n return [b];\n } else {\n return [a, b];\n }\n}", "title": "" }, { "docid": "5a4ba866e7a8f800a040fc623f661038", "score": "0.69648296", "text": "function checkwin() {\n // empty array of moves\n var winning = [];\n //Loop over boxes and push placed peices into array.\n $(boxes).each(function() {\n if ($(this).hasClass('box-filled-1')) {\n winning.push(\"player1\");\n } else if ($(this).hasClass('box-filled-2')) {\n winning.push(\"player2\");\n } else {\n winning.push(\"empty\");\n }\n });\n // Check the array to find the winner or the tie.\n if (winning[0] !== \"empty\" && winning[0] === winning[1] && winning[1] === winning[2]) {\n winner = winning[0];\n showWinner();\n } else if (winning[3] !== \"empty\" && winning[3] === winning[4] && winning[4] === winning[5]) {\n winner = winning[3];\n showWinner();\n } else if (winning[6] !== \"empty\" && winning[6] === winning[7] && winning[7] === winning[8]) {\n winner = winning[6];\n showWinner();\n } else if (winning[0] !== \"empty\" && winning[0] === winning[3] && winning[3] === winning[6]) {\n winner = winning[0];\n showWinner();\n } else if (winning[1] !== \"empty\" && winning[1] === winning[4] && winning[4] === winning[7]) {\n winner = winning[1];\n showWinner();\n } else if (winning[2] !== \"empty\" && winning[2] === winning[5] && winning[5] === winning[8]) {\n winner = winning[2];\n showWinner();\n } else if (winning[0] !== \"empty\" && winning[0] === winning[4] && winning[4] === winning[8]) {\n winner = winning[0];\n showWinner();\n } else if (winning[2] !== \"empty\" && winning[2] === winning[4] && winning[4] === winning[6]) {\n winner = winning[2];\n showWinner();\n } else if (winning.includes(\"empty\") === false) {\n winner = \"Tie Game\";\n showWinner();\n }\n console.log(winning);\n }", "title": "" }, { "docid": "a8cfbdf118376e607ab047f6ac30d831", "score": "0.6955011", "text": "function getWinnersUnique() {\n\tvar winners = [];\n\tfor (var q = 0; q<gameWinners.length; q++) {\n\t\tfor (var r = 0; r<gameWinners[q].length; r++) {\n\t\t\tif (winners.indexOf(gameWinners[q][r]) < 0) {\n\t\t\t\twinners.push(gameWinners[q][r]);\n\t\t\t}\n\t\t}\n\t}\n\treturn winners;\n}", "title": "" }, { "docid": "7708425b08f7a3e3f511e3cee01d43f9", "score": "0.69264704", "text": "function getWinsByPlayer() {\n\tvar winsByPlayer = {};\n\tfor (var k = 0; k < gameWinners.length; k++) {\n\t\tfor (var l = 0; l < gameWinners.length; l++) {\n\t\t\tif (!winsByPlayer[gameWinners[k][l]]) {\n\t\t\t\twinsByPlayer[gameWinners[k][l]] = 1;\n\t\t\t} else {\n\t\t\t\twinsByPlayer[gameWinners[k][l]]++;\n\t\t\t}\n\t\t}\n\t}\n\treturn winsByPlayer;\n}", "title": "" }, { "docid": "287c788047d401b2a8833db0b122a919", "score": "0.690118", "text": "function checkWinner() {\n let winner = null\n \n // check horizontal for winner\n for (let i = 0; i < 3; i++) {\n if (matching(boardArr[i][0], boardArr[i][1], boardArr[i][2])) {\n winner = boardArr[i][0]\n }\n }\n \n // check vertical for winner\n for (let i = 0; i < 3; i++) {\n if (matching(boardArr[0][i], boardArr[1][i], boardArr[2][i])) {\n winner = boardArr[0][i]\n }\n }\n \n // check diagonal for winner\n if (matching(boardArr[0][0], boardArr[1][1], boardArr[2][2])) {\n winner = boardArr[0][0]\n }\n if (matching(boardArr[2][0], boardArr[1][1], boardArr[0][2])) {\n winner = boardArr[2][0]\n }\n \n let openSpots = 0\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (boardArr[i][j] == '') {\n openSpots++\n }\n }\n }\n \n if (winner == null && openSpots == 0) {\n return 'tie'\n } else {\n return winner\n }\n }", "title": "" }, { "docid": "2548cc556865f8557abda6b4a74a4dd3", "score": "0.6890244", "text": "function getWinners(callback) {\n\n const winners = [];\n callback.filter((state) =>{\n if(state[\"Home Team Goals\"] > state[\"Away Team Goals\"]){\n winners.push(state[\"Home Team Name\"]);\n } else if (state[\"Away Team Goals\"] > state[\"Home Team Goals\"]){\n winners.push(state[\"Away Team Name\"]);\n } else {\n winners.push(\"Tie\");\n }\n })\n return winners;\n}", "title": "" }, { "docid": "2e594f32eee126f779c58992e1a18103", "score": "0.6885805", "text": "function getWinnerSoFar() {\n var playerIds = Array.from(GameState.players.keys());\n var winnerSoFar = getPlayer(playerIds[0]);\n for (var [_, player] of GameState.players) {\n if (player.score > winnerSoFar.score) {\n winnerSoFar = player;\n }\n }\n return winnerSoFar;\n}", "title": "" }, { "docid": "7b0aca39f3ab8b20b476a0c60baf3a16", "score": "0.68573755", "text": "function checkForWinner(){\n\ttemp = [[],[],[]];\n\ttemp[0] = horWin();\n\ttemp[1] = verWin();\n\ttemp[2] = diaWin();\n\t\n\tif( temp[0][0] || temp[1][0] || temp[2][0]){\n\t\tvar winrar = \"\";\n\t\tif(temp[0][0] == true){\n\t\t\twinrar = temp[0][1];\n\t\t}\n\t\tif(temp[1][0] == true){\n\t\t\twinrar = temp[1][1];\n\t\t}\n\t\tif(temp[2][0] == true){\n\t\t\twinrar = temp[2][1];\n\t\t}\n\t\tif(winrar == \"O\"){\n\t\t\tconsole.log( \"you lose!\");\n\t\t\tdom.innerHTML = \"You lose!\";\n\t\t}else {\n\t\t\tconsole.log( winrar+ \" is the Winner!\");\n\t\t\tdom.innerHTML = winrar + \" is a Winner!\";\n\t\t}\n\t} else if(turns>=9){\n\t\tconsole.log(\"cat\");\n\t\tdom.innerHTML = \"CAT\";\n\t}\n}", "title": "" }, { "docid": "60b7086c19ed60eca273f74a7c0cfa0c", "score": "0.68335015", "text": "function determineWinner(players) {\n var highScore = 0;\n var winner;\n var tie = false;\n for (let i = 0; i < players.length; i++) {\n if (!players[i].bust) {\n let score = players[i].getTotal();\n if (score > highScore) {\n winner = players[i];\n highScore = score;\n } else if (score === highScore) {\n tie = true;\n }\n }\n }\n console.log(`Dealer's cards: ${players[players.length - 1].revealAllCards()}`);\n if (tie) {\n console.log(`\n It's a tie at ${highScore}!\n `);\n } else {\n if(winner.name == \"User\"){\n var winnerReturn = 2;\n inv.pouch.changeGold((wager*winnerReturn))\n }\n console.log(`\n ${winner.name} wins with a total of ${highScore}!\n `);\n }\n }", "title": "" }, { "docid": "aad945faf7cd8a5a46d2f04589660a26", "score": "0.6811203", "text": "function getGameWinner() {\n \n let winner;\n console.log('P1TotalScore', P1TotalScore, 'P2TotalScore', P2TotalScore);\n if (P1TotalScore > P2TotalScore) {\n winner = P1;\n } else if (P1TotalScore < P2TotalScore) {\n winner = P2;\n } else {\n winner = 'Tie';\n }\n P1MovesTypes = [];\n P1MovesValues = [];\n \n P2MovesTypes = [];\n P2MovesValues = [];\n\n P1TotalScore = 0;\n P2TotalScore = 0;\n return winner;\n}", "title": "" }, { "docid": "721b78bfc657e3dcab624fbdb887a264", "score": "0.6810234", "text": "function getWinners(cb) {\n\n let array = cb;\n\n const winners = array.map(game => {\n\n if (game[\"Home Team Goals\"] > game[\"Away Team Goals\"]){\n return game[\"Home Team Name\"];\n } \n \n else {\n return game[\"Away Team Name\"];\n };\n });\n\n return winners;\n\n}", "title": "" }, { "docid": "3c5f9106c07c17fd4b6a1b0f25b8ac4c", "score": "0.6800611", "text": "function checkForWinner() {\n threeInARow(1, 2, 3);\n threeInARow(4 ,5, 6);\n threeInARow(7, 8, 9);\n threeInARow(1, 4, 7);\n threeInARow(2, 5, 8);\n threeInARow(3, 6, 9);\n threeInARow(1, 5, 9);\n threeInARow(3, 5, 7);\n}", "title": "" }, { "docid": "eca8004a57ccaf7d6b27b1333127e48c", "score": "0.6790587", "text": "checkForWinner() {\n const currentPlayer = this.players[this.playerIndex];\n const availableCells = this.availableCells;\n return this.winCombinations.reduce((gameWon, winCombo) => {\n if (gameWon) return true;\n let scoreCount = 0;\n let emptyCell;\n const isWinningCombo = winCombo.reduce((comboMatches, cell) => {\n if (!!this.playerInfo[currentPlayer].moves[cell]) {\n scoreCount++;\n } else if (availableCells[cell]) {\n emptyCell = cell;\n return false;\n } else {\n return false;\n }\n if (!comboMatches) return false;\n return true;\n }, true);\n if (isWinningCombo) {\n this.winningCombo = winCombo;\n }\n if (scoreCount === 2 && !!emptyCell) {\n this.playerInfo[currentPlayer].priorityNextMove = emptyCell;\n }\n return isWinningCombo;\n }, false);\n }", "title": "" }, { "docid": "7f1c5fe4ae51f3cedf06789d5c1e2efb", "score": "0.6785368", "text": "function getWinner() {\n let winner = null;\n // loop through winGame, if 3 select match then win\n winGame.forEach(function(element) {\n //handle X or O match row or column or diagonal in any WinGame element then win the game\n if (\n board[element[0]] &&\n board[element[0]] === board[element[1]] &&\n board[element[0]] === board[element[2]]\n )\n return (winner = board[element[0]]);\n });\n // includes() whether array includes a certain value among its entries,return true n false.\n if (winner) {\n return winner;\n }\n //add board.includes('') to return null, otherwise at the beginning it show no body win before we get someone win\n else if (board.includes(\"\")) {\n return null;\n } else {\n return \"noWinning\";\n }\n messageShow();\n}", "title": "" }, { "docid": "63d97893bcc89e8057919bf49646314d", "score": "0.6782136", "text": "function getWinner() {\n return winTable[weaponPlayerOne][weaponPlayerTwo] === 0\n ? 'tie'\n : winTable[weaponPlayerOne][weaponPlayerTwo] === 1\n ? 'playerOne' : 'playerTwo';\n}", "title": "" }, { "docid": "8108353e55ad63ec602f73b4007086e3", "score": "0.6772926", "text": "function findWinner(players) {\n // Your code here\n\n let winner = players[0].name;\n let winnerScore = players[0].totalScores();\n for (let ind = 1; ind < players.length; ind++) {\n let playerTotalScore = players[ind].totalScores()\n if(playerTotalScore > winnerScore) {\n winner = players[ind].name;\n winnerScore = playerTotalScore;\n\n }\n }\n\n return winner; \n}", "title": "" }, { "docid": "0ed5e7b48cf8a62abc7844b8dc812854", "score": "0.67689955", "text": "winning(board, player){\n for (let i=0; i<winSet.length; i++) {\n let [a,b,c] = winSet[i]\n if(board[a] === player && board[a] === board[b] && board[a] === board[c]) {\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "cc2ab7f260276399d3cabea13c870123", "score": "0.6767814", "text": "function getWinner(){\n if((self.board[0].status == self.board[1].status) && \n (self.board[1].status == self.board[2].status) && \n (self.board[0].status != \"null\")) {\n console.log(\"Player \" + self.board[0].status + \" wins\");\n self.message = (self.board[0].status + \" wins!\");\n if (self.board[0].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[0].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[3].status == self.board[4].status) && \n (self.board[4].status == self.board[5].status) && \n (self.board[3].status != \"null\")) {\n self.message = (self.board[3].status + \" wins!\");\n console.log(self.board[3].status + \" wins!\");\n if (self.board[3].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[3].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[6].status == self.board[7].status) && \n (self.board[7].status == self.board[8].status) && \n (self.board[6].status != \"null\")) {\n self.message = (self.board[6].status + \" wins!\");\n console.log(self.board[6].status + \" wins!\");\n if (self.board[6].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[6].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[0].status == self.board[3].status) && \n (self.board[3].status == self.board[6].status) && \n (self.board[0].status != \"null\")) {\n self.message = (self.board[0].status + \" wins!\");\n console.log(self.board[0].status + \" wins!\");\n if (self.board[0].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[0].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[1].status == self.board[4].status) && \n (self.board[4].status == self.board[7].status) && \n (self.board[1].status != \"null\")) {\n self.message = (self.board[1].status + \" wins!\");\n console.log(self.board[1].status + \" wins!\");\n if (self.board[1].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[1].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[2].status == self.board[5].status) && \n (self.board[5].status == self.board[8].status) && \n (self.board[2].status != \"null\")) {\n self.message = (self.board[2].status + \" wins!\");\n console.log(self.board[2].status + \" wins!\");\n if (self.board[2].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[2].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[0].status == self.board[4].status) && \n (self.board[4].status == self.board[8].status) && \n (self.board[0].status != \"null\")) {\n self.message = (self.board[0].status + \" wins!\");\n console.log(self.board[0].status + \" wins!\");\n if (self.board[0].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[0].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n if((self.board[2].status == self.board[4].status) && \n (self.board[4].status == self.board[6].status) && \n (self.board[2].status != \"null\")) {\n self.message = (self.board[2].status + \" wins!\");\n console.log(self.board[2].status + \" wins!\");\n if (self.board[2].status == \"America\"){\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n } else if(self.board[2].status == \"England\"){\n self.scoreEngland++;\n self.score2 = self.scoreEngland;\n }\n }\n // if no one wins AND all squares are equal to null, its a tie game and America gets the victory\n else if ((self.board[0].status != \"null\") &&\n (self.board[1].status != \"null\") &&\n (self.board[2].status != \"null\") &&\n (self.board[3].status != \"null\") &&\n (self.board[4].status != \"null\") &&\n (self.board[5].status != \"null\") &&\n (self.board[6].status != \"null\") &&\n (self.board[7].status != \"null\") &&\n (self.board[8].status != \"null\")){\n self.message = \"Tie goes to America!\";\n self.scoreAmerica++;\n self.score1 = self.scoreAmerica;\n }\n if (self.scoreAmerica >= 2) {\n self.message = \"Game Over, America Wins! :)\";\n // ((self.score1 = \"\") && (self.score2 = \"\"));\n }\n else if(self.scoreEngland >= 2) {\n self.message = \"Game Over, England Wins :(\";\n // ((self.score1 = \"\") && (self.score2 = \"\"));\n }\n }", "title": "" }, { "docid": "306a98ceb4d7b487f75af4b68b8d74d2", "score": "0.67505556", "text": "function checkForWinner(dom) {\r\n \r\n var vals = [\"placeholder\", dom.byId(\"1\").innerHTML, dom.byId(\"2\").innerHTML, dom.byId(\"3\").innerHTML, dom.byId(\"4\").innerHTML, \r\n dom.byId(\"5\").innerHTML, dom.byId(\"6\").innerHTML, dom.byId(\"7\").innerHTML, dom.byId(\"8\").innerHTML, dom.byId(\"9\").innerHTML];\r\n\t\r\n if(allTheSame(vals[1], vals[2], vals[3])) {\r\n winner = vals[1];\r\n paintWinningCombo(dom,1,2,3);\r\n return true;\r\n }\r\n else if(allTheSame(vals[4], vals[5], vals[6])) {\r\n winner = vals[4];\r\n paintWinningCombo(dom,4,5,6);\r\n return true;\r\n }\r\n else if(allTheSame(vals[7], vals[8], vals[9])) {\r\n winner = vals[7];\r\n paintWinningCombo(dom,7,8,9);\r\n return true;\r\n }\r\n else if(allTheSame(vals[1], vals[4], vals[7])) {\r\n winner = vals[1];\r\n paintWinningCombo(dom,1,4,7);\r\n return true;\r\n }\r\n else if(allTheSame(vals[2], vals[5], vals[8])) {\r\n winner = vals[2];\r\n paintWinningCombo(dom,2,5,8);\r\n return true;\r\n }\r\n else if(allTheSame(vals[3], vals[6], vals[9])) {\r\n winner = vals[3];\r\n paintWinningCombo(dom,3,6,9);\r\n return true;\r\n }\r\n else if(allTheSame(vals[1], vals[5], vals[9])) {\r\n winner = vals[1];\r\n paintWinningCombo(dom,1,5,9);\r\n return true;\r\n }\r\n else if(allTheSame(vals[3], vals[5], vals[7])) {\r\n winner = vals[3];\r\n paintWinningCombo(dom,3,5,7);\r\n return true;\r\n }\r\n return false;\r\n \r\n}", "title": "" }, { "docid": "8c68b71dcce54ad0a840caba74129d13", "score": "0.67470545", "text": "function decideWinner(humanChoice, botChoice){\n var rpsDatabase = {\n 'rock' :{'scissors': 1, 'rock': 0.5, 'paper': 0 },\n 'paper' :{'scissors': 0, 'rock': 1, 'paper': 0.5},\n 'scissors':{'scissors': 0.5, 'rock': 0, 'paper': 1 },\n }\n var humanScore = rpsDatabase[humanChoice][botChoice];\n var botScore = rpsDatabase[botChoice][humanChoice];\n\n \n\n return [humanScore, botScore];\n}", "title": "" }, { "docid": "ae262ec6cc03682f04018879b15af710", "score": "0.6731002", "text": "function checkWinner(){\n \n //outline all win conditions. Tried other methods. Really wanted to use array comparison, but couldn't\n //find a way to make it happen. \n //Win conditions for 'x' player\n if ($('#zero').hasClass('x') && $('#one').hasClass('x') && $('#two').hasClass('x') || \n $('#three').hasClass('x') && $('#four').hasClass('x') && $('#five').hasClass('x') ||\n $('#six').hasClass('x') && $('#seven').hasClass('x') && $('#eight').hasClass('x') ||\n $('#zero').hasClass('x') && $('#three').hasClass('x') && $('#six').hasClass('x') ||\n $('#zero').hasClass('x') && $('#four').hasClass('x') && $('#eight').hasClass('x') ||\n $('#one').hasClass('x') && $('#four').hasClass('x') && $('#seven').hasClass('x') ||\n $('#two').hasClass('x') && $('#five').hasClass('x') && $('#eight').hasClass('x') ||\n $('#two').hasClass('x') && $('#four').hasClass('x') && $('#six').hasClass('x')\n ) {\n winner = 'You won!';\n $(\"#player-score\").html(parseInt($(\"#player-score\").html(), 10)+1);\n $('.square').addClass('disabled-btn');\n $('#reset').addClass('highlight');\n playerScore++;\n //Win conditions for 'o' player\n } else if ($('#zero').hasClass('o') && $('#one').hasClass('o') && $('#two').hasClass('o') || \n $('#three').hasClass('o') && $('#four').hasClass('o') && $('#five').hasClass('o') ||\n $('#six').hasClass('o') && $('#seven').hasClass('o') && $('#eight').hasClass('o') ||\n $('#zero').hasClass('o') && $('#three').hasClass('o') && $('#six').hasClass('o') ||\n $('#zero').hasClass('o') && $('#four').hasClass('o') && $('#eight').hasClass('o') ||\n $('#one').hasClass('o') && $('#four').hasClass('o') && $('#seven').hasClass('o') ||\n $('#two').hasClass('o') && $('#five').hasClass('o') && $('#eight').hasClass('o') ||\n $('#two').hasClass('o') && $('#four').hasClass('o') && $('#six').hasClass('o')\n ) {\n winner = 'Computer won!';\n $(\"#opponent-score\").html(parseInt($(\"#opponent-score\").html(), 10)+1);\n $('.square').addClass('disabled-btn');\n $('#reset').addClass('highlight');\n compScore++;\n //If board is full with no win conditions outlined above\n } else if(countTurn >= 9){\n alert('Cat scratch fever.');\n catScore++;\n //Add to cat-record score\n $(\"#cat-record\").html(parseInt($(\"#cat-record\").html(), 10)+1);\n $('.square').addClass('disabled-btn');\n $('#reset').addClass('highlight');\n\n }\n\n }", "title": "" }, { "docid": "6571cf95c16dc8b1748c29efaa0a5172", "score": "0.672321", "text": "function CheckWinner(arr, player) {\r\n\r\n //Checks if all is equal to determine winner\r\n function isFive(a, b, c, d, e) {\r\n return (a === b && b === c && c === d && d === e && a != \"\");\r\n }\r\n\r\n let winner = null;\r\n for (let y = 0; y < arr.length; y++) {\r\n for (let x = 0; x < arr.length; x++) {\r\n const current = arr[y][x];\r\n let isChecked = false;\r\n if (current == player) {\r\n\r\n if (!isChecked) {\r\n //horizontal\r\n if (isFive(arr[y][x], arr[y][x + 1], arr[y][x + 2],\r\n arr[y][x + 3], arr[y][x + 4])) {\r\n winner = player;\r\n isChecked = true;\r\n }\r\n }\r\n\r\n if (!isChecked) {\r\n //diagonal 1\r\n if (isFive(arr[y][x], arr[y + 1][x + 1], arr[y + 2][x + 2],\r\n arr[y + 3][x + 3], arr[y + 4][x + 4])) {\r\n winner = player;\r\n isChecked = true;\r\n }\r\n }\r\n if (!isChecked) {\r\n //diagonal 2\r\n if (isFive(arr[y][x], arr[y + 1][x - 1], arr[y + 2][x - 2],\r\n arr[y + 3][x - 3], arr[y + 4][x - 4])) {\r\n winner = player;\r\n isChecked = true;\r\n }\r\n }\r\n if (!isChecked) {\r\n //vertical\r\n if (isFive(arr[y][x], arr[y + 1][x],\r\n arr[y + 2][x], arr[y + 3][x], arr[y + 4][x])) {\r\n winner = player;\r\n isChecked = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return winner;\r\n}", "title": "" }, { "docid": "330ac2173ebf88cd95a5bfa04d4981d0", "score": "0.6722049", "text": "checkWinner(playerChoice, aiChoice) {\n if (playerChoice === aiChoice) {\n return [\"draw\", \"same\"];\n }\n\n if (playerChoice === \"sword\") {\n if (aiChoice === \"magic\") {\n return [\"player\", \"magic\"];\n } else {\n return [\"enemy\", \"magic\"];\n }\n }\n\n if (playerChoice === \"magic\") {\n if (aiChoice === \"shield\") {\n return [\"player\", \"shield\"];\n } else {\n return [\"enemy\", \"shield\"];\n }\n }\n if (playerChoice === \"shield\") {\n if (aiChoice === \"sword\") {\n return [\"player\", \"sword\"];\n } else {\n return [\"enemy\", \"sword\"];\n }\n }\n }", "title": "" }, { "docid": "c6bb95285aec19556a73a24b9c29e4e6", "score": "0.6710416", "text": "function winnerCheck(myArray, currentRound) {\n 'use strict';\n var result = \"No Winner\";\n if (currentRound > 9) {\n if (myArray[0].health === myArray[1].health) {\n result = \"Draw\";\n } else if (myArray[0].health > myArray[1].health) {\n result = myArray[0].name + \" WINS!!!\";\n } else {\n result = myArray[1].name + \" WINS!!!\";\n }\n } else if ((myArray[0].health <= 0) && (myArray[1].health <= 0)) {\n result = \"You Both Die\";\n } else if (myArray[0].health <= 0) {\n result = myArray[1].name + \" WINS!!!\";\n } else if (myArray[1].health <= 0) {\n result = myArray[0].name + \" WINS!!!\";\n } else {\n result = \"No Winner\";\n }\n return result;\n\n} // End of the winnerCheck() function.", "title": "" }, { "docid": "6d0b4e8bc30e7c906953c06dc078ab9d", "score": "0.6675859", "text": "function findWinner(resultArray, marked){\n // iterate through the 8 possible combos\n for(var i = 0; i < possibleCombo.length; i ++){\n // var to keep track of matching numbers\n var countWins = 0;\n // iterate through length of each possible outcome\n for(var j = 0; j < possibleCombo[i].length; j ++){\n if(resultArray.indexOf(possibleCombo[i][j]) !== -1){\n // if there is matching #, increase countWin\n countWins++;\n } \n // if there is 3 matching #, announce winner\n if(countWins === 3 && marked === 'X'){\n playerX++; \n alert('The winner of this game is ' + marked + '!');\n score.innerHTML = 2;\n score.innerTEXT = 2;\n stopGame();\n // }\n } else if (countWins === 3 && marked === 'O'){\n playerO++;\n alert('The winner of this game is ' + marked + '!');\n stopGame();\n }\n }\n }\n}", "title": "" }, { "docid": "83cc11df9508b7bca2e50759fff78f74", "score": "0.6673929", "text": "function findWinner(){\n const totals = hands.map((hand) => {\n return hand.reduce((total, card) => {\n return total + card.value;\n }, 0);\n });\n //console.log('this is the total within the findWinner function', totals);\n const winningValue = totals.reduce((a, b) => Math.max(a,b));\n const winningIndex = totals.indexOf(winningValue);\n const winner = `Player ${winningIndex + 1} won with ${winningValue} points`;\n return $win.append(winner);\n }", "title": "" }, { "docid": "e14751a92cdf3c0d23ee7c2dfbc17a60", "score": "0.6671939", "text": "getWinner() {\n return this.teams[0].teamScore > this.teams[1].teamScore\n ? this.teams[0]\n : this.teams[1];\n }", "title": "" }, { "docid": "8abb75e4ac6e4128ece335a621696b66", "score": "0.66713506", "text": "checkForWinner(board) {\n // Check for horizontal wins\n for (var i = 0; i <= 12; i += 4) {\n if (\n board[i] !== NOBODY &&\n board[i] === board[i + 1] &&\n board[i] === board[i + 2] &&\n board[i] === board[i + 3]\n )\n return board[i] == PLAYER_SWORD ? 1 : 2;\n }\n\n // Check for vertical wins\n for (var i = 0; i <= 3; i++) {\n if (\n board[i] !== NOBODY &&\n board[i] === board[i + 4] &&\n board[i] === board[i + 8] &&\n board[i] === board[i + 12]\n )\n return board[i] == PLAYER_SWORD ? 1 : 2;\n }\n\n // Check for main diagonal win\n if (\n board[0] !== NOBODY &&\n board[0] === board[5] &&\n board[0] === board[10] &&\n board[0] === board[15]\n ) {\n return board[0] == PLAYER_SWORD ? 1 : 2;\n }\n // Check for secondary diagonal win\n if (\n board[3] !== NOBODY &&\n board[3] === board[6] &&\n board[3] === board[9] &&\n board[3] === board[12]\n ) {\n return board[3] == PLAYER_SWORD ? 1 : 2;\n }\n\n // Game is not over\n for (var i = 0; i < 16; i++) {\n if (board[i] === NOBODY)\n return 0;\n }\n\n // It is a tie\n return 3;\n }", "title": "" }, { "docid": "7fdd1a3b5b0961e4e705b1225f1e325b", "score": "0.6662273", "text": "function checkForWinningMove(){\n winners.map(function(a) {\n if (board[a[0]] === aiToken && board[a[1]] === aiToken && board[a[2]] === \"\"){\n nextMove = a[2];\n return nextMove;\n }\n else if (board[a[0]] === aiToken && board[a[2]] === aiToken && board[a[1]] === \"\"){\n nextMove = a[1];\n return nextMove;\n }\n else if (board[a[1]] === aiToken && board[a[2]] === aiToken && board[a[0]] === \"\"){\n nextMove = a[0];\n return nextMove;\n }\n });\n}", "title": "" }, { "docid": "ef11e302b24523d929b723c69393ef26", "score": "0.6661971", "text": "function determineWinner(){\n for (var i = 0; i < resultsArray.length; i++) {\n if (resultsArray[i][0].classList.contains('clicked-o') && resultsArray[i][1].classList.contains('clicked-o') && resultsArray[i][2].classList.contains('clicked-o') ){\n oWinsFill();\n turnCounter = 11;\n if (player1 === 'Player 1') {\n player2Wins = player2Wins + 1;\n winCounter2.textContent = `Player 2 wins: ${player2Wins}`;\n } else {\n player1Wins = player1Wins + 1;\n winCounter1.textContent = `Player 1 wins: ${player1Wins}`; \n }\n \n whosTurn.textContent = `${player2} wins!`;\n } else if (resultsArray[i][0].classList.contains('clicked-x') && resultsArray[i][1].classList.contains('clicked-x') && resultsArray[i][2].classList.contains('clicked-x')){\n turnCounter = 11;\n xWinsFill();\n if (player1 === 'Player 1') {\n player1Wins = player1Wins + 1;\n winCounter1.textContent = `Player 1 wins: ${player1Wins}`;\n } else {\n player2Wins = player2Wins + 1;\n winCounter2.textContent = `Player 2 wins: ${player2Wins}`; \n }\n whosTurn.textContent = (`${player1} wins!`)\n } \n }\n}", "title": "" }, { "docid": "f85c1adab7bbf43748e6d1304426fb28", "score": "0.66572493", "text": "function compareMoves(compChoice, userChoice){\n // Declare variable for winner\n let winner;\n\n // Remaining code evaluates who wins the round by comparing moves played\n if(compChoice == \"Rock\"){\n if(userChoice == \"Rock\"){\n winner = 0;\n }\n else if(userChoice == \"Paper\"){\n winner = 2;\n }\n else{\n winner = 1;\n }\n }\n if(compChoice == \"Paper\"){\n if(userChoice == \"Rock\"){\n winner = 1;\n }\n else if(userChoice == \"Paper\"){\n winner = 0;\n }\n else{\n winner = 2;\n } \n }\n if(compChoice == \"Scissors\"){\n if(userChoice == \"Rock\"){\n winner = 2;\n }\n else if(userChoice == \"Paper\"){\n winner = 1;\n }\n else{\n winner = 0;\n } \n }\n return winner;\n\n}", "title": "" }, { "docid": "5a5ce665597962b3086743b3aef7a15f", "score": "0.66446114", "text": "function getMatchWinner(match) {\n let player1SetsWon = 0;\n let player2SetsWon = 0;\n\n match.sets.forEach(set => {\n //player1 has more points\n if (set.player1 - 1 > set.player2 && set.player1 >= 11) {\n player1SetsWon++;\n }\n //player2 has more points\n if (set.player1 < set.player2 - 1 && set.player2 >= 11) {\n player2SetsWon++;\n }\n });\n\n if (player1SetsWon === 3) return match.player1;\n\n if (player2SetsWon === 3) return match.player2;\n\n return false;\n}", "title": "" }, { "docid": "bda15b3af1580301fe2ed59b465afd9c", "score": "0.66413254", "text": "determineWinner() {\n\n\t}", "title": "" }, { "docid": "0e1dc9942e35964f4cfd7de640702b09", "score": "0.6636415", "text": "function checkWinner(currentPlayerValue) {\n if (cellArray[0].innerText === currentPlayerValue && cellArray[1].innerText === currentPlayerValue && cellArray[2].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[3].innerText === currentPlayerValue && cellArray[4].innerText === currentPlayerValue && cellArray[5].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[6].innerText === currentPlayerValue && cellArray[7].innerText === currentPlayerValue && cellArray[8].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[0].innerText === currentPlayerValue && cellArray[3].innerText === currentPlayerValue && cellArray[6].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[1].innerText === currentPlayerValue && cellArray[4].innerText === currentPlayerValue && cellArray[7].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[2].innerText === currentPlayerValue && cellArray[5].innerText === currentPlayerValue && cellArray[8].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[0].innerText === currentPlayerValue && cellArray[4].innerText === currentPlayerValue && cellArray[8].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n } else if (cellArray[6].innerText === currentPlayerValue && cellArray[4].innerText === currentPlayerValue && cellArray[2].innerText === currentPlayerValue) {\n displayWinningOutcome(currentPlayerValue);\n }\n}", "title": "" }, { "docid": "6fb00452128bf56d1134f6412688bb6b", "score": "0.6623422", "text": "function tournamentWinner2(competitions, results) {\n let teamPointsMap = new Map();\n let currentWinner = \"\";\n teamPointsMap.set(currentWinner, 0);\n\tconst WIN_POINTS = 3;\n\n for (let i = 0; i < results.length; i++) {\n const winner = results[i] === 1 ? competitions[i][0] : competitions[i][1];\n let currentHighScore = teamPointsMap.get(currentWinner);\n if (teamPointsMap.has(winner)) {\n teamPointsMap.set(winner, teamPointsMap.get(winner) + WIN_POINTS);\n }\n else {\n teamPointsMap.set(winner, WIN_POINTS);\n }\n\n if (teamPointsMap.get(winner) > currentHighScore) {\n currentWinner = winner;\n currentHighScore = teamPointsMap.get(winner);\n }\n }\n\n return currentWinner;\n}", "title": "" }, { "docid": "0d6d37c5780d9058afe86f6179e8cd88", "score": "0.6623016", "text": "function checkWinner() {\n //positions\n var one = $('td[data-x=\"0\"][data-y=\"0\"]').text();\n var two = $('td[data-x=\"1\"][data-y=\"0\"]').text();\n var three = $('td[data-x=\"2\"][data-y=\"0\"]').text();\n var four = $('td[data-x=\"0\"][data-y=\"1\"]').text();\n var five = $('td[data-x=\"1\"][data-y=\"1\"]').text();\n var six = $('td[data-x=\"2\"][data-y=\"1\"]').text();\n var seven = $('td[data-x=\"0\"][data-y=\"2\"]').text();\n var eight = $('td[data-x=\"1\"][data-y=\"2\"]').text();\n var nine = $('td[data-x=\"2\"][data-y=\"2\"]').text();\n var board = [one, two, three, four, five, six, seven, eight, nine];\n //horizontal win combos\n if(one !== \"\" && one === two && two === three) {\n turn = 0;\n return message(`Player ${one} Won!`);\n } else if (four !== \"\" && four === five && five === six) {\n turn = 0;\n return message(`Player ${four} Won!`);\n } else if (seven !== \"\" && seven === eight && eight === nine) {\n turn = 0;\n return message(`Player ${seven} Won!`);\n //vertical win combos\n } else if (one !== \"\" && one === four && four === seven) {\n turn = 0;\n return message(`Player ${one} Won!`);\n } else if (two !== \"\" && two === five && five === eight) {\n turn = 0;\n return message(`Player ${two} Won!`);\n } else if (three !== \"\" && three === six && six === nine) {\n turn = 0;\n return message(`Player ${three} Won!`);\n //diagonal win combos\n } else if (one !== \"\" && one === five && five === nine) {\n turn = 0;\n return message(`Player ${one} Won!`);\n } else if (three !== \"\" && three === five && five === seven) {\n turn = 0;\n return message(`Player ${three} Won!`);\n } else if (!board.includes(\"\")) {\n turn = 0;\n return message('Tie game');\n } else {\n return false\n }\n}", "title": "" }, { "docid": "a4f90e7517daeedd3178cefa68f6c558", "score": "0.6607897", "text": "function winnerCheck(){\n var winner='no winner';\n if(playerOne[1]<=0 && playerTwo[1]<=0){\n winner= 'Tie!';\n }\n else if(playerOne[1]<=0){\n winner= playerTwo+' wins!!!';\n }\n else if(playerTwo[1]<=0){\n winner= playerOne+' wins!!!';\n };\n return winner;\n }", "title": "" }, { "docid": "1e6a9c7f6d96328847b841df0baf176f", "score": "0.66032475", "text": "function isWinner(){\n var winnerColumn = checkColumn();\n var winnerRow = checkRow();\n var WinnerDiag = checkDiag();\n var winner = false;\n if(winnerColumn){\n winner = winnerColumn;\n }else if(winnerRow){\n winner = winnerRow;\n }else if(WinnerDiag){\n winner = WinnerDiag;\n }\n if(winner == \"win1\")scoreP1++;\n if(winner == \"win2\")scoreP2++; \n return winner\n}", "title": "" }, { "docid": "f15cab81a429eef8d10c0266500873e2", "score": "0.660072", "text": "function WinnerDetection(){\n let value=[\"X\", \"O\"];\n let win= false;\n let someOneWinner= false;\n //v = x\n //v = o\n value.forEach(function(v){\n if(game[0] === v && game[1]===v && game[2]===v){\n win= true;\n someOneWinner=true;\n // alert(\"player\" + game[0] + \"Wins\")\n\n }else if(game[3] === v && game[4] === v && game[5]===v){\n win= true;\n someOneWinner=true;\n }else if(game[6] === v && game[7] === v && game[8]===v){\n win= true;\n someOneWinner=true;\n }else if(game[0] === v && game[3] === v && game[6]===v){\n win= true;\n someOneWinner=true;\n }else if(game[1] === v && game[4] === v && game[7]===v){\n win= true;\n someOneWinner=true;\n }else if(game[2] === v && game[5] === v && game[8]===v){\n win= true;\n someOneWinner=true;\n }else if(game[0] === v && game[4] === v && game[8]===v){\n win= true;\n someOneWinner=true;\n } else if(game[2] === v && game[4] === v && game[6]===v){\n win= true;\n someOneWinner=true;\n }\n \n\n if(win === true){\n swal({\n title: \"Good job! \" + v,\n text: \"Congratulations\",\n icon: \"success\",\n button: \"Done!\",\n });\n \n win = false;\n }\n });\n\n if(count === 9 && someOneWinner === false){\n alert(\"Tie\");\n }\n\n }", "title": "" }, { "docid": "17a8a75bf1f0dc700a9c0b8afc14817c", "score": "0.6600707", "text": "printWinner() {\n let winner, tie = false;\n console.log(`Evaluando manos...`);\n // De momento gana el jugador 1 :)\n winner = this.players[0];\n console.log(`${winner.name} - Mano: ${winner.hand.toString()} - Valoración: ${JSON.stringify(winner.hand.value)}`);\n // Recorro el resto de manos a ver si le pueden ganar, y en ese caso actualizo el ganador. También controlo si hay empates\n for (let i = 1; i < this.players.length; i++) {\n const player = this.players[i];\n if (player.hand.value.rank > winner.hand.value.rank) {\n tie = false;\n winner = player;\n } else if (player.hand.value.rank === winner.hand.value.rank) {\n let changeWinner = false;\n tie = true;\n switch (player.hand.value.rank) {\n case Ranking.Ranking.STRAIGHT_FLUSH:\n // La escalera más alta gana. NO hay empate posible\n if (player.hand.value.highCard > winner.hand.value.highCard) changeWinner = true;\n tie = false;\n break;\n case Ranking.Ranking.POKER:\n // El poker más alto gana. NO hay empate posible\n if (player.hand.value.topFour > winner.hand.value.topFour) changeWinner = true;\n tie = false;\n break;\n case Ranking.Ranking.FULL_HOUSE:\n // El full house más alto gana. NO hay empate posible\n if (player.hand.value.topThree > winner.hand.value.topThree) changeWinner = true;\n tie = false; \n break;\n case Ranking.Ranking.FLUSH:\n // El color con mayor valor gana (el totalSum da más peso a las artas altas)\n if (player.hand.value.totalSum > winner.hand.value.totalSum) changeWinner = true;\n break;\n case Ranking.Ranking.STRAIGHT:\n // La escalera con mayor valor gana (el totalSum da más peso a las artas altas)\n if (player.hand.value.totalSum > winner.hand.value.totalSum) changeWinner = true;\n break;\n case Ranking.Ranking.THREE:\n // El trio más alto gana. NO hay empate posible\n if (player.hand.value.topThree > winner.hand.value.topThree) changeWinner = true;\n tie = false; \n break;\n case Ranking.Ranking.DOUBLE_PAIR:\n let pairsPlayer = player.hand.value.topPair + player.hand.value.topPairB;\n let pairsWinner = winner.hand.value.topPair + winner.hand.value.topPairB;\n // La parejas más altas gana\n if (pairsPlayer > pairsWinner) changeWinner = true;\n // En caso de empate las cartas más altas\n else if (pairsPlayer === pairsWinner && player.hand.value.totalSum > winner.hand.value.totalSum) changeWinner = true;\n break;\n case Ranking.Ranking.PAIR:\n // La pareja más alta gana\n if (player.hand.value.topPair > winner.hand.value.topPair) changeWinner = true;\n // En caso de empate las cartas más altas\n else if (player.hand.value.topPair === winner.hand.value.topPair && player.hand.value.totalSum > winner.hand.value.totalSum) changeWinner = true;\n break;\n case Ranking.Ranking.HIGH_CARD:\n // La mano con mayor puntaje gana (el totalSum da más peso a las cartas altas)\n if (player.hand.value.totalSum > winner.hand.value.totalSum) changeWinner = true;\n break;\n }\n // Si se deshace el empate con el jugador actual\n if (changeWinner) {\n winner = player;\n tie = false;\n } else if (tie && player.hand.value.totalSum < winner.hand.value.totalSum) {\n // Deshago el empate, si el totalSum del winner anterior es mayor\n tie = false;\n }\n }\n console.log(`${player.name} - Mano: ${player.hand.toString()} - Valoración: ${JSON.stringify(player.hand.value)}`);\n }\n if (tie) {\n console.log(`El resultado es EMPATE!`);\n } else {\n console.log(`El ganador es ${winner.name} que tiene ${winner.hand.value.description} con la mano ${winner.hand} `); \n }\n }", "title": "" }, { "docid": "d3a88abe62c0be8cdec3baf395f32612", "score": "0.65994656", "text": "function checkWinner () {\n winningComb.forEach((item, index) => { \n if (gameBoard.board[item[0]] === this.activePlayer.marker && gameBoard.board[item[1]] === this.activePlayer.marker && gameBoard.board[item[2]] === this.activePlayer.marker) {\n winnerText.innerHTML = `<b>${this.activePlayer.name} wins</b>`;\n this.haveWinner = true;\n } \n })\n }", "title": "" }, { "docid": "f18fe271673ce0482e50bd63232d4ce0", "score": "0.6594102", "text": "static winner(played) {\n let size = played.length; // Assumes square\n for (let i = 0; i < size; i++) {\n // Row\n if (this.isWinRow([i, 0], played)) {\n return played[i][0];\n }\n // column\n if (this.isWinColumn([0, i], played)) {\n return played[0][i];\n }\n }\n // 1st diagonal\n if (this.isWinDiagonal1([0, 0], played)) {\n return played[0][0];\n }\n if (this.isWinDiagonal2([size - 1, 0], played)) {\n return played[size - 1][0];\n }\n // No win\n return 0;\n }", "title": "" }, { "docid": "0e6d3600407c06e060846fad07ab24c5", "score": "0.6590286", "text": "function decidewinner(playerchoice,computerchoice){\r\n var scoring = {\r\n 'rock':{'rock':0.5,'paper':0, 'scissor':1},\r\n 'paper':{'rock':1, 'paper':0.5, 'scissor':0},\r\n 'scissor':{'rock':0,'paper':1,'scissor':0.5},\r\n };\r\n \r\n var yourscore= scoring[playerchoice][computerchoice];\r\n var botscore= scoring[botchoice][playerchoice];\r\n\r\n return [yourscore,botscore];\r\n}", "title": "" }, { "docid": "ffaae3d185235305ba75bfbeff13f7c7", "score": "0.6589823", "text": "function getWinners(cb) {\n\tlet winners = [];\n\tcb.forEach(function(item) {\n\t\tlet home = item['Home Team Goals'] + item['Half-time Home Goals'];\n\t\tlet away = item['Away Team Goals'] + item['Half-time Away Goals'];\n\t\tif (home > away) {\n\t\t\twinners = cb.map(function(item){\n\t\t\t\treturn item['Home Team Name'];\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\twinners = cb.map(function(item){\n\t\t\t\treturn item['Away Team Name'];\n\t\t\t});\n\t\t}\n\t});\n\treturn winners;\n}", "title": "" }, { "docid": "ed8b89ec0ca83625021944d8c3da59ee", "score": "0.6578912", "text": "function hasWinner(pick) {\n move_counter++;\n //check if there is a winner\n if( (cells[0].textContent=== pick && cells[1].textContent === pick && cells[2].textContent === pick) ||\n (cells[0].textContent === pick && cells[3].textContent === pick && cells[6].textContent === pick) ||\n (cells[0].textContent === pick && cells[4].textContent === pick && cells[8].textContent === pick) ||\n (cells[3].textContent === pick && cells[4].textContent === pick && cells[5].textContent === pick) ||\n (cells[6].textContent === pick && cells[7].textContent === pick && cells[8].textContent === pick) ||\n (cells[2].textContent === pick && cells[5].textContent === pick && cells[8].textContent === pick) ||\n (cells[1].textContent === pick && cells[4].textContent === pick && cells[7].textContent === pick) ||\n (cells[2].textContent === pick && cells[4].textContent === pick && cells[6].textContent === pick)) {\n gameOverHandler(pick);\n }\n //tie!\n else if(move_counter==9){\n gameOverHandler(\"no one\"); \n }\n }", "title": "" }, { "docid": "6b1de095bdba5e6631a850cae7392e54", "score": "0.65752214", "text": "function checkWinner() {\n const winning_combos = [[0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6]];\n board = {};\n $('td').text((i, token) => board[i] = token);\n for (let combo of winning_combos) {\n if (board[combo[0]] !== \"\" && board[combo[0]] === board[combo[1]] && board[combo[0]] === board[combo[2]]) {\n setMessage(`Player ${board[combo[0]]} Won!`);\n return true;\n };\n };\n return false;\n}", "title": "" }, { "docid": "cef086ac6271697e4f469288abb83bb0", "score": "0.6574957", "text": "function opponentWin() {\n var wsLength = winSums.length\n var losers = [];\n for (i = 0; i < wsLength; i++) {\n if (arrayMax(winSums[i]) == 2 && gridImage[i] == 0) losers.push(i)\n }\n var randomIndex = Math.floor(Math.random() * (losers.length));\n if (losers.length) return losers[randomIndex];\n else return null;\n }", "title": "" }, { "docid": "9acbdcc7d7e4977c371b1806b5a0ac96", "score": "0.65732807", "text": "function winnerchecker() {\n for (var i = 0; i < squ.length; i = i + 3) {\n var res = threerow(i, i + 1, i + 2);\n if (res === 1) {\n var gameover = document.getElementById(\"result\");\n if (squ[i].innerHTML === \"X\") {\n gameover.innerHTML = player1 + \" is the winner\";\n return;\n }\n else {\n gameover.innerHTML = player2 + \" is the winner\";\n return;\n }\n\n }\n }\n for (var i = 0; i < 3; i++) {\n var res = threerow(i, i + 3, i + 6);\n if (res === 1) {\n var gameover = document.getElementById(\"result\");\n if (squ[i].innerHTML === \"X\") {\n gameover.innerHTML = player1 + \" is the winner\";\n return;\n }\n else {\n gameover.innerHTML = player2 + \" is the winner\";\n return;\n }\n\n }\n }\n var res = threerow(0, 4, 8);\n if (res === 1) {\n var gameover = document.getElementById(\"result\");\n if (squ[i].innerHTML === \"X\") {\n gameover.innerHTML = player1 + \" is the winner\";\n return;\n }\n else {\n gameover.innerHTML = player2 + \" is the winner\";\n return;\n }\n\n }\n var res = threerow(2, 4, 6);\n if (res === 1) {\n var gameover = document.getElementById(\"result\");\n if (squ[i].innerHTML === \"X\") {\n gameover.innerHTML = player1 + \" is the winner\";\n return;\n }\n else {\n gameover.innerHTML = player2 + \" is the winner\";\n return;\n }\n\n }\n}", "title": "" }, { "docid": "e9cd21fa0f954759acd3f92810a4621f", "score": "0.6572797", "text": "function winnerSet() {\n if (g.player1Score > g.player2Score) {\n g.winner = \"Player 1\";\n } else if (g.player1Score < g.player2Score) {\n g.winner = \"Player 2\";\n } else if (g.player1Score == g.player2Score) {\n g.winner = \"It's a tie\";\n } else {\n g.winner = \"error in the code\";\n }\n}", "title": "" }, { "docid": "7149c619c2a026d509212864ac457cdc", "score": "0.6570201", "text": "function checkWinner(){\n for (let i = 0; i < winningCombo.length; i++) {\n if (Math.abs(board[winningCombo[i][0]] + board[winningCombo[i][1]] + board[winningCombo[i][2]]) === 3) return board[winningCombo[i][0]];\n }\n if (board.includes(null)) return null\n return 'T'\n}", "title": "" }, { "docid": "ed6b82387fb59feaeaf80c282909c6fb", "score": "0.6560811", "text": "function checkWinner() {\n var winner = false;\n var board = {}; //board is an empty object\n\n $('td').text((index, square) => board[index] = square);\n\n WINNING_COMBOS.forEach(function(position) {\n if (board[position[0]] === board[position[1]] && board[position[1]] === board[position[2]] && board[position[0]] !== \"\") {\n setMessage(`Player ${board[position[0]]} Won!`)\n return winner = true;\n }\n })\n\n return winner;\n}", "title": "" }, { "docid": "3196d69af0fe8add06fa26db4a0783b8", "score": "0.65345114", "text": "function checkForWinner() {\n let symbol = activePlayer.getActivePlayer().symbol\n //3 on top row\n if (gameBoardArr[0] === symbol && gameBoardArr[1] === symbol && gameBoardArr[2] === symbol) {\n //create a function here depending on what happens if someone wins\n declareWinner()\n //3 on middle row\n } else if (gameBoardArr[3] === symbol && gameBoardArr[4] === symbol && gameBoardArr[5] === symbol) {\n declareWinner()\n //3 on bottom row\n } else if (gameBoardArr[6] === symbol && gameBoardArr[7] === symbol && gameBoardArr[8] === symbol) {\n declareWinner()\n } else if (gameBoardArr[0] === symbol && gameBoardArr[3] === symbol && gameBoardArr[6] === symbol) {\n declareWinner()\n } else if (gameBoardArr[1] === symbol && gameBoardArr[4] === symbol && gameBoardArr[7] === symbol) {\n declareWinner()\n } else if (gameBoardArr[2] === symbol && gameBoardArr[5] === symbol && gameBoardArr[8] === symbol) {\n declareWinner()\n } else if (gameBoardArr[0] === symbol && gameBoardArr[4] === symbol && gameBoardArr[8] === symbol) {\n declareWinner()\n } else if (gameBoardArr[2] === symbol && gameBoardArr[4] === symbol && gameBoardArr[6] === symbol) {\n declareWinner()\n }\n }", "title": "" }, { "docid": "3873700998880dd9e1b1e06d26873070", "score": "0.65286905", "text": "function checkWin(arrayOfChosenNumbers) {\n let obj = {};\n let youWin;\n\n arrayOfChosenNumbers.forEach((el, index) => {\n obj[el] = index;\n });\n for (let i = 0; i < win.length; i++) {\n youWin = win[i].every(el => {\n return obj[el] !== undefined;\n });\n if (youWin) break;\n }\n return youWin;\n}", "title": "" }, { "docid": "afee28c9893c16cee2807863d6fd8702", "score": "0.6527467", "text": "function checkWin()\n{\n if (this.player1.score >= this.options.scoreToWin)\n {\n this.winner = \"player1\"\n this.loser = \"player2\"\n return 1;\n }\n else if (this.player2.score >= this.options.scoreToWin)\n {\n this.winner = \"player2\"\n this.loser = \"player1\"\n return 2;\n }\n\n return 0;\n}", "title": "" }, { "docid": "da937620a7a779722fd31af269e6cdd0", "score": "0.65266615", "text": "function selectWinner(players) {\n const sortedList = players.sort(function(a,b) {\n return b.playerscore-a.playerscore;\n })\n if(sortedList[0].playerscore === sortedList[1].playerscore) {\n alert(`Game Finished, ${sortedList[0].name} & ${sortedList[1].name} had a draw!\n The game will now restart.`);\n location.reload();\n } else {\n alert(`Game Finished, ${sortedList[0].name} won!\n The game will now restart.`);\n location.reload();\n }\n}", "title": "" }, { "docid": "2cf11f0d61eef628342b7ed72d093c04", "score": "0.65260464", "text": "function decideWinner(humanChoice, botChoice) {\n var rpsDatabase = {\n 'rock': { 'scissor': 1, 'rock': 0.5, 'paper': 0 },\n 'paper': { 'rock': 1, 'paper': 0.5, 'scissor': 0 },\n 'scissor': { 'paper': 1, 'scissor': 0.5, 'rock': 0 },\n };\n\n var yourScore = rpsDatabase[humanChoice][botChoice];\n var botScore = rpsDatabase[botChoice][humanChoice];\n\n return [yourScore, botScore];\n}", "title": "" }, { "docid": "aed5cc16bd3a392bf84aa1c92ff1de3f", "score": "0.65233314", "text": "checkWinner() {\n let bC = 0, wC = 0;\n\n for(let i = 0; i < this.size; i++){\n for(let j = 0; j < this.size; j++){\n if(this.board[i][j] === Othello.WHITE){\n wC++;\n }\n if(this.board[i][j] === Othello.BLACK){\n bC++;\n }\n }\n }\n if(wC > bC){\n return Othello.WHITE;\n } else if(bC > wC){\n return Othello.BLACK;\n } else{\n return Othello.TIE;\n }\n }", "title": "" }, { "docid": "d3b156a5ea10b9f94a7584a28d07065c", "score": "0.65225536", "text": "declareWinner() {\n // Find the index of the strategy with most points.\n let winner = this.resultsByStrategy.reduce((iMax, x, i, arr) => {\n return x > arr[iMax] ? i : iMax;\n }, 0);\n\n let str = 'The winner is ' + this.strategies[winner].name +\n ' with ' + this.resultsByStrategy[winner] + ' points!';\n coolPrint(str);\n\n if (this.verbose) {\n console.log('The winner says:')\n this.strategies[winner].win();\n if (this.strategies.length < 2) return;\n console.log('\\nThe losers say:\\n');\n this.strategies.forEach((strategy, i) => {\n if (i !== winner) {\n console.log(strategy.name + ' says:');\n strategy.defeat();\n }\n });\n }\n }", "title": "" }, { "docid": "19744031a7b6dc71c20a4f5aa9075d32", "score": "0.6520457", "text": "function checkForWinner(){\n var winningCombos = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n [0, 4, 8],\n [2, 4, 6]\n ]\n//the initial gamestate must be such that there is no winner at start\n var winner = false\n//REVIEWTHISSECTION\n winningCombos.find(function(combo){\n if(gameState.board[combo[0]] == gameState.board[combo[1]] && gameState.board[combo[1]] == gameState.board[combo[2]]){\n winner = gameState.board[combo[0]]\n }\n })\n\n return winner\n }", "title": "" }, { "docid": "7447e76ff5541f213a013577c02920f0", "score": "0.65202653", "text": "function results (){\n if (player1.ready === true && player2.ready === true){\n if ((player1.picked === rock && player2.picked === scissors) || (player1.picked === rock && player2.picked === lizard) || (player1.picked === paper && player2.picked === spock) || (player1.picked === scissors && player2.picked === paper) || (player1.picked === scissors && player2.picked === lizard) || (player1.picked === lizard && player2.picked === paper) || (player1.picked ===lizard && player2.picked === spock) || (player1.picked === spock && player2.picked === rock) || (player1.picked === paper && player2.picked === rock) || (player1.picked === spock && player2.picked === scissors) ){\n player1.win++;\n player2.lose++;\n nextGame();\n }\n else if (player1.picked === player2.picked) {\n tie++;\n nextGame();\n }\n else {\n player1.lose++;\n player2.win++;\n nextGame();\n }\n }\n}", "title": "" }, { "docid": "f1933b107930aa95c616da2ac995684c", "score": "0.6516623", "text": "function decideWinner(humanChoice, botChoice){\n var rpsDataBase={\n 'rock' : {'scissor':1, 'rock':0.5, 'paper':0},\n 'paper': {'rock':1, 'paper':0.5, 'scissor':0},\n 'scissor':{'paper':1, 'scissor':0.5, 'rock':0}\n };\n\n var humanScore = rpsDataBase[humanChoice][botChoice];\n var botScore = rpsDataBase[botChoice][humanChoice];\n\n return [humanScore, botScore];\n}", "title": "" }, { "docid": "862a79cb147967df86db0cd11c1d60d3", "score": "0.6506066", "text": "function theWinneris(arr, playerSym){\n let result = true;\n arr.forEach(function(seq){\n if(doWeHaveAWinner(seq, playerSym)){\n result = false;\n game = \"over\";\n $(\".player h2\").text(\"Player \" + playerTurn + \" wins!\");\n theWinner = playerTurn;\n $(\".player\").addClass(\"playerExpand\");\n $(\".again\").fadeIn();\n updateScore();\n }\n });\n // if there is no winner and all the stops are filled; if both players tie\n if( result && $(\".border-settings tr td\").text().length === 9){\n console.log(\"draw\");\n game = \"over\";\n theWinner = \"draw\";\n $(\".player h2\").text(\"Draw\");\n $(\".player\").addClass(\"playerExpand\");\n $(\".again\").fadeIn();\n return !result;\n }\n\n return result;\n }", "title": "" }, { "docid": "e25feb38e6926a15d3ba9f9276263cfd", "score": "0.64999807", "text": "function winner (pers) {\n if(pers.luck < 10){\n pers.luck++;\n pers.wins++;\n }\n else if (pers.luck == 10){\n pers.wins++\n }\n return pers;\n}", "title": "" }, { "docid": "c64f9b4014f0b8795e705c018cf1d69b", "score": "0.6497061", "text": "function tournamentWinner(competitions, results) {\n let teamPointsMap = new Map();\n\n for (let i = 0; i < results.length; i++) {\n const winner = results[i] === 1 ? competitions[i][0] : competitions[i][1];\n if (teamPointsMap.has(winner)) {\n teamPointsMap.set(winner, teamPointsMap.get(winner) + 3);\n }\n else {\n teamPointsMap.set(winner, 3);\n }\n }\n \n let finalWinnerScore = 0;\n let finalWinner;\n for (let [key, value] of teamPointsMap) {\n if (value > finalWinnerScore) {\n finalWinnerScore = value;\n finalWinner = key;\n }\n }\n\n return finalWinner;\n}", "title": "" }, { "docid": "8335af219d7036ac413c8bb95f70c15c", "score": "0.6495526", "text": "function checkRoundTie() {\n\n // Will return true if all boards have class carnivore, herbivore or tie and no win condition has been met.\n let activeBoards = 0\n for (let i = 0; i < smallBoards.length; i++) {\n if (!smallBoards[i].classList.contains('carnivore') && !smallBoards[i].classList.contains('herbivore') && !smallBoards[i].classList.contains('tie')) {\n activeBoards++\n }\n }\n if (activeBoards === 0 && !carnivoreWinsRound && !herbivoreWinsRound) {\n console.log('Game is a tie!')\n return roundIsTied = true\n }\n\n}", "title": "" }, { "docid": "35b6e84b9550168b2347c6052118d509", "score": "0.6481287", "text": "function checkWinner() {\n winConditions.forEach((item,index)=>{\n if(myFunc.board === myFunc.board[0])\n console.log(\"I have lost\")\n })\n }", "title": "" }, { "docid": "d686b85e4b153b70075dceef7bf29b0a", "score": "0.6478542", "text": "checkForWinners(xTurn) {\n\n // gets an array of indexes associated with the pieces of the given turn\n let pieces = this.board\n .filter(tile => tile.xPiece === xTurn)\n .map(tile => tile.index);\n\n if (pieces.length < 3)\n return [];\n\n let winConditions = [\n // rows\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8],\n\n // columns\n [0, 3, 6],\n [1, 4, 7],\n [2, 5, 8],\n\n // diagonals\n [0, 4, 8],\n [2, 4, 6]\n ];\n\n let winners = winConditions.filter(condition => condition.every(i => pieces.includes(i)));\n\n if (winners.length > 0) {\n this.xWins = xTurn;\n\n // set winning tiles\n winners.reduce((acc, arr) => acc.concat(arr), [])\n .map(i => this.board[i])\n .forEach(tile => tile.winner = true);\n }\n }", "title": "" }, { "docid": "b056be7edbdff7c0f895dde5b1a6e61c", "score": "0.64695156", "text": "checkForWinner() {\n let wins = [[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]\n let state = this.state.board\n\n wins.forEach((combo) => {\n if(state[combo[0]] === state[combo[1]]\n && state[combo[0]] === state[combo[2]]\n && state[combo[0]]) {\n alert('Winner is ' + state[combo[0]])\n this.setState({winner: true})\n }\n })\n }", "title": "" }, { "docid": "6dde230b682e473283a7da3aa4a7d32a", "score": "0.64683586", "text": "function checkWinner(board) {\n for(let row = 0; row < totalRow; row++){\n if( (board[winArray[row][0]] !== null) &&\n (board[winArray[row][0]] === board[winArray[row][1]]) &&\n (board[winArray[row][1]] === board[winArray[row][2]])\n ) {\n if(turn === 1) {\n msg.textContent = `Winner ------> X`;\n }else if(turn === -1) {\n msg.textContent = `Winner ------> O`;\n }\n turn = null;\n return true; \n }\n }\n}", "title": "" }, { "docid": "da35d453e33b3387075591faf6a34d50", "score": "0.64666003", "text": "function tug_o_war(teams) {\n var firstTeam = teams[0].reduce(function (a,b){ return a+b});\n var secondTeam = teams[1].reduce(function (a,b){return a+b});\n \n if(firstTeam>secondTeam){\n return \"Team 1 wins!\";\n } else if(firstTeam === secondTeam && teams[0][0] > teams[1][4]){\n return \"Team 1 wins!\";\n }else if(firstTeam === secondTeam && teams[0][0] < teams[1][4]){\n return \"Team 2 wins!\";\n } else if(firstTeam === secondTeam){\n return \"It's a tie!\";\n } else {\n return \"Team 2 wins!\";\n }\n}", "title": "" }, { "docid": "5f56aa58069ae24105fa15f7ffd3aa7f", "score": "0.64612955", "text": "function determineGameWinner() {\n if (userRoundWins > computerRoundWins) {\n alert(`You're the champion! Congrats!!`);\n }else{\n alert(`I'm the winner! Me!!`);\n }\n}", "title": "" }, { "docid": "067fdfa3a49cb724b110c592fc707126", "score": "0.6457862", "text": "function tournamentWinner(competitions, results){\n let scoreHash = {};\n\n for (let i = 0; i < competitions.length; i++) {\n let round = competitions[i];\n let firstTeam = round[0];\n let secondTeam = round[1];\n\n if (!scoreHash[firstTeam]){\n scoreHash[firstTeam] = 0;\n }\n if (!scoreHash[secondTeam]){\n scoreHash[secondTeam] = 0;\n }\n if (results[i] === 1){\n scoreHash[firstTeam] += 3;\n } else {\n scoreHash[secondTeam] += 3;\n }\n }\n\n let teams = Object.keys(scoreHash);\n let scores = Object.values(scoreHash);\n let maxScore = 0;\n let maxIndex;\n\n for (let j = 0; j < scores.length; j++) {\n if (scores[j] > maxScore){\n maxScore = scores[j];\n maxIndex = j;\n }\n }\n return teams[maxIndex];\n}", "title": "" }, { "docid": "900d52089f30aef576e4e9d3c0f069f8", "score": "0.64574456", "text": "function findWinner(playersScoreArray, mode) {\n if (mode == 'normal') {\n return Math.max.apply(null, playersScoreArray);\n }\n return Math.min.apply(null, playersScoreArray);\n}", "title": "" }, { "docid": "1d8ab44ecb918e008a90602ad6b09bba", "score": "0.6457401", "text": "function computerWins(array) {\n var win = false;\n for (var i = 0; i < array.length; i++) {\n if (array[0] == \"O\" && array[1] == \"O\" && array[2] == \"O\") {\n win = true;\n } else if (array[3] == \"O\" && array[4] == \"O\" && array[5] == \"O\") {\n win = true;\n } else if (array[6] == \"O\" && array[7] == \"O\" && array[8] == \"O\") {\n win = true;\n } else if (array[0] == \"O\" && array[4] == \"O\" && array[8] == \"O\") {\n win = true;\n } else if (array[2] == \"O\" && array[4] == \"O\" && array[6] == \"O\") {\n win = true;\n } else if (array[0] == \"O\" && array[3] == \"O\" && array[6] == \"O\") {\n win = true;\n } else if (array[1] == \"O\" && array[4] == \"O\" && array[7] == \"O\") {\n win = true;\n } else if (array[2] == \"O\" && array[5] == \"O\" && array[8] == \"O\") {\n win = true;\n }\n }\n return win;\n}", "title": "" }, { "docid": "00e885289ee8858a0e15ee6488bd07f2", "score": "0.645611", "text": "function getWinner() {\n if (checkRows() != null) {\n return checkRows();\n } else if (checkColumns() != null) {\n return checkColumns();\n } else if (checkDiagonals() != null) {\n return checkDiagonals();\n } else if (isBoardFull()) {\n return \"tie\";\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "c04ba4a7a07844151258955207658cbf", "score": "0.6443549", "text": "function computeWinner(){\n let winner;\n\n if(YOU[\"score\"] <= 21){\n if(YOU[\"score\"] > DEALER[\"score\"] || DEALER[\"score\"] > 21){\n winner = YOU; \n blackJackGame['wins']++;\n }\n else if(YOU['score'] < DEALER['score']){\n blackJackGame['losses']++;\n winner = DEALER;\n }\n else if(YOU['score'] === DEALER['score']){\n blackJackGame['ties']++;\n winner = undefined;\n }\n }\n else if(YOU['score'] > 21 && DEALER['score']<=21){\n blackJackGame['losses']++;\n winner = DEALER;\n }\n\n else if(YOU['score'] > 21 && DEALER['score']>21){\n blackJackGame['ties']++;\n winner = undefined;\n } \n return winner;\n}", "title": "" }, { "docid": "0e204c180151a320e79b5c9e21d8f60c", "score": "0.64421064", "text": "function checkWinner(){\n var winner = false;\n var i,n;\n //iterate through winning combos\n for (i = 0; i < winningMoves.length; i++) {\n var winning = 0;\n for(var n = 0; n < winningMoves[i]; n++) {\n var cell = '#' + winningMoves[i].charAt(n);\n if ($(cell).hasClass('played') && $(cell).data('playedBy') == 'Machine') {\n winning = winning + 1;\n }\n if (winning == 3) {\n $('#message-cell').text('I won');\n //$('.control').attr('disabled', false); // FIXME: Game doesn't support replay yet\n //$('#set-board').text('Game Over').attr('disabled', false);\n\n winner = true;\n break;\n\n }\n }\n\n }\n\n\n\n return winner;\n}", "title": "" }, { "docid": "22f1f433895539df18e733244901c72d", "score": "0.6441366", "text": "__determineWinner() {\n // check columns\n for (let colIdx in this.board) {\n const colCounts = { player1: 0, player2: 0 };\n for (let rowIdx in this.board[colIdx]) {\n if (this.board[colIdx][rowIdx] == player1Token)\n colCounts.player1 += 1;\n if (this.board[colIdx][rowIdx] == player2Token)\n colCounts.player2 += 1;\n }\n if (colCounts.player1 >= 4)\n this.__endGame(this.player1Id);\n if (colCounts.player2 >= 4)\n this.__endGame(this.player2Id);\n }\n\n // check rows\n for (let rowIdx = 0; rowIdx < boardHeight; rowIdx++) {\n const rowCounts = { player1: 0, player2: 0 };\n for (let colIdx = 0; colIdx < boardWidth; colIdx++) {\n if (this.board[colIdx][rowIdx] == player1Token)\n rowCounts.player1 += 1;\n if (this.board[colIdx][rowIdx] == player2Token)\n rowCounts.player2 += 1;\n }\n if (rowCounts.player1 >= 4)\n this.__endGame(this.player1Id);\n if (rowCounts.player2 >= 4)\n this.__endGame(this.player2Id);\n }\n\n // check ascending diagonals\n\n // check descending diagonals\n\n return null;\n }", "title": "" }, { "docid": "f5bc164545515752712e5c1a15d14ce5", "score": "0.6429266", "text": "function decideWinner(human,computer){\n var combo={\n 'rock':{'rock':0.5, 'paper':0, 'scissor':1},\n 'paper':{'rock':1, 'paper':0.5, 'scissor':0},\n 'scissor':{'rock':0, 'paper':1, 'scissor':0.5}\n }\n humanscore =combo[human][computer];\n computerscore=combo[computer][human];\n\n return [humanscore,computerscore]; \n }", "title": "" }, { "docid": "a4a2e71e83507b7cae9ea1d749875abd", "score": "0.64273196", "text": "function gameOver(){\n return winner;\n }", "title": "" }, { "docid": "f4c9fbd460e8b55f0e83ebfe3e6e52e2", "score": "0.64237255", "text": "function check_winner() {\r\n char_arr = model.board.split('/');\r\n console.log(char_arr);\r\n //horizontal check\r\n if(check_horizonal()) {\r\n return true;\r\n }\r\n //vertical check\r\n if(check_vertical()) {\r\n return true;\r\n }\r\n //diagonal check\r\n if(check_diagonal()) {\r\n return true;\r\n }\r\n //checks for tie\r\n if(check_tied()) {\r\n isTied = true;\r\n }\r\n return false; //returns false otherwise\r\n}", "title": "" }, { "docid": "f578fc5aeaa318546e05795d2c00e63c", "score": "0.6421425", "text": "function checkWinner() {\n var boxCounter = 0\n for (var i = 0; i < game.boxes.length; i++) {\n if (game.boxes[i].length == 4 ) {\n boxCounter ++\n }\n if (game.boxes.length == boxCounter){\n if (game.player1.points > game.player2.points){\n alert('Player 1 Wins')\n } else if (game.player1.points < game.player2.points) {\n alert('Player 2 Wins')\n }\n else {\n alert('Tie Game')\n }\n }\n}\n}", "title": "" }, { "docid": "9b9ddf0785fb795e704a71c1b8d83fa6", "score": "0.6413677", "text": "function getWinner(playerMove,computerMove) {\n var winner;\n var p ='player';\n var c ='computer';\n var t ='tie';\n\n\n\n if(playerMove === 'rock'){\n if (computerMove === 'scissors') {\n console.log ('Player Wins!');\n winner = p;\n } else if (computerMove === 'paper') {\n console.log ('Computer Wins!');\n winner = c;\n } else if (computerMove==='rock'){\n console.log(\"It's a tie!\");\n winner = t;\n } else {\n return 'error';\n }\n} else if(playerMove === 'scissors'){\n // Player plays 'scissors'\n\n if (computerMove==='rock') {\n console.log ('Computer Wins!');\n winner = c;\n } else if (computerMove==='paper') {\n console.log ('Player Wins!');\n winner = p;\n } else if (computerMove==='scissors') {\n console.log (\"It's a tie!\");\n winner = t;\n } else {\n return 'error';\n }\n} else if( playerMove === 'paper'){\n\n /// Player plays 'paper' \n\n if (computerMove==='rock'){\n console.log ('Player Wins!');\n winner = p;\n } else if (computerMove==='scissors'){\n console.log ('Computer Wins!');\n winner = c;\n } else if (computerMove==='paper'){\n console.log (\"It's a tie!\") ;\n winner = t;\n } else {\n return 'error';\n }\n}\n\nreturn winner\n\n}", "title": "" }, { "docid": "3dd91e6140ce2dd546e054b3caa5b807", "score": "0.6409888", "text": "function canWin() {\n winArray = [];\n playerArray = [];\n for (obj of currentBoard.boxesInside) {\n if (obj.oClick === true) {\n playerArray.push(obj.value);\n }\n }\n for (arr of winningArrays) {\n trueCount = 0;\n for (let i = 0; i < playerArray.length; i++) {\n if (arr.includes(playerArray[i])) {\n trueCount = trueCount + 1;\n }\n if (trueCount === 2) {\n winArray.push(arr);\n }\n }\n }\n if (winArray.length > 0) {\n for (arr of winArray) {\n for (item of arr) {\n if (boxLookUp[`${currentBoard.tag}${item.toString()}`].clicked === false) {\n return item;\n }\n }\n }\n } else {\n return false;\n }\n return false;\n}", "title": "" }, { "docid": "1c69e5317fe0858a46e9c0541f93445b", "score": "0.6407725", "text": "function checkWinner () {\n\t\tvar racetrack = $('.racetrack').width() - 2 * Number($('.racetrack').css('padding').slice(0,-2));\n\t\tvar avatarwidth = $('#player2avatar').width();\n\t\tvar winningCondition = racetrack - avatarwidth;\n\t\tvar avatar1traveled = Number($('#player1avatar').css('left').slice(0, -2));\n\t\tvar avatar2traveled = Number($('#player2avatar').css('left').slice(0, -2));\n\n\t\t// If one player wins, updates the wins and losses columns\n\t\tvar count;\n\t\tif (avatar1traveled >= winningCondition) {\n\t\t\twinner = player1name;\n\t\t\tcount = Number($('#player1wins').text())+1;\n\t\t\t$('#player1wins').text(count);\n\t\t\tcount = Number($('#player2losses').text())+1;\n\t\t\t$('#player2losses').text(count);\n\t\t} else if (avatar2traveled >= winningCondition) {\n\t\t\twinner = player2name;\n\t\t\tcount = Number($('#player2wins').text())+1;\n\t\t\t$('#player2wins').text(count);\n\t\t\tcount = Number($('#player1losses').text())+1;\n\t\t\t$('#player1losses').text(count);\n\t\t} else {\n\t\t\twinner = false;\n\t\t}\n\t\tif (winner) {\n\t\t\t// animation\n\t\t\t$questions.hide();\n\t\t\t$gameresults.show();\n\t\t\t$('#winner').text(winner);\n\t\t\t$choosegame.click(function(event) {\n\t\t\t\t$gameresults.hide();\n\t\t\t\t$gamesetup.show();\n\t\t\t\t$('#player1avatar').css('left', '0px');\n\t\t\t\t$('#player2avatar').css('left', '0px');\n\t\t\t});\n\t\t} else {\n\t\t\tplayGame();\n\t\t}\n\t}", "title": "" }, { "docid": "e98e5de3b265896efdc4b6a9f175ad94", "score": "0.6406267", "text": "checkWinner(squares, player){\n let winningPlayer = player + player + player\n\n for (var i = 0; i< this.winningCombinations.length; i++) {\n var win = this.winningCombinations[i]\n if (squares[win[0]] + squares[win[1]] + squares[win[2]] === winningPlayer) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "4cd962a7fc8ae691e403772f4594f4b0", "score": "0.640238", "text": "function winnerCheck(){\n var result=\"no winner\";\n if (player1[2]<1 && player2[2]<1)\n {\n result = \"You Both Die\";\n } else if(player1[2]<1){\n result =player2[0]+\" WINS!!!\"\n } else if (player2[2]<1)\n {\n result = player1[0]+\" WINS!!!\"\n };\n return result;\n }", "title": "" }, { "docid": "04d553674ca13aa59f2989e1ec2490dd", "score": "0.64009327", "text": "determineWinner(player1, player2) {\n const WIN_VALUE = 1;\n\n if (player1.move === player2['move']) round.winner = 'tie';\n else if (rules.winConditions[player1.move].includes(player2['move'])) {\n round.winner = player1.name;\n player1.wins += WIN_VALUE;\n } else {\n round.winner = player2.name;\n player2.wins += WIN_VALUE;\n }\n }", "title": "" }, { "docid": "ec5d84f28d3054fd3180ba11e5da27c9", "score": "0.63959736", "text": "function checkWinner() {\n let boardContentArray = checkBoardContent();\n const winningCondition = [[0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6]];\n \n winningCondition.forEach((item, index) => {\n //check winning condition\n if (countBoardItem<9) {\n if(\n boardContentArray[item[0]] === playerTurn.mark && \n boardContentArray[item[1]] === playerTurn.mark &&\n boardContentArray[item[2]] === playerTurn.mark \n ){\n document.getElementById('player-turn').innerText = \"Congratulation \" + `${playerTurn.name}` + \", you won!\";\n item.forEach((gridTransformIndex) =>{\n var gridItems = document.getElementById('board-game').childNodes;\n for(var i = 0; i < gridItems.length; i++) {\n gridItems[gridTransformIndex].setAttribute('class', `${playerTurn.mark}` + ' playing');\n }\n });\n winnerBolean = true;\n }\n //check for tie\n } else {\n if(\n boardContentArray[item[0]] === playerTurn.mark && \n boardContentArray[item[1]] === playerTurn.mark &&\n boardContentArray[item[2]] === playerTurn.mark \n ){\n document.getElementById('player-turn').innerText = \"Congratulation \" + `${playerTurn.name}` + \", you won!\";\n item.forEach((gridTransformIndex) =>{\n var gridItems = document.getElementById('board-game').childNodes;\n for(var i = 0; i < gridItems.length; i++) {\n gridItems[gridTransformIndex].setAttribute('class', `${playerTurn.mark}` + ' playing');\n }\n });\n winnerBolean = true;\n } else {\n document.getElementById('player-turn').innerText = \"It's tie!\";\n }\n }\n });\n }", "title": "" }, { "docid": "24383280e8176918422c89c3762b7d28", "score": "0.6393699", "text": "function compareChoices(choice1, choice2) {\n if (choice1 === \"Lapis\") {\n if (choice2 === \"Lapis\") {\n alert(\"You chose Lapis, computer chose Lapis. It's a tie!\");\n numOfTies++;\n addResult(++numOfGames, choice1, choice2, winners[0]);\n } else if (choice2 === \"Papyrus\") {\n alert(\"You chose Lapis, computer chose Papyrus. Computer wins!\");\n addResult(++numOfGames, choice1, choice2, winners[2]);\n } else {\n alert(\"You chose Lapis, computer chose Scalpellus. You win!\");\n numOfWins++;\n addResult(++numOfGames, choice1, choice2, winners[1]);\n }\n } else if (choice1 === \"Papyrus\") {\n if (choice2 === \"Lapis\") {\n alert(\"You chose Papyrus, computer chose Lapis. You win!\");\n addResult(++numOfGames, choice1, choice2, winners[1]);\n numOfWins++;\n } else if (choice2 === \"Papyrus\") {\n alert(\"You chose Papyrus, computer chose Papyrus. It's a tie!\");\n numOfTies++;\n addResult(++numOfGames, choice1, choice2, winners[0]);\n } else {\n alert(\"You chose Papyrus, computer chose Scalpellus. Computer wins!\");\n addResult(++numOfGames, choice1, choice2, winners[2]);\n }\n } else {\n if (choice2 === \"Lapis\") {\n alert(\"You chose Scalpellus, computer chose Lapis. Computer wins!\");\n addResult(++numOfGames, choice1, choice2, winners[2]);\n } else if (choice2 === \"Papyrus\") {\n alert(\"You chose Scalpellus, computer chose Papyrus. You win!\");\n numOfWins++;\n addResult(++numOfGames, choice1, choice2, winners[1]);\n } else {\n alert(\"You chose Scalpellus, computer chose Scalpellus. It's a tie!\");\n numOfTies++;\n addResult(++numOfGames, choice1, choice2, winners[0]);\n }\n }\n}", "title": "" }, { "docid": "3d6a6fb2b0ac5e178e25c70a6816fd6a", "score": "0.639362", "text": "function checkWin(board2, player){\n let play = board2.reduce((a,e,i) =>\n (e === player) ? a.concat(i) : a, []);\n let gameWin = null;\n for(let [index, win] of winIndex.entries()){\n if(win.every(elem => play.indexOf(elem) > -1)){\n gameWin = {index: index, player: player};\n break;\n }\n }\n return gameWin;\n}", "title": "" }, { "docid": "8f181d2d948dc493f055b1156a4a1111", "score": "0.6384107", "text": "function getWinners(callback) { // higher-order function\n let finalsData = callback(fifaData); // assign array to callback\n let winners = [];\n finalsData.forEach(function(item){\n if(item[ \"Home Team Goals\" ] > item[ \"Away Team Goals\" ]) {\n winners.push(item[ \"Home Team Name\" ]);\n } else {\n winners.push(item[ \"Away Team Name\" ]);\n }\n });\n\n return winners;\n}", "title": "" }, { "docid": "caccd8a09feaba321ceb567144fa46dc", "score": "0.6379416", "text": "function andTheWinnerIs(){\n premi = winner.dreta + winner.tu + winner.esquerra + winner.dalt;\n if(_triomf == 'butifarra'){\n premi = (premi * 2 ) + 1;\n }\n if(winner.tu > winner.dreta && winner.tu > winner.esquerra && winner.tu > winner.dalt){\n flagMeWinner = true;\n teamOne += premi;\n teamOne += 1;\n }else if(winner.dreta > winner.tu && winner.dreta > winner.esquerra && winner.dreta > winner.dalt){\n sortidaDeCartaGuanyadora(user3, \"dreta\")\n teamTwo += premi;\n teamTwo += 1;\n }else if(winner.esquerra > winner.tu && winner.esquerra > winner.dreta && winner.esquerra > winner.dalt){\n sortidaDeCartaGuanyadora(user2, \"esquerra\")\n teamTwo += premi;\n teamTwo += 1;\n }else{\n sortidaDeCartaGuanyadora(user4, \"dalt\")\n teamOne += premi;\n teamOne += 1;\n }\n winner = {};\n setTimeout(function(){\n cleanTapete();\n penalitzacio.innerHTML = \"\"\n }, 3000)\n puntuacioTeamA.innerHTML ===''? puntuacioTeamA.innerHTML = \"Puntuacio equip A \" +teamOne: puntuacioTeamA.innerHTML = '', puntuacioTeamA.innerHTML= \"Puntuacio equip A \" +teamOne;\n puntuacioTeamB.innerHTML ===''? puntuacioTeamB.innerHTML = \"Puntuacio equip B \" +teamTwo: puntuacioTeamB.innerHTML = '', puntuacioTeamB.innerHTML= \"Puntuacio equip B \" +teamTwo;\n }", "title": "" }, { "docid": "bf07504bf7bf1bef2a0d64f33a8a7372", "score": "0.63761", "text": "function checkWinner() {\n let winner = null\n let nobody_counter = 0\n for (i = 0; i < 3; i++) {\n // check rows\n if (board[i][0] === board[i][1] && board[i][1] === board[i][2]) {\n winner = board[i][0]\n if (winner !== null) {\n break\n }\n }\n // check columns\n else if (board[0][i] === board[1][i] && board[1][i] === board[2][i]) {\n winner = board[0][i]\n if (winner !== null) {\n break\n }\n }\n // check full board\n for (j = 0; j < 3; j++) {\n if (board[i][j] !== null) {\n nobody_counter += 1\n }\n }\n }\n if (nobody_counter === 9) {\n winner = \"nobody\"\n }\n //check diagonal\n if (board[0][0] === board[1][1] && board[1][1] === board[2][2]) {\n winner = board[0][0]\n }\n if (board[2][0] === board[1][1] && board[1][1] === board[0][2]) {\n winner = board[2][0]\n }\n //console.log(\"checkWinner was called\");\n\n if (winner === \"nought\") {\n winner = \"noughts\"\n } else if (winner === \"cross\") {\n winner = \"crosses\"\n }\n return winner;\n}", "title": "" }, { "docid": "f1d7cc2483c05c4ed66c12a51613eec3", "score": "0.6369611", "text": "function checkWinner(arr) {\n if (isTheSame(arr[0], arr[1], arr[2]))\n win(arr[0], arr[1], arr[2], \"horizontally\");\n else if (isTheSame(arr[3], arr[4], arr[5]))\n win(arr[3], arr[4], arr[5], \"horizontally\");\n else if (isTheSame(arr[6], arr[7], arr[8]))\n win(arr[6], arr[7], arr[8], \"horizontally\");\n else if (isTheSame(arr[0], arr[3], arr[6]))\n win(arr[0], arr[3], arr[6], \"vertically\");\n else if (isTheSame(arr[1], arr[4], arr[7]))\n win(arr[1], arr[4], arr[7], \"vertically\");\n else if (isTheSame(arr[2], arr[5], arr[8]))\n win(arr[2], arr[5], arr[8], \"vertically\");\n else if (isTheSame(arr[0], arr[4], arr[8]))\n win(arr[0], arr[4], arr[8], \"diagonally\");\n else if (isTheSame(arr[2], arr[4], arr[6]))\n win(arr[2], arr[4], arr[6], \"diagonally\");\n}", "title": "" } ]
70b4c4b70d87e59844902e9c0e3dac67
DrawPlayerCar() Helper function for drawing the player's vehicle. Since no line is assigned to the Player vehicle, DrawRoadObject will not function properly for the player's car.
[ { "docid": "4cd0e8a27aa4bd15084b895c7b086c91", "score": "0.65594625", "text": "function drawPlayerCar() {\n CTX.drawImage(playerCarImage, PlayerCar.topLeft.x, PlayerCar.topLeft.y);\n}", "title": "" } ]
[ { "docid": "458c87eaf3faa51162b9325888e6f24d", "score": "0.63433176", "text": "function drawPlayer(player){\n\t\tplayer.imageSrc = '../imgs/player-markers/ShipPlayer' + player.order + '.png';\n\t\tplayer.sideText = null;\n\t\tdrawObject(player, false);\n\t}", "title": "" }, { "docid": "6bd0d1e6d7bf523efc64fe42fd1c4e4c", "score": "0.6289609", "text": "function drawRoadObject(roadObject) {\n if(roadObject.lineNumber < 2) {\n CTX.fillStyle = roadObject.color;\n CTX.strokeStyle = roadObject.color;\n\n CTX.beginPath();\n CTX.moveTo(roadObject.topLeft.x, roadObject.topLeft.y);\n CTX.lineTo(roadObject.topRight.x, roadObject.topRight.y);\n CTX.lineTo(roadObject.bottomRight.x, roadObject.bottomRight.y);\n CTX.lineTo(roadObject.bottomLeft.x, roadObject.bottomLeft.y);\n CTX.closePath();\n\n CTX.stroke();\n CTX.fill();\n }\n else {\n if(roadObject.topLeft.y > HORIZON_Y) {\n CTX.drawImage(carImage, roadObject.topLeft.x, roadObject.topLeft.y - CAR_HEIGHT_OFFSET);\n }\n }\n}", "title": "" }, { "docid": "b40b35c1008c9f9d98f9d6cfbcb5c741", "score": "0.6245464", "text": "draw(){\n // If it's dead, don't render it.\n if(!this.isAlive) return\n\n // Check if car is in a wall, because we kill it, if it is!\n this.collisionDetection();\n this.sim.canvas.fill(0);\n\n // Drawing actual car at X and Y positions\n this.drawCar();\n\n if (!__SIMULATOR.paused){\n // Calculate distances from the walls!\n this.calculateDistances();\n this.findCurrentSector();\n\n // Controlling one vehicle with the keys!\n\n if (this.sim.trainingMode){\n if (this.sim.canvas.frameCount % 15) this.ai.predictDrive()\n } else {\n this.checkControls();\n }\n\n // Updating pixelPositions and values.\n this.updatePhysics();\n }\n\n this.updateAverageSteerChanges()\n\n }", "title": "" }, { "docid": "607b49f9122e25a754cfd20fb90a058e", "score": "0.5746265", "text": "function drawPlayer() {\n player.draw();\n}", "title": "" }, { "docid": "6d6ce1b173460494dfc15dd8ad655393", "score": "0.5666383", "text": "function drawCar(car) {\n var canvas = document.getElementById('road');\n var ctx = canvas.getContext('2d');\n var img = new Image();\n imgScale = 1 / 2;\n img.onload = function() {\n ctx.drawImage(img, car.x, car.y, 100 * imgScale, 100);\n };\n img.src = './images/car.png';\n }", "title": "" }, { "docid": "c3b17d661d64e80b57bf52894c27721a", "score": "0.56263113", "text": "function draw() {\n background(backgroundColor);\n\n\n ped1X -= 1;\n ped2X -= 2;\n ped3X -= 3;\n\n const car = drawCar(carImage, carX, carY, scale);\n\n if (ped1X > 0) {\n car.addTarget().bearing(ped1X,ped1Y);\n } else {\n ped1X = pedXStart;\n ped2X = pedXStart;\n ped3X = pedXStart;\n }\n if (ped2X > 0) {\n car.addTarget().bearing(ped2X,ped2Y);\n }\n if (ped3X > 0) {\n car.addTarget().bearing(ped3X,ped3Y);\n }\n car.drawLights();\n\n drawPedestrian(ped1X, ped1Y, \"#FF0000\");\n drawPedestrian(ped2X, ped2Y, \"#FF8800\");\n drawPedestrian(ped3X, ped3Y, \"#FF00FF\");\n}", "title": "" }, { "docid": "4ae915a595ae8e23f5303b2f88f7b40a", "score": "0.5617392", "text": "function DrawPlayer() {\n CTX.rect(PLAYER.paddleLeft, canvasHeight-PLAYER.paddleHeight, PLAYER.paddleWidth, PLAYER.paddleHeight);\n CTX.strokeStyle = '#000000';\n CTX.fillStyle = '#000000';\n CTX.fill(); \n CTX.stroke();\n }", "title": "" }, { "docid": "96d7fd2f298a29210e97bb9fb99c8a74", "score": "0.560201", "text": "function draw(){\n // Reset translation every frame\n context.setTransform(1, 0, 0, 1, 0, 0);\n // clear screen so that the old stuff is removed from the last frame\n context.clearRect(0, 0, canvas.width, canvas.height);\n\n // Clamp the camera to the player\n let camX = -player.locX + (canvas.width / 2);\n let camY = -player.locY + (canvas.height / 2);\n context.translate(camX, camY);\n\n // Populate players\n players.forEach(p => {\n context.beginPath();\n context.fillStyle = p.color;\n // Draw circle\n context.arc(p.locX, p.locY, p.radius, 0, Math.PI * 2);\n context.fill();\n // Add border\n context.lineWidth = 3;\n context.strokeStyle = 'rgb(0, 255, 0)';\n context.stroke();\n });\n\n // Populate orbs\n orbs.forEach(({color, locX, locY, radius}) => {\n context.beginPath();\n context.fillStyle = color;\n context.arc(locX, locY, radius, 0, Math.PI * 2);\n context.fill();\n });\n\n requestAnimationFrame(draw);\n}", "title": "" }, { "docid": "0252eae1a5b1471d7e31c8a993cd287b", "score": "0.5572527", "text": "function drawCar() {\n // DONT NEED IT /////////////\n ctx.drawImage(carImage, car.x, car.y, car.carWidth, car.carHeight);\n}", "title": "" }, { "docid": "afd8a7b3739fced56fbc2b1455bb29fb", "score": "0.5457334", "text": "draw() {\n\t\tlet context = this.graphicsContext;\n\n\t\t// Camera movement code -- keep user's player centered on screen\n\t\tcontext.save();\n\t\tcontext.resetTransform();\n\t\tcontext.translate(\n\t\t\tthis.canvas.width / 2 - this.player.x,\n\t\t\tthis.canvas.height / 2 - this.player.y\n\t\t);\n\t\t// this.canvas.style.width = this.canvas.clientWidth;\n\t\t// this.canvas.style.height = this.canvas.clientHeight;\n\n\t\tcontext.clearRect(\n\t\t\t-1000,\n\t\t\t-1000,\n\t\t\tthis.stageWidth * 4,\n\t\t\tthis.stageHeight * 4\n\t\t); // Note that this must match with the size of the world border\n\t\tcontext.globalCompositionOperation = \"destination-over\";\n\n\t\t// Generates the \"world border\" (a blue rectangle behind the green rectangle)\n\t\tcontext.fillStyle = \"rgb(30,144,255)\";\n\t\tcontext.fillRect(\n\t\t\t-1000,\n\t\t\t-1000,\n\t\t\tthis.stageWidth * 4,\n\t\t\tthis.stageHeight * 4\n\t\t);\n\n\t\t// Generate the playing field for the world (a green rectangle), along with gridlines\n\t\tcontext.fillStyle = \"rgba(34,139,34,1)\";\n\t\tcontext.fillRect(0, 0, this.stageWidth, this.stageHeight);\n\t\tcontext.lineWidth = 1;\n\t\tthis.drawGridlines(context, this.stageWidth, this.stageHeight);\n\n\t\t// Draw all actors on the canvas\n\t\tfor (let i = 0; i < this.playerActors.length; i++) {\n\t\t\t// TODO: Test this feature to see if its feasible in multiplayer\n\t\t\t// if (this.playerActors[i].isHidden && this.playerActors[i].playerID !== this.playerID) {\n\t\t\t// \tcontinue;\n\t\t\t// }\n\t\t\tthis.drawPlayer(context, this.playerActors[i]);\n\t\t}\n\t\tfor (let i = 0; i < this.bulletActors.length; i++) {\n\t\t\tthis.drawBullet(context, this.bulletActors[i]);\n\t\t}\n\t\tfor (let i = 0; i < this.crateActors.length; i++) {\n\t\t\tthis.drawCrate(context, this.crateActors[i]);\n\t\t}\n\t\tfor (let i = 0; i < this.environmentActors.length; i++) {\n\t\t\tthis.drawEnvironmentObject(context, this.environmentActors[i]);\n\t\t}\n\n\t\t// Draw the game GUI (health bar, ammo, etc.)\n\t\tthis.displayGUI && this.drawToggleableGUI(context);\n\t\tthis.drawUntoggleableGUI(context);\n\n\t\tcontext.restore();\n\t}", "title": "" }, { "docid": "6863c99b3d04f16e93284614ed34cb7f", "score": "0.54456604", "text": "function drawPlayScreen() {\n\n background(56, 56, 56);\n\n if (frameCount % 15 === 0) {\n raceTrack.push(new raceTracks());\n }\n\n for (var i = raceTrack.length - 1; i >= 0; i--) {\n raceTrack[i].show();\n raceTrack[i].update();\n\n if (raceTrack[i].offscreen()) {\n raceTrack.splice(i, 1);\n }\n }\n\n if (frameCount % 100 === 0) {\n opposition.push(new Opposition());\n }\n\n // Opposition Show Up\n for (var i = opposition.length - 1; i >= 0; i--) {\n //console.log(opposition[i].flag);\n opposition[i].show();\n opposition[i].update();\n\n if (opposition[i].overtakenBy(driver) && opposition[i].isOvertakenBy === false) {\n if (opposition[i].flag == 1) {\n carsOvertaken += 1;\n opposition[i].isOvertakenBy = true;\n }\n }\n // Opposition collide with driver, get destroyed\n if (opposition[i].hits(driver)) {\n opposition[i].boom();\n opposition.splice(i, 1);\n\n // Collision Repair Life Lost\n carsOvertaken = (carsOvertaken >= 0) ? (carsOvertaken - 3) : 0;\n carRepairLives--;\n } else if (opposition[i].offscreen()) {\n opposition.splice(i, 1);\n }\n }\n\n console.log(carRepairLives);\n // Driver Shown\n driver.show();\n\n // Mouse Controls\n if (keyIsDown(LEFT_ARROW)) {\n driver.turnLeft();\n }\n if (keyIsDown(RIGHT_ARROW)) {\n driver.turnRight();\n }\n if (keyIsDown(UP_ARROW)) {\n driver.turnLeft();\n }\n if (keyIsDown(DOWN_ARROW)) {\n driver.turnRight();\n }\n\n\n\n // Driver Stats\n textSize(40);\n textFont(font);\n textAlign(LEFT);\n fill(255);\n text('Cars Overtaken In Race: ' + carsOvertaken, 30, 60);\n\n for (var i = 0; i < carRepairLives; i++) {\n image(carRepaired, 30 + (i * 70), height - 60);\n }\n\n textSize(40);\n textFont(font);\n textStyle(BOLD);\n textAlign(LEFT);\n fill(255);\n text('Repair Lives:', 30, 725);\n\n // Game Over\n if (carRepairLives === 0) {\n noLoop();\n\n textSize(60);\n textFont(font);\n textStyle(BOLD);\n textAlign(CENTER);\n fill(255);\n text('YOU CRASHED! GAME OVER.', width / 2, height / 2);\n aTag.show();\n // Line Shape\n stroke(255);\n line(320, 420, 900, 420);\n\n //Ellipse Shape\n fill(0);\n ellipse(270, 390, 55, 55);\n\n fill(0);\n ellipse(950, 390, 55, 55);\n }\n}", "title": "" }, { "docid": "2af9f067e07765bf5555b15d3b5337a4", "score": "0.5427849", "text": "draw() {\n this.player.draw();\n this.treasure.draw();\n //Canvas vertical lines\n for (var x = 0; x <= WIDTH; x += SQUARE_SIDE) {\n line(x, 0, x, HEIGHT);\n }\n //Canvas horizontal lines\n for (var y = 0; y <= HEIGHT; y += SQUARE_SIDE) {\n line(0, y, WIDTH, y);\n }\n }", "title": "" }, { "docid": "15765eccbf57cd5fbf61b250041a58ba", "score": "0.5418961", "text": "function drawCar(x , y, color1, color2, color3){\r\n\tfill(color1, color2, color3);\r\n\trect(x, y, 95, 30);\r\n\tstrokeWeight(0.2);\r\n\tstroke(0);\r\n\tfill(0);\r\n\tellipse(x+22,y+30, 20, 20);\r\n\tellipse(x+63, y+30, 20, 20);\r\n\tstroke(0);\r\n\tfill(255);\r\n\tquad(x+30,y-25,x+60,y-25, x+80, y+1, x+8, y+1);\r\n}", "title": "" }, { "docid": "30e121c8764fe8fbd5658ad2ff65c3d7", "score": "0.5399458", "text": "function drawMyCar(pos)\n {\n var x = getPosXfrom(pos);\n ctx.beginPath();\n ctx.fillStyle = \"red\";\n ctx.fillRect(x,MYCAR_Y,CAR_WIDTH,CAR_HEIGHT); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(x,MYCAR_Y+30,10,30); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(x+40,MYCAR_Y+30,10,30); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(x,MYCAR_Y+70,10,30); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(x+40,MYCAR_Y+70,10,30); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"yellow\";\n ctx.fillRect(x,MYCAR_Y,15,5); \n ctx.stroke();\n \n ctx.beginPath();\n ctx.fillStyle = \"yellow\";\n ctx.fillRect(x+35,MYCAR_Y,15,5); \n ctx.stroke();\n }", "title": "" }, { "docid": "e3d3e91fe33760cd8f4b1a3a708dc4e9", "score": "0.53881544", "text": "function movePlayerCar() {\n var multMod = 0;\n \n if(KEY_LIST[KEY.A]) {\n //Have this part set player car drawing to left facing car image\n if(PlayerCar.topLeft.x > MAX_PLAYER_LEFT) {\n multMod = -1;\n }\n }\n \n if(KEY_LIST[KEY.D]) {\n //Have this part set player car drawing to right facing car image\n if(PlayerCar.topLeft.x < MAX_PLAYER_RIGHT) {\n multMod = 1;\n }\n }\n \n if(multMod != 0) {\n var toAdd = PLAYER_SPEED * multMod;\n PlayerCar.topLeft.x += toAdd;\n PlayerCar.topRight.x += toAdd;\n PlayerCar.bottomRight.x += toAdd;\n PlayerCar.bottomLeft.x += toAdd; \n }\n}", "title": "" }, { "docid": "d76720db6674f75f21727874fcb5c943", "score": "0.5353112", "text": "function WinnerLine(_x, _y, _width, _height){\n //inner properties\n this.width = _width;\n this.height= _height;\n this.x = _x;\n this.y = _y;\n this.speed = 4;\n\n\n var xIncrease = 1;\n var yIncrease = 0;\n\n //move method\n this.move = function(){\n this.x += -xIncrease*this.speed;\n\n//------------------------------------------------------------------------------------------------\n\n //winner line stops when it touches the good car\n if((this.x < 280) && (this.x > 100))\n {\n xIncrease = xIncrease * 0;\n this.speed == 0.0;\n }\n\n//------------------------------------------------------------------------------------------------\n\n //win\n if((this.x < 280) && (this.x > 100))\n {\n //background\n fill('gold');\n rect(0,0, windowWidth,windowHeight);\n\n //text\n noStroke();\n fill('brown');\n textAlign(CENTER,CENTER);\n textSize(30);\n text('Refresh to play again', width/2, height/2 + 30);\n textSize(90);\n text('CONGRATS, YOU WIN!', width/2, height/2 - 30);\n gameover()=true;\n }\n }\n\n//------------------------------------------------------------------------------------------------\n\n//display method\n this.display = function() {\n angleMode(DEGREES);\n\n //create the line\n fill('white');\n rect(this.x, this.y, this.width,this.height);\n\n }\n}", "title": "" }, { "docid": "61ce34f120d32c21825077b3cd4d6891", "score": "0.5324215", "text": "function drawPlayer(player) {\n context.drawImage(player.image, player.x, player.y, player.size, player.size);\n}", "title": "" }, { "docid": "f3295f0d1bb295d417abaa315022487b", "score": "0.52987117", "text": "play() {\r\n\r\n formObj.hide();\r\n textSize(30);\r\n text(\"Game Start\", displayWidth / 2, 0);\r\n\r\n image(trackImg, 0, -displayHeight * 4, displayWidth, displayHeight * 5);\r\n\r\n /*\r\n static function call to retrieve existing player records: name and distance \r\n value for all registered players according to the index in the database \r\n */\r\n Player.getPlayerInfo();\r\n /* Function call to retrieve existing value of CarsAtEnd from the database. */\r\n playerObj.getCarsAtEnd();\r\n\r\n\r\n if (allPlayers !== undefined) {\r\n background(rgb(198, 135, 100));\r\n image(trackImg, 0, -displayHeight * 4, displayWidth, displayHeight * 5);\r\n //index of the array\r\n var index = 0;\r\n\r\n //x and y position of the cars\r\n var x = 275;\r\n var y;\r\n\r\n\r\n //for every player object inside allPlayers\r\n for (var plr in allPlayers) {\r\n\r\n //add 1 to the index for every loop\r\n index = index + 1;\r\n\r\n //position the cars a little away from each other in x direction\r\n x = x + 200;\r\n\r\n //use data from the database to display the cars in y direction\r\n y = displayHeight - allPlayers[plr].distance;\r\n\r\n cars[index - 1].x = x;\r\n cars[index - 1].y = y;\r\n\r\n if (index == playerObj.index) {\r\n cars[index - 1].shapeColor = \"red\";\r\n //add to camera position to move with respective player\r\n camera.position.x = displayWidth / 2;\r\n camera.position.y = cars[index - 1].y;\r\n\r\n //create an indicator to indentify respective player\r\n fill(\"lightgreen\");\r\n ellipse(cars[index - 1].x, cars[index - 1].y - 100, 40, 40);\r\n\r\n }\r\n else {\r\n cars[index - 1].shapeColor = \"black\";\r\n\r\n }\r\n\r\n }\r\n }\r\n if (keyIsDown(UP_ARROW) && playerObj.index !== null && playerObj.distance < 4300) {\r\n playerObj.distance += 50;\r\n /*\r\n function call to change existing value in the data base of distance and name to a \r\n new one based on the value of captured \r\n */\r\n playerObj.updatePlayerRecord();\r\n }\r\n if (playerObj.distance == 4000) {\r\n playerObj.rank += 1;\r\n Player.updateCarsAtEnd(playerObj.rank);\r\n playerObj.updatePlayerRecord();\r\n \r\n }\r\n drawSprites();\r\n }", "title": "" }, { "docid": "4a715f02fc2c1ed7fb69f16f7f76cc30", "score": "0.52908844", "text": "addOtherCar(self, playerInfo) {\r\n if (playerInfo.active){\r\n console.log(\"add other CAr\");\r\n console.log(playerInfo);\r\n\r\n const othercar = self.add.image(playerInfo.x, playerInfo.y, playerInfo.texture).setOrigin(0, 0);\r\n \r\n othercar.playerId = playerInfo.playerId;\r\n self.otherCars.add(othercar);\r\n }\r\n }", "title": "" }, { "docid": "6667d27b317384226d53fb1f7308ab2a", "score": "0.52509815", "text": "function Car() {\n // properties\n this.pos = createVector(windowWidth/2, windowHeight/2);\n this.vel = createVector(random(-3, 3), random(-3, 3));\n this.c = color(random(255), random(255), random(255), random(100));\n\n\n // methods\n this.move = function() {\n this.pos.add(this.vel);\n\n if (this.pos.x > width - 100) this.pos.x = 0;\n if (this.pos.x < -100) this.pos.x = width - 100;\n if (this.pos.y > height + 300) this.pos.y = 0;\n if (this.pos.y < 0) this.pos.y = height + 300;\n }\n\n this.display = function() {\n fill(this.c);\n\n push();\n translate(this.pos.x - 80, this.pos.y - 75);\n scale(.20);\n loaf();\n pop();\n\n //ellipse(this.pos.x, this.pos.y, 50, 50);\n }\n\n}", "title": "" }, { "docid": "ead9b702fdcc9e5814f43fa4aadf9fba", "score": "0.52343273", "text": "function animate () {\r\n requestAnimationFrame(animate);\r\n if (start) {\r\n //camera lock centers the camera on the car\r\n if (tiles.cameraLock) {\r\n let diffX = (tiles.width / (2 * tiles.cameraScale)) - (player.currentX - tiles.cameraX / tiles.cameraScale);\r\n let diffY = (tiles.height / (2 * tiles.cameraScale)) - (player.currentY - tiles.cameraY / tiles.cameraScale);\r\n tiles.translate(diffX, diffY);\r\n tiles.cameraX -= diffX * tiles.cameraScale;\r\n tiles.cameraY -= diffY * tiles.cameraScale;\r\n }\r\n //reset clears the canvas before each animation\r\n reset(tiles.cameraX, tiles.cameraY, tiles.cameraScale);\r\n drawBackground();\r\n drawMap();\r\n roadWorks()\r\n speedCheck();\r\n // lake(1200,800);\r\n drawLights(counter, map, override);\r\n counter++;\r\n if (counter === limit) counter = 0;\r\n\r\n\r\n /////////collision zone visualiser\r\n if (collisionVis) {\r\n collisionZone()\r\n }\r\n\r\n\r\n\r\n // /////////traffic visualiser\r\n\r\n const arrayOfVertices = Object.keys(map.graphObj);\r\n for (let index = 0; index < arrayOfVertices.length; index++) {\r\n\r\n const vertex = map.graphObj[arrayOfVertices[index]]\r\n vertex.occupiedCheck();\r\n if (trafficVis) {\r\n drawTraffic(vertex.x, vertex.y, vertex.getAverageTime())\r\n }\r\n }\r\n\r\n\r\n player.run();\r\n //draw the data for path comparisons.\r\n if (player.compare && compareClickCount === 2) {\r\n $('#distance-info').html(`Distance: ${player.comparePaths.distance.distance}<br> Time: ${Math.round((player.comparePaths.distance.time) / 60)} s`)\r\n $('#time-info').html(`Distance: ${player.comparePaths.time.distance}<br> Time: ${Math.round((player.comparePaths.time.time) / 60)} s`)\r\n }\r\n\r\n //perform computer car calcualtions and rendering\r\n for (let i = 0; i < numberOfComputers; i++) {\r\n computerArray[i].run()\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "555dc1967aab2f77fc28bed68ea10ebf", "score": "0.5218278", "text": "function _drawPlayer(context, player) {\n // context.fillStyle = \"blue\";\n // context.fillRect(player.x, player.y, player.width, player.height);\n var img = document.getElementById(\"player-img\");\n context.drawImage(img, player.x, player.y, player.width, player.height);\n }", "title": "" }, { "docid": "4b7a5d4e65c2d171d7b9ebbf3767f381", "score": "0.5212622", "text": "function draw() {\n\t// Wipe the canvas clean\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tif (localPlayer.getIsCatcher())\n\t{\n\t\t// Draw the local player\n\t\tlocalPlayer.drawCatcher(ctx);\n\t}\n\telse\n\t{\n\t\t// Draw the local player\n\t\tlocalPlayer.draw(ctx);\n\t}\n\t// Draw the remote players\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].getIsCatcher())\n\t\t{\n\t\t\t// Draw the local player\n\t\t\tremotePlayers[i].drawCatcher(ctx);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Draw the local player\n\t\t\tremotePlayers[i].draw(ctx);\n\t\t}\n\t\t\n\t};\n}", "title": "" }, { "docid": "ed9860bf8dd79b698ce9043a7947adc8", "score": "0.5181029", "text": "reportSpawnVehicle(player) {\n this.decider_.reportThrottle(player, throttles.kSpawnVehicleThrottle);\n }", "title": "" }, { "docid": "3fa57da27d9c941586fb8a5358fc4866", "score": "0.51580536", "text": "function draw() {\n\n\t// Draw the local player\n\tlocalPlayer.draw();\n\n\t// Draw the remote players\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tremotePlayers[i].draw();\n\t};\n}", "title": "" }, { "docid": "b50a964f7798c4526e9fcc5f6b0b8f03", "score": "0.515533", "text": "function PlayerView(player, gameView)\r\n\t{\r\n\t\tthis.player = player;\r\n\t\tthis.playerName = player.name;\r\n\t\tthis.cardObjects = [];\r\n\t\tvar gView = gameView;\r\n\t\tthis.avatarObject = {};\r\n\t\tthis.refVec = {};\r\n\t\tthis.btnObjects = [];\r\n\t\tthis.outCardObjs = [];\r\n\t\tthis.lastOutCards = [];\r\n\t\t// draw profile -\r\n\t\t// name\r\n\t\t// profile\r\n\t\t// lord flag\r\n\t\tthis.initProfile = function()\r\n\t\t{\r\n\t\t\tvar x, y;\r\n\t\t\tvar id;\r\n\t\t\tvar avatarPos, refVec;\r\n\t\t\t\r\n\t\t\tvar length = resImages.length;\r\n\t\t\tvar avatarImg = resImages[this.player.avatar];\r\n\t\t\tvar avatar = new paper.Raster(avatarImg);\r\n\t\t\t\r\n\t\t\tif(this.playerName == gView.sessionPlayer.name) {\r\n\t\t\t\t// calc the avatar pos for this player\r\n\t\t\t\tx = avatarImg.width*2.5;\r\n\t\t\t\ty = gView.viewSize.height - avatarImg.height/2 - gView.margin;\r\n\t\t\t\tavatarPos = new Point(x, y);\r\n\t\t\t\trefVec = new Point(1, -1);\r\n\t\t\t} else {\r\n\t\t\t\tvar offset = gView.offset+gView.cardSize.width*2.5;\r\n\t\t\t\t// calc the avatar pos for this player\r\n\t\t\t\tvar leftSidePlayer = (this.player.name == gView.sessionPlayer.leftPlayer);\r\n\t\t\t\tif(leftSidePlayer) {\r\n\t\t\t\t\tx = offset/2;\r\n\t\t\t\t\ty = gView.viewSize.height/2;\r\n\t\t\t\t\tavatarPos = new Point(x, y);\r\n\t\t\t\t\trefVec = new Point(-1, -1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tx = gView.viewSize.width-offset/2;\r\n\t\t\t\t\ty = gView.viewSize.height/2;\r\n\t\t\t\t\tavatarPos = new Point(x, y);\r\n\t\t\t\t\trefVec = new Point(1, -1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// set the position of the avatar\r\n\t\t\tavatar.position = avatarPos;\r\n\t\t\t\r\n\t\t\t// draw the name of the player\r\n\t\t\tvar playerName = new paper.PointText(new Point(avatar.position.x-avatarImg.width/2, avatar.position.y + avatarImg.height/2+self.margin));\r\n\t\t\tplayerName.content = this.player.name;\r\n\t\t\tplayerName.characterStyle = {\r\n\t\t\t\tjustification: 'center',\r\n\t\t\t\tfont: 'Arial Black',\r\n\t\t\t\tfontSize: 12,\r\n\t\t\t\tfillColor: 'white',\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tthis.nameObject = playerName;\r\n\t\t\tthis.avatarObject = avatar;\r\n\t\t\tthis.refVec = refVec;\r\n\t\t\t// draw a avartar to represent the lord if the play is lord\r\n\t\t\tthis.drawLordFlag();\r\n\t\t}\r\n\t\t\r\n\t\tthis.drawLordFlag = function()\r\n\t\t{\r\n\t\t\tif(this.player.isLord && !this.lordObject && this.avatarObject && this.refVec)\r\n\t\t\t\tthis.lordObject = _drawLordFlag(this.avatarObject.position, this.refVec);\r\n\t\t}\r\n\t\t\r\n\t\t// call this function to draw view when deliver card to this player or chupai\r\n\t\tthis.updateCardsView = function()\r\n\t\t{\r\n\t\t\tif(!this.player)\r\n\t\t\t\treturn;\r\n\t\t\tclearRasterCards(this.cardObjects);\r\n\t\t\tthis.drawLordFlag();\r\n\t\t\tvar cards = this.player.cards;\r\n\t\t\tfor(var i = 0; i < cards.length; ++i)\r\n\t\t\t{\r\n\t\t\t\tdrawCard(this, cards[i], i+1);\r\n\t\t\t}\r\n\t\t\tview.draw();\r\n\t\t}\r\n\t\t\r\n\t\t// this function is used for play cards\r\n\t\tthis.updatePlayerView = function(outCards)\r\n\t\t{\r\n\t\t\tvar clientOutCards = transServerCards(outCards);\t\t\t\r\n\t\t\t// clear last object\r\n\t\t\tclearRasterCards(this.outCardObjs);\r\n\t\t\t\r\n\t\t\t// draw the cards at the center of the gameview\t\t\t\r\n\t\t\tif(clientOutCards.length > 0)\r\n\t\t\t{\r\n\t\t\t\t// calculate the position of the out cards, it must be in the center of the view\r\n\t\t\t\tvar center = gView.center;\r\n\t\t\t\tvar totalLength = gView.cardSize.width + gView.offset * clientOutCards.length;\r\n\t\t\t\tvar startW = center.x - totalLength / 2 + gView.cardSize.width / 2;\r\n\t\t\t\tvar startH = center.y;\r\n\t\t\t\t\r\n\t\t\t\tfor(var i = 0; i < clientOutCards.length; ++i)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar card = clientOutCards[i];\r\n\t\t\t\t\tvar outCard = new paper.Raster(resImages[card.id]);\r\n\t\t\t\t\toutCard.position = new Point(startW + i*gView.offset, startH);\r\n\t\t\t\t\tthis.outCardObjs.push(outCard);\r\n\t\t\t\t}\r\n\t\t\t\tview.draw();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.isActive() && this.isSessionView())\r\n\t\t\t{\r\n\t\t\t\t// it's the player, draw the buttons\r\n\t\t\t\tthis.drawButtons();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.takeCardsOut = function()\r\n\t\t{\r\n\t\t\t// only allow the active player to play cards\r\n\t\t\tif(this.isActive())\r\n\t\t\t{\r\n\t\t\t\tthis.translateCards();\r\n\t\t\t\tvar selectedCards = this.selectedCards();\r\n\t\t\t\tif(selectedCards.length > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar suitpattern = new SuitPattern(selectedCards);\r\n\t\t\t\t\tif (!suitpattern.IsValid())\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t// if it's larger than the last play cards\r\n\t\t\t\t\tvar outCards = gView.gameState.outCards;\r\n\t\t\t\t\tif(outCards.length > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar clientOutCards = transServerCards(outCards);\r\n\t\t\t\t\t\tvar needCheckPattern = true;\r\n\t\t\t\t\t\tif(this.lastOutCards.length == clientOutCards.length)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar matched = false;\r\n\t\t\t\t\t\t\tfor(var i = 0; i < clientOutCards.length; ++i)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmatched = false;\r\n\t\t\t\t\t\t\t\tfor(var j = 0; j < this.lastOutCards.length; ++j)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(clientOutCards[i].id == this.lastOutCards[j].id)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tmatched = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(!matched)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t// not found\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(matched)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tneedCheckPattern = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(needCheckPattern)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar lastSuitpattern = (new SuitPattern(clientOutCards));\r\n\t\t\t\t\t\t\tvar validPattern = suitpattern.IsLargerThan(lastSuitpattern);\r\n\t\t\t\t\t\t\t// check if it's good to play\r\n\t\t\t\t\t\t\tif(validPattern <= 0)\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.lastOutCards.splice(0, this.lastOutCards.length);\r\n\t\t\t\t\tfor(var i = 0; i < selectedCards.length; ++i)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.player.cards.remove(selectedCards[i]);\r\n\t\t\t\t\t\tthis.lastOutCards.push(selectedCards[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t// find a good one, play it\r\n\t\t\t\t\tgView.gameState.activePlayer = {}; // reset it\r\n\t\t\t\t\tthis.updatePlayerView(selectedCards);\r\n\t\t\t\t\tthis.sortCards();\r\n\t\t\t\t\tthis.clearButtons();\r\n\r\n\t\t\t\t\t// Send the signal to server\r\n\t\t\t\t\tsendPlayedCards(this.player.name, selectedCards);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(this.player.cards.length == 0)\r\n\t\t\t\t\t\tstartNewGame(this.player.name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.pass = function()\r\n\t\t{\r\n\t\t\tif(this.isActive())\r\n\t\t\t{\r\n\t\t\t\t// Send the signal to server\r\n\t\t\t\tthis.clearButtons();\r\n\t\t\t\tvar clientOutCards = transServerCards(gView.gameState.outCards);\r\n\t\t\t\tsendPlayedCards(this.player.name, clientOutCards);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.tip = function()\r\n\t\t{\r\n\t\t\t//\r\n\t\t}\r\n\t\t\r\n\t\tthis.isActive = function()\r\n\t\t{\r\n\t\t\treturn this.player.name == gView.gameState.activePlayer.name;\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tthis.isSessionView = function()\r\n\t\t{\r\n\t\t\treturn this.player.name == gView.sessionPlayer.name;\r\n\t\t}\r\n\t\t\r\n\t\tthis.selectedCards = function()\r\n\t\t{\r\n\t\t\tvar selectedCards = [];\r\n\t\t\tfor (var i = 0; i < this.player.cards.length; i++) {\r\n\t\t\t\tvar card = this.player.cards[i];\r\n\t\t\t\tif (card.selected)\r\n\t\t\t\t\tselectedCards.push(card);\r\n\t\t\t}\r\n\t\t\treturn selectedCards;\r\n\t\t}\r\n\t\t\r\n\t\tthis.translateCards = function()\r\n\t\t{\r\n\t\t\tvar clientCards = transServerCards(this.player.cards);\r\n\t\t\tthis.player.cards.splice(0, this.player.cards.length);\r\n\t\t\tthis.player.cards = clientCards;\r\n\t\t}\r\n\t\t\r\n\t\t// after deliver cards, call this functio to sort\r\n\t\tthis.sortCards = function()\r\n\t\t{\r\n\t\t\tthis.player.cards.sort(Card.orderByRank);\t\t\t\r\n\t\t\tthis.updateCardsView();\r\n\t\t}\r\n\t\t\r\n\t\tthis.drawButtons = function()\r\n\t\t{\r\n\t\t\tif(this.player.name == gView.gameState.activePlayer.name)\r\n\t\t\t{\r\n\t\t\t\tvar buttons = ['chupai', 'buchu', 'tishi'];\r\n\t\t\t\tvar btnImg = resImages[buttons[0]];\r\n\t\t\t\tvar totalW = btnImg.width*3 + 2*gView.offset;\r\n\t\t\t\tvar x = (gView.viewSize.width - totalW)/2 + btnImg.width/2;\r\n\t\t\t\tvar y = gView.viewSize.height - gView.cardSize.height - 3*gView.offset;\r\n\t\t\t\t\r\n\t\t\t\tvar btn;\r\n\t\t\t\tfor(var i = 0; i < buttons.length; ++i)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar x1 = x + i * btnImg.width + i * gView.offset;\r\n\t\t\t\t\tvar image = resImages[buttons[i]];\r\n\t\t\t\t\tbtn = new paper.Raster(image);\r\n\t\t\t\t\tbtn.position = new Point(x1, y);\r\n\t\t\t\t\tbtn.name = buttons[i];\r\n\t\t\t\t\tthis.btnObjects.push(btn);\r\n\t\t\t\t}\r\n\t\t\t\tview.draw();\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.clearButtons = function()\r\n\t\t{\r\n\t\t\tfor(var i = 0; i < this.btnObjects.length; ++i)\r\n\t\t\t\tthis.btnObjects[i].remove();\r\n\t\t\tthis.btnObjects.splice(0, this.btnObjects.length);\r\n\t\t}\r\n\t\t\r\n\t\tfunction drawCard(playerView, card, index)\r\n\t\t{\r\n\t\t\tif(playerView.isSessionView())\r\n\t\t\t{\r\n\t\t\t\tvar x = gView.myPositionInfo.center.x; \r\n\t\t\t\tvar y = gView.myPositionInfo.center.y;\r\n\t\t\t\t// always draw the last delived card\r\n\t\t\t\tvar cardRaster = new paper.Raster(resImages[card.id]);\r\n\t\t\t\tcardRaster.name = card.id;\r\n\t\t\t\tcardRaster.position = new Point(x+index*gView.offset, y);\r\n\t\t\t\t\r\n\t\t\t\tplayerView.cardObjects.push(cardRaster);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar cards = playerView.player.cards;\r\n\t\t\t\tvar leftSidePlayer = (playerView.player.name == gView.sessionPlayer.leftPlayer)\r\n\t\t\t\tvar totalH = (cards.length-1)*gView.offset + gView.cardSize.height;\r\n\t\t\t\tvar offset = gView.offset+gView.cardSize.width*2.5;\r\n\t\t\t\tvar x = leftSidePlayer ? offset : (gView.viewSize.width-offset);\r\n\t\t\t\tvar y = (gView.viewSize.height - totalH)/2;\r\n\t\t\t\tvar cardRaster = new paper.Raster(resImages['rear']);\r\n\t\t\t\tcardRaster.name = 'rear'+i;\r\n\t\t\t\tcardRaster.position = new Point(x, y+index*gView.offset);\r\n\t\t\t\t\r\n\t\t\t\tplayerView.cardObjects.push(cardRaster);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction _drawLordFlag(avatarPos, refVec) {\r\n\t\t\tvar lordImg = resImages['Lord'];\r\n\t\t\trefVec = refVec.normalize(40+lordImg.height);\r\n\t\t\tvar lord = new paper.Raster(lordImg);\r\n\t\t\tlord.position = new Point(avatarPos.x+refVec.x, avatarPos.y+refVec.y);\r\n\t\t\treturn lord;\r\n\t\t}\r\n\t\t\r\n\t\t// private function\r\n\t\tfunction clearRasterCards(rasterObjects)\r\n\t\t{\r\n\t\t\tfor(var i = 0; i < rasterObjects.length; ++i)\r\n\t\t\t{\r\n\t\t\t\trasterObjects[i].remove();\r\n\t\t\t}\r\n\t\t\trasterObjects.splice(0, rasterObjects.length);\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear = function()\r\n\t\t{\r\n\t\t\tif(!this.player)\r\n\t\t\t\treturn;\r\n\t\t\tclearRasterCards(this.cardObjects);\r\n\t\t\tclearRasterCards(this.outCardObjs);\r\n\t\t\tclearRasterCards(this.btnObjects);\r\n\t\t\tif(!this.avatarObject)\r\n\t\t\t\tthis.avatarObject.remove();\r\n\t\t\tif(!this.nameObject)\r\n\t\t\t\tthis.nameObject.remove();\r\n\t\t\tif(!this.lordObject)\r\n\t\t\t\tthis.lordObject.remove();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e65cfeba23ddbf510a8c9bb47f19037f", "score": "0.51517636", "text": "function Car4(make, model, year, color, passengers, convertible, mileage) {\n this.make = make;\n this.model = model;\n this.year = year;\n this.color = color;\n this.passengers = passengers;\n this.convertible = convertible;\n this.mileage = mileage;\n this.started = false;\n\n this.drive = function() {\n this.started = true;\n };\n\n // rest of the methods\n}", "title": "" }, { "docid": "be8a0060183258af9c63a0dcaa6b563f", "score": "0.5130627", "text": "function generateRoadObject(lineNumber) {\n var topLeft, topRight, roadObject;\n var offset = (lineNumber < 2 ? DIVIDER_OFFSET : CAR_OFFSET);\n \n topLeft = new Point(LINE_LIST[lineNumber].startPoint.x - offset, LINE_LIST[lineNumber].startPoint.y);\n topRight = new Point(LINE_LIST[lineNumber].startPoint.x + offset, LINE_LIST[lineNumber].startPoint.y);\n\n //Newly created dividers will appear as just a line\n roadObject = new RoadObject(new Point(topLeft.x, topLeft.y), \n new Point(topRight.x, topRight.y), \n new Point(topRight.x, topRight.y), \n new Point(topLeft.x, topRight.y), (lineNumber < 2 ? DIVIDER_COLOR : NPC_COLOR));\n\n roadObject.lineNumber = lineNumber;\n return roadObject;\n}", "title": "" }, { "docid": "cd8c7a81664f05aa9e3313dbee168316", "score": "0.51181585", "text": "movePlayer() {\n this.ensureInGame();\n\n let context = this.canvas.getContext(\"2d\");\n\n let x1 = this.curPosition[0] + this.playerRecSize / 2;\n let y1 = this.curPosition[1] + this.playerRecSize / 2;\n let x2 = (x1 + this.curVector[0][0] * this.curSpeed * this.directionVectorLength);\n let y2 = (y1 + this.curVector[1][0] * this.curSpeed * this.directionVectorLength);\n\n if (!this.useImage) {\n //print the rect\n context.fillStyle = this.playerRecDefaultColor;\n context.lineWidth = 1;\n context.fillRect(this.curPosition[0], this.curPosition[1], this.getPlayerRecSize(), this.getPlayerRecSize());\n } else {\n //print the image\n this.playerSprite.update();\n //context.fillRect(this.curPosition[0], this.curPosition[1], this.getPlayerRecSize(), this.getPlayerRecSize());\n this.playerSprite.drawSprite(x1, y1, this.playerRecSize, this.playerRecSize, this.curAngle);\n }\n\n //print the vector\n context.strokeStyle = this.directionVectorColor;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.stroke();\n context.closePath()\n }", "title": "" }, { "docid": "5ba2103b9d4fa88bb6cc834d9087aa8a", "score": "0.5104785", "text": "function render() {\n\n var baseSegment = findSegment(position);\n var basePercent = Util.percentRemaining(position, segmentLength);\n var playerSegment = findSegment(position+playerZ);\n var playerPercent = Util.percentRemaining(position+playerZ, segmentLength);\n var playerY = Util.interpolate(playerSegment.p1.world.y, playerSegment.p2.world.y, playerPercent);\n var maxy = height;\n\n var x = 0;\n var dx = - (baseSegment.curve * basePercent);\n\n ctx.clearRect(0, 0, width, height);\n\n Render.background(ctx, background, width, height, BACKGROUND.SKY, skyOffset, resolution * skySpeed * playerY);\n Render.background(ctx, background, width, height, BACKGROUND.HILLS, hillOffset, resolution * hillSpeed * playerY);\n Render.background(ctx, background, width, height, BACKGROUND.TREES, treeOffset, resolution * treeSpeed * playerY);\n\n var n, segment;\n\n for(n = 0 ; n < drawDistance ; n++) {\n\n segment = segments[(baseSegment.index + n) % segments.length];\n segment.looped = segment.index < baseSegment.index;\n segment.fog = Util.exponentialFog(n/drawDistance, fogDensity);\n\n Util.project(segment.p1, (playerX * roadWidth) - x, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n Util.project(segment.p2, (playerX * roadWidth) - x - dx, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n\n x = x + dx;\n dx = dx + segment.curve;\n\n if ((segment.p1.camera.z <= cameraDepth) || // behind us\n (segment.p2.screen.y >= segment.p1.screen.y) || // back face cull\n (segment.p2.screen.y >= maxy)) // clip by (already rendered) segment\n continue;\n\n Render.segment(ctx, width, lanes,\n segment.p1.screen.x,\n segment.p1.screen.y,\n segment.p1.screen.w,\n segment.p2.screen.x,\n segment.p2.screen.y,\n segment.p2.screen.w,\n segment.fog,\n segment.color);\n\n maxy = segment.p2.screen.y;\n\n }\n\n Render.player(ctx, width, height, resolution, roadWidth, sprites, speed/maxSpeed,\n cameraDepth/playerZ,\n width/2,\n (height/2) - (cameraDepth/playerZ * Util.interpolate(playerSegment.p1.camera.y, playerSegment.p2.camera.y, playerPercent) * height/2),\n speed * (keyLeft ? -1 : keyRight ? 1 : 0),\n playerSegment.p2.world.y - playerSegment.p1.world.y);\n }", "title": "" }, { "docid": "d6c7bdb2c52830445903875101cd388e", "score": "0.50975865", "text": "function drawTruck(){\n //make the outline of the truck\n canvasInfo.context.beginPath()\n canvasInfo.context.moveTo(canvasInfo.truckX, canvasInfo.truckY)\n canvasInfo.context.lineTo(canvasInfo.truckX + 400, canvasInfo.truckY)\n canvasInfo.context.moveTo(canvasInfo.truckX + 400, canvasInfo.truckY)\n canvasInfo.context.lineTo(canvasInfo.truckX + 400, canvasInfo.truckY-75)\n canvasInfo.context.moveTo(canvasInfo.truckX + 400, canvasInfo.truckY - 75)\n canvasInfo.context.lineTo(canvasInfo.truckX + 330, canvasInfo.truckY - 75)\n canvasInfo.context.moveTo(canvasInfo.truckX + 330, canvasInfo.truckY - 75)\n canvasInfo.context.lineTo(canvasInfo.truckX + 250, canvasInfo.truckY - 150)\n canvasInfo.context.moveTo(canvasInfo.truckX + 250, canvasInfo.truckY - 150)\n canvasInfo.context.lineTo(canvasInfo.truckX + 150, canvasInfo.truckY - 150)\n canvasInfo.context.moveTo(canvasInfo.truckX + 150, canvasInfo.truckY - 150)\n canvasInfo.context.lineTo(canvasInfo.truckX + 150, canvasInfo.truckY - 75)\n canvasInfo.context.moveTo(canvasInfo.truckX + 150, canvasInfo.truckY - 75)\n canvasInfo.context.lineTo(canvasInfo.truckX, canvasInfo.truckY - 75)\n canvasInfo.context.moveTo(canvasInfo.truckX, canvasInfo.truckY - 75)\n canvasInfo.context.lineTo(canvasInfo.truckX, canvasInfo.truckY)\n canvasInfo.context.closePath()\n canvasInfo.context.lineWidth = 1\n canvasInfo.context.strokeStyle = \"black\"\n canvasInfo.context.stroke()\n\n //make the first wheel\n canvasInfo.context.fillStyle = \"SlateGray\"\n canvasInfo.context.beginPath()\n canvasInfo.context.arc(canvasInfo.truckX + 75, canvasInfo.truckY+7, 40, 0, 2*Math.PI)\n canvasInfo.context.closePath()\n canvasInfo.context.stroke()\n canvasInfo.context.lineWidth = 1\n canvasInfo.context.strokeStyle = \"black\"\n canvasInfo.context.fill()\n\n //make the second wheel\n canvasInfo.context.fillStyle = \"SlateGray\"\n canvasInfo.context.beginPath()\n canvasInfo.context.arc(canvasInfo.truckX + 325, canvasInfo.truckY + 7, 40, 0, 2 * Math.PI)\n canvasInfo.context.closePath()\n canvasInfo.context.stroke()\n canvasInfo.context.lineWidth = 1\n canvasInfo.context.strokeStyle = \"black\"\n canvasInfo.context.fill()\n}", "title": "" }, { "docid": "03f56bed25fd1b5ad94a72d0be9a6962", "score": "0.508151", "text": "function updateRoadObject(roadObject) {\n var deleteVal = roadObject.lineNumber < 2 ? roadObject.topLeft.y : roadObject.topLeft.y - CAR_HEIGHT;\n if(deleteVal >= (GAME_HEIGHT - 2)) {\n roadObject.color = DELETE_COLOR;\n }\n else {\n var offset = (roadObject.lineNumber < 2 ? DIVIDER_OFFSET : CAR_OFFSET);\n var midPoints = getMidPoints(roadObject, offset);\n \n //Road Object spawned recently and is near the top\n if(roadObject.bottomLeft.y > (roadObject.lineNumber < 2 ? DIVIDER_HEIGHT : CAR_HEIGHT) + HORIZON_Y) {\n var topSidePoints = getSidePoints(getNextPointOnLine(roadObject.lineNumber, midPoints[0]), offset);\n roadObject.topLeft = topSidePoints[0];\n roadObject.topRight = topSidePoints[1];\n }\n \n if(roadObject.bottomLeft.y < GAME_HEIGHT) {\n var botSidePoints = getSidePoints(getNextPointOnLine(roadObject.lineNumber, midPoints[1]), offset);\n roadObject.bottomLeft = botSidePoints[0];\n roadObject.bottomRight = botSidePoints[1];\n }\n }\n \n if(roadObject.color != DELETE_COLOR) {\n drawRoadObject(roadObject);\n }\n}", "title": "" }, { "docid": "ba59c5115f37e271f48b4547435903af", "score": "0.5073619", "text": "function drawPlayer(){\n\t\t\tif(p.state == PLAYER_STATE_NORMAL){\n\t\t\t\trenderWalkAnimation();\n\t\t\t}else if(p.state == PLAYER_STATE_ATTACK){\n\t\t\t\tp.stamina -= staminaCost;\n\t\t\t\trenderAttackAnimation();\n\t\t\t}\n\t\t\telse if(p.state == PLAYER_STATE_DEAD){\n\t\t\t\trenderDeathAnimation();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a3874c7377138e22ba1b2fb2615c1fef", "score": "0.5072322", "text": "function EnemyCar(props) {\n var self = this;\n self.x = 0;\n self.y = CONTAINER_TOP - ENEMY_CAR_HEIGHT;\n self.dx = props.dx || 0;\n self.dy = props.dy || 0;\n self.$parent = props.$parent;\n self.enemyHealth = ENEMY_HEALTH - 100;\n\n self.score = props.score;\n\n self.init = function () {\n addNewEnemyCar();\n plotPosition();\n };\n\n var enemyCarSpeed = 1;\n self.updatePosition = function () {\n //increase speed with score\n enemyCarSpeed = Math.floor(self.score / 100) + 1;\n self.y = self.y + enemyCarSpeed;\n self.top = self.y + ENEMY_CAR_HEIGHT;\n plotPosition();\n };\n\n self.destroyEnemyCar = function () {\n if (self.enemyHealth === 0) {\n self.$elem.remove();\n return true;\n }\n self.enemyHealth -= 100;\n };\n\n var getRandomXPosition = function () {\n var randomValue = getRandom(1, 3);\n if (randomValue === 1) return 30;\n if (randomValue === 2) return 130;\n if (randomValue === 3) return 230;\n };\n self.x = getRandomXPosition();\n\n var plotPosition = function () {\n self.$elem.style.left = self.x + \"px\";\n self.$elem.style.top = self.y + \"px\";\n };\n\n var addNewEnemyCar = function () {\n self.$elem = document.createElement(\"div\");\n self.$elem.className = \"car enemy-car\";\n self.$parent.appendChild(self.$elem);\n };\n\n\n}", "title": "" }, { "docid": "0a2b04afe8280e42eebf6f5de108eb7d", "score": "0.50691503", "text": "draw() {\n this.context.fillStyle = \"black\";\n this.context.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height);\n this.drawImage(this.sprites, this.spritesDescription.infosHouse, { x: -2, y: -10 });\n // Draw middle sprites, if they are under the characters\n for (let i = 0; i < this.middleSprites.length; i++) {\n let s = this.middleSprites[i];\n if (this.playerPosition.pos.y >= s.y) {\n this.drawImage(this.sprites, s.desc, { x: s.x, y: s.y - s.desc.height + 1 });\n }\n }\n super.draw();\n // Draw middle sprites, if they are over the characters\n for (let i = 0; i < this.middleSprites.length; i++) {\n let s = this.middleSprites[i];\n if (this.playerPosition.pos.y < s.y) {\n this.drawImage(this.sprites, s.desc, { x: s.x, y: s.y - s.desc.height + 1 });\n }\n }\n // In order to avoid weird things around the carpet, we decided that the wall must be drawn over the 2x of the carpet side.\n // This is why I have 2/32 here, for those 2px over a square of 32.\n this.drawPattern(this.patterns.wallBottom, { x: -2, y: 0, width: 2 + (2 / 32), height: 1 });\n this.drawPattern(this.patterns.wallBottom, { x: 1 - (2 / 32), y: 0, width: 9 + (2 / 32), height: 1 });\n if (this.exitHouseOverlayOpacity > 0) {\n this.context.fillStyle = \"rgba(255, 255, 255, \" + this.exitHouseOverlayOpacity + \")\";\n this.context.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height);\n }\n }", "title": "" }, { "docid": "0951ef1e1a95fea29d5b0c5f05b31763", "score": "0.50237995", "text": "drawPlayer() {\n push();\n noFill();\n noStroke();\n rectMode(CENTER);\n rect(this.x,this.y,this.w,this.h);\n imageMode(CENTER);\n image(playerOverlay,this.x,this.y);\n pop();\n }", "title": "" }, { "docid": "097e1fe91ef83fb7ba2301439a37b767", "score": "0.501826", "text": "function drawPlayer(curve, curve_speed) {\r\n curve_speed = -Player.speed * 3\r\n curve += curve_speed + (Player.posY + Player.size / 2)\r\n ctx.save()\r\n ctx.beginPath();\r\n ctx.lineWidth = 20 // Largeur de la ligne\r\n const gradient = ctx.createLinearGradient(Player.posX - ((Player.trail_size * VELOCITY) / 1.5), 2000, 500, 2000) // x1, y1, x2, y2\r\n gradient.addColorStop(0, 'rgba(0,0,0,0)') // Couleur de départ\r\n gradient.addColorStop(1, Player.trail_color) // Couleur de arrivée\r\n ctx.strokeStyle = gradient\r\n ctx.moveTo(Player.posX, (Player.posY + Player.size / 2))\r\n ctx.quadraticCurveTo(Player.posX - ((Player.trail_size * VELOCITY) / 4), (Player.posY + Player.size / 2), Player.posX - ((Player.trail_size * VELOCITY) / 1.3), curve);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.fillStyle = Player.color;\r\n ctx.strokeStyle = \"#aa7870\";\r\n ctx.translate(Player.posX + Player.size / 2, Player.posY + Player.size / 2);\r\n ctx.rotate(Player.rotation * Player.speed * 1.5 / 180);\r\n ctx.translate(-Player.posX - Player.size / 2, -Player.posY - Player.size / 2);\r\n ctx.lineWidth = 2\r\n ctx.moveTo(Player.posX, Player.posY);\r\n ctx.lineTo(Player.posX + Player.size, Player.posY + Player.size / 2);\r\n ctx.lineTo(Player.posX, Player.posY + Player.size);\r\n ctx.lineTo(Player.posX, Player.posY);\r\n ctx.stroke();\r\n ctx.fill();\r\n ctx.restore()\r\n}", "title": "" }, { "docid": "3e8372f704283984bd3cff5a11eda403", "score": "0.5008699", "text": "function draw(car) {\n ctx.fillStyle = 'blue';\n ctx.fillRect(car.x, car.y, 30, 30);\n // var img = new Image()\n // img.onload = function () {\n // ctx.drawImage(img, car.x, car.y, 35, 75);\n // }\n // img.src = './images/car.png'; // Set source path\n }", "title": "" }, { "docid": "da8f2c1e8533c1605bda06da613bd737", "score": "0.4983786", "text": "draw(){\n if (this.webGL) this.canvas.translate(-0.5 * this.canvas.width, -0.5 * this.canvas.height)\n // this.editingTrack ? this.canvas.noCursor() : this.canvas.cursor();\n\n this.canvas.background(this.backgroundColor);\n this.drawTrack();\n\n if (this.showDebug) this.drawDebugText();\n\n // Interface and listeners and such when editing track.\n this.drawCars();\n if (this.editingTrack) this.drawTrackEditing();\n }", "title": "" }, { "docid": "4d39819831b4590f91dbdc39dcedc8db", "score": "0.49806526", "text": "function drawScene() {\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // preventiva da gre igralec iz trave\n if(playerXposition + playerMovementLR > 3.3) {\n playerMovementLR = 0;\n playerCameraMoveX = 0;\n }\n if(playerXposition + playerMovementLR < -3.3) {\n playerMovementLR = 0;\n playerCameraMoveX = 0;\n }\n\n if(playerYposition + playerMovementUpDown > 3.92) {\n playerMovementUpDown = 0;\n playerCameraMoveY = 0;\n playerCameraMoveZ = 0;\n }\n if(playerYposition + playerMovementUpDown < -3) {\n playerMovementUpDown = 0;\n playerCameraMoveY = 0;\n playerCameraMoveZ = 0;\n }\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //collisionDetection\n var wallRect1 = {x: 1.1, y: -0.8, width: 0.12, height: 1.0};\n var wallRect2 = {x: 1.1, y: 0.5, width: 0.12, height: 1};\n var wallRect3 = {x: 0.11, y: 1.4, width: 1.1, height: 0.12};\n var wallRect4 = {x: -1.15 , y: 1.4, width: 1, height: 0.12};\n var wallRect5 = {x: -1.2, y: 0.5, width: 0.12, height: 1};\n var wallRect6 = {x: -1.2, y: -0.8, width: 0.12, height: 0.95};\n var wallRect7 = {x: -1.15, y: -0.9, width: 1.095, height: 0.12};\n var wallRect8 = {x: 0.17, y: -0.9, width: 1, height: 0.12};\n\n var playerXRect = {x: playerXposition + playerMovementLR, y: playerYposition, width: 0.05, height: 0.05};\n if (collision(playerXRect, wallRect1) ||\n collision(playerXRect, wallRect2) ||\n collision(playerXRect, wallRect3) ||\n collision(playerXRect, wallRect4) ||\n collision(playerXRect, wallRect5) ||\n collision(playerXRect, wallRect6) ||\n collision(playerXRect, wallRect7) ||\n collision(playerXRect, wallRect8)) {\n\n } else {\n playerXposition += playerMovementLR;\n playerCameraPositonX += playerCameraMoveX;\n }\n var playerYRect = {x: playerXposition, y: playerYposition + playerMovementUpDown, width: 0.05, height: 0.05};\n if (collision(playerYRect, wallRect1) ||\n collision(playerYRect, wallRect2) ||\n collision(playerYRect, wallRect3) ||\n collision(playerYRect, wallRect4) ||\n collision(playerYRect, wallRect5) ||\n collision(playerYRect, wallRect6) ||\n collision(playerYRect, wallRect7) ||\n collision(playerYRect, wallRect8)) {\n\n } else {\n playerYposition += playerMovementUpDown;\n playerCameraPositionY += playerCameraMoveY;\n playerCameraPositionZ += playerCameraMoveZ;\n }\n\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // BULLET WALL collision\n for (b in bullets) {\n if (bullets[b] == null) continue;\n\n var bulletRect = {x: bullets[b].x, y: bullets[b].y, width: 0.05, height: 0.05};\n if (collision(bulletRect, wallRect1) ||\n collision(bulletRect, wallRect2) ||\n collision(bulletRect, wallRect3) ||\n collision(bulletRect, wallRect4) ||\n collision(bulletRect, wallRect5) ||\n collision(bulletRect, wallRect6) ||\n collision(bulletRect, wallRect7) ||\n collision(bulletRect, wallRect8)) {\n bullets[b] = null;\n }\n }\n\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //console.log(\"draw scene\");\n // set the rendering environment to full canvas size\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n\n // Clear the canvas before we start drawing on it.\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n if (worldVertexTextureCoordBuffer == null || worldVertexPositionBuffer == null) {\n return;\n }\n\n // kamera: premiki in rotacija glede na tipke\n mat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix);\n mat4.translate(pMatrix, [cameraPositionX, cameraPositionY, cameraPositionZ]);\n mat4.rotateX(pMatrix, degToRad(cameraRotationY));\n\n\n // Set the drawing position to the \"identity\" point, which is\n // the center of the scene.\n mat4.identity(mvMatrix);\n\n //premik sveta za -7 po Z koordinati\n mat4.translate(mvMatrix, [0.0, 0.0, -7.0]);\n\n // Activate textures\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, grassTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n // Set the texture coordinates attribute for the vertices.\n gl.bindBuffer(gl.ARRAY_BUFFER, worldVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, worldVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Draw the world by binding the array buffer to the world's vertices\n // array, setting attributes, and pushing it to GL.\n gl.bindBuffer(gl.ARRAY_BUFFER, worldVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, worldVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Draw the world.\n setMatrixUniforms();\n gl.drawArrays(gl.TRIANGLES, 0, worldVertexPositionBuffer.numItems);\n\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, fogTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n // Set the texture coordinates attribute for the vertices.\n gl.bindBuffer(gl.ARRAY_BUFFER, outterWallVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, outterWallVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, outerWallVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, outerWallVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, outterWallVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, outterWallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n\n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\n\n\n // izris igralca (zaenkrat kocke)\n mat4.translate(mvMatrix, [playerXposition, 0.0, playerYposition]);\n mat4.rotateY(mvMatrix, degToRad(playerRotation)); // rotacija\n\n\n // izpisemo v console X in Y pozicijo igralca vsakih 500 klicov metode drawScene ( ZA POMOČ )\n if(counterShowConsole > 500){\n //console.log(\"Trenutna pozicija: \" + playerXposition + \" \" + playerYposition);\n counterShowConsole = 0;\n }else{\n counterShowConsole += 1;\n }\n\n\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, playerTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, playerVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, playerVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, playerVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, playerVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, playerVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, playerVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n // glava\n\n mat4.translate(mvMatrix, [0, 0.05, 0]);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, headTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, headVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, headVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, headVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, headVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n // trebuh\n mat4.translate(mvMatrix, [0.03, -0.04, 0]);\n \n \n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, headTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, headVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, headVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, headVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, headVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n // roke\n\n mat4.translate(mvMatrix, [-0.02, 0, 0]);\n mat4.scale(mvMatrix, [1, 1, 2]);\n \n \n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, headTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, headVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, headVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n \n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, headVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, headVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n// oci\n\nmat4.translate(mvMatrix, [0.025, 0.052, 0.01]);\nmat4.scale(mvMatrix, [0.1, 0.3, 0.1]);\n\n // desna\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, eyeTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, headVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, headVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, headVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, headVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n // leva\n mat4.translate(mvMatrix, [0, 0, -0.2]);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, eyeTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, headVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, headVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, headVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, headVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, headVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n\n // ZIDOVI\n\n // zidovi\n mat4.identity(mvMatrix);\n mat4.translate(mvMatrix, [1.1, 0, -7.86]);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, wallTexture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, wallVertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, wallVertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, wallVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, wallVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, wallVertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.8]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.rotateY(mvMatrix, degToRad(-90));\n mat4.translate(mvMatrix, [0.45, 0, 0]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.8]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.rotateY(mvMatrix, degToRad(-90));\n mat4.translate(mvMatrix, [0.45, 0, 0]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.8]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.rotateY(mvMatrix, degToRad(-90));\n mat4.translate(mvMatrix, [0.45, 0, 0]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.8]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n mat4.translate(mvMatrix, [0, 0, 0.5]);\n\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, wallVertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n\n\n\n\n // izris zombijev\n\n // da zombiji ne hodijo skos enako hitro, ampak v valih (kot koraki)\n if(zombieMS < 0.005) zombieMS += 0.0001;\n //else zombieMS = 0.0005; // TUKI SM SPREMENU TAK DA CE NE DELA RIP XD.\n\n\n\n for(var i in zombies){\n if (zombies[i] == null) continue;\n //zombies[i].draw();\n\n\n\n // PREMIKANJE ZOMBIJEV (sory za grdo kodo rip :(\n\n var st1 = generirajStevilo(0, 1);\n var st2 = generirajStevilo(0, 1);\n var treshold = 0.5; // ce bo random generirano stevilo med 0 in 1 manjse od tresholda se bo naredu pozitivni premik, drugac negativni\n // (malo bolj random)\n if(skacejo){\n if(zombies[i].ms >= maxHitrostZombijev){\n // se spremeni smer kam skacejo\n //console.log(zombies[i].x + \" and \" + playerMovementLR);\n if(zombies[i].x < playerXposition){\n\n\n zombies[i].smerX = 1;\n }else{\n\n zombies[i].smerX = -1;\n\n }\n if(zombies[i].y < playerYposition){\n zombies[i].smerY = 1;\n\n }else{\n zombies[i].smerY = -1;\n\n }\n //console.log(\"skok\");\n zombies[i].ms = 0.00001;\n\n }\n }else{\n if(zombies[i].x < playerXposition){\n\n\n zombies[i].smerX = 1;\n }else{\n\n zombies[i].smerX = -1;\n\n }\n if(zombies[i].y < playerYposition){\n zombies[i].smerY = 1;\n\n }else{\n zombies[i].smerY = -1;\n\n }\n zombies[i].ms = maxHitrostZombijev;\n }\n\n\n var deltaX;\n var deltaY;\n if(zombies[i].smerX == 1){\n deltaX = (playerXposition - zombies[i].x);\n }else{\n deltaX = (zombies[i].x - playerXposition);\n }\n\n if(zombies[i].smerY == 1){\n deltaY = playerYposition - zombies[i].y;\n }else{\n deltaY = zombies[i].y - playerYposition;\n }\n\n // console.log(deltaX + \" \" + deltaY); // vecji kot je delta vecji more bit ms v tej smeri!\n\n var vsotaObeh = deltaX + deltaY;\n\n var spremembaX = deltaX / vsotaObeh;\n var spremembaY = deltaY / vsotaObeh;\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n var zombieXRect;\n var sprX = zombies[i].ms * spremembaX;\n if (zombies[i].smerX == 1) zombieXRect = {x: zombies[i].x + sprX, y: zombies[i].y, width: 0.07, height: 0.07};\n else zombieXRect = {x: zombies[i].x - sprX, y: zombies[i].y, width: 0.07, height: 0.07};\n if (collision(zombieXRect, wallRect1) ||\n collision(zombieXRect, wallRect2) ||\n collision(zombieXRect, wallRect3) ||\n collision(zombieXRect, wallRect4) ||\n collision(zombieXRect, wallRect5) ||\n collision(zombieXRect, wallRect6) ||\n collision(zombieXRect, wallRect7) ||\n collision(zombieXRect, wallRect8)) {\n spremembaX = 0;\n }\n\n var zombieYRect;\n var sprY = zombies[i].ms * spremembaY;\n if (zombies[i].smerY == 1) zombieYRect = {x: zombies[i].x, y: zombies[i].y + sprY, width: 0.07, height: 0.07};\n else zombieYRect = {x: zombies[i].x, y: zombies[i].y - sprY, width: 0.07, height: 0.07};\n if (collision(zombieYRect, wallRect1) ||\n collision(zombieYRect, wallRect2) ||\n collision(zombieYRect, wallRect3) ||\n collision(zombieYRect, wallRect4) ||\n collision(zombieYRect, wallRect5) ||\n collision(zombieYRect, wallRect6) ||\n collision(zombieYRect, wallRect7) ||\n collision(zombieYRect, wallRect8)) {\n spremembaY = 0;\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n var zombie2Rect;\n for (j in zombies) {\n if (j == i || zombies[j] == null) continue;\n\n zombie2Rect = {x: zombies[j].x, y: zombies[j].y, width: 0.1, height: 0.1};\n if (collision(zombieXRect, zombie2Rect)) spremembaX = 0;\n if (collision(zombieYRect, zombie2Rect)) spremembaY = 0;\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n if (collision({x: playerXposition, y: playerYposition, width: 0.07, height: 0.07}, {x: zombies[i].x, y: zombies[i].y, width: 0.07, height: 0.07})) {\n // GAME OVER PLAYER DEAD!!\n //console.log(\"YOU DEAD MAN!\");\n konecIgre = true;\n document.getElementById(\"gameOver\").classList.toggle(\"skrito\");\n document.getElementById(\"score\").innerHTML = zombiesKilled;\n var audio = new Audio('./sounds/gameOver.wav');\n audio.play();\n\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n var bulletRect;\n for (k in bullets) {\n if (bullets[k] == null) continue;\n bulletRect = {x: bullets[k].x, y: bullets[k].y, width: 0.1, height: 0.1};\n\n if (collision(bulletRect, {x: zombies[i].x, y: zombies[i].y, width: 0.07, height: 0.07})) {\n bullets[k] = null;\n zombies[i].health -= 50;\n if(zombies[i].health > 0){\n var zombieHitAudio = new Audio('./sounds/zombieHit.wav');\n zombieHitAudio.play();\n }\n\n }\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n if (zombies[i].health <= 0) {\n zombies[i] = null;\n zombiesKilled += 1;\n var zombieDead = new Audio('./sounds/zombieDied.wav');\n zombieDead.play();\n continue;\n }\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n var test = spremembaX + spremembaY;\n //console.log(\"Vsota: \" + vsotaObeh + \", X + Y: \" + test);\n var sprememba;\n if(zombies[i].smerX == 1){\n sprememba = zombies[i].ms * spremembaX;\n if(sprememba > 0.04) sprememba = 0.04;\n\n zombies[i].x += sprememba;\n }else{\n sprememba = zombies[i].ms * spremembaX;\n if(sprememba > 0.04) sprememba = 0.04;\n\n zombies[i].x -= sprememba;\n }\n if(zombies[i].smerY == 1){\n sprememba = zombies[i].ms * spremembaY;\n if(sprememba > 0.04) sprememba = 0.04;\n\n zombies[i].y += sprememba;\n }else{\n sprememba = zombies[i].ms * spremembaY;\n if(sprememba > 0.04) sprememba = 0.04;\n\n zombies[i].y -= sprememba;\n }\n // DOLOCANJE ROTACIJE\n var rot;\n if(zombies[i].smerX == -1 && zombies[i].smerY == -1){\n rot = Math.atan(deltaY / deltaX);\n rot = -rot;\n rot = rot - degToRad(90);\n\n\n }\n if(zombies[i].smerX == 1 && zombies[i].smerY == 1){\n rot = Math.atan(deltaY / deltaX);\n rot = -rot;\n\n }\n if(zombies[i].smerX == -1 && zombies[i].smerY == 1){\n rot = Math.atan(deltaX / deltaY);\n rot = -rot;\n rot = rot - degToRad(90);\n\n }\n if(zombies[i].smerX == 1 && zombies[i].smerY == -1){\n rot = Math.atan(deltaY / deltaX);\n }\n\n\n\n\n if(skacejo){\n zombies[i].ms += 0.002; // TO SPREMENI ZA 'SKAKANJE'\n }\n\n //console.log(zombieMS);\n\n zombies[i].draw(rot);\n //zombies[i].draw(zombies[i]);\n // }\n\n\n\n }\n}", "title": "" }, { "docid": "39d5aeb86e020056d79243a352aadf21", "score": "0.49789128", "text": "function drawPlayer() {\n if (goingLeft) {\n image(mouseImage, playerX, playerY, playerRadius * 6, playerRadius * 6);\n } else {\n image(mouseImageFlipped, playerX, playerY, playerRadius * 6, playerRadius * 6);\n }\n}", "title": "" }, { "docid": "cf86ac04193f261db4553b5e253fd6e0", "score": "0.49754438", "text": "function drawPlayers()\r\n\t{\r\n\t\tif(!self.gameState)\r\n\t\t\treturn;\r\n\t\tvar sessionPlayer = self.sessionPlayer;\r\n\t\tvar players = self.gameState.players;\r\n\t\tif(!players || !sessionPlayer)\r\n\t\t\treturn;\r\n\r\n\t\t// create playerView object for each player\r\n\t\tfor(var i = 0; i < players.length; ++i)\r\n\t\t{\r\n\t\t\tvar player = players[i];\r\n\t\t\tvar playerView = null;\r\n\t\t\tfor(var j = 0; j < self.playerViews.length; ++j)\r\n\t\t\t{\r\n\t\t\t\tif(player.name == self.playerViews[j].playerName)\r\n\t\t\t\t{\r\n\t\t\t\t\tplayerView = self.playerViews[j];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!playerView)\r\n\t\t\t{\r\n\t\t\t\tplayerView = new PlayerView(player, self);\r\n\t\t\t\tplayerView.initProfile();\r\n\t\t\t\tself.playerViews.push(playerView);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tplayerView.player = player;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tview.draw();\r\n\t}", "title": "" }, { "docid": "fb72bc5c91586bfbdbee510871af6738", "score": "0.49748737", "text": "function draw(){\n //reset translation back to default\n context.setTransform(1,0,0,1,0,0)\n //this tells the screen, i want to start at 0,0\n //and I want to draw a rectangle down to canvasl/r\n //clears screen so bg new each time\n context.clearRect(0,0,canvas.width,canvas.height)\n //make camera follow player\n const camX = -player.locX + canvas.width/2\n const camY = -player.locY + canvas.width/2\n //translate allows us to move the canvas around (cumulative)\n context.translate(camX,camY)\n //draw the players\n players.forEach((p)=>{\n //context is a 2D thing to draw on the canvas.\n context.beginPath()\n //context.fillStyle = p.color\n context.fillStyle = p.color\n //arc is used to create circles or parts of circles\n //x,y,radius,startingangle\n //context.arc(p.locX,pr.locY,10,0,Math.PI*2)\n //Notice that in the original implementation, the radius is hard coded\n context.arc(p.locX,p.locY,p.radius,0,Math.PI*2)\n //reference circle\n //context.arc(200,200,10,0,Math.PI*2)\n context.fill()\n context.lineWidth = 3;\n //this is the border color of the player\n context.strokeStyle = 'rgb(0,255,0)'\n context.stroke()\n \n })\n\n //draw all the orbs\n orbs.forEach((orb)=>{\n context.beginPath() \n context.fillStyle = orb.color\n context.arc(orb.locX,orb.locY,orb.radius,0,Math.PI*2)\n context.fill()\n })\n\n requestAnimationFrame(draw)\n}", "title": "" }, { "docid": "8fc97490f57361c6b5d4fdf406c2c52e", "score": "0.49633178", "text": "drawCar() {\r\n\r\n //calculate size of squares\r\n let c = this.height / 10;\r\n\r\n // car body\r\n ctx.fillStyle = this.colour;\r\n ctx.beginPath();\r\n //boot curve\r\n ctx.bezierCurveTo(this.x + (c * 2), this.y + (c * 10), this.x + (c * 1), this.y + (c * 8), this.x + (c * 2), this.y + (c * 6));\r\n ctx.lineTo(this.x + (c * 4), this.y + (c * 5));\r\n //back window curve\r\n ctx.bezierCurveTo(this.x + (c * 5), this.y + (c * 4), this.x + (c * 3), this.y + (c * 1), this.x + (c * 6), this.y + (c * 1));\r\n //front window curve\r\n ctx.bezierCurveTo(this.x + (c * 18), this.y + (c * 1), this.x + (c * 15), this.y + (c * 1), this.x + (c * 15), this.y + (c * 5));\r\n ctx.lineTo(this.x + (c * 19), this.y + (c * 5));\r\n //front bonnet curve\r\n ctx.bezierCurveTo(this.x + (c * 19), this.y + (c * 5), this.x + (c * 21), this.y + (c * 5), this.x + (c * 18), this.y + (c * 10));\r\n ctx.lineTo(this.x + (c * 17), this.y + (c * 10));\r\n ctx.lineTo(this.x + (c * 2), this.y + (c * 10));\r\n ctx.fill();\r\n\r\n // text box\r\n ctx.fillStyle = 'white';\r\n ctx.strokeStyle = 'black 1px';\r\n ctx.font = '40px arial';\r\n ctx.fillText(this.number, this.x + (c * 8.5), this.y + (c * 8.5));\r\n ctx.strokeText(this.number, this.x + (c * 8.5), this.y + (c * 8.5));\r\n\r\n //window 1\r\n ctx.fillStyle = this.window;\r\n ctx.fillRect(this.x + (c * 5.5), this.y + (c * 2), (c * 3.5), (c * 3));\r\n\r\n //window 2\r\n ctx.fillStyle = this.window;\r\n ctx.fillRect(this.x + (c * 10), this.y + (c * 2), (c * 3.5), (c * 3));\r\n\r\n //Wheels\r\n ctx.fillStyle = 'black';\r\n this.drawWheel(this.x + (c * 6), this.y + (c * 10), c * 1.5);\r\n this.drawWheel(this.x + (c * 14), this.y + (c * 10), c * 1.5);\r\n\r\n }", "title": "" }, { "docid": "38b518fb7d61dffeecccf501ea5e5565", "score": "0.4963002", "text": "function renderObstacle(obstacle) {\r\n if (GAME.isGameOver) {\r\n return;\r\n }\r\n GAME.isObjectRendering = true;\r\n context.beginPath();\r\n context.fillStyle = grey;\r\n if (obstacle.shape == \"circle\") {\r\n context.fillRect(\r\n obstacle.cord.x + (player.power.slowedDown ? 1 : obstacle.vx) - obstacle.dimension,\r\n obstacle.cord.y - obstacle.dimension + (obstacle.movingDown ? -(player.power.slowedDown ? 1 : obstacle.vy) : player.power.slowedDown ? 1 : obstacle.vy),\r\n 50,\r\n 50\r\n );\r\n } else {\r\n context.fillRect(\r\n obstacle.cord.x + (player.power.slowedDown ? 1 : obstacle.vx),\r\n obstacle.cord.y + (obstacle.movingDown ? -(player.power.slowedDown ? 1 : obstacle.vy) : player.power.slowedDown ? 1 : obstacle.vy),\r\n 50 + 2 * (player.power.slowedDown ? 1 : obstacle.vx),\r\n 50\r\n );\r\n }\r\n context.fill();\r\n context.closePath();\r\n\r\n context.beginPath();\r\n context.fillStyle = red;\r\n if (obstacle.shape == \"circle\") {\r\n context.arc(obstacle.cord.x, obstacle.cord.y, 25, (Math.PI / 180) * 0, (Math.PI / 180) * 360);\r\n } else {\r\n context.fillRect(obstacle.cord.x, obstacle.cord.y, obstacle.dimension, obstacle.dimension);\r\n }\r\n context.fill();\r\n context.closePath();\r\n\r\n if (obstacle.cord.y < (obstacle.shape == \"circle\" ? 290 : 265) && obstacle.movingDown) {\r\n obstacle.cord.y += player.power.slowedDown ? 1 : obstacle.vy;\r\n }\r\n\r\n if (obstacle.cord.y > (obstacle.shape == \"circle\" ? 160 : 135) && !obstacle.movingDown) {\r\n obstacle.cord.y -= player.power.slowedDown ? 1 : obstacle.vy;\r\n }\r\n\r\n if (obstacle.cord.y >= (obstacle.shape == \"circle\" ? 290 : 265) || obstacle.cord.y <= (obstacle.shape == \"circle\" ? 160 : 135)) {\r\n obstacle.movingDown = !obstacle.movingDown;\r\n }\r\n obstacle.cord.x -= player.power.slowedDown ? 1 : obstacle.vx;\r\n if (!player.power.invisibility && touchedObstacle(obstacle)) {\r\n showGameOver();\r\n } else if (obstacle.cord.x >= -(obstacle.shape == \"circle\" ? 25 : 50) && !GAME.isGameOver) {\r\n window.requestAnimationFrame(function () {\r\n renderObstacle(obstacle);\r\n });\r\n } else {\r\n GAME.isObjectRendering = false;\r\n }\r\n}", "title": "" }, { "docid": "863c78c35765ad4ea01f8f500459c215", "score": "0.49552923", "text": "function renderPlayer(me, player) {\n const { x, y, direction, image, map_number } = player;\n if(me.map_number == map_number){\n const canvasX = x*SCALING_FACTOR + (canvas.width / 2 - MAP_SIZE_X*SCALING_FACTOR / 2); // canvas.width / 2 ;//+ x; - me.x;\n const canvasY = y*SCALING_FACTOR + (canvas.height / 2 - MAP_SIZE_Y*SCALING_FACTOR / 2); // canvas.height / 2;//+ y; - me.y;\n updateHealth(me.hp);\n\n // Draw ship\n context.save();\n context.translate(canvasX, canvasY);\n\n context.rotate(direction);\n context.drawImage(\n getAsset(image),\n -PLAYER_RADIUS*SCALING_FACTOR,\n -PLAYER_RADIUS*SCALING_FACTOR,\n PLAYER_RADIUS * 2*SCALING_FACTOR,\n PLAYER_RADIUS * 2*SCALING_FACTOR,\n );\n context.restore();\n\n // Draw health bar\n context.fillStyle = 'white';\n context.fillRect(\n canvasX - PLAYER_RADIUS*SCALING_FACTOR,\n canvasY + PLAYER_RADIUS*SCALING_FACTOR + 8,\n PLAYER_RADIUS*SCALING_FACTOR * 2,\n 2,\n );\n context.fillStyle = 'red';\n context.fillRect(\n canvasX - PLAYER_RADIUS*SCALING_FACTOR + PLAYER_RADIUS*SCALING_FACTOR * 2 * player.hp / PLAYER_MAX_HP,\n canvasY + PLAYER_RADIUS*SCALING_FACTOR + 8,\n PLAYER_RADIUS*SCALING_FACTOR * 2 * (1 - player.hp / PLAYER_MAX_HP),\n 2,\n );\n }\n}", "title": "" }, { "docid": "f189dcd3c2b784b85525003451ba08d0", "score": "0.4955272", "text": "draw(context, camera) {\r\n\t\tthis._refreshEntity();\r\n\t\t\r\n\t\t//If the entityID is set. Make sure the entity has been found before proceeding.\r\n\t\tif(this._entityID == null || this._entity != null) {\r\n\t\t\tlet posX;\r\n\t\t\tlet posY;\r\n\t\t\tlet posZ;\r\n\r\n\t\t\tif(this._entity != null) {\r\n\t\t\t\t//Position the shape relative to the parent entity.\r\n\t\t\t\tposX = this._posX + this._entity.posX;\r\n\t\t\t\tposY = this._posY + this._entity.posY;\r\n\t\t\t\tposZ = this._posZ + this._entity.posZ;\r\n\t\t\t} else {\r\n\t\t\t\t//Position the shape relative to global coordinates.\r\n\t\t\t\tposX = this._posX;\r\n\t\t\t\tposY = this._posY;\r\n\t\t\t\tposZ = this._posZ;\r\n\t\t\t}\r\n\r\n\t\t\tconst cylinderBottom = posY - this._height / 2;\r\n\t\t\tconst cylinderTop = posY + this._height / 2;\r\n\t\t\t\r\n\t\t\t//Check that the cylinder would be visible within the culling values of the camera.\r\n\t\t\tif(camera.topCulling >= cylinderBottom && camera.bottomCulling <= cylinderTop) {\r\n\t\t\t\t//Draw a circle representing the cylinder seen from above.\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.arc(posX, posZ, this._radius, 0, Math.PI * 2);\r\n\t\t\t\tcontext.fill();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1e22fe539134bd53b5665c230cba49d8", "score": "0.49356028", "text": "function renderPlayer(me, player) {\n const { x, y, direction, pos, cilentClick, isTurnToPlay } = player;\n var canvasX = x; //canvas.width / 8 + \n var canvasY = y; //canvas.height / 8 + \n\n \n\n if (pos < 4) {\n canvasX = canvas.width / 8;\n canvasY = (pos - 1)*150 +100\n }\n else {\n canvasX = canvas.width /2;\n canvasY = (pos - 4)*150 +100\n }\n if (player.y == me.y) {\n context.fillStyle = 'white';\n context.fillRect(canvasX+50, canvasY, 20, 20,);\n\n }\n i++;\n context.font = \"20px Arial\";\n //context.fillText(isTurnToPlay, canvasX-50, canvasY, 20000);\n // Draw ship\n if (isTurnToPlay) {\n context.fillStyle = 'white';\n } else {\n context.fillStyle = 'red'\n }\n context.save();\n context.translate(canvasX, canvasY);\n context.fillRect(\n -PLAYER_RADIUS,\n -PLAYER_RADIUS,\n PLAYER_RADIUS * 2,\n PLAYER_RADIUS * 2);\n context.rotate(direction);\n context.drawImage(\n getAsset('ship.svg'),\n -PLAYER_RADIUS,\n -PLAYER_RADIUS,\n PLAYER_RADIUS * 2,\n PLAYER_RADIUS * 2,\n );\n context.restore();\n context.fillStyle = 'green'\n context.fillRect(0, canvas.height - canvas.height*1/4 + 10,100, 150);\n}", "title": "" }, { "docid": "2a75c6d89a0af4c4cdeb90c2c7337b28", "score": "0.49022543", "text": "function draw() {\n \n // console.log(\"Potential Velocity Added: \" + Math.hypot(velXAdded(), velYAdded()))\n \n // Updating\n click_multiplier = speed_slider.value; // Set click multiplier equal to value of slider\n \n if (!hole()) {\n updatePosition();\n }\n \n // Drawing\n background(\"green\"); // Backgroud\n stroke(\"black\"); // Hole outline\n fill(\"black\"); // Hole color\n ellipse(hole_x, hole_y, hole_radius*2, hole_radius*2); // Hole\n stroke(\"black\");\n fill(\"white\");\n ellipse(x, y, (radius-animation)*2, (radius-animation)*2);\n \n obstacles.forEach(drawObstacle);\n}", "title": "" }, { "docid": "1fdac318e6609639216dafb97955f57e", "score": "0.48949772", "text": "draw() {\n // this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.addToMap(this.clearRect);\n this.addObjectsToMap(this.level.clouds);\n\n // this.ctx.translate(this.camera_x, 0);\n this.addObjectsToMap(this.level.backgroundObjects);\n // this.ctx.translate(-this.camera_x, 0); //Back\n\n this.ctx.translate(this.camera_x, 0); //Forwards\n \n this.addObjectsToMap(this.throwableObjects);\n this.addObjectsToMap(this.level.coins);\n this.addObjectsToMap(this.level.enemies);\n this.addToMap(this.character);\n this.ctx.translate(-this.camera_x, 0);\n\n // --------- Space for fixed Objects ---------\n this.addToMap(this.statusBar);\n // --------- Space for fixed Objects End ---------\n\n let self = this;\n requestAnimationFrame(function () {\n self.draw();\n });\n }", "title": "" }, { "docid": "950048b0066da5f591afa3a79017d860", "score": "0.48814595", "text": "draw(canvas, items = this.getActors(), overlays = this.getOverlays()) {\n //Make sure it draws the current scene\n // Grab the Canvas and Drawing Context\n var ctx = canvas.c\n for(let i in items){\n if(checkClip(items[i])) {\n ctx.save()\n // Create a circle\n ctx.beginPath()\n ctx.arc(items[i].pos.x(), items[i].pos.y(), items[i].clip.radius, 0, Math.PI * 2, false)\n // Clip to the current path\n ctx.clip()\n }\n canvas.drawImage(canvas.scene[items[i].obj], items[i].pos.x(), items[i].pos.y(), ALIGN.CENTER.MIDDLE, items[i].pos.rotation())\n //TODO: This is players specific, add something more appropriate to distinguish\n $(`#${items[i].obj}`).css({\n left: items[i].pos.x()-30, \n top: items[i].pos.y()+30\n })\n // Undo any clipping\n ctx.restore()\n }\n //ctx.restore();\n //Overlays are always on top\n for(let o in overlays){\n canvas.drawImage(overlays[o], window.innerWidth/2, window.innerHeight/2, ALIGN.CENTER.MIDDLE, 0);\n }\n }", "title": "" }, { "docid": "d782ec7c863aad91bb9954c823802be0", "score": "0.4867962", "text": "function Component(width, height, x, y) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n // to add \"moving\" to the obstacles we need to introduce speed\n this.speedX = 0;\n this.speedY = 0;\n // function to add this value to our current position\n this.update = function() {\n ctx.fillStyle = 'red';\n ctx.fillRect(this.x, this.y, this.width, this.height);\n };\n // function to draw the element in its new position\n this.newPos = function() {\n this.x += this.speedX;\n this.y += this.speedY;\n };\n // next 4 lines check the position of the obstacle\n this.left = function() {\n return this.x;\n };\n this.right = function() {\n return this.x + this.width;\n };\n this.top = function() {\n return this.y;\n };\n this.bottom = function() {\n return this.y + this.height;\n };\n\n // Then we need to create a function that checks if the position of the car is not the same as the obstacle´s one.\n this.crashWith = function(obstacle) {\n return !(car.y > obstacle.bottom() || car.x + 40 < obstacle.left() || car.x + 40 > obstacle.right());\n };\n}", "title": "" }, { "docid": "5aec76cb02a6f63f514dae3104c20bd8", "score": "0.4866045", "text": "function race() {\r\n\r\n if (raceFinished == false) {\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n for (let i = 0; i < cars.length; i++) {\r\n cars[i].drawCar();\r\n cars[i].move();\r\n }\r\n requestAnimationFrame(race);\r\n }\r\n}", "title": "" }, { "docid": "87a180ec6a2f7a91006d3562c8a82b0a", "score": "0.4848099", "text": "function drawAll() {\r\n //Drawing the tracks\r\n drawTracks();\r\n //Drawing the car\r\n greenCar.draw();\r\n blueCar.draw();\r\n}", "title": "" }, { "docid": "7c40cc2b3cfec97f294d9adfaa946fd2", "score": "0.4840556", "text": "play(){\n\n form.hide(); \n Player.getPlayersInfo();\n\n //GAME STARTS\n if(allPlayers !== undefined){\n image(track,0,-height*5,width,height*6);\n\n var index = 0;\n for (var plyr in allPlayers){\n index = index + 1;\n \n var x = allPlayers[plyr].positionX;\n cars[index-1].position.x = x;\n var y = height - allPlayers[plyr].positionY;\n cars[index-1].position.y = y;\n }\n\n this.handlePlayerControls();\n drawSprites();\n\n }\n\n\n }", "title": "" }, { "docid": "996bfbce1a8fa3c4ca4e5afaed518925", "score": "0.48345038", "text": "function Car(object) {\n this.color = object.color;\n this.wheels = object.wheels;\n this.convertible = object.convertible;\n this.engine = object.engine;\n this.startEngine = function () {\n return `Zoom Zoooom, engine is running!`;\n }\n}", "title": "" }, { "docid": "e37b14964db96fc9e24cb708514bd155", "score": "0.48335803", "text": "function addCar() {\n //BODY\n var carGroup = new THREE.Group();\n\n var carBodyMat = self.TerminUtils.createTextureReflectiveMaterial('../libs/terminalia/assets/textures/car_body.png', self.reflectionMap, .5);\n var carBody = self.TerminUtils.loadObjModel(\"CarBody\", '../libs/terminalia/assets/models/obj/carbody.obj', carBodyMat);\n carGroup.add(carBody);\n\n //MECHANICAL\n var carMechanicalMat = self.TerminUtils.createTextureReflectiveMaterial('../libs/terminalia/assets/textures/car_mechanical.png', self.reflectionMap, .5);\n var carMechanical = self.TerminUtils.loadObjModel(\"CarMechanical\", '../libs/terminalia/assets/models/obj/carmechanical.obj', carMechanicalMat);\n carGroup.add(carMechanical);\n\n //WHEELS\n var carWheelsMat = self.TerminUtils.createTextureMaterial('../libs/terminalia/assets/textures/car_wheels.jpg');\n var carWheels = self.TerminUtils.loadObjModel(\"CarWheels\", '../libs/terminalia/assets/models/obj/carwheels.obj', carWheelsMat);\n carGroup.add(carWheels);\n\n //TYRES\n var carTyresMat = new THREE.MeshLambertMaterial( { color: 0xcbcfd6, envMap: self.reflectionMap, combine: THREE.MixOperation, reflectivity: 1.0} );\n var carTyres = self.TerminUtils.loadObjModel(\"CarWheels\", '../libs/terminalia/assets/models/obj/cartyres.obj', carTyresMat);\n carGroup.add(carTyres);\n\n //ADD SHADOW MAP\n var shadowMap = self.TerminUtils.createTexture(\"../libs/terminalia/assets/textures/car_shadow_bake.png\");\n var shadowMapMaterial = new THREE.MeshBasicMaterial({map: shadowMap, color: 0xffffff});\n shadowMapMaterial.transparent = true;\n shadowMapMaterial.opacity = 0.7;\n var plane = self.TerminUtils.loadObjModel(\"ShadowPlane\", '../libs/terminalia/assets/models/obj/ShadowPlane.obj', shadowMapMaterial);\n carGroup.add(plane);\n\n self.scene.add(carGroup);\n }", "title": "" }, { "docid": "1a14daf48402b7153783ab18627607e8", "score": "0.4833367", "text": "function displayCar(car) {\r\n // TODO: Your code here\r\n }", "title": "" }, { "docid": "8611977655c9e9a21cf6bf689cac525c", "score": "0.48162463", "text": "render(worldTime, player) {\n this.doDayNight(player, worldTime)\n this.renderer.render(this.scene, this.camera)\n this.controls.update()\n }", "title": "" }, { "docid": "e4d1a28f5459ac088a8e9ad64b09b13a", "score": "0.4815021", "text": "function draw() {\n if (active) {\n //draw active spots, that were visited by the player\n drawActiveSpots();\n //lerp player sprite towards player position\n px = (px + currentLvl.playerX) * 0.5;\n py = (py + currentLvl.playerY) * 0.5;\n drawPlayer(currentLvl);\n //check for a win, else swap player sprite every 30 frames\n if (win && counter >= 30) {\n active = false;\n } else if (counter >= 30) {\n counter = 0;\n swap = !swap;\n }\n counter++;\n } else if (win) {\n drawWin();\n }\n}", "title": "" }, { "docid": "c22b95a0ff02e339c9b128cd7acedda0", "score": "0.48116073", "text": "function carHit() {\r\n playerCar.rotationSpeed = 13;\r\n graduallyDecreaseSpeed();\r\n}", "title": "" }, { "docid": "29c6918cd18b1b083f2d6dc576e2713d", "score": "0.48112246", "text": "addMyCar(self, playerInfo) {\r\n console.log(\"add my CAr\");\r\n console.log(playerInfo);\r\n self.mycar = self.physics.add.image(playerInfo.x, playerInfo.y, playerInfo.texture).setOrigin(0, 0);\r\n\r\n\r\n \r\n\r\n\r\n }", "title": "" }, { "docid": "40c8de7ea85dc6fed3e2895d622cdd7d", "score": "0.4802048", "text": "function draw(){\n\n if (players.length === 3 ){\n setTimeout(function(){alert(\"Game Over! \"+ \"Your score was: \" + player.score)},90000); //game ends after 90 seconds\n \n waitScreen.style.display = \"none\"; //remove the wait screen\n gameScreen.style.display = \"flex\"; //now display the gameScreen\n \n ScoreBoard.innerHTML=\"SCORE: \" + player.score; \n\n ctx.clearRect(0,0,canvas.width,canvas.height); //clear the canvas every frame \n\n let attacker;\n //draw the player attacks on the canvas\n players.forEach(client => {\n client.draw(ctx)\n if (client.attack === true){\n attacker = client;\n attacks[0].draw(ctx);\n }\n }); \n \n let carCrash;\n //check if a player has crashed\n players.forEach(client=> {\n carCrash = collision(client,attacks[0]);\n if (carCrash && client != attacker){\n client.crash = true;\n client.draw(ctx); //player's car dissapears.\n if(client === player){\n setTimeout(function(){alert(\"Game Over!\" + \"Your score was: \" + player.score)},1000); //player's game is over\n }\n } \n })\n\n /*NOTE TO READER: I am not using a SetInterval function here as there are multiple functionalities and cases to be handled. \n We want to avoid any time errors/bugs. \n For example, it is important to have a counter as we want to make sure score is only increased once during a collision, when counter = 448.\n Using a setinterval along with the counter will increase code complexity unneccesarily*/\n\n if (counter >100 && counter < 500){\n counter++;\n let currentPoint = points[index]; //a new fuel point position for every point in the array\n currentPoint.draw(ctx); //draw the fuel\n\n //check if any player has collected the fuel\n let collided = false;\n players.forEach( player => {\n collided = collision(player,currentPoint);\n if (collided){\n currentPoint.used = true; \n currentPoint.draw(ctx);\n player.score++}\n })\n if (counter === 448) {\n collided = false; //reset collision state\n counter = 0;\n index++;\n }\n }\n\n counter++; }\n window.requestAnimationFrame(draw); \n }", "title": "" }, { "docid": "f37d24bc4982cc0a1fefaebbcf75b8a9", "score": "0.47989786", "text": "function renderPlayer() {\n player.render();\n }", "title": "" }, { "docid": "769eba652ce40478a1e7600227885377", "score": "0.47986948", "text": "function draw(player) {\n let deck = currentGame.deck;\n // falls die Karten rechts ausgehen, wird die oberste Karte behalten udn der rest wird zum neuen Deck \n if (deck.length === 0) {\n let cards = currentGame.currentPlay.splice(0, currentGame.currentPlay.length - 1);\n cards.forEach(function (card) { deck.push(card); });\n renderDeck(deck, true);\n }\n player.hand.push(drawRandomCard(deck));\n // neue wiedergabe\n renderPlayerHand(player);\n renderDeck(deck, true);\n}", "title": "" }, { "docid": "b17eb8812188709de0494d4c65c8ef2e", "score": "0.4796654", "text": "function Car(game, key, x, y, p, termPoint, xOrY, speed, toF){\n\t\n\t// Call to phaser.sprite(game, x, y, key, frame), new sprite\n\tPhaser.Sprite.call(this, game, x, y, key);\n\t\n\t// Additional properties to the car.\n\tthis.anchor.set(0.5);\n //this.scale.setTo(0.5, 0.5);\n game.physics.enable(this);\n \n this.points = p;\n if(speed > 0){\n this.increment = 1/speed;\n }\n this.i = 0;\n this.timerStopped = true;\n this.timer1 = null;\n this.tp = termPoint;\n this.xOrY = xOrY;\n this.toF = toF;\n //this.px = [0];\n //this.py = [0];\n}", "title": "" }, { "docid": "79752b7f2f788318051f3ebd2a884baa", "score": "0.47932357", "text": "function drawCar(){\n\n\n\t/* autoImage.style.top = 500;\n autoImage.style.left = 230;*/\n\t//canvas.body.appendChild(autoImage);\n\n\n // document.body.appendChild(autoImage);\n\n\t//canvasContext.drawImage(autoImage, autoX, autoY);\n}", "title": "" }, { "docid": "ce7d104d0d9d4fd464e235f281a95b96", "score": "0.4789584", "text": "function draw() {\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\t\n draw_grid()\n draw_manufacturer()\n draw_color_map()\n\tdraw_cars()\n}", "title": "" }, { "docid": "32f4e25dda01b8dc13ea473a3e2d4955", "score": "0.47755855", "text": "collisionDetection(){\n var halfWidth = 0.5*this.width;\n var halfHeight = 0.5*this.height;\n\n //Car coordinates\n var topLeft = {\n x:this.x - halfWidth+this.velocityX,\n y:this.y - halfHeight+this.velocityY\n }\n\n var topRight = {\n x:this.x + halfWidth+this.velocityX,\n y:this.y - halfHeight+this.velocityY\n }\n\n var bottomLeft = {\n x:this.x - halfWidth+this.velocityX,\n y:this.y + halfHeight+this.velocityY\n }\n\n var bottomRight = {\n x:this.x + halfWidth+this.velocityX,\n y:this.y + halfHeight+this.velocityY\n }\n\n var points = [topLeft, topRight, bottomLeft, bottomRight];\n // Check for in track\n var point;\n\n for(point of points){\n if (__SIMULATOR.outOfTrack(point.x, point.y)) {\n this.suicide();\n break;\n }\n }\n\n if (this.isAlive && this.ai && this.ai.framesAlive > 20 && this.distanceInLastFrame < 1) {\n this.suicide();\n console.log(\"[AI Trainer] Removing car that went too slow!\")\n }\n\n }", "title": "" }, { "docid": "810b962ad74f68173cfc0a7496f12ad8", "score": "0.47717997", "text": "function render() {\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n updatePosition();\n if (gameStartTime !== 0) updateTimer();\n \n drawModel(positionMatrix, 0); // draw track\n let s = mat4.fromTranslation(mat4.create(), carPosition);\n mat4.scale(s, s, [mustangScale, mustangScale, mustangScale]); // .04\n drawModel(s, 1); // draw car\n\n // Cleanup\n gl.bindVertexArray(null);\n window.requestAnimationFrame(render);\n}", "title": "" }, { "docid": "d786607524b850ad921cde36f1ca71b9", "score": "0.47700754", "text": "function drawPlayers(players, x, y, w, h) {\n /* clear drawing area */\n render.fillStyle = \"white\";\n render.fillRect(x, y, w, h);\n /* divide up for num players */\n const areaEach = w / players.length;\n let loc = 0;\n for(i in players) {\n const p = players[i];\n render.font = \"15px monospace\";\n render.textAlign = \"center\";\n render.fillStyle = getColorFromPlayerID(i);\n render.roundRect(loc + 5, y + 5, areaEach - 10, 45, 5).fill();\n render.fillStyle = \"white\";\n render.fillText(p.name, loc + areaEach/2, y + 22, areaEach - 20);\n render.font = \"16px monospace\";\n render.fillStyle = \"white\";\n render.fillText(p.wins + \"-\" + p.losses + \"-\" + p.ties + \" (\" + p.score.toFixed(2) + \")\", loc + areaEach/2, y + 43, areaEach - 20);\n render.textAlign = \"start\";\n loc += areaEach;\n }\n}", "title": "" }, { "docid": "262bc8ac8bf5bb0e40de5cae4b19f996", "score": "0.47649002", "text": "function drawPlayer() {\n fill(playerFill,playerHealth);\n ellipse(playerX,playerY,playerRadius*2);\n tint(255,playerHealth);\n image(playerImage, playerX-playerRadius, playerY-playerRadius, playerRadius*2,playerRadius*2);\n}", "title": "" }, { "docid": "cb6c552f47af24635d70983a776a71c9", "score": "0.47645518", "text": "function draw() {\n\tbackground(220);\n\tlet w = width;\n\tlet h = height;\n\n\tlet wBorder = w / 3;\n\tlet hBorder = h / 3;\n\n\t// horizontal border\n\tline(0, hBorder, w, hBorder);\n\tline(0, hBorder * 2, w, hBorder * 2);\n\n\t// vertical border\n\tline(wBorder, 0, wBorder, h);\n\tline(wBorder * 2, 0, wBorder * 2, h);\n\n\t// set line size (thickness)\n\tstrokeWeight(3);\n\n\t// draw X and O in board\n\tfor (let i = 0; i < board.length; i++) {\n\t\tfor (let j = 0; j < board[0].length; j++) {\n\t\t\tlet item = board[i][j];\n\t\t\tlet x = wBorder * (i + 1) - wBorder / 2;\n\t\t\tlet y = hBorder * (j + 1) - hBorder / 2;\n\n\t\t\t// draw X in board\n\t\t\tif (item == players[0]) {\n\t\t\t\tlet xr = wBorder / 4;\n\n\t\t\t\tline(x, y, x - xr, y - xr);\n\t\t\t\tline(x, y, x + xr, y - xr);\n\t\t\t\tline(x, y, x + xr, y + xr);\n\t\t\t\tline(x, y, x - xr, y + xr);\n\t\t\t}\n\n\t\t\t// draw O in board\n\t\t\telse if (item == players[1]) {\n\t\t\t\tlet r = wBorder / 1.75;\n\t\t\t\tnoFill();\n\t\t\t\tellipse(x, y, r);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet winner = checkWinner();\n\n\tif (winner != null) {\n\t\tnoLoop();\n\n\t\tlet winnerP = createP();\n\n\t\tif (winner == \"tie\") {\n\t\t\twinnerP.html(\"Tie! No one wins.\");\n\t\t} else {\n\t\t\twinnerP.html(\"Winner is: \" + winner);\n\t\t}\n\t} else {\n\t\t// nextTurn();\n\t}\n}", "title": "" }, { "docid": "6116e7326b491e96dfad03902bb2260c", "score": "0.47612482", "text": "function Car(dSkaicius, spalva, greitis) {\n this.numberOfDoors = dSkaicius;\n this.color = spalva;\n this.maxSpeed = greitis;\n}", "title": "" }, { "docid": "2d3789c85321d22a99f1799e1864306f", "score": "0.47500023", "text": "function draw() { \n\tctx.clearRect(0,0,canvas.width, canvas.height); \n\t\n\tdrawEdges(); \n\tdrawPickups(); \n\tcheckKeys(); \t\n\tplayer.update(); \n\n\tcheckCollisions(); \n\t\n\tplayer.render(ctx); \n\n}", "title": "" }, { "docid": "fbcbc50fe037f663028a40be827ec609", "score": "0.4748592", "text": "function drawPlayerMap(data) {\r\n if (data.columns) {\r\n delete data.columns;\r\n }\r\n const radius = Math.min(width, height) / 2;\r\n const pie = d3\r\n .pie()\r\n .sort(null)\r\n .value(d => {\r\n return d.Count;\r\n });\r\n\r\n const arc = d3\r\n .arc()\r\n .innerRadius(radius * 0.8)\r\n .outerRadius(radius * 0.5);\r\n\r\n const outerArc = d3\r\n .arc()\r\n .outerRadius(radius * 0.9)\r\n .innerRadius(radius * 0.9);\r\n\r\n svg.attr('transform', 'translate(' + width * 0.9 + ',' + height * 0.85 + ')');\r\n\r\n const path = svg\r\n .selectAll('path')\r\n .data(pie(data))\r\n .enter()\r\n .append('path')\r\n .attr('d', arc)\r\n .attr('fill', (d, i) => colorPicker(i))\r\n .on('mousemove', d => {\r\n showTooltip(d);\r\n })\r\n .on('mouseleave', d => {\r\n tooltip.style('visibility', 'hidden');\r\n d3.select('#imageid').remove();\r\n d3.select('#circleid').remove();\r\n })\r\n .on('click', d => {\r\n drawPlayerDetailGraph(d);\r\n });\r\n\r\n path\r\n .transition()\r\n .duration(1000)\r\n .attrTween('d', function(d) {\r\n var interpolate = d3.interpolate({ startAngle: 0, endAngle: 0 }, d);\r\n return function(t) {\r\n return arc(interpolate(t));\r\n };\r\n });\r\n\r\n const polyline = svg\r\n .select('.lines')\r\n .selectAll('polyline')\r\n .data(pie(data))\r\n .enter()\r\n .append('polyline')\r\n .attr('points', function(d) {\r\n const pos = outerArc.centroid(d);\r\n pos[0] = radius * 0.95 * (midAngle(d) < Math.PI ? 1 : -1);\r\n return [arc.centroid(d), outerArc.centroid(d), pos];\r\n });\r\n\r\n const label = svg\r\n .select('.labels')\r\n .selectAll('text')\r\n .data(pie(data))\r\n .enter()\r\n .append('text')\r\n .attr('dy', '.35em')\r\n .html(function(d) {\r\n return d.data.Player;\r\n })\r\n .attr('transform', function(d) {\r\n const pos = outerArc.centroid(d);\r\n pos[0] = radius * 0.95 * (midAngle(d) < Math.PI ? 1 : -1);\r\n return 'translate(' + pos + ')';\r\n })\r\n .style('text-anchor', function(d) {\r\n return midAngle(d) < Math.PI ? 'start' : 'end';\r\n });\r\n\r\n svg.append('g').attr('class', 'slices');\r\n const text = svg\r\n .select('.slices')\r\n .selectAll('text')\r\n .data(pie(data))\r\n .enter()\r\n .append('text')\r\n .attr('transform', function(d) {\r\n return 'translate(' + arc.centroid(d) + ')';\r\n })\r\n .attr('dy', '.4em')\r\n .attr('text-anchor', 'middle')\r\n .style('fill', 'black')\r\n .style('font-size', '20px')\r\n .text(function(d) {\r\n return d.data.Count;\r\n });\r\n}", "title": "" }, { "docid": "a5786174afe7bf77300d76febff8e489", "score": "0.47473285", "text": "draw(player, ai){\n\n // set a color\n this.ctx.fillStyle = \"#000\"; \n // draws the black board\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n\n //loop to go through array to draw objects on screen\n for(let i = 0; i < this.objects.length; ++i){\n this.objects[i].draw(this.ctx);\n }\n\n // draw the user score to the left\n this.drawScore(player.score, this.canvas.width/4, this.canvas.height/5);\n \n // draw the COM score to the right\n this.drawScore(ai.score, 3 * this.canvas.width/4, this.canvas.height/5);\n\n }", "title": "" }, { "docid": "a54869b9943361874b63930853c60c6c", "score": "0.4733867", "text": "function drawCylinder() {\n setMV();\n Cylinder.draw();\n}", "title": "" }, { "docid": "37689d30e4e1a7fa43473a8933a87dce", "score": "0.4732935", "text": "function drawScreen()\n{\n\tctx.clearRect(0,0, canvas.width, canvas.height); //Clear the canvas\n\tdrawLayer(GROUND_LAYER); // Draw ground layer\n\tdrawLayer(MASK_LAYER); // Draw mask layer\n\tdrawLayer(MASK_LAYER_TWO); // Draw mask layer 2\n\t//Draw player and other objects here\n\tdrawLayer(FRINGE_LAYER); // Draw fringe layer\n\tdrawLayer(FRINGE_LAYER_TWO); // Draw fringe layer 2\n}", "title": "" }, { "docid": "3e2c17124ac5aca8884ec6e8e14e0bda", "score": "0.47322446", "text": "function vehicle( vehicleType ){\n// properties and defaults\n this.vehicleType = vehicleType || 'car',\n this.model = 'default',\n this.license = '00000-000'\n }", "title": "" }, { "docid": "ed23b84638ebec245c34dc02a7fb183f", "score": "0.47146392", "text": "function drawCarBody(xc, yc) {\n\t\t\tctx.save();\n\t\t\tctx.translate(xc, yc);\n\t\t\tctx.rotate(-S.angle + !!expl*Math.PI);\n\t\t\tctx.drawImage(img, -iw/2, -ih*!expl, iw, ih);\n\t\t\tctx.restore();\n\t\t}", "title": "" }, { "docid": "0ae48955c0df7dabbed8ae1bb82a0549", "score": "0.47104844", "text": "function Player (color) {\n\tthis.color = color;\n\tthis.x = 10;\n\tthis.y = 20;\n\tthis.radius = 10;\n\tthis.canFall = true;\n\tthis.playerSpeed = 5;\n\tthis.draw = function() {\n\t\tctx.fillStyle = this.color;\n\t\tctx.beginPath();\n\t\tctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI, false);\n\t\tctx.fillStyle = color;\n\t\tctx.fill();\n\t\tctx.lineWidth = 2;\n\t\tctx.strokeStyle = '#003300';\n\t\tctx.stroke();\n\t};\n}", "title": "" }, { "docid": "19e048cbf616768c16a55801486480e9", "score": "0.47104695", "text": "function gameDraw(){\r\n\t\tctx.save();\t //Because transformations are used to follow the player around, the context is saved and restored through each cycle so\r\n\t\t\t\t //that all transformations can be performed from the zero position\r\n\t\tctx.clearRect(0, 0, 800, 600);\r\n\t\tmoveFrame(); //This function translates the visible window to follow the player\r\n\t\t//Draw all game objects (right now just the user's character)\r\n\t\tfor (var i = 0; i < gameObjects.length; i++)\r\n\t\t{\r\n\t\t\tgameObjects[i].draw();\r\n\t\t}\r\n\t\t//Draw everyone else's characters\r\n\t\tfor (var i = 0; i < otherPlayers.length; i++)\r\n\t\t{\r\n\t\t\tif (otherPlayers[i]){\r\n\t\t\t\totherPlayers[i].draw();\r\n\t\t\t}\r\n\t\t}\r\n\t\tctx.globalCompositeOperation = 'destination-over';\r\n\t\t//Draw the blocks that make up the environment\r\n\t\tif (envBlocks){\r\n\t\t\tenvBlocks.draw();\r\n\t\t}\r\n\t\tctx.restore();\r\n\t\t//If the chat interface is in use then draw it\r\n\t\tif (chatInterface){\r\n\t\t\tchatInterface.draw();\r\n\t\t}\r\n\t\tif (characterSettings){\r\n\t\t\tcharacterSettings.draw();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "db7ec6d1f109edec53becb675706e0fb", "score": "0.47001326", "text": "function drawRow(model) {\n const carTR = getCarTR(model);\n if (!carTR) return;\n CAR_FORM.carsData.appendChild(carTR);\n}", "title": "" }, { "docid": "cde6b2326ad198a7a1068b0d22c36d2d", "score": "0.46932077", "text": "function vehicle(vehicleType) {\n\t\t// Propiedades y valores por defecto\n\t\tthis.vehicleType = vehicleType || 'car';\n\t\tthis.model = 'default';\n\t\tthis.license = '00000-000';\n\t}", "title": "" }, { "docid": "06084f189bb1102490bc6da6ac57ffb7", "score": "0.468002", "text": "function drawMyplayer(x, y) {\n // save the context\n ctx.save();\n\n // translate the coordinate system, draw relative to it\n ctx.translate(x, y);\n\n // (0, 0) is the top left corner of the player.\n ctx.strokeRect(0, 0, player.sizex, player.sizey);\n\n // eyes\n ctx.fillRect(2, 2, 1, 1);\n ctx.fillRect(6.5, 2, 1, 1);\n\n // nose\n ctx.strokeRect(4.5, 4, 1, 4);\n\n // mouth\n ctx.strokeRect(3.5, 8.4, 3.0, 1.0);\n\n // teeth\n ctx.fillRect(3.8, 8.4, 1, 1);\n ctx.fillRect(5.2, 8.4, 1, 1);\n\n // restore the context\n ctx.restore();\n}", "title": "" }, { "docid": "039b1e6e8a80daa24f0503efb3707814", "score": "0.46791056", "text": "function init() {\n world = new b2World(\n new b2Vec2(0, GRAVITY) //gravity\n , true //allow sleep\n );\n\n if(currentMember < populationSize){\n car = new Car();\n car.generateNewCar();\n } else{\n car = new Car();\n car.setChromosome(carsArray[currentMember%populationSize].getChromosome());\n }\n\n var xvert = car.getVertexXArray();\n var yvert = car.getVertexYArray();\n var wheelpos = car.getWheelPosArray();\n var wheelrad = car.getWheelRadiusArray();\n var done = false;\n\n do{\n try{\n car.setCarDef(drawCar(world, WORLD_SCALE, xvert[0], yvert[0], xvert[1], yvert[1], xvert[2], yvert[2], xvert[3], yvert[3], xvert[4], yvert[4], xvert[5], yvert[5], xvert[6], yvert[6], xvert[7], yvert[7], wheelpos[0], wheelpos[1], wheelrad[0], wheelrad[1]));\n done = true;\n } catch(err){\n car.generateNewCar();\n }\n } while(!done);\n\n connecttile();\n\n //setup debug draw\n var debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(document.getElementById(\"canvas\").getContext(\"2d\"));\n debugDraw.SetDrawScale(DRAW_SCALE);\n debugDraw.SetFillAlpha(FILL_ALPHA);\n debugDraw.SetLineThickness(LINE_THICKNESS);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n world.SetDebugDraw(debugDraw);\n\n return world;\n\n}", "title": "" }, { "docid": "5bab24c049862ccfa70c725b040990f6", "score": "0.46776718", "text": "function draw() {\n drawBackground();\n\n // Powerups\n for (let i = 0; i < powerups.length; i++) {\n drawPowerUp(powerups[i]);\n }\n\n // Draw player\n drawSnake(player.snake);\n}", "title": "" }, { "docid": "c44e5eeee30782fb349842a85957a2c3", "score": "0.4677018", "text": "paintCanvas() {\n // Draw the tile map\n this.game.map.drawMap();\n\n // Draw dropped items\n this.game.map.drawItems();\n\n // Draw the NPCs\n this.game.map.drawNPCs();\n\n // Draw other players\n this.game.map.drawPlayers();\n\n // Draw the player\n this.game.map.drawPlayer();\n\n // Draw the mouse selection\n this.game.map.drawMouse();\n }", "title": "" }, { "docid": "3cb61649f4b1fac765da2e1354058190", "score": "0.4676837", "text": "function checkPlayer() {\n // Display current location in browser concole\n // console.log(player.x);\n // console.log(player.y);\n\n if (player.x == 18 || player.x == displayWidth - 18 \n || player.y == 18 || player.y == displayHeight - 18 \n || barrierX.isInside(player) || barrierY.isInside(player)) {\n\n // Disable player movement until the game starts again\n gameOver = true;\n\n var gameDisplay = document.getElementById(\"gameDisplay\");\n var ctx = gameDisplay.getContext(\"2d\");\n\n document.getElementById(\"gameDisplay\").style.WebkitFilter=\"grayscale(100%)\";\n ctx.font = \"20px Montserrat\";\n ctx.fillStyle = \"black\";\n ctx.fillText(\"Game Over!\\nYou Reached \" + playerScore + \" points\", 20, 40);\n\n player.speedX = 0;\n player.speedY = 0;\n\n barrierX.speedX = 0;\n barrierY.speedY = 0;\n }\n}", "title": "" }, { "docid": "0cbd805c35fbdb492efe8ad29745bbd9", "score": "0.4658476", "text": "initPlayer(map) {\n let $parent = document.getElementById(\"players\");\n let $newPlayer = document.createElement(\"div\");\n\n $newPlayer.setAttribute(\"class\", \"players__player\");\n $newPlayer.setAttribute(\"id\", `players__player-${this.name}`);\n \n $parent.appendChild($newPlayer);\n\n this._$player = `players__player-${this.name}`;\n if(this.displayName === \"Craaftx\") {\n this.character.spriteList[\"walk\"][2].drawSprite(this.$player);\n } else {\n this.character.spriteList[\"walk\"][2].drawSprite(this.$player);\n }\n\n let xAxis, yAxis;\n do {\n xAxis = map.getRandomRow();\n yAxis = map.getRandomCol();\n } while (!map.isReachable(xAxis, yAxis) || map.isNearPlayers(xAxis, yAxis))\n this.updatePlayerPosition(xAxis, yAxis);\n this.initLifePoints();\n }", "title": "" }, { "docid": "75a48d14965a80503027f8b274062dc0", "score": "0.46544605", "text": "function Elmntcreation() {\n // make main car icon ih feild\n car = document.createElement(\"div\");\n car.setAttribute(\"class\", \"car\");\n gameArea.appendChild(car);\n // make road lines\n for (let x = 0; x < 8; x++) {\n let line = document.createElement(\"div\");\n line.setAttribute(\"class\", \"roadLine\");\n line.y = x * 100;\n line.style.top = line.y + \"px\";\n gameArea.appendChild(line);\n }\n // make enemey car line in feild\n for (let x = 0; x < 4; x++) {\n let enemy = document.createElement(\"div\");\n enemy.setAttribute(\"class\", \"enemyCar\");\n enemy.y = x * 600 * -1;\n enemy.style.top = enemy.y + \"px\";\n let randomImg = Math.trunc(Math.random() * 5 + 1);\n enemy.style.backgroundImage = `url(img/car${randomImg}.png)`;\n let randomLeft = Math.trunc(Math.random() * 290);\n enemy.style.left = randomLeft + \"px\";\n gameArea.appendChild(enemy);\n }\n // option maker\n // setTimeout(optional, 1000);\n if (player.start) {\n bg.play();\n setTimeout(() => {\n if (player.start) bg.play();\n }, 44000);\n setTimeout(() => {\n if (player.start) bg.play();\n }, 89000);\n setTimeout(() => {\n if (player.start) bg.play();\n }, 135000);\n setTimeout(() => {\n if (player.start) bg.play();\n }, 180000);\n }\n}", "title": "" }, { "docid": "b68d94a98dfbf74c66c1278c10e94ba7", "score": "0.46485153", "text": "function render() {\n ctx.fillStyle = '#fff';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n // Render the player\n renderEntity(player);\n}", "title": "" }, { "docid": "bf6169da5c161df31736b04214d3b6cc", "score": "0.464724", "text": "function Car(makeModel,year,isElectric) {\n\tthis.makeModel = makeModel;\n\tthis.year = year;\n\tthis.isElectric = isElectric;\n\tthis.drive = function() {console.log(\"VROOM VROOM\");};\n\tconsole.log(\"CAR INITIALIZATION COMPLETE!\")\t\n}", "title": "" }, { "docid": "fbbe118893d6ed464f9ee1642d5e2794", "score": "0.46465614", "text": "function Vehicle(x,y,v,w) {\n this.angularVelocity = 0;\n this.angle = random(2*PI);\n this.position = createVector(x,y);\n this.speed = v;\n this.velocity = createVector(this.speed*cos(this.angle),this.speed*sin(this.angle));\n this.curvature = w;\n this.vehicleSize = 6; // scales up the vehicle size (in visualizer)\n\n // Integrate acceleration\n this.update = function() {\n this.angle += this.angularVelocity;\n this.angle %= (2*PI);\n this.velocity = createVector(this.speed*cos(this.angle),this.speed*sin(this.angle));\n this.position.add(this.velocity);\n this.angularVelocity = 0; // Reset angularVelocity to 0 each cycle\n }\n\n this.steer = function(target,k1,synchronyParameter) {\n var positionError = p5.Vector.sub(this.position,target); // A vector pointing from the location to the target\n this.angularVelocity = this.curvature*(1 + k1*p5.Vector.dot(positionError,this.velocity));\n this.angularVelocity += synchronyParameter;\n }\n \n this.display = function() {\n // Draw a triangle rotated in the direction of velocity\n fill(\"red\");\n stroke(176,23,31);\n strokeWeight(1);\n \n push();\n translate(this.position.x,this.position.y);\n rotate(this.angle + PI/2);\n beginShape();\n vertex(0, -this.vehicleSize*2);\n vertex(-this.vehicleSize, this.vehicleSize*2);\n vertex(this.vehicleSize, this.vehicleSize*2);\n endShape(CLOSE);\n pop();\n }\n \n}", "title": "" }, { "docid": "af25beb5647157c9d9a5ab2777619036", "score": "0.46432295", "text": "canSpawnVehicle(player) {\n return this.decider_.decide(player, {\n requirements: [\n requirements.kMainWorldRequirement,\n requirements.kNoDeathmatchRequirement,\n requirements.kNoMinigameRequirement,\n requirements.kOutsideRequirement,\n ],\n throttles: [ throttles.kSpawnVehicleThrottle ],\n });\n }", "title": "" }, { "docid": "e525f0fc73b7377f0a894114b91cc5cf", "score": "0.4641253", "text": "function updateHighway() {\n CTX.clearRect(0, 0 , GAME_WIDTH, GAME_HEIGHT);\n \n drawRoadObject(TheRoad);\n \n if(DividerTimeCounter == DIVIDER_NEW_TIME) {\n DividerTimeCounter = 0;\n RoadObjectList.push(generateRoadObject(0));\n RoadObjectList.push(generateRoadObject(1));\n }\n DividerTimeCounter++;\n \n if(CarTimeCounter == CAR_NEW_TIME) {\n CarTimeCounter = 0;\n var randomLane = Math.floor(Math.random() * 3) + 2;\n RoadObjectList.push(generateRoadObject(randomLane));\n }\n CarTimeCounter++;\n \n for(var i = 0; i < RoadObjectList.length; i++) {\n updateRoadObject(RoadObjectList[i]);\n }\n movePlayerCar();\n drawPlayerCar();\n \n checkCollission();\n clearRoadObjectList();\n \n ScoreCounter++;\n if(ScoreCounter == SCORE_HIT) {\n ScoreCounter = 0;\n Score++;\n $('#scoreValue').html(Score.toString());\n }\n \n if(Score > HighScore) {\n HighScore = Score;\n $('#highScoreValue').html(HighScore.toString());\n }\n}", "title": "" }, { "docid": "42c88437fa3fa4d6ab261aac69a6dfd8", "score": "0.46404645", "text": "function drawRoute2(map, car, hotels){\n\n\t//setAllMap(null);\n\tvar directionsDisplay = new google.maps.DirectionsRenderer();\n\tvar directionsService = new google.maps.DirectionsService();\n\tdirectionsDisplay.setMap(map);\n\tvar waypts = [];\n\n\tif(hotels.length>=2) {\n\t\t_.forEach(hotels, function(hot){\n\t\t\tvar h=hot.hotelFare.results;\n\t\t\tvar myLatlng = new google.maps.LatLng(h.location.latitude, h.location.longitude);\n\t\t\twaypts.push({\n \t\tlocation:myLatlng,\n \t\tstopover:true\n \t});\n\t\t});\n\t}\n\tvar myLatlng2 = new google.maps.LatLng(car.location.latitude, car.location.longitude);\n\tvar req2 = {\n \torigin: myLatlng2,\n \tdestination: myLatlng2,\n \twaypoints : waypts,\n \toptimizeWaypoints : true,\n \ttravelMode: google.maps.TravelMode.DRIVING\n \t};\n\n\tdirectionsService.route(req2, function(response, status) {\n\t\tif (status == google.maps.DirectionsStatus.OK) {\n\t\t\tdirectionsDisplay.setDirections(response);\n\t\t}\n\t\telse{\n\t\t\twindow.alert('Directions request failed due to' + status);\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "2492a9635e4ffffd90bce4d96a213ef4", "score": "0.46332654", "text": "function draw() {\n drawMap();\n drawBullets();\n drawMonsters();\n\n curPlayer.draw();\n drawOtherCharacters();\n //drawFogOfWar(); //Laggy??? -- TODO need to check into this to be sure\n}", "title": "" }, { "docid": "a26086ae661d6363fbef38313b14980d", "score": "0.4631742", "text": "async draw(addedPiece, player) {\n return this.makeCoin(addedPiece.x, addedPiece.y, player.color);\n }", "title": "" } ]
a494c6587cc11ce2650840710178a9dd
CONCATENATED MODULE: ./node_modules/asyncvalidator/es/validator/number.js Validates a number.
[ { "docid": "a56a2605a189c9da5ad6d046edf4c9d7", "score": "0.68879235", "text": "function number(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(isEmptyValue(value)&&!rule.required){return callback();}es_rule.required(rule,value,source,errors,options);if(value!==undefined){es_rule.type(rule,value,source,errors,options);es_rule.range(rule,value,source,errors,options);}}callback(errors);}", "title": "" } ]
[ { "docid": "246ec905cca95b31a30a7e48142f88df", "score": "0.7901612", "text": "function isValidNumber() {\n\tvar _normalizeArguments = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getNumberType__[\"b\" /* normalizeArguments */])(arguments),\n\t input = _normalizeArguments.input,\n\t options = _normalizeArguments.options,\n\t metadata = _normalizeArguments.metadata;\n\n\treturn __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__validate___[\"a\" /* default */])(input, options, metadata);\n}", "title": "" }, { "docid": "462d86733b92dd9cc9105ba502679b8e", "score": "0.7538621", "text": "function isValidNumber() {\n var _normalizeArguments = Object(_getNumberType__WEBPACK_IMPORTED_MODULE_1__[\"normalizeArguments\"])(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return Object(_validate___WEBPACK_IMPORTED_MODULE_0__[\"default\"])(input, options, metadata);\n}", "title": "" }, { "docid": "8b0c2680429766ed8292a233e77ea704", "score": "0.7251956", "text": "validateNumber (value/*, definition*/) {\n\t\tif (typeof value !== 'number') {\n\t\t\treturn 'must be a number';\n\t\t}\n\t}", "title": "" }, { "docid": "127246a6b6a656e3596d88fed3dcfc4b", "score": "0.69574416", "text": "function validateNumber(number,validator){\n\tif(parseFloat(number)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}//validateNumber\t", "title": "" }, { "docid": "adec075bb42866245970ee61915c2a4b", "score": "0.6918614", "text": "validateNumber(number){\r\n console.log(number);\r\n const numberRegX = /^\\d+$/;\r\n if(numberRegX.test(number)){\r\n this.cleanedData = number;\r\n return true;\r\n };\r\n this.error = \"invalid number\";\r\n return false;\r\n }", "title": "" }, { "docid": "7c3d03fa2abdecd9b1eceace3f7b18fc", "score": "0.6900975", "text": "function publicNumberValidation(value){\r\n\t\tif(value){\r\n\t\t\tif(regexTest(value, NUMBERS_PATTERN) === true){\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tif(label){\r\n\t\t\t\t\treturn label + LABEL_NUMBERS_TEMPLATE;\r\n\t\t\t\t}else if(DEFAULT_TEMPLATE) {\r\n\t\t\t\t\treturn NUMBERS_TEMPLATE;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n }", "title": "" }, { "docid": "c68ece8d19fadfe4086e3cb5239b4bef", "score": "0.68764365", "text": "function is_valid_number()\n{\n\treturn isValidNumber.apply(this, arguments)\n}", "title": "" }, { "docid": "f730a5745dc9182c28ca002481e2d58f", "score": "0.68554807", "text": "function is_valid_number()\r\n{\r\n\treturn isValidNumber.apply(this, arguments)\r\n}", "title": "" }, { "docid": "ccd0c5a48e2c3e8931c57e06f553a730", "score": "0.6747585", "text": "function numberValidation(value){\r\n\tif(value){\r\n\t\tif(regexTest(value, NUMBERS_PATTERN) === true){\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tif(label){\r\n\t\t\t\treturn label + LABEL_NUMBERS_TEMPLATE;\r\n\t\t\t}else if(DEFAULT_TEMPLATE) {\r\n\t\t\t\treturn NUMBERS_TEMPLATE;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "cfdf17b0c46c3a289df40260c11ac5ca", "score": "0.6637381", "text": "function isValidNumber( value ) {\r\n\t\treturn !isNaN( value );\r\n\t}", "title": "" }, { "docid": "4360a51f1ae6f3fa682cdfd2d34acde0", "score": "0.6597707", "text": "verifyNumber(value) {\n var numberRex = new RegExp(\"^[0-9]+$\");\n if (numberRex.test(value)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "88decdcf243d2fc7925c47b7de84fa42", "score": "0.65855217", "text": "function numberValidation(value){\n let regex = /^[0-9]+$/;\n return (regex.test(value.trim()));\n}", "title": "" }, { "docid": "1a617ed1ca9ab435f722c9466c64f6f5", "score": "0.65553236", "text": "function validateNumberInput(input){\n\tif(isNaN(+input))\n\t{\n\t\tgenerateError(\"Please enter a number!\");\n\t\treturn false;\n\t}\n\tvar num=Number(input); //get an int value from text input\n\tif(num<0||num>200)\n\t{\n\t\tgenerateError(\"Please enter a number between 0-200!\");\n\t\treturn false;\n\t}\n\treturn num;\t\t\n\n}", "title": "" }, { "docid": "6f36b3552fef6d55d435814cbbfd7f56", "score": "0.65098554", "text": "function number(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n es_rule.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "6f36b3552fef6d55d435814cbbfd7f56", "score": "0.65098554", "text": "function number(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n es_rule.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "6f36b3552fef6d55d435814cbbfd7f56", "score": "0.65098554", "text": "function number(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n es_rule.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "6f36b3552fef6d55d435814cbbfd7f56", "score": "0.65098554", "text": "function number(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n es_rule.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "5021f4c1352d0a316eca28bec195ab0c", "score": "0.6508137", "text": "number_()\n\t\t{\n\t\t\treturn (typeof this.validator_.value === 'number');\n\t\t}", "title": "" }, { "docid": "e759a528e82a04b6074a09e13c8eb8e7", "score": "0.64789295", "text": "verifyNumber(value) {\n var numberRex = new RegExp(\"^[0-9]+$\");\n if (numberRex.test(value)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "e759a528e82a04b6074a09e13c8eb8e7", "score": "0.64789295", "text": "verifyNumber(value) {\n var numberRex = new RegExp(\"^[0-9]+$\");\n if (numberRex.test(value)) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "95c0c2af9a24669874fdd54b101334b4", "score": "0.6448749", "text": "function onlyNumberValidate(input) {\n\tfunction setInputFilter(textbox, inputFilter) {\n\t [\"input\", \"keydown\", \"keyup\", \"mousedown\", \"mouseup\", \"select\", \"contextmenu\", \"drop\"].forEach(function(event) {\n\t textbox.addEventListener(event, function() {\n\t if (inputFilter(this.value)) {\n\t this.oldValue = this.value;\n\t this.oldSelectionStart = this.selectionStart;\n\t this.oldSelectionEnd = this.selectionEnd;\n\t } else if (this.hasOwnProperty(\"oldValue\")) {\n\t this.value = this.oldValue;\n\t this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);\n\t } else {\n\t this.value = \"\";\n\t }\n\t });\n\t });\n\t}\n\t// Install input filters.\n\tsetInputFilter(input, function(value) {\n\t // return /^[\\d\\s]+$/.test(value); });\n return /^[\\d\\s]*$/.test(value); });\n}", "title": "" }, { "docid": "d1001bb03118f3e19438ffd0f0969cfe", "score": "0.64461106", "text": "numberSimpleVerify(fields, callback) {\n let rules = {\n number: 'required|string',\n country_id: 'numeric|digits_between:1,32'\n };\n\n this._verifyAndRun('verify/number-simple/', rules, fields, (cb) => {\n callback(cb);\n });\n }", "title": "" }, { "docid": "bfe52de7eecaaacf1139b16a69c47e98", "score": "0.64293116", "text": "function validateNumberInput(number) {\n\tvar validNumber = true;\n\tif (number < 0 || isNaN(number)) {\n\t\tvalidNumber = false;\n\t}\n\n\treturn validNumber;\n}", "title": "" }, { "docid": "664e4a7896b89f4bda834ae20da8cec5", "score": "0.64260143", "text": "isNumber(toCheck) {\n }", "title": "" }, { "docid": "40cbdf92e01b582af1eda3e7617b8a77", "score": "0.6409237", "text": "function validNumber(field_id, number) {\n var isValidNumber = isInt(number) && number >= 30 && number <= 500;\n //updateFieldBorder(field_id, isValidNumber);\n if (!isValidNumber) {\n showError(field_id, \"Please enter a valid integer from 30 to 500.\");\n }\n return (isValidNumber);\n}", "title": "" }, { "docid": "fe90d9b8e25954549a11b00bf2008f9c", "score": "0.6399812", "text": "function isValidNumber(number?: string) {\n const validation = {};\n if (number) {\n if (!isFormatValid(number)) {\n validation.error = INVALID_FORMAT_ERROR;\n }\n if (exceedsMaxLength(number)) {\n validation.warning = PERFORMANCE_WARNING;\n }\n }\n return validation;\n}", "title": "" }, { "docid": "b198554c70bced9863355f2008ae1ae9", "score": "0.6379762", "text": "function isValidNumber(input) {\r\n return typeof input === \"number\" && isFinite(input);\r\n }", "title": "" }, { "docid": "ff9c3b09f3c4776b254507cb82a44ce3", "score": "0.63401204", "text": "function isValidNumber ( input ) {\r\n\t\treturn typeof input === 'number' && isFinite( input );\r\n\t}", "title": "" }, { "docid": "de79d29ec99e4d380d36c8074b480644", "score": "0.63322747", "text": "function isValidNumber ( input ) {\n return typeof input === 'number' && isFinite( input );\n }", "title": "" }, { "docid": "752c795f29e370d4c9d8c8b525807ac7", "score": "0.6322692", "text": "function flatNumIsValid() {\n let flatRegEx = /[0-9]{1,3}/;\n return flatNum.value != \"\" && flatRegEx.test(flatNum.value);\n }", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "eebf33b48cfd5066ce476ac73fd38abc", "score": "0.631078", "text": "function isValidNumber ( input ) {\n\t\treturn typeof input === 'number' && isFinite( input );\n\t}", "title": "" }, { "docid": "c400daa7c685712ec2f952b7645448fd", "score": "0.6280975", "text": "validate(value) {\n if(!isNaN(parseInt(value))) { // if the incoming value is numbers\n throw new Error(\"Name cannot be numbers, seriously ?\")\n }\n\n }", "title": "" }, { "docid": "4051f7044c916821512d560091bb4b14", "score": "0.6245718", "text": "function checkNumber(value) {\n if (!isValueTypeNumber(value)) {\n throw new Error(`A numeric value was expected, got ${JSON.stringify(value)} instead`);\n }\n }", "title": "" }, { "docid": "03639396e13c604a55489e7471b9c67c", "score": "0.6243402", "text": "function validateNumber(val, legalMin, legalMax) {\n return (!isNaN(val) && val >= legalMin && val <= legalMax);\n}", "title": "" }, { "docid": "acee3b9a6d5f81e42c0c388e3e919fe0", "score": "0.6240392", "text": "function validateNumber(arg, value, options) {\n const min = options !== undefined && options.minValue !== undefined\n ? options.minValue\n : -Infinity;\n const max = options !== undefined && options.maxValue !== undefined\n ? options.maxValue\n : Infinity;\n if (!validateOptional(value, options)) {\n if (typeof value !== 'number' || isNaN(value)) {\n throw new Error(invalidArgumentMessage(arg, 'number'));\n }\n else if (value < min || value > max) {\n throw new Error(`${formatArgumentName(arg)} must be within [${min}, ${max}] inclusive, but was: ${value}`);\n }\n }\n}", "title": "" }, { "docid": "df4d693a53c50e5b25289d805762f543", "score": "0.6236061", "text": "function validnumber(param){\r\n\tnumber=param;\r\n\tvar isValid = !isNaN(parseFloat(number));\r\n return isValid || \"Please enter a number\";\r\n}", "title": "" }, { "docid": "b1bb37385299b20352ce1ad57e425622", "score": "0.62093216", "text": "validate(value){\n if(!validator.isMobilePhone(value))\n throw new Error(\"phone number is not valid\");\n }", "title": "" }, { "docid": "198f120ec986a1fe0eaf8fb22743071f", "score": "0.62054765", "text": "function validateNumeric(data) {\n debug.extend('validateNumeric')('Validating...');\n if (isNaN(data)) {\n debug.extend('validateNumeric')('Validation Error: ' + data + ' isNaN.');\n throw new CiborgError(null,\n 'Validation Error: ' + data + ' isNaN.',\n data + ' is not a number.',\n '400' // Bad Request\n );\n } else {\n debug.extend('validateNumeric')('Validation OK.');\n }\n }", "title": "" }, { "docid": "ecbdbd0e3a8cb98ad20454c5a3416914", "score": "0.6166136", "text": "validateFieldNumber() {\n let me = this,\n isValid = true;\n \n me.form.find(\"[DataType='Number']\").each(function () {\n var control = $(this);\n let value = control.val();\n \n if (!/^[0-9,.]*$/.test(value)) {\n isValid = false;\n control.addClass(\"notValidControl\");\n control.attr(\"title\", \"Please enter a number salary!!!\");\n alert(\"Please enter a number salary\");\n } else {\n control.removeClass(\"notValidControl\");\n }\n })\n\n return isValid;\n }", "title": "" }, { "docid": "2becc1f4fe455f87cde59fea18613748", "score": "0.61621314", "text": "function acceptsNumber(value: number) {\n // ...\n}", "title": "" }, { "docid": "4f0d6798ab543b8f56fac0ffa24c4989", "score": "0.61465585", "text": "function IsNumber(options, validationOptions) {\n if (options === void 0) { options = {}; }\n return Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"ValidateBy\"])({\n name: IS_NUMBER,\n constraints: [options],\n validator: {\n validate: function (value, args) { return isNumber(value, args.constraints[0]); },\n defaultMessage: Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"buildMessage\"])(function (eachPrefix) { return eachPrefix + \"$property must be a number conforming to the specified constraints\"; }, validationOptions)\n }\n }, validationOptions);\n}", "title": "" }, { "docid": "f1bb9e80b9b02baa508a1f7b1a84d5d6", "score": "0.61429", "text": "isNumber(number){\n let reg = new RegExp(/^\\d+(\\.\\d+)?$/);\n return reg.test(number);\n }", "title": "" }, { "docid": "d47a2419d836546b14878e096b4c8d1d", "score": "0.6138775", "text": "function assertNumber(n)\n { \n if(!isNumber(n))\n {\n alert(\"Se debe ingresar un número válido.\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "bf3336762302d475bbe93bdf9e1032cf", "score": "0.61378276", "text": "function validateNumber() {\n // Check to be sure that the number is less than one billion.\n if (preDecimalNumbersArray.length > 16) {\n return false;\n } else if (postDecimal.length > 2) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "428c47260cd683ba6368dc671d538077", "score": "0.6136235", "text": "function ValidarNumero(valor) {\n if (isNaN(valor)) {\n return false\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "cafec638c04687d54b26b812c8556c1a", "score": "0.61148304", "text": "function useNumberInput(props){if(props===void 0){props={};}var _props=props,_props$focusInputOnCh=_props.focusInputOnChange,focusInputOnChange=_props$focusInputOnCh===void 0?true:_props$focusInputOnCh,_props$clampValueOnBl=_props.clampValueOnBlur,clampValueOnBlur=_props$clampValueOnBl===void 0?true:_props$clampValueOnBl,_props$keepWithinRang=_props.keepWithinRange,keepWithinRange=_props$keepWithinRang===void 0?true:_props$keepWithinRang,_props$min=_props.min,min=_props$min===void 0?minSafeInteger:_props$min,_props$max=_props.max,max=_props$max===void 0?maxSafeInteger:_props$max,_props$step=_props.step,stepProp=_props$step===void 0?1:_props$step,isReadOnly=_props.isReadOnly,isDisabled=_props.isDisabled,isRequired=_props.isRequired,isInvalid=_props.isInvalid,_props$pattern=_props.pattern,pattern=_props$pattern===void 0?\"[0-9]*(.[0-9]+)?\":_props$pattern,_props$inputMode=_props.inputMode,inputMode=_props$inputMode===void 0?\"decimal\":_props$inputMode,allowMouseWheel=_props.allowMouseWheel,id=_props.id;_props.onChange;_props.precision;var name=_props.name,ariaDescBy=_props[\"aria-describedby\"],ariaLabel=_props[\"aria-label\"],ariaLabelledBy=_props[\"aria-labelledby\"],onFocusProp=_props.onFocus,onBlurProp=_props.onBlur,onInvalidProp=_props.onInvalid,getAriaValueTextProp=_props.getAriaValueText,isValidCharacterProp=_props.isValidCharacter,formatValue=_props.format,parseValue=_props.parse,htmlProps=_objectWithoutPropertiesLoose$9(_props,_excluded$1$3);var onFocus=useCallbackRef$1(onFocusProp);var onBlur=useCallbackRef$1(onBlurProp);var onInvalid=useCallbackRef$1(onInvalidProp);var isValidCharacter=useCallbackRef$1(isValidCharacterProp!=null?isValidCharacterProp:isFloatingPointNumericCharacter);var getAriaValueText=useCallbackRef$1(getAriaValueTextProp);/**\n\t\t\t * Leverage the `useCounter` hook since it provides\n\t\t\t * the functionality to `increment`, `decrement` and `update`\n\t\t\t * counter values\n\t\t\t */var counter=useCounter(props);var updateFn=counter.update,incrementFn=counter.increment,decrementFn=counter.decrement;/**\n\t\t\t * Keep track of the focused state of the input,\n\t\t\t * so user can this to change the styles of the\n\t\t\t * `spinners`, maybe :)\n\t\t\t */var _useBoolean=useBoolean(),isFocused=_useBoolean[0],setFocused=_useBoolean[1];var isInteractive=!(isReadOnly||isDisabled);var inputRef=react.exports.useRef(null);var inputSelectionRef=react.exports.useRef(null);var incrementButtonRef=react.exports.useRef(null);var decrementButtonRef=react.exports.useRef(null);var sanitize=react.exports.useCallback(function(value){return value.split(\"\").filter(isValidCharacter).join(\"\");},[isValidCharacter]);var parse=react.exports.useCallback(function(value){var _parseValue;return(_parseValue=parseValue==null?void 0:parseValue(value))!=null?_parseValue:value;},[parseValue]);var format=react.exports.useCallback(function(value){var _formatValue;return((_formatValue=formatValue==null?void 0:formatValue(value))!=null?_formatValue:value).toString();},[formatValue]);useUpdateEffect(function(){if(counter.valueAsNumber>max){onInvalid==null?void 0:onInvalid(\"rangeOverflow\",format(counter.value),counter.valueAsNumber);}else if(counter.valueAsNumber<min){onInvalid==null?void 0:onInvalid(\"rangeOverflow\",format(counter.value),counter.valueAsNumber);}},[counter.valueAsNumber,counter.value,format,onInvalid]);/**\n\t\t\t * Sync state with uncontrolled form libraries like `react-hook-form`.\n\t\t\t */useSafeLayoutEffect$1(function(){if(!inputRef.current)return;var notInSync=inputRef.current.value!=counter.value;if(notInSync){var parsedInput=parse(inputRef.current.value);counter.setValue(sanitize(parsedInput));}},[parse,sanitize]);var increment=react.exports.useCallback(function(step){if(step===void 0){step=stepProp;}if(isInteractive){incrementFn(step);}},[incrementFn,isInteractive,stepProp]);var decrement=react.exports.useCallback(function(step){if(step===void 0){step=stepProp;}if(isInteractive){decrementFn(step);}},[decrementFn,isInteractive,stepProp]);/**\n\t\t\t * Leverage the `useSpinner` hook to spin the input's value\n\t\t\t * when long press on the up and down buttons.\n\t\t\t *\n\t\t\t * This leverages `setInterval` internally\n\t\t\t */var spinner=useSpinner(increment,decrement);useAttributeObserver(incrementButtonRef,\"disabled\",spinner.stop,spinner.isSpinning);useAttributeObserver(decrementButtonRef,\"disabled\",spinner.stop,spinner.isSpinning);/**\n\t\t\t * The `onChange` handler filters out any character typed\n\t\t\t * that isn't floating point compatible.\n\t\t\t */var onChange=react.exports.useCallback(function(event){var evt=event.nativeEvent;if(evt.isComposing)return;var parsedInput=parse(event.currentTarget.value);updateFn(sanitize(parsedInput));inputSelectionRef.current={start:event.currentTarget.selectionStart,end:event.currentTarget.selectionEnd};},[updateFn,sanitize,parse]);var _onFocus=react.exports.useCallback(function(event){var _inputSelectionRef$cu,_event$currentTarget$,_inputSelectionRef$cu2;onFocus==null?void 0:onFocus(event);if(!inputSelectionRef.current)return;/**\n\t\t\t * restore selection if custom format string replacement moved it to the end\n\t\t\t */event.target.selectionStart=(_inputSelectionRef$cu=inputSelectionRef.current.start)!=null?_inputSelectionRef$cu:(_event$currentTarget$=event.currentTarget.value)==null?void 0:_event$currentTarget$.length;event.currentTarget.selectionEnd=(_inputSelectionRef$cu2=inputSelectionRef.current.end)!=null?_inputSelectionRef$cu2:event.currentTarget.selectionStart;},[onFocus]);var onKeyDown=react.exports.useCallback(function(event){if(event.nativeEvent.isComposing)return;if(!isValidNumericKeyboardEvent(event,isValidCharacter)){event.preventDefault();}/**\n\t\t\t * Keyboard Accessibility\n\t\t\t *\n\t\t\t * We want to increase or decrease the input's value\n\t\t\t * based on if the user the arrow keys.\n\t\t\t *\n\t\t\t * @see https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-17\n\t\t\t */var stepFactor=getStepFactor(event)*stepProp;var eventKey=normalizeEventKey(event);var keyMap={ArrowUp:function ArrowUp(){return increment(stepFactor);},ArrowDown:function ArrowDown(){return decrement(stepFactor);},Home:function Home(){return updateFn(min);},End:function End(){return updateFn(max);}};var action=keyMap[eventKey];if(action){event.preventDefault();action(event);}},[isValidCharacter,stepProp,increment,decrement,updateFn,min,max]);var getStepFactor=function getStepFactor(event){var ratio=1;if(event.metaKey||event.ctrlKey){ratio=0.1;}if(event.shiftKey){ratio=10;}return ratio;};/**\n\t\t\t * If user would like to use a human-readable representation\n\t\t\t * of the value, rather than the value itself they can pass `getAriaValueText`\n\t\t\t *\n\t\t\t * @see https://www.w3.org/TR/wai-aria-practices-1.1/#wai-aria-roles-states-and-properties-18\n\t\t\t * @see https://www.w3.org/TR/wai-aria-1.1/#aria-valuetext\n\t\t\t */var ariaValueText=react.exports.useMemo(function(){var text=getAriaValueText==null?void 0:getAriaValueText(counter.value);if(!isNull(text))return text;var defaultText=counter.value.toString();// empty string is an invalid ARIA attribute value\nreturn!defaultText?undefined:defaultText;},[counter.value,getAriaValueText]);/**\n\t\t\t * Function that clamps the input's value on blur\n\t\t\t */var validateAndClamp=react.exports.useCallback(function(){var next=counter.value;if(next===\"\")return;if(counter.valueAsNumber<min){next=min;}if(counter.valueAsNumber>max){next=max;}/**\n\t\t\t * `counter.cast` does 2 things:\n\t\t\t *\n\t\t\t * - sanitize the value by using parseFloat and some Regex\n\t\t\t * - used to round value to computed precision or decimal points\n\t\t\t */counter.cast(next);},[counter,max,min]);var onInputBlur=react.exports.useCallback(function(){setFocused.off();if(clampValueOnBlur){validateAndClamp();}},[clampValueOnBlur,setFocused,validateAndClamp]);var focusInput=react.exports.useCallback(function(){if(focusInputOnChange){focus(inputRef.current,{nextTick:true});}},[focusInputOnChange]);var spinUp=react.exports.useCallback(function(event){event.preventDefault();spinner.up();focusInput();},[focusInput,spinner]);var spinDown=react.exports.useCallback(function(event){event.preventDefault();spinner.down();focusInput();},[focusInput,spinner]);useEventListener(\"wheel\",function(event){var doc=getOwnerDocument$1(inputRef.current);var isInputFocused=doc.activeElement===inputRef.current;if(!allowMouseWheel||!isInputFocused)return;event.preventDefault();var stepFactor=getStepFactor(event)*stepProp;var direction=Math.sign(event.deltaY);if(direction===-1){increment(stepFactor);}else if(direction===1){decrement(stepFactor);}},inputRef.current,{passive:false});var getIncrementButtonProps=react.exports.useCallback(function(props,ref){if(props===void 0){props={};}if(ref===void 0){ref=null;}var disabled=isDisabled||keepWithinRange&&counter.isAtMax;return _extends$c({},props,{ref:mergeRefs(ref,incrementButtonRef),role:\"button\",tabIndex:-1,onPointerDown:callAllHandlers(props.onPointerDown,function(event){if(!disabled)spinUp(event);}),onPointerLeave:callAllHandlers(props.onPointerLeave,spinner.stop),onPointerUp:callAllHandlers(props.onPointerUp,spinner.stop),disabled:disabled,\"aria-disabled\":ariaAttr(disabled)});},[counter.isAtMax,keepWithinRange,spinUp,spinner.stop,isDisabled]);var getDecrementButtonProps=react.exports.useCallback(function(props,ref){if(props===void 0){props={};}if(ref===void 0){ref=null;}var disabled=isDisabled||keepWithinRange&&counter.isAtMin;return _extends$c({},props,{ref:mergeRefs(ref,decrementButtonRef),role:\"button\",tabIndex:-1,onPointerDown:callAllHandlers(props.onPointerDown,function(event){if(!disabled)spinDown(event);}),onPointerLeave:callAllHandlers(props.onPointerLeave,spinner.stop),onPointerUp:callAllHandlers(props.onPointerUp,spinner.stop),disabled:disabled,\"aria-disabled\":ariaAttr(disabled)});},[counter.isAtMin,keepWithinRange,spinDown,spinner.stop,isDisabled]);var getInputProps=react.exports.useCallback(function(props,ref){var _props$readOnly,_props$readOnly2,_props$required,_props$required2;if(props===void 0){props={};}if(ref===void 0){ref=null;}return _extends$c({name:name,inputMode:inputMode,type:\"text\",pattern:pattern,\"aria-labelledby\":ariaLabelledBy,\"aria-label\":ariaLabel,\"aria-describedby\":ariaDescBy,id:id,disabled:isDisabled},props,{readOnly:(_props$readOnly=props.readOnly)!=null?_props$readOnly:isReadOnly,\"aria-readonly\":(_props$readOnly2=props.readOnly)!=null?_props$readOnly2:isReadOnly,\"aria-required\":(_props$required=props.required)!=null?_props$required:isRequired,required:(_props$required2=props.required)!=null?_props$required2:isRequired,ref:mergeRefs(inputRef,ref),value:format(counter.value),role:\"spinbutton\",\"aria-valuemin\":min,\"aria-valuemax\":max,\"aria-valuenow\":Number.isNaN(counter.valueAsNumber)?undefined:counter.valueAsNumber,\"aria-invalid\":ariaAttr(isInvalid!=null?isInvalid:counter.isOutOfRange),\"aria-valuetext\":ariaValueText,autoComplete:\"off\",autoCorrect:\"off\",onChange:callAllHandlers(props.onChange,onChange),onKeyDown:callAllHandlers(props.onKeyDown,onKeyDown),onFocus:callAllHandlers(props.onFocus,_onFocus,setFocused.on),onBlur:callAllHandlers(props.onBlur,onBlur,onInputBlur)});},[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]);return{value:format(counter.value),valueAsNumber:counter.valueAsNumber,isFocused:isFocused,isDisabled:isDisabled,isReadOnly:isReadOnly,getIncrementButtonProps:getIncrementButtonProps,getDecrementButtonProps:getDecrementButtonProps,getInputProps:getInputProps,htmlProps:htmlProps};}", "title": "" }, { "docid": "ede415b4f3602bed6d15115a27af4ad7", "score": "0.6104293", "text": "validate() {\r\n if(this.input.value === '' | this.input.value === null | this.input.value === undefined) {\r\n this.showError('Por favor preencha o campo com o número desejado');\r\n return false;\r\n } else if(this.input.value < 0 | this.input.value > 300) {\r\n this.showError('O número digitado precisa estar entre 1 e 300');\r\n return false;\r\n } else {\r\n this.showError();\r\n this.val = this.input.value;\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "c26bfc7eb687a8a2862d27ad1e504f11", "score": "0.6100351", "text": "function validateInteger(num) {\n if (Number.isInteger(num)) {\n console.log(true);\n }\n}", "title": "" }, { "docid": "c5297fdc9a80a1dd9a1ee622d4397b76", "score": "0.6068729", "text": "static validNumber (digits) {\n digits = Number(digits);\n\n if (digits < 1 || digits > MAX_VALUE) {\n throw new Error(`Out of range, use a number between 1 and ${MAX_VALUE}`);\n }\n }", "title": "" }, { "docid": "df5bd4929c7318952cfb2a3cab52a33b", "score": "0.6062779", "text": "function numberValidator(value, minValue, maxValue, culture) {\r\n var numberValue = numberParser(value, culture);\r\n return numberValue >= minValue && numberValue <= maxValue;\r\n }", "title": "" }, { "docid": "fe217a5da06ffa620128f9039884460e", "score": "0.60464674", "text": "static checkNumber(n) {\r\n \r\n if ( (typeof(n) !== \"number\") || isNaN(n) ) {\r\n alert(\"Utils::checkNumber()::Error: n is not a number: n = \" + n + \"!!!\");\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "title": "" }, { "docid": "e40d66393baa8f4d1324141b019115d3", "score": "0.60412717", "text": "function numberCheck(input){\n var regex = /^[0-9]+$/;\n if (input.match(regex)){\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "4950496db1f37e801d1cb0a8ecafa4d1", "score": "0.6036943", "text": "function validateInput(num){\n if(isNaN(num) || num > max || num < min){\n setMessage(`Please enter a number between ${min} and ${max}`,'red');\n return false;\n }\n else \n return true;\n}", "title": "" }, { "docid": "7c06ae08d34dd6f5dfc087f11fc91c06", "score": "0.6036534", "text": "function intValidatorWithErrors( n, min, max, caller, name ) { // 7005\n if ( n < min || n > max || n != truncate(n) ) { // 7006\n raise( caller, ( name || 'decimal places' ) + // 7007\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n ); // 7008\n } // 7009\n // 7010\n return true; // 7011\n } // 7012", "title": "" }, { "docid": "cb8b2bdb9df2b928247f9d60c4366127", "score": "0.60246134", "text": "function zf_ValidateNumber(elem) {\n var validChars = \"-0123456789\";\n var numValue = elem.value.replace(/^\\s+|\\s+$/g, '');\n if (numValue != null && !numValue == \"\") {\n var strChar;\n var result = true;\n if (numValue.charAt(0) == \"-\" && numValue.length == 1) {\n return false;\n }\n for (i = 0; i < numValue.length && result == true; i++) {\n strChar = numValue.charAt(i);\n if ((strChar == \"-\") && (i != 0)) {\n return false;\n }\n if (validChars.indexOf(strChar) == -1) {\n result = false;\n }\n }\n return result;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "994d41d9a3c614f1c550137c45ac86a3", "score": "0.60206753", "text": "function validarNumero(){\r\n if(!(this.configurado===true)){\r\n\t this.displayErrorCfg();\r\n\t return false;\r\n\t} // if\r\n\telse{\r\n\t if(isNaN(this.valor)){\r\n\t if(this.displayAlert) alert('El campo debe ser numerico');\r\n\t\tif(this.displayFoco) this.setFoco();\r\n\t\treturn false;\r\n\t } // if\r\n\t else return true;\r\n\t} // else\r\n }", "title": "" }, { "docid": "8eecc3b2e7aa9458c1d7868a63f63832", "score": "0.6018275", "text": "function checknumber(field) {\n var v;\n \n if (field.value !== undefined) {\n v = parseFloat(field.value);\n if (v != field.value) return false;\n }\n else {\n v = parseFloat(field);\n\tif (v != field) return false;\n }\n \n if (isNaN(v) || \n ((field.min != null) && (v < field.min)) || \n ((field.max != null) && (v > field.max))) return false;\n \n return true;\n}", "title": "" }, { "docid": "f02c20a32be7b508ec8c706d83a50d4d", "score": "0.60138905", "text": "function validateNumberKeyPress(event) {\n var key = window.event ? event.keyCode : event.which;\n if (key === 44 || key === 8 || key === 0 ||\n (event.ctrlKey && key === 99) ||\n (event.ctrlKey && key === 97) ||\n (event.ctrlKey && key === 118)) {\n return true;\n }\n else if (key < 48 || key > 57) {\n return event.preventDefault();\n }\n else return true;\n}", "title": "" }, { "docid": "af85dade45a99dd038058e80738b6f9d", "score": "0.600259", "text": "function BoundedNumericFieldValidator(name, minimum, maximum, error){\n\tthis.name = name;\n\tthis.minimum = minimum;\n\tthis.maximum = maximum;\n\tthis.error = error;\n}", "title": "" }, { "docid": "fc22d582ae83fa2152369dc75e3d90c5", "score": "0.5987805", "text": "function CheckNum(n) {\n return (/^\\d+/g.test(n) && M.PInt(n) >= 0 && M.PInt(n) < num);\n }", "title": "" }, { "docid": "11debaee3dc1b68c99e7104457b31553", "score": "0.597392", "text": "function numValidate(val){ \r\n\t \r\n\t if(val!='') {\r\n\t \tif (val.match(/^[0-9|.]+$/))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\talert(\"Please enter positive number only\");\r\n\t\t\t}\r\n }\r\n }", "title": "" }, { "docid": "a55f7d2a2f9fabb96971887c0c80b2c6", "score": "0.5965195", "text": "function validateNum (num, method) {\n if (typeof num !== 'number') {\n throw new Error(`First argument of ${method} method must be a number`)\n }\n }", "title": "" }, { "docid": "4e6ad3f6124b27b9e54167781da4db45", "score": "0.59621924", "text": "function checkInputisNumber(value) {\n if (isNaN(value)) {\n return false;\n }\n else {\n console.log(value + \" is a number\")\n return true\n }\n}", "title": "" }, { "docid": "884433212cb4b63d89ad2205ea7f6f9a", "score": "0.5959261", "text": "function validar_numero(dato){\n\n\treturn Number.isInteger(Number(dato));\n\n}", "title": "" }, { "docid": "380c70ea1c981d0895f0bad461d4a2bf", "score": "0.5958707", "text": "function validateNumber(sNumber) {\n var filter = /^[0-9]+$/;\n if (filter.test(sNumber)) {\n\n return true;\n }\n else {\n\n return false;\n }\n}", "title": "" }, { "docid": "68a56261d2b62791eb7928e631708a05", "score": "0.59573185", "text": "function errorNumber(numeroUtente){\n var controllo = false;\n if (numeroUtente < 1 || numeroUtente > 100 || isNaN(numeroUtente)) {\n controllo = true;\n }\n return controllo;\n }", "title": "" }, { "docid": "8a2117be5127bcd4582406a049e7a02e", "score": "0.5957262", "text": "validateNumeric(numbers) {\n\t\tif (/^[0-9]+$/.test(numbers)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "8a2117be5127bcd4582406a049e7a02e", "score": "0.5957262", "text": "validateNumeric(numbers) {\n\t\tif (/^[0-9]+$/.test(numbers)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "f09fc4c8040bd2704347b2be8306d6c7", "score": "0.5946365", "text": "function intValidatorWithErrors(n, min, max, caller, name) {\n\t if (n < min || n > max || n != truncate(n)) {\n\t raise(caller, (name || 'decimal places') + (n < min || n > max ? ' out of range' : ' not an integer'), n);\n\t }\n\n\t return true;\n\t }", "title": "" }, { "docid": "7ecde6929721bba6cda3d0a464952ac7", "score": "0.59451413", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n\t if ( n < min || n > max || n != truncate(n) ) {\r\n\t raise( caller, ( name || 'decimal places' ) +\r\n\t ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n\t }\r\n\r\n\t return true;\r\n\t }", "title": "" }, { "docid": "7ecde6929721bba6cda3d0a464952ac7", "score": "0.59451413", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n\t if ( n < min || n > max || n != truncate(n) ) {\r\n\t raise( caller, ( name || 'decimal places' ) +\r\n\t ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n\t }\r\n\r\n\t return true;\r\n\t }", "title": "" }, { "docid": "7ecde6929721bba6cda3d0a464952ac7", "score": "0.59451413", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n\t if ( n < min || n > max || n != truncate(n) ) {\r\n\t raise( caller, ( name || 'decimal places' ) +\r\n\t ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n\t }\r\n\r\n\t return true;\r\n\t }", "title": "" }, { "docid": "76d2875f25b72ddc4823e6a90ad58474", "score": "0.5943776", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\n\t if ( n < min || n > max || n != truncate(n) ) {\n\t raise( caller, ( name || 'decimal places' ) +\n\t ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\n\t }\n\n\t return true;\n\t }", "title": "" }, { "docid": "9aa8de1973437ba4eebda8e287d60678", "score": "0.594218", "text": "function validateNumber2(input) {\n var reg = /^\\d+$/;\n return ( (reg.test(input)) && (input > -1) ) || \"Enter a valid number!\";\n}", "title": "" }, { "docid": "48e7fbf3c01247168cab9e1d73f71c86", "score": "0.5940101", "text": "function validNumber(str, min, max) {\n\tvar n = Number(str);\n\n\tif (isNaN(n))\n\t\treturn false;\n\n\t// check to make sure that there is only digits \n\tif (str.match(/^([0-9])+$/) == null) {\n\t\treturn false;\n\t}\n\n\tif (min != undefined && n < min)\n\t\treturn false;\n\n\tif (max != undefined && n > max)\n\t\treturn false;\n\n\treturn true;\n}", "title": "" }, { "docid": "841cd4878c1d2214baabbe6b47b0ffaf", "score": "0.5922059", "text": "function validateNumber(context, name, def) {\n var value = context[name];\n\n if (value == null) {\n value = def;\n }\n\n if (isNaN(value)) {\n raise(value, 'options.' + name);\n }\n\n context[name] = value;\n}", "title": "" }, { "docid": "841cd4878c1d2214baabbe6b47b0ffaf", "score": "0.5922059", "text": "function validateNumber(context, name, def) {\n var value = context[name];\n\n if (value == null) {\n value = def;\n }\n\n if (isNaN(value)) {\n raise(value, 'options.' + name);\n }\n\n context[name] = value;\n}", "title": "" }, { "docid": "987c776fee6e2a1f198d5d3dddf637f1", "score": "0.5903209", "text": "function IsValidNum(val ,numberOfDecimal) {\n\t// define how many decimal places number are accepted.\n\tacceptLength = numberOfDecimal;\n\t\n\tif (isNaN(val) || Trim(val)==\"\") {\n\t\treturn false;\n\t}\n\telse {\n\t\tif (val.indexOf('.') == -1) {\n\t\t\treturn (true);\n\t\t}\n\t\telse {\n\t\t\trestText = val.substring(val.indexOf('.')+1, val.length);\n\t\t\tif (restText.length>0 && restText.length<=acceptLength) {\n\t\t\t\treturn (true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (false);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5aa2bb92f8408b37fac63dee87f98c68", "score": "0.5893538", "text": "numberHlrVerify(fields, callback) {\n let rules = {\n number: 'required|string',\n country_id: 'numeric|digits_between:1,32'\n };\n\n this._verifyAndRun('verify/number-hlr/', rules, fields, (cb) => {\n callback(cb);\n });\n }", "title": "" }, { "docid": "b1d1ba91a56c6e7fb0373b4756b6383e", "score": "0.5893337", "text": "function BoundedLengthNumericFieldValidator(name, minimumLength, maximumLength, error){\n\tthis.name = name;\n\tthis.minimumLength = minimumLength;\n\tthis.maximumLength = maximumLength;\n\tthis.error = error;\n}", "title": "" }, { "docid": "1dc44c947460659c0f272609dff6056b", "score": "0.5890621", "text": "function checkIsProperNumber(val, variableName) {\n\tif(val === undefined || typeof val !== \"number\"){\n\t\tthrow `${variableName || 'provided variable'} is not a number`;\n\t}\n}", "title": "" }, { "docid": "86035f3857df1254c5db0218bd5f4859", "score": "0.5886717", "text": "function isNumber(n) { return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) }", "title": "" }, { "docid": "77c7a1938417dafe200647e4e2d984a8", "score": "0.5877885", "text": "function checkNumber(fieldEle, errorEle, indexMsg) {\n var fieldEle = getEleById(fieldEle);\n var errorEle = getEleById(errorEle);\n\n errorEle.style.display = \"none\";\n\n if (fieldEle.value === \"\") {\n errorEle.style.display = \"block\";\n\n return;\n } else if (isNaN(fieldEle.value)) {\n errorEle.style.display = \"block\";\n errorEle.textContent = errorNumberMsg[indexMsg];\n }\n}", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "43333811dbc2127f89344e239e23a264", "score": "0.5861108", "text": "function intValidatorWithErrors( n, min, max, caller, name ) {\r\n if ( n < min || n > max || n != truncate(n) ) {\r\n raise( caller, ( name || 'decimal places' ) +\r\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "2359af6c48d22898e35bc5aa81ae6555", "score": "0.5854013", "text": "function checkNumber (num) {\n if (typeof num === 'number') {\n return num\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "585120733faa609dbcbd31254be7903f", "score": "0.5839471", "text": "function isValidateNumber(Value) {\n var temp = parseFloat(Value);\n return !isNaN(temp);\n}", "title": "" } ]
7ba647a568883ea03a763170d48a269d
pick the locale from the array try ['enau', 'engb'] as 'enau', 'engb', 'en', as in move through the list trying each substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
[ { "docid": "ef1787ab0c1a27eedd3b5f0ccb7b76b2", "score": "0.0", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "title": "" } ]
[ { "docid": "33ec6ad9c0bba72649eebb2f1ecd1c5b", "score": "0.7080607", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n \n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "ec0b20bc36b12e8f31a1cc22cb864654", "score": "0.7076074", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}", "title": "" }, { "docid": "b5e608fff0172d33b291494830f14e8b", "score": "0.70720136", "text": "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "title": "" } ]
e64a549053b896e18635d0d46e972799
Print all invoices to PDFs (to different files)
[ { "docid": "7f6d05dc1379d76ed8aa9fa4eb785cda", "score": "0.73474216", "text": "function printAllToPDF(keys) {\n\n // Iterate over all invoice keys\n keys.map(key => {\n let url = path.join(__dirname, '../..', '/pages/single_invoice.html?id=' + key);\n printToPDF(key, url);\n })\n}", "title": "" } ]
[ { "docid": "f21b564d62a563a79e4d3f481f9bcbcb", "score": "0.6899707", "text": "function toPDF() {\n toggleUnprinted();\n makeAnchors(\"printable\");\n html2pdf()\n .set(printOptions)\n .from(printable[0])\n .save()\n .then(toggleUnprinted)\n .then(makeSortable);\n }", "title": "" }, { "docid": "60201f3ed1964d647d4c25185a23f105", "score": "0.662314", "text": "function CreateInvoiceFile(InvcType, InvcNo) { \n var oDocPrint = new DocumentPrint();\n oDocPrint.KeyName = \"InvoiceData\";\n oDocPrint.Title = \"Invoice\";\n\n// formatType = el('lkpINVFormat').value;\n// if (formatType != \"\") {\n// formatType = formatType.split(\".\"); //Split the value\n// formatType = formatType[1]; //taken only extension for checking\n// exportType = formatType.replace(\")\", \"\");\n// }\n// if (exportType == \"pdf\") {\n// oDocPrint.Type = \"CreatePdf\"; //use Createpddf as type\n// }\n// else if (exportType == \"xls\") {\n// oDocPrint.Type = \"export\"; //use Export as type\n// }\n// else if (exportType == \"doc\") {\n// oDocPrint.Type = \"word\"; //use Export as type\n// }\n// else {\n// oDocPrint.Type = \"CreatePdf\"; //use Createpddf as type\n // }\n oDocPrint.Type = \"All\";\n var HSInvoiceDraft = \"HSInvoiceDraft.rdlc\"\n var HSInvoiceFinal = \"HSInvoice.rdlc\"\n if (getConfigSetting('014') != \"\") {\n HSInvoiceFinal = getConfigSetting('014')\n }\n\n if (getConfigSetting('013') != \"\") {\n HSInvoiceDraft = getConfigSetting('013')\n }\n\n if (InvcType == \"HS_Draft\") {\n oDocPrint.DocumentId = \"1\";\n oDocPrint.ReportPath = \"../Documents/Report/\" + HSInvoiceDraft;\n }\n else if (InvcType == \"HS_\") {\n oDocPrint.DocumentId = \"1\";\n oDocPrint.ReportPath = \"../Documents/Report/\" + HSInvoiceFinal;\n }\n else if (InvcType == \"RP_Draft\") {\n oDocPrint.DocumentId = \"2\";\n oDocPrint.ReportPath = \"../Documents/Report/RPInvoiceDraft.rdlc\";\n }\n else if (InvcType == \"RP_\") {\n oDocPrint.DocumentId = \"2\";\n oDocPrint.ReportPath = \"../Documents/Report/RPInvoice.rdlc\";\n }\n oDocPrint.add(\"INVC_TYP\", InvcType);\n oDocPrint.add(\"INVC_NO\", InvcNo);\n oDocPrint.openReportDialog();\n}", "title": "" }, { "docid": "a305455af6d9f26e9e6a82b5277af227", "score": "0.65169126", "text": "function printToPDF(ID, url = null, all = false) {\n // Create new hidden window\n let win = new BrowserWindow({\n width: 800,\n height: 600,\n show: false\n });\n\n let URL;\n if (url != null) {\n URL = url;\n } else if (all == true) {\n URL = path.join(__dirname, '../..', '/pages/single_invoice.html?all=true'); // If all invoices should be on one page\n } else {\n URL = path.join(__dirname, '../..', '/pages/single_invoice.html'); // If page URL is not passed as argument\n }\n win.loadURL(URL);\n\n win.webContents.on('did-finish-load', () => {\n // Use default printing options\n win.webContents.printToPDF({}, (error, data) => {\n if (error) throw error\n const filename = \"arve-\" + ID + \".pdf\";\n fs.writeFile(`${config.invoicesFolder}${filename}`, data, (error) => {\n if (error) throw error\n console.log('Write PDF successfully.');\n win.close();\n })\n })\n })\n}", "title": "" }, { "docid": "852a58de7d4b779b347d571bae800b6c", "score": "0.6351909", "text": "printInvoice(req, res)\n {\n // console.log(this.order_details);\n let inv = edge.render('templates.invoice.edge', {order: this.order_details});\n let inv_file_name = req.params.id.toString().substring(15, 19)\n // var html = fs.readFileSync(inv, 'utf8');\n var options = { format: 'Letter' };\n\n pdf.create(inv, options).toFile(path.join(__dirname, '../../invoices', `invoice_${inv_file_name}.pdf`),\n (err, file) => {\n if (err) return console.log(err);\n // Open file in the browser\n fs.readFile(file.filename, (err, data) => {\n if(err)\n return res.redirect('back')\n else{\n res.contentType(\"application/pdf\");\n return res.send(data);\n }\n });\n });\n }", "title": "" }, { "docid": "d7459a9b282e0967d696e382ca44889d", "score": "0.6271534", "text": "function invoicePdf(e) {\n\tvar id = $(e.currentTarget).val();\n\tif (id != '') {\n\t\twindow.open(webroot + 'invoices/viewOldInvoice/' + id + '.pdf');\n\t}\n}", "title": "" }, { "docid": "41f711a406dcbdb39300108b386ee048", "score": "0.6029642", "text": "function exportPdf(a,b=\"\"){var c=require(\"html-pdf\");b=b?b:\"./new.pdf\";var d=\"\";d=\"<style>\",d+=\"body{ font-family: Helvetica }\",d+=\"</style>\",loading(\"Caricamento\"),c.create(d+a,{format:\"A4\",border:\"1cm\"}).toFile(b,function(a){if(loading(),a)console.log(a);else{var c=\"\";switch(process.platform){case\"darwin\":c=\"open\";break;case\"win32\":c=\"start\";break;case\"win64\":c=\"start\";break;default:c=\"xdg-open\";}exec(c+\" \"+b)}})}", "title": "" }, { "docid": "60f05f80757c573113db85425910029f", "score": "0.5987607", "text": "printPages() {\n fs.existsSync(this.root) || fs.mkdirSync(this.root);\n for (const page in this.pageLines) {\n fs.writeFileSync (this.root + '/' + page, this.pageLines[page].join('\\n'));\n }\n }", "title": "" }, { "docid": "76d69b71163592de4445a0fe2d585a43", "score": "0.5943607", "text": "joinPDF() {\n\n const aux = this.is_split;\n\n for (let i in aux){\n const pdfDoc = new HummusRecipe(`${__pathtemp}/${__intext}-${aux[i][0]}.pdf`, `${__pathtemp}/${__outext}-${i}.pdf`);\n\n for (let j = aux[i][0] + 1; j <= aux[i][1]; j++){\n pdfDoc.appendPage(`${__pathtemp}/${__intext}-${j}.pdf`)\n }\n pdfDoc.endPDF();\n }\n }", "title": "" }, { "docid": "a40bb68f671c6fbdc5375c201c0747f4", "score": "0.58753884", "text": "function generatePaper() {\n\n currentPage = 0;\n\n var studentName = document.getElementById('studentName').value;\n var profName = document.getElementById('profName').value;\n var className = document.getElementById('className').value;\n var dueDate = document.getElementById('dueDate').value;\n var paperTitle = document.getElementById('paperTitle').value;\n var paperContents = document.getElementById('paperContents').value;\n\n var doc = new PDFDocument({ autoFirstPage: false });\n var stream = doc.pipe(blobStream());\n\n // Set document MLA guidelines.\n doc\n .fontSize(12)\n .font('Times-Roman')\n .lineGap(24)\n\n doc.on('pageAdded', function () {\n doc.moveUp()\n currentPage += 1;\n doc.text(getLastName(studentName) + ' ' + currentPage, {\n align: 'right'\n }\n );\n })\n\n\n // Set the page margins\n doc.addPage({\n margins: {\n top: 72,\n bottom: 72,\n left: 72,\n right: 72\n }\n });\n\n // Configure the heading in the top left corner.\n if (currentPage == 1) {\n doc\n .text(studentName, 72, 72)\n .text(profName, 72, 108)\n .text(className, 72, 144)\n .text(dueDate, 72, 180)\n .text(paperTitle, {\n align: 'center'\n }\n );\n\n }\n\n doc\n .text(paperContents)\n\n // edit the document's metadata\n if (paperTitle != \"\") {\n doc\n .info['Title'] = paperTitle\n } else {\n doc\n .info['Title'] = 'Maribel - MLA Formatter'\n }\n\n\n // Set the name to be saved of the document.\n documentTitle = paperTitle\n\n // Add the Works Cited page.\n\n if (makeWorksCited) {\n citations = document.getElementById('worksCited').value,\n\n doc\n .addPage()\n .text('Works Cited', {\n align: 'center'\n }\n )\n }\n\n\n\n\n var x;\n // for (x = 0; indivCitations.length; x++) {\n // doc.text(indivCitations[x], {\n // align: 'left'\n // }\n // );\n // x++;\n // }\n\n\n // End and display the document in the iframe to the right\n doc.end();\n\n stream.on('finish', function () {\n var iframe = document.querySelector('embed');\n // get a blob you can do whatever you like with\n const blob = stream.toBlob('application/pdf');\n // or get a blob URL for display in the browser\n const url = stream.toBlobURL('application/pdf');\n lastBlob = blob;\n iframe.src = url;\n });\n}", "title": "" }, { "docid": "589137c2e380fad117a3406394d08adf", "score": "0.58616596", "text": "function createPDF() {\n const exportSection = DOM.EXP;\n html2pdf().from(exportSection).save();\n}", "title": "" }, { "docid": "86d69eae7b854bdd9324fd3ca734bdb4", "score": "0.58565235", "text": "function PDFPrinter() {\n\n this.print = function () {\n var svg = new Rsvg(),\n deferred = Q.defer();\n\n svg.on('finish', function () {\n deferred.resolve(svg.render({\n format: 'pdf',\n width: svg.width,\n height: svg.height\n }).data);\n });\n\n fs.createReadStream('./server/templates/ticket/default.svg').pipe(svg);\n\n return deferred.promise;\n };\n\n return this;\n\n}", "title": "" }, { "docid": "d894d7946b45e649f896269f1778e917", "score": "0.58508474", "text": "setupPDF() {\n let config = this.Reveal.getConfig();\n\n let slideSize = this.Reveal.getComputedSlideSize(\n window.innerWidth,\n window.innerHeight\n );\n\n // Dimensions of the PDF pages\n let pageWidth = Math.floor(slideSize.width * (1 + config.margin)),\n pageHeight = Math.floor(slideSize.height * (1 + config.margin));\n\n // Dimensions of slides within the pages\n let slideWidth = slideSize.width,\n slideHeight = slideSize.height;\n\n // Let the browser know what page size we want to print\n createStyleSheet(\n \"@page{size:\" + pageWidth + \"px \" + pageHeight + \"px; margin: 0px;}\"\n );\n\n // Limit the size of certain elements to the dimensions of the slide\n createStyleSheet(\n \".reveal section>img, .reveal section>video, .reveal section>iframe{max-width: \" +\n slideWidth +\n \"px; max-height:\" +\n slideHeight +\n \"px}\"\n );\n\n document.documentElement.classList.add(\"print-pdf\");\n document.body.style.width = pageWidth + \"px\";\n document.body.style.height = pageHeight + \"px\";\n\n // Make sure stretch elements fit on slide\n this.Reveal.layoutSlideContents(slideWidth, slideHeight);\n\n // Compute slide numbers now, before we start duplicating slides\n let doingSlideNumbers =\n config.slideNumber && /all|print/i.test(config.showSlideNumber);\n queryAll(this.Reveal.getRevealElement(), SLIDES_SELECTOR).forEach(function (\n slide\n ) {\n slide.setAttribute(\n \"data-slide-number\",\n this.Reveal.slideNumber.getSlideNumber(slide)\n );\n },\n this);\n\n // Slide and slide background layout\n queryAll(this.Reveal.getRevealElement(), SLIDES_SELECTOR).forEach(function (\n slide\n ) {\n // Vertical stacks are not centred since their section\n // children will be\n if (slide.classList.contains(\"stack\") === false) {\n // Center the slide inside of the page, giving the slide some margin\n let left = (pageWidth - slideWidth) / 2,\n top = (pageHeight - slideHeight) / 2;\n\n let contentHeight = slide.scrollHeight;\n let numberOfPages = Math.max(Math.ceil(contentHeight / pageHeight), 1);\n\n // Adhere to configured pages per slide limit\n numberOfPages = Math.min(numberOfPages, config.pdfMaxPagesPerSlide);\n\n // Center slides vertically\n if (\n (numberOfPages === 1 && config.center) ||\n slide.classList.contains(\"center\")\n ) {\n top = Math.max((pageHeight - contentHeight) / 2, 0);\n }\n\n // Wrap the slide in a page element and hide its overflow\n // so that no page ever flows onto another\n let page = document.createElement(\"div\");\n page.className = \"pdf-page\";\n page.style.height =\n (pageHeight + config.pdfPageHeightOffset) * numberOfPages + \"px\";\n slide.parentNode.insertBefore(page, slide);\n page.appendChild(slide);\n\n // Position the slide inside of the page\n slide.style.left = left + \"px\";\n slide.style.top = top + \"px\";\n slide.style.width = slideWidth + \"px\";\n\n if (slide.slideBackgroundElement) {\n page.insertBefore(slide.slideBackgroundElement, slide);\n }\n\n // Inject notes if `showNotes` is enabled\n if (config.showNotes) {\n // Are there notes for this slide?\n let notes = this.Reveal.getSlideNotes(slide);\n if (notes) {\n let notesSpacing = 8;\n let notesLayout =\n typeof config.showNotes === \"string\"\n ? config.showNotes\n : \"inline\";\n let notesElement = document.createElement(\"div\");\n notesElement.classList.add(\"speaker-notes\");\n notesElement.classList.add(\"speaker-notes-pdf\");\n notesElement.setAttribute(\"data-layout\", notesLayout);\n notesElement.innerHTML = notes;\n\n if (notesLayout === \"separate-page\") {\n page.parentNode.insertBefore(notesElement, page.nextSibling);\n } else {\n notesElement.style.left = notesSpacing + \"px\";\n notesElement.style.bottom = notesSpacing + \"px\";\n notesElement.style.width = pageWidth - notesSpacing * 2 + \"px\";\n page.appendChild(notesElement);\n }\n }\n }\n\n // Inject slide numbers if `slideNumbers` are enabled\n if (doingSlideNumbers) {\n let numberElement = document.createElement(\"div\");\n numberElement.classList.add(\"slide-number\");\n numberElement.classList.add(\"slide-number-pdf\");\n numberElement.innerHTML = slide.getAttribute(\"data-slide-number\");\n page.appendChild(numberElement);\n }\n\n // Copy page and show fragments one after another\n if (config.pdfSeparateFragments) {\n // Each fragment 'group' is an array containing one or more\n // fragments. Multiple fragments that appear at the same time\n // are part of the same group.\n let fragmentGroups = this.Reveal.fragments.sort(\n page.querySelectorAll(\".fragment\"),\n true\n );\n\n let previousFragmentStep;\n let previousPage;\n\n fragmentGroups.forEach(function (fragments) {\n // Remove 'current-fragment' from the previous group\n if (previousFragmentStep) {\n previousFragmentStep.forEach(function (fragment) {\n fragment.classList.remove(\"current-fragment\");\n });\n }\n\n // Show the fragments for the current index\n fragments.forEach(function (fragment) {\n fragment.classList.add(\"visible\", \"current-fragment\");\n }, this);\n\n // Create a separate page for the current fragment state\n let clonedPage = page.cloneNode(true);\n page.parentNode.insertBefore(\n clonedPage,\n (previousPage || page).nextSibling\n );\n\n previousFragmentStep = fragments;\n previousPage = clonedPage;\n }, this);\n\n // Reset the first/original page so that all fragments are hidden\n fragmentGroups.forEach(function (fragments) {\n fragments.forEach(function (fragment) {\n fragment.classList.remove(\"visible\", \"current-fragment\");\n });\n });\n }\n // Show all fragments\n else {\n queryAll(page, \".fragment:not(.fade-out)\").forEach(function (\n fragment\n ) {\n fragment.classList.add(\"visible\");\n });\n }\n }\n },\n this);\n\n // Notify subscribers that the PDF layout is good to go\n this.Reveal.dispatchEvent({ type: \"pdf-ready\" });\n }", "title": "" }, { "docid": "83942dd5d50193cefa520465c7719790", "score": "0.58361244", "text": "function print() {\n let wordsearchContainerElem = getElem(\"wordsearchForPrint\");\n let options = {\n margin: 20,\n filename: 'wordsearch' + (title !== \"\" ? \"_\" + title : \"\") + '.pdf',\n }\n html2pdf(wordsearchContainerElem, options);\n}", "title": "" }, { "docid": "b8564bbed9e40eb1a8e133f51ebc9225", "score": "0.57448274", "text": "function Action_Print_pdf_blank(){\n\t\n //var url = '../html2fpdf/blank_Application_pdf.phpf';\n\t\n //window.open('../pdf/blank_Application.pdf');\n window.open('../html2fpdf/blank_Application_pdf.php');\n\t\n// var c = document.getElementById('regis_form');\n// c.action = \"../action/action_insert_regis_form_pdf.php?action=insert_pdf\";\n// c.target = \"_self\";\n// c.submit();\n \n}", "title": "" }, { "docid": "3cbbc7742fc35942d1fab45c0a3e530e", "score": "0.57293713", "text": "function PDF_Saver () {\n this.savePDFs = (pdf_Array) => {\n if (!fs.existsSync('./consent_forms')) {\n fs.mkdirSync('./consent_forms');\n }\n pdf_Array.forEach((val, ind, arr) => {\n\n fs.writeFile(path.join('./consent_forms', val._id + \".pdf\"), val.pdf, {\n encoding: 'utf8'\n }, function (err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"The pdf-file was saved!\");\n });\n\n });\n }\n }", "title": "" }, { "docid": "19c83bc8f0fa6d123a53c4d0fbaf320d", "score": "0.57070965", "text": "function openSendPDF(clientid) {\n\tconsole.log(\"openSendPDF\"+clientid);\n\tfor (var i = 0; i < clientData.length; i++) {\n if (clientData[i].id === clientid){\n var compiledTemplate = Template7.compile($$('#pdfPageTemplate').html());\n var context = clientData[i];\n\t\t\tcontext.containersqty = context.containers.length;\n\t\t\tcontext.itemsqty = countClientItems(context);\n var html = compiledTemplate(context);\n mainView.router.loadContent(html);\n\t\t}\n\t\tbuildContainerPDFListHtml(context.containers);\n\t\t$$('.send-pdf').on('click', function () {\n\t\t\tgeneratePDF(context);\n\t\t});\n\t\t\n\t}\n}", "title": "" }, { "docid": "81e6bf5b357aab8be39172fd6cb1b522", "score": "0.56569254", "text": "function generarPDF() {\t\n\t\twindow.open('../reportes/reporte.php', '_blank');\n\t}", "title": "" }, { "docid": "186164747f16bd7844c0e7edcd92eff7", "score": "0.5654065", "text": "function loadFiles(){\n for( i = 0; i < 7; i++){\n loadInvoice(\"Checking\", \"1267451**** - WOLFE\", \"Active\", \"USD\", \"$6266.33\");\n loadInvoice(\"Saving\", \"5719371**** - MAENGUNE\", \"Active\", \"USD\", \"$10998.10\");\n loadInvoice(\"Saving\", \"7125781**** - KAISER\", \"Deactivated\", \"USD\", \"$23.86\");\n }\n}", "title": "" }, { "docid": "13867e904299011128bb60fb9e40f59c", "score": "0.5591071", "text": "function drawPDF(inputArray,qPerPage) {\n\n\tvar width = 195;\n\n\tvar height = 290;\n\n\tvar totalQ = inputArray.length;\t \n\n\tif ((totalQ < 1)){\n\t\tthrow \"Must have at least one question.\";\n\t}\n\tif (qPerPage > 10){\n\t\tqPerPage = 10;\n\t}\n\n\tvar numPages = Math.floor((totalQ - 1) / qPerPage) + 1;\n\tvar lines = qPerPage - 1;\n\tvar heightQ = height / qPerPage;\n\n\tvar doc = new jsPDF();\n\t\n\n\t//\tdraw the lines in the first page\n\tdrawLines(doc,lines,heightQ,width);\n\t//\tdraw the text in the first page\n\tdrawText(doc, inputArray, qPerPage, heightQ, width, 0);\n\n\t// draw the lines and text on remaining pages\n\tfor (var i = 1; i < numPages; i++){\n\t\tdoc.addPage();\n\t\tdrawLines(doc,lines,heightQ,width);\n\t\tdrawText(doc, inputArray, qPerPage, heightQ, width, i);\n\t}\n\n\t// Save the PDF\n\tdoc.save('Test.pdf');\n\n\n}", "title": "" }, { "docid": "427d3e4788cf29c3a273364164a857a2", "score": "0.55905896", "text": "function generatePDF() {\r\n\r\n if (gblCurrentSMData.searchResultVOs === null) { bootbox.alert('There is no data to report.'); return;}\r\n var dt = new Date();\r\n var dd = {};\r\n dd.pageSize = 'LEGAL';\r\n dd.pageOrientation = 'landscape';\r\n dd.footer = function(currentPage, pageCount) { \r\n\t\tvar ft = [];\r\n\t\t//ft.push({columns: [{text: 'http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=cf1fb7537e35f310VgnVCM10000071d60f89RCRD', style: 'footertext', margin: [15,0,0,0]}, {text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', style: 'footertext', margin: [0,0,15,0] }] });\r\n\t\tft.push({columns: [{text: '375 University Avenue, Suite 201,', style: 'footertext', margin: [20,0,0,0]}] });\r\n\t\tft.push({columns: [{text: 'Toronto, Ontario M5G 2J5 | 416-338-5858', style: 'footertext', margin: [20,0,0,0]}, {text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', style: 'footertext', margin: [0,0,20,0] }] });\r\n\t\tft.push({columns: [{text: '[email protected]', style: 'footertext', margin: [20,0,0,0] }, {text: '' + moment().format('LLLL'), alignment: 'right', style: 'footertext', margin: [0,0,20,0] }] });\r\n\t\t\r\n\t\treturn ft; \r\n\t\r\n\t};\r\n dd.header = {columns: [ {image: 'logo', width: 160, margin: [0,20,0,10]}, {text: 'Office of the Lobbyist Registrar', margin: [0,20,20,0], style: 'headertext'} ] };\r\n dd.pageMargins = [20, 70, 20, 60];\r\n dd.styles = {};\r\n dd.styles.reporttitle = {fontSize: 28,bold: true, alignment: 'center', color: \"#000000\", margin: [0,70,0,20]};\r\n dd.styles.measuretitle = {fontSize: 16,bold: true, alignment: 'left', color: \"#000000\", margin: [0,0,0,10], pageBreak: 'before'};\r\n dd.styles.rpttable = {margin: [0,0,0,15]};\r\n dd.styles.reportdate = {fontSize: 16, bold: true, alignment: 'center' };\r\n dd.styles.cmo = {fontSize: 20, bold: true, alignment: 'center' };\r\n dd.styles.headertext = {fontSize: 12, color: \"#aaa\", alignment: \"right\", width: '50%'};\r\n dd.styles.tableheader = {fontSize: 8, color: \"#000\", alignment: \"center\", fillColor: '#eeeeee'};\r\n dd.styles.footertext = {color: \"#aaa\", fontSize: 8};\r\n dd.styles.datasource = {fontSize: 10, alignment: 'left', margin: [0,10,0,10]};\r\n dd.styles.termsheader = {fontSize: 16, bold: true, margin: [50, 500, 50,10]};\r\n dd.styles.termstext = {fontSize: 10, margin: [50, 0, 100,0]};\r\n dd.styles['N/A'] = {fillColor: '#eee'};\r\n\r\n dd.styles.tblcol = {margin: [0,0,0,0],fontSize: 8};\r\n\r\n dd.images = {};\r\n //dd.images.logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL8AAAAwCAIAAADPbjxcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAApbSURBVHhe7ZwJVFNXGscDYQtLAIlhF2SRRVREwAVEEFyqFMdKxb2gVtx66rEdZ449cqy1FcdlHGc8dlDHrTOWI3WpWKqjuBQUEQSVsVh2MARCZE8gIYT5yLsJLy8QIYGUwPuZ8/y+ex8v7738c+/3vXtvdLq6uigkJCqhi/4nIRk4pHpIVIdUD4nqkOohUZ1RoR52A+/y42IyPxh0Rn7O9bS4dnbCFYFIvCrY/btP5uno6KAKErUZ+W1PA08A0gHjPxlFX1zKwgpJBoXREvfo6erA69CPeQWVb1ERidqMFvVYmBjuXR4oEnd9eu4XVESiNqMo59oZ6WtubJBewErNLUdFJOoxitRDM9BbMcsdjJSsYqyERE20KecSi7tuv6h0Yph5OYxBRf0g+VHRimO3GWZGdWc2ZBfXTt+dYm1OYyfF4ZOvv6e9uP28EjlKWejrtG3hJOSMerRGPRDtrv3Hnfxyrq4OBRLvlcETUIVSuM1tQXt++I3dhKlH1Ck2WHkSLrj4+BpXG3O0E4Wy4WT6v+79ihylfBzunRQfhpxRj3b0XE+KagJ3XwbpgC3uonCa27By5dQ28ufv/xGkg3zIvKi6VmZGYHBb+nUEEuVogXrYDbylh9LahJ1xoZ6h3nao9F1ceVLi89mlPElbhcdInwrb9o5OzCVRBy1Qz4GruexG/lwf+1Obw8xoBqhUKTF/vbXsyM/clnZXa/rxuBBU2jdR/s57lvljr0VTnVCpFHxt5DRnVEqiFeq5nFUC211RflRddLbXskvTC94oidhu5JbBFmKUnMTl7rY98U1fLAlw2RczHXtFTiOqZ2lgT22U/3hUSjL8o2ZBR6fR6m/BYCfF2liYRB28eUP6tMZ5rNm6OR6xoV7jmXSsRIbRqpMCkfjV0ZWQnUEyteDrG1jUDFWOm8+9qefd3/uHOd722M4ETt5+ufX0Q+RIOLt1LrwLciiUjMLqewWsrKJaThMf7p2FsWGAGzPY0/Y9XyddaTfZLhTdLXiD2XgM9agedhaODDPky9MpFv/0rCLzNftpCaeRJ9DV0bG2MJ7hbh0+yXHmBBu0E4VSXc/LK69DDg44B3Njw9Z24YNX1aiIQpnixOAJOl5XNyJfAXcbc1kOm1PCufOyKuu3WlZ9q7iri04zmObCDPK0jfRz0tfr7vEJ6KH/hysdnShAkTU8gLeDZUVdS3ldy76UnK9SckK87aB58HdhBroxe73IweLN29btZx5ez+lu2PBgQpnuZp0UHzrZiQF2A08QmXhTUtkL4ximq4InJEQH0Ax67v+z0rpNSfdyS4myuPmsYk9ydvQM17/FzrYbYwIlIN+YY7exWjypf1682M+ZVc/Dv/X5beGltc1fpjxFvgK7oqYeXDMLktOdFzIvPnyNSqXcf1V9JDXfx3EMZJp4BWNoQc+lyKaIieykuFPxYRGTHKi6OvBV23EuIzjhCsQ6aI8hQCzu+uBwmqJ0ZDwproVGrqVNiPy+qeS2Jl575rcruYrbgpU0tLbP339dUToyUrJKYo7dUt5RKGlg3slHJ+4qSkdGQVU9ZK81jTzkS9FK9QAQPm8M9/7vniU1p9Z/90nEYr/uYAW+ZFjtUPD9oyLoUJAjhZDQ1TTy/3I9DznvorC6cZ+0Sfjmau7bVgFmY8C3AllSMgrZV7NLkdMbhawGZA2QOy+qfsqrQI4Uwgm0tnckJGcjR4q2qkeGlZnR6tkem+f5IH/IeFJUiywpyTvm5x9agRwpWUU1yJJnzewJF7dH0Gn6yJdw9n4hRBhgQBSFlcj439GV0OkgR4ribnj6anumjmfE9vawY463HZT7uzKh1URFUo7HzS4/sY4gIMVL03r1aIw2oQhZUsJ8HCaNs4J4HPkS+ALibhhe9pZrQjw2zPVGvoROcVcZp7u9JBzcztLYw85yro8D8qXwBR3I6o2+2h7IKM9uDd+6gDjAEh8xEco/nOnWy6VNtHewMoUAH/kS2oTEh2SkelQHciLZtp/gw2SMXtU2oCNbmhhiBqe5DeInzFYTLHl85wmQ6tF6nMb25P/qBM4qQKrnd0YxOh4o+P6FVM9IhpByg3KmSJ4PqYOnnSWyuvM4FdMu1SDVo1G4LXJxCUSsDDoNOariad+jnteketRnGA6+pBewPruQgZ9FFOXvfHrzIEwVcrWmy7o/sucamdwteHM09Tmk6PA5+zozkjaFXvn8PVOjfk0ZUI6hPlU20lfEbhJ1di8/0gykejQNtIv55dxNSffHbTmfV9bn0MSA8JQGzh2d4vI6NPqhAUj1aIgpTlYLfcchR0J1A3/pobRBmeOAD31UHq9QAVI9GiLY0zZt9/uRkvE4GRXcFuhrkKMG8oGz5kIfUj0aZYF88wNUvR2Ejgb/yIdse0YserhZShgQRyNLDfCPfEolA2eagVTPSIBBp1mZotEuVj1xFs7QQapnhIAPfTQGqZ4Rggeu89IYpHpUB0u2u4bgyTZ2xAEd2dNebi6OmqBLe9f7jwT1wKXWNvHBgO220w9iT9wJcGV+HO4NEYDiVFyVUZzrUvW2tYkvaOLLTWSWLavoJ1jUTJhJ09AqaG0XVnK7px3iUTLhBh84DxQd+CcPXJpQ1Em4e4pXpsXq4TTxj6bmv5+Yythw5vMLmR/N8dgXE7h+rtep+LCMr5YlxYdFTHa0sehehDAoMMyIw5kbv02PPvKzUPLDZDIIUw0JKH762Oww4gRFoQiOvOXUfeRLUTKkqk7cw6ATz3nn+Uw4AcJUa2wRN57hrh59KjVmlhu8sBXEIV52YLvZmN/IKfvTvx/nlHDoxgYHV89i/TP23LaILfMnTXMhLsqxtTRZGeS+JACt4mOa0/r8/iplfZiXgZ7c7XpWxr3zkrhoS3ECKB4TQ7l5zQA2Kq74V7eeVz2vkPuZM5oBNS7UEzkKjGfS9akqfpqrgicQJlz/ymqQrZuTsU3hJIe/enQdxpjC68vLT6GBqWnkg32vgPXgVbWVqZGdpYmthUkhqyEhORtqe31dfPga7iz8VeK13B+ySi59uqDh7Ebo2tAb9BtXG/O9HwYipw/WhnjMm+yInN6Y7m6NLCm/FLJhu9jPaflMN6ykL/avmNHXMkJAj6oLXyrkDJCxdNrhtUHKu9yFvuNAZMiRMtzXkoo6xS7bLyJnkDAx1HO3tbA2p4VOtI+e4WYoadVkfJ9ZtPey3NKTA6tmLg10weyMwuo/XnyUXVxLeMjnZW/55fLA6Bmu2M8C1TW3hSRcwaow4NbviQ6Au73oQGo57oGesaHe46+jDfSoUHUps2hfylPCUANVV2e6m/XhdUGyxXhpeRU7z2dgNnBt1yIs4YKYL11hAWvi6plLArpP/lZ+5Q75X907si5okV/Psvy8sjo4bEYhWyR/bS5M+hcfTIsN9VIM6Ya7eoYOiAoruS3lnBbozqeOH4tK+weEtDkldRB4wX22NDH0d2UqxgQqw21uyynlNPKE8GFZWxj7uzBNjIj93dDRJhTllnKq63lwadCdQSQA54DqFBi96iFRHy3OuUh+ZyiU/wPMJO0MrJVkbgAAAABJRU5ErkJggg==';\r\n dd.images.logo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDUAAAEICAYAAABPrM81AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAKyLSURBVHhe7f0HYNzZdd+LfzENGPQOdrDX5bJv3yVXzSqWJTlykW1ZtuMS23GcHj+/vOg5/5fkpTzHz/Fz4shNlmXJkSXZkqxV8Urk7nKXvS47WEA0guhlBlOB//nemcFiuSABkAPMAPh+dg9nMPObmd/v/u49955zzz23YHR0dAxC5JiCgoL0s8kZG1M1FUIIIYQQIttMNQ4XIt8Zd2qoMgshhBBCCCGEyHcmTnjKjhWe9KMQQgghhBBCCCHEvEKRGmIcLfEQuSIWT2JoJIrBUAR9QyMI2/NRe83v9aK0LIjK8iBqKkpQXOhPf0IIIYQQQgjxsCwk+19ODTGOnBpiLpmoc3oGQrjS3IXzNzpw8koLWtp6EB8Mo6KkCOs2LMfOravw3I41WNVQpXoqhBBCCCHEIyKnhliQyFgUc0U0nsBAKIKBoRH0DYTQ2tmPK813cf7GHZy82oaW9h7E7T3n1Fi3FHsea8SL+zbg8fXLsKy2AmXFhelvEkIIIYQQQswUOTXEgkRODTGbTNQxnX1DOH+9A2cut+DU+WY0t3VjKBTFwEgUfSMxhKMJjCaT8NtnSgt9WFJbjnVrl+KZnWvx0Re2Y3NjffqbVG+FEEIIIYSYKXJqiAWJjEMxW1DNxBNJ9A+G0XanD9dbu3D+5h2cudqGkxea0XF3IHWgxwP4vIDXHqmTRkeZcANFAR8qqsqwa/NKfOzAdjz12Go0LqlCRWlQ9VYIIYQQQogZIqeGWJDIOBSzAXVLJJZwCUDPXmjG37x0HGevtGIgnkR/JIa+cBQj8UTKiTEu7oOslICpKK/96fcUoKq8GCuX1eCFXevwyQ/sdctRMqj+CiGEEEIIMT0Wkv2vLV2FELMOozQGh0fQ3NGL4282441zN3HxVifae4cxkhxNRWdkIjQ8accG4aO9lrTHSDyJOz1DOHW5BQdPNeHQ6es419SOAfteIYQQQgghxOJETg0hxKyTSI5ieCSG4UgcCS4x4daslIAvteRkKk8x36fTw44dTYziZksX/uybx/G5l06g+U5f+iAhhBBCCCHEYkNODSHErJPJqRFPJjFK/wUjMsajMlLHPBAeY8eOmYza097BEZdk9NUz13H04m1cbenC8EjUHSqEEEIIIYRYPMipIYSYdRhoQfHYP6n1e9PxZEwCnSC+lDNkNJFEa3svvvbKm/j64Qvo6BlKf7cQQgghhBBisSCnhhBiTnDuhmz4HAoKMGbfwxTHfYMhnL3cgjfO3MT5pg603O3HSDSePlAIIYQQQgix0JFTQwgx/ygw1eX3IZocQ0/XAK5ea8MrJ6/iyJu30DsYVsSGEEIIIYQQiwQ5NYQQ8w/6LDwFSNpDOJZAR9cATp6/hRPnbuJ2Ry8GQxGXnFQIIYQQQgixsJFTQwgxf2GOjYAfQ9EErlxrx+mzN3GBy1A6U8tQFLEhhBBCCCHEwkZODSHE/IVOC58H0bExdA+O4HprN46fv4lDJ67i0KkmnL3WjoHhSPpgIYQQQgghxEJDTg0hxPyH28MWB9AZjuLlI5fxx3/1Gv7L517Gn33rOJo7+xSxIYQQQgghxAJFTg0hxPxgLC2TwWUofh9CiSRu3OnDqSuteO3MDbzB5SjXO9DWNaBdUYQQQgghhFiAyKkhhJgnPMirkYYRG4V+jAV8GEsk0d01gKPnb+HohWb0DY0oYkMIIYQQQogFhpwaQoj8ZgwoMPEUFDgpGLM/KJPhcmx4Aa/XPlaA/oEwzlxoxmmTnr5hJEdHp3KLCCGEEEIIIeYRcmoIIfKcsZSvwud1UsD9XOmZeJB3wu2K4sNgJIqLl1tw4fwtdPUMIhpPYmyM36eIDSGEEEIIIRYCcmoIIfKX0TEgkURlMICd65c5qSwKAPHk/aM1CJ0WXg+iyTF094dwvbUHJy+34s3rHdoNRQghhBBCiAWEnBpCiPxldBSIxtFYVYqfeu9O/NR7dtrzEnstBiSncGwQtytKIdpCI/jqq2/iKwfPuaShQgghhBBCiIWBnBpCiPyFTotEEhWFfmxfsxRPbWvE4+uXobGhCsVen703mormuB/pXVEGInGcb2rHqYstuN3R56I14vysEEIIIYQQYl4jp4YQYg6ZIrLiXng4nRZp/0NtTTleeGozXnhiI+pKi1wUh4vmuB9chuIpcAlCo8Mj6Ovux822LjR39rktXpVbQwghhBBCiPmNnBpCiDmB/gPnRJipH8H5QfjPGCrLi7Fzyyrs3taI+poyBPxetyPKVPk1+G4iOYqe/hBOX27F2att6B8eSb0vhBBCCCGEmLfIqSGEmHXoxygo8NgjVc5MvRpvURoMYO3yamxcXY8ly6pRVlUCn8++j9EaD3JseOx3C/24G4rg+yeb8P1jV3C3dyj9phBCCCGEEGK+IqeGEGLe4Pd5UVlWjNXLarDnsUZs37AMFYUBIJaYOreGfTYUS+Jmew8u3+rE7Tt96B4IIcadVIQQQgghhBDzEjk1hBCzDt0No2Oj4H+pvx6NpbUV+PCz2/Dhp7ZiWUkREOFuKFMl/mSEiP12IonhwRCu3urE1dtdGB6JKreGEEIIIYQQ8xQ5NYQQ847ykiJsXb0EOzYsw8olVagoDcLvLZgitwbF/jHpH47gTFM7zlxrd8+FEEIIIYQQ8xM5NYQQsw79CZ4CjykcqpxHi4oYGxtzvgm/34OKihI0rluClWvqUVwUcFEYD1yG4j7oRU84ijcuNOONN2+iZyCUflMIIYQQQggx35BTQwgx76BbxOvxoKayBDu3NmLnppWopFOD+TGm2AkFXi/CdlzLnT7caunG3Z5BDIUibncUIYQQQgghxPxCTg0hxKxDN0M2c2pkqK8qxbt2rceLj69FXbBw6twa9IZQ6PiIxjEyGEZbZz/auwftowkot4YQQgghhBDzCzk1hBDzlpKiQqxZWoMNq+qxtLYc5aVF8HtNrU0VrUFGx1yExtWWuyZdGApHU68LIYQQQggh5g1yagghZh26EbKVUyMDc2vwP35lcWkRlq1uwLKV9SgK+IHE6NRbvAZ86IvEcOpaO05dbUX/UDj9phBCCCGEEGK+IKeGEGJewyUj5WXF2LJhOTavX4ryYDph6JS5NTwIReO43tyJpludGFakhhBCCCGEEPMOOTWEELMO3QtjY6P2mN2cGhmqy4N4YstKPLFpBapdwtDE1LugeD2IxhLo6ehDb1svYiOx9FsFToQQQgghhBD5j5waQog5gYETXDIyCz4NlAYLsW5ZDdYtr0VpSSEKuLyEPzRFtEZydAzhcAx9gyF09g6hZyCMGHdQEUIIIYQQQswL5NQQQswh2Y+AoKPE5/WgvKwIFZUlCJQVo6AogAKPqTf6NB7kRHG5NbwYiidxpaULV5rvYigcSb8phBBCCCGEyHfk1BBCzHs8ngKXILSiLIglDZWoq6tAod8LjDLq4sHRGvB6MRRN4EpLN67cplNDuTWEEEIIIYSYL8ipIYSYQx4UNvHolJcUYduaBmxrrEd54TR2QUk7NYajcbetaz46NTI5PiS5ESGEEEIIkd8UjI6mRvwavAmX70CILEPd0jcYxvW2bhw8dhWf+5s3cK6pA+AuJT5v+qj7EEsAQyM4sHsdPv3rH8GBJzfft57yd9q7B3HicgsOnriKv/3+OVy93QXQueG9j/+W35UctVPxobosiOd2rMUv/PCzePKxRvuYzy1rySUJO7eIlUE4EnPOlngiKV0962TqVwGKi/yoqShBMeuQEEIIIcQCYiGNKeXUEOPkm1NjqjopJ8z8gPexf2gENzt6cOjYVXz2q6/jzLX2rDs1CB0AfXb8wRPX8Luf/z6OXmwGuAyF+TXuV5/s+7zJMQSSSezdvBI/9yPP4fk9G9BQU+YSkOaqnrHcuM1sR88gbnX0unwffUNheL1et9xGzA5v3e8CrFpShed3rMGqhirpGyGEEEIsKBaS/S+nhhgn3wbtrJM0UgeGR9wjq6jfjOBgod/NovO5V8Zd3sP72DMQMqO8CwePX8UXvnEUb964AxT5s+7UIPy9w2du4D9+9rs4dKoJI/Ek4vwMKxBlMrgFbCiKx9YuwY99+Ensf3ITtjQ2oLayJKdOjW4rt8vNnThzpQ1Hz95Ee/cAvH46NbRycNbg/eYtt8fHNyzHT31wnz0uyzv9KIQQQgjxKCwk+19ODTFOrgftk9VBbrN59lo77vYNufcrSouwvK4CDVVlqCovdg6ODDI68hPet7auARy9eBuHTlzFS4fO41pL94OXhWR4SKfGqcst+MzfvIGDJ6+h7e6AfUXU5c6wN9NH3UMiCUTjWLe8Bu99fhv279uIZ7evwcr6ypzVq0y5Hb90G4dPXceh1y+hub0HBVZuBTleFrOg4f1mt5hM4pkda/HPfva9eGbnOukXIYQQQiwoJrO95ityaohx8sGpETbDkrP6/SZDZsy23OnD2RsduNs/7N6vKCnE8poKLKkpR011GeqqKCUuQSQdHLnOgSDeCe/blVud+Jvvn8Whk9dw+kobOvqG31oW8iAe0qlxyX7vywfPOqfGefu9u71T/F5y1EVrLK+twL4da7B/7wZ86Okt2LCyLqdOjZbOfhw+dxMHj13Bdw+dx43WaTqDxMPD+836kEjigNWDT//qh3Fg30Y5NYQQQgixoOBYc6GgkbHIOWxQmUbV0x9yRtxffPMEfvt/fgu/84ffwl9/+yS+9/olJ994+Sz+7MuH8Xuf/x7+y59/D3/49SN4/fwtN6M9Eo2Pf9dCaqTzlfH7YMZgf+8QzpxqwunTN9A3HOE6Ijtg9tQPHVwr66uwsq4SxfytUTNSH2STsrrYuUbMkL1rdbCrL4RonNvB5hg7L/phPF4rS589oWNGMndC55FUiRBCCCFEXiOnhsgp3M2BO2PcbOvBsfO3cPD4FZd3gbtXHDQj+MiF27jU3IWbHX240d6LK7e7caapHUft9VfNQD50sgmH7PhX7PjXzlzH6autzsExPBIFd44QuWUwFMHFW504eaXVJbpk0stIImGaxyzFWTQW6dRYWlOOpdXlKGLeDgakPXCmnd6DAkStPnLJEyUSi6ffyx0sIjqGPHQQOe+GZG7F3QF3L4QQQgghRH5iozYh5pbMDD4lFInjensvXj52Bf/f57+P3/vc9/B3r13AtdZuDLF2lgVTu2Qw5J5SZM+LizAa8CM+OopW++x3Dr2JP/rSYfz25w/ij79+DMcv3kZnzxCicSYXlUGSS1q7BvDlg+fwZbunrYzQCBamclvMMkwky2VJdZUlKOTvpVbZ3R9WEzNiGamRcmoMuuS0QgghhBBCiPxGTg2RE4bCUVxuvos3zt/EqyevuWgL7lRx7NJtXG/vQc/QCGJ0SNCRwZl2hoFT0iH4Y/Za0uzUgVAETW3dOHWlBYfPXMerp5tw9EIzrt7uctthitzApUCMmLlwowNvnLuJM1fb0M/Ih0JfevZ7dgkEfKitLEVtRYn9pNUZF6mRfnMyWNfsvBjdMzwUxvBAGAnuiCKEEEIIIYTIa+TUEHNGJjqDcEeKrx48j8985XV88RtH8eqJq+gKRYCiQlqkmDLngptZN/HbP8EARs2IjZkR2mnfS6fGscst6B0ccYeKuYX3uG9oxN2H18/cwO3bdzE8EEotB2JIf7oOzCaFPi9qyktQa1LoYaQGc2pMEa3BSsVzDMfolUk9F0IIIYQQQuQ1cmqIOSE5OoaRSBwdXQM4+Waz282BeTNeP3vTbdna3DmAMBMzcladMp2cC252ncd7MWaP3MgnZMYo8zbcccsHcp8TYbERSyTROxjCjdYuHDt3E6fsXt/tHkLM7q1bATIHDg3i9XpQXOhHsMgPL+sTf3fK+sR/7CSTSYzZdSQTo1ZvRx8Y4CGEEEIIIYTILXJqiFmHM/dMCNpjxu6pi834zP86hD/8X6/g3KUWDIYjSNDoNOPTOTMe1ujlx+yzHjNm/T6vk4I5WOYg3oL3OTQSw7WWbpy8cBvHTzbh4pVWDEa57MTu7xzdD2696bbf5M/xN1mvuHQp9Wbq8X6w/tmxo/Zh1tl4POm+KxNhJIQQQgghhMgv5NQQswpn6Lv7Q2i6fRfHztzAwaOM0Ghyu2Hc4Q4TnBFPR1s8tEPDYZ+1z9P49Nj3eQo89ooM0bmCS0uGwhG03OnFiXM33b1uut2F7sEwogzRoFMhB44BOrY8AZ+TgmltIct65EFybAzhSByhkTiSTN4ihBBCCCGEyEvk1BCzBh0MTAh66VYnXj5yGZ//yuv4+nfPoL1/OLWLiRmauTJ2RfbgfeZOIe3dgzh3pRV/d+g8Xjt+Fd3MS1FcmIqUyBHcBtVndc1X5E9F7tA/MZWPwg6LJ0cxEI5gMDziIjaEEEIIIYQQ+YmcGmJWGN/94noH3jh9Ha+euOYSR15p68YQd5Xwp3c0kUNjXkODv29wBDdbu3Hs7A28frIJ56+1o8XufZiJNh85AufR4HKkQKHficc5NabwavBUTRJjowhHYwhHYi6vhhBCCCGEECI/kVNDZB3O3Gd2v3jptQt46ftncdQM3t5YAigpMkOXO5vImTHf4X0OReK40d6DN87cwFe/eQLfffUCOkPR9H32po/MHV5PAQoDfhSZeFnnpsqp4ShwhzGfBhOfMgGtEEIIIYQQIj+RU0NklbdFaJy57oTP23qGMEJLkUtOOGMu5jVcbtLRPYhLN+7gyJkbeO1kE05dasH1jl4MJ5N5c5+9Hg+ChT4nXu/0z4e79UTiCUTjSZdfQwghhBBCCJGfyKkhssbECI3vHrmMw8eu4mJTOwa5DCHHuRXEo8P7m5H+4RGcutqG77x+CV/79km8ave6KxLPmwiNDG5r16IAgoXpSI3pbNBqx9GRwS2BI9EYRll/hRBCCCGEEHmJrEyRFRim3zsYwo3WLhzj7hdnb6CpJb37BWe6p5NbgfYmQ/0TZkTGk9xSg1Pm01wyIOYCJn69avf12IXbePVkEw6fuY6z19rQ3NWPMHNP5FkkjsfqXMDqHoXPp5Uo1BizehiPjyJmMqr6J4QQQgghRN4ip4Z4ZFxuhZEYrrV046QZu8fN2L14tQ2DTAjKXU6YEHRamPFIJ0Y0xvUNJnFmokw5OkTOyERnkI6eQXzj8EV8/qXj+PYr53H+cgsG6Hwqnsl9njt42tzil8tQ3BVMpyqlfR+M1qBDQz4NIYQQQggh8hc5NcQjQaMvFk/ibs8QTp1vxrEzN9B0Ox2hwaj9aUVomNXIWX6TiuJCbF+7FE9va8TuTcuxblk1Sjn7r4iNnMAkmZFoHHe6B3HyUgsOnrjm5Ijd66t2nzsHwojwtvjzNVdKgYvQyDhlpgsvidVNVU4IIYQQQoj8Rk4N8dDQUGRCxVAkiubWLhx67U28dvQKukei08+h4ZabJNPLTUaxqqESn/jQE/jHP/Ne/PzHn8f7nt6KhooSRWzMIZnIDIrbsnUojNNXWvCZL7+G//lXr+Lkm7fQ0z+MKP0EhX5gBgk4c4FzUKSeThteUX5flRBCCCGEEILIqSEeiYHhEZxr6sCRC81483o7WphbgbtfTBWhQStzdMwq4JjLd1BfVYrdm1bgwJ4NOLBvA57ZtRaPb1qOVUurUOy371KkxpwSjsTQ3NGHM1fbcPhUEw4evYKDJ5tw8nIr2rsHEY7FkeT9pePqQfd5Igp9EEIIIYQQQmQZOTXEI9HWNYi/fuVN/PXhi2gLxYDiIm45kX73AYyNuugL3+gYSooLsW3jcvz9jz2Dn/3IU9jYWO92reCWmuGIGc+K0JgTMtEZ5G5fCAdPX8dffPME/vCLr+BvvnMa7V0DKWdVRmay3ITOjPQSIzk2hBBCCCGEENlCTg3xUERiCdzpGcTV5rs4dfE2Lt64g0F7DQG/1aoHVCsatIkkPMkxFHq9qK8pw+4tK7F/7wYcMNm1aQVqKkqccZ1IjiKeTLq8HWJ2YV6UnoEQrrd249j5Wzh44qqTV083uS16r7R0YYiJW5kMlDJVdAbvGaNruKwomoDf7nd5UQDlxYXw8/O6p9OCpTRmZcXcJmMsTy7Vmk3hb9CJmK/3J1OvJjv3bAp/I1MWM168JIQQQggh5hI5NcSMocNhIBTBmaZ2l2uhu6sfiUjMhv5mBLBGPcje5Xat4Sj88QTKSoqwZf1yfOJ9e/AjL+7AirqK9EFiNslEZEyU4ZEYrrZ04ztHLuP3vnAIv/8XB3HQnt/q6EXI3kdJIcBlQNPJNJExPLmLTTjCfWBRlExiWU0Zltk9LuL3KGJjWtChQedewgztMToNo/HZF+av4f3Lt/vD82G94flNdt6zISxzRYoJIYQQQuQ1BaOcAuQTGi5iUUMDaio4oz8UjuLyrU68fPQK3jh7A2cvt+BO33A6aeR9/GSsZmbYVgT8WFlZgvqaclTWV2LXtkb8vQPbsWV1Q/rAFHd6h3D2WhsOHr+Kv/7uaVxuvpv6fi57mAx+vxl+laVFaFxZ53Jz/MwH92HnhmXTuq7FAg3kSCyO/sEwOjv7MByKumUkPUMjbkte5tB4/fR1tNh7phRS95NOiAdF32RwRifv8yjK7F4tqypBZVEAARSgrCyImmXV6B+J4eSFZpeXY1rfS6PSzu3A7nX49K9/BAee3Dzt+0mdduZaO/70m8dx8OQ1NLd0oX848uClM5ylN2N286p6fOQ9u7B/30bs2rgcS2rK5rwe8fxZTietfR21dva6tbfWjl4UcKeZ+7Wzh4S3mr8XHx3FiLXxsJV7yIR/uzdzDM+gAGMotmuvLSlC0OezqsbtdmfhnvA7+d2mr57cvga/9sl344nH18z5/RdCCCGEmE0Wkv0vp4YYZ6pBO+tId38Il2514siZ6/j2wXO4cOMO+s0IivCzNBTvV484u2oG9LbVDfixD+zD7scaUVZejLrqUiyvq0AZd0tJw9+RUyP7sFyHw1F0dA/gzJu38G0r1+t2L7lkKGbvD5kxT6dDT2gEYS4b4b0cl9R33BeWMe9BehZ9k92DD797B3ZuXonqsiC8Xq/7/jNXW/Hlb5/Cpcz9nMo4X+ROjX679psdPbh2uwuXrneg19ofy7JgJvlMpoHHvs/rLcBQOIaWrgHcvtOH5vYe9IesvHiPWAdyhZU7t+X12jk2LqnCs9tXY3ltBeJWR5OMKMkyY/zPfpPLfdZZPf7As9uwflXdnN9/IYQQQojZhGPNhYKcGmKcqQbtrCNNrd146Y1LbjeMo2YotjF5JB0SnD2+H/a9fqtmQTMSnn18DX7tU+/Bs3s2IGhGrd/necfv8nfk1Mg+LFfeL+bIOGT38KVvncS1m52pcmXUBMuWj5kIiunoBJatlX2BPfL7GZnRWFWCJ7Y14sPv3YUdW1a5HCmxeALNHb04ZPfzT758GKevtQPBwP3vZ4ZF7tQYsXPpGwyjqz/k2gR3pfHa63wvm2ScGt0DYVy0OnHO2t4pqycd042omU2s3HnNfjuPnRuW4xNWr7asWTKLTo2ULqSw7jKKrLayZM7vvxBCCCHEbJLt8WQukVNDjDPVoJ115NjF2/hvX3rVGYk9PUPO6Hqg0cPqZYZHuRmwzJnxwq51+NmPPI1dm1e6mdfJqh1/R06N7MNyPWNl+qd/a0b+iatotjLtHxxJlakZtO5mUGjwT3ZjJoNGZSzhPuK1+7Nj43J88r278eyONVjWUIXK8mIErH4MhiK40daDg8eu4nN//QbONsmpMR2480/czikaT7jkvDTiZ0NXp269tbueQZy+0orXz97Ay29cws323lTy3ywvd5k2LHMTn/1+kdWvZ+gU/fjz2LdllTX5lONhtuB3F/p9LoqMdVgIIYQQYiExG2PKXJHD6Tcxn6DtEE+MYnB4BC3tPWi704cRGoCM0Ch4QDVKfdDtfLFt/TJs37wCNZUlLkJjVtqRfSlD1Z1dnn5JvAWXn1w34/56Ww+G6ZCgY6HQ7iHvo3Nu2L2c6sbwnqYTNnLRUG15MdavqHPRGQf2bsSBJzZhz7bVWFpX4aJxvB5G4zClyqgZ6aPOWBTTg44/lmFlaRBLqsvcUq1lteVZl6U15e776ypLUVkeRLG1Vx/bdT7cKjsH1kiP1aOigB9VZUE0VJfaOZdNei3ZEpY1IzTk0BBCCCGEyG/k1BBTQi8eZ4xHInGEh6NIDEcwNhJLGbe0Nh5kAzOCIp5EbbAQz5jR+/Rjq11I92yRMn4o9ix9Xjz/heSJfBRGk6OIhCMmUXdPUw6MGZQNjVxG/MeSgNWDcvv81jVL8P7nt+FXPv48Pvn+vWhcWu2+ks4LOTAenUw5zra437L/GLw3mm/OJ57KhPMkE899NkUIIYQQQuQ3cmqIacGcCN0Dw+jpH0YsEk85K8iDnAVmENC3wKiMivIg1q2owdrlNShhdEC24WlYbU7ab4ZH4ugdCKO9awCdvUMubF+koFMjYfcvEY2nDDaW2wNu4Tg8lksfzNjlPeUyHyZ9febx1Xhhz3rs37sB+3evw+Prl6LC3hPzFLvNdGqMZdp3nsCzsbNKPxNCCCGEEOIt5NQQ04IJCm939uH23X6EE4mplynQ9hi1Cub1oqiiBKXVpSgtL3Zh7Qypn5UZUI/HLYnp6B1yOTiY/+NcUzsGhkfc25mIjUUduUFjNW73j+KcGtMsB34uGkdBLAGf3b/Vq+rwIz/0FH7xJ17ED79nF57c1uiWBWiGWwghhBBCCDGXyKkhpsVILI727kG09QxihNt9Tpl7wYzasVEEfB5UV5WitqYcpcFC+H3e2XEo8DtNEmZ8D4WjaLnTh+MXmnHw+BUcPHIZr524hpOXbuNqSxe6+ocRjsRTyy8WG3Q2MJcGZTqOBx5i5RS0+7aspgxb1zTg6e2rcWDvBhx4chOe3r0O29YvdfkHmPtBCCGEEEIIIeYSOTXEtOASDi7l6OwbRiSZtJozhWOCxnByDMV+H1bUlWN5vRm9RbNs9BYUpGzw0VG3TIZbUn7126fwO3/0bfynP/gm/ueXX8PXX3sTb964g+6BEGLxpHOw3CsLGl6eu8aMTMFYKiFoZXEhdm9rxEffswv/8Eefx6c++ITLpVFSVDh7kTdCCCGEEEIIMQVyaohpQQdA90AYPSaxhBm63BnhQQ4AGrlmEAcDXjeLP5cz+TSvR2IJdHQP4dKtuzjCiI3TTTh40uTENRw6dgWHGMFx8pp778rtu8q9cT8YzcKtcosD2Ll5BQ7s2+C25eVWuXXpnSG424wQQgghhBBC5AI5NcS0iJthy+1cB0IRxLl0YTp2rFu24MPyWjo1KudueQKNbG6BEvCltiwtK8aIz+tybZw6fwt/9c0T+L0//z7+7z/+Dn73i4fwtVfexFnl3pgceogSo6goKsT2tUuxfd1SVJQEU2+NKXeGEPdyr/7IlQgxn5isDudChBALl8nafC5EzA4Fo0x1zycq5EXP/QxU1o3jl1rw+18+7KIbunqGEIrGHpxXI5EEInE8tnYJfuxD+3Bg30ZsbmxAbWXJlIYwf+9O7xDOXmvDweNX8dffPe0Sf4JOEZ83fdQM4W/SGcPzYk4QEvBhaX0ldm1ajh3rl2GHGe3L6ipQGAygpLgQFaVBlNkjnTF+Xus8h+V68Ohl/Nb/+zc4eOo6UBZMOX4eBBOKhiLYv2sdPv1rP4QDT2wa1xXTdWjw+N7BMJpautz9/PzfHMG56x0ph9NU95PRM0MjOLDbfv/XP4IDT26e0e+eudaOP/3mcVdvm+33+4cjqd+83/Ip1o9oHJtX1eMj79mF/VZvd21cjiU1ZdP+3fkKy6v1bj/eePMWDtl9+varF9DU1pNqd7mq/yxz66J89vvBoN/qwXr8q596N559fE3e3g+WY8J0TTQWd9FfI1afGOkWTyaRSIw6BzGfJ5NjppJGXW4f1w3zejKSgW3NhN9ZYHWWW1VzuZfXyoNl4vN6TTeZ+L12m7zWnH0ueorCv7107gqR57Atsx3ErG1Erc1Erd9hm3Hthu1lvM1k2os9WvtxOiDTXh7Qbia2GbYXny/1mGk3hX4fCgN+az/WZrzWzvh5IcSCIqNnqE+oZ9g/Z3TNeP/MR+qZtK7hTnCT6pmMjkjrGac3rL/N6JqJeibVH/tQZOPtQhPmFuRx/Fw+kC/nkQ3k1BDj3M9IYN048mYz/utfHsKhk00YMCPTLdWwRmxvpo+6B1MaGIlhx4Zl+OmPPY0D+zZhzbKa8R0yHgR/L+tODcLfZXWfoJSKTNlUBQtRWeRHhQ1qqitLULO0Gmsa67Fj/VJsNON2ZUMVKkreuU3pVNeRb7BcH9qpsXMt/o9f/TD2P7nJGUr8ruleP4+VUyP/YXnJqTF9WF73I2S6j0va7vQOoqNn0C3bGwhFMWj1j/pzaCTinB0ZidPRyrpnxpq75sy18TdsUOThIMh0VcDaa5HpqWLTVyWmt+h0pW6qKg2ipqIE1eXF9ph6XldZ6nabuh/5Up8fVI7zkYWuJx6Vye43jQwm7+4fHkFn3xC6+0LWZkKu3+iz9sII0SGTUCRm6jmOaNSMESb7ZpvJtJeMkHvaTWGhDyWFAZesvMzaS3lxkT0WuvEIJ1rqq0rRUFXm/ma7ohFyP9Rusku2yjNX5XG/819oeu1Rmat286Byn6hn7pqeuds77PRN76D1yeyfwyk9MzwSdRO31DNJ65tHk2k9c4/9kBGv6ZlC65OpZwr91jdbvztRz1SXB51+qa8uNV1Thkrrr9mH07lxP+ZSzyykuiqnhhjnQcr58Lmb+I9//j0cOtWEERuwuyUoNAzvV2842DDFsHvjCvz8jz6PA09sdEtQyq2hT9VY+Xuz4tS4F55H0oTnSuM9FkexGQnOqbGqDjvWLcXGFbXOqVFng57SkiDKS4ucEcGkp/TAcuZ0vsByfVinxgs71uJf/+oPuh1PvLxu+67pKl3+rpwa+Q/LS06N6eFme2ywQ4cEd1saMl3HgVDM/h6zOjRsr3Gw1GmDpo4eM9Ks/g/aoInGGZe58Xjn0DCd83anhl0TrytzbXZPUsaZBz46NdIzyhwQlVr7KTMDrJzGGZ0a5Wmnhg2g+LyOW2mbPvPa/Suy43ksnSAUfkdqpij1M7mCww/2JXzk/eR/dlbpd/OTzDmyvbD8Mo/UiZTM3+Kd0KgImVFBpx/bS5jtwJ5zy/iwPfabru/sH3aJvFNOjRH0WXsZpFPDDA46NSLWJzmnhrWbJPN7pXXE/doNnRqcIS1xbYb1P21sWDuoKityDsD6ypK3OTWKrW0VmRTbc36GbY2PdHbkQz/ACC/OLrPdsL7NJ1LtJ9VuOH7KxjhqLstjOuefqpJjptIz5zXqquRihO2FE2FF1g+xH59teF8Y8RVinxyOub6WeiZi+mXE6Zm0U8P0jJO+4ZRTw/ps59QwcU4N01OcvE05Ne7RM6kfGreBvKZnCu366NQosj7aOTUm6Bk6Neg4ra9MSaXpGeqYoB1HZ4iboKCeKQ6knKo2Rp1LPTPfdMiDkFNDjHO/RsS68eqZG/h3f/pdZwxzYEKF7Rr1/aoNB+mmGPZuXoFf/okX3bKFhuoya7CBKRsrf29unBqZR3vCGVJrChzoMzysxH6rgoaAPRabNNRWYN26pdicziuxitEbppg4WLqXfBj0TAbLVU4NOTXuB8tLTo37w/LJQEcEjS6W15XmLrdVdFNbN3p6BjEaiiJu70eTSUTM6OIW2DF7TuM9bnqGjwkuPbHzd8tP7NHpUyf25RMviz9pv8uf5u+z3XkpVn99ThjempJCa5fcQjtgj4X2eqEdV1RSiBKruw2mrzasrMXGlXXY3Fhv9bncLaubOMjMRXkyBJiOHpZn0sqIp2BXmz4iP6FR4+6DlR0H6zRoWI7jYcamU/nedFmoemVie8lAp8XNjl5ct7ZyzdpMsz22d/RhoD/kjAe3/MTqQZSPJjG2GWsrrs2wrZguyLQbthlXdpnim1iMk7Sb8fZikrpfNEhT7abQ+oRM+/HZ8/KKYjQsrcaqZTXYsKIW603WmdBpeC+5aDd0AnVbmUWs3WQiJ+cLzimQvifUQZlx1MOW41yXx/j5W31y51/69vPne3Rm8Fzo3GakEY1jHj+Lp5WXsEy4jIOGOpd208DPdnuZ7F73DYVxw8YuTa3duGJ65rY97zS9MzgQdtFd1CuT6RneN/bR1DUJ0zUZHePOOXPamcfMz9qjqw8mrHuZ/nminglQz1DHjOsZL7wBL8qoZ6xvbjQ9s8n6ZuqZtcsZ0T63emY228tcI6eGGOd+jYZ149Dp6/i3f/wdM4abUmvMUm+YuEPeSdqp8cSWVfi1T77bRWpwRoQRDlM1Tv7enDg1JoPnZorNiSk792ivcVnKurVLsXnNEmxf04BVS6pQYdfDDpnRJxQXwcEZUFNi+dieeE5yasipcT9YXnJqTA7X3TI8lTM8rMu9nEnuG0JrZ78bNF1ttQGUlVWP6S06NcZswOSW59nAxgp2wqN9GR9TIyH3kPo79dID4fXykjPXPfFvduMTH9P6y2/3jk6NJQ2V2LC81kWecfDkBpjW/its8FRjAyvqr3udHLMN61tX/zAu3OxER9cAotZfcMDJ16cujNzB3i/l1OC66IxTIzVjO57LxJ7zvnqsPBma/LbcDVbOLGs6zjMOEH7fQoPVMOP867c2M2x6/K61j5udfbje3otrbV1otkc6NYbsfTexQKibx9uLCR/Hxd6f+DgdJraTdzyasM3wtzNtx7621AzVhqVVKaeGGRnr7XGdSYO1pSD7ems7HM9wRnYu18ZnZv/bTe+cvXgbd3uGXCRKActrnkC9zdLirV1qemjHlpVYUlvhXp8pmQgNlsf5yy3o6h2e9fLgeXqsvXutLfO8ucSaE3aZ82ddYCQSlze03rG6bmPXPqvfbOfM77KYYIRD0vrO5fWVeGbPBqxcWv1Q9/l+8Kv4fYyqYHTXgJVzOJTSMzc6etHU3mP9c3fKqWH3Ytj6b/chtlfeC9YTPmZ2c+TtmexxOriTud9jWr9k9Ayx+lBCPVNfgcZl1SmnhumYtVZGDdXl7r1yp2eK3TJS9hHTPZWZMlf6ay6QU0OMcz9lw7pBp8Zv/dG3nTE8fhzrzP2qDY3hcBRPbWvEr3/qvS4XA0M7p+OR5+/lzKlBJiqj9ECHMzgudNXOocKEoWP+kqAzFrasacC21UuwzR65dS290hzE3ks2lfnDwHKVU0NOjfvB8pJT4y1YHhm6+mh838HZq204bsbEbRssRRlhYIPXIasvQ1ZPh+2RM810+joFkvn8+GPqYfzJff++D/deb+bPzOvjj6kH/u2Mb9NFDIml7iqz9l5mf5dxwGS6at3qejxpOnrb6ga3zI7OjQxzUb5v3riDL5p+P2l1bqhnEFErzwfmasoTbHjpzp9nyVNNSYHzWVGjOePF9KTPBqNB07Pl5cVuOZDL3WC6hP1Eo1vWWOZmLyfL4TDf9M3E9kLjmzO0tzv78Mb5Wzhnbeb65VZ0dg0gZO8NWzthuwlbu+H26zTUxytu5nve8Zh6GGfC7z2Qe8txQvuY/JFdhMc5nIoDqWjNUrs/pXY/a814XcH+ftNyPL19NdaaEUKDY+La+Nm6byxfOle5FOfk2Zv4wpcP44LpowLTi3MyLsoWLB7TkQXJJPZsW4Vf+MSL2G1lOdNyY3lkIjROnruBL3/9KC7buKKA/dVslQdP0c6zwL7fa+12z2ON+PsfftLGCCvGz5/nxSUN5+1cTth9OvzGJbRYf1HAsVau+tEcMRa3/tDsgD3Wx/zyz74Xe3eufeT2MVHPUMdE7TdudfTi8PmbOH+pBbet3LusLwnZexk9EzJhVKDTM5mPZ77nHY+ph3Em/N4Dufe6Mn9mXr/30X7I6RnTLXRwOz1j9arEXquvLcfqDcvx2OaVeNrKbvWSqndEAGZTz0ws0/mOnBpinPs1EtaNg+NOjaZ0o7T6wjpzv2ozwanxT0yZcfkJw/TYMKdqjPy9nDo17oXnS6FCpNHLKBReu51PXU05tphBsM2Mg22N9c4jXWKDWCYJ4mA1s6aO6wkZ6nrv2su5xN1HOTVSvymnxjtgecmpkYKzf1xXy3D5HhugNtugyTk1rD5xJ6g2M9Zc3eQ5sD6xfCiZGebcNfO3ky4/N0M0QX8FmDjRDOq1K+vw5JaV2LZ2iZuVXtFQiaWm0ypKi1zkwWzqK9a3Y2bs/rcvvYqDx66g504fRsLWPu13XRnmO+PVL/2EDyxvCk/fOTX8CLoZt7RTg7kbTJessEFrY30mVxPXUhehxB5dxJ8d75LIzXL5ZxveTxqZXWZk9nHW1OS66dw37B6fvdyC61faXIST0yd04vA+s71knFj5cs8z95D5tia2G2vvnDld0Wj9/YZleHrrKpdIvMbuZ111mZutZ+6N2dJLLF9GvnDW/+Drl/C7n3kJR8/dBGx8Af8U/Xg+weJhJJtdC3fF+/Q/+RgOPDX9fj0Dy4N5ENq7BnDwjYv4zJ+9jJNW1xC08pitcSLP0fSpx+qv39opI5D/90+9F89PMNZ5Xm12TkcvNNt5XcJLNn5tGh+/5qgfzRWZ8Rvv87/4OA48u/WR2wfLl7l1GAnDvrmvL4Rrt7tw2Mr7/NVW3L5xx0VsIJDRM+l+eT7oGdoW1i4qra9Ys34pHtu4Ak9Z/8ylo1WmX2qtv2CfwQixbOoZlulCwfvpT3/6/+SThXRRIruwbtyyASejNW512GA+g1MQ6ef3wkZqDXSFGflP7VqH1ctrweR00wlv5u8Nj6R2D7jV3oPLpqQYWpYyRqfRKWQae7bqtLtOEw4w+ftUlBR7znDpocEQWs34u3ilFcdNsb5uHeubZgBxdnckEnfXzAR/XEfH9bq8vslktuFv3GrrxqGjV1L3cTrGqruPCTQuqcIL1oGvXlFrlz2zNas8loMxOjZ4P89bOXVa2WTK8IFQ0VvHuHpptRv48PenC3+XzjE6NujJZ0fndu3hb97v/GkA2m/WWqfC/Cmrl9c4I48JFxc6LC/OAtKx0Wz36boNFHptQJJqd7NfP++L3RIad4x+Yj147vG1LqdNtuH1Z2RgOIKrLd04fOYGvvKdk/jmK+dx6qIZZq3d6AuNwGpRqlxoTPBx3KHhvojv5gc8F54Oz43nSEOSjmU7Z+YnCNm1dFDHXr+D003tLqlpRSl3VAm66IEHZWd/VFjO3Bnm9LU2q3MDCJuOiPENNxi1cp03kq4HdBBPFL5mZU6Vwu19h61OdfcOo8360qZbnTh/+TaOmVF6+HQTzpjBf9vKYND6PUYFcocbv32e5Z+pk/nKxPNr7x7Eq2eu4zuHLzhj7vtm1F20a+2w6x42vZr0270tzJQN24197kH6OBfwXCiZ/p7thu3A7smonTP7su6uQVy72oYLVnevd/YhFEs6x3d1efHbyiOb8Du53ILRGs0dPTh67hZa2Y+ybyoMpOviPBGWrRlz7F9dv27jw5mWG4/N7GZx2/r3k5da0N5v40Q6NZzjbJLffVRhPTDx2fcXFQewfmUdntvx9v6I58VcGtSlLWzr1o/22N/WqGfvvPJV2H5MAa62cjrwzNYZjd/uZWL9aLMxyssnr+Gl1y7g298/68a0XAZ61+yEsOmZ0bfp4PmkZ0ysjozac/aHdzr7cflyCy5a33zb6lPEro3Rfkw0OrE8HpVsfU8+IKeGmBLWjWw4NThQm22nBk/HrXOmX4OzATSKnUfUvZ3iYes6P5dRQE5B8idGXWZlzkzd6RpAa1c/btvAjrNVoVAUwxQbzNKjfMde7+xNbe/IDMsRG+hykJL62tkZCE3E3Uc5NdL37j7nL6fGonZqcObvZnsvzpuxcuLNZhw5cwOvmt67YDqIbXooEks5NNhuKE4XWNmwPmUk35h4bjxfO+8xe06nRsSup7fPdBeN7b4hF51iQ2/nrI2YocZlBDSsZ8O5wfLu6B7CKTMOb1v/wkz1Meob/hYHd5kynndi50+xesHsAQyGTcRHne4JWf3i7jfd/cPoMMO4xQatzSbcKWfAyp7GUCQUw8BQ2NW3Qft7vI+we5dvkRu8tlgigR4716u3OnHM2swrp5twxAzuM3QCtvWgz+rYiF1DkmVCnc8ymthm8pXM+fFcec5WJ612OqfCoN0f9vdcu9/Le2avmfnktn5kIlPep2zfL7YXJhh2Tg3TUUfO3URrz6AZy2lD+W11MM8lPT5b2ZAaHy638QXHQDMpL5ZHPMHxV8yVx4kLzWg3PZZyHKTrWbYlXW+5ExV3lGJSx2e2r3HXkcH1I3ZOHO8xwu/q7bvoYS4HGtmZMexiEd5n60vGnVcP6dRgX8XlI902brzafBdHTc98/+Q15xR+83KrG88OmJ6J2nF0PM5vPeNF0voN2geMduuw8RiXMw2MxE3P2Dt2jdz1iR/x2bVyqSPbzqPAOrtQsBIUYoHAwYS1Tb8NPvzUZ6bkwOUG1sHAFIQLITWFMB7J8cjYj1Fx+6yzCpgpUFyEscJCN5ClAc1ZnO++dgGf/cph/M6ffhf//g/+Fv/5T76DP/7aEXzNXj9iipkzvwNDEdc587SoXO4nQojsM7F90aHzlYPn8Jmvvo4vvXQcr59qsgGp6RAaDhQOTNnm2fbnM7xepyxt8MeQ+UIfuMNE8+1ufPWbJ/BHX3wF/+s7p3DYjFM6YaV/HoJMGVN8FKs3mRlEztrSUUqx5yHT/zetL3jt+DX8+d+8gd/93Mv4L5//Hv74b4/h6IXbzkDioD5TV/PhfvAcuEadjtCzV1vxGevnfv8LB/G9Ny67nQdCPEcucWS7ccZc7s/5kXH30u4jDeeSIoyYEdJh9+bIySb8D7v2//HFQ3j9zA0XsUInltrNfWC5mB6Njo6iazDkJq3orBHiXtiGGJHTY/Xk1KXb+MyXXsF/t7b26vGruG39dZiOgNKFqGfsWnhNdm0hayvNd3rxypHL+P2/+L4rg1MXb7syYdlIz7wFR2dCzH/opzDhlm1cl8yZ3L1bVuKZ7auxnevF7W/uTsJtljw2gOS6NbfeLyPsUOn0YGTAdB0f1COUzECHBoIpIs6CckDDmbbr7T04c60Nb3AG68xNl8uC+R0O2uCV+SUOHjM5etmtKT944hoOn72JU1daXQ6R5jt9rrOnx5b7nAshsg9nmxlFdNra3SFrm5Q3zt10id5augYQpl7gAIMyPvuT/vB8Jm1YOJ3l9WLULqrfDNRLpnuOnL+FV81Qe8Xk9XO3cOlWp4tiEQ8By9mVdVpYh9Izcm6G3R5j1t/0Wdkzseb56+1uPf5rp6/jkPUJ7Btescc3zt90/UI+3AcOpLkT0K32bhwzI/7gkVT/dcyMDm7ZymuJ2SU6Bw5nThfSoJvXwvtn15aw9jMUjTk9ceJyq/XtTS4S8qjduyvWZhhtSmeUuAdWB2sL3EqTW54yTwiTLAsxEea2YiLYptt3Tc/Y2NmM+oMnmnD8YouL7hsMxxDnziULVs/YNdm1xe15fyiKW3d63bWzDGg3sExutHTZ+CWk9pOG3Y4QC4Axxn6iyOdBfWUp9m1fjV/6xAH805//Afz4Dz2J5/duxEpmKrdBpJcRHNaJOmF4PYWzsUxSx/c4CKFz42EiOqhTKRz00MnBGR03IxdwXtdwYhQtd/pxygat33rlTXzur99IRXH8j2/i3/7Pb+I/fe5l/OHXjuIrB8/jFRssXrrF7cBG3DKXeyM5hBAPD9sQ2xRnm7nu+U+/dgR/+JXXcc6ME84+J9iG3eyPPS709sbL42ggYDqrtAjD9vSaDSQ5cPqzvz2GL5s+YvI76Z9ZgGWZdi6l+osiJO0xmkzidls3vvX9c/iTLx/G//irw/jqwXNuPTkr7sR7MRf3Y+JvcTnh7Y4+vH7qOv7Czu2vXzruEjaCOTOcmJFBY2Oh4yY0UoYHI246B8L4jvXrX/rGMXzn9Ys429SOAdMlE8tOpLGyiCfHTNdGnSQ42SQWPRPbytBIFFesH/r+0av4/FffwNf+7jTae4fSS4zYN1vbWwxtitdIe4L5pmxMwjL42ndP4wtWJoeOX8O1lm63jfDEslusLIJeRywK6H+wPtFrjTloCm9pXSX2bFvtdl05sG8T9u/bgP171js5sCstuynrnDz3+Brs27wSWxrrsbSmDGWFAfiYlTjKKI6ZRnCYQqFwoHrPjFzcTnQgnEoi1dTa43YBOXKBURw3cOj0jdRMT3q2mDtQHGIEx1ETzoS9fgnHTl93GeUZdibPrBAPBxOB0uB4hbPhjJg6bu3L2tzJKy0uD0vE2lYyY2gulgFCRmeZrorZc+ZT4TKCY6afXFTZkct43fTT+attaOnsc4atyCIs/7QzfMweaeNxt6Zrrd04ebkFh89a/8AZOkb3pfuD49ZvcHth54RjHzWLMFqwt28Yp8/ddL/NCJJXT113UYiXbndhMGL1gQ5AykKJZpoOmftm1z0cj7voTHe/OLPM/vv1izhl947b2aaiLqcxhljoOF1TgJFEAm3dg85hKn0iuKNH3Mbb3JL1FPXM4Ytu/Pvq6SbXD101XTjEpeSLTc/wGp0DNXXdLAOWBXcPe83KxtkIVlbUzd02fmFfMB1TZSGiRKFiSlg38j5RKBuwDRa4w0pFWTEal1Zhx4ZlWF5XibLiIiyrq8DWNQ14YtsqPL97PfY/tQkHnt7skhdRnty1Fts2rMCShkq3B3nMOtiIDeBiTPDktENGDHfdD9FeMp+jckoPgsYdHhR7jQOekTCT9w2j1a796o0OF9XxOkOQX7uAK2aIJezjgaKA2yqWe+RPF3cflSg09Zv3O38OOO03lSh04SYK5XVebenCn3/7JL70nVPO6DhmRkcz8xawrbNNUHJ5zbmGl25lwKV0iWQSg9Zemy634tLVNrT1DyNuxVRbWeq2H31YeB+Yj+Ck6QMm1BvmkgU6ah/UPhcLvH4WgesrUsuDmPOEieOarnfgjRNXcejVN9FkfaO3yI/ikiLXF7CPzTa8T2wWzPvEHb7+7AsH8eVvHHNLTS7bwLorHEGceaUomfNejLhrt7preiphz/sHR3Dr5h2cOdmE9rYeVFaXoqqqzPRYalebmcL7QGOFy1lu2fcxiXGri45JjR3mF1ah7H+f1Rluj1pWWoT11rdzu8rpwvLgMijOULM8Trx5y+UymfXyYBdh3x8I+LB6WfXkiUI5cWXnwvEOE+j2MCr4QePXhcoMxm+Z+h2KRHHejPU//+Ir+OpLJ1wi6SbrH3oiMSS4HIN6ZlH3zXbtrEdWn+gGZPLUazbGPWk2wh2rb0tsrF5rY1bWUW6aMB1Y9guFRdbCxILHRl/M2E9bnAMxbktYU1GMtdb57Nq4HM/uWOuMc+fMePJesdf3mezdgAN7UhEczMnx+PqlWGNKuaa8BEHrML1pRT3jCI4MTimZsOMdd2rYo9c6aTtxZrynMc61ydwaloniXCTHqSY3W8ecG5xBpeNHCDF9aBBwB6IrzZ04evamC93k7ibnrt9xEVRusCCjOnX9pp9GTU9FzXDg7hzUOy4f0NErOGUGxN2eQcTiCadvxSyQGbxa35C0viGSSFi/MIiTV+0+cHbOxEX02f04ef4WOu4OuC3EuVNAtuESivM37uA1638Y3XT43E2cudqOW539CPH33Jp2O99F3mxcv279ecTaRIcZG1w+esTaykHruw+dbMJZa0Pc2UawbhdgxPRHy91+F/kVjmo8s9jpHxoxvdLm2grHu2+YXnvT9E5rzxBG3IB+kTs0MrAMrCzCpntbugdd/q/Xz9+0PuG6sxXOcdkbJ2QXIXJqiAUPQ9qmkkIbONZVlWH7+mX48HOP4Rf/3nP4l7/0QfzzX/wAPvnRp/Hup7dg45oGVJcGEaBDgwOTETOCGDLJJKN0btj3PBrs6OnoMKHyZiQFIzGYj6O0CCgvRtjnRQv3P7eBAAewQojpwdkIGmdnr7Xj9OVW9HT1IxmPY4ztjJE4bvZUA6a3kXZuuN2dTP8Mm4q7ZgOoSxdvu63muHVhMpnK7yBmkcx9oAM8aPeCu4pYf9VpfdHLhy/ipb87hUvX22YtGz6jt/7q+2fxV69dQCv7PM6ol1ibkZExOS5iw8qGZWT3qd3K7K9fvYCvWhm23R1IH7SIYZWxOhpLJtE7FHKRDEwKKRY3Ts+8fAZfevVNtGT0DPtmtqXFkKNnpqSdqK6MKsvQZjbBl01H/9XBc1aWi1PPqJYIYTBMq6QogHpToptW1WHPllV4jhEbjOhweTkYwWHCnBy717uQw8fXLcPaZTUuMWmpGUY+OjYyTg6GUbsojrSzYzoOD9fRm1BRUSZGcqSdHHF7vS8ccRnDlVNDiJnRb4PnM5du44wZ5b0DYbfjx5hrYyZsc2x/4u3QQKaj1fRPzMqod4jLyHpx7lq72+FhiAmWxeyTcWywvnKZSTCAkPUrN+70OSfd4VPXcdbqNut4tmA4OO9va6f9hrWZ85wBpPEZTDs0eD5ZdqAsCFgk1CdpJ9SglSN3FTp7uc1FWXJHh8VtxFvZ2JiLyUGHB0cQsjqb4LhJLEroiOUOOOxXqMsu3LiDQY5vqWfYhtQ3T06mT3D9QSEGrMzevN7hxje37/S6nExcNriYsNIQQpB7ozdISXEh1q2oxfM71+IT79uFX/vEfvxvv/wh/LNf/AB+6qNP4z3PbsW2TSvQUFWGIg5SOKAMZXZRoYPDXnNRHPwB95UPCZV6am1zMjFmg4G3zlEIcX84a52Zue4bCOH0uVs4faEZ/Yy00kzzzOAAqiiAu1Z2f2dG9N+duIbOXu6VInICnU2lRWi3wevXD57D118+g/a7/e6tifX+YeBnmYOIeQpabYA80D2A6NCIdWfWnzkjQ+1meqTLiUtLh8K4dPPO+BbJj3J/5jW8bJMxK5Pk8AgSVq/GNEmzKGEbYF6U623duN5yF8PMn5epC+l6IqaAZWRdAW2ChPXNg8xH2NrjdqhiPrvFpGfk1BDiAQR8XlSVFbvEhNvXLsWTj63G84zgeHITDjA3B5+7HBzcUeWtXVS2rVmCRvtMTUUJCv0+FNABQUX9tigOe22GjgkenbTPJMcWb3ZjIWZK1Nrd3f5htNzpc0lQ75ihFuEMhmaaZwaN2YAPg7E4Lt3owMWrbc5RtJizrecULle0+zGUTOJKSxdOXmrBWbsnjAagofCoMErjcnMnLt7sdJFNTBrrbrPazPRhUbG8TPrNgD9zrc0Jny9qrDxohI3Gk0ia4RWLJdzOF5qsWXy4nD3XO0zu2POoveIaTardiOnB9mQP3GyAkdyuPG92WHkuLj0jp4YQ94Gd62RCSoOpCA4mHv34i4/jH3z8OfyrX/4QfuNXfxD/4CdfxI9+YC/2P7EJm9YuQUV5sWtoBRxkDkcAJiRkUqyHyMXB36dTw/lD0q8JIR7MoLW7i2aEX7hpgya2QxqDmm2eOSwvr8cZH/1dA+i504fBwTAiZpQwYeiinXnOJSxzl4vJh04bzH73xDV89/gVt3vYo9IzEHZbjh+5dBu9EUU2PTS8R36vlWEMxy63uK0YuRvYoietT5L2EDYdErLyYaJb6ZHFBXOqHLU2cfRSC3oZQZlZDipmBsvM70OP2RhvXGx2iVapwxcTcmoI8RBwV5XqckZwVGLr6gbs3ZrJwbHF7aRCh8Z+5uHYk47i2J3aTeXZ7Wuwe9MKbFxZh4aqUpfHw8cOfAaODboz+J/cGkJMj8FwBBdv3XXr2oeYYDcfIzSoAygM73eRXDNzeM4ZVm40PCJmgDBKo7Wz321fSMeGyBGsy9Yn9dtgljljTr3ZjO6+oUeOoAlZu7lh7eZGcxeGmSCb+Tzysd3Qy88249qNPc+3dsMy83oxYmXYdqcPLW3dbotx7R5k5eLxIG73jLu+cUnOYssBsJhhzedytqHhCJpbunG7vQdh6hlu3So9M3NYZqajQ1aGN1u7cfO2jXeGR2wosXjalJwaQsyQeyM3Jgp3UWmoLsXWNQ141571+MT7duOf/Ph+/Juffz8+/as/iH/5Sx/A3/+R5/HBA4/jsY0rUF9dhkIOFKkk7fPTo8D95wYE84486wTEomAoFMWV5rsuRH+IuW7yzThjs6BQDzAPD6O4+Milavno3EjPCA3aeV6wgdOFW50uhFjkCN4Pq9MRq9vtVsdbb3ain8kobXDLfmkmM988NnN8PBLHwN0BDHYNIMH6yIiQvGo31i7YZthOJsqM+tM5gEVGsXMai8QQt7ZCY2MovMh3D0qXS9zuV/9Q2Ek8YbpPLHhY56mbGPUXHYkiMmD6asgMcLZdWqb51CTmjZ6xQrO+IJm0MrXyjPQNIzYScwl5eZqLQc/IqSFEFvF6PSgJFqKushSrl1bjsbVL8NS2Rrywe72L3nC5OJ7ciGd3rcPOzSvcMSUM6bWBzUK396lPnVJd+HpV5BkjZki0t/egraPXzZamIjXSb+YStvlRM2rGRp1dGiz0ux2YltdVYFlNOWrKihHgVnbUD/k0M+ScGh4MxxNoautGU2s3hrOQwyGvYFlPKnwvdUheYbo1bvWES62YM6appRu3OvpcSP9M4W4EA/Y9XCIxbMZ3JBK38btddL4Minkf7By99lhc6EN1eRDLa8uxorYCdRUlKGMEJM+XhgePzQcyZWf3KDoSR1fPMLrM6IhSHy1mTL/FzDjsNYOWOytpV7fFA3cA6jbju6tvCOFwFMlEwlRr/ukZ6hLqlFrTLctNx1D4PF/1jDtt65tZpt39w06PMypsMSCnhhBZZmLkxkQhwSI/VtRXukiOPZtXYOvqepSbYkQyj5TiLMAuig6NVISJEHNLIhrHUNcAhszYi7Nzp1GeDwMntnkb2HnM0GFS4prqUmzbuBxP7FiL3dtXY0NjPcrMaHORGwzLtv/zw6C2svN4ELbzaunqR8tdZllfQE4N3he3DIizcRlh+dvrTk/nxU14J4ykKAygx+r7kcstOHKx2a1XnynhSBzNnX24fbcfYQ7YucY9XwwNwnth51ho7aamvARrV9Vj72Orrd2sweb1S7G0tgxB3isb1Lt2ky+wDH0ehMx4a7Y2c7uz105xgTkDZwLLw3Rx1OoYjVtudbvonTyLiOGRqEtqfKOjFyH2cfm2LJR6xs4xaDqfOoW65YnH1zgZ1zPsD5gHhMfmCxzfcBmKtatbd/pwi+X7EM7t+YicGkLMIX6vF+XFRaitKMWS6jIbkBUjQEVOxegGywsU9lPWWcmxIeYSrlfnzieM1BgxAydqj8wOnhcDJzs35tMpKfJjWV0F9mxeiQO716fz8KRlN2U9dm5YhsrSorf0RK5VRbo9u11legZxt3tg4eTUsPL12vUVF/pRVlyI0mDA5T4qsb+LzLjne865QWOfkk/Lg1wEjRcDVs/fvNaON6+0YnBo5tnvR7iMxe5pm93bEQ7W8yayieU+imKfD40Nldhh7eJZMzBcW9n71m5kz+9chye3rcKmFbUoYyQk71M+3CPqHY8HI/GkK9u2rgG35eKixsqEkRo9gyPo5owy79UCgLVtjP86ff0Qkq9Mdq7TkvTnJ8C632ptoLXL9AyXt+VLLg2er9XDUp8X65bWuL752R3r0nomLfacr+2293gMj80rPcMcPnY+Ts+YLl8sekZODSHmiIkRG3xkErdUIrc8UIJzBK908VytyCV0oLF9DYYiGGACOr7IgQcNv1zDNm/nFvB5UFtTjj3bGvFzH34Sv/bx5/HxF3fgA89swYef24qfeP8e/NOffjc+9ZGnsXpZTfqz4//kkJRxFo+Por9n2GQI8YUww5p2VhTatdVUlmBpfSUaaikVqK8tR2V5Mfw0kunI4MwXl9wwEoC3I9e3hKQHs4y0uNXciZu37iD0ELlOOFt+tze9PIIzqPzefDA2uAzLBud1JUV4fu9G/OgHn8DP/NBT+OT79+JDz27FB57egh979078jLWlX/ixF/BD79qBZWXB/InYYBF6CxBNJnG3b8hk2KrRIo5MYHmYPk4tPwmjz4XJLwSnBt0ZqfHeGHVKRuw6pxYe674iv2CfNaPrmCD8zCRQz3T1D6FrwPQMo+HyoW8mPOeRKBpMd/zAc9vw0x97Bj/9oSfw4+/ZiQ8+s9kJn//0h/bhkx99Gu+1vprHuv6An80HrCgZAXW3L+QkuiDa1dTIqSFEDqCK5ywyZXJ1L4R4VBLWqTOz+pAZdnE2NIbn58OUMwd5NqCrLApgx8ZleGHPejy3cy2e2LrKLU3bsKLW7ZC0ff1SPLNjLZ6193ZtXoE14zl4bODEQWauYBGaMHN9JBxBJMT10PN80GTlycvyFnjckoZdG1ekI2fWY/8E4Wsv7OJOVquxze5VeUkhP5ySXN4TwguwKh4zA6GvP4SeniEMDI+4WTqXE2OacP11nxmZzHMQo5GVJ47AVCCKB3XVpdi9bRWet/vxxLZGPG7tZMPKWqy3drNtzRLs2bIKz9l7++werVpShfJgIfz8cK7vD29QOodEj5Vtj8shsZiXW7A86NRIOqcGl0othLX/jEb1Wl/j8/ngM31NCZgUTiFFJsFCe+73pJpczuvrW6SuqcDt/FfEc7zn3CcTXrPXji2wz7h8avfA3D391g76TUfF6Ch2ztP0m7nCytxFUBYGsLyuEnseW43nTOfv3bLS6Zb1K+qcTNQzex5rxNLaCpcTy8tryIt+4K1cNQulXU0HOTWEEEIsSLg94IAZ3dzSlVEbeTFoIhzAxeJYWlqEH3xyM37wmS0uMSjJRHRlhHCXpBf3bsCLu9ehnstQOLs7AyN1VnCDN3vkDHgmWmG+wnM38dg1+Yv8WLWiBj/0wnb84kefwT/42DP4lY89i1/54Wfxj39sP37zU+/Bv/65H8A//7n34Uc+uA8rGUGTGcimvyenuDqekpjdF85+U2hATGZYTAbbCrfXHDZJ5IOxwbK1+u4ScVcUo35JFTY0NmCtlT2Xb93bZvw+L6rKS7BsaRVWr1uCZStrzBDz594ZSKwcudsHI8iY1HVRb2HKOmVWSCqnRhg9AwtjRpnGf9AM+uJgAIWmr4vKgig1KZ9KyotdNFhZSRH8dMCzauRan1h7cbeJDg27pjK7ngprWxV2npNewwQpLg/CV1EClARTUZL3QD0zHIkj9LZExDlUNNQNdk68zlrTMStW12P1ylosqS13Tpp79QydUMvsvTXLa7F8ZR2q6yqc0yf3eiZVjtQz3JWMslj0jJwaQgghFiSMJGA+jXA0njLO8gEb7HA2hwOi2qpSbLaB0wYbEJUWc8Z/cipLg9ixcXkqt4YZcVwikXOnRgY7jbGxUYxZ+c7f/fDdRbgxNQ3nirJibFpVjz2bVmDv5pVulm7fllVuJ6vnd6x10RsH9m3EC/s24Llda7F9TQMqaDRzNszKIuc4K2Ri+PHMdtlgW2GbCeVLu2FVt/OgobhsSaUzNJbVl6PKjCY6MO7FGZV2P2ory7B+dQPWWPtiTpScGxvO1iiwMh1zhlxohFu6ztc2kyUKPKktXQfD6B8IpxI5z3NoFNdUFmO91dMnmfNl36ZUPgaXI+k+4t5f73bKe3zdMlQwgTz1fC7rK3/ahP0V29NSM+DHcz85ueca7pU9G7H/yU3YuW2Vc9bci9Mz1j8ziSXbRC79GQ5eb3IMxXb/ViyrdnqDEwrMreRjXqF74GtlxUWorynHmlV1WGmfKQ5Qz9gX8btyiZUlHUXMj8Qk3hwLLQbk1BBCCLEgYafOmT+K8wG4maAcwgGqnYjP70V5bQUq6irgp7Hl3krN/twLX+OAsrGhCqvqK1FMI46zmbkc7E7ERhFjVqwcoHLglCrmXI9OHw6WddIktSwwVb6Z+zJRaDSXFBViS+MSfPIH9uET796FVZyRNEPVDWjzAY8HI4kEOnoH0dEziIgNbqcLk+nSCcJ8Gm+1mxzeUytzOiTKrR1sa2zAttUNqDBjYiroKNy4sh4bV9ShbNypkX4zZxS4Ms3opZksC1p4WJ2ik8fKITQQcsLn8xnqByYZXr2kBi/sWo9f+MjT+FeffBf+2ScO4J/8+P77y4/tx6//6Av4tY8/h48+vxXLK4tNz1ubzakxanXTfj/gLUBVWRDb1y3FJ967G//4x15wUWuTXscE+Rc/+SL+9afei099YB8al1S5spkIHXrhkZjLATQeqZHLrsPpmSTKAn5sMp3BJaB0aExFeUkRtphO2rqq3ukot1vWPdc651g5suYkEtYvm9xb9gsVOTWEEEIsSGicMps+k8/xec7hKXCQ6POisrrMiZ8zO1Pg93lQUVqEShtYBgoD8Njn3S5Cub4kDkBtIMoAZQ5Kk2bQz/vBk53/VNdAp43f70VdVQl2b1qO3RuXo76qzIUee1gmuS4DZxxwq8xRdPYNmwzNKCElnRpcrkLJi3ZD7Jw4g0rH3qqGKhRzJnsKeMxKO3ZlQyWKXVh4fjgDGdHENe7MpzGaD5E9ucLpj7SeNuOWMroAIlcYPURdTUOe0V7PPb4Gz2xfjacfa3ygcMee3Xb8+mW1KLW6nnLC5bq+MpcNIwu9puNKsX3tEhexNtn53yu85ud3rnW7FLH/updxPcP+mU6NXMOytrb5Nj1DJ8UU8JhVpmOoZxhNRl2VD3qG/VjcdB4lb/T4LCOnhhBCiAUJM89zLSnDm12nzkF0rrFxaqHXDOKKEre1c6HfBkHTpMAGy14bHHo4QPSx+86HgQqdGqkBqhuYLo6xkxsw0rlBR0ZxSRHKastRYoN+HyNp8mFQ62FOjSR6B5mrYGa7SozZf4y8obiryHW7YVlamQas3VSXFztxa9enoNCOqa0scW2tkPeFF5Pj2+KMeDsJZ2zY/XG7Yyxm6IAjVtfGnU72P9vWfI34ItQPMxFC/ekipEzyKoLHzo/nlonES700+XXcT+6H6zd4TM4bZho7F+qKOtMb9SbMpTEV1EXUSTVlxa5v53fkFDYbazssVyZLpywWPSOnhhBCiAUJu/FxYzsv4HmMubW45cWFqCgpdLs5TJcCO9YXDMBX5HeJ29Jfl3vsHDhocgPY9EuLAY4ductBcbAQdXUVqKutcIZ0zvNq0BjkLht2T/qGI26HATo4pk3mfubDRHEGOxGflXWplTVlsjXu9+IzA4Ph41yG4o53F5P7C+JpMPR+opG4qEnflmRiDCORuMvnshhzjTgj1K6b8iBHwFzDM3GOB3uSzdNy30vJl0vleZj4rG9l/8xlJX46KaaAeoY6prTY+mbXL9uX5Mk1MRKMDrJ8KeLZRk4NIYQQCxY3aZF6mnvcoOmtRKEU55yYJjzWbZfnt8/xY26EmSfDlbwp5LknWOTHyvpKrKirQJCRNy5RXI7vi92P8V02uIsJZ8FnhFvglEe39a0tXbkcazqz+O54jx1v4o7Oo6aSOv+pr2FRwLKwexQdTaJ7MLRgdkERU5NqC6nnuSelt90uWH6vk4Jp9M9uZxifHe/l1rX2Qp7omRSMeEo/XQTIqSGEEELMIZlBUMBHp8b0u2EOttznbLDF5/k1eFq88J5UlQadBDIRAbm+N1Y9GAnAWW8m4kvkSwLTh4GnbuLqv9X9AJ160zA2aJA448Tuj2svIj/hrbF7xS2I6dDoHhh2OUeEyAVv9c/T0xvv6JdFzpBTQwghhJgrzODlsMfn8ziZhm02Dnfd4PIGrvlNzT3PY0N1AcFBsD/gm+BsyvF9YdWw82BYN3Np0ECcv9vtpnFODebJ8LloJS77mQpPgQd+O56OjZSxofaSt9j9iSYZqZHKAcOdd4SYc6hnTIEy6sI5Q6fRQTsnCPtlE0ZhpvS/dE0ukFNDCCGEmEM47ikwg8uFtjpja3pwQQAdG5QZfEzMMvk6U8f11PFEwkk+rdF/WFi2zI1Bh8Z0Spm3ItVeJiw/ka3xcLjoowmSTXij7D4xUoOJbSkzygEjRBbJ6A3qm+npGeolL7xu+cl0PiFmCzk1hBBCiDknlXhtJkaWO3wWbArxaKScGh6X78GNafPi/hS4esJdNmggut1/5jmpuu/+Sb8i5gQWN4WhP5TM39nE2k1sNIm+4RH0DYXdNp9C5IKH0TNU+3Jn5B45NYQQQoh5wmzYE+LRoCPDRQR48yuChvWEme+5+89C8QNk6r/awBxhFYdpYooCXpQU+VFswud8LWuVim3G48FIPIm2rgEnI9F46j0hcsBM9EzGoZFHqn/RIqeGEEIIIcRD4ga/ZuClZvdSr+ULbrCt0bZ4GNJWHfMLVJYVo7a6DLVVpSgvDbrtdTPvPzIpryCGI3Fcbe3GlZYuDI1E028Kkd9kmkE2moJ4NOTUEEIIIYR4BDSoFQsPq9Fjqa10mS+mOBhAeUkRSu2RuU1SkRrZqPX2Ax4PookkursH0dM1iKgiNYQQM0RODSGEEEIIIcQ7oO+CS5gY8FMY4PIT/4RdHrIAv5hflxzFaCiC0eEIoEShQogZIqeGEEIIIYQQYhLGXKJZj8eDsuJClJv4Gb5Bp0aW/BqZDLtjiSSSsThisYRLFroQdu0RQswNcmoIIYQQQggh3kEmUoO7+1SXB51wC+OsOTQypHNrJO0hHI0jFIm5RLfaJlMIMR3k1BBCCCGEEEJMCiMmmEejurzYScDl1BjlO6kDskKBy60RHx3DYDiKIZN4gr8hhBBTI6eGEEIIIYQQ4h3QocGICb/Pi5ryEtSZFDJSw17Ltk+DEk+Oon8o7CSeSKTeE0KIKZBTQwghhBBCCPEO6LcYHRudEKlRgoB3FpafkAIPYslR9A6NmIQRU8JQIcQ0kVNDCCGEEEII8U4YkGHi83lRXVZsEkwtP3GRGln0bDB3hqcgtbXrQAjd/SFEY4rUEEJMDzk1hBBCCCGEEO9gzP7LJAqtKgu+5dRwOTWyTEGBi9ToGRxB96AiNYQQ00dODSGEEEKIBQjn0bM5mS4WH6w/3NLV6/WioqzYid9HpwbfTB2TFZhTw5NyanDpSR+dGnE5NYQQ00NODSGEEEKIBQZtRG9BAbxmKGpXTPEoMFKDVagw4EPQxJt60f7JslfDRWoknVOjxzk1tPxECDE95NQQQgghhFhQjHHSGwGf1+1a4ZFXQzwk3P2EkRoU58TgY3I0Je61LMEqalZJKqdGGD0DIUQVqSGEmCZyagghhBBCLDA8Ho+bWS8K+N1zIR6WjGODFDDyx++Dx+9FAZ1lWXVseFJbug6G0T8QRlyRGkKIaaJeTgghhBBioUAb0wxNLjsJFgWceJnYUYgsUODzwlcWhLc0iAI6y1x9S733aKSWnyTiSYQGQk74XAghpoN6OSGEEEKIhYQZmcynESz0O6GDQ4hs4PP7UFpRjNLyYviYMDRbuTVYRU0YERIbiTkZ5RIXIYSYBnJqCCGEEEIsGMzATEdqFAf8KC70w6flJyJLcElTbWUp6ipLUOjzurqWnUgNI5P7hY6SZHL8u7nMxS11EUKI+6BeTgghhBBioUAD04zBgMeDytKgEyYLFSIbMPlsTXkJqstKEPBavcp2MIWrv0AyMYaRSBzhaBxJRWwIIaZATg0hhBBCiIXE6BiKzPhcUl2KhpoyFBX60m8I8WgE/D5UlxWjurzYOTjGvRDZghEZHg+io0l0D4a0C4oQYlrIqSGEEEIIsVBgyH4yiaDfixV15VhZV+HyagiRDQJWr2oqgqgpDyLgZRKM0az6NFJbuxYglhh1Do3ugWHEtAuKEGIK5NQQQgghhHgECtL/5QXOqTGKEr8Pa5dWY+3yGpQGC9NvCvFoFFq9Yk6N2ooSFGaWn2TTqUEKChBNMlIjjJ6BMKJyagghpkBODSGEEEKIR4A2HX0JOcdOgs4Vr8+H4uJCMz7LUGPGJ2fXhcgGLlKjvNhJgFsFZ2v3kwxu+UkmUoNOjRBiWn4ihJgCOTWEEEIIIR4Ws+fGxsacU4MuhZxBu9LsS48ZmoGyIIoqSlBUXOiMUO4cwXMU4lEpdMtP6NQITsipkWWsGcWSSfQyUmNwBLGEnBpCiAcjp4YQQgghxENCky45OobRzIx1rvwa/P1YHMVeD1YtrUbjylqUlRbB6/Hk0tUiFhh+nw9VpcVOuMMOklbns+kwY2W1740lR9E7NIK+wbByagghpkRODSGEEEKIh4QREMlkEonR0dTulgyfzwWczQ5FUO314MlNy/Hk1lVuiYAQ2YTRGZVlQVSWFMHPqs7tVrMarGFfam0obu1pIDyC/tAI4orUEEJMgZwaQgghhBAPyUgkjo7OAXTcHUAkljCDzIZWc+nYGDWLMppAhd+H7Wsa8NyONU62r1uKCjM8hcgmHk8BCgPM2RJAcWkRioJ+eO21rEVrsOnY93Eb1+7uQfR0DyAai6feE0KI+yCnhhBCCCHEQzIwGMK5S804d/k2BsIRwEenRvrNuSCRAIbDWFVRjE98+En8wk++iBef3Ix1y2tREgwol4aYFfyFflTWVaDCxM9EtHSuZaOu0SHo9SAajeNuazfu3u5GNBxLvymEEJMjp4YQQgghxAwZMaOrrWsA19t6cMuks3sQEe7SwFnruYjUoBEZS6DE48Hahirs3rwSz+3diCd2rsOaFbWoKi+G3yVyFCL7BAJ+VFWXoaqqLFXPmNMlW/4zaz+J5ChCQyMYGgxjZCSGuLUtOeiEEPdDTg0hhBBCiDQT3RHcNeR+0mcG19ELzTh28TZ6hyOA1ww7Jk609+YE5hkYHkFDcSHe/fw2vOddO7BieY12OxFzQsDvQ3VFKWrKS1DIuu8SymQRtiOry0lPAcLROEKRmEvIy7othBD3IqeGEEIIIYThnAH2mEgkEY0lEI6YMTUSw/BIFIOhCHoGQ2i9248LN+/g2IVmvHaqCWcut6Df3mPI/KwvO6GjgokZzcgrNWNv3dJq7NmyCs/u3Yhdj61GTVWpdjsRcwKdZ9zatdokwCVXY4zUyKIjjc4Lrxdx+85Ba39D4SjiiWx7ToQQCwU5NYQQQgixiDHjyQwoOjQ8dGqMjrnkn/1DI+juG8adniEnLXf7cO12F9548xb+18un8YVvn8DLr1/CxaZ2DEbj3OvSvmcWh1U0GBniH40BAyE0FAXwA88/ho9+cB/2bl+NlQ2VCBb6FaEh5oSMU6OmPIiAi9TIcr2jZ84knhy1thh2Emf+GCGEmAQ5NYQQQgixeEkbT2MFBWaXjaF3IITTl1pw6NiVt8nBY1dx8LjJCZOTTTh64Taa2rrRPRBGlNETLpdG6iuzBh0U/O54Eh57pPFYX1WKXRuX48Ce9Tjw5Cbse3wNGpdWo7ykCD5GiwgxBxT6faitKHZS6CI1rK5m26FW4EHM6n3v0IhJGDFt7SqEuA/q/YQQQgixyEk5NGLxJK7f7sIXv3kM//Wz38Xvff57+B9f+L7JIfzxl17DX3ztKL7zygVcutaO7v4QovRiFPpTDo1sk3FocJvYcAS+eAKlRQFs27wSP/cTB/CLn3wXntq1Dktqy90Wm4rQEHNJyqlRirrxnBrZdmhYm7J2FU0k0T0QSrU3tgUhhJgEOTWEEEIIsbgx+4kmWXJ01CUAffPGHRy5cBvHLrXg+OVWnLjcglNX23DeXm9q60GXGVhMXpikL8Pl0pihUyMzq01DkELnBYUz0dxBJZqAz/4uKfRjSU0ZtqxuwBNbVuH5nWtxYN9GHHh6C/ba8xVLq1BWXKgIDTHnBHxeVJcXm5Sklp+4Op1+M1tYu2KkRs/gCLoHFakhhLg/6gWFEEIIIRwFKSdFYQAIFr5diuy1In8qMoP5Mx7WmTHuyKCkHRmUWByImIQjwFAYhfEk6itL8PjWVfjh9+/FL/74C/iHP/YCPv7iDqxsqLIzTXliFKEhcgFzalSXFaOqNGjNwdpCtqshm5Yn5dTg0pM+OjXo8BNCiEmQU0MIIYQQgqQNKdBIM6PtHeIzoTPD5c/gwdMn9dUF9jUeFBf6UV5ciKqyIOqrSrCyrgLrl9fisbVLsHfzSjz3+Boc2L0OB/ZswIG9G7D/iY143h6ftte3rm5ARUmR/fzMfl+IbOK1elwSDDjxsS4yiW1WHWypNhZLJp1To8c5NbT8RAgxOXJqCCGEEELMJmljz+MpQFGRD9WVJVjWUInVK2qxdf1yPLVzHd7//GP4xA8+gV/+iQP4jV/5EH7jH3wIv/zx5/GxF7bj8fXLUFdVhkK/10VmZESIXMC6R6ea3+qj3+eFJ7OEKpt10nkBuRKLOTXC6BkIIapIDSHEfZBTQwghhBBitqCdZ+LzFLhZ7aqyYtRVlboEn8vrK7FqaTXWrqzFxjUNeGzDMux+rBFP71mPZ0z2bluFzY31aKguQ0lRAF6Phm0iP6DPgfXROTaCfvgL/c5pl13Hhie1petgGP0DYcQVqSGEuA/qHYUQQgghZg0z8szQK/R5UVtRgqW1FaivLkNdZSlqK0tQXR50yT6LAj47tgBJM+ISCUoSY5wBnwBnx7XsROQTXr8PxVVlCFaVwuuzOjxqL2bFr5FafpKIJxEaCDnhcyGEmAw5NYQQQgghZhnaeQzbp7NiJBLDUGjEzT53dQ+h9U4fmprv4s1rbTh+vhmvHr+Gg0ev4OCJa3j93E2cvdaOG2096B0MIxKLY/QeZ4cQucLn96GsogRl5cWpXXjGsuTVoO/OxG21PBJzMsolLkIIMQlyagghhBBCzBaMrPAUuHwAnT1DuNHShUtN7TjD7WLP38SrJ6/hu4cv4Gsvn8EXv3EMf/i/XsFv//G38e/+xzfxb//gm/jPn/se/vRvj+G7x6/imn12YCjiQvIzURuK3BC5hLugVJYFnaR2QRnLik/DkanbTEKaTGb3u4UQCwo5NYQQQgghZhMzzhJmmIVGYugbGkFXfwh3eobQ1jWA2539uN7Wi8vNXTh/4w5OXmnF6+dv4ZUz13Ho9HUcPNmEgydMjl/DoaNX8crxq3j97A28eaPDRW4kkqNZTWMgxExgolDu4kMJMFLDRRFlsUKmvy6ZGMNIJI5wNO6WaAkhxETk1BBCCCGEmG0468xEijT8vOntYblNbIDiA4r8KSkuBEqLUo/2figSw622bhw+eQ2f/5s38Ht//j38zl98H3/5d6dx3V7nNpeZ3SiEmGu4I09NeTFqyopTTo1sR1O4duNBdDSJ7sGQdkERQkyKnBpCCCGEEHMBDbSMc8OJDcMoztFhQkeHc3b4UmKvxUdH0T88gpbOPpy73o43LjTj1TM3XL6Ng0cu45g9v9Xe446JJ2TsibklYPW0pqLESSGdddnO92LNhG0llhh1Do3ugWHnyBNCiInIqSGEEEIIkZekHR90dBQyiqMIyYAPoWgcl6+148+/9Br++C8O4rUT13C7ow8j9roiNsRcknJqlKKmvAQB1lMXqZFtx0YBoklGaoTRMxBGVE4NIcQ9yKkhhBBCCJGP0D+Rnql2kRx+L0Zd9MYYugdCLnLjVebeOHYFJ87fRGtnH4ZHoi7PhhBzgVt+UlHslqC8lVMji6Qjm1KRGnRqhBDT8hMhxD3IqSGEEEIIMV/ILF8J+IGyYnRF4/j+G5fw0t+dxvnLrW6HFc5kK2JDzAWMzqi2eljtEoVmIjXSb2YLq8qxZNIlxu0ZHEFMy6yEEPcgp4YQQgghRAYaZTSaGOIeSwufU/g6oyA4G53tEPuZQIcFZ8UL/QjZudzq7MeZK204fPq62yq23ww/IeYC7n5SWVaEytIiBGhVcPvVbHo16JvzeBCzdtc7NIK+wbByaggh3oGcGkIIIYQQGei0iMaBUBQYjpiMpB7D9vdIzN4zg4rH0G7LoV9jHOYxKAnijp3ft167gG8dPIc7Xf3uLUZrKGJDzCZ0apSXFKGiuBB+eiASaadf1rDvtDrMhLkD4RH0h5QQVwjxTuTUEEIIIYRIR2hUBgPYsW4J9u9aiwO7KeucPLt9NXZuWIbVS6tQwq1Xx+jYoOTYs+GWongxnEyiqb0HJy7dxmunmnDmcgv6h8Lpg4SYHTxW/woDPgSLC1FSFnSPXkYRZatduEiNAreNa3f3IHq6BxCNxVPvCSFEGjk1hBBCCCHSERqNNeX46Q8/hX/zqx/Gv/m1j+DT/8jEHv/5z78fP/PDz+LAk5tQV1OW+gxnpTlrnO3kiDPFLUfhDikB3DLD77N/cwSf/cph3GrtSR8gRPYZGxtzQgJFflQtqXISCPhSy1Cy4dhIL7WKWtu829qNu7e7EQ3H0m8KIUQKOTWEEEIIIWiAJZIoN+Ns69qleGb3erzwxEYceHKzc2RQ9tvf+/dtwIG9G7B78wrUV5e6RIkMlsjazPTDQuPPzqU/HHVRGqcu3MbdnkGXf2A01+cmFjyBgB/VNWWori5Lbe3q8s6k33xUrG5zR5/Q0AiGh8KIRmPu79RbBeB/QojFjZwaQgghhBBpkmaMhWNxhKNxJJNvWWUlRQGsXlqNA7vX41d++Fn8/R96Cts2LENJaRF89Gpka2b6YaFdlxE7jUQiieFwFEOhqF3HqDP+hJgtAn4vqsuLTdK7oKR8DtmD9dd+I+nxIBIbRYwJfK2ic6WLqrYQQk4NIYQQQog0o6NjLhEhZWKEg9vloTSI1UuqsW/LKhzYvQEH9mzAzvXLUFnoT+2Skg/LUCjMQWDn3zUQQrcJ8xEIMZvQqVFTUYya8mIEfGZeZDvfDOu114sExjAUiWJoJOockAUemTJCCDk1hBBCCCEeSCZ3wMQcAivqKvDxF3fg4/u3Y0VZMLUzSjokPqc4p4YHI4kk2nsG0d49gBHu5iLELFLo86GmvAQ1ZSXpSI0sO/gYjWESs3rdOxhywmgkj9V3RSEJIeTUEEIIIYSYIdzGcuvqBuxYvwwr6qtQXloEfzZ3fXhY3Iy2x0Vq3O0dRqdJ1IXqCzF7BPw+VJeXuCUogUw7yHZbKGC9HkPP4Ah6TeLJUefUEEIIOTWEEEIIIWbAxIiN4pIirFyzBCsblyBYGEjtiJLzZShA1Ay+nqGwGX9hlyxUiNkklVMjiBqTQjo1sh6pYZXaU4D4aBJ9w2H0mzBXDLeUlV9DCCGnhhBCCCHEQ1JcXIhVq+rQuLIWJYXprSyztu3DQ0ADz+NBPDlmhl/UJIIYHS1CzCLc8cQlCi1jpIY3HamRfjNbFDBXzCh6BsJO4sn08hNX6YUQixk5NYQQQgghHhLuirJmSZVJJUoCvlRejZwGatDAK0BidNQlUxwKR5Ew40+I2cRFapQVo6o0CL9LFJp+I1s4Z12By6nB5Lc9Jkzm6/KEyqchxKJHTg0hhBBCiIekKODHstpyLK0pR5EZdjnf2pXY6I5OjXAk5oRh+kLMJl6vByXBgBMf14NkvR3Yd9r3xqwuM58GJWHPCwo88mkIIeTUEEIIIYR4WDhDXVVejKqJYfe5hBaeSdLOg7ueULj1pRCzBfPLcAcSv7UFbn3sYX1zEUtZrHes14zUoFNjeAT9JnRqMKeGkmoIIeTUEEIIIYR4SGjEcSeUCpPU7if2Yh74EEbNsIwmEk6SY4rUELML3Qpejyfl2Aj64S/0pRwOWXVspJwa/YMj6B8acdFILlFo+m0hxOJFTg0hhBBCiIeEYffFwQCCRX4z6jJGXK69GgXuDBKJUcRN5NMQc4XX70NxVSmCVWXw+pg4117MSnOwtlVQYHU6icGBEIZMxpKj8Hk8LkpECLG4kVNDCCGEEOIh8ZpBxVwaFO7EkA9RGmR0bMyF5yeTSbc8QIi5wB/wobyy1KQYPpcwNEteDfotTJKjo4hEohgJRxCNxt0OKGP8/vT7QojFiZwaQgghhBAPSYGnwC1BcbkE3Cv54EAocAEjNAApzugTYg5wu6BUlKCmrASFzDHD/BrZqn6ZiIzkKBKxBIZDEQy73X34A/JoCLGYkVNDCCGEEOIh4Yp+r8fr8gnkWxg8ozWYW0OBGmKuCPh8qC4vdhJwOWZY+bJfAbm1KxOG9g5HXJ4NJhEVQixe5NQQQgghhHhI6MdISf4ZVTyjPDwtsYBxkRoZp4ZbfjKWXZ8GK7THg2hiFF39YZOQPU9mGmH6ICHEYkNODSGEEEKIR0Q2lRATnBplwVSkxmxsJ+xJb+06GHaiSA0hhJwaQgghhBCPQCpKwyQTaT8LdpwQ8wG3/KSsGFUmfubUcJEaWWwQrqkVIJ4cxUAo4oTPU17F1CFCiMWHnBpCCCGEEEKIRyYVqRFEjUnhbEVqGMmxUYzEYk74XAixuJFTQwghhBBCCPHI0KlRU5HJqZGJ1Ei/mRUYkVGQCojiV2e+PhMtJYRYlMipIYQQQgghhHhkuLVxZWkQlSVF8NPR4CI1nNshO9BvYdYLl5z0DYWduOUntGjk0xBi0SKnhhBCCCGEEOKRGBsbg8/rQVlJEcqLi+Bn8k46HLLo03B4PAjFErjZ0e+Ez/maEGLxIg0ghBBCCCGEeGQ8BQUo9PsQKPTB4zczw5sOn8iWY8MlBC1w27h294ecaEtXIYScGkIIIYQQQojswciJokBK3Har2VyCUoDk2Bgi8bgTPpdDQ4jFjZwaQgghhBBCiKxRWOhHbW2FSbmL3EByjOtT0u8+OvyqRHLUSRa/VggxT5FTQwghhBBCCJE1mFdj8+ol2NzYgLJC/+zk1tCSEyFEGjk1hBBCCCGEEFmjuNCPFQ2VWFlfieKADxhNZjVSQwghJiKnhhBCCCGEECJr+P1eVJUFUVnKXVDM3JA/Qwgxi8ipIYQQQgghhMgaAZ8X1eXFTgI+MzdGxxSpIYSYNeTUEEIIIYQQQmSNwoAPNZXFqK0oRqHXK4eGEGJWkVNDCCGEEEIIkTUYqVHjIjWCEyI10m8KIUSWkVNDCCGEEEIIkTUCLqdGMapLixHwmrnhIjXk1RBCzA5yagghhBBCCCGyhtfjcTugBE28KABGZ2FLVyGESCOnhhBCCCGEECIrjKXzZ3g8HngLClBAh0aSTg15NYQQs4OcGkIIIYQQQoisUlBQAI/PC38wAH9RAB5PgRwbQohZQU4NIYQQQgghRNbxBXwoqSlHaU0ZfD6vtnYVQswKcmoIIYQQQgghso4/4ENFVSnKK0vh8/nk0BBCzApyagghhBBCCCGyTsDnQ3VZMWrKgijkLija2lUIMQvIqSGEEEIIIYTIOtzataaiGNXlxQj4zOxwkRryagghsoucGkIIIYQQQoisU+j3obayBHUmheM5NdJvCiFElpBTQwghhBBCCJF1GKlR7SI1gghw+YlyagghZgE5NYQQQgghhBBZx+/3oqqsGJUm/szyEzk2xAKhYIKI3CKnhhBCCDFP0OBJCDGfYKLQqtJikyACHjM7RkfT7wiRn8zEUUH3XEZEbpFTQwghhJhzClAwQw+FO9z+cZ8TYrGRrvtO0i+J/Ce1/CSYThTqlQUo8pqUjkkrmmlCN52Cj3KPnBpCiKlJK/nUf0KIRyEVfT2KMZcwb/ojoTH7L2mfoWgAJRYdVuc5ye/qf/qlB8E2kmov1tb4AjsvdWBzjt/rRUVJEBXFRfDTUHSRGlJgIj/J6I1RezI9PZPSMUn26arXOUVODSEWKM4JMUEeBboyPB4Tr31P+qse5nt59KOdiRDzHGszHPYkEqNObOw0bTjQisaTiCaSSJlpak1ikWBVnXU+nkwikWS7mbrhjJqREY8nTKy9uOPVXuYaGnxeGzeUBgtNAvDxRbt/8sqKvGSCnomzn51GB03dwr487vpzO15qJmfIqSHEfMIMIo+T6elNDig4AEyYgqYnmQraqegHfZgHOLF/nNgYxL4jEo0jPBKzxwRiNkh038f3p0P6+3g+8mSLxQ7bYcwGTJTpDJoysL25z2WMNA2exCKCkU0Jq/80NlyU0xTwGDo0nHEy3b5KZB2OWbgEpTDgg9ekwOu1V0156ZaIPORt/fM09EbqeBsXm6TUEjtmdc65QE4NIeYRVJPMs8WoiYzOnBiNMVGIU7bxuHNIxGIJ5+AY43v8kvTn34lpZSpyaudk6jEWT6BnIIS7fcPoHwojPBJNGVYpDX7f38/Ao+TQEIseNgtrGxwoMeIiYu2Ks8nThe0tau046j5nL7h2dt+GLESqyqVl3pK+ALYU9mF0srM/mQq2kZgdG3fH2wt5Ugg8ldT5T30NCwqvFwUlRSnh1q4aD4i8whREun/m+HbiGPdBpPrzTL9sx89rZTu/kVNDiBxAn4TPOnXKPfb//bHjkqYwI2bUdPWHcOnWXRy/2ILXz9/CK6ev49Dxqzh45DIOHr6Ag6++OUH4d0rO2LH9AyGOqGAjPRvxJd6SaBwFppQ99p7PTrDQ50VxMIDyimI7WQ9u3enD2aZ2vHnjDi7e6sTl5k5ca+nC9dYeNHf0ob17EN12XgPDEYQjcRcqPxH+pBvIvf1lIWYVVrf8qXJs7AWIj45iMBzBUCjiQlany5gZZ4mRGBLWvtxgK/V1eYGadn7C2sWqMv/vTYHrU0LWT4Ui1gZcXoYHw2jCkWjMxPojVtA8cQLyNLzW93s91v+nX1sMeP02pigLori0yF1/qmJKayxmePfzpgqk1QP1TNh0DIU6ZCroaA1Zv0xJcCKQDTxvGjYjpNNPFwFyagiRJSaLVphMiKfAg0K/z4nXnk8JP2YDoJgp2N6hEVy4cQdfPXgO/9+XX8N/+vz38H/90bfwb3//G/it3/4qfuv//hJ+6999Eb/17/8S/z97/h/+y1fwH+31//D/fAWf/8tDaG6+m3JihKOAfdfbxF7zmA4PBPwoLQ2iprYCKxobECgvwdlbd/Gto1fwbZNvHb2Ml45QLuHbx67g4OkmnLh0Gxdv3UFzZy96B0Mu5DdzvW+RN5peLALoROPMCWU6M7tzgjV3hrX29IfQ3T/soqAexES9MWafSw5HMGpiVh3fda/nmszA1AWdLKIBVF5jVYORcXR+ufo/0xvj2kwe3U5PgfV/SfQPjzhh/zIVPGYoHHEORDoSXXPJdZOxAqUrw29Gvd9nzzjDsUjgzidV5cVOAnRq5ItOFrmB+sXpmRlrp9nD+trMpMNgaJp6Jm56ycbP/dYvp/RMnvTLrnzds7QsfOTUECILcODIJR5UbG13B3D1dhfOXGvHkfO38KqLoLiEg0cvj8vrp5pw7nIrbnf0Ikyjhh38vYowo5GoJJMp4QztUO8wWlu7ceZKK45fasHFm5241dGHzt6h1OAtkRhXX/zKTEQIk3VVV5Rg15aVOPDERhzYsx4Hdq9Lya6MrMf+3W/Jgb0bcODJTdjzWCOW1VegJBhAUaHP7TvvZpnsB/JEfwvxDlhHiwI+J3ye836dbYXOSWvLvQMhtFi7ZfttsvY8PBJLHTMJ1CtnrrbitLX5vsGQGalcRmYXk+u2x/I0HVVg4jVF4DUDTfogT7D7QGPB5aCwQfd0clBk4PLGQMDr8iAwH0LO2w0NfzOIh63/u3ajExevtKGts9+MjoibJb2XTDh4l/WJ562PvHCtDYMjUfcd+VBBPaYDCv1+J9Oa1FggFBf5sbK+EivrKhD0+xh6mvu6JXKG0zPWJgtNz7D/yDk8BzufIdMzl5vu4ILpmbs9g6lIr0n0J6M4GDXW2T2Ii1fbcfXGHfus9eO+ScbzcwlP1cTlsrHr4XidE6mLgcWjTYV4RDIzppMJvbl9ZnjcaOvBkQvN+Mbhi/jsN4/hd79wEP/+9/8Wv/Xbf43f+h2T//dvnPyn//kS/uhLr+LlI5fRORgG2MFPnLFJKyXnzOAyETo+YqZYbRAXMSU7bEp00D5nP401S6vx3K51+Nj79+AXfupd+Be//lH8m//tR518+jd/DJ/+3ybIv/wRfPqffgyf/vWPvF3+MeWj+PSv/RD+zS+8H7/50+/GP/+J/fiHH38Wf//DT+JnPvgEftbkU+/fhx9/zy78vRcfx0eefwwfemYrfuCJTc4ZsnfLKmxdvQSNDdWoLi+xS/K6QbUQuYJGWVVZENVlRfkxM8gGa+2ca/wHBkK4cr0D33jlTXz7yBXnlJxMt5BbHT347NePmk45jlt9w0CwMOUIzTlWnjaws5aOQhrBhT53zmr3OYb1xsTtlmMD8pjJdNaGZ/B5vSgPFqGcW3DmhTPQzsH6yB7rY18/fgUvv3IeZy61oKWz3xkc97YZOjro8KCR8Y1vncS3Xz6LO30hKoS397M5YQw+O8fiQr81Y7+bbFgslFl92rSqHptX1aHcrh1JG9tIVyxaOEasKA2ivKTITby5upDL6kDdYHrmbn8I33/tgumNM66P5kRCJvJ4ojAvVpf1x3Safvf7Z/HK65fQxeXd947nc4GVJaPBWLaufOloWQQsjqsUIkswbLxvKIyWu/0up8Spyy04fLoJB7kEg2IDroOMzDhhcvJaSvj+6es4eOotOXzuJk5dbcONO30IxeIpBUiFzpByOjGoQO1vLk+pqShB45JqPLZ2KfZtXomntzU62WvP921ZhWe2r8YLjLLYtxH7n96M/c9txf7nH8OBcdmWkudMnt2KA09twYEnN79TnrLPPrERL+xeh+d2rMHTj63GE/b9uzcux84Ny7DLHnfYI89jy+oGbG6sx8aVdVi3ohaNS6uwrLYctZUl1kkVuRkZztoKkUs4S1FdTqfGhHDnXI+hbTDkcuNYO7/TO4STl27jlVNNeP3cLZy60oZrLd1oNr1wq6MXl251umivgydNh5gw+qvfjDg3aMr1zIsrRxvcmQHssfPx+b1uYGqXJ/IEF6lh9SURiWF0koiG+8F2U1kWRJXp8gCNbq4rYtvJFaxT1p8wqrGlawDnm9rxhvWph63dsA9mO2F7ab7Ti6stXThnfesb9t7hk1dx4uJtNLX3YJj9LHVALisoi3B0zNpJgRkahagwY8PvdgJZHNCJs7K+AisykRp0tOWyXomcQqdGZWnQSYDOU+d4zaWeMd1gOiJkeuam6RNGRlLHUBgZfeX2XadnKJeb7+L05dT7r5suOnutDc13+0xH2fg913qGZWjtik6NytJi0+U2/vFZe1sE5HhUJET+ca83NiOEiYButPfijTdv4auHzuN/fvV1/Mc/+g7+/R98E7/72b/Dn33ldXzrlfM4Ye/fau1GHxMBcnaIyTbLTWyg6MQGiwgGUuGwY/bddGYwzwVD1+wzBfbIxllhn9m0dgn2P7EJP/bBffiVT74Lv/EPP4z/49c+jN/42ffiV/7es/iRd+3Agd3rnbNheW0FSooKbfyXOl+3VjFHIkSuYaQGHRpVNmhiB5/zQVOG9MxzxAzNO139OHH+Jv78peP4w68fwTffuIhDNkj63slr+Mr3z+F3vnAQn/36MTeQcs5PCpt3qonnkDG3gwF3MjClYwO5xWOczQvYB7C+R8yYp8zEqWHtprayGDXWb9HBkWo3eQDrmNW1TuuHX37jMr7wtSP4i5dOWF98Dt/nBMKp6/jGaxfsteP4A2s3X/nuGbRZfwob2CMvBvVWjtY3Ftp1cLKiprIEgcDiMDaIi5xjTo2JTmaxaGF9oI6pYY4VRhKwPuRDlaDOs3F6u+mOr33vLP7oL191OuVrTLx/ugnfP9WEv7bx/1988wT+9K8O45v2vIN6psTG9vxsrmEZWlmyTKvKg078VtaLAdpNQoh74FZOPQNh3GzvxZlrbXjj3E28wggM5sQ4dsXtNHLoxDUcSkdjvHrmBo5cuI2z1zvQ1NaNju5Bl8wskkgiSWXNUEvOTFCo9GjUmOKhXcJZm7JgwM1ebG2sx77NK/Dc42uwn9EXzHuxZ0MqtwXzYHCpx1Ob8YI9PrtzLfZtWYmta5Zg9dJqNFSXuTAzer8zThghFjPMsF8SLHTiwlvzYsRksHl6CsDsN8wT0Hp3ACcutaQiMk5QTLeM65cmnGlqQz8T+3I2i2071+2bg08zdF352uCv1IwURmqIPIPVnc4MygwMyEIztOsqS01KUDhubORB26FDz/rQkF3Pjc5enLraisNnb7j2MrHNvHrmupt4uNTShUHrg+0iUp/NNSzC0VFXpixbljGjMRcLnC2uKS95y4ilsywPqpXIDaz7dRXWDkzo6Msb5yl1henAocQorrT14OjF23j19Ft6xon1y6+a7jl+6TauMRKME5N0UOaDniFWlotRz3CUJ8SiZrKIDGZMZ6gZZ0s/+7fH8dufexn//ve/gf/yBy/hc195Hd9+9QLOmhHS3jWICPUw17gXmzD6otCEyo0zQxkjxGEHMulnIgFEUxEZXjNoCs0wWNpQiad3rcPf+8Be/IOffBf+xc+/H7/5c+/DP/nx/fjE+3bjxT3rsbmxAbVVpc67PVlkxL0ixGKGbYDtmTMUfmuPHjo12BbZNPKlfaQjNhI2EBqORNF2pxfHz9ng6ehl50Q9d6UNA5wBoh5xYuc/rk9yCIvPGWde1JlOqqu2QRN1nkiTR/qX1YV1Jl1vJvZz94OJdeury9Bg97bIGRvTj/KYE9iWrc8dseto7RpwSbcPHbuK7x+9ghNvNrtoyhAvnH1yPkUQuXZj5WtjgyWV6fJdRO2GCSEZoVJbbkasJ12vNFZZtKT0TCnqnfM07dTIp/pAx1txACFTJVwSevpCCw4dvep0Dcf/LZ19CFOXUs/w2HyBZWhlWeT1oaGydFHpmTy6C0LMPUz+w50FWu/248LNOzh+oRmv0Qt7JJMjI50b41QqL8br52/hbFM7rrf14E7fMAZHYohzfMhZSgoVMwdcNEAIlTRniijOc2pGgHXq65fXYs+mVEQG82HsZ0TGvo0peXJTKj/GrvV4alsjHlubisRgvoqSooB9vZqtENOBTdPtgFLoR7m1u/Ky4vQyFHsjH8ZOPEFPAUbtMZ5IJTdsMyPtZnsPbtkgqrN/yEV7OWdGvjg0HKlBU7HpPO5kwB0NuF5e5BmufnlcdefWwZTpJAzlrF49nVUmNETzpr1kYDuwvjRuj+yDO60vzuSh4URD33AEMV48ZyfZbvIFGhvJJIJ27swtsaqh0iUMXSwwssslSGXOLZ/dF96aPLo9Ym4pCvixtLbCpNzahPXLLqIs/WY+4PSMD3GrpIyU7OgZTOXuMbljzwfstTiP47g/b/pmg3rGxg1F3gIsrS5z5SunhhALjMwM1UQJR+NmPPQ6Z8X/evk0fu8vD+E//Pe/xW9/5iV88WtH3XaszI3BLZ5cbgzmw2BURmY5CRUxnQz2XW/DDV5MQXPXEm7VSLG/y0uLsGXdMrzv+W34xU/sx7/4hR/Av/zUe/BLH3kGP/DkZjy2bqlbRkIjjNtd3Rt9QZnfzPfzF/ORYDCA5ctrsWx5jWtbGE2m2mi+QP1B44uDIw4+qGucfqFRxm46jwZMhEVn+qzMynLjihpsXFmLMs5WLULerpftkc/zpmqx3qR2Axm2AfhQKGrPre4/AF6Ly6mRCQtnnXTXlJZ8gu2GTkq2FdduKHa+POd8cmZkYPnFkyi181u3rMYl2S5ZJO1mvJ24Ksn7xnuUNkHyrV6JOYEJ5Vc1VGFVXSWKWRc4Xs63qDDi+mY7v3EdkxY3/s9DPUPHdSyOoLWzFbXlWM7EvNZXv9VPLVzSGkWIKWBjoFDhTBQa7vcTvj826hrSjJsSP0OZ4e9xL34nPNcJv8o/ObAbCkVw+04fzl9rx+vcieTI5ZS4XBlXx3cuef3sDTumDc3tPegfCCMaS7jZ1FQURlqJ8UupPCaeA2dV7VivPS+ygSHXsnGXkCe2rsLzO9biwO50fgxGYjyxCS/s3Yjndq7Dns0rsM4MLs6OlZgB5jdlea+fZEHgbkvqXr2t3CaTifed5czPCvEQlBYXYcPqemywtkhD3CXmdToij2CDp3BwRz2T0TXUA/mmC9genXHmw4bltdhgxlkpnb2LHaff0pIvWDWKmw7lMiYKI4KmgtFNxUUBVJQVo6a6DJUVJXC7dPCjedZsUm3GZLzNmORj52n6xmvnVWSGXHl50EVeuoSZdMAsMrgUMGDjHIpLap5vbUbMCaktXYtcwtwqk9KSCVu75hvv0DP2PE/1jNvK1XRLtdkT1YxQzZTrImBxXKV4dKhjOBiiJ3VaYsY9hZ+ZxMkwFTySYbKjSfts5rucTPZbb8lYIokExYxijrsJIzJG7fe5Xz8T8r1y5jo+/81j+H/+8Fv4L//9b/HZLx7Cd753Bhcv3UZ3zyCi/BDzYnCw4Tpc+yLObtFhMclvjgu3jEvvXuK3c60qCWLLhmX46Pt241d+4gB+42ffg3/yE/vxo+/Ziae3r8ayuopURIb9hnPg3CMLDXdF/Gfa9Sh9z1nudHIswDIRc0NlWZHbjnjnuiWopFOD9SujIMTMoaMxGkOptwDrllZj3Yo6OTUyUE9lJNdwzG39S8z0Z9/wCPqHwogxp9M0KbbB8Ko1S9DYWI8SM8ZdPyg9PHNYZnYP/AEvKhsqnfiLbIzh3lqY/f2DYFLhEjO2KC7BsLt+1avFxMR6X1RciIaVdSa1qUhKjfceDo5pbHxdZPbLMtPZy1cvQdB0+GJCTg0xLVIJnoqxrLYcS2tSsuwBwjVcDbUVqGLWXVNSXk+Bja+m79Xk8Uw8V1ZSiNrqMixJ/+5kv+WE79vvcekGw2YZCk1v5Vs5MwZwubkL56934MKNTly6ddclAr3R3oO7fcMYicQR8HJv/mI01Fdi2bJqLFtShWV8Xldh328y2e+aZM6LIV7rltdidyZXxu51b+1awlwZezbg6cdWY5sNElfY9/Ic6T3NR2dvtqHjhjNSxcGA8x43WFmxjtxblhlhmS5Jr+mutDpUXFoE30PMaLHTTJoBlrROcowdJR0qfKSwA6Cw81QHuqDh7ieMhGK4d5nVJc4Uunan+z4zWFzWZqgra6rKsNT0GPVuNXczoHGyyCmwfstj/ZbHjFc+z4v6ZecRSybRMxhywp29pktlWRA7rT/bsXE5KujUcM5A051iZrCfsXIvCwSwee1SbF6/zC1FXaz4/T5U2niy0vSGy3HE6E2xaKkwPfOY6ZnH2C7o1Ihp0uGhYH9jOpq6epvp7G2bV6CcS+YXEXJqiGlRVlKETWuXYM/2NWlZ/UDZZUb99p1rsXbDcjNKS1yYmRvkTRO/zzq90mIsX1qDTZtX4vEda7H78cl/i7LbZJed1+NbV2GrnadLwGUNe3gk5hwXxy7exre4o8DZG7jTO+g8w+ut0e/ZtzEle012rcce+509du6T/cZ95bFGk9XYZ5973/OP4Rc/cQD/9Ofeh3/4Y/vxo+/eiR1WBg/atWQxwARhwaIA6mrLsWGjDZIft/v5gHq0e1sjHt+yCpvt2FUblqF6eS0CDzETzAgdlyAvGseoiYumoYxHgdhgKmH3gGMq9aELErYxOmXrzAhvqKtEqbVFv+mzAu48ovs+M2h8WHviFtQbbBC63tpoqRkm7q1FpM/uR4EZaz4rD19ZMQqcsWYv5rJI6LkziSaS6OoL4a4Jl1JOFy6f3L9zHfZb31bHyAJGIsqpMXNcZFMcdcUBvGDjmBd2rUWtle1iZXwXlIri9K4X9qL08KKFbeEF0zMv2JhwXM9w4knMDJaZlV2tleHzNo7mkncuc1tMeD/96U//n3zCEH0hJoN1I+aWdIyhurwEq5dVo3FZDVYvN+HjJLKKsrQGG9fUp7Yitc6La3KZ/HIqMstFOED2eDwIWANl1MfaFbVYc5/fzJzPWjN+ecxa+5sZ+WlMM1Kjf3gktTWiwWtg9MXqZXbsqjqsXlmL1fbd7noecE33E/72Gvtdnt92M8CfsgHgY/bI95ZUl7mwbEYpLNY25u7nKO+n+wO+gA/1teVYu7Ju0vu5xqRxabXVn2qsWFLltrulQ43OIQ6Epgt/d8Due9vdAURN0RdaXeLuMZypL7HBJcMc6Wgq8BaggOdmdXyMM5E26Oc++hu564yd35LaskWRBJHlxd03uBMQc8lcv92FXms7OU+6Z/eGeoNbs3IXoOceX+uSi80EFylkBuew1YO23iGERqKI2LVGOHjiteXy+uYT6RlnRlM9u2cDnrKB6EbToVwXPVNY3zq6B3HySqvLJj9s94P9TE5zItD4tOtjJN1Tu9ZZ+691Gfqnsx6Z19PaPYBjdj1tdl3JxKhbPummjnJ1PVS6JsHCAMpNp9G5zmjC6ehRXg8nIypLgwiHI7h4rQ13re0k7f7wsjJLW8QUWPl7rbyC1s9saqzHB1/Yjj1bV1m5cp379KObeD+4rJZOqVttPThy5obbztZuUmqN/2zBKmy/zbEU9e8LO9ei0frlh4XX0Wf9CnObdfYModtk2PQxrHzmRX2y8mBZBGwcw7HwM2aIr7QxyqPCcmFUKSOpeH/fOHPdRRjP+v2dCqu/HL8yoS3HZ/u2rHJRydmC1039Wl5chBGrB5eaOlz09Kj1yaMpJeP+Fw+A+tjuk98eyqxePrZuCT50YDt2bFrhciNNZXfxHiwUCkbT+3stpIsSD8eDZtlGonH0DIbdY+awB9UYHkPHBLcR4rIV17Csjk23mlG5R025h83oYMZ2DnZZRx/8m3SC2EDMBgrcMqyipMj9HYrETWKu42SSNJ5H6lxS5/OoNZ/F4b7H/uH1chDITMMzud6FTtLUDJcChe1eDIRGXMf9oPvJMuX95LKReDLp6s/SmpSDaLrw+7v7Q7h0qxM3WrvRxkGUDcppqPebATVk9aF/OIKegRAGB4YxYh1p3OoanRsb1y3FD35gHw48vRl7Nq90y5sW+iw0y4sOjTfevIVDx6/i269eQJMNrtxOP7kaVKUUiRv0BIN+HNi9Hv/qp96NZx9fM+P7wevj/T/b1IZDR6/gq988gUvNdwGuObV2K6aA5c3IJmvDTHz8D3/qRbe0jgYyt2l8mPtx8nIr/uBv3sChk9fQ0dnv2mRqV4QcKU46NcNRt5X2P/7Z99r1bUKF6XPq9amuj9fDiMDf+6vXcPBkE3r6htzuWq7t2Hs5gcM702dVZUGsWVnnlkP+9Af2Ysf6ZTO6X0ys/flvHsehE9dwraULvcMjuTe25gMsf/ZfAb+bMX1+1zr84seexRPbVjmH0XQmeTKwfkViCeeo53bzv/Mn38WRC82wxpe6F7MB64hdA5cD+60N7Df9+79/6j1uBvhh+0NeB6Nnv2t9zKHj13DY2v5ta/tOB+d7feI1J1O7A5WWFOLAnvX4Z594Ec9sX/3Q5ZGB5RI1/cPx7kHrn377T75tffEs39+pcNebdJNBnIjiEupftvq7b8vKR77eifC7OEY8fbkFf/r1o3jF9GdLZ5/brtkG9ClHt7g/aWd8hY2PVy2twn67T5/68JNu6eB07BDWvYWCIjXEtEhlKQ6mQwZTwuf3E3bgdSYcTDE3xkw6b8KGyJlVKtMqzjDZd03nN/nIdcA0fulNZxZ3OhiY/Zefb6gqTe2/z++bxndOR8a/w86TjhTu8T/T613o8H6yDnFJEDO+T1X2fI/H8F4tqSl3r800Szx1Gu9/aTCQ+k7ee+uYKcwDwGgd5mphHpal9t4KCnN61JVjXWM9tmxcgUZGathr3JFmocPyWqiRGoTXR+dIRUkQSRsA3LTr6xkII2mXppnnKUgPmjgLtHpJlYtGe/+z27B5TYNr1w8D78dCi9To6g/hqtUrRjQMmfEZiSZyez1pePbcFYxbtNJJu9yub7rwumKJUcTN8IjY/bnTNeCiH1PX5Q5IHSjeDo0+LteysuN4Y/djjXhm51rs3rzC9TkzLTbeh4USqREyY7VvMIy7PYO4SSeZPc95PzNdrDwUqZG9SA3Ca2eZUv9Hkib2eLd7yDnwXJ2w952Id+L0jInphiU1ZXjS2ufTJlvXLnU2yXRg+S8UcthSxGKDDWcm8qhk63selonXIsne/Zyu0PvvwhpLi1wnvMUMsCe2NeLdezfiw89tw4+8ewd+5kP78Gs/8jz+5afei3/9qx/Gb/6jj+Af/4MP4Sd++Fns3b7aJYgNmlEj5j+sD4ziotNzhQ3Otm5txIb1y1DKGULOqHNWVUwOIzRCESyzge0PvbANH37xcSyrTw1sWa7ZnLWbzzCio6G61EkRjRFXLrksG9O7Ho/LqdHTPYBeM4KZX2gm8N4y2vLZx1fjORss19dXumSo7rq4hlv3/p1kbju9pVZGS6vK8INPb8EPPrPVLd1a7HCiKzOxkcqpYeWkerToqa8uw7v2bsC7921EQ521Ezo0WDdUPyaHZZIpHyuq+poyvLhnA17cvcE5Uhdjv6zlJ2KcBzUAetY7+4YwFI662QJWG9UZMRWsIffWE/6ZcTyk3n/ruHGxzoyzQyknfeo1hsAyxwofGYHh9aYfJ77u9YznbsnUZ352ujD8k7lXOBvGT3HwxSgfRt8s9A6C5bSQl59k4HW2dPbj8LmbePVUE145egU32rrdVs5J1hWrO3ZQ6uDFDocHDJ+38qixevDktkZ84mNP44md61z0E6PgHuU+LLTlJ7c6enHo9HUcPHHVhZDzb9Apmqv2Q3jejICxPvz5nWvxm7/0Qbcb18MsfzjX1I7PvXQSB+1+XW++i76hcOp+zZd8CHNBWmelwsEDLmk5l/387Meewa7NK9MHPXi8NRks/4Wy/ITXwJwavI4/+fJhnL7WBlMmqWiNfIbXrOUnWV9+Qnj9Gc5cbcOffuOo0zPNNgbhMuHxSB7pmRQsf+oZ0+2VNkZl/jfeH7fsZOPyGd2fiWU/35FTQ4xzv0bAunHdFMt3TdFyDXooErX+OpWbQtVG3A9WJxe2ah0R6xD/Zn3hQDrlgEgNqt1zSgEdFSnhgNsJ/7b3GP5YaMYBnQwMBw8W+pxBVZR55Ot+fyoRqA02uHTpYXQa1SFzeHB9Jz/N86NBzetY6LC8FoNTg7gcQQMhHLtwG1/49kkcs2vu6UnnQMjl9eYbNPJDEayqrcCzZpg9t3cj9u/bgLUr6txyILbNh4X1baE5NZizhYb/QWs/X/3OqVTOFtanXBtrZmBbpbfrWoVfN6N0v10Xl4ZSl063HfH6Bsy4aKYxeuIq/uSrr5vx0Zp2alh7oSwCPflAWJQsT9YjK+/ta5fgEx9+Cgee3ISNjQ2oeYTZU5b/QnFqMLcW9S+v4/c+9zKOXWpJOTWYPyGf4TXLqTErTo0MLIf+oTBu2tiDevSzf/0Gzl5rT+VckWMjBcuepjud1aYTdm5Yjk997GnnrOYSIUajzuT+sMwXCnJqiHHu1whYN05fbcMfff0ojpiSZafKbTJp8KnaiPvB6jTRqcEBHx8ZheGcGDYIdo8ZoVPDRWB44LPOi46MjFODDo6UQ8NnNsJbTo2g/Z1xavB159SwQQC3jCP8rQIbdHv5XfYanR18L+Dzpf7m79gjX6PThMbzvcxW551v8N4sFqcG4fVebenC1w9fwOHT13HpShvauwYwYgMFF6DPa2a9XWyky9wNZq0M6szY2L5+Gd734g7s27EGG1bWobq8OCvlv9CcGpmcNDTW/ugvX8Epq1Mw4ydnRkmGdKTGjnXL8Ekb/O5/YiPWLa9x+Y2mex95fRnOXGnFZ919a0Izc2zYdY/Z+xTXZhZhs0m1m1HXdipMZzZWleL5nevwkx99GjutPrGfYf/2sO2G5b9QnBpMGs7o30N2Hf/5My/h8PlbqYTNuW4nU8FrllNj1p0ahN9/5lILPvtV0zOnmnCr2/SM1RmnX9g/8HGx6RkWOcud/bM9VgYDWF1b4erhpz72DHYyEixdJjO5PxN1+3xHTg0xzv0aAesGs7r/ty+9ildOXcfQYGqve26F6RSLEPeBtaPgnp6H9cm9nq4+43+nj3R/25N3LD9xf6ce3+4M4fKT9OsFXH5if/OHTLUV2ODDUxJEsCzoZiZpjDFsno/8271mUldZioaaMpRwtmgKZqszzzUs48Xk1CDcEamjZwinzLj+5uELOGnX3trSjUEzbMHksD4zsK1cFg0sUpZrLO4iNBobKrH/6S14xsp9nw3cGeLKNjLTpL2Twfq2kJwahEszGQV08I1L+E///W/dEieYvnFtKJcw94WdF7c6f++zW3Fg70Y8uyOV4HCm7Yj3jYlCmczwldPX8blvn3ROjqSVnfsm07mmkN2xiwYOo834c+Vszx9ftxQ/+YG9eMGMwHWr6lBdWeLK7VFqNT+/EJwahJ9NJsfMeL+M/+u/fQ2vnL0BWD8MLtXKZ3jNcmrMqlNjItQzXH7CZSiffem4W5bi2pqV1eLUM6ZfGHWXLgMuM/nUh/a5+8K+ufIhJxtY9xYK2v1ETAnrBrfceu3sTTS1dLks9REbIMWtgXEZCr3uEslkwmzWzObtHtPCjpvCARplJJoShqQy/J/b77oteM24YA4XGpicAe23wRz3t+8dDKF7IISuvmF0mtzpGTTDdBBtXYNmlA+48Ohbd3pxq70XzWakN9t77d1Dbk/8u72DbmeCu/bane5BdKaly17nfvntdvwt+3ybvdbdH3Jrxmlo8TyZmZyjdjpWFqK+5DUt5N1PJoORO0xWVxwMIJEevHP4WGADA27/zDrsBnZpt9sjWSX5DK+RAyVXx8dQboPY9fWV2Le1EQee2Yq9j6/B2uW1bicqllE2YH1bSLufENZTHt/dO4xTZnDescdRaz+jvJ6c6gy7t/a/L+CFx9pRWUkR1q+oRV1Vafr96cP7VlTodztHBa3dDJoRRgPVx+uz8UDS7uEojfvM5eb0umcRthmK6Qm6+Bg1SOf4xlV1eGH3OvzQizuxc8sqlJpRygiNR4XlvhB2PyG8Fn5fq/W1r5xqwm3rc9x1ULfke32x8uC5a/eT2YXlwSjcJbUVKDI9MxAacfWfk1dj9kgds7j0TBJ0+ZUW+d0E3MbGetMz6/HRF3e4rVuL7PWHhWW9UJBTQ0wJ60abdZ5HLzY7gzEaiyPBRuZm1EzZSiQPkoJJXptM2HE7MV3Ex7e9RrH6RgObz/mYEXb6FF/60QbubsanMP23fQ8HC9Fo3G2z2GuGRgcN97ZuXLvViYvX2nHaDJAjp67j1ZNNOHT2Jo6boXWtpQstdlwmQe6YfQcHpzSEuRyG7WIyma/w3BebUyMDZ964zeLK+irU2SPvb3dXPwb6h9NH2PXPhwH3w0BdzsGhGUtumYJd43ozzH7kfbvx4XfvxOMcxJqRX2KDJt6HbMH6ttCcGoTX1T0QxrWOPvSY3hiJJRFj2fKacnVdaei3GorGnKG9ywbCvM6HhdfJsmm0Nrm8ocKaaQEikRjCfSFEmNiPdcXdS3dw6kMLBStHWFVxs6Z2zUHrs2pryrF7WyM+8f49+NDzj2Htilo3w52tS2d5LxSnBuH1uMky63tv9wylli+lKkuqzuQrVh5yasy+UyOD0zOFfvfby+sqEU2MIhSKIjIYRsz0q2tgC1bPWGWj0mYE4UgUpVYXViyvwRM71uJHrX/+wDNbXLmwfB4lcoZlvFCQU0NMCesGO8+jF247pwajNDirOT74lEhmQ9ygeDKxejeZsON/m5gxzkf7iEsAagZTJJpwUSA03hn10dMfwt2+IZdLgdnYb93pxy173mGvMSKE7/f0DqO3z8Sed/cOuciOO72D6BoIucR5jDLhYCSTD2S+wnb+NqdGc5eVwUiqHHk/cgH7aaoa+33mWeGg+lnr0LPu1LDv5pIkhm+WcbmBDRIKzIAotGsP8LkdM2oDiySNGAdfSZdJjormoeHgh+WaicwwCdr119u1c3C+vrEOT5nh8sEXHsOeravcNnslwYA1sexeKOubc2pcbnVRVUPWljigT7X/9EFzTdLKJAtOjWHrI/ttEBqKxNHdPYAhOgdZfrlsR0bS6nQ4HEGt3WvuZMP7zfOlzBR+hsty6AystDZDozRg5VRidYm7RY2aPnTjBPvNMZar+5D7YOr5fCNjYFh7YSQXu5zyoBl6deXY3NiAxzavwDM71+F9T23GY2uXulnmhynX+8HveodTI2P0ZrltjsPbZsLf9ti9pRGfTacGIyKPX21zSwAZ4ZPk1tH5XD3SdcAtx7FyZ380a06N0xOcGrN1f6cifb3sH4tLcujUMB28pKYcFaVFpqK5NbsHZaZ7mAstYe8zYtzpbrZP9yH3wdTz+UZGz9g1Uc+w76koLsKa+gpsW7sEO6xPftr0zLv2bsSW1UvcWOVRYRkvFOTUEFPCupFyajS7LeqcU4NKJJeDNCGmTbqeUpwDxB5ppGQiPygcOFgnmRpAeDBmnUpkJIa+/pBb63+z+S4uXG3FiTeb8boNNk5ebMFVG3i02WDMRXFYH1Rqhl9mIDuZ5Ds8R+fU6Oxzg6ombtk4yC0braxydf4sWBM3U+jzoNEGVVzPnW2nRgYOVmnALzNDZduG5Vi9qs7lZaHOC/UOIULjlLA4WCaZx/nChAGTm/1hBIENousqSrBneyNeNIPsIwd24D1PbML6FXUot8EUt06eDVjf2s3gP3GpBbfaezDsnBrpiAZipznnki6XFTaApGPHOTWsTc/UqcErCBYGkIzF0dTUhk7OqFPfUPdM9ruzLYT3npEwpteW8X5vbcTS+ipTed4ZXd9k0OipryrFuhW12GwDb0YtMKnf4FAYyeEokpGYHWXXnmkzZL61G9YNlp/pAq/9TWfnulX1LirjQ/u3u50H9mxZiWV27Yzmy3bOAdYr59SI0qnRjSPO6O1/K5Iuc6+zLty+337C6giN+Od3rMuaU4PLR7lDEJeEjlg/GmMun0y9mPRcci32j0kqcpBOjRqX3ylrTg3eXzqtWu3+nmqyvngu7u+DxP5JOzUYqcGorCesjs+lUyMDy4ftakl1uUtWvWltAyqry9DNZck2ThkdsXEY68+4nknLfGK8b6aeicFn5V8ULMTGNQ348IHt+MEDj+O53Rvw+IZlTt9Sd2cDlu1CQU4NMSWsGwzDf+3cLdw0ZRu1zifJwXBa4blGKJHkq6Rno11dpaQHJm+JVXJKBjuWs/JRG5SHrMMcGGC0xiDudA6graMXt83g7+jqd1Ecff3DGLSB2WDfkHuk8dJsAxFGegy5cPpEyiCnM8U623xWs2znqUgNu4b23vTykzAKrON0u8ikxwhzKulzywwi19ig6rlZdWp4ECwKuIiN5fYblZWl/HEUWRlUBnyoKClC0MRjf3MA6mYWWcdo7NxPF05W/9yj/eA76uI0ZOJ3UTIzVJP99kSxc/TYYT4zrsuCATRUlmCVDU7XL69xa3KZDPQpK1vO4NOhQefObEYesb51dA/h1NVW3L7Ti5D1K9xOmcYT7zfbzVwLA+CZGG+FGSlP7kxHajyEU4Pnz6UHoXAEF6+1uWiwMQ5AeV05ujb+boFdHutBrd37dTZQrrGBMc+TERePAgfX3EmFOTqYULCktMgtUXV5Juw5242fSwLtPEatzYyyvWQSa7L+3ltXKZl24+r8BLH/39EmpiPvaDfp77/3d+8VO1eWDh3WNWVBrLTrW2ttZv3qJdj72Gq8+8lN2PdYozO0OJtMw2s2YL2iU4P5neh0PnruBtq6B+CxMnZtZuK9zqLY/67ucAcxztRnM1KjZzCE6+09zqkxYIYpnce5bP9Ti523nbvPZ32CtRvWAyYJXfkIy7gysDycU8PGHnTyHjk74f7a701+PrMtqetlnS4pCWJNDiI1MrB8uEyUEZX11aZnrK0xeiRhbTho51dvbZNOeCa0JaPxpJPxtn4/ySM947fCLrV6VVtegkYr43Ura7Fx7VI8sX0N3vPkZuzdugprrM4xd0+2HBqEZbtQ0O4nYpz7zSywbjBJ6H/4s5ddtuqoGW9J63xyOoMrxKyRbgeuk0o/Tvzb/qFhGLRBerF1oCX2WMpH63ADNoAvqCpD3bJqbFu3FI+Z7DBZZh0UQ7KnYyTORVbxyWA7b7vb7yKyDp64hpdevYDrNnj2FPpQMAOjLpu4Ircuym+DOu66sX/3Ovzzn8hOtvmpYHmEIzF09YXQbwNuOrhu2mDz6OUWnG1qx6WbneiyQSdnbpkscFJdyJf4uhsdUtJ/Z4SkH8b/vh/31sO3PU4UvsYDJ5B+z28DpmKrnyusfrJeblvdgE2NdWbEV6GqogQV5UFngLKuzjYsX7dV+DeO4tDp1KwkkwOzjeRqPEJjOzESdQP3f/ST73K7hFRZmdCgnUl9G7VjaYCeuHAbn/nq63jVDJSuoTBGzCBlNFDOrs/OKWH1da3d/x94div279mAp80w53KbbLSnzHXTOcrEzF19Qy7aram1G8cuteDSjTtobevG4ECIB6fq5XgDmADLh0K14x7Tf4+/l36cDvwN/kzm+tzfabFm+9Z5TAJft+spMYOp3gyMDWuWYN/G5di4sg4NptMbzLBi0j62mcyWrbMF6wx31ukbHDH9fBW/+/nv4fil2/CZXqSTdTZIFVMmMsGL/bvWud2nnsviltrfOHwRB0814eTF27hjdcZnv8Pfy0d4zaPJMbe9PHXl/l3r8Y9+5Hk8acZmNsqDDg22nYPHr+K/2nibeexm8/5OBa+JjhY6PlnXeb2/9NGnsWfzike+3kfBLSdOJjFgZcWlS3d7BtFjj02tXS4f2pXrd9DR3IUh07kPtFP4OutaRs9kJPMen2b+ngqWB4skUy7u77RMS88kUV5eguWNDdhoffOejcuw3nROnZV7fXVGzxTCb2PPbLePXPVHs4GcGmKc+ykp1g0O4j/30kmcsY5ndGgEYwwTdgON9EFCLBYyHZWbIc942SnJVHLSCU6NzY31bgavuqzYrQVleD13eImasZyIxJ2BEyw1Q7I8tdUsBw8poyf9W3MI2zl3fLl0qxNnrrbi6PlbaO8adLslMFIjF6SKOr2lqxmWOzYsx4++ewe2mXEx24OqyfpElzD5QjPOmjF+6eYddHFZAUPrWQfuc9OYayBp3WzUBi1c+8uZJeYa4GtcQ81HGoPuWnk8n6c+6r6S55Eac6Vmz3x2L1z+Fnvk84ANcvz2t9vKmB+YrFz4kv0OnRpBGxwx2diO9ctcOdKpwR1gMszVYJXXQ2P3pSOXXP9yt2/Y7YCUa6OfS0Y2rarDx961y0WwlNtAkk6emZYLr+Ear+8Nu75r7egaGHZGKe9Rzq6Pdc70VG1FMbatXYodZqBze8ZltRVZu+8Try2zReUNOgOt3Vy63oE2M2Tf5tSYpCx4JtSXFLfDmpMx13b4mruO9PuuvfBrUh91n+VX8jxY1qmtwDlcsfZibSTTXlLtx+N2beH7k8Ivtt8uMf1db3p8w7ol2Gt1YgONDdPz1NcZZrvd8HpSRm/UbaH71e+dxpXbXfAG/C66YbbgdfG3OTP8uOmMT7xnFx5b++j6l9/Z7nLqtODMtTa8aXWDu5p5Z8Foyxa8ZF43l2OUmV5geXzshe2un89GeTDvF3N+nbX7+6XvnrK++C681u/N5v19ELwm9k2M5KouK7H+dxl+8Nmtzqn3qNf7qLC8MqScfWFcb+vG8UstuGL9SUfzXQxNsXyWKogRZU6v2B/c0TFm/XTCdA2vm+87fWPC67X/Z1HPpJ0a1idvtHq1Z9NyFwlUba9x7JNhNsp9YlnOd+TUEOM8qLEwIWJzZx8GBunQSNqxHMSn3xRiMZFpJpn2wkdrDu6RvZYNAAqDATd7R2dAaCSK3oGw23aWuWnYjrrv9CN0p88lwFpphvo2Myye3r7adWLswJgIKxeDBiYpY44Qbp/bYwNMhgO7viGHbT1VrDZosIFCRWkQK+oqzNAsSr87d7AcOHjqtYES98/njBp31KHR405ysjKyl3kfaaz3DIXQb58Z4rImE0aB0MHF74xaubvlLNYds0tO3fvUDCmjgjgo4vVzhrA0WIhiqyNFhT6U2fOqsiAqS4IoKy5Mh77fp96wHPk99rli+xzLkgY7v4OzzLlg2Mqhs3fI1TeuJaeTJ5djEZY7I4NYltzxpdLKlg411r+HgdfH2WduR0iDlPc4t9eXukbeb+onXh/rD/XQbJCJ3GB9Z7sZZGJl04dxToq4k7GDJikOlzvCjuHnBrgE0Ax5Cg2+SDzu9NLEdsPfyZQrry+lLzzO+GSboVFGxxTzHlW5el/kIr8Y6l0SNH37oJlw+z6fjzrd2kppkSsv7h7DJIWzGZkxGZnypP5hVB11dWpp4OzVKd4mfj1/o9Kun0stsqV/uZSGCbsHKK6NJN3vzOLlPDKufqX1MhNXLq+tcPoiG/C72Qfw/rbYOIEOwQLT+7nVGbxe7vrmdQmBl9aUuT4on3AOiUTS9G3U1SfucjdiZZdITMjRNAnOiTQSx7DpFY7T2Kf32Wept6l/WD/ZL3FXrrnQM37TM1zeymTl1DNcAsrP0DEym+SyfmUbOTXEOGykD0J1RIiZwUEnZ/fbuvrdI3PTTHRqcGBUs6oOq1c3YNuahvSa7NTggetWszVYmgn53s6n0lOzxUOVi50qz5cODK4f7zejbsgGT+NOjUjGOEsZvG93atAJwcGzJ+3U8Lzl1CiiU8Pv6se4U6Mk49SYGbkqzwwLvb4t9vb0MNdPwz0Si6ecGs7gjbgIBefUsNfZZiiMfEumZ1UnTqFmnKApY8Pv2g0l4wQcNzbMaMgYDjMlV+0m1/Up29ed7+1jKhZbeeSq3k/Fw5RbyqkRc06McacGnSL2nM6MlJiecU6Nhatn5nsbnIicGmKcfFVWQsxXODjn4Jsefz5mZuczy0/4d18kiq7BsEuayA6VHSmXrHxs/3ZsWf3oYa0i92S26uMgiqH0zoFh4sJe04Ml3ueUpD9ksFtm35x5fFvkRvo517oz50hmra3qi5jvsAqzTbCNuDaTbjfUp2xLNm69p92kP5jmrXZjRoe1CRehlHYQ0rBge5kYAaXxrxCLD+oO6hG3JJTLQxMpfZPSM5xgSD1O1jeThaJnFpL+k1NDjKPBsBDZ50G6lZEc3NaSa0HPX+9wO48wHHL9ilo5NRYIc923qr6IhcBctRu1FyEWL9IzC8v+l1NDjKPOXYi55W1h1sMRF8XB2UmGKuZq+YkQQgghhFj4yKkhFiRyaggx99xP96o9CiGEEEKI2UJODbEgkRElhBBCCCGEEAufhWT/52bzYyGEEEIIIYQQQohHRE4NIYQQQgghhBBCzEvk1BBCCCGEEEIIIcS8RDk1xDjKqSHmEtU3IYQQQgghcoPHs3DiG+TUyCIy0oQQQgghhBBi4SP7OX+QUyOLyKkh5gLWM7ZXtVkhhBBCCCHEYkc5NYQQQgghhBBCCDEvGY/UEELMDxSpIYQQQgghhBApFKkhhBBCCCGEEEKIeQjw/we/Ut/m8c/PAAAAAABJRU5ErkJggg==';\r\n\t\r\n dd.content = [];\r\n dd.content.push({text: 'Toronto\\'s Lobby Registry',style: 'reporttitle'});\r\n dd.content.push({text: 'Lobbyist Report (PDF)',style: 'cmo'});\r\n //dd.content.push({text: arrMM[dt.getMonth()] + \" \" + dt.getDate() + \", \" + dt.getFullYear(),style: 'reportdate'});\r\n dd.content.push({text: 'Terms of Use Disclaimer', style: 'termsheader'});\r\n dd.content.push({text: 'This portion of the City of Toronto web site is being used for the purpose of disclosure of information contained in the City\\'s Lobbyist Registry System (the \"System\") under Chapter 140, Lobbying, of the City of Toronto Municipal Code. This site is being made available to allow members of the public to readily obtain information regarding the activities of lobbyists involved in lobbying the City of Toronto.', style: 'termstext'});\r\n dd.content.push({text: 'Users of this portion of the City of Toronto web site should be aware of the following:', style: 'termstext'});\r\n dd.content.push({text: \"(i) Despite the Lobbyist Registrar's authority to verify and clarify the information submitted to the System, it is the lobbyists' exclusive responsibility to ensure that all submitted information is accurate and correct and the information submitted by lobbyists to the System may be posted as received; and\", style: 'termstext'});\r\n dd.content.push({text: 'ii) The City of Toronto provides the System on an \"as is\", \"as available\", basis. The City does not make any express or implied warranties, representations or endorsements with respect to the system, including but not limited to, warranties as to usefulness, completeness, accuracy and reliability and the City will not accept any responsibility for data improperly entered. In addition, the City does not represent and warrant that the system will be available or meet your requirements, that access will be uninterrupted, that there will be no delays, failures or errors or omissions or loss of transmitted information, that no viruses or other contaminating or destructive properties will be transmitted or that no damage will occur to your computer system. As a user of the System, you accept sole responsibility for adequate protection and backup of your data, hardware and software and to take reasonable and appropriate precautions against viruses and other contaminating or destructive properties.', style: 'termstext'});\r\n\r\n var tbl = {};\r\n tbl.style = 'rpttable';\r\n tbl.table = {};\r\n //table widths must match columns or js error\r\n tbl.table.widths = columnWidths(); //['*', '*', 100, '*', '*', 100, '*','*'];\r\n tbl.table.headerRows = 1;\r\n tbl.table.body = [];\r\n tbl.table.body[0] = [];\r\n\r\n $.merge(tbl.table.body[0],addHeaders());\r\n\r\n dd.content.push({text: 'Lobbyist Report',style: 'measuretitle', pageBreak: 'before'});\r\n\r\n //var dataSource = this[rptColumns[gblSelectedReport].DataSource];\r\n var rowcnt = 1;\r\n $.each(gblCurrentSMData.searchResultVOs, function(x, SM) {\r\n\r\n tbl.table.body[rowcnt] = [];\r\n\r\n for (var i = 0; i < rptColumns[gblSelectedReport].Cols.length; i++) {\r\n switch(rptColumns[gblSelectedReport].Cols[i].column) {\r\n case 'SMLLobbyist':\r\n tbl.table.body[rowcnt].push({text: SM.lobbyistName || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLLobbyistNames':\r\n tbl.table.body[rowcnt].push({text: SM.lobbyistList , style: 'tblcol'});\r\n break;\r\n case 'SMLPOHName':\r\n tbl.table.body[rowcnt].push({text: SM.pohName || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLPOHNameTitle':\r\n tbl.table.body[rowcnt].push({text: SM.pohNameOrTitle || \"\", style: 'tblcol'});\r\n break; \r\n case 'SMLPOHPosition':\r\n tbl.table.body[rowcnt].push({text: SM.pohPosition || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLPOHType':\r\n tbl.table.body[rowcnt].push({text: SM.pohType || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLFinContributor':\r\n tbl.table.body[rowcnt].push({text: SM.financialContributor || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLFinContributors':\r\n tbl.table.body[rowcnt].push({text: SM.financialContributors.join(\", \"), style: 'tblcol'});\r\n break;\r\n case 'SMLLobbyistType':\r\n tbl.table.body[rowcnt].push({text: SM.lobbyistType || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLBeneficiary':\r\n tbl.table.body[rowcnt].push({text: SM.beneficiaryName || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLBeneficiaries':\r\n tbl.table.body[rowcnt].push({text: SM.beneficiaries.join(\", \"), style: 'tblcol'});\r\n break;\r\n case 'SMLBusOrg':\r\n tbl.table.body[rowcnt].push({text: SM.businessOrganization || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLClient':\r\n tbl.table.body[rowcnt].push({text: SM.client || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLSubjectMatter':\r\n tbl.table.body[rowcnt].push({text: SM.subjectMatter || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLStatus':\r\n tbl.table.body[rowcnt].push({text: SM.status || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLInitFileDate':\r\n tbl.table.body[rowcnt].push({text: SM.InitialApprovalDate || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLCommMethod':\r\n tbl.table.body[rowcnt].push({text: SM.communicationMethod || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLCommDate':\r\n tbl.table.body[rowcnt].push({text: SM.communicationDate || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLRequestMeeting':\r\n tbl.table.body[rowcnt].push({text: SM.requestMeeting || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLResultOfMeetingRequest':\r\n tbl.table.body[rowcnt].push({text: SM.resultOfMeetingRequest || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLDateOfRequest':\r\n tbl.table.body[rowcnt].push({text: SM.dateOfRequest || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLSubjectMatterNo':\r\n tbl.table.body[rowcnt].push({text: SM.subjectMatterNumber || \"\", style: 'tblcol'});\r\n break;\r\n case 'SMLLobRegNo':\r\n tbl.table.body[rowcnt].push({text: SM.lobbyistRegistrationNumber || \"\", style: 'tblcol'});\r\n break;\r\n }\r\n\r\n }\r\n\r\n rowcnt++;\r\n });\r\n\r\n dd.content.push( tbl );\r\n\r\n //pdfMake.createPdf(dd).open();\r\n pdfMake.createPdf(dd).download(\"Lobby Registry Data.pdf\");\r\n}", "title": "" }, { "docid": "34ad294febd23d87bb404285eee9358b", "score": "0.5576576", "text": "async function pdf(){\n \n var data = obj.INFO\n var data1 = data.map(data => {\n // Flight name\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Flight Name: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Flight_Name,{\n underline:false\n })\n\n // Source time\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Source Time: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Source_Time,{\n underline:false\n })\n\n //! Source city\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Source City: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Source_City,{\n underline:false\n })\n\n//! total time\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Total Time: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Total_Time,{\n underline:false\n })\n\n\n //! no. of stops \n\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Number Of Stops: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Number_Of_Stops,{\n underline:false\n })\n\n //! destination time\n\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Destination Time: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Destination_Time,{\n underline:false\n })\n\n //! destination city\n\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n \n pdfdocument.fillColor('black') \n .text(\"Destination City: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Destination_City,{\n underline:false\n })\n\n //!flight ticket price\n\n pdfdocument.font('Times-Roman'); \n pdfdocument.fontSize(12); \n \n // pdfdocument.moveDown(1);\n pdfdocument.fillColor('black') \n .text(\"Flight Ticket Price: \",{\n underline:true,\n continued:true\n }).fillColor('#1B1464')\n .text(data.Flight_Ticket_Price,{\n underline:false\n })\n\n\n pdfdocument.moveDown(1);\n\n\n });\n\n \n }", "title": "" }, { "docid": "acc18e9e45c54f747433970a58be6e79", "score": "0.5575986", "text": "function PrintPDF() { if (OBPager.taskSubmittedFlag == 1) { print(); } else { return false; } }", "title": "" }, { "docid": "62f03c25bc00432663420bdb1036209c", "score": "0.55754733", "text": "function create_pdf (personas,paginas) {\n // Creamos el archivo estatico\n doc.pipe(fs.createWriteStream(\"static/pdf/file.pdf\"));\n\n // Recorro todas las personas\n for (var i = 0; i < paginas; i++) {\n // Asignamos el diseño\n set_page(personas[i]);\n // Chequeo si no es la ultima pagina\n if(i!=paginas-1){\n doc.addPage();\n }\n }\n\n // Finalizamos el archivo\n doc.end();\n\n // Lo anunciamos como ready\n isReady = true;\n}", "title": "" }, { "docid": "0999c531721a57a04e897df29f838a32", "score": "0.5548337", "text": "function printReport() {\n\tvar report = Banana.Report.newReport(param.reportName);\n\n\tvar formLength = form.length;\n\tfor (var i = 0; i < formLength; i++) {\n\n\t\t/** \n\t\t\t1. Title\n\t\t**/\n\t\treport.addParagraph(\"ESTRATTO CONTO DEI MOVIMENTI FINANZIARI - CONTABILITÀ RESIDENTI dal 01.01.\" + param.year + \" al 31.12.\" + param.year, \"title bold center\");\n\t\treport.addParagraph(\" \");\n\n\n\t\t/**\n\t\t\t2. Information of the resident\n\t\t**/\n\t\treport.addParagraph(\"Nome e cognome residente: \" + getObject(form, form[i].name).name);\n\t\treport.addParagraph(\"Struttura: \" + getObject(form, form[i].name).struttura);\n\t\treport.addParagraph(\" \");\n\t\treport.addParagraph(\" \");\n\n\n\t\t/** \n\t\t\t3. Bank statements\n\t\t**/\n\n\t\t//CASSA\n\t\tprintBankStatement(getObject(form, form[i].name).accountCassa, getObject(form, form[i].name).numeroContoCassa, report);\n\t\t\n\t\t//POSTA\n\t\tprintBankStatement(getObject(form, form[i].name).accountPosta, getObject(form, form[i].name).numeroContoPosta, report);\n\t\t\n\t\t//SOSPESI\n\t\tprintBankStatement(getObject(form, form[i].name).accountSosp, \"Sospesi\", report);\n\n\n\t\t/**\n\t\t\t4. Totals \n\t\t**/\n\t\tvar table = report.addTable(\"tableTotals\");\n\t\ttableRow = table.addRow();\n\t\t\n\t\t//CASSA\n\t\ttableRow.addCell(\"Totale Saldo Cassa al 31.12.\" + param.year + \": \", \"styleTotal bold 10pt\", 1);\n\t\ttableRow.addCell(param.basicCurrency, \"styleTotal bold 10pt\", 1);\n\t\tif (getObject(form, form[i].name).endBalanceCassa) {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalanceCassaFormatted, \"right styleTotal bold 10pt\", 1);\n\t\t} else {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalanceCassaFormatted, \"right styleTotal bold 10pt\", 1); //endBalanceCassa\n\t\t}\n\t\ttableRow.addCell(\" \", \"\", 1);\n\n\t\t//POSTA\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"Totale Saldo Conto Corrente Postale al 31.12.\" + param.year + \": \", \"styleTotal bold 10pt\", 1);\n\t\ttableRow.addCell(param.basicCurrency, \"styleTotal bold 10pt\", 1);\n\t\tif (getObject(form, form[i].name).endBalancePosta) {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalancePostaFormatted, \"right styleTotal bold 10pt\", 1);\n\t\t} else {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalancePostaFormatted, \"right styleTotal bold 10pt\", 1);\n\t\t}\n\t\ttableRow.addCell(\" \", \"\", 1);\n\n\t\t//SOSPESI\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"Totale Saldo Sospesi al 31.12.\" + param.year + \": \", \"styleTotal bold 10pt\", 1);\n\t\ttableRow.addCell(param.basicCurrency, \"styleTotal bold 10pt\", 1);\n\t\tif (getObject(form, form[i].name).endBalanceSosp) {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalanceSospFormatted, \"right styleTotal bold 10pt\", 1);\n\t\t} else {\n\t\t\ttableRow.addCell(getObject(form, form[i].name).endBalanceSospFormatted, \"right styleTotal bold 10pt\", 1);\n\t\t}\n\t\ttableRow.addCell(\" \", \"\", 1);\n\n\n\t\t/**\n\t\t\t5. Signature\n\t\t**/\t\n\t\treport.addParagraph(\" \");\n\t\treport.addParagraph(\" \");\n\t\tvar table = report.addTable(\"tableSignature\");\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(param.city + \", 31.12.\" + param.year, \"\", 1);\n\t\ttableRow.addCell(param.companyName, \"\", 1);\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"\", \"\", 2);\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"\", \"\", 2);\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"\", \"\", 2);\n\n\t\t//Text\n\t\ttableRow = table.addRow();\n\t\ttableRow.addCell(\"Gli interessi attivi e passivi rimangono a favore o rispettivamente a carico degli Istituti Sociali Comunali della Città di Lugano senza influenzare in alcun modo i conti dei singoli residenti. Gli interessi attivi servono per coprire le spese di tenuta del conto e l'Imposta preventiva verrà gestita dagli Istituti Sociali Comunali. Contro il presente estratto può essere inoltrato reclamo scritto entro 10 giorni dalla ricezione, scaduto questo termine riterremo il presente estratto definitivo. Le ricevute delle registrazioni così come le pezze giustificative dei movimenti contabili possono essere consultati presso il servizio contabile di ogni struttura previo richiesta preventiva telefonica o scritta. Documento senza firma.\", \"\", 2);\n\n\t\t//Add a page break between each resident\n\t\treport.addPageBreak();\n\t}\n\n\t//Add the footer\n\taddFooter(report);\n\n\t//Function call to use the styles\n\tvar stylesheet = createStyleSheet();\n\n\t//Create the prewiev of the report\n\tBanana.Report.preview(report, stylesheet);\n\n\t//Return the report\n\treturn report;\n}", "title": "" }, { "docid": "27ba23097b7e201fdb2c91fc35e54bb9", "score": "0.550178", "text": "function ExportPreviewPDF(doc) {\n\tvar toPDF = new File(Folder.desktop + \"/\" + doc.fullName.name.replace(\".indd\", \".pdf\"));\n\tExportPDFWithPreset(doc, toPDF, \"Jono Voorbeeld PDF\");\n}", "title": "" }, { "docid": "ec3fd4d18914b45f79e29b4a40c70404", "score": "0.5472841", "text": "downloadPDF() {\n var doc = new jsPDF(\"landscape\");\n doc.setFontSize(8);\n doc.setFontType(\"bold\");\n var headText = \"\";\n for (var key in this.state.stocks[0]) {\n headText = headText + \" | \" + key;\n }\n doc.text(20, 20, headText);\n\n doc.setFontType(\"normal\");\n let yLocation = 20;\n for (let i = 0; i < this.state.stocks.length; i++) {\n var text = \"\";\n for (var key in this.state.stocks[i]) {\n text = text + \" | \" + this.state.stocks[i][key];\n }\n doc.text(20, (yLocation += 10), text);\n }\n // Output as Data URI\n doc.save(\"Portfolio.pdf\");\n }", "title": "" }, { "docid": "4dbfd4e03b8a9a21d91d38522781f751", "score": "0.5465374", "text": "function openPDFReport(download, _debug){\n if ( vm.processing_download_report || vm.processing_upload_report )\n return;\n\n if ( download )\n vm.processing_download_report = true;\n else\n vm.processing_upload_report = true;\n\n var _filters = {\n bNotification : true,\n bRecommendation : true,\n bDrug : true,\n range : {\n start : vm.startDate,\n end : vm.endDate\n }\n };\n\n physicianPatientDataService\n .getMePhysicianPatient($routeParams.patientId, _filters)\n .then(function(patientReports){\n\n var _patientDrugs = patientReports.patientDrugs;\n var _recommendations = patientReports.recommendations; \n var _notification_bases = patientReports.notificationBases; \n\n //Populate contents\n pdfMakeService.getBaseDocDefinition().then(function(baseDocDefinition){\n var _date_created = baseDocDefinition.date_created;\n var pdf_DocDefinition = baseDocDefinition;\n var _patient_basic_info = PDFBuilder_patient_info(_date_created);\n var _title_text = PDFBuilder_title();\n var _patient_bp_table = PDFBuilder_patient_bp_measurements(); \n\n var _chart_image = document.getElementById(\"bpMeasurementChart\").toDataURL();\n pdf_DocDefinition.content = [\n _patient_basic_info, \n {\n text : _title_text,\n margin : [10,20,10,10]\n },\n {\n image : _chart_image,\n fit : [500,500],\n margin : 10,\n alignment : 'center'\n }, \n {\n table : _patient_bp_table,\n margin : [2,15,2,0]\n },\n pdfMakeService.createTableTitle('Medication And Notes'),\n {\n table : patientReportContentToPDFService.convertMedicationsToTable(_patientDrugs),\n },\n pdfMakeService.createTableTitle('Recommendations'), \n {\n table : patientReportContentToPDFService.convertRecommendationsToTable(_recommendations),\n },\n pdfMakeService.createTableTitle('Notifications'),\n {\n table : patientReportContentToPDFService.convertNotificationsBasesToTable(_notification_bases),\n }\n ];\n\n //create name\n var _pdf_file_name = getPDFFileName();\n\n if ( _debug ){\n vm.processing_download_report = false; \n vm.processing_upload_report = false; \n return pdfMake.createPdf(pdf_DocDefinition).open(); \n }\n\n if ( download ) {\n vm.processing_download_report = false; \n return pdfMake.createPdf(pdf_DocDefinition).download(_pdf_file_name);\n } else { \n return pdfMake\n .createPdf(pdf_DocDefinition)\n .getDataUrl(function(dataURL){\n\n var _blob = pdfMakeService.convertDataUrlToBlob(dataURL, _pdf_file_name);\n var _category = 'Uploaded Reports'; \n patientFileDataService\n .uploadPhysicianPatientDocument(_blob, vm.patient_id, _category)\n .then(function(result){\n vm.processing_upload_report = false; \n onReportUpload('Successfully Uploaded BP Measurement Charts to Patient Records'); \n }, function(err){\n vm.processing_upload_report = false; \n onReportUpload('Failed to Upload BP Measurement Charts to Patient Records, please check console for cause (dev)', true); \n console.log('upload error', err);\n });\n }) \n }\n }); \n\n }, function(err){\n console.log('getPatientReport', err);\n }); \n }", "title": "" }, { "docid": "f485bb3e2b49a2f0775c3a86857f12bc", "score": "0.5459164", "text": "function setupPDF() {\n var slideSize = getComputedSlideSize(window.innerWidth, window.innerHeight); // Dimensions of the PDF pages\n\n var pageWidth = Math.floor(slideSize.width * (1 + config.margin)),\n pageHeight = Math.floor(slideSize.height * (1 + config.margin)); // Dimensions of slides within the pages\n\n var slideWidth = slideSize.width,\n slideHeight = slideSize.height; // Let the browser know what page size we want to print\n\n injectStyleSheet('@page{size:' + pageWidth + 'px ' + pageHeight + 'px; margin: 0px;}'); // Limit the size of certain elements to the dimensions of the slide\n\n injectStyleSheet('.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: ' + slideWidth + 'px; max-height:' + slideHeight + 'px}');\n document.body.classList.add('print-pdf');\n document.body.style.width = pageWidth + 'px';\n document.body.style.height = pageHeight + 'px'; // Make sure stretch elements fit on slide\n\n layoutSlideContents(slideWidth, slideHeight); // Add each slide's index as attributes on itself, we need these\n // indices to generate slide numbers below\n\n toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)).forEach(function (hslide, h) {\n hslide.setAttribute('data-index-h', h);\n\n if (hslide.classList.contains('stack')) {\n toArray(hslide.querySelectorAll('section')).forEach(function (vslide, v) {\n vslide.setAttribute('data-index-h', h);\n vslide.setAttribute('data-index-v', v);\n });\n }\n }); // Slide and slide background layout\n\n toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR)).forEach(function (slide) {\n // Vertical stacks are not centred since their section\n // children will be\n if (slide.classList.contains('stack') === false) {\n // Center the slide inside of the page, giving the slide some margin\n var left = (pageWidth - slideWidth) / 2,\n top = (pageHeight - slideHeight) / 2;\n var contentHeight = slide.scrollHeight;\n var numberOfPages = Math.max(Math.ceil(contentHeight / pageHeight), 1); // Adhere to configured pages per slide limit\n\n numberOfPages = Math.min(numberOfPages, config.pdfMaxPagesPerSlide); // Center slides vertically\n\n if (numberOfPages === 1 && config.center || slide.classList.contains('center')) {\n top = Math.max((pageHeight - contentHeight) / 2, 0);\n } // Wrap the slide in a page element and hide its overflow\n // so that no page ever flows onto another\n\n\n var page = document.createElement('div');\n page.className = 'pdf-page';\n page.style.height = (pageHeight + config.pdfPageHeightOffset) * numberOfPages + 'px';\n slide.parentNode.insertBefore(page, slide);\n page.appendChild(slide); // Position the slide inside of the page\n\n slide.style.left = left + 'px';\n slide.style.top = top + 'px';\n slide.style.width = slideWidth + 'px';\n\n if (slide.slideBackgroundElement) {\n page.insertBefore(slide.slideBackgroundElement, slide);\n } // Inject notes if `showNotes` is enabled\n\n\n if (config.showNotes) {\n // Are there notes for this slide?\n var notes = getSlideNotes(slide);\n\n if (notes) {\n var notesSpacing = 8;\n var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline';\n var notesElement = document.createElement('div');\n notesElement.classList.add('speaker-notes');\n notesElement.classList.add('speaker-notes-pdf');\n notesElement.setAttribute('data-layout', notesLayout);\n notesElement.innerHTML = notes;\n\n if (notesLayout === 'separate-page') {\n page.parentNode.insertBefore(notesElement, page.nextSibling);\n } else {\n notesElement.style.left = notesSpacing + 'px';\n notesElement.style.bottom = notesSpacing + 'px';\n notesElement.style.width = pageWidth - notesSpacing * 2 + 'px';\n page.appendChild(notesElement);\n }\n }\n } // Inject slide numbers if `slideNumbers` are enabled\n\n\n if (config.slideNumber && /all|print/i.test(config.showSlideNumber)) {\n var slideNumberH = parseInt(slide.getAttribute('data-index-h'), 10) + 1,\n slideNumberV = parseInt(slide.getAttribute('data-index-v'), 10) + 1;\n var numberElement = document.createElement('div');\n numberElement.classList.add('slide-number');\n numberElement.classList.add('slide-number-pdf');\n numberElement.innerHTML = formatSlideNumber(slideNumberH, '.', slideNumberV);\n page.appendChild(numberElement);\n }\n }\n }); // Show all fragments\n\n toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR + ' .fragment')).forEach(function (fragment) {\n fragment.classList.add('visible');\n }); // Notify subscribers that the PDF layout is good to go\n\n dispatchEvent('pdf-ready');\n }", "title": "" }, { "docid": "f92a783254976b059248d7a57af37773", "score": "0.54505837", "text": "function printTicket() {\n const path = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];\n var idTicket = sessionStorage.getItem('idTicket')\n ipcRenderer.send('printTicket', path + '/invoices/enlace-factura-' + idTicket + '.pdf');\n}", "title": "" }, { "docid": "a8bed1b982346a63356a3fd54a6f639b", "score": "0.5446", "text": "splitPDF(isAll){\n const pdfDoc = new HummusRecipe(`${__path}/${this.file}`);\n \n pdfDoc\n .split(__pathtemp, isAll ? __outext : __intext)\n .endPDF();\n }", "title": "" }, { "docid": "dd91b47d0a187b767a43a7329e49f80a", "score": "0.5430819", "text": "isJoinPDF(){\n let size = this.is_split.length\n const pdfDoc = new HummusRecipe(`${__pathtemp}/${__outext}-0.pdf`, `${__pathtemp}/${__outpdftext}.pdf`);\n for (let i = 1; i < size; i++) {\n pdfDoc.appendPage(`${__pathtemp}/${__outext}-${i}.pdf`)\n }\n pdfDoc.endPDF();\n }", "title": "" }, { "docid": "e58214b4dc1c0bba0105a29539ed7e89", "score": "0.53991127", "text": "function pdfDownload(){\n // var valuePromo=document.getElementById(\"Valuecode\");\n // var total = document.getElementsByClassName(\"prixTotal\");\n // var quantity = document.getElementsByClassName(\"quantityPanier\");\n // var Produit_nom= document.getElementsByClassName(\"produit_name\");\n // var PrixTotal =document.getElementById(\"priceTotal\");\n // var affich=\"\";\n // for(var i=0;i<total.length;i++){\n // affich +=Produit_nom[i].innerHTML + \" x la quantity est : \" + quantity[i].value + \" le prix est : \" +total[i].innerHTML + \"\\n\" ;\n // }\n // affich +=\"Le Value promo : \" + valuePromo.innerHTML + \" le Prix Total est : \" + PrixTotal.innerHTML;\n // console.log(affich);\n // var commande={\n // content : [{\n // affich,style:'table'\n // }],\n // styles:{ \n // table:{\n // fontSize:22,\n // bold:true\n\n // }\n // }\n // };\n\n var docDefinition = {\n content: [\n { text: 'This is a header', style: 'header' },\n 'No styling here, this is a standard paragraph',\n { text: 'Another text', style: 'anotherStyle' },\n { text: 'Multiple styles applied', style: [ 'header', 'anotherStyle' ] }\n ],\n \n styles: {\n header: {\n fontSize: 22,\n bold: true\n },\n anotherStyle: {\n italics: true,\n alignment: 'right'\n }\n }\n };\n\n pdfMake.createPdf(docDefinition).download();\n\n}", "title": "" }, { "docid": "2cba3a158dff88c2683162df61ada68a", "score": "0.53964996", "text": "function printPDF(mn,idx){\n var par='',tok='',p=v='';\n $('.'+mn+'_cari').each(function(){\n p=$(this).attr('id');\n v=$(this).val();\n par+='&'+p+'='+v;\n tok+=v;\n });\n // if(mn=='kwitansipenerimaansiswa') {\n if(idx!='') {\n par+='&idpembayaran='+idx;\n tok+=idx;\n }\n var x = $('#id_loginS').val();\n var token = encode64(x+tok);\n window.open('report/r_'+mn+'.php?token='+token+par,'_blank');\n }", "title": "" }, { "docid": "72c146b50023e06d9221ebcd160fe011", "score": "0.5391234", "text": "function setupPDF() {\n\n\t\tvar slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );\n\n\t\t// Dimensions of the PDF pages\n\t\tvar pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ),\n\t\t\tpageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) );\n\n\t\t// Dimensions of slides within the pages\n\t\tvar slideWidth = slideSize.width,\n\t\t\tslideHeight = slideSize.height;\n\n\t\t// Let the browser know what page size we want to print\n\t\tinjectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0px;}' );\n\n\t\t// Limit the size of certain elements to the dimensions of the slide\n\t\tinjectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );\n\n\t\tdocument.body.classList.add( 'print-pdf' );\n\t\tdocument.body.style.width = pageWidth + 'px';\n\t\tdocument.body.style.height = pageHeight + 'px';\n\n\t\t// Make sure stretch elements fit on slide\n\t\tlayoutSlideContents( slideWidth, slideHeight );\n\n\t\t// Add each slide's index as attributes on itself, we need these\n\t\t// indices to generate slide numbers below\n\t\ttoArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) {\n\t\t\thslide.setAttribute( 'data-index-h', h );\n\n\t\t\tif( hslide.classList.contains( 'stack' ) ) {\n\t\t\t\ttoArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) {\n\t\t\t\t\tvslide.setAttribute( 'data-index-h', h );\n\t\t\t\t\tvslide.setAttribute( 'data-index-v', v );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\t// Slide and slide background layout\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\n\t\t\t// Vertical stacks are not centred since their section\n\t\t\t// children will be\n\t\t\tif( slide.classList.contains( 'stack' ) === false ) {\n\t\t\t\t// Center the slide inside of the page, giving the slide some margin\n\t\t\t\tvar left = ( pageWidth - slideWidth ) / 2,\n\t\t\t\t\ttop = ( pageHeight - slideHeight ) / 2;\n\n\t\t\t\tvar contentHeight = slide.scrollHeight;\n\t\t\t\tvar numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );\n\n\t\t\t\t// Adhere to configured pages per slide limit\n\t\t\t\tnumberOfPages = Math.min( numberOfPages, config.pdfMaxPagesPerSlide );\n\n\t\t\t\t// Center slides vertically\n\t\t\t\tif( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {\n\t\t\t\t\ttop = Math.max( ( pageHeight - contentHeight ) / 2, 0 );\n\t\t\t\t}\n\n\t\t\t\t// Wrap the slide in a page element and hide its overflow\n\t\t\t\t// so that no page ever flows onto another\n\t\t\t\tvar page = document.createElement( 'div' );\n\t\t\t\tpage.className = 'pdf-page';\n\t\t\t\tpage.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px';\n\t\t\t\tslide.parentNode.insertBefore( page, slide );\n\t\t\t\tpage.appendChild( slide );\n\n\t\t\t\t// Position the slide inside of the page\n\t\t\t\tslide.style.left = left + 'px';\n\t\t\t\tslide.style.top = top + 'px';\n\t\t\t\tslide.style.width = slideWidth + 'px';\n\n\t\t\t\tif( slide.slideBackgroundElement ) {\n\t\t\t\t\tpage.insertBefore( slide.slideBackgroundElement, slide );\n\t\t\t\t}\n\n\t\t\t\t// Inject notes if `showNotes` is enabled\n\t\t\t\tif( config.showNotes ) {\n\n\t\t\t\t\t// Are there notes for this slide?\n\t\t\t\t\tvar notes = getSlideNotes( slide );\n\t\t\t\t\tif( notes ) {\n\n\t\t\t\t\t\tvar notesSpacing = 8;\n\t\t\t\t\t\tvar notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline';\n\t\t\t\t\t\tvar notesElement = document.createElement( 'div' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes-pdf' );\n\t\t\t\t\t\tnotesElement.setAttribute( 'data-layout', notesLayout );\n\t\t\t\t\t\tnotesElement.innerHTML = notes;\n\n\t\t\t\t\t\tif( notesLayout === 'separate-page' ) {\n\t\t\t\t\t\t\tpage.parentNode.insertBefore( notesElement, page.nextSibling );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnotesElement.style.left = notesSpacing + 'px';\n\t\t\t\t\t\t\tnotesElement.style.bottom = notesSpacing + 'px';\n\t\t\t\t\t\t\tnotesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px';\n\t\t\t\t\t\t\tpage.appendChild( notesElement );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Inject slide numbers if `slideNumbers` are enabled\n\t\t\t\tif( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) {\n\t\t\t\t\tvar slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1,\n\t\t\t\t\t\tslideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1;\n\n\t\t\t\t\tvar numberElement = document.createElement( 'div' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number-pdf' );\n\t\t\t\t\tnumberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV );\n\t\t\t\t\tpage.appendChild( numberElement );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\t\t// Show all fragments\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) {\n\t\t\tfragment.classList.add( 'visible' );\n\t\t} );\n\n\t\t// Notify subscribers that the PDF layout is good to go\n\t\tdispatchEvent( 'pdf-ready' );\n\n\t}", "title": "" }, { "docid": "a0b9ec347bfffcc90551fdbbca6d82df", "score": "0.5390703", "text": "function renderInvoice(documentId) {\n let docRef = db.collection(\"invoices\").doc(documentId);\n docRef\n .get()\n .then(function(doc) {\n if (doc.exists) {\n $(\"invoice-company-name\").innerText = doc.data().companyName;\n $(\"invoice-street-address\").innerText = doc.data().companyStreetAddress;\n $(\"invoice-post-code\").innerText = doc.data().companyPostCode;\n $(\"invoice-city-name\").innerText = doc.data().companyCityName;\n $(\"invoice-country-name\").innerText = doc.data().companyCountryName;\n $(\"invoice-project-name\").innerText = doc.data().projectName;\n $(\"invoice-number\").innerText = doc.data().invoiceNbr;\n $(\"invoice-date\").innerText =\n \"Verzonden op \" +\n doc\n .data()\n .invoiceDate.toDate()\n .toISOString()\n .slice(0, 10);\n $(\"invoice-payment-date\").innerText = doc\n .data()\n .invoicePaymentDate.toDate()\n .toISOString()\n .slice(0, 10);\n $(\"invoice-note\").innerText = \"Nota: \" + doc.data().invoiceNote;\n $(\"invoice-total-sum\").innerText = \"€\" + doc.data().totalSum;\n $(\"invoice-tax-sum\").innerText = \"€\" + doc.data().totalTax;\n $(\"invoice-total-amount\").innerText = \"€\" + doc.data().totalAmount;\n window.print();\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such invoice!\");\n }\n })\n .catch(function(error) {\n console.log(\"Error getting invoice:\", error);\n });\n}", "title": "" }, { "docid": "022f5797e8c72b9db65aafc8df493750", "score": "0.5387943", "text": "function ExportPDFWithPreset(doc, to, presetName) {\n\n\tapp.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;\n\n\tvar preset = app.pdfExportPresets.itemByName(presetName);\n\tdoc.exportFile(ExportFormat.PDF_TYPE, to, false, preset, \"\", true);\n\tdoc.save();\n\n}", "title": "" }, { "docid": "fd417ba8c4b313a6ce435b4281f6f13f", "score": "0.5381128", "text": "function printAll() {\n $(\"#container\").printPage({\n ignoreClass: \"ignore-print\"\n });\n}", "title": "" }, { "docid": "a5303f692e4a223700beed63271b1766", "score": "0.53802586", "text": "exportToPDF() {\n html2pdf(this.$refs.document, {\n /* margin: 1,\n filename: 'document.pdf',\n image: {type: 'jpeg', quality: 0.98},\n html2canvas: {dpi: 192, letterRendering: true},\n jsPDF: {unit: 'in', format: 'letter', orientation: 'landscape'}*/\n margin: 0.5,\n\n filename: `hehehe.pdf`,\n\n image: {\n type: 'jpeg',\n quality: 0.98\n },\n\n enableLinks: false,\n\n html2canvas: {\n scale: 1,\n useCORS: true\n },\n\n jsPDF: {\n unit: 'in',\n format: 'a4',\n orientation: 'portrait'\n }\n })\n }", "title": "" }, { "docid": "89ec8aa641f5ebc366baf888e994ff8d", "score": "0.53686464", "text": "function setupPDF() {\n\n\t\tvar slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );\n\n\t\t// Dimensions of the PDF pages\n\t\tvar pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ),\n\t\t\tpageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) );\n\n\t\t// Dimensions of slides within the pages\n\t\tvar slideWidth = slideSize.width,\n\t\t\tslideHeight = slideSize.height;\n\n\t\t// Let the browser know what page size we want to print\n\t\tinjectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0;}' );\n\n\t\t// Limit the size of certain elements to the dimensions of the slide\n\t\tinjectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );\n\n\t\tdocument.body.classList.add( 'print-pdf' );\n\t\tdocument.body.style.width = pageWidth + 'px';\n\t\tdocument.body.style.height = pageHeight + 'px';\n\n\t\t// Add each slide's index as attributes on itself, we need these\n\t\t// indices to generate slide numbers below\n\t\ttoArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) {\n\t\t\thslide.setAttribute( 'data-index-h', h );\n\n\t\t\tif( hslide.classList.contains( 'stack' ) ) {\n\t\t\t\ttoArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) {\n\t\t\t\t\tvslide.setAttribute( 'data-index-h', h );\n\t\t\t\t\tvslide.setAttribute( 'data-index-v', v );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\t// Slide and slide background layout\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\n\t\t\t// Vertical stacks are not centred since their section\n\t\t\t// children will be\n\t\t\tif( slide.classList.contains( 'stack' ) === false ) {\n\t\t\t\t// Center the slide inside of the page, giving the slide some margin\n\t\t\t\tvar left = ( pageWidth - slideWidth ) / 2,\n\t\t\t\t\ttop = ( pageHeight - slideHeight ) / 2;\n\n\t\t\t\tvar contentHeight = getAbsoluteHeight( slide );\n\t\t\t\tvar numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );\n\n\t\t\t\t// Center slides vertically\n\t\t\t\tif( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {\n\t\t\t\t\ttop = Math.max( ( pageHeight - contentHeight ) / 2, 0 );\n\t\t\t\t}\n\n\t\t\t\t// Position the slide inside of the page\n\t\t\t\tslide.style.left = left + 'px';\n\t\t\t\tslide.style.top = top + 'px';\n\t\t\t\tslide.style.width = slideWidth + 'px';\n\n\t\t\t\t// TODO Backgrounds need to be multiplied when the slide\n\t\t\t\t// stretches over multiple pages\n\t\t\t\tvar background = slide.querySelector( '.slide-background' );\n\t\t\t\tif( background ) {\n\t\t\t\t\tbackground.style.width = pageWidth + 'px';\n\t\t\t\t\tbackground.style.height = ( pageHeight * numberOfPages ) + 'px';\n\t\t\t\t\tbackground.style.top = -top + 'px';\n\t\t\t\t\tbackground.style.left = -left + 'px';\n\t\t\t\t}\n\n\t\t\t\t// Inject notes if `showNotes` is enabled\n\t\t\t\tif( config.showNotes ) {\n\t\t\t\t\tvar notes = getSlideNotes( slide );\n\t\t\t\t\tif( notes ) {\n\t\t\t\t\t\tvar notesSpacing = 8;\n\t\t\t\t\t\tvar notesElement = document.createElement( 'div' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes' );\n\t\t\t\t\t\tnotesElement.classList.add( 'speaker-notes-pdf' );\n\t\t\t\t\t\tnotesElement.innerHTML = notes;\n\t\t\t\t\t\tnotesElement.style.left = ( notesSpacing - left ) + 'px';\n\t\t\t\t\t\tnotesElement.style.bottom = ( notesSpacing - top ) + 'px';\n\t\t\t\t\t\tnotesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px';\n\t\t\t\t\t\tslide.appendChild( notesElement );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Inject slide numbers if `slideNumbers` are enabled\n\t\t\t\tif( config.slideNumber ) {\n\t\t\t\t\tvar slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1,\n\t\t\t\t\t\tslideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1;\n\n\t\t\t\t\tvar numberElement = document.createElement( 'div' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number' );\n\t\t\t\t\tnumberElement.classList.add( 'slide-number-pdf' );\n\t\t\t\t\tnumberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV );\n\t\t\t\t\tbackground.appendChild( numberElement );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\t\t// Show all fragments\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) {\n\t\t\tfragment.classList.add( 'visible' );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "d804c4c94a3590708c39b7d487a825ec", "score": "0.53444713", "text": "exportToPDFnews() {\n html2pdf(this.$refs.document, {\n /* margin: 1,\n filename: 'document.pdf',\n image: {type: 'jpeg', quality: 0.98},\n html2canvas: {dpi: 192, letterRendering: true},\n jsPDF: {unit: 'in', format: 'letter', orientation: 'landscape'}*/\n margin: 1,\n\n filename: `hehehe.pdf`,\n\n image: {\n type: 'jpeg',\n quality: 0.98\n },\n\n enableLinks: false,\n\n html2canvas: {\n scale: 1,\n useCORS: true\n },\n\n jsPDF: {\n unit: 'in',\n format: 'a4',\n orientation: 'landscape'\n }\n })\n }", "title": "" }, { "docid": "afc7037ca0287e684a32b0387643470e", "score": "0.5328351", "text": "async function ScrapeInvoice() {\n // Launch CondoWorks login page on chronium\n const browser = await puppeteer.launch({\n headless: true,\n });\n const page = await browser.newPage();\n await page.goto('https://app-dev.condoworks.co/');\n await page.setViewport({\n width: 1920,\n height: 1080,\n });\n\n // Login with username and password\n await page.type('input[name=\"Email\"]', info.USERNAME);\n await page.type('input[name=\"Password\"]', info.PASSWORD);\n await page.click('#btnSubmit');\n\n // Navigate to Invoices -> All\n await page.waitForSelector(invoiceDropdown);\n await page.click(invoiceDropdown);\n await page.click(invoiceDropdown + '> div > a:nth-child(1)');\n\n // Enter invoice # search into the Invoice # field\n await page.waitForSelector(`a[title=\"View/Edit\"]`);\n await page.type('input[name=\"invoices.InvoiceNumber\"]', info.INVOICE_SEARCH);\n\n // Find and click the magnifying glass in the invoice row with # info.INVOICE_NUM\n const numField = await page.$(`td[title=\"${info.INVOICE_NUM}\"]`);\n const invoiceRow = await numField.getProperty('parentNode');\n const magGlass = await invoiceRow.$('td[data-label=\" \"] > a > button > i');\n\n if (magGlass) {\n await magGlass.click();\n }\n\n // Wait for page to load and set download configurations\n await page.waitForNavigation();\n await page._client.send('Page.setDownloadBehavior', {\n behavior: 'allow',\n downloadPath: downloadPath,\n });\n\n // Download pdf and shortly wait to allow download to finish\n const downloadButton = await page.$('a[title=\"Download file\"]');\n await downloadButton.click();\n await page.waitForTimeout(5000);\n\n // Find name of downloaded file and output file path\n const downloadName = await page.evaluate((obj) => {\n return obj.getAttribute('download');\n }, downloadButton);\n console.log(downloadPath + `/${downloadName}.pdf`);\n\n // Close Browser and end processes\n browser.close();\n}", "title": "" }, { "docid": "0dba17b55ea11a00db96dda9098b59b4", "score": "0.53199494", "text": "async function generarPdf(pedido) {\n // creacion de documento PDF\n const doc = new pdf()\n doc.text(encabezado, {align: 'center'})\n doc.text('************************************************', {align: 'center'})\n doc.text(titulo, {align: 'center'})\n doc.text('\\n')\n\n\n let idCliente = pedido.cliente_id;\n let cliente = await dataCliente.getCliente(idCliente);\n\n doc.text(`${cliente.nombre} ${cliente.apellido} - ${cliente.telefono}`, {align: 'center'});\n doc.text(`${cliente.direccion}`, {align: 'center'});\n\n doc.text('---------------------------------------------------------------------------------------------------------------------')\n doc.text('\\n')\n doc.text('SABOR PRECIO CANT SUBTOTAL ', {align: 'right'})\n doc.text('\\n')\n\n for (const itemProducto of pedido.item_producto) {\n let producto = await dataProducto.getProducto(itemProducto.producto_id);\n doc.text(`${producto.gusto} ${producto.precio} ${itemProducto.cantidad} $ ${itemProducto.subTotal}`, {align: 'right'})\n }\n doc.text('\\n')\n doc.text('---------------------------------------------------------------------------------------------------------------------')\n doc.text('\\n')\n doc.text(` Total: ${pedido.cantidadTotal} $${pedido.total}`,{align: 'right'})\n doc.text('\\n')\n doc.text('---------------------------------------------------------------------------------------------------------------------')\n \n doc.text(pie)\n return doc;\n}", "title": "" }, { "docid": "12a10f254d4486135a450e922d419475", "score": "0.5315616", "text": "function generatePDF(client) {\n\tconsole.log(\"generatePDF\");\n\t\n\t//checks the checkbox\n\tvar val = $$('input[name=\"acknowledge\"]').prop('checked');\n\t\n\t//initializes pdf and defines its structure\n\tif (!val)\n\t\treturn;\n\tvar doc = new jsPDF();\n\t\n\tvar marigin_left = 15;\n\tvar pos_top = 10;\n\tdoc.setFontStyle(\"bold\");\n\tdoc.text(marigin_left, pos_top, client.firstname + \" \" + client.surname);\n\tdoc.setFontStyle(\"normal\");\n\tpos_top = nextPDFLine(doc, pos_top);\n\tdoc.text(marigin_left, pos_top, client.email);\n\tpos_top = nextPDFLine(doc, pos_top);\n\tdoc.text(marigin_left, pos_top, client.phone);\n\tpos_top = nextPDFLine(doc, pos_top);\n\tdoc.text(marigin_left, pos_top, client.address1);\n\tpos_top = nextPDFLine(doc, pos_top);\n\tif (client.address2){\n\t\tdoc.text(marigin_left, pos_top, client.address2);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\tif (client.address3){\n\t\tdoc.text(marigin_left, pos_top, client.address3);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\tif (client.address4){\n\t\tdoc.text(marigin_left, pos_top, client.address4);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\tif (client.address5){\n\t\tdoc.text(marigin_left, pos_top, client.address5);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\tif (client.comments){\n\t\tdoc.text(marigin_left, pos_top, client.comments);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\tdoc.text(marigin_left, pos_top, \"Containers\");\n\tpos_top = nextPDFLine(doc, pos_top);\n\t\n\tpos_top = nextPDFLine(doc, pos_top);\n\tfor (var i=0; i < client.containers.length; i++){\n\t\tpos_top = addContainerToPDF(doc, client.containers[i], marigin_left+10, pos_top);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t\tpos_top = nextPDFLine(doc, pos_top);\n\t}\n\t\n\t\n\tdoc.text(marigin_left, pos_top, \"Container(s) QTY:\"+client.containers.length);\n\tpos_top = nextPDFLine(doc, pos_top);\n\tdoc.text(marigin_left, pos_top, \"Item(s) QTY:\"+countClientItems(client));\n\tpos_top = nextPDFLine(doc, pos_top);\t\n\t\n\tvar pdfOutput = doc.output();\n\tvar uristring = doc.output('datauristring');\n\tvar uristringparts = uristring.split(',');\n\turistringparts[0] = \"base64:\" + escape('raport.pdf') + \"//\";\n\n\tvar moddeduristring = uristringparts.join(\"\");\n\n\n\tsendPDF(client.email, moddeduristring);\n}", "title": "" }, { "docid": "6bb52ae979e8d2fdc99d546e27504b2a", "score": "0.53033257", "text": "getPdf(data) {\n function base64ToArrayBuffer(base64) {\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n return bytes;\n }\n var saveByteArray = (function () {\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n return function (data, name) {\n var blob = new Blob(data, {type: \"octet/stream\"}),\n url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = name;\n a.click();\n window.URL.revokeObjectURL(url);\n };\n }());\n\n if (data[KEYS.FORM_PDF]) {\n let content = base64ToArrayBuffer(data[KEYS.FORM_PDF]);\n saveByteArray([content], `BARS-${data[KEYS.FORM_NAME].replace(' ', '-')}.pdf`);\n }\n }", "title": "" }, { "docid": "003ed6b05cc058921c12b7d75c3c23de", "score": "0.5291265", "text": "function renderDetailedView(fldName, fldLastName, fldCourse, fldGender, fldPicture, fldEmail, fldDisabilities, fldPhoneNumber, fldYear, fldGroup, fldNationality, fldLetter){\n let nav = document.getElementById('navigationbar');\n nav.innerHTML = `<button type=\"button\" onclick=\"renderAllExchangeStudents()\" class=\"btn btn-danger\">close</button>\n <button type=\"button\" id=\"PDF\" class=\"btn btn-warning\">PDF</button>`\n \n let allAlma = document.getElementById('allStudent');\n let htmlString = `\n <h1>${fldName} ${fldLastName}</h1>\n <img class=\"pfp rounded float-right\" src=\"${fldPicture}\" alt=\"\">\n <p>${fldNationality}</p>\n <p>${fldGender}</p>\n <p>Course: ${fldCourse}</p>\n <p>Year: ${fldYear}</p>\n <p>Group: ${fldGroup}</p>\n <p>Disabilities: ${fldDisabilities}</p>\n <h2>Contact</h2>\n <p>${fldEmail}</p>\n <p>${fldPhoneNumber}</p>\n <h2>Motivational Letter</h2>\n <p>${fldLetter}</p>\n `;\n allAlma.innerHTML = htmlString;\n document.getElementById(\"PDF\").addEventListener(\"click\", () => {\n const pdfBody = document.getElementById('allStudent').innerHTML;\n // send whatever you like\n printPDF(pdfBody, fldName, fldLastName);\n });\n}", "title": "" }, { "docid": "92ce3c51317043e44f7eba3e1015080b", "score": "0.5272994", "text": "function g_pdf(files, _stats, cb) {\n var pdfs = files.filter(function(f) {\n return f.isType('pdf')\n });\n cb(null, pdfs);\n}", "title": "" }, { "docid": "bed998adaeda8c844721c52c86e46ab3", "score": "0.5263973", "text": "function printReport() {\n window.print();\n}", "title": "" }, { "docid": "e7910dcb887dab10d72a850a7c3dd2be", "score": "0.5262375", "text": "generatePDF(){\n let auxiliaturas = this.auxis()\n var doc = new jsPDF('p', 'mm', 'letter'),\n size = 20,\n verticalOffset = 20,\n loremipsum = 'Nombre(s) = ' + this.state.names + \"\\n\"+\n 'Apellido paterno = ' + this.state.first_surname + \"\\n\"+\n 'Apellido materno = ' + this.state.second_surname + \"\\n\"+\n 'Dirección = ' + this.state.direction + \"\\n\"+\n 'Email = ' + this.state.email + \"\\n\"+\n 'Celular = ' + this.state.phone + \"\\n\"+\n 'Ci = ' + this.state.ci + \"\\n\"+\n 'Codigo sis = ' + this.state.sis_code + \"\\n\"+\n 'Convocatoria = ' + this.state.selectedConvOption.label + \"\\n\"+\n 'Auxiliaturas = \\n' + auxiliaturas\n \n let lines = doc.setFont('Times', 'Roman')\n \t\t\t\t.setFontSize(size)\n \t\t\t\t.splitTextToSize(loremipsum, 178)\n doc.text(20, verticalOffset + size / 72, lines)\n verticalOffset += (lines.length + 0.5) * size / 72;\n //doc.line(15, 10, 200, 10) //horizontal top line\n /* if(this.state.selectedAuxOption.length === 1){\n doc.line(200, 10, 200, 115+(25*this.state.selectedAuxOption.length)) //vertical left line\n doc.line(15, 10, 15, 115+(15*this.state.selectedAuxOption.length)) //vertical rigth line\n doc.line(15, 115+(15*this.state.selectedAuxOption.length), 200, 115+(15*this.state.selectedAuxOption.length)) //horizontal button line \n }else{\n doc.line(200, 10, 200, 115+(10*this.state.selectedAuxOption.length)) //vertical left line\n doc.line(15, 10, 15, 115+(10*this.state.selectedAuxOption.length)) //vertical rigth line\n doc.line(15, 115+(10*this.state.selectedAuxOption.length), 200, 115+(10*this.state.selectedAuxOption.length)) //horizontal button line \n }*/\n doc.save('Mi_rotulado.pdf')\n }", "title": "" }, { "docid": "c6a844ff7296dc4d8413188498aaa2d5", "score": "0.5259284", "text": "function savePDF(myPreset , myPageRange) {\r\n //IF THE PAGE RANGE FIELD IS BLANK, SET THE PAGE RANGE TO ALL\r\n if (myPageRange == \"\") {\r\n myPageRange = PageRange.ALL_PAGES\r\n }\r\n //ELSE, SET THE PAGE RANGE AS THE ENTERED VALUE\r\n else {\r\n myPageRange = myPageRange;\r\n }\r\n //SET THE PAGERANGE\r\n app.pdfExportPreferences.pageRange = myPageRange;\r\n //SET THE NAME TO THE NEW PDF FILE\r\n name = myFolder+\"/\"+myFileName+\"_\"+myPreset.replace(/\\/|:/g,\"_\")+\".pdf\";\r\n //EXPORT THE CURRENT DOCUMENT TO PDF BASED ON SELECTED PRESETS\r\n app.activeDocument.exportFile(ExportFormat.PDF_TYPE, new File(name), false, myPreset);\r\n }", "title": "" }, { "docid": "39975c8fb36f793b5259a44f9ef5b64e", "score": "0.5257296", "text": "function gererarPDF(request, response) {\r\n\r\n var id = request.getParameter('poid');\r\n nlapiLogExecution('DEBUG', 'PDF Recetas: ', 'Value request id parameter: ' + id);\r\n try {\r\n var result = crearPDFCaso(id);\r\n if (result !== false && result !== null) {\r\n nlapiLogExecution('AUDIT', 'function crearPDFCaso(): ', 'Receta creada correctamente!! Case id record: ' + id);\r\n response.setContentType('PDF', 'preview.pdf', 'inline');\r\n response.write(result.getValue());\r\n } else {\r\n nlapiLogExecution('ERROR', ' function crearPDFCaso(): ', 'Receta no creada!! Case id record: ' + id);\r\n }\r\n }\r\n catch (err2) {\r\n var msgError = err2;\r\n nlapiLogExecution('ERROR', 'Error gererarPDF function', msgError);\r\n }\r\n}", "title": "" }, { "docid": "946ff75f5e45a968bcf2ce9ffc66a200", "score": "0.5256636", "text": "function foerderike_pdf(answers) {\n var text = combine_text(answers);\n var doc = new jsPDF({\n unit: \"in\",\n lineHeight: lineHeight,\n });\n doc.setProperties({ title: \"Förderike\"});\n //var img = doc.extractImageFromDataUrl(\"https://wir-bleiben-liqui.de/wp-content/uploads/2020/03/logo_header1-300x81.png\");\n doc.addImage(logo, \"PNG\", 5.7, 0.3, 2, 0.6);\n var textlines = doc.setFont(\"helvetica\", \"neue\")\n .setFontSize(12)\n .splitTextToSize(text, maxLineWidth);\n doc.text(textlines, margin, margin+oneLineHeight);\n doc.save(\"förderike.pdf\");\n}", "title": "" }, { "docid": "d9110f0da75432e18543856080b1db86", "score": "0.525135", "text": "function printPDF() {\n var pdf = new jsPDF();\n var data = $(\".diploma-container\")[0];\n var options = {format:\"PNG\", background:\"#ffffff\"};\n pdf.addHTML(data,0,0,options, function() {\n pdf.save('diploma.pdf');\n });\n\n}", "title": "" }, { "docid": "09d3fe713b4f3fa113b2187d96c8217e", "score": "0.52502227", "text": "async function createPdf(username) {\n \n console.log(\"true\");\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.emulateMedia('print');\n await page.goto(\"file://C:/Users/meysa/Desktop/testhomework/node/index.html\");\n\n //To generate a pdf name and format\n \n await page.pdf({ path:`GeneratePDF.pdf`,format: `A4` , printBackground: true});\n await browser.close();\n}", "title": "" }, { "docid": "b8fd51e6a739665c6e1330b96cd5cd6f", "score": "0.52501255", "text": "function generatePDF(formData, checklists) {\n let doc = new jsPDF();\n let title = formData.fullname + \"'s Emergency Checklist\";\n doc.setProperties({ title: title });\n\n let generalBody = checklists.general\n .map(x => [x.itemName, x.itemType, getQuantity(x.quantity, formData)]);\n let carBody = checklists.car\n .map(x => [x.itemName, x.itemType, getQuantity(x.quantity, formData)]);\n let petsBody = checklists.pets\n .map(x => [x.itemName, x.itemType, getQuantity(x.quantity, formData)]);\n\n let medicationBody = null;\n let medicationName = 'Medication - ' + formData.medication;\n switch (formData.medication) {\n case 'Asthma':\n medicationBody = checklists.medication.asthma;\n break;\n case 'Diabetes':\n medicationBody = checklists.medication.diabetes;\n break;\n case 'Risk of Cardiac Events':\n medicationBody = checklists.medication.heartAttack;\n break;\n }\n if (medicationBody != null ) {\n medicationBody = medicationBody.map(x => [x.guidelines]);\n }\n\n let finalY = 20;\n doc.setFontSize(20);\n doc.text(title, 55, finalY);\n\n finalY += 10;\n doc.setFontSize(16);\n doc.text('General Checklist', 16, finalY);\n\n finalY += 5;\n doc.autoTable({\n startY: finalY,\n head: [['Item Name', 'Item Type', 'Quantity']],\n body: generalBody,\n headStyles: { fontSize: 12 },\n bodyStyles: { fontSize: 11 }\n });\n\n if (medicationBody != null) {\n finalY = doc.previousAutoTable.finalY + 10;\n doc.text(medicationName, 16, finalY);\n\n finalY = doc.previousAutoTable.finalY + 15;\n doc.autoTable({\n startY: finalY,\n head: [['Guidelines']],\n body: medicationBody,\n headStyles: { fontSize: 12 },\n bodyStyles: { fontSize: 11 }\n });\n }\n\n if (formData.mobility == 'yes') {\n finalY = doc.previousAutoTable.finalY + 10;\n doc.text('Car Emergency Kit', 16, finalY);\n\n finalY = doc.previousAutoTable.finalY + 15;\n doc.autoTable({\n startY: finalY,\n head: [['Item Name', 'Item Type', 'Quantity']],\n body: carBody,\n headStyles: { fontSize: 12 },\n bodyStyles: { fontSize: 11 }\n });\n }\n\n if (formData.pet == 'yes') {\n finalY = doc.previousAutoTable.finalY + 10;\n doc.text('Pets', 16, finalY);\n\n finalY = doc.previousAutoTable.finalY + 15;\n doc.autoTable({\n startY: finalY,\n head: [['Item Name', 'Item Type', 'Quantity']],\n body: petsBody,\n headStyles: { fontSize: 12 },\n bodyStyles: { fontSize: 11 }\n });\n }\n\n var pdfData = doc.output('datauri');\n $('#tab-1').attr('src', pdfData);\n\n // Handle download button's click event\n $(\".download-button\").click(function (e) { \n e.preventDefault();\n doc.save(title + '.pdf');\n return false;\n });\n}", "title": "" }, { "docid": "562b4715ebc96973e564aec8dd3d5ea7", "score": "0.52480626", "text": "function generateQuotePDF(quote) {\n LogMessage(_moduleName_appPDFHelper + \": generateQuotePDF - start\");\n\n var pdfFilePath = _pdfFilePath(quote);\n var doc = _buildPDFDoc(quote);\n savePDFToDisk(doc, pdfFilePath);\n openPDFInViewer(quote);\n\n LogMessage(_moduleName_appPDFHelper + \": generateQuotePDF - complete. FileName: \" + pdfFilePath);\n}", "title": "" }, { "docid": "6a4838d8bf7521f43072eb5ba64ca232", "score": "0.5239773", "text": "function exportIndividualPages(pagesString) {\r pageNumbers = pagesString.split(\" \") // parse apart string received from panel\r for (var i = 0; i < pageNumbers.length; i++) {\r app.pdfExportPreferences.pageRange = pageNumbers[i].toString(); // select current page\r var myExportPreset = app.pdfExportPresets.item('Kodansha')\r if (app.activeDocument.documentPreferences.pageBinding == PageBindingOptions.leftToRight) { // If the book is bound left-to-right, it's also going to be lettered bottom-to-top, which means we can take the document page number to be the sequence number\r app.activeDocument.exportFile(ExportFormat.PDF_TYPE, File(app.activeDocument.filePath + '/' + app.activeDocument.filePath.displayName + \"_seq \" + pageNumbers[i].toString()), false, myExportPreset); // export current page with sequence number appended to filename\r }\r else { // if the book is bound right-to-left, it's lettered top-to-bottom, which means we need to derive the sequence number for file naming\r var sequenceNumber = (app.activeDocument.pages.length + 1) - parseInt(pageNumbers[i]); // The last page in the document would be sequence 1\r app.activeDocument.exportFile(ExportFormat.PDF_TYPE, File(app.activeDocument.filePath + '/' + app.activeDocument.filePath.displayName + \"_seq \" + sequenceNumber.toString()), false, myExportPreset); // export current page with sequence number appended to filename\r } \r }\r}", "title": "" }, { "docid": "750f8460e320aa4e858f6c1aa2d29298", "score": "0.52198046", "text": "getPdf() {\n document.location = '/get/pdf/' + this.state.id;\n }", "title": "" }, { "docid": "4cb95a6b8def98a5554c9e95cd47a2c8", "score": "0.5206218", "text": "function viewInvoice() { \n var rIndex = ifgInvoice.rowIndex;\n var cols = ifgInvoice.Rows(rIndex).GetClientColumns();\n var srccols = ifgInvoice.Rows(rIndex).Columns();\n var filename = \"\";\n var InvcType = srccols[16];\n if (exportType == \"\") {\n exportType = \"pdf\";\n }\n if (InvcType == \"Draft\") {\n filename = srccols[4] + \"_Draft_\" + srccols[1] + \".\" + exportType;\n }\n else if (InvcType == \"Final\") {\n filename = srccols[4] + \"_\" + srccols[1] + \".\" + exportType;\n }\n el(\"hiddenLinkViewInvoice\").href = \"../download.ashx?FL_NM=\" + filename + \"&INVC_TYPE=\" + InvcType;\n el(\"hiddenLinkViewInvoice\").click();\n return false;\n}", "title": "" }, { "docid": "2c1477f6896ea5f75908a7db443bd142", "score": "0.5204947", "text": "function suitelet(request, response){\r\n\r\n\tif ( request.getMethod() == 'GET') {\r\n\t\t\r\n \t//Create form\r\n \tvar form = nlapiCreateForm('Create PDFs');\r\n \t\r\n\t\tvar js_from_date = form.addField('custpage_from_date', 'date', 'Date From', null, null);\r\n\t\tvar js_to_date = form.addField('custpage_to_date', 'date', 'Date To', null, null);\r\n\t\tvar js_order_type = form.addField('custpage_order_type', 'select', 'Order Type', 'customlistsales_order_type', null);\r\n\t\tvar js_so_number = form.addField('custpage_so_number', 'text', 'J6 SO number', null, null);\r\n\t\tvar js_country = form.addField('custpage_country', 'select', 'Country');\r\n\t\tvar js_value = form.addField('custpage_so_value', 'select', 'Order Value');\r\n\t\tjs_country.addSelectOption('AU', 'Australia');\r\n\t\tjs_country.addSelectOption('NZ', 'New Zealand');\r\n\t\tjs_value.addSelectOption('less300', '<300$');\r\n\t\tjs_value.addSelectOption('more300', '>=300$');\r\n\t\r\n\t\tvar js_label_message = form.addField('custpage_label_message', 'select', 'Bag Label Message', 'customlist_bag_label_message', null);\r\n\t\tjs_label_message.setDefaultValue('1');\r\n\t\t\r\n\t\tvar js_email = form.addField('custpage_email', 'email', 'Email To:', null, null);\r\n\t\tvar js_backorders = form.addField('custpage_backorders', 'checkbox', 'Backorders Only', null, null);\r\n\t\tvar js_user_email = nlapiGetContext().getEmail();\r\n\t\t\r\n\t\tjs_email.setDefaultValue(js_user_email);\r\n\r\n form.addSubmitButton('Print Orders');\r\n response.writePage(form);\r\n }\r\n else {\r\n \t\r\n\t\tvar params = request.getAllParameters();\r\n var js_from_date = params['custpage_from_date'];\r\n\t\tvar js_to_date = params['custpage_to_date'];\r\n\t\tvar js_order_type = params['custpage_order_type'];\r\n\t\tvar js_email = params['custpage_email'];\r\n\t\tvar js_message = params['custpage_label_message'];\r\n\t\tvar js_so_number = params['custpage_so_number'];\r\n\t\tvar js_include_backorders = params['custpage_backorders'];\r\n\t\tvar js_country = params['custpage_country'];\r\n\t\tvar js_value = params['custpage_so_value'];\r\n\t\t\r\n\t\tvar ssparams = new Array();\r\n\t\tssparams['custscript_from_date1'] = js_from_date;\r\n\t\tssparams['custscript_to_date1'] = js_to_date;\r\n\t\tssparams['custscript_order_type1'] = js_order_type;\r\n\t\tssparams['custscript_email1'] = js_email;\r\n\t\tssparams['custscript_message1'] = js_message;\r\n\t\tssparams['custscript_so_id1'] = js_so_number;\r\n\t\tssparams['custscript_include_backorders1'] = js_include_backorders;\r\n\t\tssparams['custscript_country1'] = js_country;\r\n\t\tssparams['custscript_js_value1'] = js_value;\r\n\t\t\r\n//\t\tresponse.write(js_from_date + ',' + js_to_date+ ',' + js_order_type\r\n//\t\t\t\t+ ',' + js_email\r\n//\t\t\t\t+ ',' + js_message\r\n//\t\t\t\t+ ',' + js_so_number\r\n//\t\t\t\t+ ',' + js_include_backorders\r\n//\t\t\t\t+ ',' + js_country\r\n//\t\t\t\t+ ',' + js_value);\r\n\t\t\r\n\t\tvar status = nlapiScheduleScript('customscript_create_pdf_ss_new', null, ssparams);\r\n\t\tresponse.sendRedirect('TASKLINK', 'LIST_TRAN_SALESORD');\r\n\t}\t\r\n}", "title": "" }, { "docid": "2ce861b3b23597c55c5abcf1d43e41c5", "score": "0.52005166", "text": "exportToPDFDashboard() {\n html2pdf(this.$refs.document, {\n /* margin: 1,\n filename: 'document.pdf',\n image: {type: 'jpeg', quality: 0.98},\n html2canvas: {dpi: 192, letterRendering: true},\n jsPDF: {unit: 'in', format: 'letter', orientation: 'landscape'}*/\n margin: 0,\n\n filename: `hehehe.pdf`,\n\n image: {\n type: 'jpeg',\n quality: 0.98\n },\n\n enableLinks: false,\n\n html2canvas: {\n scale: 1,\n useCORS: true\n },\n\n jsPDF: {\n unit: 'in',\n format: 'a4',\n orientation: 'landscape'\n }\n })\n }", "title": "" }, { "docid": "b99b018cf84e944395f02b1ef956d38b", "score": "0.51910555", "text": "function aggiungiReport(invoiceNumber, reportName) {\n \n //Set params (normally are taken from settings)\n var param = {};\n param.print_header = true;\n param.print_isr = true;\n param.isr_bank_name = 'Aaa';\n param.isr_bank_address = 'Bbb, 6900 Lugano';\n param.isr_account = '01-103055-5';\n param.isr_id = '12345678';\n param.isr_position_scaleX = '1.0';\n param.isr_position_scaleY = '1.0';\n param.isr_position_dX = '0';\n param.isr_position_dY = '0';\n param.isr_on_new_page = false;\n param.font_family = '';\n param.color_1 = '';\n param.color_2 = '';\n param.color_3 = '';\n\n var jsonInvoice = getJsonInvoice(invoiceNumber);\n var invoiceReport = printInvoice(jsonInvoice, invoiceReport, param);\n\n Test.logger.addReport(reportName, invoiceReport);\n}", "title": "" }, { "docid": "6d6139756a8aa67632572bd5ff357f90", "score": "0.5184735", "text": "function fnBodyPrint(){\n\n\tvar BodyObjStr=document.all(\"BodyObjIDs\").value \n\tvar BodyObjTypeStr=document.all(\"BodyObjTypes\").value \n\tvar BodyObjTabHeadRowsStr=document.all(\"BodyObjTabHeadRows\").value \n\t\n\t\n\tvar BodyObjAry = new Array();\n\tvar BodyObjTypeAry = new Array();\n\tvar BodyObjTabHeadRowsAry=new Array();\n\t\n\t\n\tif(BodyObjStr!=''){//if-1\n\t BodyObjAry=BodyObjStr.split(\",\")\n\t BodyObjTypeAry=BodyObjTypeStr.split(\",\")\n\t BodyObjTabHeadRowsAry=BodyObjTabHeadRowsStr.split(\",\")\n\t for(i=0;i<BodyObjAry.length;i++)//for-1\n\t\t { \n\t\t\t\t// if paragraph Type\n\t\t\t\t// call print paragraph function with Span Id as argument\n\t\t\t\t//end if paragraph Type\n\t\t\t\tif(BodyObjTypeAry[i]=='P')\n\t\t\t\t fnPrintParagraph(BodyObjAry[i]);\n\t\t\t\n\t\t\t\t//TH=Table has Header ;TN= Table \t\t\t\thasn't header // if Table Type //call Print table function with TableId and\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif((BodyObjTypeAry[i]=='TH')||(BodyObjTypeAry[i]=='TN')||(BodyObjTypeAry[i]=='TG'))\n\t\t\t\t {\n\t\t\t\t if(PrinterObj.MaxPosibleLines()<5)\n\t\t\t\t {PrinterObj.MoveToNextPage();}\n\t\t\t\t fnPrintTable(BodyObjAry[i],BodyObjTypeAry[i],BodyObjTabHeadRowsAry[i]); \n\t\t\t }\n\t\t\t // Move to next page\n\t\t if(BodyObjTypeAry[i]=='MP')\n\t\t\t PrinterObj.MoveToNextPage();\n // move to Next line\n if(BodyObjTypeAry[i]=='ML')\n\t\t\t PrinterObj.MoveToNextLine();\n\t\t\t // Draw line\n\t\t\t if(BodyObjTypeAry[i]=='DL')\n\t\t\t PrinterObj.DrawLine(PrinterObj.BodyLeftTopX, PrinterObj.BodyRightBottomX)\n // Check Minimum gap\n if(BodyObjTypeAry[i]=='CM')\n\t\t\t { if(PrinterObj.MaxPosibleLines()<5)\n\t\t\t\t {PrinterObj.MoveToNextPage(); }\n\t\t\t\t}\n \n\t\t\t \n\n\t\t \n\t\t }//for-1\n\t }//if-1\n\t \n\n}", "title": "" }, { "docid": "7bfa37b29cbb286499154b86ebcfe0b2", "score": "0.5184607", "text": "function ListCreatedPDF() {\n\t\tthis.pdfTable \t\t= $('#createdPDFTable tbody');\n\t\tthis.pdfDeleteBtn \t\t= $('#deletepdf');\n\t\tthis.openDeletePopup\t= $('.pdfDelete');\n\t\tthis.extendDetailsBtn \t= $('.extendDetails');\n\t\tthis.editForm\t\t\t= $('form[name=\"pdfEditForm\"]');\n\t\tthis.editCSS \t\t\t= $('textarea[name=\"listEditCss\"]');\n\t\tthis.editHTML \t\t\t= $('textarea[name=\"listEditHtml\"]');\n\t\tthis.openPdfSendPopup\t= $('.pdfSend');\n\t\tthis.sendPdfForm\t\t= $('form[name=\"sendPdfToEmail\"]');\n\t\tthis.emailRecepient\t\t= this.sendPdfForm.find('input[type=\"email\"]');\n\n\t\tthis.init();\n\t\tthis.deletepdf();\n\t\tthis.events();\n\t}", "title": "" }, { "docid": "4f3d693a09b24dad9bd59e1b12d55594", "score": "0.5158139", "text": "function printDoc()\r\n{\r\n window.print();\r\n}", "title": "" }, { "docid": "35630f012738beec46c468741fd1dd28", "score": "0.51524293", "text": "function writeToFile(fileName, data) {\n var conversion = convertFactory({\n converterPath: convertFactory.converters.PDF\n });\n \n conversion({ html: `${data}` }, function(err, result) {\n if (err) {\n return console.error(err);\n }\n \n console.log(`Developer Profile has been generated: ${fileName}.pdf \\n Number of Pages: `+ result.numberOfPages);\n result.stream.pipe(fs.createWriteStream(`${fileName}.pdf`));\n conversion.kill(); // necessary if you use the electron-server strategy, see bellow for details\n });\n}", "title": "" }, { "docid": "5dd9e8702417f1a28546c31e675b5b1a", "score": "0.5146059", "text": "function writePDF(out, form) {\n const doc = new PDFDocument({\n size: \"A4\",\n margins: {\n top: 72,\n left: 72,\n bottom: 72,\n right: 72,\n }\n });\n doc.pipe(out);\n try {\n doc\n .font(\"Helvetica-Bold\", 18)\n .text(`Call-Bewerbung\\n${escapeValue(form.fields.name?.value || \"\")}`, {align: 'center'})\n .moveDown();\n\n // Inline-like fields.\n [\n { label: \"Name\", value: form.fields.name?.value },\n { label: \"E-Mail\", value: form.fields.email?.value },\n { label: \"Webseite\", value: form.fields.webseite?.value },\n { label: \"Telefon\", value: form.fields.telefon?.value },\n { label: \"Paket\", value: form.fields.paket?.value },\n { label: \"Schon Interessent*in\", value: form.fields.interessentin?.value },\n ].forEach(line => {\n doc\n .font(\"Helvetica-Bold\", TEXT_FONT_SIZE)\n .text(`${line.label}: `, { continued: true })\n .font(\"Helvetica\", TEXT_FONT_SIZE)\n .text(escapeValue(line?.value || \"-\"));\n });\n doc.moveDown();\n\n // Block-like fields.\n [\n { label: \"Wie möchtest Du die Gewerbefläche nutzen?\", value: form.fields.gewerbe_nutzung?.value },\n { label: \"Was gefällt Dir an dem Gedanken, Teil der Genossenschaft die HausWirtschaft zu werden?\", value: form.fields.gedanken_community?.value },\n { label: \"Wie möchtest Du dich in die Gemeinschaft einbringen?\", value: form.fields.einbringen?.value },\n { label: \"Sonstige Fragen und Infos?\", value: form.fields.sonstiges?.value },\n ].forEach(line => {\n doc\n .font(\"Helvetica-Bold\", TEXT_FONT_SIZE)\n .text(line.label)\n .font(\"Helvetica\", TEXT_FONT_SIZE)\n .text(escapeValue(line?.value || \"-\"))\n .moveDown();\n });\n\n doc\n .moveDown()\n .font(\"Helvetica\", 8)\n .text(\"Generiert um \" + new Date().toLocaleString(\"de-AT\", { timeZone: \"Europe/Vienna\" }));\n } catch (e) {\n console.error(e);\n } finally {\n doc.end();\n }\n}", "title": "" }, { "docid": "08fde921f213b8dea6bf23557a2753bf", "score": "0.51435846", "text": "function EfwServerPdf() {\n}", "title": "" }, { "docid": "182bb59fa0fadaeb3fe86e92c9bb31cf", "score": "0.51385313", "text": "function setupPDF() {\n\n\t\tvar slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );\n\n\t\t// Dimensions of the PDF pages\n\t\tvar pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ),\n\t\t\tpageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) );\n\n\t\t// Dimensions of slides within the pages\n\t\tvar slideWidth = slideSize.width,\n\t\t\tslideHeight = slideSize.height;\n\n\t\t// Let the browser know what page size we want to print\n\t\tinjectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0;}' );\n\n\t\t// Limit the size of certain elements to the dimensions of the slide\n\t\tinjectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );\n\n\t\tdocument.body.classList.add( 'print-pdf' );\n\t\tdocument.body.style.width = pageWidth + 'px';\n\t\tdocument.body.style.height = pageHeight + 'px';\n\n\t\t// Slide and slide background layout\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {\n\n\t\t\t// Vertical stacks are not centred since their section\n\t\t\t// children will be\n\t\t\tif( slide.classList.contains( 'stack' ) === false ) {\n\t\t\t\t// Center the slide inside of the page, giving the slide some margin\n\t\t\t\tvar left = ( pageWidth - slideWidth ) / 2,\n\t\t\t\t\ttop = ( pageHeight - slideHeight ) / 2;\n\n\t\t\t\tvar contentHeight = getAbsoluteHeight( slide );\n\t\t\t\tvar numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );\n\n\t\t\t\t// Center slides vertically\n\t\t\t\tif( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {\n\t\t\t\t\ttop = Math.max( ( pageHeight - contentHeight ) / 2, 0 );\n\t\t\t\t}\n\n\t\t\t\t// Position the slide inside of the page\n\t\t\t\tslide.style.left = left + 'px';\n\t\t\t\tslide.style.top = top + 'px';\n\t\t\t\tslide.style.width = slideWidth + 'px';\n\n\t\t\t\t// TODO Backgrounds need to be multiplied when the slide\n\t\t\t\t// stretches over multiple pages\n\t\t\t\tvar background = slide.querySelector( '.slide-background' );\n\t\t\t\tif( background ) {\n\t\t\t\t\tbackground.style.width = pageWidth + 'px';\n\t\t\t\t\tbackground.style.height = ( pageHeight * numberOfPages ) + 'px';\n\t\t\t\t\tbackground.style.top = -top + 'px';\n\t\t\t\t\tbackground.style.left = -left + 'px';\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\t\t// Show all fragments\n\t\ttoArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) {\n\t\t\tfragment.classList.add( 'visible' );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "2f484579755ae0a56f2193efc97917b6", "score": "0.51354563", "text": "function generatePDFMain() {\n\n getCurrentPlan()\n .then(plan => fetchTileDataFromPlan(plan)\n .then(tileResponse => getAnnotationsFromPlan(plan)\n .then(annotations => sendDataToServer(plan.geometry, tileResponse, annotations)\n .then(response => getResponseBlob(response)\n .then(responseBlob => readBlob(responseBlob)\n .then(fileReader => generatePDFOfMap(plan, fileReader)\n ))))))\n\n}", "title": "" }, { "docid": "2873dbf7d8f826d0ed61a0cf044ee5be", "score": "0.5111299", "text": "function ExportPrintReadyPDF(doc) {\n\n\tvar toPDF = new File(Folder.desktop + \"/\" + doc.fullName.name.replace(\".indd\", \"_drukklaar.pdf\"));\n\n\tSetBleed(doc);\n\tExportPDFWithPreset(doc, toPDF, \"Jono Drukklare PDF\");\n\n}", "title": "" }, { "docid": "962081d0bfc525b2ef6fb1b48d58c7ef", "score": "0.50950295", "text": "function createVoucherReport(journal, report, docNumber, rowsToProcess, userParam) {\n\n //Each voucher on a new page\n report.addPageBreak();\n\n //Define some variables\n var date = \"\";\n var doc = \"\"; \n var desc = \"\";\n var totDebit = \"\";\n var totCredit = \"\";\n var line = 0;\n\n //Define table info: name and columns\n var tableInfo = report.addTable(\"table_info\");\n var col1 = tableInfo.addColumn(\"col1\");\n var col2 = tableInfo.addColumn(\"col2\");\n var col3 = tableInfo.addColumn(\"col3\");\n var col4 = tableInfo.addColumn(\"col4\");\n var col5 = tableInfo.addColumn(\"col5\");\n var col6 = tableInfo.addColumn(\"col6\");\n var col7 = tableInfo.addColumn(\"col7\");\n var col8 = tableInfo.addColumn(\"col8\");\n var col9 = tableInfo.addColumn(\"col9\");\n var col10 = tableInfo.addColumn(\"col10\");\n var col11 = tableInfo.addColumn(\"col11\");\n\n\n //Define table transactions: name and columns\n var table = report.addTable(\"table\");\n var c1 = table.addColumn(\"c1\");\n var c2 = table.addColumn(\"c2\");\n var c3 = table.addColumn(\"c3\");\n var c4 = table.addColumn(\"c4\");\n\n //Define table signatures: name and columns\n var tableSignatures = report.addTable(\"table_signatures\");\n var colSig1 = tableSignatures.addColumn(\"colSig1\");\n var colSig2 = tableSignatures.addColumn(\"colSig2\");\n var colSig3 = tableSignatures.addColumn(\"colSig3\");\n var colSig4 = tableSignatures.addColumn(\"colSig4\");\n var colSig5 = tableSignatures.addColumn(\"colSig5\");\n var colSig6 = tableSignatures.addColumn(\"colSig6\");\n\n //Select from the journal all the given rows, take all the needed data, calculate totals and create the vouchers print\n for (j = 0; j < rowsToProcess.length; j++) \n {\n for (i = 0; i < journal.rowCount; i++)\n {\n if (i == rowsToProcess[j])\n {\n var tRow = journal.row(i);\n date = tRow.value(\"Date\");\n doc = tRow.value(\"Doc\");\n desc = tRow.value(\"Description\");\n var amount = Banana.SDecimal.abs(tRow.value('JAmount'));\n \n // Debit\n if (Banana.SDecimal.sign(tRow.value('JAmount')) > 0 )\n {\n totDebit = Banana.SDecimal.add(totDebit, amount, {'decimals':2});\n }\n \n // Credit\n else {\n totCredit = Banana.SDecimal.add(totCredit, amount, {'decimals':2});\n }\n //report.addParagraph(\"Array: \" + rowsToProcess[j] + \", Journal: \" + i + \", \" + date + \", \" + desc + \", \" + amount + \", \" + totDebit + \", \" + totCredit);\n }\n }\n }\n\n /* 1. Print the date and the voucher number */\n printInfoVoucher(tableInfo, report, docNumber, date, userParam);\n\n /* 2. Print the all the transactions data */\n printTransactions(table, journal, line, rowsToProcess, userParam);\n\n /* 3. Print the total line */\n printTotal(table, totDebit, totCredit, report, userParam);\n\n /* 4. Print the signatures line */\n printSignatures(tableSignatures, report, userParam);\n}", "title": "" }, { "docid": "1019916a246232455ba41abea4dff410", "score": "0.5085161", "text": "function PDFDicer(options) {\n\tvar dicer = this;\n\n\tdicer.settings = _.defaults(options, {\n\t\tprofile: 'quagga', // Default profile to use\n\t\tareas: [\n\t\t\t{ top: \"0%\", right: \"0%\", left: \"0%\", bottom: \"0%\" }\n\t\t],\n\t\timageFormat: 'png',\n\t\tmagickOptions: { // Options passed to ImageMagick when converting pdf -> page output format\n\t\t\t'-quality': 100,\n\t\t\t'-density': 150,\n\t\t\t'-background': 'white',\n\t\t\t'-alpha': 'remove',\n\t\t\t'-gaussian-blur': '0x1',\n\t\t},\n\t\tbardecode: {\n\t\t\tbin: '/opt/bardecoder/bin/bardecode',\n\t\t\tcheckEvaluation: true,\n\t\t\tserial: '',\n\t\t},\n\t\tquagga: { // Options passed to Quagga\n\t\t\tdebug: false,\n\t\t\tnumOfWorkers: 0, // Always 0 in Node backend\n\t\t\tlocate: false, // We have to indicate the location of the barcode\n\t\t\tinputStream: {\n\t\t\t\tsize: false, // Force full image resolution\n\t\t\t},\n\t\t\tdecoder: {\n\t\t\t\treaders: ['code_128_reader'],\n\t\t\t\tmultiple: false,\n\t\t\t\tdebug: {\n\t\t\t\t\tdrawBoundingBox: false,\n\t\t\t\t\tshowFrequency: false,\n\t\t\t\t\tdrawScanline: false,\n\t\t\t\t\tshowPattern: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tlocator: {\n\t\t\t\tdebug: {\n\t\t\t\t\tshowCanvas: false,\n\t\t\t\t\tshowPatches: false,\n\t\t\t\t\tshowFoundPatches: false,\n\t\t\t\t\tshowSkeleton: false,\n\t\t\t\t\tshowLabels: false,\n\t\t\t\t\tshowPatchLabels: false,\n\t\t\t\t\tshowRemainingPatchLabels: false,\n\t\t\t\t\tboxFromPatches: {\n\t\t\t\t\t\tshowTransformed: false,\n\t\t\t\t\t\tshowTransformedBox: false,\n\t\t\t\t\t\tshowBB: false\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\thalfSample: true,\n\t\t\t\tpatchSize: \"medium\" // x-small, small, medium, large, x-large\n\t\t\t}\n\t\t},\n\t\tfilter: page => true,\n\t\ttemp: {\n\t\t\tprefix: 'pdfdicer-',\n\t\t},\n\t\ttempClean: true,\n\t\tthreads: {\n\t\t\tpages: 1,\n\t\t\tareas: 1,\n\t\t},\n\t});\n\n\tdicer.profile = name => {\n\t\tswitch (name) {\n\t\t\tcase 'quagga':\n\t\t\t\t_.merge(dicer.settings, {\n\t\t\t\t\tprofile: 'quagga',\n\t\t\t\t\tdriver: 'quagga',\n\t\t\t\t\timageFormat: 'png',\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'bardecode':\n\t\t\t\t_.merge(dicer.settings, {\n\t\t\t\t\tprofile: 'bardecode',\n\t\t\t\t\tdriver: 'bardecode',\n\t\t\t\t\timageFormat: 'tif',\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown profile: ${name}`);\n\t\t}\n\n\t\treturn this;\n\t};\n\n\n\t/**\n\t* Convenience function to quickly set a setting\n\t* @param {string} key The key of the setting to set, dotted notation is supported\n\t* @param {*} value The value to set to\n\t* @return {Object} This chainable object\n\t*/\n\tdicer.set = (key, value) => {\n\t\t_.set(dicer.settings, key, value);\n\t\treturn dicer;\n\t};\n\n\n\t/**\n\t* Shortcut function to set the areas used by the split function\n\t* @param {array} areas The areas array to set. Each option should have `top`, `right`, `left`, `bottom` which are either percentages or absolute values\n\t* @return {Object} This chainable object\n\t*/\n\tdicer.areas = areas => {\n\t\t_.merge(this.settings.areas, areas);\n\t\treturn this;\n\t};\n\n\t/**\n\t * Take an input file and split it into many PDF files based on configured options\n\t * @param {string} input The input path to process (ends in .pdf usually)\n\t * @param {Object} [options] Optional options which override the defaults\n\t * @param {function} callback Callback function to fire on completion or error\n\t * @return {PDFDicer} This chainable object\n\t *\n\t * @emits stage Fired at each stage of the process. ENUM: 'init', 'readPDF', 'readPages', 'extracted', 'filtering', 'loadRange', 'preSplit'\n\t * @emits tempDir The temp dir used for storage\n\t * @emits pageConverted Fired with each page and pageOffset extracted as they are extracted\n\t * @emits pagesConverted Fired with an array of all extracted page collection\n\t * @emits pageAnalyze Fired before each page gets analyzed with the page object\n\t * @emits pageAnalyzed Fired after each page has been analyzed with the page object\n\t * @emits barcodeFiltered Fired when a specific barcode is filtered out of the input. Emitted as (page)\n\t * @emits barcodePassed Fired when a barcode passes a filter test. Emitted as (page)\n\t * @emits pagesAnalyzed Fired after all pages have been analyzed with the page collection\n\t * @emits rangeExtracted Fired after the splitted range has been calculated from the original input pdf\n\t * @emits split Fired after each pdf has been separated in the range and it gives you the pdf resultant\n\t * @emits splitted Fired after pdf have been separated in the range\n\t */\n\tdicer.split = function(input, options, callback) {\n\t\t// Argument mangling {{{\n\t\tif (_.isFunction(options)) { // Called as: input, callback\n\t\t\tcallback = options;\n\t\t\toptions = {};\n\t\t} else if (!_.isFunction(callback)) {\n\t\t\tthrow new Error('Callback required as the final parameter of pdfDicer.convert()');\n\t\t}\n\t\t// }}}\n\n\t\tvar settings = _.defaults({}, options, this.settings);\n\n\t\tasync()\n\t\t\t// Sanity checks {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('stage', 'init');\n\t\t\t\tif (!_.isString(input)) return next('Unknown input type');\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Check file exists {{{\n\t\t\t.then(function(next) {\n\t\t\t\tfs.access(input, err => next(err ? 'File not found' : null));\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Prepare (temp directory) {{{\n\t\t\t.then('tempDir', function(next) {\n\t\t\t\ttemp.mkdir(settings.temp, next);\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Build the PDF processing instance {{{\n\t\t\t// More information about image processing on https://www.imagemagick.org/script/command-line-options.php\n\t\t\t.then('pdf', function(next) {\n\t\t\t\tdicer.emit('tempDir', this.tempDir);\n\t\t\t\tnext(null, new pdfImage(input, {\n\t\t\t\t\toutputDirectory: this.tempDir,\n\t\t\t\t\tconvertOptions: settings.magickOptions,\n\t\t\t\t}));\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Set output image format {{{\n\t\t\t.then(function(next) {\n\t\t\t\tthis.pdf.setConvertExtension(settings.imageFormat);\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Extract info about the input file {{{\n\t\t\t.then('info', function(next) {\n\t\t\t\tdicer.emit('stage', 'readPDF');\n\t\t\t\tthis.pdf.getInfo()\n\t\t\t\t\t.catch(e => next(e))\n\t\t\t\t\t.then(data => next(null, data), next)\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Convert the file into images {{{\n\t\t\t.set('pages', {})\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('stage', 'readPages');\n\t\t\t\tasync()\n\t\t\t\t\t.set('pdf', this.pdf)\n\t\t\t\t\t.set('pages', this.pages)\n\t\t\t\t\t.forEach(0, parseInt(this.info.Pages) - 1, function(next, pageNumber) {\n\t\t\t\t\t\tthis.pdf.convertPage(pageNumber)\n\t\t\t\t\t\t\t.then(path => {\n\t\t\t\t\t\t\t\tthis.pages[pageNumber] = {\n\t\t\t\t\t\t\t\t\tpath: path,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdicer.emit('pageConverted', this.pages[pageNumber], pageNumber);\n\t\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(next)\n\t\t\t\t\t})\n\t\t\t\t\t.end(next);\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Post conversion emitters {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('pagesConverted', this.pages);\n\t\t\t\tdicer.emit('stage', 'extracted');\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Read each page and extract a barcode if there is one {{{\n\t\t\t.limit(settings.threads.pages)\n\t\t\t.forEach('pages', function(nextPage, page, pageOffset) {\n\t\t\t\tpage.number = parseInt(pageOffset) + 1;\n\t\t\t\tpage.barcode = false;\n\t\t\t\tdicer.emit('pageAnalyze', page);\n\t\t\t\tif (settings.driver == 'quagga') {\n\t\t\t\t\tasync()\n\t\t\t\t\t\t.limit(settings.threads.areas)\n\t\t\t\t\t\t.forEach(settings.areas, function(nextArea, area) {\n\t\t\t\t\t\t\tvar hasAreas = Object.values(area).filter(a => a === '0%').length !== 4;\n\t\t\t\t\t\t\tvar options = {\n\t\t\t\t\t\t\t\tsrc: page.path\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toptions.locate = hasAreas;\n\t\t\t\t\t\t\tif (hasAreas) {\n\t\t\t\t\t\t\t\toptions.inputStream = {\n\t\t\t\t\t\t\t\t\tarea: area,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbarcodeReader.decodeSingle(Object.assign({}, settings.quagga, options), function(res) {\n\t\t\t\t\t\t\t\tif (!page.barcode && res && res.codeResult) page.barcode = res.codeResult.code;\n\t\t\t\t\t\t\t\tnextArea();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(function(next) {\n\t\t\t\t\t\t\tdicer.emit('pageAnalyzed', page);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.end(nextPage);\n\t\t\t\t} else if (settings.driver == 'bardecode') {\n\t\t\t\t\tvar runCommand = [\n\t\t\t\t\t\tsettings.bardecode.bin,\n\t\t\t\t\t\tpage.path,\n\t\t\t\t\t];\n\t\t\t\t\tif (settings.bardecode.serial) runCommand.push('-K', settings.bardecode.serial); // Append serial number if we have one\n\n\t\t\t\t\tasync()\n\t\t\t\t\t\t.use(asyncExec)\n\t\t\t\t\t\t.exec('response', runCommand)\n\t\t\t\t\t\t.then('response', function(next) {\n\t\t\t\t\t\t\tvar firstExtracted = _(this.response)\n\t\t\t\t\t\t\t\t.filter(i => ! /^EVALUATION MODE/.test(i))\n\t\t\t\t\t\t\t\t.first();\n\n\t\t\t\t\t\t\tif (firstExtracted) page.barcode = firstExtracted;\n\n\t\t\t\t\t\t\tif (settings.bardecode.checkEvaluation && /\\?\\?\\?$/.test(page.barcode)) console.warn('You are using an evaluation version of Bardecode - the last three digits of the barcode are obscured!');\n\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(function(next) {\n\t\t\t\t\t\t\tdicer.emit('pageAnalyzed', page);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.end(nextPage);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`Unknown page decoder: ${settings.driver}`);\n\t\t\t\t}\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Filter page barcodes {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('stage', 'filtering');\n\t\t\t\tif (!_.isFunction(settings.filter)) return next();\n\n\t\t\t\t_.forEach(this.pages, page => {\n\t\t\t\t\tvar res = settings.filter(page);\n\t\t\t\t\tif (!res) {\n\t\t\t\t\t\tdicer.emit('barcodeFiltered', page);\n\t\t\t\t\t\tpage.barcode = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdicer.emit('barcodePassed', page);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Post pages analyzed emitters {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('pagesAnalyzed', this.pages);\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Build range to split the pdf {{{\n\t\t\t.set('range', new Object())\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('stage', 'loadRange');\n\t\t\t\tvar memBarcodeID = '';\n\t\t\t\tvar rangeCount = 1;\n\t\t\t\tvar index = 0;\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (var key in this.pages) {\n\t\t\t\t\t\tif (this.pages.hasOwnProperty(key)) {\n\t\t\t\t\t\t\tvar page = this.pages[key];\n\t\t\t\t\t\t\tmemBarcodeID = (page.barcode === false) ? memBarcodeID : page.barcode.split('-')[0];\n\n\t\t\t\t\t\t\tif (this.range[memBarcodeID] == null) {\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID] = new Object();\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID].barcode = new Object();\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tthis.range[memBarcodeID].barcode.id = page.barcode.substring(page.barcode.lastIndexOf(\"/\") + 1, page.barcode.length);\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\t// The barcode scanner is not able to find the barcode information.\n\t\t\t\t\t\t\t\t\tthis.range[memBarcodeID].barcode.id = page.barcode;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID].barcode.start = page.barcode;\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID].pages = 1;\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID].from = index + 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.range[memBarcodeID].pages++;\n\t\t\t\t\t\t\t\tif (page.barcode !== false)\n\t\t\t\t\t\t\t\t\tthis.range[memBarcodeID].barcode.end = page.barcode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error('[PDF-DICER] Error', error);\n\t\t\t\t\treturn next(error);\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Emits the data with the range to split the pdf {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('rangeExtracted', this.range);\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Update stage {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('stage', 'preSplit');\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Gives the resultant split pdfs {{{\n\t\t\t.forEach('range', function(nextRange, range, rangeIndex) {\n\t\t\t\trange.to = range.from + range.pages - 1;\n\n\t\t\t\tpdftk\n\t\t\t\t\t.input(input)\n\t\t\t\t\t.cat(`${range.from}-${range.to}`)\n\t\t\t\t\t.output()\n\t\t\t\t\t.then(buffer => {\n\t\t\t\t\t\tdicer.emit('split', range, buffer);\n\t\t\t\t\t\tnextRange();\n\t\t\t\t\t})\n\t\t\t\t\t.catch(nextRange);\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Emits the end signal for the functionality {{{\n\t\t\t.then(function(next) {\n\t\t\t\tdicer.emit('splitted');\n\t\t\t\tnext();\n\t\t\t})\n\t\t\t// }}}\n\t\t\t// Clean up the temp directory {{{\n\t\t\t.then(function(next) {\n\t\t\t\tif (!settings.tempClean) return next();\n\t\t\t\trimraf(this.tempDir, next);\n\t\t\t})\n\t\t\t// }}}\n\t\t\t.end(callback);\n\n\t\treturn this;\n\t};\n\n\tdicer.profile(dicer.settings.profile); // Load default profile\n}", "title": "" }, { "docid": "811509e2c63279ad990ab7b8ae1ed175", "score": "0.50765043", "text": "function printMe(element) {\n var doc = new jsPDF();\n var elementHandler = {\n \"#ignorePDF\": function(element, renderer) {\n return true;\n }\n };\n var source = window.document.getElementById(element);\n doc.fromHTML(source, 15, 15, {\n width: 180,\n elementHandlers: elementHandler\n });\n\n var string = doc.output(\"datauristring\");\n var iframe =\n \"<iframe width='100%' height='100%' src='\" + string + \"'></iframe>\";\n var newWindow = window.open();\n newWindow.document.open();\n newWindow.document.write(iframe);\n newWindow.document.close();\n\n doc.save(jq(\"input[name='familyName']\").val() + \".consent.pdf\");\n}", "title": "" }, { "docid": "d04d2f6708f51822f26b19be471b00ea", "score": "0.5074802", "text": "function prepare_for_print(show_pdf)\n {\n if (validate_form())\n {\n // Switch the selected canvas to a bigger off-screen canvas\n // The layers are to be drawn blown up on this canvas\n canvas = document.getElementById('print_canvas');\n context = canvas.getContext('2d');\n\n var start = new Date().getTime();\n\n // keep record of the layers and canvas original (screen) sizes\n var original_layers = [];\n for (var i = 0; i < layers.length; i++) {\n original_layers.push(jQuery.extend({}, layers[i]));\n original_layers[i].text_styles = jQuery.extend({}, layers[i].text_styles);\n }\n canvas.width = document.getElementById('builder_canvas').width;\n canvas.height = document.getElementById('builder_canvas').height;\n\n // Convert the dimensions to inches and multiply by 300 to get a 300dpi canvas\n var to_mm_coeff = $('#builder_units').find(':selected').data('coeff');\n var page_width = document.getElementById('builder_width' ).value * to_mm_coeff / 25.4 * 300;\n var page_height = document.getElementById('builder_height').value * to_mm_coeff / 25.4 * 300;\n\n var ratio = page_width / canvas.width;\n var font_size;\n var size = layers.length;\n for (i = 0; i < size; i++)\n {\n layers[i].set_width(layers[i].width * ratio);\n layers[i].set_height(layers[i].height * ratio);\n layers[i].set_x(layers[i].x * ratio);\n layers[i].set_y(layers[i].y * ratio);\n layers[i].set_border_width(layers[i].border_width * ratio);\n if (layers[i].type == 'text')\n {\n font_size = Number(layers[i].text_styles['font-size'].replace('pt', ''));\n layers[i].set_text_style('font-size', font_size * ratio + 'pt');\n layers[i].set_text_dimensions();\n }\n }\n\n // Draw the resized layers on the resized canvas and get the data URL of the image\n /*\n canvas.width = page_width;\n canvas.height = page_height;\n var show_delete_icons = document.getElementById('show_delete_icons').checked;\n document.getElementById('show_delete_icons').checked = false;\n draw_layers();\n\n\n // Draw border, with corner crosshairs 5 mm from the edges\n var bleedline_margin = document.getElementById('sign_builder_bleedline_margin').value;\n if (bleedline_margin > 0) {\n var gap = bleedline_margin * canvas.width / $('#builder_width').val() * to_mm_coeff;\n\n // top\n context.moveTo(gap / 2, gap - 1);\n context.lineTo(canvas.width - gap / 2, gap - 1);\n // right\n context.moveTo(canvas.width - gap + 1, gap / 2);\n context.lineTo(canvas.width - gap + 1, canvas.height - gap / 2);\n // bottom\n context.moveTo(gap / 2, canvas.height - gap + 1);\n context.lineTo(canvas.width - gap / 2, canvas.height - gap + 1);\n // left\n context.moveTo(gap - 1, gap / 2);\n context.lineTo(gap - 1, canvas.height - gap / 2);\n context.stroke();\n }\n\n // If there is a transparent background, change it to white for printing\n var background_color_input = document.getElementById('builder_background_color');\n if (background_color_input.value == 'transparent' || background_color_input.value == '') {\n context.globalCompositeOperation = \"destination-over\"; // set to draw behind current content\n context.fillStyle = '#ffffff';\n context.fillRect(0, 0, canvas.width, canvas.height); // draw white rectangle\n }\n\n var src = canvas.toDataURL('image/jpeg');\n */\n var src = document.getElementById('builder_canvas').toDataURL('image/png');\n\n var pdf_size = $(\"#builder_size\").find(\":selected\");\n var size_name = pdf_size.text().split(' (')[0];\n var pdf_width = pdf_size.data('width');\n var pdf_height = pdf_size.data('height');\n var width = document.getElementById('builder_width').value;\n var height = document.getElementById('builder_height').value;\n var orientation = document.getElementById('builder_orientation').querySelector(':checked').value;\n\n if (pdf_width == 0)\n {\n var coeff = $('#builder_units').find(':selected').attr('data-coeff');\n pdf_width = ((height > width) ? width : height) * coeff;\n pdf_height = ((height > width) ? height : width ) * coeff;\n }\n\n $.post('/frontend/products/add_canvas', {\n id: $(\"#id\").val(),\n canvas_size: size_name,\n width: pdf_width,\n height: pdf_height,\n layers: src,\n layers_obj: JSON.stringify(layers),\n background_color: document.getElementById('builder_background_color').value,\n orientation: orientation\n },function (data)\n {\n data = $.parseJSON(data);\n if (data.error)\n {\n $('#checkout_preview_modal').hide_modal();\n display_error(data.error);\n document.getElementById('modal').style.display = 'none';\n }\n else\n {\n custom_timestamp = data.timestamp;\n layers = original_layers;\n // document.getElementById('show_delete_icons').checked = show_delete_icons;\n // Revert to using the main canvas\n canvas = document.getElementById('builder_canvas');\n context = canvas.getContext('2d');\n draw_layers();\n var end = new Date().getTime();\n var time = end - start;\n console.log('Execution time: ' + time);\n document.getElementById('modal').style.display = 'none';\n if (show_pdf)\n {\n window.location.href = document.getElementById('get_pdf').getAttribute('href');\n document.getElementById('modal').style.display = 'none';\n }\n if (document.activeElement.getAttribute('id') == \"add_to_cart_button\")\n {\n var delete_icons_box = document.getElementById('show_delete_icons');\n var show_delete_value = delete_icons_box.checked;\n delete_icons_box.checked = false;\n $(delete_icons_box).trigger('change');\n document.getElementById('checkout_complete_sign_preview_image').src = document.getElementById('builder_canvas').toDataURL('image/png');\n delete_icons_box.checked = show_delete_value;\n $('#checkout_preview_modal').show_modal();\n $(\"#purchase_complete_dialog\").show();\n $(\"#preview_sign_dialog\").hide();\n }\n\n if ($(button).attr('id') == 'purchase_button')\n {\n validateQty_and_checkout(document.getElementById('id').value, $('#builder_quantity').val(), getOptions());\n }\n else\n {\n validateQty(document.getElementById('id').value, $('#builder_quantity').val(), getOptions());\n }\n }\n }).fail(function ()\n {\n display_error('<p>Failed to generate PDF.</p>');\n document.getElementById('modal').style.display = 'none';\n });\n }\n else\n {\n document.getElementById('modal').style.display = 'none';\n }\n }", "title": "" }, { "docid": "e7e013cf7aeee2e94a75b77350c32289", "score": "0.50739175", "text": "function apelOpenPdf(e, classe) {\n var file = [\n 'images/pass.pdf',\n 'images/ps.pdf',\n 'images/ms.pdf',\n 'images/gs.pdf',\n 'images/cp.pdf',\n 'images/ce1.pdf',\n 'images/ce2.pdf',\n 'images/cm1.pdf',\n 'images/cm2.pdf',\n 'images/clis.pdf',\n 'images/6e.pdf',\n 'images/6e-segpa.pdf',\n 'images/6e-hr.pdf',\n 'images/5e.pdf',\n 'images/5e-segpa.pdf',\n 'images/4e.pdf',\n 'images/4e-segpa.pdf',\n 'images/3e.pdf',\n 'images/3e-segpa.pdf'\n ],\n //redirect = 'newPage.html';\n name = 'APEL STPAUL Liste Fournitures',\n pdfWind;\n // stop the browser from going to the href\n e = e || window.event; // for IE\n e.preventDefault(); \n switch (classe) {\n case 'pass':\n // launch a new window with your PDF\n pdfWind = window.open(file[0],name);\n break;\n case 'ps':\n // launch a new window with your PDF\n pdfWind = window.open(file[1],name);\n break;\n case 'ms':\n // launch a new window with your PDF\n pdfWind = window.open(file[2],name);\n break;\n case 'gs':\n // launch a new window with your PDF\n pdfWind = window.open(file[3],name);\n break;\n case 'cp':\n // launch a new window with your PDF\n pdfWind = window.open(file[4],name);\n break;\n case 'ce1':\n // launch a new window with your PDF\n pdfWind = window.open(file[5],name);\n break;\n case 'ce2':\n // launch a new window with your PDF\n pdfWind = window.open(file[6],name);\n break;\n case 'cm1':\n // launch a new window with your PDF\n pdfWind = window.open(file[7],name);\n break;\n case 'cm2':\n // launch a new window with your PDF\n pdfWind = window.open(file[8],name);\n break;\n case 'clis':\n // launch a new window with your PDF\n pdfWind = window.open(file[9],name);\n break;\n case '6e':\n // launch a new window with your PDF\n pdfWind = window.open(file[10],name);\n break;\n case '6e-segpa':\n // launch a new window with your PDF\n pdfWind = window.open(file[11],name);\n break;\n case '6e-hr':\n // launch a new window with your PDF\n pdfWind = window.open(file[12],name);\n break; \n case '5e':\n // launch a new window with your PDF\n pdfWind = window.open(file[13],name);\n break;\n case '5e-segpa':\n // launch a new window with your PDF\n pdfWind = window.open(file[14],name);\n break;\n case '4e':\n // launch a new window with your PDF\n pdfWind = window.open(file[15],name);\n break;\n case '4e-segpa':\n // launch a new window with your PDF\n pdfWind = window.open(file[16],name);\n break;\n case '3e':\n // launch a new window with your PDF\n pdfWind = window.open(file[17],name);\n break;\n case '3e-segpa':\n // launch a new window with your PDF\n pdfWind = window.open(file[18],name);\n break; \n }\n}", "title": "" }, { "docid": "5b399113f3bb7e9e10b1f29f91eab05f", "score": "0.507314", "text": "function buildPdf(pdfMsgObj, pdfColors) {\n \n // Create a document\n let doc = new PDFDocument;\n doc.pipe(pdfMsgObj.stream);\n \n // Draw a rectangle for the header \n doc.save()\n .moveTo(25, 30)\n .lineTo(588, 30)\n .lineTo(588, 90)\n .lineTo(25, 90)\n .fill(pdfColors[2]);\n \n // start writing text\n\n // header text\n doc.font('Helvetica-Bold');\n doc.fontSize(22);\n doc.fillColor('white');\n let widthBizName = doc.widthOfString(pdfMsgObj.custBizName);\n let startBizName = 245 - (widthBizName/2);\n doc.text(pdfMsgObj.custBizName, startBizName, 50);\n doc.image(\"./smlogo.png\", 425, doc.y - 32, { width: 120 } );\n \n doc.fontSize(15);\n doc.moveDown(2);\n doc.fillColor(pdfColors[4])\n doc.text(\"Best places to advertise in the \", 25, doc.y, { continued: true } )\n .fillColor(pdfColors[3])\n .text(pdfMsgObj.displayIndustry, { continued: true } )\n .fillColor(pdfColors[4])\n .text(\" industry near \", { continued: true } )\n .fillColor(pdfColors[3]) \n .text(pdfMsgObj.displayLocation, { continued: true } )\n .fillColor(pdfColors[4])\n .text(\" based on \", { continued: true } )\n .fillColor(pdfColors[3])\n .text(pdfMsgObj.displayAttribute);\n \n doc.fontSize(10); \n doc.fillColor(pdfColors[4]);\n doc.text(\" Filtered for Zip Codes at most \", { continued: true } )\n .fillColor('black')\n .text(pdfMsgObj.distance, { continued: true } )\n .fillColor(pdfColors[4])\n .text(\" miles from the current city\");\n doc.moveDown();\n doc.image(pdfMsgObj.mapImgFile, 25, doc.y, { width: 562 } );\n // delete the image file\n fs.unlink(pdfMsgObj.mapImgFile, (err) => {\n if (err) {\n console.log(\"error deleting \", pdfMsgObj.mapImgFile, \" :\", err);\n }\n });\n \n // the bands \n doc.fontSize(8);\n doc.fillColor(pdfColors[4]);\n doc.moveDown(0.5);\n\n doc.rect( 25, 446, 561, 22 );\n doc.fillAndStroke('#f3f3f3');\n \n // construct an array of x,y starting points for the bands\n let j = 0, n = 0; m = 0;\n let bandMinText, widthMinText, widthDash;\n let startArr = [];\n for (let k=0; k<pdfMsgObj.bands; k++) {\n n = k % 3; // n (remainder of k/3) is the column in the display of bands\n m = Math.floor(k/3); // each row will have 3 bands listed\n startArr.push([40 + n*180, 450 + m*10]);\n }\n\n // then render the bands\n doc.fillColor(pdfColors[4]);\n pdfMsgObj.bandArr.forEach(function(element) {\n bandMinText = Intl.NumberFormat('en-US', { \n style: 'currency',\n currency: 'USD',\n maximumFractionDigits: 0,\n minimumFractionDigits: 0 \n }).format(element.Min);\n doc.text(bandMinText, startArr[j][0], startArr[j][1]);\n widthMinText = doc.widthOfString(bandMinText);\n doc.text(' - ', startArr[j][0] + widthMinText, startArr[j][1]);\n widthDash = doc.widthOfString(' - ');\n doc.text(Intl.NumberFormat('en-US', { \n style: 'currency', \n currency: 'USD', \n maximumFractionDigits: 0, \n minimumFractionDigits: 0 \n }).format(element.Max), startArr[j][0] + widthMinText + widthDash, startArr[j][1]);\n j++;\n });\n \n doc.fillColor(pdfColors[5]);\n doc.fontSize(10);\n doc.text(\"This is a list of Zip Codes with the highest combined business revenue in the \", 75, doc.y + 10, { continued: true } )\n .text(pdfMsgObj.displayIndustry)\n .text(\"industry. You should consider using this list if you are selling to businesses or consumers and want to\")\n .text(\"know where the most money is being made in your industry.\")\n .moveDown(2);\n let xpos = 250;\n const listHeight = 200; // pixels given to the bottom section\n doc.y = 720 - listHeight;\n let secondMargin = 300;\n let skipX = 0;\n\n /**\n * note: Dynamic font sizing is a possibility if more flexibility in\n * what content gets displayed on one page is needed. It makes\n * precise layout more difficult though. eg:\n *\n * numFields = pdfMsgObj.zip.length;\n * fieldHeight = listHeight/numFields;\n * fieldFontHeight = Math.round(fieldHeight/6); \n * subFieldFontHeight = Math.round(fieldFontHeight/2);\n */\n \n let thisSortAttributeMinArr = [];\n let thisSortAttributeMaxArr = [];\n let sortText;\n if (pdfMsgObj.sortAttribute === 'underservedMarkets') {\n thisSortAttributeMinArr = pdfMsgObj.revenuePerCapitaMin;\n thisSortAttributeMaxArr = pdfMsgObj.revenuePerCapitaMax;\n sortText = \"Revenue Per Capita\";\n } else {\n thisSortAttributeMinArr = pdfMsgObj[pdfMsgObj.sortAttribute + 'Min'];\n thisSortAttributeMaxArr = pdfMsgObj[pdfMsgObj.sortAttribute + 'Max'];\n sortText = formatCamelToDisplay(pdfMsgObj.sortAttribute);\n }\n doc.fillColor(pdfColors[3]);\n doc.fontSize(6);\n doc.text(sortText, 515 - doc.widthOfString(sortText), doc.y);\n // tiny asc or desc triangle\n if (pdfMsgObj.sort === 'desc') {\n doc.polygon( [519, doc.y - 2], [523, doc.y - 2], [521, doc.y - 6]);\n } else {\n doc.polygon( [519, doc.y - 6], [523, doc.y - 6], [521, doc.y - 2]);\n }\n doc.fillAndStroke(pdfColors[3]) \n for (let i=0; i<pdfMsgObj.zip.length; i++) {\n pdfMsgObj.filterDisplay.toggle = 1; // this controls the margins of the fields\n // if it's not reset to 1 between areas\n // shown, the margins don't work right\n // see showFilter function\n doc.fillColor(pdfColors[i])\n .moveDown(1)\n .fontSize(10)\n .circle(75, doc.y + 5, 7);\n doc.fill()\n .fillColor('#ffffff')\n .text(i + 1, 72, doc.y + 1, { continued: true } )\n .fillColor(pdfColors[i])\n .fontSize(15)\n .text(\" \", { continued: true } )\n .text(pdfMsgObj.zip[i], { continued: true })\n .fillColor('black')\n .fontSize(13);\n xpos = 400 - (doc.widthOfString(thisSortAttributeMinArr[i].toString()) + doc.widthOfString(\" - \") + doc.widthOfString(thisSortAttributeMaxArr[i].toString()));\n doc.text(thisSortAttributeMinArr[i], xpos, doc.y, { continued: true } )\n .text(\" - \", { continued: true } )\n .text(thisSortAttributeMaxArr[i])\n .fillColor(pdfColors[5])\n .fontSize(8) \n showFilter(pdfMsgObj, \"Total Population: \", 'population', pdfMsgObj.population[i].toLocaleString('en'), null, doc);\n showFilter(pdfMsgObj, \"Average Annual Revenue: \", 'averageRevenue', pdfMsgObj.averageRevenueMin[i], pdfMsgObj.averageRevenueMax[i], doc);\n showFilter(pdfMsgObj, \"Total Employees: \", 'totalEmployees', pdfMsgObj.totalEmployeesMin[i], pdfMsgObj.totalEmployeesMax[i], doc);\n showFilter(pdfMsgObj, \"Revenue Per Capita: \", 'revenuePerCapita', pdfMsgObj.revenuePerCapitaMin[i], pdfMsgObj.revenuePerCapitaMax[i], doc);\n showFilter(pdfMsgObj, \"Household Income: \", 'householdIncome', pdfMsgObj.householdIncome[i], null, doc);\n showFilter(pdfMsgObj, \"Household Expenditures: \", 'householdExpenditures', pdfMsgObj.householdExpenditures[i], null, doc);\n showFilter(pdfMsgObj, \"Median Age: \", 'medianAge', pdfMsgObj.medianAge[i], null, doc);\n showFilter(pdfMsgObj, \"Bachelors Degree or Higher: \", 'bachelorsDegreeOrHigher', pdfMsgObj.bachelorsDegreeOrHigher[i], null, doc, '%');\n showFilter(pdfMsgObj, \"High School Degree or Higher: \", 'highSchoolOrHigher', pdfMsgObj.highSchoolOrHigher[i], null, doc, '%');\n showFilter(pdfMsgObj, \"White Collar Workers: \", 'whiteCollarWorkers', pdfMsgObj.whiteCollarWorkers[i], null, doc, '%');\n }\n\n // footer text\n doc.font('Helvetica-Bold');\n doc.fontSize(15);\n widthBizName = doc.widthOfString(pdfMsgObj.custBizName);\n doc.fillColor(pdfColors[2])\n startBizName = 306 - (widthBizName/2);\n doc.text(pdfMsgObj.custBizName, startBizName, 673);\n doc.fontSize(12);\n doc.fillColor('black');\n let addressString = pdfMsgObj.custAddress + ' ' + pdfMsgObj.custCity + ' ' + pdfMsgObj.custZip;\n let widthAddress = doc.widthOfString(addressString);\n let startAddress = 306 - widthAddress/2;\n doc.text(addressString, startAddress, doc.y);\n let widthEmail = doc.widthOfString(pdfMsgObj.custEmail);\n let startEmail = 306 - widthEmail/2;\n doc.text(pdfMsgObj.custEmail, startEmail, doc.y);\n// console.log(\"pdfmsgob = \", pdfMsgObj);\n\n // Finalize the pdf file\n doc.end();\n// return pdfMsgObj.stream;\n console.log(\"PDF output.pdf created\");\n}", "title": "" }, { "docid": "4daf8cf3758fc95d275bdb3c60ca08ff", "score": "0.5072081", "text": "function forprint(){\nif (!window.print){\n return\n }\n window.print()\n}", "title": "" }, { "docid": "b4ceea063289fd6aacd3553c6861d836", "score": "0.5071481", "text": "printPagesRoot() {\n fs.existsSync(this.root) || fs.mkdirSync(this.root);\n const allPages = Object.values(this.pageLines).reduce( (p, c) => {return p.concat(c)})\n fs.writeFileSync (this.root + '/' + this.indexPage, allPages.join('\\n'));\n }", "title": "" }, { "docid": "324d3876dbd308b5a8319d52e942fe68", "score": "0.50526696", "text": "function PDFServiceHandler($http, CONSTANT, $q, __ENV) {\n\n // Get All Users\n this.downloadPDFDoc = function (objToPrint) {\n console.log(objToPrint);\n var pdfData = [];\n var tHeader = [{ text: 'First Name', style: 'tableHeader' },\n { text: 'Last Name', style: 'tableHeader' },\n { text: 'Email Id', style: 'tableHeader' },\n { text: 'Admin', style: 'tableHeader' },\n { text: 'Active', style: 'tableHeader' },\n { text: 'Is New', style: 'tableHeader' }]\n pdfData.push(tHeader);\n objToPrint.forEach(function (ele, index) {\n pdfData.push([\n ele.first_name, ele.last_name, ele.email_id, ele.isadmin, ele.isactive, ele.isnew\n ]);\n });\n console.log(pdfData);\n var docDefinition = {\n content: [\n { text: 'User List', margin: [0, 20, 0, 8], style: 'header' },\n {\n style: 'stressTable',\n table: {\n widths: ['auto', 'auto', '*', 'auto', 'auto', 'auto'],\n body: pdfData\n },\n layout: {\n fillColor: function (i, node) { return (i === 0) ? '#CCCCCC' : null; },\n hLineWidth: function (i, node) {\n return 1;\n },\n vLineWidth: function (i, node) {\n return 1;\n },\n hLineColor: function (i, node) {\n return 'gray';\n },\n vLineColor: function (i, node) {\n return 'gray';\n }\n }\n }],\n styles: {\n header: {\n fontSize: 18,\n bold: true,\n margin: [0, 0, 0, 10]\n },\n stressTable: {\n margin: [0, 5, 0, 15]\n },\n tableHeader: {\n bold: true,\n fontSize: 12,\n }\n }\n };\n pdfMake.createPdf(docDefinition).download();\n };\n\n\n }", "title": "" }, { "docid": "fefa54a6e188297561d3e30e751c208a", "score": "0.5048174", "text": "function createPDF() {\n var doc = new jsPDF()\n var specialElementHandlers = {\n '#editor': function(element, renderer) {\n return true;\n }\n };\n var content = \"\";\n patientList.on('value', function(snap) {\n doc.text(snap.val().FirstName + \" \" + snap.val().LastName, 10, 15);\n doc.text(\"Exercises:\", 10, 25);\n var height = 35;\n firebase.database()\n .ref(\"Patients/\" + patientid + \"/MedicalInfo/Exercises/\")\n .once('value', function(snap) {\n exercises = snap.val();\n snap.forEach(function(e) {\n doc.text(\" - \" + e.val().exercise, 10, height);\n height = height + 10;\n });\n });\n });\n doc.save('exercises.pdf')\n}", "title": "" }, { "docid": "f4c22000903c2c906085c787c54c99ea", "score": "0.50470054", "text": "function printPresets(carimbo,myDocument,intervaloPDF){\r\n\t\r\n\t\t//Adding our preset to the application\r\n\t\tvar scriptsFile = new File($.fileName);\r\n\t\tvar printPreset = new File(scriptsFile.path+\"/Links/ScriptPrintPresetsHumanasv2.prst\");\r\n\t\tapp.importFile(1918071916, printPreset);\r\n\r\n\t\tnomePdfPreset = printPreset.name.split(\".\")[0];\r\n\t\t//alert(nomePdfPreset);\r\n\t\tmyprintPreset = app.printerPresets.item(nomePdfPreset);\r\n\r\n\t\t//Intervalo das páginas \r\n\t\tsetIntervaloImpressao(myDocument,intervaloPDF);\r\n\t\t\r\n\t\t//Ajusta as preferencias da impressao atual\r\n\t\twith(myDocument.printPreferences){\r\n\t\t\t//flip = Flip.none;\r\n\t\t\t//flip = Flip.horizontal;\r\n\t\t\tpageRange = intervaloPDF;\r\n\t\t\t}\r\n\r\n\t\t//myPreset = app.printerPresets.item(\"ps\");\r\n\t\tmyDocument.print(true, myprintPreset); \r\n\r\n\t\t//Remove o PrinterPresets\r\n\t\tapp.printerPresets.item(nomePdfPreset).remove();\r\n\t\r\n\t}", "title": "" }, { "docid": "ec69908811cecc2ed04e61d5bf2c5ddf", "score": "0.5046049", "text": "async function generateProjectPdf(showGraphs){\n if(currentProjectInfo!=null){\n\n var projName=currentProjectInfo.project.som_projects_name.replace(' ', '_');\n var country=currentProjectInfo.project.som_projects_country;\n \n var doc = new jsPDF();\n \n var finalY= 0;\n \n //1) Set Header\n doc.setFontSize(30);\n doc.setFontStyle(\"bolditalic\");\n doc.setTextColor(\"#1a2732\");\n doc.text(\"aena\", 14, finalY + 15);\n doc.setFontStyle(\"normal\");\n doc.setTextColor(\"#96ce00\");\n doc.text(\"gpi\", 42, finalY + 15);\n doc.setTextColor(\"#1a2732\");\n doc.setFontStyle(\"bold\");\n finalY= finalY + 15;\n \n doc.setFontSize(16);\n\n //2) Set Project Info\n doc.text(\"Project Info\", 14, finalY + 15);\n \n var col = [\"Field\", \"Value\"];\n var rows = [];\n \n var excludedColumns=[\"som_projects_id\",\n \"users\",\n \"financial_summary\",\n \"phases\",\n \"som_projects_img_url\",\n \"som_status_hex_color\",\n \"airport\",\n \"country\",\n \"multi_airport\",\n \"som_status_is_behaviour_completed\",\n \"som_status_is_behaviour_ongoing\",\n \"project_due_date\",\n \"project_start_date\",\n \"partners\",\n \"advisors\"]\n \n for(var key in currentProjectInfo.project){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace(/_/g,' ');\n var temp = [code, currentProjectInfo.project[key]];\n rows.push(temp);\n //console.log(temp);\n }\n var first = true;\n for(var key in currentProjectInfo.project['partners']){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace(/_/g,' ');\n var temp = [first?'partners':'', currentProjectInfo.project.partners[key].name];\n first = false;\n rows.push(temp);\n //console.log(temp);\n }\n if (first){\n rows.push(['partners','-']);\n }\n first = true;\n for(var key in currentProjectInfo.project['advisors']){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace(/_/g,' ');\n var temp = [first?'advisors':'', currentProjectInfo.project.advisors[key].name];\n first = false;\n rows.push(temp);\n //console.log(temp);\n }\n if (first){\n rows.push(['advisors','-']);\n } \n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY + 20,\n columnStyles: {\n 0: {cellWidth: 40},\n 1: {cellWidth: 60},\n }\n });\n \n \n //3) Set Project Users\n finalY = doc.previousAutoTable.finalY;\n doc.text(\"Project Users\", 14, finalY + 15);\n \n var col = [\"Name\", \"Email\", \"Job Profile\"];\n var rows = [];\n \n for(var key in currentProjectInfo.project.users){\n //var code=key.replace('cms_users_','').replace('_',' ');\n var temp = [currentProjectInfo.project.users[key].cms_users_name, currentProjectInfo.project.users[key].cms_users_email, currentProjectInfo.project.users[key].cms_users_job_title];\n rows.push(temp);\n //console.log(temp);\n }\n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY + 20,\n columnStyles: {\n 0: {cellWidth: 33},\n 1: {cellWidth: 33},\n 2: {cellWidth: 33}\n }\n });\n\n //4) Set Project Phahses\n finalY = doc.previousAutoTable.finalY;\n doc.text(\"Project Phases\", 14, finalY + 15);\n \n var col = [\"Name\", \"Status\", \"Nº Forms\", \"Completed Forms\", \"On going Forms\" ];\n var rows = [];\n \n for(var key in currentProjectInfo.project.phases){\n //var code=key.replace('cms_users_','').replace('_',' ');\n var temp = [currentProjectInfo.project.phases[key].som_phases_name, \n currentProjectInfo.project.phases[key].som_status_name, \n currentProjectInfo.project.phases[key].formscount,\n currentProjectInfo.project.phases[key].formscompletedcount,\n currentProjectInfo.project.phases[key].formsongoingcount];\n rows.push(temp);\n //console.log(temp);\n }\n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY + 20\n });\n\n \n\n //5) Set Country Info\n //finalY = doc.previousAutoTable.finalY;\n doc.addPage();\n finalY=0;\n doc.text(\"Country Info\", 14, finalY + 15);\n \n var col = [\"Field\", \"Value\"];\n var rows = [];\n \n var excludedColumns=[\"additional_info\"]\n \n for(var key in currentProjectInfo.project.country){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace('_',' ');\n var temp = [code, currentProjectInfo.project.country[key]];\n rows.push(temp);\n //console.log(temp);\n }\n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY + 20,\n columnStyles: {\n 0: {cellWidth: 40},\n 1: {cellWidth: 60},\n }\n }); \n\n\n if(showGraphs == true){\n doc.setFontSize(13);\n doc.setTextColor(\"#96ce00\");\n \n doc.addPage();\n finalY=0;\n \n const chartInflation = document.getElementById('country-inflation-evolution-export');\n await html2canvas(chartInflation, { scale: 1 }).then(function (canvas) { \n doc.text(\"INFLATION EVOLUTION\", 14, finalY + 15 );\n doc.addImage(canvas.toDataURL('image/jpeg'), 'JPEG', 14, finalY + 20, 290/4, 150/4); \n });\n \n \n const chartPopulation = document.getElementById('country-population-evolution-export');\n await html2canvas(chartPopulation, { scale: 1 }).then(function (canvas) { \n doc.text(\"POPULATION\", 120, finalY + 15 );\n doc.addImage(canvas.toDataURL('image/jpeg'), 'JPEG', 120, finalY + 20, 290/4, 150/4); \n });\n \n finalY=60;\n \n const chartEvolution = document.getElementById('country-evolution-evolution-export');\n await html2canvas(chartEvolution, { scale: 1 }).then(function (canvas) { \n doc.text(\"GDP EVOLUTION AND FORECAST (€ MN)\", 14, finalY + 15 );\n doc.addImage(canvas.toDataURL('image/jpeg'), 'JPEG', 14, finalY + 20, 290/4, 150/4); \n }); \n \n }\n //---------\n\n // if(doc.previousAutoTable.finalY>230)\n // {\n // doc.addPage();\n // finalY=0;\n\n // }\n // else\n // {\n // finalY = doc.previousAutoTable.finalY;\n // } \n \n //6) Set Airport Info\n //As image doens´t move to new page if doesn´t fit, we control it\n doc.addPage();\n finalY=0;\n // if(doc.previousAutoTable.finalY>230)\n // {\n // doc.addPage();\n // finalY=0;\n\n // }\n // else\n // {\n // finalY = doc.previousAutoTable.finalY;\n // } \n doc.setTextColor(\"#1a2732\");\n doc.setFontSize(16);\n doc.text(\"Airport Info\", 14, finalY + 15);\n //console.log(\"Airport starts in: \" + (finalY+15))\n var airportHasImage = false;\n var img = new Image();\n if (currentProjectInfo.project.airport.som_projects_airport_img_url!=null){\n img.src = currentProjectInfo.project.airport.som_projects_airport_img_url;\n console.log('img',img)\n doc.addImage(img, 'JPEG', 14, finalY + 20, 100, 50);\n airportHasImage = true;\n }\n \n var col = [\"Field\", \"Value\"];\n var rows = [];\n \n var excludedColumns=[\"som_projects_id\", \"som_projects_airport_img_url\", \"city\"]\n \n for(var key in currentProjectInfo.project.airport){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace('_',' ');\n var temp = [code, currentProjectInfo.project.airport[key]];\n rows.push(temp);\n //console.log(temp);\n }\n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY +airportHasImage?85:20,\n columnStyles: {\n 0: {cellWidth: 40},\n 1: {cellWidth: 60},\n }\n });\n\n if (currentProjectInfo.project.multi_airport.length>1){\n\n doc.setTextColor(\"#1a2732\");\n doc.setFontSize(16);\n \n \n var multiairports = currentProjectInfo.project.multi_airport.splice(1);\n firstMultiAirport = true;\n\n var numAirport=1;\n multiairports.forEach(airport => {\n doc.addPage();\n finalY=0;\n /*\n if (firstMultiAirport){\n doc.text(\"Additional Airports Info\", 14, finalY + 15);\n firstMultiAirport=false;\n }\n */\n\n doc.text(\"Additional Airports Info (\"+numAirport+\")\", 14, finalY + 15);\n numAirport++;\n\n //console.log(\"Airport starts in: \" + (finalY+15))\n var img = new Image();\n console.log(airport.som_projects_airport_img_url);\n var hasImage = false;\n if (airport.som_projects_airport_img_url!=null){\n img.src = airport.som_projects_airport_img_url;\n doc.addImage(img, 'JPEG', 14, finalY + 20, 100, 50);\n hasImage = true;\n }\n \n var col = [\"Field\", \"Value\"];\n var rows = [];\n \n var excludedColumns=[\"som_projects_id\", \"som_projects_airport_img_url\", \"city\"]\n \n for(var key in airport){\n if(excludedColumns.includes(key)){\n continue;\n }\n var code=key.replace('som_projects_','').replace('_',' ');\n var temp = [code, airport[key]];\n rows.push(temp);\n //console.log(temp);\n }\n \n doc.autoTable(col, rows, {\n headStyles: {fillColor: [26, 39, 50], textColor: [150,206,0], fontStyle: 'bold'},\n startY: finalY + hasImage?85:20,\n columnStyles: {\n 0: {cellWidth: 40},\n 1: {cellWidth: 60},\n }\n });\n \n });\n\n }\n\n //---------\n doc.save(country+'_'+projName+'.pdf');\n $(\"body\").css(\"cursor\", \"default\");\n \n if(showGraphs){\n //Disable blur and show time\n loadingHide(false);\n }else{\n loadingHide(true);\n }\n \n \n }\n\n\n\n}", "title": "" }, { "docid": "1c7419265d8ec089c1ca74ba781b767d", "score": "0.50459915", "text": "function generarPDF(cliente,factura)\n{\n // Son las dimensiones de la ventana donde se despliega el PDF.\n var ancho = 1000;\n var alto = 800;\n //Calcula posicion x,y para centrar la ventana\n var x = parseInt((window.screen.width/2) - (ancho / 2));\n var y = parseInt((window.screen.height/2) - (alto / 2));\n\n $url = 'factura/generaFactura.php?cl='+cliente+'&f='+factura;\n\n // Para mostrar la ventana.\n window.open($url,\"Factura\",\"left=\"+x+\",top=\"+y+\",height=\"+alto+\",width=\"+ancho+\",scrollbar=si,location=no,resizable=si,menubar=no\");\n}", "title": "" }, { "docid": "00d450159d0deb4bf268d410193fd410", "score": "0.5043965", "text": "function printCurrentPage (){\n // window.print();\n}", "title": "" }, { "docid": "086063861138a91e4dfa9249e696379c", "score": "0.5039241", "text": "function ventanaPDF (url){\n window.open(url, \"pdf\", \"width=auto, height=auto\")\n }", "title": "" }, { "docid": "b59d1fa08192626b4875d6b5663d9b7d", "score": "0.5038807", "text": "generatePdf() {\n let input = this.refs.statPage;\n\n html2canvas(input, { scale: 1 }).then(canvas => {\n const imgData = canvas.toDataURL('image/png');\n\n const pdf = new jsPDF(1, 'mm', 'a4');\n pdf.addImage(imgData, 'PNG', 1, 0);\n pdf.save('download.pdf');\n });\n }", "title": "" }, { "docid": "21ec6177692780a49bdd4bad3f56f0e7", "score": "0.5038415", "text": "function print_data(){\n $('#modal_print').modal('hide');\nwindow.open(\"export/pdf_nilai.php?kelas=\"+$('#kelas_print').val(), \"Cetak Nilai\", \"height=650, width=1024, left=150, scrollbars=yes\");\n return false;\n}", "title": "" }, { "docid": "49b39867daf1577cad82a60fe92478be", "score": "0.5020679", "text": "function printDoc(){\n var toPrint = docToPrint.splice(0,lim);\n mod = 130;\n if (toPrint.length > 0){\n $.ajax({\n url:'services/xPrint.php',\n data: {action:'print',params:toPrint,model:mod},\n dataType: 'json',\n success:showPrinted,\n error:serviceError,\n type:'POST'\n });\n }\n else{\n $('<div class=\"full-page\" style=\"text-align:center;\">Operazione Terminata</div>').dialog({'title':'Messaggio','modal':true,width:500});\n }\n}", "title": "" }, { "docid": "2c0a69f7cbd452e033818704c6a6f295", "score": "0.50182843", "text": "function suiteletFunction_PrintWarrantyPdf(request, response){\r\n\r\n\t/* Suitelet:\r\n\t - EXPLAIN THE PURPOSE OF THIS FUNCTION\r\n\t -\r\n\t FIELDS USED:\r\n\t --Field Name--\t\t\t\t--ID--\r\n\t */\r\n\t// LOCAL VARIABLES\r\n\t\r\n\t\r\n\t// SUITELET CODE BODY\r\n\t\r\n\tif (request.getMethod() == 'GET') {\r\n\t\r\n\t\tvar SORecID = request.getParameter('sorecid');\r\n\t\t//var SORecID = 17806006;\r\n\t\t\r\n\t\tvar o_recordObj = nlapiLoadRecord('salesorder', SORecID)\r\n\t\t\r\n\t\tvar Customer = o_recordObj.getFieldText('entity');\r\n\t\tCustomer = nlapiEscapeXML(Customer);\r\n\t\t\r\n\t\t\r\n\t\tvar OrderDate = o_recordObj.getFieldValue('trandate');\r\n\t\tvar TranID = o_recordObj.getFieldValue('tranid');\r\n\t\t\r\n\t\t\r\n\t\tvar strVar = \"\";\r\n\t\tstrVar += \"<html>\";\r\n\t\tstrVar += \"<head>\";\r\n\t\tstrVar += \"<style>\";\r\n\t\tstrVar += \"table {\";\r\n\t\tstrVar += \" font-family: arial, sans-serif;\";\r\n\t\tstrVar += \" border-collapse: collapse;\";\r\n\t\tstrVar += \" width: 100%;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"td, th {\";\r\n\t\t// strVar += \" border: 0.5px solid #dddddd;\";\r\n\t\tstrVar += \" text-align: left;\";\r\n\t\tstrVar += \" padding: 3px;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \".unjustify {\";\r\n\t\tstrVar += \" display: inline-block;\";\r\n\t\tstrVar += \" width: 3px;\";\r\n\t\tstrVar += \"}\";\r\n\t\tstrVar += \"\";\r\n\t\t\r\n\t\tstrVar += \"body, td {\"\r\n\t\tstrVar += \"font-family: Open Sans,Helvetica,sans-serif\"\r\n\t\tstrVar += \"}\"\r\n\t\t\r\n\t\tstrVar += \"<\\/style>\";\r\n\t\tstrVar += \"<\\/head>\";\r\n\t\tstrVar += \"<body footer=\\\"myfooter\\\" footer-height=\\\"1em\\\" size=\\\"A4\\\">\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"<table style=\\\"border: 1px solid #dddddd;margin-bottom:10px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td>\";\r\n\t\tstrVar += \"<table style=\\\"margin-bottom:10px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"text-align:center;font-size:14px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">\" + nlapiEscapeXML('Warranty Registration') + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\t\r\n\t\tstrVar += \"<table style=\\\"margin-bottom:20px;\\\" align = \\\"center\\\">\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Customer Name<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"8\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + Customer + \"<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Order Date<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"4\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + OrderDate + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" <tr>\";\r\n\t\tstrVar += \" <td colspan= \\\"2\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">Order ID<\\/td>\";\r\n\t\tstrVar += \" <td colspan= \\\"14\\\" align=\\\"left\\\" style=\\\"text-align:left;font-size: 12px;font-weight: bold;border: 0px;\\\" valign=\\\"top\\\">: \" + TranID + \"<\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \"\";\r\n\t\tstrVar += \"<table style=\\\"\\\">\";\r\n\t\tstrVar += \"<thead>\";\r\n\t\tstrVar += \" <tr style=\\\"background-color: black ;color:white;\\\">\";\r\n\t\tstrVar += \" <th style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size:12px;\\\"><b>Item Name</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Quantity</b><\\/th>\";\r\n\t\t//strVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Units</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px;text-align:center;font-size: 12px;\\\"><b>Exp Date</b><\\/th>\";\r\n\t\tstrVar += \" <th style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 1px;text-align:right;font-size: 12px;\\\"><b>Warranty Term</b><\\/th>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \"<\\/thead>\";\r\n\t\t\r\n\t\tvar i_linecount = o_recordObj.getLineItemCount('item')\r\n\t\tvar j = 1;\r\n\t\tfor (var k = 1; k <= i_linecount; k++) {\r\n\t\t\tvar Item = o_recordObj.getLineItemText('item', 'item', k);\r\n\t\t\tvar quantity = o_recordObj.getLineItemValue('item', 'quantity', k);\r\n\t\t\t//var units = o_recordObj.getLineItemText('item', 'units', k);\r\n\t\t\tvar expdate = o_recordObj.getLineItemValue('item', 'custcol_sw_expiration', k);\r\n\t\t\tvar terms = o_recordObj.getLineItemText('item', 'custcol_sw_warranty', k);\r\n\t\t\t\r\n\t\t\tif (terms != null && terms != '' && terms != undefined) {\r\n\t\t\t\tj++;\r\n\t\t\t\tif (j % 2 == 0) {\r\n\t\t\t\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;background-color: #efefef !important;\\\">\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;\\\">\"\r\n\t\t\t\t}\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:left\\\" >\" + nlapiEscapeXML(Item) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + quantity + \"<\\/td>\";\r\n\t\t\t\t//strVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(units) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(expdate) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 12px;text-align:center\\\">\" + nlapiEscapeXML(terms) + \"<\\/td>\";\r\n\t\t\t\tstrVar += \" <\\/tr>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tstrVar += \" <tr style=\\\"border-left:1px;border-right: 0px;border-top: 0px;border-bottom: 0px;\\\">\"\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:left\\\" ><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <td align=\\\"center\\\" style=\\\"border-left:0px;border-right: 0px;border-top: 0px;border-bottom: 0px ;font-size: 7px;text-align:center\\\"><\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" \";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \" <\\/td>\";\r\n\t\tstrVar += \" <\\/tr>\";\r\n\t\tstrVar += \" \";\r\n\t\tstrVar += \"<\\/table>\";\r\n\t\tstrVar += \"<\\/body>\";\r\n\t\tstrVar += \"<\\/html>\";\r\n\t\tstrVar += \"\";\r\n\t\t\r\n\t\tvar xml = \"<?xml version=\\\"1.0\\\"?>\\n<!DOCTYPE pdf PUBLIC \\\"-//big.faceless.org//report\\\" \\\"report-1.1.dtd\\\">\\n<pdf style=\\\"margin-top: 0pt;\\\">\\n\" + strVar + \"\\n</pdf>\";\r\n\t\t\r\n\t\tvar file = nlapiXMLToPDF(xml);\r\n\t\tresponse.setContentType('PDF', TranID + '_Warranty.pdf', 'inline');\r\n\t\tresponse.write(file.getValue());\r\n\t}\r\n}", "title": "" }, { "docid": "9fa078f43d44331b9eb6a03f9ed9f0d1", "score": "0.5014306", "text": "function viewPdf(viewerConfig, name_pdf) {\r\n document.addEventListener(\"adobe_dc_view_sdk.ready\", function () {\r\n var adobeDCView = new AdobeDC.View({\r\n /* Pass your registered client id */\r\n clientId: CLIENT_ID,\r\n /* Pass the div id in which PDF should be rendered */\r\n divId: \"adobe-dc-view\",\r\n });\r\n adobeDCView.previewFile(\r\n {\r\n /* Pass information on how to access the file */\r\n content: {\r\n //enter the Location of PDF which needs to be displayed\r\n location: {\r\n url: \"./pdfFiles/output.pdf\",\r\n },\r\n },\r\n /* Pass meta data of file */\r\n metaData: {\r\n /* file name */\r\n fileName: name_pdf + \".pdf\",\r\n },\r\n },\r\n viewerConfig\r\n );\r\n\r\n adobeDCView.registerCallback(\r\n AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,\r\n function (event) {\r\n switch (event.type) {\r\n case \"DOCUMENT_OPEN\":\r\n ga(\r\n \"send\",\r\n \"event\",\r\n \"DOCUMENT_OPEN\",\r\n event.data.fileName,\r\n \"open document\"\r\n );\r\n break;\r\n case \"PAGE_VIEW\":\r\n ga(\r\n \"send\",\r\n \"event\",\r\n \"PAGE_VIEW\",\r\n `Page ${event.data.pageNumber} of ${event.data.fileName}`,\r\n \"view page\"\r\n );\r\n break;\r\n case \"DOCUMENT_DOWNLOAD\":\r\n ga(\r\n \"send\",\r\n \"event\",\r\n \"DOCUMENT_DOWNLOAD\",\r\n event.data.fileName,\r\n \"download document\"\r\n );\r\n break;\r\n case \"TEXT_COPY\":\r\n ga(\r\n \"send\",\r\n \"event\",\r\n \"TEXT_COPY\",\r\n `COPIED - ${event.data.copiedText} -FROM ${event.data.fileName}`,\r\n \"copy text\"\r\n );\r\n break;\r\n default:\r\n }\r\n },\r\n {\r\n enablePDFAnalytics: true, //turn on pdf analytics\r\n }\r\n );\r\n });\r\n}", "title": "" }, { "docid": "79050cdd8b0dc23fc891c2130544f00a", "score": "0.50127435", "text": "function ShowCustomerInvoices() {\n\n\n //Take the value chosen, in the previous option\n var options = salesNavigator.getCurrentPage().options;\n \n var queryFilter=\"SELECT * FROM OINV T0 \";\n\n\n if (options.businessPartner.cardCode != null && typeof(options.businessPartner.cardCode) != 'undefined')\n {\n\n queryFilter = queryFilter +\" WHERE T0.cardCode='\"+options.businessPartner.cardCode+\"'\";\n\n }\n\n invoices=new Array();\n dataBase.transaction(function(tx) {\n\n tx.executeSql(queryFilter, \n [],\n function(tx, results)\n {\n \n var nLength = results.rows.length;\n \n \n for(var c=0;c<nLength;c++)\n {\n var invoice = new Document();\n\n var date = results.rows.item(c).docDate;\n var anio = date.substring(4,0);\n var mes= date.substring(6,4);\n var dia= date.substring(8,6); \n var concat = (anio+\"-\"+ mes +\"-\"+ dia);\n\n invoice.docEntry= results.rows.item(c).docEntry;\n invoice.cardCode= results.rows.item(c).cardCode;\n invoice.cardName= results.rows.item(c).cardName;\n invoice.docDate= concat;\n invoice.taxDate= results.rows.item(c).taxDate;\n invoice.discount= results.rows.item(c).discount;\n invoice.discountPercent= results.rows.item(c).discountPercent;\n invoice.comments= results.rows.item(c).comments;\n invoice.paidToDate= results.rows.item(c).paidToDate;\n invoice.docTotal= results.rows.item(c).docTotal;\n invoice.VatSum= results.rows.item(c).VatSum;\n invoice.baseImp= (invoice.docTotal-invoice.VatSum);\n \n invoices.push(invoice);\n }\n $scope.invoices=invoices;\n $scope.$apply();\n \n },\n function(tx, error)\n {\n alert(error.message); \n }\n );\n });\n }", "title": "" }, { "docid": "4ccb7620965db0d882da91e2d381dc27", "score": "0.50047916", "text": "function printPDF()\n{\n\tvar list2 = document.getElementsByClassName(\"div-button-active\")[0];\n\tconsole.log(\"active before: \" + list2);\n\treset_layout();\n\tswot_layout();\n\tconsole.log(\"active after: \" + list2);\n\n\tdocument.getElementById(\"strengths_div\").style.display = \"inline\";\n\tdocument.getElementById(\"opportunities_div\").style.display = \"inline\";\n\tdocument.getElementById(\"weaknesses_div\").style.display = \"inline\";\n\tdocument.getElementById(\"threats_div\").style.display = \"inline\";\n\tif(document.getElementById('swotcard_name').getAttribute('swot_type') == 'advanced') {\n document.getElementById(\"str_opp_div\").style.display = \"inline\";\n document.getElementById(\"str_thr_div\").style.display = \"inline\";\n document.getElementById(\"wea_opp_div\").style.display = \"inline\";\n document.getElementById(\"wea_thr_div\").style.display = \"inline\";\n }\n else {\n\t\tdocument.getElementById(\"str_opp_div\").style.display = \"none\";\n document.getElementById(\"str_thr_div\").style.display = \"none\";\n document.getElementById(\"wea_opp_div\").style.display = \"none\";\n document.getElementById(\"wea_thr_div\").style.display = \"none\";\n\t}\n\n\tvar divContents = document.getElementById(\"swot_div\").outerHTML;\n\t//$('.dropdown').hide();\n\n\tvar printWindow = \"\";\n\tprintWindow += '<html><head><title>DIV Contents</title>';\n\tprintWindow += '</head><body >';\n\tprintWindow += '<h1>'+ document.getElementById('swotcard_name').innerHTML +'</h1>';\n\tprintWindow += divContents;\n\tprintWindow += '</body></html>';\n\n\n\n\tif(list2.id == \"swot_button\")\n\t{\n\t\treset_layout();\n\t\tswot_layout();\n\t}\n\telse if(list2.id == \"str_opp_button\")\n\t{\n\t\treset_layout();\n\t\tstr_opp_layout();\n\t}\n\telse if(list2.id == \"str_thr_button\")\n\t{\n\t\treset_layout();\n\t\tstr_thr_layout();\n\t}\n\telse if(list2.id == \"wea_opp_button\")\n\t{\n\t\treset_layout();\n\t\twea_opp_layout();\n\t}\n\telse if(list2[0].id == \"wea_thr_button\")\n\t{\n\t\treset_layout();\n\t\twea_thr_layout();\n\t}\n\n\tdocument.getElementById(\"html_string\").value = printWindow;\n\n\treturn printWindow;\n}", "title": "" }, { "docid": "a38c74939196820d8cabe63566033905", "score": "0.5004005", "text": "function downloadPdf(budgetName) {\n let url = serverUrl + \"/transactionPdf?budgetName=\" + budgetName\n window.open(url, '_blank');\n}", "title": "" }, { "docid": "73d79839022e6c122660af5d1f3d6fc5", "score": "0.50015", "text": "function addInvoices(invoices) {\n invoices.forEach(invoice => {\n $('#invoices-lines').append($('<tr>')\n .append($('<td>').addClass('id').text(invoice.id))\n .append($('<td>').addClass('date').text(invoice.date))\n .append($('<td>').addClass('paid').append($('<input>')\n .prop('type', 'checkbox')\n .prop('disabled', true)\n .prop('checked', invoice.paid)\n ))\n .append($('<td>').addClass('client').text(invoice.client.lastname + ', ' + invoice.client.name))\n .append($('<td>').addClass('taxableBase text-right euro').text(invoice.taxableBase))\n .append($('<td>').addClass('ivaImport text-right euro').text(invoice.iva))\n .append($('<td>').addClass('total text-right euro').text(invoice.total))\n .append($('<td>').addClass('actions')\n .append($('<img>').addClass('edit-icon').prop('src', './img/edit.svg').height('20px')\n .on('click', function(ev) {\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n // send request to get all information from the current invoice\n requestInvoice(invoice.id);\n }))\n .append($('<img>').addClass('delete-icon').prop('src', './img/delete.svg').height('20px'))\n .on('click', function(ev) {\n ev.stopPropagation();\n ev.stopImmediatePropagation();\n // send request to delete the current invoice\n if (confirm(\"Are you sure to delete this invoice?\")) {\n requestDelete(invoice.id);\n }\n })\n )\n )\n });\n}", "title": "" }, { "docid": "5af2581e5d94e0cbdfb681d102491bfd", "score": "0.4991362", "text": "compose() {\n var objectPositions = [],\n objectIdCounter = 3;\n // Indexing objects\n this.root.id = 0;\n this.root.childs[0].id = 1;\n this.root.childs[0].childs[0].id = 2;\n for(var i=0; i < this.root.childs[0].childs[0].childs.length; i++) {\n if(!this.root.childs[0].childs[0].childs[i].active) { continue; }\n this.root.childs[0].childs[0].childs[i].id = objectIdCounter;\n objectIdCounter += 1;\n for(var j=0; j<this.root.childs[0].childs[0].childs[i].childs.length; j++) {\n if(!this.root.childs[0].childs[0].childs[i].childs[j].active) { continue; }\n this.root.childs[0].childs[0].childs[i].childs[j].id = objectIdCounter;\n objectIdCounter += 1;\n if(this.root.childs[0].childs[0].childs[i].childs[j].type == SimplePdfObjectType.PAGE) {\n for(var k=0; k < this.root.childs[0].childs[0].childs[i].childs[j].childs.length; k++) {\n if(!this.root.childs[0].childs[0].childs[i].childs[j].childs[k].active) { continue; }\n this.root.childs[0].childs[0].childs[i].childs[j].childs[k].id = objectIdCounter;\n objectIdCounter += 1;\n }\n }\n }\n } \n // Compose a PDF document\n // Head\n var pdf = this.root.getComposed();\n // Body (Metadata)\n objectPositions.push(pdf.length);\n pdf += this.root.childs[0].getComposed();\n // Body (Root/Catalog)\n objectPositions.push(pdf.length);\n pdf += this.root.childs[0].childs[0].getComposed();\n // Body (Page-Area)\n for(var i=0; i < this.root.childs[0].childs[0].childs.length; i++) {\n if(!this.root.childs[0].childs[0].childs[i].active) { continue; }\n objectPositions.push(pdf.length);\n pdf += this.root.childs[0].childs[0].childs[i].getComposed();\n // Body (Pages|Fonts)\n for(var j=0; j<this.root.childs[0].childs[0].childs[i].childs.length; j++) {\n if(!this.root.childs[0].childs[0].childs[i].childs[j].active) { continue; }\n objectPositions.push(pdf.length);\n pdf += this.root.childs[0].childs[0].childs[i].childs[j].getComposed();\n if(this.root.childs[0].childs[0].childs[i].childs[j].type == SimplePdfObjectType.PAGE) {\n // Body (Streams)\n for(var k=0; k < this.root.childs[0].childs[0].childs[i].childs[j].childs.length; k++) {\n if(!this.root.childs[0].childs[0].childs[i].childs[j].childs[k].active) { continue; }\n objectPositions.push(pdf.length);\n pdf += this.root.childs[0].childs[0].childs[i].childs[j].childs[k].getComposed();\n }\n }\n }\n }\n // Reference-Table\n var xrefPosition = pdf.length;\n pdf += ('xref\\n0 ' + String(objectIdCounter) + '\\n0000000000 65535 f\\n');\n for(var i=0; i < objectPositions.length; i++) {\n pdf += (this.numPad(objectPositions[i], 10) + ' 00000 n \\n');\n }\n // Trailer\n pdf += ('trailer\\n<< /Size ' + String(objectIdCounter) + '\\n/Info 1 0 R\\n/Root 2 0 R\\n>>\\nstartxref\\n' + String(xrefPosition) + '\\n%%EOF');\n return pdf;\n }", "title": "" }, { "docid": "3646f52f3b53e95e0d94b4d65e4986b9", "score": "0.49905115", "text": "open() {\n var pdfCompose = this.compose(),\n file = new Blob([pdfCompose], {type: 'application/pdf'});\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveOrOpenBlob(file, filename);\n } else {\n window.open(URL.createObjectURL(file), '_blank');\n }\n }", "title": "" }, { "docid": "b0a3c1f3aad5a7b6e35d69c8370be8be", "score": "0.497918", "text": "function generarDocumentosMasivos() {\n\n\t\n\t\n\t// Obtener los atributos del Filtro\n\tlet\n\tqueryString;\n\t//TODO: let assaas;\n\t\n\tlet sociedades;\n\tif($('#idSociedad').val() == \"\"){\n\t\tsociedades = JSON.stringify(Array.from(sociedadPrivilege)).slice(1, -1);\n\t\t\n\t\tif(sociedadPrivilege.size <= 1){\n\t\t\tsociedades.slice(1, -1);\n\t\t}\n\t\t\n\t}else{\n\t\tsociedades = $('#idSociedad').val();\n\t}\n\tlet huertos;\n\tif($('#idHuerto').val() == \"\"){\n\t\thuertos = JSON.stringify(Array.from(huertoPrivilege)).slice(1, -1);\n\t\t\n\t\tif(huertoPrivilege.size <= 1){\n\t\t\thuertos.slice(1, -1);\n\t\t}\n\t\t\n\t}else{\n\t\thuertos = $('#idHuerto').val();\n\t}\n\n\tqueryString = \"idSociedad=\"+sociedades + \"&idHuerto=\"+huertos;\n\t\n\tqueryStringRolPrivado = \"&rolPrivado=\"+JSON.stringify(rolPrivado).slice(1,-1);\n\t\n\t// Pasar parametros al servicio para descargar Archivos Multiples (PDF)\n\tlet\n\tfile = $(this)\n\t\t\t.getJSONSync(\n\t\t\t\t\t'/simpleWeb/json/work/ExcelReport/excelReportListaTrabajadores/?'\n\t\t\t\t\t\t\t+ queryString + queryStringRolPrivado);\n\n\t// alerta(JSON.stringify(file));\n\n\t// Descargar Archivo PDF\n\twindow.open(\"/simpleWeb/json/work/showExcelReport/?FILE=\" + file[0]);\n\n}", "title": "" }, { "docid": "4d1b85a591f6c81336c079a24acce011", "score": "0.49750856", "text": "function eval_pdf_count(count,num,start,tot,ticket){\n\n\t// calculate the last ticket to be printed minus 3. We use this to prevent extra pdfs from being generated.\n\tnumless = Number(num)-Number(3);\n\tif(count >= numless){\n\t\t\n\t\t// first check if print_called is true. We only want to call it once.\n\t\tif(print_called != true){\n\t\t\t//hide the loading image for pdfs.\n\t\t\t$(\"#loadingpdf\").hide();\n\n\t\t\t//Give user a print option here before calling print function. also, tell them it's ready to print.(bc)\t\n\t\t\t$(\"#print_ready\").show();\n\t\t\t$(\"#print_bt\").show();\n\n\t\t\t$(\"#print_bt\").bind('click',function () {\n\t\t\t\tprint_watch(num, ticket);\n\t\t\t});\n\n\t\t\t// show the progress info for printing.\n\t\t\t//$(\"#loadingprint\").show();\n\t\t\t//$(\"#printp\").empty();\n\t\t\t//$(\"#print\").show();\n\t\t\t\n\t\t\tprint_called = true;\n\t\t}\n\t} else {\n\t\t//print_called = false;\n\t}\n\t\n\t// update the progress bar, though this is a little silly since it will jump from 0 straight to 100.\n\t$(\"#progress\").progressbar({value: (Number(count)/Number(num)*Number(100))});\n\t\n}", "title": "" }, { "docid": "f04305b37e0e260bbaf64bcf5352e5cc", "score": "0.4974124", "text": "function TrackingInformation(){\n //setOrderHeader();\n //setOrderItem();\n nameTraveler = document.getElementById(\"ordernumber\").value;\n document.getElementById(\"pdftraveler\").href = \"../pdf/\"+nameTraveler+\".pdf\";\n }", "title": "" }, { "docid": "7e6891cfff348d2f11d81c24e2cad224", "score": "0.49688944", "text": "function onPrint() {\r\n\twindows.print();\r\n}", "title": "" } ]
3b832becd0e2191a7c3a0049cb60ade0
Cuando reciba una llamada en ejecuto el handler "respuesta"
[ { "docid": "973f40859e85032f5ea9099a27646b59", "score": "0.0", "text": "function respuestaTimestampVacio(req, res) //Esta función devuelve como respuesta a la llamada un archivo, en este caso un HTML para \"visualizar la app\"\n{ \n req.utc = new Date(Date.now()).toUTCString();\n req.unix = new Date(Date.now()).getTime();\n res.json({\"unix\": req.unix, \"utc\": req.utc}); \n console.log(\"Recibida una llamada en www.app.com/api/timestamp/\");\n}", "title": "" } ]
[ { "docid": "cdad4d807f9e10f976c4e0afcd7f28e1", "score": "0.71576595", "text": "function procesamientoRespuesta() {\r\n try {\r\n var respuesta = this.rsJson();\r\n } catch(e) {\r\n control.fallo(E_SERVIDOR);\r\n }\r\n \r\n if (this.status == 200) {\r\n control.correcto(respuesta);\r\n } else {\r\n control.fallo(respuesta);\r\n }\r\n }", "title": "" }, { "docid": "6d2bf499cc0b9dcfb7ff17b6bcec128d", "score": "0.66228336", "text": "function handleResponse() {\n //on verifier si le serveur a fini de traité la requette c'est a dire s'il a completement fini de transmetres les données par ce qu'il peut etre dans une phase intermedière\n if (xmlHttp.readyState == 4) {\n //si tout c'est bien passé on verifier si notre requete est un succes ou pas?\n if (xmlHttp.status == 200) {\n // responseXML = retourne un Document qui contient la réponse serveur ou null si la requête a échoué ;\n reponse = xmlHttp.responseXML;\n\n //on accède a la racine du Document Xml c'est a dire la première balise d'un Document Xml est appéler racine il s'agit de la balise <response> du fichier Php\n xmlRoot = reponse.documentElement;\n\n //puis on accède au prémier element de la balise racine qui est le Contenue et ceci grace a la propriété data\n message = xmlRoot.firstChild.data;\n\n //enfin on injecte le contenue dans la page html\n document.getElementById(\"answer\").innerHTML =\n '<span style=\"color: red\">' + message + \"</span>\";\n setTimeout(\"process()\", 1000);\n } else {\n alert(\"erreur au niveau de la lecture des données\");\n }\n }\n}", "title": "" }, { "docid": "7a9195681f7eb4ac8aa72ea8fd43e5b0", "score": "0.65239674", "text": "static subir(){\n\n console.log('[..] Hola, martes con frio en buenos aires!!!');\n\n let valorPedido = \"\";\n let valorRespuesta = \"\";\n// INPUT\n valorPedido = document.querySelector( \"#nota_titulo\" ).value;\n\n document.querySelector( \"#nota_titulo\" ).value = \"\";\n//1. Procesamiento\n valorRespuesta = valorPedido;\n //1.1 le envio un dato de parametro al Servidor \n const traer = async () => {\n let persona = {};\n persona.titulo = document.querySelector(\"#nota_titulo\").value;\n let personaStringJSON = JSON.stringify(persona);\n let respuesta = await fetch(\"NotaServer\",\n {method: 'POST', body: personaStringJSON});\n let datotexto = JSON.parse(await respuesta.text());\n document.querySelector('#panelResultados').innerHTML = datotexto;\n };\n traer()\n .catch(ex => {\n document.querySelector(\"#panelMensajes\").innerHTML = 'ERROR: ' + ex.message;\n });\n //1.2 recibo respuesta del Servidor, tambien en algun dato de parametro\n \n//2. OUTPUT \n document.querySelector(\"#panelMsgContenido\").innerHTML = valorRespuesta;\n \n console.log('[OK] Hola, martes con frio en buenos aires!!!');\n\n }", "title": "" }, { "docid": "bb636a8599427b759e5797ae1ca381e3", "score": "0.64663255", "text": "function respuesta_servidor(respuesta) {\n // alert(respuesta)\n //extraer de la respuesta codigo y mensaje (si tipo texto)\n // let codigo_respuesta = respuesta.substring(0, 2);\n // let mensaje = respuesta.substring(2);\n\n //extraer de la respuesta codigo y mensaje (si tipo json)\n\n //1. convertir json a array\n let array_respuesta = JSON.parse(respuesta);\n\n //2. extraer los datos e array\n let codigo_respuesta = array_respuesta[0];\n let mensaje = array_respuesta[1];\n\n if (codigo_respuesta == \"00\") {\n //enviar mensaje a textarea\n document.querySelector(\"#texto\").value = mensaje;\n } else {\n //enviar mensaje al span\n document.querySelector(\"#mensaje\").innerText = mensaje;\n }\n}", "title": "" }, { "docid": "687b7d1c7ce85148ddf84c1c6776c36b", "score": "0.6454197", "text": "function callback(respuesta) { \n console.log(respuesta);\n }", "title": "" }, { "docid": "71d64c0e8dbbf37fd37827272e691b9a", "score": "0.6426835", "text": "function responderPeticion (req, res){\n res.end('Hola Mundo');\n}", "title": "" }, { "docid": "a19e28e3683018087499455a1fed9e38", "score": "0.6401691", "text": "function response(respons) {\r\n res.send(respons);\r\n }", "title": "" }, { "docid": "6c014a82358e2557ddda93234a74ed48", "score": "0.63693845", "text": "function pruebas(req, res) {\n //console.log({req,res});\n res.status(200).send({\n message: 'prueba accion controlador api rest node exitosa!'\n });\n}", "title": "" }, { "docid": "534aa99881d3f1f528f1adaef4f3e431", "score": "0.62720615", "text": "function enregistreResponse(rep){\n\tconsole.log(\"debut enregistreResponse\");\n\tvar ret = JSON.parse(rep,revival2);\n\tvar status = ret.status;\n\tif(status == \"OK\"){\n\t\tconsole.log(\"Debut if enregistreResponse\");\n\t\talert(\"Inscription ok\");\n\t\tmakeMainPanelConnexion();\n\t}else{\n\t\tconsole.log(status);\n\t}\n}", "title": "" }, { "docid": "e683288e9a6c89ff368562e3de933138", "score": "0.6269572", "text": "function enviarArticulo(req,res){\n var params = req.body;\n var ml;\n var respuesta = {\n porcentaje : 5,\n articulo: [],\n keywordsArticulo: [],\n infoScrapper: []\n }\n ml = machineLearningService.postArticulos((resp) => {\n let data = '';\n\n // A chunk of data has been recieved.\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n // The whole response has been received. Print out the result.\n resp.on('end', () => {\n console.log(JSON.parse(data));\n res.status(200).send({ message: data, status: 200 })\n });\n\n }).on(\"error\", (err) => {\n console.log(\"Error: \" + err.message);\n return err\n })\n}", "title": "" }, { "docid": "cd3da6bd1b1435b1b8cd530aea613270", "score": "0.62194055", "text": "function responseHandler(res){\n\tres.on('data', resDataPiper);\n\tres.on('end', resFinalizer);\n}", "title": "" }, { "docid": "545019bb307b48caade5fa2ac4f93d57", "score": "0.6192222", "text": "function resibir_mensajes_chat(ultimo_Folio) {\n url = \"servicios/chatServ.asmx/leer_mensaje\"\n var emisor =mi, reseptor = otro;\n var clave_chat;\n //creamos la clabe del chat\n if (emisor > reseptor)\n clave_chat = emisor + \"-\" + reseptor;\n else if (reseptor > emisor)\n clave_chat = reseptor + \"-\" + emisor;\n\n var obj ={\n 'emisor': reseptor,\n 'reseptor': emisor,\n 'ultimo_Folio': ultimo_Folio,\n 'clave_chat': clave_chat\n }//fin obj\n\n $.post({\n type: \"POST\",//tipo a enviar\n async: false,\n cache: false,\n url: url,\n data: JSON.stringify(obj),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"post\",//tipo de datos.\n beforeSend: function () {//funcion que se ejecuta mientras hacemos la llamada.\n }//fin beforeSend.\n ,\n complete: function (response) {\n //response = JSON.stringify(response);\n respuesta = response.responseText;\n // console.log(response);//respuesta. responseText\n respuesta = JSON.parse(respuesta);\n\n }//fin complete\n });//fin de ajax\n \n return respuesta.d;\n}//fin", "title": "" }, { "docid": "972241aa886e05d2b8dc13c378a246f6", "score": "0.6177101", "text": "function respuesta(req, res) //Esta función devuelve como respuesta a la llamada un archivo, en este caso un HTML para \"visualizar la app\"\n{ \n res.sendFile(__dirname+'/views/index.html'); //Meto el path/file para darlo como respuesta\n console.log(\"Recibida una llamada en www.app.com/\");\n}", "title": "" }, { "docid": "8dd7989d8b35ecc4397d84e0718b7b57", "score": "0.61600715", "text": "function datosRecibeServidor(identificacion) {\n var http = getXMLHttpRequest();\n http.open(\"GET\", \"proceso.php?identificacion=\" + identificacion, true);\n http.onreadystatechange = procesoRecibidaDatos;\n http.send(null);\n return http;\n}", "title": "" }, { "docid": "993b183720265e9b60a01fbf08857408", "score": "0.61352277", "text": "function cbRespondeSolicitud(requestJSON) {\n\tconsole.log(`Me acaban de pedir algo: esto: ${JSON.parse(requestJSON)}`)\n\tlet request = JSON.parse(requestJSON);\n\n\tlet topico = request.topico;\n\tlet mensaje;\n\n\tswitch (request.accion) {\n\t\t//COORDINADOR\n\t\tcase globals.COD_ADD_TOPICO_BROKER:\n\t\t\tif (!colaMensajesPorTopico.hasOwnProperty(topico)) { // le piden administrar a un topico que no administraba\n\t\t\t\tagregarColaMensajes(topico);\n\n\t\t\t\tif (topico == globals.MESSAGE_ALL_TOPIC_NAME) { //suscribirme a heartbeat\n\n\t\t\t\t\t//solicito a coordinador el heartbeat para suscribirme\n\t\t\t\t\tinitSocketsClienteReconectado();\n\n\n\t\t\t\t\tvar messageInicial = {\n\t\t\t\t\t\tidPeticion: globals.generateUUID(),\n\t\t\t\t\t\taccion: globals.COD_ALTA_SUB,\n\t\t\t\t\t\ttopico: globals.HEARTBEAT_TOPIC_NAME\n\t\t\t\t\t};\n\t\t\t\t\tconsole.log(`Voy a solicitar broker sub a coordinador ${messageInicial}`)\n\t\t\t\t\tcommsCliente.solicitarBrokerSubACoordinador(messageInicial);\n\t\t\t\t}\n\n\t\t\t\tdebugConsoleLog(`Asignaron el topico ${requestJSON}`);\n\t\t\t}\n\n\t\t\tmensaje = globals.generarRespuestaExitosa(request.accion, request.idPeticion, {});\n\t\t\t// los resultados van vacíos porque el coord ya sabe ip y puertos del broker\n\n\t\t\tconsole.log('CCC');\n\t\t\tconsole.log(JSON.stringify(mensaje));\n\n\t\t\trepSocket.send(JSON.stringify(mensaje));\n\n\t\t\tconsole.log('DDD');\n\t\t\tconsole.log(JSON.stringify(mensaje));\n\n\t\t\tbreak;\n\n\t\t//SERVIDOR HTTP\n\t\tcase globals.COD_GET_TOPICOS:\n\t\t\t// filtrado para evitar enviar al cliente HTTP las colas de grupos y heartbeat, que estan vacias\n\t\t\tlet topicos = globals.getKeys(colaMensajesPorTopico).filter(topico =>\n\t\t\t\t(topico != globals.HEARTBEAT_TOPIC_NAME && !topico.startsWith(globals.GROUP_TOPIC_PREFIX))\n\t\t\t);\n\n\t\t\tlet resultados = {\n\t\t\t\tlistaTopicos: topicos // ['topico1','topico2',...]\n\t\t\t};\n\n\t\t\tmensaje = globals.generarRespuestaExitosa(request.accion, request.idPeticion, resultados);\n\t\t\t// los resultados van vacíos porque el coord ya sabe ip y puertos del broker\n\n\t\t\trepSocket.send(JSON.stringify(mensaje));\n\n\t\t\tdebugConsoleLog(`Solicitaron los topicos`);\n\t\t\tbreak;\n\n\t\tcase globals.COD_GET_MENSAJES_COLA:\n\n\t\t\tif (colaMensajesPorTopico.hasOwnProperty(topico)) {\n\t\t\t\t//manda cola de mensajes de ese topico\n\t\t\t\tlet resultados = {\n\t\t\t\t\tmensajes: colaMensajesPorTopico[topico] // ['mensaje1','mensaje2',...]\n\t\t\t\t};\n\t\t\t\tmensaje = globals.generarRespuestaExitosa(request.accion, request.idPeticion, resultados);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//no maneja ese topico -> manda rta con codigo de error\n\t\t\t\tmensaje = globals.generarRespuestaNoExitosa(request.accion, request.idPeticion, globals.COD_ERROR_TOPICO_INEXISTENTE, `El topico ${topico} no es administrado por este broker`);\n\t\t\t}\n\n\t\t\trepSocket.send(JSON.stringify(mensaje));\n\n\t\t\tdebugConsoleLog(`Solicitaron los mensajes del topico ${topico}`);\n\t\t\tbreak;\n\n\t\tcase globals.COD_BORRAR_MENSAJES:\n\t\t\tif (colaMensajesPorTopico.hasOwnProperty(topico)) {\n\t\t\t\t//borra los mensajes de ese topico porque lo administraba\n\t\t\t\tborrarColaMensajesTopico(topico);\n\t\t\t\tlet resultados = {};\n\t\t\t\tmensaje = globals.generarRespuestaExitosa(request.accion, request.idPeticion, resultados);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//no maneja ese topico -> no borra mensajes\n\t\t\t\tmensaje = globals.generarRespuestaNoExitosa(request.accion, request.idPeticion, globals.COD_ERROR_TOPICO_INEXISTENTE, `El topico ${topico} no es administrado por este broker`);\n\n\t\t\t}\n\n\t\t\tdebugConsoleLog(`Solicitaron borrar la cola de mensajes del topico ${topico}`);\n\t\t\trepSocket.send(mensaje);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tmensaje = globals.generarRespuestaNoExitosa(request.accion, request.idPeticion, globals.COD_ERROR_OPERACION_INEXISTENTE, 'El codigo de operacion ingresado no se reconoce como un codigo valido');\n\t\t\trepSocket.send(JSON.stringify(mensaje));\n\n\t\t\tdebugConsoleLog(`Error ${request.error.codigo}: ${request.error.mensaje}`);\n\t\t\tbreak;\n\t}\n\n}", "title": "" }, { "docid": "e68803275d3a809d563ad8dfcfed811d", "score": "0.6113597", "text": "function gestionarPagina(evento){\n\tif (evento.target.readyState == 4 && evento.target.status == 200) {\n\t\trespuesta = JSON.parse(evento.target.responseText);\n\t\trespuestaLibros(respuesta);\n }\n}", "title": "" }, { "docid": "c4e867806712f73e0adeb0bb6102a769", "score": "0.610332", "text": "function atenderServidor(request, response){\n var path = request.url;\n retornarArchivo(request,response,path.substr(1));\n console.log('petición recibida : ' + path);\n if(request.url=='/statu.json'){\n retornarArchivo(request,response,path.substr(1));\n }\n //Almacena los datos del usuario\n if(request.url=='/registrar'){\n guardarRegistro(request,response);\n }\n\n //leerArchivos(request.url);\n\n\n}", "title": "" }, { "docid": "f384f2d1597554ddeec94a0594fe2ce5", "score": "0.61014223", "text": "on_REPLY (e, callback) {\n\n\t\tif (e.target.status >= 200 && e.target.status < 400) {\n\t\t\t\n\t\t\tvar response = e.target.response;\n\n\t\t\t// convert to object if request is a JSON string\n\t\t\tif (typeof response === 'string') {\n\t\t\t\tresponse = JSON.parse(e.target.response);\n\t\t\t}\n\n\t\t\t// Go ahead and pass the response to the caller\n\t\t\tcallback(response);\n\n\t\t} else {\n\t\t\t\n\t\t\tconsole.log('Error: There was an error loading the JSON. -- Status:', e.target.status);\n\t\t}\n\t}", "title": "" }, { "docid": "1d333e2f2b34806e77892acbc14af911", "score": "0.6074581", "text": "function cargarDatosUno() {\n\n var resp = $(\"#listadoQuestion\");\n axios.post('/questions/obtenerCadaDato', {\n posicionInicial: cont,\n numeroElementos: 1\n }).then(function (response) {\n mostrarRespuesta(response, resp);\n cont++;\n }).catch(function (error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "8bfdb31bd2f462b896b4e1bfa04b186b", "score": "0.6066378", "text": "function gestionarListado(evento){\n\tif (evento.target.readyState == 4 && evento.target.status == 200) {\n\t\trespuesta = JSON.parse(evento.target.responseText);\n\t\trespuestaLibros(respuesta);\n }\n}", "title": "" }, { "docid": "848ac858be75bf20478fb5df49064518", "score": "0.6034132", "text": "function handleResponse() {\n\t\tif (data.type === MESSAGE_TYPES.TEXT) {\n\t\t\thandleResponseForText(data);\n\t\t}\n\n\t\tif (data.type === MESSAGE_TYPES.ATTACHMENT) {\n\t\t\thandleResponseForAttachment(data);\n\t\t}\n\n\t\tif (data.type === MESSAGE_TYPES.DELAY) {\n\t\t\thandleResponseForDelay(data);\n\t\t}\n\n\t\tif (data.type === MESSAGE_TYPES.CARDS) {\n\t\t\thandleResponseForElements(data.elements);\n\t\t}\n\n\t\tif (data.type === MESSAGE_TYPES.LIST) {\n\t\t\thandleResponseForElements(data.elements);\n\t\t}\n\n\t\treturn error;\n\t}", "title": "" }, { "docid": "c0d1fe0e14b2fa84665e1ec3d86588b4", "score": "0.6024146", "text": "function responderPeticion(request, response){\n response.end('Mi nombre es Anthony Tineo');\n}", "title": "" }, { "docid": "435100dc9c30518bda66622a52a2dbf7", "score": "0.60212564", "text": "function procesarCambio_comentarios()\n{\n\tconsole.log(\"procesarCambio_comentarios\");\n\n\tif(obj.readyState == 4)\n\t{ \n\t\t// valor 4: respuesta recibida y lista para ser procesada\n\t\tif(obj.status == 200)\n\t\t{ \n\t\t\t// El valor 200 significa \"OK\"\n\t\t\t// Aquí se procesa lo que se haya devuelto:\n\t\t\tconsole.log(\"se ha terminado la carga de datos de la entrada -> devolviendo\");//devolvemos mensaje por log\n\t\t\tcomenta=JSON.parse(obj.responseText);//creamos el objeto datos con los datos parseados\n\t\t\tformatear_comentarios();//mostramos la informacion de la entrada\n\t\t}\n\t\telse \n\t\t{\n\t\t\tconsole.warn(\"no se ha podido completar la peticion ajax-html de la entrada\");//devolvemos mensaje por log\n\t\t}\n\t}\n}", "title": "" }, { "docid": "948ab5c3926c60a7b0b501b68e212a32", "score": "0.59908795", "text": "async getMaleza(req, res) {\n const malezacontrol = await malezaModel.getMaleza()\n return res.status(200).send(malezacontrol); // <--\n //return res.status(200).send(malezaDto.multipleMalezaControl(malezacontrol));\n }", "title": "" }, { "docid": "2affd0182a87a4b55163c6cc812ffe44", "score": "0.59886366", "text": "function _lista_usuarios() {\n //variables a usar\n var urla = \"servicios/accesoServ.asmx/obtener_lista_usuarios\";\n\n $.post({\n type: \"POST\",//tipo a enviar\n async: false,\n cache: false,\n url: urla,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"post\",//tipo de datos.\n beforeSend: function () {//funcion que se ejecuta mientras hacemos la llamada.\n }//fin beforeSend.\n ,\n complete: function (response) {\n //response = JSON.stringify(response);\n respuesta = response.responseText;\n // console.log(response);//respuesta. responseText\n respuesta = JSON.parse(respuesta);\n\n }//fin complete\n });//fin de ajax\n\n return respuesta.d;\n}//fin", "title": "" }, { "docid": "39816521faa4a20959a142d4e5285198", "score": "0.5988463", "text": "handleReply(data){\r\n\t\tresponse=JSON.parse(data.target.response);\r\n\t}", "title": "" }, { "docid": "efd386d7c821a3cd11f8387999c21ae2", "score": "0.59859324", "text": "recuperar(){\n\n if (this.state.correo != '') {\n return fetch('http://www.mako.guru/listadosApp/recuperarPassUsu.php',{\n method:'post',\n headers:{\n 'Accept': 'aplication/json',\n 'Content-Type': 'aplication/json',\n },\n body:JSON.stringify({\n correo: this.state.correo,\n })\n \n })\n .then((response) => response.json())\n .then((responseJson) =>{\n if (responseJson == 1) {\n this.errorAsignar();\n \n } else{\n \n if (responseJson == 2) {\n this.errorEnvio();\n } else{\n\n if (responseJson == 0) {\n\n this.malCorreo();\n\n } else{\n \n this.envioOk();\n\n };\n\n };\n };\n\n })\n\n.catch((error) => {\n console.warn('error fetch: '+error);\n }); \n\n Keyboard.dismiss();\n\n } else{\n this.faltanDatos();\n };\n\n}", "title": "" }, { "docid": "2ace9d778a8479d303dcde30efdba2b4", "score": "0.597558", "text": "async getDatosAdicionalesMaleza(req, res) {\n const result = await malezaModel.getDatosAdicionalesMaleza()\n return res.status(200).send(result); // <--\n }", "title": "" }, { "docid": "19a1c506496443238a4103cbe408bdfb", "score": "0.59704024", "text": "function carregarRespostas(idDuvida) {\n\n\n var resultado = $.post('dao/processar/ProcessarDuvidas.php',{operacao : 'buscarResposta', idDuvida: idDuvida}, function (result) {\n\n });\n\n return (resultado);\n}", "title": "" }, { "docid": "725bb251ebef0de20eb41001e578561d", "score": "0.5970142", "text": "function enviarMensaje(evento) {\n var hilo = evento.target.id;\n evento.preventDefault();\n // El mensaje abre un hilo nuevo o es la respuesta de un hilo ya creado\n if(hilo == 'formulario_mensajes_nuevos'){\n var parametros = {\n \"receptor\" : $('#receptor').val(),\n \"asunto\" : $('#asunto').val(),\n \"mensaje\" : $('#mensaje').val()\n };\n }\n else{\n var parametros = {\n \"mensaje\" : $('#mensaje').val(),\n \"hilo\" : hilo\n };\n }\n\n var respuesta = llamarAjax(parametros,'../php/mensajeria.php');\n alert(respuesta);\n $('form').trigger(\"reset\");\n}", "title": "" }, { "docid": "4fdcb0a588024dcbde3aaa56ecdc289f", "score": "0.5959152", "text": "function caricaeventi() {\r\n fetch(\"./caricastand.php\").then(onResponse).then(onJSON);\r\n}", "title": "" }, { "docid": "ed3b2e84ee454df60d738e7269af8804", "score": "0.5946961", "text": "async function handleRequest(_request, _response) {\r\n console.log(\"I hear voices!\"); // Serverlog\r\n //_response.setHeader(\"content-type\", \"text/html; charset=utf-8\");\r\n _response.setHeader(\"Access-Control-Allow-Origin\", \"*\");\r\n _response.setHeader(\"content-type\", \"application/json\");\r\n if (_request.url) {\r\n //Url muss man parsen um es bearbeiten zu. Genauso wie im Video gemacht aber es scheint als wäre es veraltet\r\n let url = Url.parse(_request.url, true);\r\n let path = url.pathname; // Pathname entweder /html oder /json\r\n if (path == \"/speichern\") {\r\n let jsonstring = JSON.stringify(url.query);\r\n console.log(jsonstring);\r\n storeOrder(url.query);\r\n }\r\n if (path == \"/abfragen\") {\r\n console.log(\"Datenbank wird abgefragt\");\r\n let answerdata = orders.find();\r\n let answerarray = await answerdata.toArray();\r\n _response.write(JSON.stringify(answerarray));\r\n }\r\n }\r\n _response.end();\r\n }", "title": "" }, { "docid": "1a6d865deb53a2c8d2909955bb0ed2c3", "score": "0.5930701", "text": "function handleResponse(o)\r\n\t{\r\n\t\t// but you can use the generic handleResonse if you want\r\n\t\tlum_handleResponse(o);\r\n\t}", "title": "" }, { "docid": "dd7c318bc3d9902b0c93b7c77fbd1956", "score": "0.59257466", "text": "async function obtenerConteoPersonal() {\n try {\n let res = await axios('controllers/questionaryController.php', {\n method: 'POST',\n data: {\n tipoPeticion: 'obtenerConteoPersonal',\n idInstitucion,\n nombreInstitucion,\n clasificacionInstitucion,\n anioInstitucion,\n }\n })\n resultado = res.data\n if (resultado[0] == 'success') {\n totalHombres = parseInt(resultado[1])\n totalMujeres = parseInt(resultado[2])\n } else if (resultado[0] == 'error') {\n alertify.error(resultado[1])\n } else {\n console.warn('Tipo de respuesta no definido. ' + resultado)\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "2d42f088ca89ef341c04593046e12d2e", "score": "0.592002", "text": "async function contabaConDisposicion1P1S12() {\n try {\n let res = await axios('controllers/questionaryController.php', {\n method: 'POST',\n data: {\n tipoPeticion: 'contabaConDisposicion1P1S12',\n idInstitucion,\n nombreInstitucion,\n clasificacionInstitucion,\n anioInstitucion,\n }\n })\n resultado = res.data\n if (resultado[0] == 'success') {\n return resultado[1]\n } else if (resultado[0] == 'error') {\n alertify.error(resultado[1])\n } else {\n console.warn('Tipo de respuesta no definido. ' + resultado)\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "7abbf65056c968517fd00449c667ba0e", "score": "0.59189606", "text": "function handleResponse(resp) {\n}", "title": "" }, { "docid": "f4733ff672e3ce4eecf7886fb14370e6", "score": "0.5915302", "text": "function handleComplete(resp) {\n if (resp.status == 200) {\n resp.json().then(function(jsondata){\n if (jsondata && jsondata.result) {\n if (jsondata.result == 'OK') {\n displayMessage('Success', 'Sent to Kodi', 'ok');\n return;\n }\n }\n if (typeof jsondata.error !== 'undefined') {\n if (typeof jsondata.error.data !== 'undefined' && jsondata.error.data.stack.message) {\n displayMessage('Kodi Error ' + jsondata.error.code, 'Kodi reported: ' + jsondata.error.data.stack.message + '', 'error');\n return;\n }\n if (typeof jsondata.error.message !== 'undefined') {\n displayMessage('Kodi Error ' + jsondata.error.code, 'Kodi reported: ' + jsondata.error.message + '', 'error');\n return;\n }\n displayMessage('Kodi Error ', 'Kodi reported error code ' + jsondata.error.code + '', 'error');\n return;\n }\n });\n } else {\n if (resp.status === 0) {\n displayMessage('Network error', 'Could not contact Kodi. Check your configuration.', 'error');\n } else {\n displayMessage('Status error ' + resp.status, 'Could not contact Kodi. Check your configuration. HTTP Status: ' + resp.status + ' ' + resp.statusText + '', 'error');\n }\n }\n}", "title": "" }, { "docid": "086ecad6206eb6eb29e8240d2952052a", "score": "0.5909194", "text": "function handleResp(err, data) {\n if (err) {\n // Log any errors\n console.log(err);\n }\n // Log the mail response\n console.log('Message sent: ' + data.response);\n res.send('Feedback sent!');\n }", "title": "" }, { "docid": "233223398ec09678aeb9e6830bd72e08", "score": "0.59002954", "text": "function pruebas (req,res){\n res.status(200).send({\n message:'probando el controlador de usuarios'\n });\n}", "title": "" }, { "docid": "84075a27e80b9d12bd7da25cbd1e528a", "score": "0.5891493", "text": "function onRequest(request,response)\n\t{\n\t\tvar postData = \"\";\n\t\tvar pathname = url.parse(request.url).pathname;\n\t\tconsole.log(\"Peticion para \" + pathname + \" recibida.\");\n\n\t\t//la codificacion de la informacion recibida sera UTF8\n\t\trequest.setEncoding(\"utf8\");\n\n\t\t/*\n\t\trequest.addListener(\"data\", function(chunk) {\n \t\t// funcion llamada cuando un nuevo trozo (chunk) \n \t\t// de informacion (data) es recibido.\n\t\t});\n\t\t*/\n\t\trequest.addListener(\"data\", function(chunk)\n\t\t{\n\t\t\tpostData = postData + chunk;\n\t\t\tconsole.log(\"Recibido trozo POST '\" + chunk + \"'.\");\n\n\t\t});\n\n\t\t/*\n\t\trequest.addListener(\"end\", function() {\n \t\t// funcion llamada cuando todos los trozos (chunks) \n \t\t// de informacion (data) han sido recibidos.\n\t\t}); \n\t\t*/\n\t\t//llamamos al router una vez que toda la inf haya sido recibida\n\t\trequest.addListener(\"end\", function()\n\t\t{\n\t\t\troute(handle, pathname, response, postData);\n\t\t});\n\n\t\t//se llama a funcion route para indicar qué debe hacerse\n\t\t//route(handle,pathname,response);//-->devuelve un string;\n\t\t\n\t}", "title": "" }, { "docid": "1ffd3a7638bcc08d664a92a85e2c6397", "score": "0.5890477", "text": "function consumirServicio(){\n\n //1.crear un objeto de AJAX\n let telefono= new XMLHttpRequest();\n\n //2. abrir la conexion\n\n let url=\"http://jsonplaceholder.typicode.com/users\"\n telefono.open('GET',url, true );\n\n //3. ejecutar la carga de informacion\n telefono.onload = function(){\n\n let respusta = JSON.parse( this.responseText);\n\n console.log([0]);\n\n nombre.texcontent = respusta[0].name\n \n\n }\n\n //4. envio conexion\n telefono.send();\n\n\n\n}", "title": "" }, { "docid": "5a8918d3daaf6142472d7424299892e0", "score": "0.58873516", "text": "async function obtenerConteoInmuebles() {\n try {\n let res = await axios('controllers/questionaryController.php', {\n method: 'POST',\n data: {\n tipoPeticion: 'obtenerConteoInmuebles',\n idInstitucion,\n nombreInstitucion,\n clasificacionInstitucion,\n anioInstitucion,\n }\n })\n resultado = res.data\n if (resultado[0] == 'success') {\n totalPropios = parseInt(resultado[1])\n totalRentados = parseInt(resultado[2])\n totalOtros = parseInt(resultado[3])\n } else if (resultado[0] == 'error') {\n alertify.error(resultado[1])\n } else {\n console.warn('Tipo de respuesta no definido. ' + resultado)\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "42ff5aa892318cd33d3066645c6ea39f", "score": "0.58847857", "text": "function fn_aplicarRespuesta() {\n var send;\n var insertaCabeceraPregunta = { \"insertaCabeceraPregunta\": 1 };\n var Accion = \"IP\";\n if ($(\"#inpPsgDescripcionPregunta\").val() !== \"\") {\n if ($(\"#inpPsgDescripcionPreguntaPOS\").val() !== \"\") {\n if ($(\"#inpPsgCantidadMinimaRespuestas\").val() !== \"\") {\n if ($(\"#inpPsgCantidadMaximaRespuestas\").val() !== \"\") {\n if ($(\"#inpPsgCantidadMinimaRespuestas\").val() <= $(\"#inpPsgCantidadMaximaRespuestas\").val()) {\n if (lc_control == 1) {\n $(\"#mdl_rdn_pdd_crgnd\").show();\n $(\"#mdlPreguntasSugeridas\").hide();\n send = insertaCabeceraPregunta;\n send.accion = Accion;\n send.cdnCabecera = $(\"#cdn_id\").val();\n send.descCabecera = $(\"#inpPsgDescripcionPregunta\").val();\n send.descPos = $(\"#inpPsgDescripcionPreguntaPOS\").val();\n send.maxCabecera = $(\"#inpPsgCantidadMaximaRespuestas\").val();\n send.minCabecera = $(\"#inpPsgCantidadMinimaRespuestas\").val();\n send.respID = 0;\n send.preElimina = 0;\n send.plu = 0;\n send.estado = \"x\";\n send.respuesta = \"x\";\n $.getJSON(\"../adminpreguntassugeridas/config_preguntassugeridas.php\", send, function(datos) {\n if (datos.str > 0) {\n $(\"#pre_id\").val(datos.psug_id);\n fn_muestraDetallePreguntasPorEstado(0, grupos + 1, \"activo\");\n $(\"#opciones_estado label\").removeClass(\"active\");\n $(\"#check_activos\").addClass(\"active\");\n\n fn_validaNumeroRespuestas();\n $(\"#btnPsgGuardarCambios\").attr(\"onclick\", \"aceptar()\");\n $(\"#tabPreguntasSugeridas\").show();\n $(\"#tabRespuestas\").show();\n $(\"#tabPlusAsociados\").show();\n }\n $(\"#mdl_rdn_pdd_crgnd\").hide();\n });\n } else {\n fn_validaNumeroRespuestas();\n }\n } else {\n alertify.error(\"El número mínimo de respuestas no puede ser mayor al número máximo de respuestas\");\n }\n } else {\n alertify.error(\"Ingresar cantidad máxima de respuestas\");\n }\n } else {\n alertify.error(\"Ingresar cantidad mínima de respuestas\");\n }\n } else {\n alertify.error(\"Ingresar descripción de la pregunta en POS\");\n }\n } else {\n alertify.error(\"Ingresar descripción de la pregunta\");\n }\n}", "title": "" }, { "docid": "07054f72607e8bd293c47534efef2875", "score": "0.5883607", "text": "function prueba (req, res) {\n\n\t//Recuperamos el valor con el request.params\n\t//var nombre = req.params.nombre;\n\tif (req.params.nombre){\n\t\tvar nombre = req.params.nombre;\n\t} else {\n\t\tvar nombre = \"Sin Nombre\";\n\t}\n\n\t//Devolvemos un JSON\n\tres.status (200).send({\n\t\tdata: [2,3,4],\n\t\tmessage: \"Hola Mundo con NodeJS y Express - \" + nombre\n\t});\n}", "title": "" }, { "docid": "b2c7f09f56fd9b11bb42967c586e1bad", "score": "0.5843065", "text": "function respond(code, body, type) { // funzione che viene passata come callback alle funzioni che gestiscono i vari metodi per concludere una richiesta con una risposta.\n //argomenti passati: codice di stato HTTP | un corpo (messaggio) | e un tipo di contenuti (mime)\n if (!type) type = \"text/plain\";\n response.writeHead(code, {\"Content-Type\": type});\n // se il corpo è un flusso in lettura uso il metodo pipe per trasferire un flusso in lettura a uno in scrittura\n if (body && body.pipe)\n body.pipe(response);\n else // altrimenti se il corpo è null o una stringa lo ritorno al metodo end della risposta\n response.end(body);\n }", "title": "" }, { "docid": "0b395aeb77fbeb26483201a219f7538a", "score": "0.5837418", "text": "function processRequest(event) {\n console.log(event);\n console.log(marequete.readyState);\n console.log(marequete.status);\n // console.log(event);\n\n if (marequete.readyState == 4 && marequete.status == 200) {\n // var mareponse = marequete.response;\n var mareponseText = marequete.responseText;\n // parser la reponse texte en json \n mareponseText = JSON.parse(mareponseText);\n // appel la fonction bindlist avec la réponse en param\n\n // stocker le tableau dans la variable data\n data = mareponseText;\n data.forEach(function(eleve) {\n bindList(eleve);\n\n });\n // console.log(mareponse);\n }\n\n}", "title": "" }, { "docid": "862c6d8d62a0192e34f1fb0c16829491", "score": "0.5834838", "text": "function respuestasResponse(id){\n\n // Colocar las respuestas correctas siempre en el 'value1'\n var respuestasResponse = [];\n respuestasResponse[0] = { \n contenido:{ \n value1: 'A la hemoglobina presente en el tejido',\n value2: 'A la falta de luz en el fondo oceánico.',\n value3: 'Al tipo de clorofila de sus bacterias simbióticas',\n value4: 'A las mitocondrias presentes sus células.' } };\n\n respuestasResponse[1] = { \n contenido:{ \n value1: 'Ácido sulfhídrico (H2S)',\n value2: 'Dióxido de carbono (CO2)',\n value3: 'Glucosa (C6H12O6)',\n value4: 'Agua (H2O)' } };\n\n respuestasResponse[2] = { \n contenido:{ \n value1: 'En dos, oxidación de sustancias inorgánicas y fijación de CO2.',\n value2: 'En dos, reducción de sustancias inorgánicas y producción de CO2.',\n value3: 'En dos, reducción de compuestos orgánicos y producción de oxígeno.',\n value4: 'En dos, oxidación de compuestos orgánicos y producción de H2O.' } };\n\n respuestasResponse[3] = { \n contenido:{ \n value1: 'Bacterias simbióticas presentes en sus tejidos.',\n value2: 'Arqueas del ambiente circundante a la fuente hidrotermal.',\n value3: 'Células especializadas presentes en el tejido del anélido.',\n value4: 'Fitoplancton fotosintético del fondo oceánico.' } };\n\n respuestasResponse[4] = { \n contenido:{ \n value1: 'CO2 + O2 + 4H2S → CH2O + 4S + 3H2O',\n value2: '6CO2 + 6H2O -> C6H12O6 + 6O2',\n value3: 'C6H12O6 + 6O2 -> 6CO2 + 6H2O + ATP',\n value4: 'NH3 + O2 + 2H+ + 2e− → NH2OH + H2O' } };\n\n return respuestasResponse[id];\n\n }", "title": "" }, { "docid": "75da621e9086b682e7a3d14bc3a1e363", "score": "0.5821216", "text": "function home(request, respuesta) {\n respuesta.status(200).send({\n message: 'Hola mundo desde el servidor de NodeJs'\n });\n}", "title": "" }, { "docid": "aa8a3eacebb5a730ab76054a17cc9d96", "score": "0.58202964", "text": "respuestaTitulos(e){\n //console.log(e.detail.__data.response.items);\n this.datapeliculas = e.detail.__data.response.items;\n\n \n }", "title": "" }, { "docid": "39ae2b77cb2157119541ec73302f65e9", "score": "0.58169425", "text": "function VerificarCliente(){\n var datosC = new FormData(formulario);\n var url='../php/buscarCliente.php';\n fetch(url,{\n method: 'POST',\n body: datosC\n })\n .then( res => res.json())\n .then( data => {\n if(data==='no'){\n mensaje.innerHTML = `\n <div class=\"alert alert-danger\" role=\"alert\">\n EL CLIENTE NO EXISTE !!\n </div>\n `;\n mensaje.style.display='block';\n }else{\n for(let i=0; i<data.length; i++){\n alert(`Nombres : ${data[i].Nombres} Apellidos: ${data[i].Apellidos} Telefono: \n ${data[i].Celular} `);\n } \n }\n \n });\n}", "title": "" }, { "docid": "a5f448f381a41fc8cb70e5dc07248ba2", "score": "0.58003265", "text": "function responseHandler(resp) {\n // Set response var to the response we got back\n // This is so it remains accessable outside this scope\n response = resp;\n // Check for redirect\n // @TODO Prevent looped redirects\n if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) {\n // Change URL to the redirect location\n settings.url = response.headers.location;\n url = Url.parse(settings.url);\n // Set host var in case it's used later\n host = url.hostname;\n // Options for the new request\n var newOptions = {\n hostname: url.hostname,\n port: url.port,\n path: url.path,\n method: response.statusCode === 303 ? 'GET' : settings.method,\n headers: headers\n };\n \n // Issue the new request\n request = doRequest(newOptions, responseHandler).on('error', errorHandler);\n request.end();\n // @TODO Check if an XHR event needs to be fired here\n return;\n }\n \n response.setEncoding(\"utf8\");\n \n setState(self.HEADERS_RECEIVED);\n self.status = response.statusCode;\n \n response.on('data', function(chunk) {\n // Make sure there's some data\n if (chunk) {\n self.responseText += chunk;\n }\n // Don't emit state changes if the connection has been aborted.\n if (sendFlag) {\n setState(self.LOADING);\n }\n });\n \n response.on('end', function() {\n if (sendFlag) {\n // Discard the 'end' event if the connection has been aborted\n setState(self.DONE);\n sendFlag = false;\n }\n });\n \n response.on('error', function(error) {\n self.handleError(error);\n });\n }", "title": "" }, { "docid": "b2115117e327d02add4fa1bb1498c7ff", "score": "0.57986945", "text": "function cargarUsuarios(error,data){\n if(error==null){\n usuarios = JSON.parse(data); //Destr\n console.log(\"Los usurios registrados son\");\n console.log(usuarios);\n }else{\n console.log(error);\n response.end(error.toString());\n }\n}", "title": "" }, { "docid": "60441d8932915181011cb9bf7c73abae", "score": "0.5787573", "text": "function iniciar(response, url, method) {\r\n console.log(\"Manipulador de petición 'iniciar' ha sido llamado.\");\r\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n response.write(\"<h2>Meli Proxy</h2>\");\r\n response.end();\r\n}", "title": "" }, { "docid": "1a6a8588189a7b14f46871143b22bab2", "score": "0.5786177", "text": "function enviar_mensajes_chat( emisor, reseptor) {\n var url = \"servicios/chatServ.asmx/enviar_mensajes_chat\"\n var clave_chat;\n //creamos la clabe del chat\n if (reseptor != \"\")\n reseptor = reseptor;\n else\n reseptor = 0;\n if (emisor > reseptor)\n clave_chat = emisor + \"-\" + reseptor;\n else if (reseptor > emisor)\n clave_chat = reseptor + \"-\" + emisor;\n \n //variables a enviar\n var obj = {\n 'emisor': emisor,\n 'reseptor': reseptor,\n 'fecha': fechaCompleta(),\n 'hora': Tiempo1(),\n 'mensaje': obtener_texto(),\n 'clave_chat': clave_chat\n };\n\n $.post({\n type: \"POST\",//tipo a enviar\n async: false,\n cache: false,\n url: url,\n data:JSON.stringify(obj),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"post\",//tipo de datos.\n beforeSend: function () {//funcion que se ejecuta mientras hacemos la llamada.\n }//fin beforeSend.\n ,\n complete: function (response) {\n //response = JSON.stringify(response);\n respuesta = response.responseText;\n // console.log(response);//respuesta. responseText\n respuesta = JSON.parse(respuesta);\n //limpiamos la caja \n $('#caja_texto').val(\"\");\n\n }//fin complete\n });//fin de ajax\n\n return respuesta.d;\n\n}//fin", "title": "" }, { "docid": "0488822a8c01fe425aea8b4c768860b9", "score": "0.5783136", "text": "function success(data){\n\t\tconsole.log('Respuesta recibida del servidor....', data)\n\n\t\t/*Simulación de como podría ser la respuesta recibida por el servidor.*/\n\t\tdata = {ip: '123.123.123.123', port: 3000, user: 'pepe', 'password': '123456', scheme: 'http'}\n\n\t\t/*Aquí lanzamos un message através de Chrome, en nuestro caso lo recibe background.js que es el que tiene el listener creado.*/\n\t\tchrome.extension.sendMessage({ functions: 'setProxyOn', data: data });\n\t}", "title": "" }, { "docid": "a59809fd0b654e63cdd3c556bba8ed35", "score": "0.5783028", "text": "function iniciar(enrutar, controlador){\n function arrancarServidor(request, respuesta) {\n var rutaCapturada = url.parse(`http://localhost:8888${request.url}`);\n //console.log(`rutaCapturada = ${rutaCapturada.pathname}`);\n //console.log(`rutaCapturada = ${rutaCapturada.port}`);\n var ruta = rutaCapturada.pathname;\n //var contenido = enrutar(controlador, ruta, respuesta);\n enrutar(controlador, ruta, respuesta);\n\n //var page = fs.readFileSync()\n\n //crear un registro de los Request solicitados al servidor\n var registro = fs.createWriteStream('resgistro.txt',{'flags':'a'});\n registro.write(`ruta = ${ruta}. '\\n'`);\n //registro.write(`ruta = ${ruta} -- ${contenido}. '\\n'`);\n\n //console.log(\"Alguien se acaba de conectar a nuestro servidor\");\n /*respuesta.writeHead(200,{\"Content-Type\":\"text/html\"});\n respuesta.write(`<h1>${contenido}</h1>`);\n respuesta.end();*/\n }\n\n servidor.createServer(arrancarServidor).listen(8888);\n}", "title": "" }, { "docid": "75aa5945031864e45dda1fb851d9ba3c", "score": "0.57828486", "text": "function darDeBajaPromocion(id)\n{\nvar requerimiento = new RequerimientoGet();\nrequerimiento.setURL(\"verpromociones/ajax/darDeBajaPromocion.php\");\nrequerimiento.addParametro(\"id\",id);\nrequerimiento.addListener(respuestaDarDeBajaPromocion);\nrequerimiento.ejecutar();\n}", "title": "" }, { "docid": "c2e7db7174ea86b992471fa80cb60289", "score": "0.5779392", "text": "function obtenerRespuestas(id_leccion, id_estudiante) {\n return new Promise((resolve, reject) => {\n RespuestaModel.obtenerRespuestasDeEstudiante(id_leccion, id_estudiante, (err ,respues) => {\n if (err) return reject(new Error('No se puedo obtener Respuesta estudiante'));\n return resolve(respues);\n });\n });\n }", "title": "" }, { "docid": "c97ab291c7c3789fb2df9e54a8d582ec", "score": "0.57783276", "text": "function pipe(res){\n var body=\"\";\n res.on(\"data\",recibir);\n res.on(\"end\",terminar);\n function recibir(data){\n body+= data;\n }\n\n function terminar(data){\n response.end(body);\n }\n }", "title": "" }, { "docid": "cf82c53b68a87a9457cd36931112c60d", "score": "0.5774944", "text": "function responseFromServer()\n {\n if ( this.readyState == 4\n && this.status == 200\n )\n {\n let resp = this .responseText;\n if ($extraCback)\n { $extraCback (this, method, params)\n }\n }\n\t return;\n }", "title": "" }, { "docid": "d9d8139bd7f26a38d5ba4c19d23ee9d9", "score": "0.57594466", "text": "function handleResponse() {\n if (successfulRequest(this)) {\n var response = JSON.parse(this.responseText);\n console.log(response)\n }\n}", "title": "" }, { "docid": "ac001d251d6264554479b07105a50112", "score": "0.5757374", "text": "function fn_validaNumeroRespuestas() {\n var send;\n var validaNumeroDerespuestas = { \"validaNumeroDerespuestas\": 1 };\n var tipo = \"Todo\";\n send = validaNumeroDerespuestas;\n send.cdnNumeroRespuestas = $(\"#cdn_id\").val();\n send.psugNumero = $(\"#pre_id\").val();\n $.getJSON(\"../adminpreguntassugeridas/config_preguntassugeridas.php\", send, function(datos) {\n if (datos.str > 0) {\n if (datos.respuestasasociadas < datos.numero_maximo_respuestas) {\n fn_cargaPlusRespuesta(tipo);\n $(\"#txt_nombrerespuestanueva\").val(\"\");\n } else {\n alertify.error(\"<b>Alerta</b> Superó el límite de respuestas\");\n return false;\n }\n }\n });\n}", "title": "" }, { "docid": "d793f792522ededdb0ab0d94c123c2c4", "score": "0.5748152", "text": "function onRequest(request, response){\n\n\tconsole.log(\"USUARIO FEZ UM REQUEST EM: \" + request.url); // URL que foi acessada\n\n \t// Resposta do cliente\n\tresponse.writeHead(200, {\"Context-Type\" : \"text/plain\"} );\n\tresponse.write(\"printando dados\"); \n\tresponse.end(); \n\n}", "title": "" }, { "docid": "960c69ba0a248106fe0c685a7badc475", "score": "0.57422316", "text": "function almacenDeRespuestas(opcion){\r\n\tif(opcion == 1){\r\n\t\talert(\"La respuesta es SÍ. ;D\");\r\n\t\tdocument.write(\"La respuesta es SÍ. ;D\");\r\n\t\t}else if(opcion==2){\r\n\t\t\talert(\"La respuesta es NO. :(\");\r\n\t\t\tdocument.write(\"La respuesta es NO. :(\");\r\n\t\t\t}else if(opcion==3){\r\n\t\t\t\talert(\"La respuesta es PROBABLEMENTE. :'v \");\r\n\t\t\t\tdocument.write(\"La respuesta es PROBABLEMENTE. :'v \");\r\n\t\t\t\t}else if(opcion==4){\r\n\t\t\t\t\talert(\"La respuesta es TAL VEZ. :3\");\r\n\t\t\t\t\tdocument.write(\"La respuesta es TAL VEZ. :3\");\r\n\t\t\t\t\t}else if(opcion==5){\r\n\t\t\t\t\t\talert(\"La respuesta es DEFINITIVAMENTE NO. >.<!\");\r\n\t\t\t\t\t\tdocument.write(\"La respuesta es DEFINITIVAMENTE NO. >.<!\");\r\n\t\t\t\t\t\t}\r\n}", "title": "" }, { "docid": "39936dbf81fcee7f334e736ef7ff9c4c", "score": "0.5739882", "text": "function obtenerultimo_folio_chat() {\n var url = \"servicios/chatServ.asmx/obtenerultimo_folio_chat\"\n mi = id_usuario($('#nombre_usr_chat').text());\n\n var clave_chat;\n //creamos la clabe del chat\n if (mi > otro)\n clave_chat = mi + \"-\" + otro;\n else if (otro > mi)\n clave_chat = otro + \"-\" + mi;\n else\n clave_chat= \"0-0\"\n\n var obj = {\n 'folio': clave_chat\n }\n\n $.post({\n type: \"POST\",//tipo a enviar\n async: false,\n cache: false,\n url: url,\n data: JSON.stringify(obj),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"post\",//tipo de datos.\n beforeSend: function () {//funcion que se ejecuta mientras hacemos la llamada.\n }//fin beforeSend.\n ,\n complete: function (response) {\n //response = JSON.stringify(response);\n respuesta = response.responseText;\n // console.log(response);//respuesta. responseText\n respuesta = JSON.parse(respuesta);\n\n }//fin complete\n });//fin de ajax\n\n return respuesta.d;\n}", "title": "" }, { "docid": "8d12842dc4e2df3d3517dd4237a7efa9", "score": "0.5734575", "text": "function prueba (req, res) {\n res.status(200).send({\n message: 'Estas logueado!'\n })\n}", "title": "" }, { "docid": "466dd1b0882019fd0954778e13fa8ed1", "score": "0.57297605", "text": "function consultarDatos(contenedor)\n{\n\tvar formulario = document.forms[0];\n\tvar sUrl = formulario.action\n\tnew Request(\n\t{\n\t\tmethod:'post',\n\t\turl:sUrl,\n\t\tdata:formulario,\n\t\tonSuccess:function(html)\n\t\t{\n\t\t\tif(!$(contenedor))\n\t\t\t\talert('el contenedor no se definio')\n\t\t\telse\n\t\t\t$(contenedor).set('html',html)\n\t\t}\n\t}).send()\n}", "title": "" }, { "docid": "3b86ea1e38a6459756472320bd03c452", "score": "0.5729431", "text": "function GestorComunicacionServidor(URL){\n \n this.URL = URL;\n \n this.datos = \"\";\n \n /*\n * callbackFunction es una funcion que se encargara de tratar la respuesta que recibamos del servidor\n */\n this.enviarPeticion = function(callbackFunction){\n \n var peticion = new XMLHttpRequest();\n \n peticion.onreadystatechange = function(e){\n \n if(e.target.readyState === 4 && e.target.status === 200){\n callbackFunction(e.target);\n }\n \n };\n \n peticion.open(\"POST\", this.URL, true);\n peticion.send(this.datos);\n };\n \n}", "title": "" }, { "docid": "b1c318c27b3488521ccd7d7dad878343", "score": "0.5726634", "text": "async function contabaConElementos() {\n try {\n let res = await axios('controllers/questionaryController.php', {\n method: 'POST',\n data: {\n tipoPeticion: 'contabaConElementos',\n idInstitucion,\n nombreInstitucion,\n clasificacionInstitucion,\n anioInstitucion,\n }\n })\n resultado = res.data\n if (resultado[0] == 'success') {\n return resultado[1]\n } else if (resultado[0] == 'error') {\n alertify.error(resultado[1])\n } else {\n console.warn('Tipo de respuesta no definido. ' + resultado)\n }\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "2a151a9f7ceacd5ed849227356a88d99", "score": "0.5724937", "text": "function buscarCompetencias(req, res) {\n var sql = \"select * from competencia\"\n con.query(sql, function (error, resultado, fields) {\n if (error) {\n console.log(\"Hubo un error en la consulta\", error.message);\n return res.status(404).send(\"Hubo un error en la consulta de las competencias\");\n }\n var response = resultado\n\n res.send(JSON.stringify(response));\n });\n}", "title": "" }, { "docid": "7a610564118157f90b26392943f9fec8", "score": "0.572101", "text": "function doUsoMensajeria() {\n\t\t\n\t\t// Elementos necesarios para evitar CSFR\n\t\tvar token = $(\"meta[name='_csrf']\").attr(\"content\");\n\t\tvar header = $(\"meta[name='_csrf_header']\").attr(\"content\");\n\t\t\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\t// Elementos necesarios para evitar CSFR\n\t\t\tbeforeSend: function (request)\n {\n\t\t\t\tif(token){\n\t\t\t\t\trequest.setRequestHeader(header, token);\n\t\t\t\t}\n },\n\t\t\turl: \"/ejemplo01Web/samples/usoMensajeria.do\",\n\t\t\tsuccess: function(response){\n\t\t\t\tif(response.status == \"SUCCESS\"){\n\t\t\t\t\talert(\"Exito!! Por favor, revisa tus logs\");\n\t\t\t\t }else{\n\t\t\t\t\t alert(\"Error\");\n\t\t\t\t \n\t\t\t\t }\n\t\t\t },\n\t\t\t error: function(e){\n\t\t\t\t alert('Error: ' + e);\n\t\t }\n\t});\n}", "title": "" }, { "docid": "31cf81caacf88532c0879779fd2672a4", "score": "0.57198584", "text": "function cargarInmuebles(ordenarPor){\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n var q = \"ordenarPor=\"+ordenarPor;\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n var respuestaTexto = new XMLSerializer().serializeToString(respuesta);\n console.log(\"Cargar Inmuebles\");\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n\n var coincidencias = x[0].childNodes[0];\n \n if (coincidencias != null) {\n document.getElementById(\"titulo\").style.display = \"none\";\n for (i=0; i<x.length; ++i) {\n \n document.getElementById('box2').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n document.getElementById(\"titulo\").style.display = \"block\";\n document.getElementById('box2').innerHTML = '';\n document.getElementById(\"titulo\").innerHTML = 'No hay coincidencias';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n \n \n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarInmueblesCliente.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n \n}", "title": "" }, { "docid": "84240955c793b53e2541dc5b55b03b13", "score": "0.5713709", "text": "function handlerMensaje (data) {\n mensajes.push(data)\n var html = plantilla({\n 'mensajes': mensajes\n })\n $('#mensajes').html(html)\n }", "title": "" }, { "docid": "5d38fe4d250dffa1e4ca0a4bfd830641", "score": "0.5712808", "text": "function cor_resposta(res) {\n if (res == \"ACERTO\") {\n return fill(verde);\n } else {\n return fill(vermelho);\n }\n}", "title": "" }, { "docid": "6df408c9f94b4f405a2e6b19e31a48f4", "score": "0.5711966", "text": "function obtener_empresa(id){\n var opc = \"obtener_empresa\";\n $('.preloader').show();\n $.post(\"dist/fw/equipamiento.php\",{'opc':opc, 'id':id},function(data){\n if(data){\n limpia_formulario()\n $('#Empresa').show();\n $('#Empresa').text(data.RazonSocial);\n $('#idEmpresa').text(data.ClaveEmpresa);\n obtener_contactos(id);\n }\n else\n {\n alerta_error(\"Error\", \"Error al recibir los datos\");\n }\n $('.preloader').hide();\n },'json');\n}", "title": "" }, { "docid": "3c7c538c442e045282839908f819a0f8", "score": "0.5697178", "text": "_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.from,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n log.log('RESPONSE-EVENT: ', event);\n _this._onResponseHandler(event);\n }\n }", "title": "" }, { "docid": "ba57b4dc0b971f1442f3dd1a1b07b35d", "score": "0.5687501", "text": "async function postTurnosApi(e){ // manda a la api seccion reservas los datos insertados en el formTurnos\n e.preventDefault(); \n let formData = new FormData(formTurnos); \n \n let name = formData.get('name');\n let email = formData.get('email');\n let phone = formData.get('telefono');\n \n\n let turno = {\n \"name\" : name,\n \"email\" : email,\n \"phone\" : phone,\n \n } \n \n try{ \n console.log(turno);\n let res = await fetch(`${url}reservas`,{\n \"method\":\"POST\",\n \"headers\":{\"Content-type\":\"application/json\"},\n \"body\":JSON.stringify(turno)\n });\n if( res.status === 201){ \n alert(\"Enviado nuevo turno\"); \n }\n else{\n alert(\"Respues NO OK obtener turnos\") \n }\n \n }\n \n catch(error){\n alert(\"ERROR CATCH POST TURNOS\");\n }\n }", "title": "" }, { "docid": "b9c072df90b5b62d5fe746d7b1665ce5", "score": "0.5682495", "text": "postApi({ruta, objeto}){\n axios.post(\"/\" + ruta, objeto)\n .then(function(response){\n console.log(\"RECURSO AÑADIDO\");\n let añadido = true;\n })\n .catch(function(error){\n console.log(error);\n })\n }", "title": "" }, { "docid": "fa2fb41eda2dec0822e2af9d1cdcccf6", "score": "0.56815857", "text": "function processDenounce()\r\n{\r\n\ttry\t{\r\n\t\t\r\n\t//Intentamos levantar la respuesta Xml\r\n\tvar xml = reques.responseXML;\r\n\t\t\r\n\t//var messageType = xml.getElementsByTagName(\"type\")[0].childNodes[0].nodeValue;\r\n\t \r\n\t\r\n\t//trae el mensaje que devolvió el request al servlet\r\n\t//if(messageType==VALIDATED_MESSAGE) {\r\n \t document.getElementById('rcontent').innerHTML = xml.getElementsByTagName(\"content\")[0].childNodes[0].nodeValue;\r\n \t readjustContent();\r\n \t//}\r\n \t\r\n \t//Si el tipo es warning muestra un error de campo ej. error en captcha.\r\n \t/*\r\n \telse if (messageType==ERROR_MESSAGE) {\r\n \t\twarning = document.getElementById('errWarning');\r\n \t\twarning.style.display=\"block\";\r\n \t\twarning.innerHTML = xml.getElementsByTagName(\"message\")[0].childNodes[0].nodeValue;\r\n \t}\r\n \t*/ \t\r\n\t}\r\n\t//Si no volvio un Xml es que ocurrio una exception no controlada, mostramos la pantalla de error.\r\n\tcatch(e) { \r\n \tdocument.body.innerHTML = reques.responseText;\r\n }\r\n}", "title": "" }, { "docid": "1a9ab5c95c5d20904994ce037718d874", "score": "0.5678658", "text": "function recieveRequestHandler(req, res){\n res.writeHead(200, {\"Content-Type\": \"text/html\"}); // sets the header of the response\n let body = [];\n req.on('data', function(part) { // this part picks up the bitstream of bodydata and appends to the body array.\n body.push(part);\n }).on('end', () => { //when the body has been colleceted this callback is called.\n body = JSON.parse(Buffer.concat(body).toString()); // the body is converted to String and then a javascript object.\n database.getFromDatabase(body, connection).then((value) => { // gets the best matching note and configures the callback for the promise returned\n res.write(value); // then the response object writes the best matching note\n console.log(value);\n res.end();\n });\n });\n}", "title": "" }, { "docid": "810b9eed6fd8699428c402105300ef82", "score": "0.5678312", "text": "processVideotecaData(respuesta) {\n // Se añade datos extra a la respuesta obtenida del servidor\n \n var res = JSON.parse(respuesta);\n var datos = res.data;\n for (var i = 0; datos != undefined && i < datos.length; i++) {\n // Se añaden las imágenes de la columna 5, que permiten acceder a la edición, borrado y fotografías del álbum\n var idVideoteca = datos[i][0];\n\n var publico = \"NO\";\n if (datos[i][3] == 1) {\n publico = \"SI\";\n }\n datos[i][3] = publico;\n var opciones = videotecaAdminTablaFacade.imgAccessVideos(idVideoteca) + \"&nbsp;\" + videotecaAdminTablaFacade.imgUploadVideo(idVideoteca) + \"&nbsp;\" + videotecaAdminTablaFacade.imgEditVideoteca(idVideoteca) + \"&nbsp;\" + videotecaAdminTablaFacade.imgDeleteVideoteca(idVideoteca);\n datos[i].push(opciones);\n\n } // for\n res.data = datos;\n return JSON.stringify(res);\n }", "title": "" }, { "docid": "571a54620c901a5d91028a4cc53116f4", "score": "0.567773", "text": "function gotContactos (err, contactos) {\n if (err) {\n console.log(err)\n return next()\n }\n\n return res.json(contactos);\n }", "title": "" }, { "docid": "eb5bb9701694a3b2727186fc9201d126", "score": "0.5676611", "text": "function processRequest_ventas() {\n \n if (req.readyState == 4) {\n \n if (req.status == 200) {\n \n var doc_el = req.responseXML.documentElement;\n var important = get_element(doc_el, \"important\", 0);\n var url = get_element(doc_el, \"url\", 0);\n var message = get_element(doc_el, \"foundMatch\", 0);\n var messagePrev = get_element(doc_el, \"foundPrevious\", 0);\n //alert(\"responseText\\n>\" + req.responseText + \"<\");\n //alert(url);\n url = replaceCharacteres(url, '-', '&'); \n \n if (important == 'si') {\n window.location.href = url; \n } else {\n\t if (messagePrev == 'true') {\n\t alert('Esta caja ya ha sido agregada a una venta anterior o no se encuentra en inventario.'); \n\t focusText();\n\t } else {\n\t if (message == 'false') {\n\t\t alert('No se pudo agregar la caja debido a que no hacen match.');\n\t\t focusText();\n\t\t } else {\n\t\t location.reload();\n\t\t } \n\t }\n\t }\n \n //var message = req.responseXML.getElementsByTagName(\"valid\")[0].childNodes[0].nodeValue; \n //setTable(\"tableContent\");\n // If the user entered value is not valid, do not allow the user to\n // click submit button.\n var submitBtn = document.getElementById(\"submit_btn\");\n if (message == \"false\") {\n submitBtn.disabled = true;\n } else {\n submitBtn.disabled = false;\n }\n }\n }\n }", "title": "" }, { "docid": "c6a4bcf90cce56eac07f5e063030d553", "score": "0.56735855", "text": "function recargar(){\n var peticion= new XMLHttpRequest();\n peticion.onreadystatechange=function(){\n if (this.readyState==4) {\n document.getElementById('cuerpo').innerHTML=this.responseText;\n asignarEventos();\n }\n };\n\n peticion.open('GET','usuarios/recargar');\n peticion.send();\n}", "title": "" }, { "docid": "51719418c9f256380f1086abb54f3026", "score": "0.56628007", "text": "function usuarioPredefinido(data) {\n var arrRQ = [];\n var datas = null;\n var usuRQ1 = new XMLHttpRequest();\n usuRQ1.open(\"POST\", \"https://api.trello.com/1/cards/\" + data + \"/idMembers?value=\" + usuario1 + \"&key=\" + appkey + \"&token=\" + token);\n usuRQ1.send(datas);\n var usuRQ2 = new XMLHttpRequest();\n usuRQ2.open(\"POST\", \"https://api.trello.com/1/cards/\" + data + \"/idMembers?value=\" + usuario2 + \"&key=\" + appkey + \"&token=\" + token);\n usuRQ2.send(datas);\n arrRQ.push(usuRQ1);\n\n usuRQ1.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n var finalizado = true;\n for (let i = 0; i < arrRQ.length; i++) {\n if (arrRQ[i].readyState !== this.DONE) {\n finalizado = false;\n }\n }\n if (finalizado == true && archivos.length == 0) {\n spiner.style = 'display:none';\n $(\"#mensajeModal\").modal();\n var close = document.getElementById('close');\n close.addEventListener('click', function () {\n location.reload();\n }, false)\n }\n }\n });\n}", "title": "" }, { "docid": "9c367ea9c82648c92b521549f63be01c", "score": "0.56543463", "text": "function cambiarStatusTrabajo(id, estatus)\n{\n\tvar v = new XMLHttpRequest();\n var url = 'http://auto-red.wc.lt/servicios/cambiarstatustrabajo.php?id=' + id + '&estatus=' + estatus;\n\tv.open('GET', url, true);\n\tv.send();\n\tv.onreadystatechange = function()\n\t{\n\t\tif (v.status == 200 & v.readyState == 4)\n\t\t{\n\t\t\tvar respuestaJSON = JSON.parse(v.responseText);\n\t\t\talert(respuestaJSON.mensaje);\n\t\t\tcargarTrabajos2();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ce840824764432f98a2c7f1fef122767", "score": "0.56465757", "text": "function apiHandler(response) {\n if (requestSender.readyState === 4 && requestSender.status === 200) {\n console.log(response.target.response)\n }\n}", "title": "" }, { "docid": "a6a6696cd5c734993f43830c575fc3a6", "score": "0.5641845", "text": "function ajaxHandler2(){\n\n fetch('http://jsonplaceholder.typicode.com/posts', {\n method: 'POST',\n body: JSON.stringify({\n usuario: \"Alejandro\",\n password: 1234,\n userId: 123\n }),\n headers:new Headers({\n 'Content-Type':'application/json'\n })\n }).then(function(response) { \n //Gestión de la respuesta \n return response.json();\n }).then(function(datos){\n console.log(datos);\n alert(\"Se ha añadido a usuario \"+datos.usuario);\n });\n}", "title": "" }, { "docid": "e7e360b2515eba0ea9a229c438dbd3c4", "score": "0.5641032", "text": "function limpiarBusqueda () {\n var xhr = new XMLHttpRequest();\n var existeRespuesta = new Boolean (false);\n var q = \"ordenarPor=No\";\n history.replaceState({}, null, \"http://localhost:8888/Sistema-Inmobiliaria/html/inventario.html\");\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status==200){\n var respuesta = xhr.responseXML;\n var respuestaTexto = new XMLSerializer().serializeToString(respuesta);\n console.log(\"Cargar Inmuebles\");\n console.log(xhr.responseXML);\n x = respuesta.getElementsByTagName('resultado');\n \n if (respuesta != null){\n existeRespuesta = true;\n } else {\n existeRespuesta = false;\n }\n \n if (existeRespuesta == true){\n xs = new XMLSerializer();\n\n var coincidencias = x[0].childNodes[0];\n \n if (coincidencias != null) {\n document.getElementById(\"titulo\").style.display = \"none\";\n document.getElementById('box2').innerHTML = '';\n for (i=0; i<x.length; ++i) {\n \n document.getElementById('box2').innerHTML += xs.serializeToString(x[i]) + '\\n<br />\\n';\n }\n } else {\n document.getElementById(\"titulo\").style.display = \"block\";\n document.getElementById('box2').innerHTML = '';\n document.getElementById(\"titulo\").innerHTML = 'No hay coincidencias';\n }\n } else {\n alert(\"Error de conexion con la base de datos\");\n }\n \n \n }\n }\n\n xhr.open(\"POST\", \"http://localhost:8888/cgi-bin/Sistema-Inmobiliaria/mostrarInmueblesCliente.pl\", true);\n xhr.setRequestHeader(\n 'Content-type', \n 'application/x-www-form-urlencoded'\n ); \n xhr.responseType = \"document\";\n xhr.send(q);\n \n}", "title": "" }, { "docid": "df2280e84cd1c7340baaee00d38e9f38", "score": "0.56361103", "text": "function getResponse(objectReturnId,url,classname,loadphrase) {\n\t//Carregando...\n\tvar recebe = document.getElementById(objectReturnId);\n\trecebe.innerHTML = loadphrase;\n\t\n //Adiciona à fila\n fila[fila.length]=[objectReturnId,url];\n //Se não há conexões pendentes, executa\n if((ifila+1)==fila.length)getResponseRun();\t\n}", "title": "" }, { "docid": "f624bc4a82b9ca1f042637efef23dd1d", "score": "0.56344205", "text": "function requestHandler(req, res) {\n console.log(\"Request recieved\");\n console.log(req.url);\n //console.log(req.headers);\n //console.log(req.connection);\n if(req.method == \"POST\" && req.url == \"/quiteasy\") {\n var body = '';\n\n req.on('data', (chunk) => {\n body += chunk.toString();\n });\n\n req.on('end', () => {\n //var data = queryString.parse(body);\n try {\n var data = JSON.parse(body);\n } catch (err) {\n replyUnableToParseData(res, err);\n }\n\n if(data['function'] == undefined) {\n replyNoFunction(res)\n return;\n } \n\n switch(data['function']) {\n case 'login':\n handleLogin(req, res, data);\n return;\n case 'signup':\n handleSignup(req, res, data);\n return;\n case 'getSelfCampagins':\n handleSelfCampagins(req, res, data);\n return;\n case 'getOtherCampgains':\n handleOtherCampagins(req, res, data);\n return;\n case 'getFriends':\n handleGetFriends(req, res, data);\n return;\n case 'sendMessage':\n handleSendMessage(req, res, data);\n return;\n case 'getMessage':\n handleGetMessage(req, res, data);\n return;\n default:\n replyUnsupportedFunction(res);\n }\n });\n } else {\n res.statusCode = 400;\n res.end(\"unsupported\");\n }\n}", "title": "" }, { "docid": "6f1077c4745e1636704ac9c35f3af63e", "score": "0.5627753", "text": "function reqListener () {\n // console.log('this: ', this);\n const data = JSON.parse(this.responseText);\n console.log('result: ', data[2]);\n }", "title": "" }, { "docid": "8483f0e44a9be9ae88024747a0668279", "score": "0.562741", "text": "finish () {\n function onServerPreResponseHandler (err, value) {\n const self = this\n\n // check if an error was already catched\n if (self._response.error) {\n self.emit('serverResponseError', self._response.error)\n self.log.error(self._response.error)\n } else if (err) { // check for an extension error\n let error = new Errors.HemeraError(Constants.EXTENSION_ERROR).causedBy(err)\n self.emit('serverResponseError', error)\n self._response.error = error\n self.log.error(self._response.error)\n }\n\n // reply value from extension\n if (value) {\n self._response.payload = value\n }\n\n // create message payload\n self._buildMessage()\n\n // indicates that an error occurs and that the program should exit\n if (self._shouldCrash) {\n // only when we have an inbox othwerwise exit the service immediately\n if (self._replyTo) {\n // send error back to callee\n return self._transport.send(self._replyTo, self._message, () => {\n // let it crash\n if (self._config.crashOnFatal) {\n self.fatal()\n }\n })\n } else if (self._config.crashOnFatal) {\n return self.fatal()\n }\n }\n\n // reply only when we have an inbox\n if (self._replyTo) {\n return this._transport.send(this._replyTo, self._message)\n }\n }\n\n this._extensions.onServerPreResponse.invoke(this, onServerPreResponseHandler)\n }", "title": "" }, { "docid": "6d2b9dce38b0747dae172b0a88ab10a4", "score": "0.5623947", "text": "function response(){\n if(auxiliar === \"true\" && asistio === \"false\") {\n return ingreso(true,false,nombre,doc_identidad);\n }\n else if(auxiliar === \"true\" && asistio === \"true\"){\n return ingreso(true,true,nombre,doc_identidad);\n }\n else{\n return ingreso(false,false,nombre,doc_identidad);\n }\n }", "title": "" }, { "docid": "6d2b9dce38b0747dae172b0a88ab10a4", "score": "0.5623947", "text": "function response(){\n if(auxiliar === \"true\" && asistio === \"false\") {\n return ingreso(true,false,nombre,doc_identidad);\n }\n else if(auxiliar === \"true\" && asistio === \"true\"){\n return ingreso(true,true,nombre,doc_identidad);\n }\n else{\n return ingreso(false,false,nombre,doc_identidad);\n }\n }", "title": "" }, { "docid": "ed534940dc6f6b2b9b80794dd57186d2", "score": "0.56131256", "text": "handleResponse(data) {\n this.responseHandler(data);\n }", "title": "" }, { "docid": "4c2d7bc9bb8c3a5eb13e12291fe583b8", "score": "0.5612522", "text": "function sessionResponseHandler(res){\n\tres.on('data', resDataPiper);\n\tres.on('end', resSessionFinalizer);\n}", "title": "" }, { "docid": "8c2c4dcaf554626e82861d32dbbb66ef", "score": "0.5611163", "text": "function handleSuccess(res) {\n\n return res.data;\n }", "title": "" }, { "docid": "9d313c5ab98d5c174637d5ff2a0f4ee3", "score": "0.5610219", "text": "_mandar(){\n this.xmlhttp.onreadystatechange = this._verificar.bind(this);\n if(this.parametro != \"\"){\n this.xmlhttp.open(\"POST\", this.url, true);\n this.xmlhttp.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded;charset=UTF-8\");\n this.xmlhttp.send(this.parametro);\n }\n }", "title": "" }, { "docid": "446240397d6914ba97a3c3f5daeb602b", "score": "0.5608777", "text": "function serachProcesoorigen() {\n var getData = \"\";\n var url = route + \"/api/ProcesoOrigen/SearchAll\";\n //var dataToPost = JSON.stringify(clave);\n var Mensaje = Common.sendRequestJson('POST', url, undefined, undefined, false);\n if (Mensaje.resultado === null) {\n alert(\"No object\");\n } else {\n addProcesoOrigen(Mensaje.resultado);\n }\n\n}", "title": "" }, { "docid": "1c3e5abf503b40960324c177230eac96", "score": "0.5608573", "text": "function inicio() {\r\n /*le asignamos un evento al boton y lo que tiene que hacer */\r\n var datos = new FormData();\r\n datos.append(\"accion\", \"IniciarSesion\");\r\n fetch(controlador,{\r\n method:\"POST\",\r\n body:datos}).then(res => res.json())\r\n .then(data =>\r\n {\r\n if (data.error === 'error') {\r\n window.location.href = dir_index;\r\n } else if (data.usuario.length > 0) {\r\n ref_a[1].addEventListener(\"click\", mostrartabla);/*le asignamos un evento al boton y lo que tiene que hacer */\r\n ref_a[2].addEventListener(\"click\", desplegaruno);\r\n ref_a[5].addEventListener(\"click\", desplegardos);\r\n ref_a[7].addEventListener(\"click\", mostrarFormRconsumo);\r\n ref_a[10].addEventListener(\"click\", desplegartres);\r\n ref_a[11].addEventListener(\"click\", mostrarFormRPA);\r\n ref_a[14].addEventListener(\"click\", desplegarcuatro);\r\n ref_a[18].addEventListener(\"click\", cerrarSesion);\r\n }\r\n }\r\n );\r\n}", "title": "" } ]
6b1a70e02fcdfcb70370ff7ef3130000
GetCardInfo gets the cloze, fullText, and partial text for each cloze card
[ { "docid": "313290519fd9d655707ddda43304a7ca", "score": "0.7603544", "text": "function GetCardInfo()\n{\n\tvar ctn=0;\n\tvar g,h;\n\n\t//loops through the entire array\n\twhile(ctn<clozeCardArr.length)\n\t{\n\t\t//gets the full text of the current cloze card\n\t\tg=clozeCardArr[ctn].fullText;\n\t\t//gets the cloze text of the current cloze card\n\t\th=clozeCardArr[ctn].cloze;\n\t\t//if the full text includes the cloze text and the cloze text doesn't include is, then print out the full text, cloze text, and the partial text\t\t\n\t\tif(g.includes(h)&&(!(h).includes(\"is\")))\n\t\t{\n\t\t\tclozeCardArr[ctn].partial();\n\t\t\tconsole.log(g);\n\t\t\tconsole.log(h);\n\n\t\t}\n\t\t//else print out an error message stating that the cloze is not within the full text\n\t\telse\n\t\t{\n\t\t\tconsole.log(\"Error! Cloze is not in the text!\");\n\t\t}\n\t\tconsole.log(\"------------------------------\");\n\t\tctn++;\n\t}\n\n}", "title": "" } ]
[ { "docid": "0eaedd6930d21ca790f6ac551ffc3051", "score": "0.66735965", "text": "showCardInfo() {\n rectMode(CENTER);\n fill(0);\n textSize(30 * this.scalar);\n text(this.cardCost, this.x - 3/10 * this.width * this.scalar, this.y - 53/150 * this.height * this.scalar);\n textSize(18 * this.scalar);\n text(this.cardName, this.x, this.y - 1/5 * this.height * this.scalar, 100 * this.scalar, 40 * this.scalar);\n textAlign(LEFT);\n text(this.cardText, this.x, this.y + 1/5 * this.height * this.scalar, this.width/2 * this.scalar + 50 * this.scalar, this.height/2 * this.scalar - 35 * this.scalar);\n textAlign(CENTER);\n }", "title": "" }, { "docid": "5c8d7f4ba42d5cecb88477ba61d4db1a", "score": "0.64542574", "text": "function ClozeCard(text, cloze) {\n\tthis.fullText = text,\n\tthis.cloze = cloze\n\n\tthis.partial = function() {\n\t\tif (this.fullText.includes(this.cloze)) {\n\t\t\tconsole.log(this.fullText.replace(this.cloze))\n\t\t} else {\n\t\t\tconsole.log(brokenCloze)\n\t\t}\n\t};\n\n\tthis.displayPartial = function() {\n\t\tconsole.log(this.partial);\n\t}\n\tthis.displayFull = function() {\n\t\tconsole.log(this.fullText);\n\t}\n}", "title": "" }, { "docid": "83bd4d9e85b8d7f25755762fff8ea9b5", "score": "0.6333833", "text": "function showInfoDiv(card) {\n const id = card.find(\".card-title\").html()\n const { pic, usdRate, eurRate, ilsRate } = coinsState[id]\n const infoDiv = card.find(\".info-div\")\n infoDiv.css({ display: \"flex\" });\n infoDiv.find(\"img\").attr({ \"src\": pic })\n infoDiv.find(\"#usd\").html(`usd: ${usdRate}`)\n infoDiv.find(\"#eur\").html(`eur: ${eurRate}`)\n infoDiv.find(\"#ils\").html(`ils: ${ilsRate}`)\n card.find(\".more-info\").html(\"Hide Info\")\n}", "title": "" }, { "docid": "4270720c544b3ac6893423772e6ed1cc", "score": "0.6214584", "text": "function clozeCard (text, cloze) {\n\n //for the cloze arguement\n this.fullText = text;\n\n this.cloze = cloze;\n\n this.partial = text.replace(cloze, \"...\");\n\n} // Cloze Card Constructor CLOSE", "title": "" }, { "docid": "19df96264acc89d04dd1e44d10b7f559", "score": "0.6206786", "text": "function buildExtraInfoCards () {\n getData();\n processData();\n document.getElementById('extra_matchedCalls').innerHTML = extra_matchedCalls;\n document.getElementById('extra_notMatchedCalls').innerHTML = extra_notMatchedCalls;\n document.getElementById('extra_bookings').innerHTML = extra_bookings;\n document.getElementById('extra_notBooked').innerHTML = extra_notBooked;\n document.getElementById('extra_dropped').innerHTML = extra_dropped;\n}", "title": "" }, { "docid": "f2dec3ba5b7e26061d7ea6abaeff8029", "score": "0.617065", "text": "function ClozeCard(fullText, cloze, partial) {\n if (fullText.search(cloze) !== -1) {\n this.fullText = fullText;\n this.cloze = cloze;\n this.partial = this.fullText.split(this.cloze).join(\"...\");\n this.displayCard = function() {\n console.log(\"Cloze: \" + cloze);\n console.log(\"Partial: \" + partial());\n console.log(\"Full Text: \" + fullText);\n }\n //if it can not find the cloze in the full text. \n } else {\n return \"hmm... I cant seem to find that in the text - remember this has to be an exact match! Try again.\";\n }\n}//closes ClozeCard constructor", "title": "" }, { "docid": "53fbad104ff1024f598eb68e0aecc7f7", "score": "0.6127479", "text": "function cardDetails(data){\r\n card = data;\r\n var newDescription;\r\n var list=\"\";\r\n if(card.img != null){\r\n $('#img').prepend(\"<img id='cardImage' src='\" + card.img + \"'/>\")\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"260px\";\r\n }\r\n if(card.issuer_name == \"Wells Fargo\" && card.img != null){\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"280px\";\r\n }else if(card.issuer_name == \"Citi\" && card.img == null){\r\n $('#img').prepend(\"<img id='cardImage' src='/images/citiicon.png'/>\")\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"260px\";\r\n }else if(card.issuer_name == \"Discover\" && card.img == null){\r\n $('#img').prepend(\"<img id='cardImage' src='/images/discover.png'/>\")\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"260px\";\r\n }else if(card.issuer_name == \"Bank of America\" && card.img == null){\r\n $('#img').prepend(\"<img id='cardImage' src='/images/boa.png'/>\")\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"260px\";\r\n }else if(card.issuer_name == \"American Express\" && card.img == null){\r\n $('#img').prepend(\"<img id='cardImage' src='/images/am.png'/>\")\r\n document.getElementById(\"cardImage\").style.height = \"160px\";\r\n document.getElementById(\"cardImage\").style.width = \"260px\";\r\n }\r\n // }else{\r\n // document.getElementById(\"cardImage\").style.height = \"160px\";\r\n // document.getElementById(\"cardImage\").style.width = \"260px\";\r\n // }\r\n $('#nameOfCard').text(card.name.toUpperCase())\r\n //$('#issuerName').append(\"Offered by: \" + card.issuer_name)\r\n $('#PNN').text(card.payment_network_name)\r\n\r\n\r\n if(card.issuer_name == \"Chase\" || card.issuer_name == \"Capital One\" || card.issuer_name == \"Barclays\" || card.issuer_name == \"Bank of America\" || card.issuer_name == \"Citi\" || card.issuer_name == \"Discover\" || card.issuer_name == \"American Express\"){\r\n document.getElementById(\"issuerName\").style.position = \"relative\";\r\n document.getElementById(\"issuerName\").style.left = \"382px\";\r\n document.getElementById(\"issuerName\").style.bottom = \"132px\";\r\n document.getElementById(\"PNN\").style.position = \"relative\";\r\n document.getElementById(\"PNN\").style.left = \"382px\";\r\n document.getElementById(\"PNN\").style.bottom = \"108px\";\r\n }else if (card.issuer_name == \"Wells Fargo\") {\r\n document.getElementById(\"issuerName\").style.position = \"relative\";\r\n document.getElementById(\"issuerName\").style.left = \"401px\";\r\n document.getElementById(\"issuerName\").style.bottom = \"133px\";\r\n document.getElementById(\"PNN\").style.position = \"relative\";\r\n document.getElementById(\"PNN\").style.left = \"401px\";\r\n document.getElementById(\"PNN\").style.bottom = \"108px\";\r\n }\r\n // Apply Now & Offered by:\r\n if(card.issuer_name == \"Chase\"){\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"https://www.chase.com/digital/resources/about-chase\\\" >Chase</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://creditcards.chase.com/credit-cards/browse-all?HT5N=Y71UH0&iCELL=61FY&jp_ltg=chsecate_allcards', '_blank')\r\n })\r\n }else if (card.issuer_name == \"Capital One\") {\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"https://www.capitalone.com/about\\\" >Capital One</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://www.capitalone.com/credit-cards/compare/', '_blank')\r\n })\r\n }else if (card.issuer_name == \"Barclays\"){\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"https://www.home.barclays/about-barclays.html\\\" >Barclays</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://home.barclaycardus.com/cards.html', '_blank')\r\n })\r\n }else if (card.issuer_name == \"Bank of America\") {\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"http://about.bankofamerica.com/en-us/index.html#fbid=wGMAEyiZSww\\\" >Bank of America</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://www.bankofamerica.com/credit-cards/#filter', '_blank')\r\n })\r\n }else if (card.issuer_name == \"Wells Fargo\") {\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"https://www.wellsfargo.com/about/\\\" >Wells Fargo</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://www.wellsfargo.com/credit-cards/find-a-credit-card/all/', '_blank')\r\n })\r\n }else if (card.issuer_name == \"Citi\") {\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"http://www.citigroup.com/citi/about/citi_at_a_glance.html\\\" >Citi</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://www.citi.com/credit-cards/compare-credit-cards/citi.action?ID=view-all-credit-cards', '_blank')\r\n })\r\n }else if(card.issuer_name == \"Discover\"){\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"https://www.discover.com/company/our-company/\\\" >Discover</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://www.discover.com/credit-cards/#card-options-content', '_blank')\r\n })\r\n }else if (card.issuer_name == \"American Express\") {\r\n $(\"#issuerName\").append(\"Offered by: \" + \" <a href=\\\"http://about.americanexpress.com/\\\" >American Express</a> \")\r\n $('#applyButton').click(function(){\r\n window.open('https://card.americanexpress.com/american-express/?s_clid=94eb7b9a2d10144b82d7fad0f9fafde1&gclid=Cj0KEQjwuOHHBRDmvsHs8PukyIQBEiQAlEMW0KD9_MuXifHEisq-6ICbVu06kOrkSgWtLuKjC7BSUSsaAuvr8P8HAQ', '_blank')\r\n })\r\n }\r\n // Three arrow button on top\r\n $('#backButton').click(function goBack(){\r\n const prevID = card.id-1;\r\n window.location.href = \"card.html?\" + prevID;\r\n })\r\n\r\n $('#downButton').click(function goDetails(){\r\n window.scrollTo(0,document.body.scrollHeight)\r\n })\r\n\r\n $('#rightButton').click(function goForward(){\r\n const nextID = card.id+1;\r\n window.location.href = \"card.html?\" + nextID;\r\n })\r\n\r\n function goBack(){\r\n const prevID = card.id-1;\r\n window.location.href = \"card.html?\" + prevID;\r\n };\r\n\r\n function goForward(){\r\n const nextID = card.id+1;\r\n window.location.href = \"card.html?\" + nextID;\r\n };\r\n\r\n function goDetails(){\r\n window.scrollTo(0,document.body.scrollHeight)\r\n };\r\n\r\n $(document).keydown(function(e) {\r\n switch(e.which) {\r\n\r\n case 37: // left\r\n goBack();\r\n break;\r\n\r\n case 39: // right\r\n goForward();\r\n break;\r\n\r\n case 40:\r\n goDetails();\r\n break;\r\n\r\n default: return; // exit this handler for other keys\r\n }\r\n e.preventDefault(); // prevent the default action (scroll / move caret)\r\n });\r\n // End of three arrow button\r\n\r\n // Detials of card section\r\n newDescription = card.description.split(\"|\");\r\n newDescription.forEach(item => {\r\n list = list + \"<li>\" + item + \"</li>\";\r\n });\r\n $('#descriptionOfCard').prepend(list)\r\n\r\n // Card Feature Section\r\n if(card.min_score != 0){\r\n if(card.min_score >= 720 && card.min_score <= 850){\r\n $('#cpminScore').append(\"<h4>Minimum Credit Score</h4>\" + \"\\n\" + '<span>' + card.min_score + '</span>' + \" | Excellent\")\r\n document.getElementById(\"cpminScore\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else if (card.min_score >= 690 && card.min_score <= 719) {\r\n $('#cpminScore').append(\"<h4>Minimum Credit Score</h4>\" + \"\\n\" + '<span>' + card.min_score + '</span>' + \" | Good\")\r\n document.getElementById(\"cpminScore\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else if (card.min_score >= 630 && card.min_score <= 689) {\r\n $('#cpminScore').append(\"<h4>Minimum Credit Score</h4>\" + \"\\n\" + '<span>' + card.min_score + '</span>' + \" | Average\")\r\n document.getElementById(\"cpminScore\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else if (card.min_score >= 350 && card.min_score <= 629) {\r\n $('#cpminScore').append(\"<h4>Minimum Credit Score</h4>\" + \"\\n\" + '<span>' + card.min_score + '</span>' + \" | Poor\")\r\n document.getElementById(\"cpminScore\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n }\r\n\r\n if(card.cash_back != 0){\r\n $('#cpcashBack').append(\"<h4>Cash Back</h4>\" + \"\\n\" + '<span>' + card.cash_back + '</span>' + \"%\")\r\n document.getElementById(\"cpcashBack\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.travel != 0){\r\n $('#cptravel').append(\"<h4>Travel</h4>\" + \"\\n\" + '<span>' + card.travel + '</span>' + \"%\")\r\n document.getElementById(\"cptravel\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.low_interest != 0){\r\n $('#cplowInterest').append(\"<h4>Low Interest</h4>\" + \"\\n\" + '<span>' + card.low_interest + '</span>' + \"%\")\r\n document.getElementById(\"cplowInterest\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.zero_percent != 0){\r\n $('#cpzeroPercent').append(\"<h4>Zero Percent</h4>\" + \"\\n\" + '<span>' + card.zero_percent + '</span>' + \"%\")\r\n document.getElementById(\"cpzeroPercent\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.balance_transfer != 0){\r\n $('#cpbalanceTransfer').append(\"<h4>Balance Transfer</h4>\" + \"\\n\" + '<span>' + card.balance_transfer + '</span>' + \"%\")\r\n document.getElementById(\"cpbalanceTransfer\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.points != 0){\r\n $('#cppoints').append(\"<h4>Points</h4>\" + \"\\n\" + '<span>' + card.points + '</span>' + \"%\")\r\n document.getElementById(\"cppoints\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.gas != 0){\r\n $('#cpgas').append(\"<h4>Gas</h4>\" + \"\\n\" + '<span>' + card.gas + '</span>' + \"%\")\r\n document.getElementById(\"cpgas\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.extended_warranty != 0){\r\n $('#cpextendedWarranty').append(\"<h4>Extended Warranty</h4>\" + \"\\n\" + '<span>' + card.extended_warranty + '</span>' + \"%\")\r\n document.getElementById(\"cpextendedWarranty\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.price_guarantee != 0){\r\n $('#cppriceGuarantee').append(\"<h4>Price Guarantee</h4>\" + \"\\n\" + '<span>' + card.price_guarantee + '</span>' + \"%\")\r\n document.getElementById(\"cppriceGuarantee\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n\r\n // Intangible Features Section\r\n // Doesn't show Intangible features if there isn't any results\r\n if((card.customer_service == -1 || !(Math.round(card.customer_service*100) > 1)) &&\r\n (card.redemption == -1 || !(Math.round(card.redemption*100) > 1)) &&\r\n (card.technology == -1 || !(Math.round(card.technology*100) > 1)) &&\r\n (card.security == -1 || !(Math.round(card.security*100) > 1)) &&\r\n (card.credit_building == -1 || !(Math.round(card.credit_building*100) > 1))){\r\n\r\n document.getElementById(\"right\").style.width = \"0%\";\r\n document.getElementById(\"middle\").style.width = \"66%\";\r\n console.log(\"No Results\");\r\n }else{\r\n document.getElementById(\"middle\").style.borderRight = \"1px solid rgba(33,150,243,1)\";\r\n document.getElementById(\"right\").style.width = \"33%\";\r\n console.log(\"Has Results\");\r\n }\r\n\r\n if(card.customer_service != -1 && Math.round(card.customer_service*100) > 1){\r\n $('#cdCustomerService').append(\"<h4>Customer Service</h4>\" + \"\\n\" + '<span>' + Math.round(card.customer_service*100) + '</span>' + \"%\")\r\n document.getElementById(\"cdCustomerService\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else{\r\n // $('#cdCustomerService').append(\"<h4>Customer Service</h4>\" + \"\\n\" + '<span>' + \"No Result\" + '</span>')\r\n // document.getElementById(\"cdCustomerService\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.redemption != -1 && Math.round(card.redemption*100) > 1){\r\n $('#cdRedemption').append(\"<h4>Redemption</h4>\" + \"\\n\" + '<span>' + Math.round(card.redemption*100) + '</span>' + \"%\")\r\n document.getElementById(\"cdRedemption\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else{\r\n // $('#cdRedemption').append(\"<h4>Redemption</h4>\" + \"\\n\" + '<span>' + \"No Result\" + '</span>')\r\n // document.getElementById(\"cdRedemption\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.technology != -1 && Math.round(card.technology*100) > 1){\r\n $('#cdTechnology').append(\"<h4>Technology</h4>\" + \"\\n\" + '<span>' + Math.round(card.technology*100) + '</span>' + \"%\")\r\n document.getElementById(\"cdTechnology\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else{\r\n // $('#cdTechnology').append(\"<h4>Technology</h4>\" + \"\\n\" + '<span>' + \"No Result\" + '</span>')\r\n // document.getElementById(\"cdTechnology\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.security != -1 && Math.round(card.security*100) > 1){\r\n $('#cdSecurity').append(\"<h4>Security</h4>\" + \"\\n\" + '<span>' + Math.round(card.security*100) + '</span>' + \"%\")\r\n document.getElementById(\"cdSecurity\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else{\r\n // $('#cdSecurity').append(\"<h4>Security</h4>\" + \"\\n\" + '<span>' + \"No Result\" + '</span>')\r\n // document.getElementById(\"cdSecurity\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n if(card.credit_building != -1 && Math.round(card.credit_building*100) > 1){\r\n $('#cdCreditBuilding').append(\"<h4>Credit Building</h4>\" + \"\\n\" + '<span>' + Math.round(card.credit_building*100) + '</span>' + \"%\")\r\n document.getElementById(\"cdCreditBuilding\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }else{\r\n // $('#cdCreditBuilding').append(\"<h4>Credit Building</h4>\" + \"\\n\" + '<span>' + \"No Result\" + '</span>')\r\n // document.getElementById(\"cdCreditBuilding\").style.borderBottom = \"1px solid rgba(33,150,243,1)\";\r\n }\r\n\r\n }", "title": "" }, { "docid": "e1f282b981c0c56370b731f944d320d3", "score": "0.6117899", "text": "generateCardInfo(){\n if(this.props.currentTile.rents == null || this.props.currentTile.name.includes(\"Chance\") || this.props.currentTile.name.includes(\"Community\") || this.props.currentTile.name.includes(\"Tax\")){\n return(<p></p>)\n }\n\n if(this.props.currentTile.name.includes(\"Station\")){\n return(\n <div>\n <p className=\"tileText\">Rent _______________ £25 </p>\n <p className=\"tileText\">If 2 Stations are owned £50</p>\n <p className=\"tileText\">If 3 Stations are owned £100</p>\n <p className=\"tileText\">If 4 Stations are owned £200</p>\n </div>\n )\n }\n\n return(\n <div>\n <p className=\"tileText\">Rent _______________ £{this.props.currentTile.rents[0]}</p>\n <p className=\"tileText\">Full Set £{this.props.currentTile.rents[0]*2}</p>\n <p className=\"tileText\">With 1 House ____ £{this.props.currentTile.rents[1]}</p>\n <p className=\"tileText\">With 2 Houses ___ £{this.props.currentTile.rents[2]}</p>\n <p className=\"tileText\">With 3 Houses ___ £{this.props.currentTile.rents[3]}</p>\n <p className=\"tileText\">With 4 Houses ___ £{this.props.currentTile.rents[4]}</p>\n <p className=\"tileText\">With Hotel ______________ £{this.props.currentTile.rents[5]}</p>\n <p className=\"tileText\">_____________________________</p>\n <p className=\"tileText\">Houses Cost _________ £{this.props.currentTile.buildCost}</p>\n <p className=\"tileText\">Hotels Cost __________ £{this.props.currentTile.buildCost}</p>\n </div>\n )\n }", "title": "" }, { "docid": "fdd04248fa4f206a54e543ca0fc005dc", "score": "0.6112092", "text": "function getCardInfo() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/GetCardInfo' + cacheBuster });\n }", "title": "" }, { "docid": "36b38833ce7b9af763f3264ac4fde0a5", "score": "0.6101087", "text": "function InfoCard(props) {\n\treturn (\n\t\t<Card wrapperStyle={styles.wrapperStyle} containerStyle={styles.container}>\n\t\t\t<Card.FeaturedTitle style={styles.headerText}>{props.headerText}</Card.FeaturedTitle>\n\t\t\t{<Card.FeaturedSubtitle style={styles.leftText}>{props.leftText}</Card.FeaturedSubtitle>}\n\t\t\t<Card.FeaturedTitle style={styles.infoPosition}>{props.infoPosition}</Card.FeaturedTitle>\n\t\t\t{<Card.FeaturedSubtitle style={styles.rightText}>{props.rightText}</Card.FeaturedSubtitle>}\n\t\t</Card>\n\t);\n}", "title": "" }, { "docid": "97dc783d4bca50323ed875636c36d005", "score": "0.60215104", "text": "function getCardString(card) {\n return card.value + ' of ' + card.suit; \n}", "title": "" }, { "docid": "960dab5c8ee29aae1d81158ad50ea519", "score": "0.5968393", "text": "function getCardInfo(player) {\n //console.log(player);\n return {\n heroes: player.heroes.map((card) => HERO_CARDS[card.index].levels[card.level]),\n villains: player.villains.map((card) => VILLAIN_CARDS[card.index])\n };\n}", "title": "" }, { "docid": "0c8bafa62b841e3eac4971eff609c26c", "score": "0.59181213", "text": "function cardGenerate(postInfo)\n{\n\tvar cardString = \"\";\n\tcardString += \"<li>\";\n\tcardString += \"<div class=\\\"row\\\">\";\n\tcardString += \"<div class=\\\"col s12\\\">\";\n\n\tif(postInfo.type == 'C')\n\t{\n\t\tif(postInfo.motion == 'F')\n\t\t{\n\t\t\tcardString += \"<div class=\\\"card cyan darken-3\\\">\";\n\t\t}\n\t\telse if(postInfo.motion == 'A')\n\t\t{\n\t\t\tcardString += \"<div class=\\\"card blue darken-3\\\">\";\n\t\t}\n\t}\n\tif(postInfo.type == 'R')\n\t{\n\t\tif(postInfo.motion == 'F')\n\t\t{\n\t\t\tcardString += \"<div class=\\\"card cyan darken-1\\\">\";\n\t\t}\n\t\telse if(postInfo.motion == 'A')\n\t\t{\n\t\t\tcardString += \"<div class=\\\"card blue darken-1\\\">\";\n\t\t}\n\t}\n\n\tcardString += \"<div class=\\\"card-content white-text\\\">\";\n\tcardString += \"<span class=\\\"card-title\\\">\";\n\tcardString += postInfo.title;\n\tcardString += \"</span>\";\n\tcardString += \"<p>\";\n\tcardString += postInfo.description;\n\tcardString += \"</p>\";\n\tcardString += \"</div>\";\n\tcardString += \"<div class=\\\"card-action\\\">\";\n\tcardString += \"<p>\"; // open cross reference\n\tfor(i = 0; i < postInfo.crossQuestionList.length; i++)\n\t{\n\t\tvar QAList = postInfo.crossQuestionList[i];\n\t\t// let question = postInfo.crossQuestionList[i][0];\n\t\t// let answer = postInfo.crossQuestionList[i][1];\n\t\tcardString += \"Q) \" + QAList[0] + \"<br>\";\n\t\tcardString += \"A) \" + QAList[1] + \"<br>\";\n\t}\n\tcardString += \"</p>\";\n\tcardString += \"</div></div></div></div>\"\n\tcardString += \"</li>\";\n\t//console.log(cardString);\n\treturn cardString;\n}", "title": "" }, { "docid": "96fe1c0ad7ceb986dc18321e9f25c34d", "score": "0.590131", "text": "function getCardInfo(partner) {\n return {\n status: partner.status,\n statusId: partner.statusId,\n memberName: memberInfoService.getmemberName(),\n cardNo: '',\n partnerName: partner['partnerName_' + localeService.getLang()],\n imgLink: 'img/dashboard/membercard/vertical/default.png'\n };\n }", "title": "" }, { "docid": "e5e164de38ce2e7ebd96963cd441c14c", "score": "0.5887708", "text": "function getCardInfo()\n{\n var cardType = [\"Ace\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Jack\", \"Queen\", \"King\"];\n var cardValue = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10];\n\n // generate the random number between 1 and 52\n // var dealValue = Math.floor((Math.random() * 52) + 1);\n\n // determine what the card type and value are\n if (dealValue == 1 || dealValue == 14 || dealValue == 27 || dealValue == 40)\n {\n tempCardType = cardType[0];\n tempCardValue = cardValue[0];\n }\n else if (dealValue == 2 || dealValue == 15 || dealValue == 28 || dealValue == 41)\n {\n tempCardType = cardType[1];\n tempCardValue = cardValue[1];\n }\n else if (dealValue == 3 || dealValue == 16 || dealValue == 29 || dealValue == 42)\n {\n tempCardType = cardType[2];\n tempCardValue = cardValue[2];\n }\n else if (dealValue == 4 || dealValue == 17 || dealValue == 30 || dealValue == 43)\n {\n tempCardType = cardType[3];\n tempCardValue = cardValue[3];\n }\n else if (dealValue == 5 || dealValue == 18 || dealValue == 31 || dealValue == 44)\n {\n tempCardType = cardType[4];\n tempCardValue = cardValue[4];\n }\n else if (dealValue == 6 || dealValue == 19 || dealValue == 32 || dealValue == 45)\n {\n tempCardType = cardType[5];\n tempCardValue = cardValue[5];\n }\n else if (dealValue == 7 || dealValue == 20 || dealValue == 33 || dealValue == 46)\n {\n tempCardType = cardType[6];\n tempCardValue = cardValue[6];\n }\n else if (dealValue == 8 || dealValue == 21 || dealValue == 34 || dealValue == 47)\n {\n tempCardType = cardType[7];\n tempCardValue = cardValue[7];\n }\n else if (dealValue == 9 || dealValue == 22 || dealValue == 35 || dealValue == 48)\n {\n tempCardType = cardType[8];\n tempCardValue = cardValue[8];\n }\n else if (dealValue == 10 || dealValue == 23 || dealValue == 36 || dealValue == 49)\n {\n tempCardType = cardType[9];\n tempCardValue = cardValue[9];\n }\n else if (dealValue == 11 || dealValue == 24 || dealValue == 37 || dealValue == 50)\n {\n tempCardType = cardType[10];\n tempCardValue = cardValue[10];\n }\n else if (dealValue == 12 || dealValue == 25 || dealValue == 38 || dealValue == 51)\n {\n tempCardType = cardType[11];\n tempCardValue = cardValue[11];\n }\n else\n {\n tempCardType = cardType[12];\n tempCardValue = cardValue[12];\n }\n}", "title": "" }, { "docid": "0aed6eddb0e44a62acc3a25f0abe54bc", "score": "0.5877885", "text": "function collectCardText(data)\n\t{\n\t\tvar out = [];\n\n\t\t$.each(data, function(idx, val) {\n\t\t\t$.each(val, function(idx2, val2) {\n\t\t\t\tout.push(val2);\n\t\t\t});\n\t\t});\n\n\t\treturn out.join('<br/>');\n\t}", "title": "" }, { "docid": "1b5a826d518e0820ddedfa1726723efe", "score": "0.5875328", "text": "function createCard(data) {\n console.log(data)\n //will get you the name of the attraction\n console.log(\"Attraction Name: \" + data.name)\n\n //this will give you an image url for the place\n console.log(\"image url: \" + data.image);\n \n //this will give you a description of the place\n //must shorten it as text lengths vary\n console.log(\"Wiki description: \" + data.wikipedia_extracts.text); \n \n //this will get you the wikipedia page to the place\n console.log(\"wikipedia page: \" + data.wikipedia);\n const resultsDisplay = $('.results-display');\n\n let attractionDescription = data.wikipedia_extracts.text;\n\n //if...else statement that shortens the text to 280 characters or less\n if(attractionDescription.length > 280){\n attractionDescription = attractionDescription.substring(0,280) + \"...\"; \n } else {\n attractionDescription;\n }\n \n //uses jquery to create a new attraction card to display;\n const newAttraction = $(`\n <div class=\"card card-extras\" style=\"width: 18rem;\">\n <img class=\"card-img-top card-image\" src=\"${data.preview.source}\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.name}</h5>\n <div class=\"favorite-icon\"><img src=\"assets/favorite.png\" class=\"fave-me\"></div>\n <p class=\"card-text\">${attractionDescription}</p>\n <a href=\"${data.wikipedia}\" target=\"_blank\" class=\"btn btn-primary\">Learn More</a>\n </div>\n </div>`)\n resultsDisplay.append(newAttraction);\n}", "title": "" }, { "docid": "b4ac13139de6013b2e22ba09e3e2acbb", "score": "0.58521867", "text": "function showCard(placeResult) {\n let infoCard = document.getElementById(\"optionInfo\");\n //if infoCard is open remove the open class.\n if(infoCard != null){\n if (infoCard.classList.contains(\"open\")) {\n infoCard.classList.remove(\"open\");\n }\n\n //clearing previous details\n while (infoCard.lastChild) {\n infoCard.removeChild(infoCard.lastChild);\n }\n }\n\n //Adding photo if there is one\n if (placeResult.photos) {\n let firstPhoto = placeResult.photos[0];\n photo = document.createElement(\"img\");\n photo.classList.add(\"card-img-top\");\n photo.src = firstPhoto.getUrl();\n if(infoCard != null){\n infoCard.appendChild(photo);\n }\n }\n //new div created for card body\n var newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"card-body\");\n if(infoCard != null){\n infoCard.appendChild(newDiv);\n }\n let title = document.createElement(\"h5\");\n title.classList.add(\"card-title\");\n title.textContent = placeResult.name;\n newDiv.appendChild(title);\n //add rationg if there is one\n if (placeResult.rating != null) {\n let rating = document.createElement(\"p\");\n rating.classList.add(\"card-text\");\n rating.textContent = `Rating: ${placeResult.rating} \\u272e`;\n newDiv.appendChild(rating);\n }\n let address = document.createElement(\"p\");\n address.textContent = `Address: ${placeResult.formatted_address}`;\n newDiv.appendChild(address);\n if (placeResult.website) {\n let websiteBut = document.createElement('button');\n let websiteLink = document.createElement('a');\n let websiteUrl = document.createTextNode(placeResult.website);\n websiteLink.appendChild(websiteUrl);\n websiteLink.textContent= \"Go to the website\";\n websiteLink.href = placeResult.website;\n websiteLink.classList.add(\"websiteLink\");\n websiteBut.classList.add(\"btn\");\n websiteBut.appendChild(websiteLink);\n newDiv.appendChild(websiteBut);\n } \n \n //Getting first 5 reviews if there is one\n if (placeResult.reviews && placeResult.reviews.length) {\n let reviewDiv = document.createElement(\"div\");\n //create a new div for reviews to added to card body\n newDiv.appendChild(reviewDiv);\n reviewDiv.classList.add(\"review\");\n var contentStr =\n +\"<li>Reviews:\" +\n (function (rs, fx) {\n var list = document.createElement(\"ul\");\n reviewDiv.appendChild(list);\n rs.forEach(function (r) {\n list.appendChild(fx(r));\n });\n return \"<ul>\" + list.innerHTML + \"</ul>\";\n return list;\n })(placeResult.reviews, function (r) {\n var item = document.createElement(\"li\");\n\n review = item.appendChild(document.createElement(\"ul\"));\n props = {\n author_name: \"author\",\n rating: \"rating\",\n text: \"text\",\n };\n item.appendChild(document.createElement(\"h6\"));\n item.lastChild.appendChild(document.createElement(\"a\"));\n item.lastChild.lastChild.appendChild(\n document.createTextNode(r.author_name)\n );\n item.lastChild.appendChild(\n document.createTextNode(\"(\" + r.rating + \")\")\n );\n if (r.aspect && r.aspect.length) {\n item.appendChild(document.createElement(\"ul\"));\n r.aspect.forEach(function (a) {\n item.lastChild.appendChild(document.createElement(\"li\"));\n item.lastChild.lastChild.appendChild(\n document.createElement.TextNode(a.type + \":\" + a.rating)\n );\n });\n }\n item.appendChild(document.createElement(\"p\"));\n item.lastChild.appendChild(document.createTextNode(r.text));\n return item;\n }) +\n \"</li>\";\n contentStr = +\"</ul>\";\n } else {\n var contentStr = \"<h5>No Result, status=\" + status + \"</h5>\";\n }\n if(infoCard != null){\n infoCard.classList.add(\"open\");\n }\n}", "title": "" }, { "docid": "f010fb1dd8cc2396393025812678b063", "score": "0.5847045", "text": "function extractInfo(data) {\n for (var i =0; i < data.length; i++)\n { proImages[i].innerHTML= \"<img src=\"+data[i].picture.large +\" class='img-cont' alt>\" ;\n cards[i].innerHTML= data[i].email+ \"<br>\"+data[i].location.city;\n titles[i].innerHTML = (data[i].name.first+ \" \" + data[i].name.last);\n modalUpper[i].innerHTML = (data[i].name.first+ \" \" + data[i].name.last+ \"<br>\"+data[i].email+ \"<br>\"+data[i].location.city );\n lowerModal[i].innerHTML= data[i].cell+ \"<br>\"+data[i].location.street.number+\" \"+data[i].location.street.name+\" \"+data[i].location.state+\" \"+data[i].location.postcode+\"<br>\"+\"Birthday:\"+\" \"+data[i].DOB;\n };\n}", "title": "" }, { "docid": "9a64324b0ec375be0804d8a8bf18099e", "score": "0.5840819", "text": "function getCardDetails(sv, cat, cardIndx) {\n var data = sv[cat.name];\n console.log(data);\n \n\n//this creates the headings for each sub category\n cat.subCats.forEach(function(sCat){\n $(`#${cat.name}${cardIndx}`).append(`<br><h4 style=\"margin-bottom: 0px; margin-top: 30px;\"><u>${sCat.display}</u><i class=\"material-icons right small\">star</i><div class = \"right\">${data[sCat.name].rating.toFixed(2)}</div></h4>`);\n\n var details = sv.details[cat.name][sCat.name]\n//creates the details in each section\n details.address.filter(function(val, i){return i < 5})\n .forEach(function(val2, j){\n $(`#${cat.name}${cardIndx}`).append(`<br><h6 style=\"margin-top: 0px; margin-bottom: 0px;\"> ${details.name[j]} <i class=\"material-icons right\">star</i><div class= \"right\">${details.ratings[j]}</div></h6><div>${val2}</div>`);\n })\n\n })\n}", "title": "" }, { "docid": "acb1ca4ee86295a8b0e37a2a28b91926", "score": "0.5833296", "text": "function ClozeCard(text, cloze) {\n this.cloze = \". . .\";\n //How do I take out the cloze portion when I do not know where within the question it will be?\n this.partial = cloze;\n this.fullText = text;\n}", "title": "" }, { "docid": "323906fb5f2e18374cbfe46ae3a8dcfe", "score": "0.5831773", "text": "function ClozeCard(text, cloze){\n\t//text is Full Text\n\tthis.text = text;\n\tthis.cloze = cloze;\n\tthis.partial = this.text.replace(this.cloze, \".....\");\n\t\n\tthis.newCard = function() {\n\t\tvar card = {\n\t\t\ttext: this.text,\n\t\t\tcloze: this.cloze,\n\t\t\tpartial: this.partial,\n\t\t\ttype: \"ClozeCard\"\n\t\t};\n\t\tfs.appendFile(\"ClozeCard.txt\", JSON.stringify(card) + \";\", \"utf8\", function (err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t});\n\t};\n\n}", "title": "" }, { "docid": "26e94a894d5595b90a56cd8c180080a1", "score": "0.58254147", "text": "function ClozeCard (text, cloze) {\n //cloze= return deleted text\n this.cloze=cloze;\n //text= returns the full text\n this.text=text;\n}", "title": "" }, { "docid": "e5e8ebee579c1cd447cbc01e61a30b5a", "score": "0.582287", "text": "function getInfo(data)\r\n{\r\n cName=document.querySelector(\"#cName\");\r\n info=document.querySelector(\".info\");\r\n image=document.querySelector(\".image\");\r\n cName.textContent=data.name+\" [\"+data.alpha3Code+\"]\";\r\n let description=`<div class='description'>\r\n <table><tbody> \r\n <tr><td><b>Capital</b></td><td>${data.capital}</td></tr>\r\n <tr><td><b>Region</b></td><td>${data.region}</td></tr>\r\n <tr><td><b>Population</b></td><td>${data.population}</td></tr>\r\n <tr><td><b>Currency </b></td><td>${data.currencies[0].name}</td></tr>\r\n <tr><td><b>Time Zones</b></td><td>${data.timezones[0]}</td></tr>\r\n <tr><td><b>Languages</b></td><td>\r\n `\r\n \r\n data.languages.forEach((elt)=>{\r\n description+=`${elt.name} ; `\r\n });\r\n description+=`</td></td>\r\n </tbody></table> \r\n </div>`\r\n image.setAttribute(\"src\",data.flag)\r\n info.innerHTML=description;\r\n}", "title": "" }, { "docid": "8328cc2f0cc0844d6a6a07667512597f", "score": "0.58223844", "text": "function displayCards(carta){\n var numero = carta.getnum();\n var numero2 = carta.getnum();\n var naipe, naipe2;\n //converte figuras\n if (numero === 11){\n numero = \"J\";\n numero2 = \"j\";\n } else if (numero === 12){\n numero = \"Q\";\n numero2 = \"q\";\n } else if (numero === 13){\n numero = \"K\";\n numero2 = \"k\";\n }else if (numero === 1){\n numero = \"A\";\n numero2 = \"a\";\n }\n\n //converte naipes\n if (carta.getnaipe() === 0){\n naipe2 = \"&spades\";\n naipe= \"spades\";\n } else if (carta.getnaipe() === 1){\n naipe2 = \"&hearts\";\n naipe= \"hearts\";\n } else if (carta.getnaipe() === 2){\n naipe2 = \"&diams\";\n naipe= \"diams\";\n } else {\n naipe2 = \"&clubs\";\n naipe= \"clubs\";\n }\n //implementado usando template strings para permitir a interpolação de expressões\n //https://developer.mozilla.org/pt-PT/docs/Web/JavaScript/Reference/template_strings\n //ECMAScript2015 6yh edition\n var classSrg = `\"card rank-${numero2} ${naipe}\"`;\n var desenhaCarta;\n //verifica se é a primeira carta do dealer para a desenhar voltada para baixo\n if ((jogo.cartas_dealer.indexOf(carta)) === 0 && (firstdraw===true)){\n desenhaCarta = createCardHtml(`<div class=\"card back\">*</div>`);\n firstdraw=false;\n } else{\n desenhaCarta = createCardHtml(`<div class=${classSrg}><span class=\"rank\">${numero}</span><span class=\"suit\">${naipe2};</span></div>`);\n }\n //verifica se as cartas são do dealer ou do player para escrever na section correcta\n if (jogo.cartas_dealer.indexOf(carta) === -1 ){\n document.getElementById(\"flex-cards2\").appendChild(desenhaCarta);\n }else {\n document.getElementById(\"flex-cards1\").appendChild(desenhaCarta);\n }\n}", "title": "" }, { "docid": "8403aef8e0486cad1c1b4ea4b6cca94e", "score": "0.5817743", "text": "function ClozeCard(text, cloze){\n\n//receiving the results of the call//\n\tif(!(instanceof ClozeCard)) {\n\t\tnew ClozeCard(text, cloze);\n\t}\n\n\tthis.text = text;\n\tthis.cloze = cloze;\n}", "title": "" }, { "docid": "c0bbd1b239bcf90820243d3acc8ed39c", "score": "0.581543", "text": "function prepareText(card){\n var value = \"\";\n \n //Cost processing\n var text = card[0].cost;\n text = text.replace(/\\{X\\}/g, \"<img src='http://eakett.ca/mtgimage/symbol/mana/x.svg' width='17px'>\")\n .replace(/\\{C\\}/g, \"<img src='https://hydra-media.cursecdn.com/mtgsalvation.gamepedia.com/1/1a/C.svg' width='17px'>\")\n .replace();\n var testSymbol = \"\";\n for(var i = 0; i < text.length; i++){\n if(text[i] == \"{\"){\n if(text[i + 4] == \"}\"){\n testSymbol = (\"{\" + text[i + 1] + \"/\" + text[i + 3] + \"}\");\n text = text\n .replace(testSymbol, (\"<img src='http://eakett.ca/mtgimage/symbol/mana/\" + text[i + 1].toLowerCase() + text[i + 3].toLowerCase() + \".svg' width='17px'>\"))\n .replace();\n }else{\n testSymbol = (\"{\" + text[i + 1] + \"}\");\n text = text.replace(testSymbol, (\"<img src='http://eakett.ca/mtgimage/symbol/mana/\" + text[i + 1].toLowerCase() + \".svg' width='17px'>\"));\n }\n }\n }\n card[0].cost = text;\n \n //Details text processing\n text = card[0].text;\n\n text = text.replace(/\\{T\\}/g, \"<img src='http://www.eakett.ca/mtgimage/symbol/other/t.svg' width='17px'>\")\n .replace(/X/g, \"<img src='http://eakett.ca/mtgimage/symbol/mana/x.svg' width='17px'>\")\n .replace(/\\{C\\}/g, \"<img src='https://hydra-media.cursecdn.com/mtgsalvation.gamepedia.com/1/1a/C.svg' width='17px'>\")\n .replace();\n \n //Mana Symbols\n value = \"\";\n var symbol = \"\"; \n for(var i = 0; i < text.length; i++){\n if(text[i]== \"{\"){\n symbol = (\"{\" + text[i + 1] + \"}\");\n text = text.replace(symbol, (\"<img src='http://eakett.ca/mtgimage/symbol/mana/\" + text[i + 1].toLowerCase() + \".svg' width='17px'>\"));\n }\n }\n \n //Italic text\n value = \"\";\n for(var i = 0; i < text.length; i++){\n value += text[i];\n if(text[i] == \"(\"){\n value += \"<em>\";\n }else if(text[i] == \")\"){\n value += \"</em>\";\n }\n }\n text = value;\n \n //Text new Lines\n text = text.replace(/\\n/g, \"<br>\");\n \n card[0].text = text;\n}", "title": "" }, { "docid": "1e2a11751bc3b27737bee15bb3b42fc3", "score": "0.5811874", "text": "function ClozeCard(text, cloze){\n\tthis.cloze = cloze;\n\tthis.fullText = text;\n\tthis.partial = this.fullText.replace(cloze, \"...\");\n\t//this.display = function(){\n\tif (!this.fullText.includes(cloze)){\n\t\tconsole.log(\"error your text does not include the section to take out\");\n\t\t//}\n\t};\n}", "title": "" }, { "docid": "6eb287789592798e43bf19e7cb7ff539", "score": "0.5806572", "text": "formatCards() {\n\t\t// Error checking, if the data is empty\n\t\tif (this.props.data === null) {\n\t\t\treturn <h1 id=\"searchEmpty\">No results found</h1>;\n\t\t} else {\n\t\t\tif (this.state.isLoaded === false) {\n\t\t\t\tlet element = this.props.data.map((item, index) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// Clickable card, clicking expands all of the information in modal\n\t\t\t\t\t\t<Card id=\"drinkCard\" key={index}>\n\t\t\t\t\t\t\t<Card.Img\n\t\t\t\t\t\t\t\tvariant=\"top\"\n\t\t\t\t\t\t\t\tsrc={item.strDrinkThumb}\n\t\t\t\t\t\t\t\talt={item.strDrink}\n\t\t\t\t\t\t\t\tonClick={() => this.handleDrinkClick(item)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Card.Body>\n\t\t\t\t\t\t\t\t<Card.Title>{item.strDrink}</Card.Title>\n\t\t\t\t\t\t\t</Card.Body>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\treturn <div className=\"drinkContainer\">{element}</div>;\n\t\t\t} else {\n\t\t\t\tlet element = this.state.drink.map((item, index) => {\n\t\t\t\t\tlet listIngredients = this.parseIng(item);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// Clickable card, clicking expands all of the information in modal\n\t\t\t\t\t\t<Card id=\"drinkCard\" key={index}>\n\t\t\t\t\t\t\t<Card.Img\n\t\t\t\t\t\t\t\tvariant=\"top\"\n\t\t\t\t\t\t\t\tsrc={item.strDrinkThumb}\n\t\t\t\t\t\t\t\talt={item.strDrink}\n\t\t\t\t\t\t\t\tonClick={() => this.handleDrinkClick(item)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Card.Body\n\t\t\t\t\t\t\t\tonClick={() => this.handleDrinkClick(item)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Card.Title>{item.strDrink}</Card.Title>\n\t\t\t\t\t\t\t\t<Card.Text>Type: {item.strAlcoholic}</Card.Text>\n\t\t\t\t\t\t\t\t<Card.Text>\n\t\t\t\t\t\t\t\t\tCategory: {item.strCategory}\n\t\t\t\t\t\t\t\t</Card.Text>\n\t\t\t\t\t\t\t\t<Card.Text>\n\t\t\t\t\t\t\t\t\tIngredients: {listIngredients}\n\t\t\t\t\t\t\t\t</Card.Text>\n\t\t\t\t\t\t\t</Card.Body>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\treturn <div className=\"drinkContainer\">{element}</div>;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c24f32340d805e79b2fffebf65c349c5", "score": "0.5805044", "text": "function showCardImage(card,index) {\n $.getJSON('/api.php?action=parse&text={{Carte|Name=' + card + '|Scale=.5|Link=}}&format=json', function(n) {\n var addCardTemplate = n.parse.text['*'];\n $('#deckGenerator td.dcalc-card[data-card-index=\"' + index + '\"]').html(addCardTemplate);\n });\n}", "title": "" }, { "docid": "de33c24015649e9ee0cce3684eabf9d4", "score": "0.5784303", "text": "function getDetails(data){\n\n\tif(data.Response === 'False'){\n\t\t\t\talert(data.Error)\n\t\t\t\t$(\".fullcard\").hide();\n\t\t\t\t$('.loader').hide()\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\".fullcard\").show();\t\n\t\t\t}\n\n\n// Validation \n\n\t\t\tif(data.Poster !== 'N/A'){\n\t\t\t\t$('#coverPhoto').html('<img src=\"' + data.Poster + '\" class=\"img-fluid profileHeight\"/>')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#coverPhoto').html('<img src=\"' + 'https://www.nettv4u.com/uploads/entethallatha-kaaranathal-movie-review.jpg' + '\" class=\"img-fluid defaultHeight\"/>')\n\t\t\t}\n\n\t\t\t\n\t\t\tif(data.Title === undefined || data.Title === \"\" || data.Title === null){\n\t\t\t\t\t\t$(\".card-title\").text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\".card-title\").text(data.Title)\n\t\t\t}\n\t\t\tif(data.Ratings[0] === undefined || data.Ratings[0] === \"\" || data.Ratings[0] === null){\n\t\t\t\t\t$(\".rating\").text('Rating: N/A')\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\".rating\").text(data.Ratings[0].Value)\n\t\t\t}\n\t\t\tif(data.Plot === undefined || data.Plot === \"\" || data.Plot === null){\n\t\t\t\t$(\".card-text\").text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\".card-text\").text(data.Plot)\n\t\t\t}\n\t\t\tif(data.Director === undefined || data.Director === \"\" || data.Director === null){\n\t\t\t\t$('.Director').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Director').text(data.Director)\n\t\t\t}\n\t\t\tif(data.Actors === undefined || data.Actors === \"\" || data.Actors === null){\n\t\t\t\t$('.Actors').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Actors').text(data.Actors)\n\t\t\t}\n\t\t\tif(data.Country === undefined || data.Country === \"\" || data.Country === null){\n\t\t\t\t$('.Country').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Country').text(data.Country)\n\t\t\t}\n\t\t\tif(data.Genre === undefined || data.Genre === \"\" || data.Genre === null){\n\t\t\t\t$('.Genre').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Genre').text(data.Genre)\n\t\t\t}\n\t\t\tif(data.Language === undefined || data.Language === \"\" || data.Language === null){\n\t\t\t\t$('.Language').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Language').text(data.Language)\n\t\t\t}\n\t\t\tif(data.imdbID === undefined || data.imdbID === \"\" || data.imdbID === null){\n\t\t\t\t$('.imdbID').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.imdbID').text(data.imdbID)\n\t\t\t}\n\t\t\tif(data.imdbVotes === undefined || data.imdbVotes === \"\" || data.imdbVotes === null){\n\t\t\t\t$('.imdbVotes').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.imdbVotes').text(data.imdbVotes)\n\t\t\t}\n\t\t\tif(data.Released === undefined || data.Released === \"\" || data.Released === null){\n\t\t\t\t$('.Released').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Released').text(data.Released)\n\t\t\t}\n\t\t\tif(data.Runtime === undefined || data.Runtime === \"\" || data.Runtime === null){\n\t\t\t\t$('.Runtime').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.Runtime').text(data.Runtime)\n\t\t\t}\n\t\t\tif(data.DVD === undefined || data.DVD === \"\" || data.DVD === null){\n\t\t\t\t$('.DVD').text('N/A')\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('.DVD').text(data.DVD)\n\t\t\t}\n\t\t\t\n}", "title": "" }, { "docid": "96c177144d6a4748e71ad3182e0a7ee6", "score": "0.5764604", "text": "function getCurrentGear() {\r\n var i = document.getElementById(\"DeckCurrent\"); \r\n // iterate through cards in the gear\r\n children = i.childNodes;\r\n var deck = '';\r\n for (var i = 0; i < children.length; i++) {\r\n var node = children[i];\r\n if (node.nodeName == \"DIV\") {\r\n var thehtml = node.innerHTML.replace(/\\n/g, '');\r\n var thehtml = thehtml.replace(/\\r/g, '');\r\n\r\n var cardId = thehtml.replace(/.*card\\/(\\d+).*/,'$1');\r\n var cardName = thehtml.replace(/.*BV_system_file.*false;\">([^<>\\s]+)\\s*<\\/a>.*/,'$1');\r\n var cardCount = thehtml.replace(/.*DeckCardCount\\d+\">(\\d+)<.*/,'$1');\r\n var cardType = thehtml.replace(/.*<a class=\\\"c([^\\s]+).*/,'$1');\r\n var tmp = thehtml.replace(/.*minirune_([^\\s\"]+).*minirune_([^\\s\"]+).*/, '$1 $2');\r\n var rune1 = tmp.replace(/^([^\\s]+).*/,'$1');\r\n var rune2 = tmp.replace(/.*\\s([^\\s]+)$/,'$1');\r\n\r\n // removing @nbsp; for readability\r\n cardName = cardName.replace(/&nbsp;/g, ' ');\r\n\r\n if (cardCount != 0) {\r\n deck = deck.concat(\"{\" + cardId + \",\" + cardName + \",\" + cardCount + \",\" + cardType + \",\" + rune1 + \",\" + rune2 + \"}\");\r\n }\r\n\r\n //DEBUG alert(deck); //DEBUG\r\n }\r\n }\r\n\r\n return deck;\r\n}", "title": "" }, { "docid": "d78095c92d3dbc499ab04eab8ca2975c", "score": "0.57633615", "text": "function ClozeCard(text, cloze){\n\tthis.text = text;\n\tthis.cloze = cloze;\n}", "title": "" }, { "docid": "f07e66c629da9814f8f1c6991128cee2", "score": "0.57572347", "text": "function ClozeCard (text, cloze) {\n\tthis.text = text;\n\tthis.cloze = cloze;\n\tconsole.log(this.text, this.cloze);\n\n}", "title": "" }, { "docid": "d539bf2c843551126c70c64d4fb271b9", "score": "0.5755977", "text": "function viewMoreInfo(d) {\n // set clicked flag variable to true\n clicked = true;\n\n // show clicked dot\n showDotOnMap(d);\n\n // show tooltip on timeline\n showTimelineTooltip(d);\n\n // add data to card\n const authors = d.properties.authors.replace(\"et al.\", \"<em>et al.</em>\");\n const card_title = authors + ' ' + d.properties.yearpublished;\n const area = d.properties.area.replace(/ *([|]) */g, '$1').split('|').join(', ');\n const age = d.properties.age.replace(/ *([|]) */g, '$1').split('|').join(', ');\n const diagnosticcriteria = d.properties.diagnosticcriteria.replace(/ *([|]) */g, '$1').split('|').join(', ');\n const diagnostictools = d.properties.diagnostictools.replace(/ *([|]) */g, '$1').split('|').join(', ');\n const prevalenceper10000 = d.properties.prevalenceper10000.replace(/ *([|]) */g, '$1').split('|').join(', ');\n const confidenceinterval = d.properties.confidenceinterval.replace(/ *([|]) */g, '$1').split('|').join(', ');\n $(\"#card-title\").html(card_title);\n $(\"#card-country\").text(d.properties.country);\n $(\"#card-area\").text(area);\n $(\"#card-samplesize\").text(d.properties.samplesize);\n $(\"#card-age\").text(age);\n $(\"#card-diagnosticcriteria\").text(diagnosticcriteria);\n $(\"#card-diagnostictools\").text(diagnostictools);\n $(\"#card-percentwaverageiq\").text(d.properties.percentwaverageiq);\n $(\"#card-sexratiomf\").text(d.properties.sexratiomf);\n $(\"#card-prevalenceper10000\").text(prevalenceper10000);\n $(\"#card-confidenceinterval\").text(confidenceinterval);\n $(\"#card-yearsstudied\").text(d.properties.yearsstudied);\n $(\"#card-categoryadpddorasd\").text(d.properties.categoryadpddorasd);\n\n // add links to card\n let links = [];\n if (d.properties.link1title && d.properties.link1url) {\n links.push('<a href=\"'+ d.properties.link1url +'\" >'+ d.properties.link1title +'</a>') \n }\n if (d.properties.link2title && d.properties.link2url) {\n links.push('<a href=\"'+ d.properties.link2url +'\" >'+ d.properties.link2title +'</a>') \n }\n if (d.properties.link3title && d.properties.link3url) {\n links.push('<a href=\"'+ d.properties.link3url +'\" >'+ d.properties.link3title +'</a>') \n }\n if (d.properties.link4title && d.properties.link4url) {\n links.push('<a href=\"'+ d.properties.link4url +'\" >'+ d.properties.link4title +'</a>') \n }\n\n let links_string = links.join('<br />');\n links_string = links_string.replace('>Spectrum', '><em>Spectrum</em>');\n\n $(\"#card-links\").html(links_string);\n\n // show card\n $(\"#more-information-card\").css(\"display\", \"block\");\n }", "title": "" }, { "docid": "0feef64b91ea7472cdbe2b5506684c83", "score": "0.5753156", "text": "async function fetchCards(card) {\n if (card) {\n const searchUrl =\n 'https://www.mtgmate.com.au/cards/search?utf8=%E2%9C%93&q=' +\n card +\n '&button=';\n // Turn the provided string into a proper URL, replacing spaces and such\n const uri = encodeURI(searchUrl);\n // Fetch the data from the URL\n const response = await fetch(uri);\n //Extract the webpage into a string\n const htmlString = await response.text();\n // Pass the string into cheerio to work on\n const $ = cheerio.load(htmlString);\n // Extract the items with class .magic-card into an array\n const cardsOutput = $('.magic-card');\n let i;\n let newCard = [];\n // The for loop condition is a little messed up because there are 2 tables of data that are actually generated in the MTGMate HTML\n // By starting at halfway through the length we skip the first table that seems to have dodgy data in it anyway\n for (i = cardsOutput.length / 2; i < cardsOutput.length; i++) {\n newCard.push({\n name: cardsOutput[i].children[3].children[1].children[0].data,\n set: cardsOutput[i].children[5].children[1].children[0].data,\n price: cardsOutput[i].children[7].children[0].data.trim(),\n quantity: cardsOutput[i].children[9].children[0].data.trim(),\n });\n }\n setCards(newCard);\n } else {\n setCards([]);\n }\n }", "title": "" }, { "docid": "a4408660dd29031175f2b5de51c73ef1", "score": "0.5751913", "text": "function getInfo(stateCode) {\n let queryURLNPS = 'https://developer.nps.gov/api/v1/parks?stateCode=' + stateCode + '&limit=5&api_key=CIOegTmdfiM4Yf3b17p4OpcSRxRf0G6lZ4pgTuOv';\n $.ajax({\n url: queryURLNPS,\n method: 'GET'\n }).then(function(response1) {\n \n //cardID array references items in HTML to append cards to\n cardID = [card1, card2, card3, card4];\n //imageID array creates a unique ID for each image on the cards\n imageID = ['cardimg1', 'cardimg2', 'cardimg3', 'cardimg4'];\n //parkID gives each park name span a unique ID\n parkID = ['parkName1', 'parkName2', 'parkName3', 'parkName4'];\n //infoID gives each information section a unqiue ID\n infoID = ['info1', 'info2', 'info3', 'info4'];\n //fetchData attributes determines where info is pulled from the NPS API object\n fetchData = [response1.data[0], response1.data[1], response1.data[2], response1.data[3]];\n\n //Empty content so new items can be placed\n card1.empty().addClass('green darken-2').css('color', 'white');\n card2.empty().addClass('green darken-2').css('color', 'white');\n card3.empty().addClass('green darken-2').css('color', 'white');\n card4.empty().addClass('green darken-2').css('color', 'white');\n\n //Loop to dynamically generate multiple cards\n for (i = 0; i < cardID.length; i++) {\n //Appends to the div class=card Section 1\n let imgDiv = $('<div>').attr('class', 'card-image');\n let newImg = $('<img>').attr('id', imageID[i]).attr('src', fetchData[i].images[0].url).attr('alt', fetchData[i].images[0].altText);\n let newSpan = $('<span>').attr('id', parkID[i]).attr('class', 'card-title').text(fetchData[i].fullName);\n //Section 2\n let cardDiv = $('<div>').attr('class', 'card-content');\n let para = $('<p>').attr('id', infoID[i]).text(fetchData[i].description);\n //Section 3\n let actionDiv = $('<div>').attr('class', 'card-action');\n let infoBtn = $('<button>').attr('class', 'waves-effect waves-light btn teal darken-4 cardBtn').attr('data-parkCode', fetchData[i].parkCode).text('Get more info!');\n //Append contents to div for each section\n let section1 = imgDiv.append(newImg).append(newSpan);\n let section2 = cardDiv.append(para);\n let section3 = actionDiv.append(infoBtn);\n //Append sections to the cards in the HTML\n cardID[i].append(section1).append(section2).append(section3);\n }; \n });\n}", "title": "" }, { "docid": "4ea983ad385f1729053f320860ff4e6c", "score": "0.5747031", "text": "function informationCard(myName, myLocation, myHobby) {\n \n return \"Hi, my name is \" + myName + \". I live in \" + myLocation + \n \" and enjoy \" + myHobby; \n \n}", "title": "" }, { "docid": "092c2925374b9248cc0069f47c4e0232", "score": "0.57322276", "text": "function getCard(image) {\n let alt = image.altText;\n if (alt.length == 0) {\n alt = DEFAULT_ALT;\n }\n\n return (\n '<div class=\"card\">' +\n '<img src=\"' + image.imageUrl + '\" alt=\"' + alt + '\">' +\n '<div>date uploaded: ' + image.dateUploaded + '</div>' +\n '</div>'\n );\n}", "title": "" }, { "docid": "9e3a9ebbbc1c1b48aa17a97f826627bf", "score": "0.57210195", "text": "function makeCardContent(identificationInfo) {\n const cardContent = $('<div />');\n const topHalf = makeTopHalfOfCard(identificationInfo);\n\n const results = identificationInfo.results;\n const list = $('<div />').addClass('card-ids-container');\n\n const listTitle = $('<div />').addClass('card-id-row');\n const name = $('<p />').addClass('card-id-common-name bold-text').text(`Possible Common Name`);\n const score = $('<p />').addClass('card-id-score bold-text').text(`Score`);\n listTitle.append(name);\n listTitle.append(score);\n\n $.each(results, (j, currentResult) => {\n const span = $('<div />').addClass('card-id-row');\n const name = $('<p />').addClass('card-id-common-name').text(`${j + 1}. ${currentResult.commonNames[0]}`);\n var displayedScore = currentResult.manuallyIdentified ? 'U.E.' : `${currentResult.score}%`;\n const score = $('<p />').addClass('card-id-score').text(displayedScore);\n span.append(name);\n span.append(score);\n list.append(span);\n });\n\n const border = $('<div />').addClass('mdl-card__actions mdl-card--border');\n const button = $('<a />').addClass('mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect').text(\"View More\");\n button.on('click', (e) => {\n displayResultModal(identificationInfo);\n })\n border.append(button);\n\n cardContent.append(topHalf);\n cardContent.append(listTitle);\n cardContent.append(list);\n cardContent.append(border);\n\n return cardContent;\n}", "title": "" }, { "docid": "5f0d50f099b6246f575180a3c8f5d9d4", "score": "0.57157546", "text": "function ClozeCard(text, cloze) {\n // Convert the incoming strings to lower case\n\tvar textToLower = text.toLowerCase();\n\tvar clozeToLower = cloze.toLowerCase();\n\n\t// Confirm that the cloze statement appears within the complete text\n\tif (!textToLower.includes(clozeToLower)) {\n\t\tconsole.log(\"ERROR: \" + \"'\" + cloze + \"'\" + \" does not appear within the answer\");\n\t\treturn;\n\t}\n\n this.full = text;\n this.cloze = cloze;\n\n this.partial = text.replace(cloze, '...');\n}", "title": "" }, { "docid": "f462750f682429c6266362b5b280a878", "score": "0.56989527", "text": "function Cards() {\n const cards = [\n {\n label: translate({ message: 'Brownfield' }),\n description: translate({\n message:\n \"Compatibility with any front-end framework means you don't have to change your stack.\",\n }),\n link: '/guides/getting-started/setup',\n isDoc: true,\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/brownfield.svg',\n },\n {\n label: translate({ message: 'Security' }),\n description: translate({\n message:\n 'Front-of-mind for the Tauri Team driving our highest priorities and biggest innovations.',\n }),\n link: '/references/architecture/security',\n isDoc: true,\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/security.svg',\n },\n {\n label: translate({ message: 'FLOSS' }),\n description: translate({\n message:\n 'Relicensing and redistribution is possible thanks to MIT or MIT/Apache 2.0 licensing where applicable.',\n }),\n link: 'about/intro#honest-open-source',\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/floss.svg',\n },\n {\n label: translate({ message: 'Bundle Size' }),\n description: translate({\n message:\n \"By using the OS's native web renderer, the size of a Tauri app can be less than 600KB.\",\n }),\n link: '/references/benchmarks',\n isDoc: true,\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/box.svg',\n },\n {\n label: translate({ message: 'Cross Platform' }),\n description: translate({\n message:\n 'Bundle binaries for all major desktop platforms (mobile coming soon).',\n }),\n link: '/guides/building/cross-platform',\n isDoc: true,\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/cross_platform.svg',\n },\n {\n label: translate({ message: 'Built on Rust' }),\n description: translate({\n message:\n 'With performance and security at the center, Rust is the language for the next generation of apps.',\n }),\n link: 'https://docs.rs/tauri/1/',\n linkText: translate({ message: 'Learn More' }),\n imageUrl: 'img/index/illustrations/code.svg',\n },\n ]\n\n const latestVersion = useLatestVersion()\n\n return (\n <section className={classNames(styles.cardContainer)}>\n {cards.map((card, index) => (\n <div className={classNames(styles.card, 'card')} key={index}>\n <div className={classNames(styles.cardSide, styles.cardLeading)}>\n <h2>{card.label}</h2>\n <p>{card.description}</p>\n <div className={classNames(styles.cardSpacer)}></div>\n <Link\n className={'button button--primary'}\n href={(card.isDoc ? latestVersion.path : '') + card.link}\n >\n {card.linkText}\n </Link>\n </div>\n <div className={classNames(styles.cardSide, styles.cardImage)}>\n <img src={card.imageUrl} />\n </div>\n </div>\n ))}\n </section>\n )\n}", "title": "" }, { "docid": "8d83f3d6c6f5041287d6c08962836b07", "score": "0.56269556", "text": "function displayTheCoinsOnUi(theCoinsFromTheApi) {\n let coinObjectCounter = 0;\n // loop to display all the cards\n for (let coinObject of theCoinsFromTheApi) {\n if (coinObjectCounter == theCoinsFromTheApi.length - 1) {\n $(\"#loader\").hide();\n return;\n }\n let newDiv = $(\"<div>\");\n newDiv.addClass(\"card \");\n newDiv.css(\"width\", \"18rem\");\n newDiv.addClass(\"justify-content-center\");\n $(\"#cardsDiv\").append(newDiv);\n\n let cardBody = $(\"<div>\");\n cardBody.addClass(\"card-body\");\n newDiv.append(cardBody);\n\n let title = $(\"<h5>\");\n title.addClass(\"card-title\");\n title.html(coinObject.symbol.toUpperCase());\n title.css(\"font-weight\", \"bolder\");\n cardBody.append(title);\n\n let checkBoxLabel = $(\"<label>\");\n checkBoxLabel.addClass(\"switch\");\n title.append(checkBoxLabel);\n\n let checkBoxInput = $(\"<input>\");\n checkBoxInput.attr(\"id\", \"id\" + coinObject.id);\n checkBoxInput.attr(\"type\", \"checkbox\");\n checkBoxLabel.append(checkBoxInput);\n\n let checkBoxSpan = $(\"<span>\");\n checkBoxSpan.addClass(\"slider round\");\n checkBoxLabel.append(checkBoxSpan);\n\n let text = $(\"<p>\");\n text.addClass(\"card-text\");\n text.html(coinObject.name);\n cardBody.append(text);\n\n let button = $(\"<button>\");\n button.addClass(\"btn btn-primary\");\n button.attr(\"id\", coinObject.id);\n button.addClass(\"btn btn-primary btn-warning button\");\n button.attr(\"type\", \"button\");\n button.attr(\"data-toggle\", \"collapse\");\n button.attr(\"data-target\", \"#button\" + coinObject.id);\n button.html(\"more info\");\n cardBody.append(button);\n\n let moreInfoContent = $(\"<div>\");\n moreInfoContent.addClass(\"collapse infoContent\");\n moreInfoContent.attr(\"id\", \"button\" + coinObject.id);\n cardBody.append(moreInfoContent);\n\n coinObjectCounter++;\n // on click get the more info about the card\n\n button.click(function (event) {\n // get more info from the url and display it or check if the info is saved and display it\n getMoreInfoFromUrl(event.target.id, moreInfoContent);\n });\n // on change in the checkbox input check if it checked or not\n checkBoxInput.change(function (event) {\n if ($(event.target).is(\":checked\")) {\n // if the button is checked save it to the array of saved coins\n savesTheCheckedCoins(event.target.id);\n } else {\n // if the input is not checked remove it from the array\n deleteFromCoinArray(event.target.id);\n }\n });\n }\n }", "title": "" }, { "docid": "8899160cbceb98d3398fab5a9b07a742", "score": "0.5612879", "text": "function showCards() {\n var library = require('./cardLibrary.json');\n\n if (count < library.length) {\n\n if (library[count].front !== undefined) {\n console.log('');\n console.log(colors.yellow('---------- Basic Card ----------'));\n console.log(colors.yellow('--------------------------------'));\n console.log('Front: ' + library[count].front);\n console.log('--------------------------------');\n console.log('Back: ' + library[count].back + '.');\n console.log(colors.yellow('--------------------------------'));\n console.log('');\n } else {\n console.log('');\n console.log(colors.yellow('---------- Cloze Card ----------'));\n console.log(colors.yellow('--------------------------------'));\n console.log('Text: ' + library[count].text);\n console.log('--------------------------------');\n console.log('Cloze: ' + library[count].cloze + '.');\n console.log(colors.yellow('--------------------------------'));\n console.log('');\n }\n count++;\n showCards();\n } else {\n count = 0;\n mainMenu();\n }\n}", "title": "" }, { "docid": "4086f1735e05b53d7f9cc5bae129781c", "score": "0.56093746", "text": "function ClozeCard(text, cloze){\n if (text.includes(cloze)){\n cardCheck = true;\n console.log(\"Your card is valid!\");\n this.cloze = cloze;\n this.partialText = text.replace(cloze, \"__?__\");\n this.fullText = text;\n } else{\n cardCheck = false;\n console.log(\"Your card doesn't work!\")\n }\n \n}", "title": "" }, { "docid": "86adb9ffe5a38afed7c80faafe1fa66e", "score": "0.556108", "text": "function getCard(id) {\n var options = {};\n // determine if id is multiverseid format or id (hash)\n if (!isNaN(id)) {\n options.multiverseid = id;\n } else {\n options.id = id; // just asume a hash here\n }\n return fetch(getCardsURI(options)).catch(catchError).then(extractHeaderMeta).then(function (result) {\n /* eslint-disable no-param-reassign */\n result.NOTE = RECOMMEND_GET_CARDS;\n /* eslint-enable no-param-reassign */\n return result;\n });\n}", "title": "" }, { "docid": "b6bf455e29f50fd0c2cc957447ee5195", "score": "0.55601704", "text": "function displayHandCard(cardStr) {\n var card = cardInfo[cardStr];\n $(\"#hand\").append(\"<div class='card-wrapper'>\" +\n \"<img src='\" + card.src + \"' data-card='\" + cardStr + \"'class='\" + card.classes + \"'>\" + \n \"</div>\");\n \n }", "title": "" }, { "docid": "eff6129891d29a7b4a8db5258375e2f5", "score": "0.55586123", "text": "function displayCard() {\n background(147, 176, 204);\n noStroke();\n\n //creates a big \"card\" in which information will be displayed\n fill(210);\n rect(width * 0.05, height * 0.05, width * 0.9, height * 0.9, 10);\n fill(255, 125, 162);\n rect(width * 0.06, height * 0.06, width * 0.88, height * 0.88, 10);\n\n //\"Trainer Card\" title\n fill(0);\n textSize(50);\n text(\"Trainer Card\", width * 0.15, height * 0.2, width * 0.6, height * 0.2);\n\n //displays info\n textSize(20);\n text(\"Name: \" + mainPlayer.name, width * 0.2, height * 0.4, width * 0.6, height * 0.2);\n text(\"Money: $\" + String(leCash), width * 0.2, height * 0.5, width * 0.6, height * 0.2); \n text(\"Time Played: \" + String(floor((millis()/1000) / 60)) + \" min. \" + String(floor((millis()/1000) % 60)) + \" s.\", width * 0.2, height * 0.6, height * 0.6, height * 0.2);\n\n //displays player icon\n image(trumpPic, width * 0.66, height * 0.55, 175, 300);\n}", "title": "" }, { "docid": "34957db76ba06bd6469677d86ebcd465", "score": "0.5521197", "text": "function findCard(searchText) {\n for each (card in cardList) {\n if (exactMatch(searchText, card.title) || synonymMatch(searchText, card.title)) {\n imagesrc = imageUrlTemplate.replace('{code}', card.code);\n return({\n imagesrc: imagesrc,\n side: card.side_code,\n url: baseCardUrl + card.code\n });\n }\n }\n return null;\n}", "title": "" }, { "docid": "9694875f99c5019fcd5af46a8ce9b56f", "score": "0.5516255", "text": "function showCredits(){\n\t\n\tvar credits = 'This Magic the Gathering deck building tool is built and maintained by Dashiel Nemeth, and hosted on <a href=\"https://github.com/ChainsawXIV/deckbuilder\" target=\"_blank\">GitHub</a>. Submit bug reports and feature requests on the issues page, <a href=\"https://github.com/ChainsawXIV/deckbuilder/issues\" target=\"_blank\">here</a>.<br><br>Card data for this project is provided by:<ul><li><a href=\"https://mtgjson.com/\" target=\"_blank\">https://mtgjson.com/</a></li><li><a href=\"http://gatherer.wizards.com/Pages/Default.aspx\" target=\"_blank\">http://gatherer.wizards.com/</a></li></ul>Magic the Gathering and all associated information and materials are the property of <a href=\"https://magic.wizards.com\" target=\"_blank\">Wizards of the Coast</a>, and this tool is not associated with Wizards of the Coast in any way.<br><br><b>Update History</b><br><br>';\n\tcredits += '<u>Version 0.2.2 (July 17th, 2018)</u><ul><li>Fixed additional filtering, deck and card validation, and layout related bugs.</li><li>Significantly improved card rating data by averaging across all printings of a particular card.</li></ul>';\n\tcredits += '<u>Version 0.2.1 (January 10th, 2018)</u><ul><li>Fixed a number of edge cases and bugs with user interactions and filtering.</li><li>Added card rarity to the data set and denoted it on the card list for building pauper.</li></ul>';\n\tcredits += '<u>Version 0.2.0 (January 6th, 2018)</u><ul><li>Major code cleanup and bug fixing pass, resolving numerous issues and improving performance.</li><li>Added support for importing and exporting deck lists in the standard text format.</li><li>Added support for cards with unusual deck building rules such as Planeswalker commanders.</li></ul>';\n\tcredits += '<u>Version 0.1.0 (January 2nd, 2018)</u><ul><li>First pass implementation of all core deck building and card lookup features, plus local saving.</li><li>First pass interface design and implementation for current and upcoming feature set.</li></ul>';\n\t\n\tDECK.dialog.show( {\n\t\tallowClose:true,\n\t\ttitle:\"Deck Builder Information\",\n\t\tbody:credits\n\t} );\n\t\n}", "title": "" }, { "docid": "51f3addabb03a678a9c61bb38934be61", "score": "0.550581", "text": "function retrieveCommunityChestInfo() {\n var communityChest = [];\n \n $('#formCommunityChest').find('div.oneCommunityChest').each(function (index, element) {\n communityChest[index] = new Card();\n \n $(this).find('input').each(function (innerIndex, innerElement) {\n switch (innerIndex) {\n case 0:\n if ($(this).val() !== \"\") {\n communityChest[index].setName($(this).val());\n }\n else {\n communityChest[index].setName($(this).attr('placeholder'));\n }\n break;\n case 1:\n communityChest[index].setType($(this).attr('placeholder'));\n break;\n case 2:\n if ($(this).val() !== \"\") {\n communityChest[index].setDescription($(this).val());\n }\n else {\n communityChest[index].setDescription($(this).attr('placeholder'));\n }\n break;\n }\n });\n });\n \n jsonObject += \"\\\"communityChest\\\" : [\";\n \n for (var i = 0; i < communityChest.length; i++) {\n jsonObject += communityChest[i].toJson();\n if (i !== (communityChest.length - 1)) {\n jsonObject += \",\";\n }\n }\n jsonObject += \"],\";\n}", "title": "" }, { "docid": "28a62a6b3a5fef40de7ad1f92f064c7c", "score": "0.550062", "text": "DisplayName(){\n let cardType = this.props.card.type_line;\n if (cardType.includes(\"land\") || cardType.includes(\"Land\")){\n return(<div><h6>\n <Badge class = \"Primary\" variant=\"primary\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n else if ((cardType.includes(\"Creature\") || cardType.includes(\"creature\"))){\n return(<div>\n <h6>\n <Badge class = \"Secondary\" variant=\"secondary\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n else if ((cardType.includes(\"Enchantment\") || cardType.includes(\"enchantment\"))){\n return(<div>\n <h6>\n <Badge class = \"Secondary\" variant=\"success\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n else if ((cardType.includes(\"artifact\") || cardType.includes(\"Artifact\"))){\n return(<div>\n <h6>\n <Badge class = \"Secondary\" variant=\"warning\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n else if ((cardType.includes(\"Instant\") || cardType.includes(\"instant\"))){\n return(<div>\n <h6>\n <Badge class = \"Secondary\" variant=\"warning\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n else if ((cardType.includes(\"Sorcer\") || cardType.includes(\"sorcer\"))){\n return(<div>\n <h6>\n <Badge class = \"Secondary\" variant=\"info\">{this.props.card.name} </Badge>{' '}\n </h6>\n </div>);\n }\n }", "title": "" }, { "docid": "d20e258a9d0dcf592c7bca569533c752", "score": "0.5494803", "text": "function formatCard(data) {\n return {\n image: data.cards[0].image,\n id: uuid()\n };\n}", "title": "" }, { "docid": "645e58cf7cfa4ed754363a08b0afe67d", "score": "0.5486604", "text": "async function getOneCard() {\n let data = await $.getJSON(`${baseURL}/new/draw/?count=1`);\n console.log(`${data.cards[0].value} of ${data.cards[0].suit}`);\n }", "title": "" }, { "docid": "c604707c33c64d766beedbe0fa0a3248", "score": "0.5460569", "text": "function showCards () {\n\n var arr = require(\"./cardArr.json\");\n\n if (count < arr.length) { \n\n if (arr[count].front !== undefined) { \n console.log(`\\n`);\n console.log(colors.rainbow(\"-+-+-+-+-+-+-+-+-+-+- Basic Card -+-+-+-+-+-+-+-+-+-+-\"));\n console.log(colors.blue(\"-+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-\"));\n console.log(\"Front: \" + arr[count].front); \n console.log(colors.yellow(\"------------------------------------------------\"));\n console.log(\"Back: \" + arr[count].back + \".\");\n console.log(colors.blue(\"-+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-\"));\n console.log(`\\n`);\n\n } else { \n console.log(`\\n`);\n console.log(colors.rainbow(\"-+-+-+-+-+-+-+-+-+- Fill in the Blank Card -+-+-+-+-+-+-+-+-+-\"));\n console.log(colors.blue(\"-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-\"));\n console.log(\"Statment: \" + arr[count].text); \n console.log(colors.yellow(\"------------------------------------------------\"));\n console.log(\"Blank: \" + arr[count].cloze + \".\"); \n console.log(colors.blue(\"-+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+--+-+-+-+-+-+-+-+-+-+-\"));\n console.log(`\\n`);\n }\n count++;\t\t\n showCards();\t\n } else {\n count=0;\t\t\n promptMenu();\t\t\n }\n}", "title": "" }, { "docid": "adc441b472bce30831ca43388406528a", "score": "0.5455018", "text": "function getData(data) {\n console.log(data);\n console.log(data[0].charityName);\n console.log(data[0].mission);\n console.log('Rating: ' + data[0].currentRating.rating);\n console.log(data[0].websiteURL);\n console.log(data[0].irsClassification.subsection);\n\n //Loop Through Data Returned and create at most nine charity cards for the results\n\n for (var i = 0; i < data.length; i++) {\n // Store the charity name, mission, and mailing address locally in an array\n missions.push({\n name: data[i].charityName,\n mission: data[i].mission,\n addr:\n data[i].mailingAddress.streetAddress1 +\n ' ' +\n data[i].mailingAddress.city +\n ', ' +\n data[i].mailingAddress.stateOrProvince +\n ' ' +\n data[i].mailingAddress.postalCode,\n });\n\n // Make a div for indexing eacch charity by name\n var $npDiv = $(\n '<div id=\"index-' +\n i +\n '\" class=\"col s6 m4 cardcol for-buttons\" data-Name=\"' +\n data[i].charityName +\n '\"></div>'\n );\n\n //Card Div\n var $mycard = $('<div class=\"card\" style=\"height:275px\"></div>');\n\n var $cardContent = $(\n '<div class=\"card-image waves-effect waves-block waves-light\"><img class=\"activator\" src=\"images/mochaGrunge.png\" style=\"height:130px;\"><span class=\"card-title charity-title\" style=\"padding:15px;\">' +\n data[i].charityName +\n '</span></div>'\n );\n\n //var $cardContentAction = $('<div class=\"card-action\" style=\"height:40%;padding: 5px 18px;\">');\n var $cardContentAction = $(\n '<div class=\"card-action\" style=\"overflow:auto;\">'\n );\n\n var $cardContentSpan = $(\n '<p class=\"card-title activator grey-text text-darken-4\" style=\"font-size:15px;line-height:1.0rem; margin:16px;\" ></p>'\n );\n $cardContentSpan.append(\n '<span style=\"font-size: 18px;line-height: 1.2rem;\">' +\n data[i].tagLine +\n '</span>'\n );\n\n var $icon = $('<i>');\n $icon.addClass('activator material-icons right');\n $icon.text('more_vert');\n\n var $cardRatingImg = $(\n '<img src=\"' +\n data[i].currentRating.ratingImage.large +\n '\" class=\"img-rating\">'\n );\n\n //$cardContentSpan.append($icon);\n $cardContentAction.append($cardContentSpan);\n $cardContentAction.append($icon);\n\n //Card Reveal Creation\n var $cardReveal = $('<div>');\n $cardReveal.addClass('card-reveal');\n\n // Add the charity name to the card\n var $cardRevealSpan = $('<p>');\n $cardRevealSpan.addClass('card-title grey-text text-darken-4');\n $cardRevealSpan.css({ 'font-size': '22px', 'line-height': '1.4rem' });\n $cardRevealSpan.append(data[i].charityName);\n\n var $cardRevealIcon = $('<i>');\n $cardRevealIcon.addClass('card-reveal-close-icon material-icons right');\n $cardRevealIcon.css({ 'margin-left': '0', 'line-height': '1.25' });\n $cardRevealIcon.text('close');\n\n $cardRevealSpan.append($cardRevealIcon);\n\n // Add a reveal div to display deductible status, url link, and button for adding to favorites\n var $cardRevealP = $(\"<p class='card-reveal-deductible-text'>\");\n $cardRevealP.text(data[i].irsClassification.deductibility);\n var $cardRevealP2 = $(\"<p class='card-reveal-contribute-button'>\");\n var $cardRevealLink1 = $(\n '<a href=\"' + data[i].websiteURL + '\" target=\"_blank\">'\n );\n $cardRevealLink1.text('Contribute');\n $cardRevealP2.append($cardRevealLink1);\n var $cardRevealP3 = $('<p>');\n var $cardRevealBtn = $(\n '<button data=\"' +\n i +\n '\" class=\"favChar card-reveal-favorite-button\"></button>'\n );\n $cardRevealBtn.text('Favorites');\n $cardRevealP3.append($cardRevealBtn);\n\n $cardReveal\n .append($cardRevealSpan)\n .append($cardRevealP)\n .append($cardRevealP2)\n .append($cardRevealP3);\n\n // Appending CardImg, CardContent, and Card Reveal to its div\n $mycard.append($cardContent);\n $mycard.append($cardContentAction);\n $mycard.append($cardRatingImg);\n $mycard.append($cardReveal);\n $npDiv.append($mycard);\n\n //Appending to id=display-nonprofit\n $('#resultsRow').append($npDiv);\n }\n }", "title": "" }, { "docid": "39cdf16ee0802d5bcf165733d1b12298", "score": "0.54526", "text": "function charactersForCard() {\n return characters.map((char) => ({\n id: char.id,\n title: char.name,\n description: char.description,\n figure: {\n src: `${char.thumbnail.path}.${char.thumbnail.extension}`,\n alt: `Marvel's character ${char.name} thumbnail`,\n },\n }));\n }", "title": "" }, { "docid": "e9f2cece9440b61abeb5f792e0eb6bbc", "score": "0.5451939", "text": "function make_info_divs(){\r\n //console.log( 'func.make_info_div START');\r\n let i_of_found_card;\r\n v_side_div1.innerHTML = \"\";\r\n v_side_div2.innerHTML = \"\";\r\n card_marked = true;\r\n for (i=0;i<to_reprts_arr.length; i++){ \r\n \r\n for (i2=0 ; i2<all_coins_arr.length ; i2++){\r\n if (all_coins_arr[i2] === to_reprts_arr[i]) {\r\n i_of_found_card = i2;\r\n break\r\n }\r\n }\r\n card[i_of_found_card].children[4].click();// Recent Info btn clicked. (cause to fetch info to reports section)\r\n } // for i<to_reprts_arr.length close\r\n }", "title": "" }, { "docid": "62496fa4cc62fd86d3feb369d0635d60", "score": "0.54458797", "text": "function buildCard(loan){\n var result = \"<div class='col-33 fl'><div class='ph-20 card'><h3 style='text-align:center;'>\" + loan.title + \"</h3>\" +\n\t\t\t\t\"<h4 style='color:#162d5a; padding-top: 15px; font-weight: 600'>Loan Details:</h4>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Loan Amount:</span> $\" + formatNumber(loan.balance.toFixed(0)) + \"<br /></p>\" +\n \"<p><span class='fw-sb'>Interest Rate:</span> \" + (loan.interestRate*100).toFixed(2) + \"%<br /></p>\" +\n \"<p><span class='fw-sb'>Term Length:</span> \" + loan.terms + \" Months<br /></p>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Warrant:</span> \" + (loan.warrant*100) + \"%<br /></p>\" +\n\t\t\t\t\"<h4 style='color:#162d5a; padding-top: 15px; font-weight: 600'>Repayment Summary:</h4>\" +\n \"<p><span class='fw-sb'>Monthly Payment:</span> $\" + formatNumber(loan.payment.toFixed(0)) + \"<br /></p>\" +\n \"<p><span class='fw-sb'>Interest Paid:</span> $\" + formatNumber(loan.interest_paid.toFixed(0)) + \"<br /></p>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Warrant Value:</span> $\" + formatNumber(loan.warrant_cost.toFixed(0)) + \"<br /></p>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Total Cost of Capital:</span> $\" + formatNumber(loan.cost_of_capital.toFixed(0)) + \"<br /></p>\" +\n\t\t\t\t\"<h4 style='color:#162d5a; padding-top: 15px; font-weight: 600'>Company Details:</h4>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Starting Valuation:</span> $\" + formatNumber(loan.valuation.toFixed(0)) + \"<br /></p>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Growth Rate:</span> \" + (loan.growth*100).toFixed(2) + \"%<br /></p>\" +\n\t\t\t\t\"<p><span class='fw-sb'>Sale Valuation:</span> $\" + formatNumber(loan.saleValuation.toFixed(0)) + \"<br /></p></div></div>\"\n\n\t//returns the concatenated string to the page\n return result;\n}", "title": "" }, { "docid": "bed17a5b54a97659ab34c1807ea5ab3f", "score": "0.54406536", "text": "function getChallengeCard() {\n var number = Math.floor(Math.random() * challengeCards[countryValue].length);\n var specialMsg = \"\"; //TEMP TESTING\n // debug to test specific cards\n if (cCard != -1) {\n if (cCard >= challengeCards[countryValue].length) {\n console.log(\"cCard value out of bounds!!\");\n }\n else {\n number = cCard;\n console.log(\"debugging specific card\");\n }\n }\n console.log(\"Challenge Card! : \" + number);\n // UpdateUserMessage(\"Challenge Card!\\n\\n\" + challengeCards[number].title + \"\\n\" + challengeCards[number].text + \"\\n\" + challengeCards[number].impact);\n var _title = challengeCards[countryValue][number].title;\n var _msg = challengeCards[countryValue][number].text + \"<br><br>\" + challengeCards[countryValue][number].impact;\n UpdatePopup(_title, _msg, \"red\");\n // checking for special case cards\n if (challengeCards[countryValue][number].special) {\n \tspecialMsg = challengeCards[countryValue][number].special;\n \tspecialCards(challengeCards[countryValue][number].special); \t \t\n }\n impactStats(challengeCards[countryValue][number].hp, challengeCards[countryValue][number].wp, challengeCards[countryValue][number].ep, challengeCards[countryValue][number].gb);\n UpdateHUD(player1.hp, player1.wp, player1.gb, player1.ep);\n // pass data to console\n console.log(\"**********CARD DATA**********\");\n console.log(_title);\n console.log(challengeCards[countryValue][number].impact);\n console.log(specialMsg);\n console.log(\"*****************************\");\n}", "title": "" }, { "docid": "fd96b363a17654f2fd2094ff281ec56f", "score": "0.54356265", "text": "function displayCard(card,multiple){\n\n var displayDiv = document.getElementById(\"display\");\n\n if(multiple == false) {\n displayDiv.innerHTML = \"\";\n }\n var cardImage = document.createElement(\"IMG\");\n cardImage.src = card.image;\n\n var description = document.createElement(\"p\");\n var descriptionNode = document.createTextNode(\"Description: \"+card.description);\n description.appendChild(descriptionNode);\n\n var cardName = document.createElement(\"p\");\n var cardNameNode = document.createTextNode(\"Name: \"+ card.name);\n cardName.appendChild(cardNameNode);\n\n\n var suit = document.createElement(\"p\");\n var suitNode = document.createTextNode(\"Suit: \"+ card.suit);\n suit.appendChild(suitNode);\n\n var element = document.createElement(\"p\");\n var elementNode = document.createTextNode(\"Element: \"+ card.element);\n element.appendChild(elementNode);\n\n var attributes = document.createElement(\"p\");\n\n min = Math.ceil(2);\n max = Math.floor(1);\n var upOrDown = Math.round(Math.random() * (max - min) + min);\n\n if(upOrDown == 1){\n attributes.appendChild(document.createTextNode(\"Attributes: \"))\n for(var i = 0; i < card.face_up.length; i++){\n var value = card.face_up[i];\n if(i != 0){\n attributes.appendChild(document.createTextNode(\",\" + value));\n }else {\n attributes.appendChild(document.createTextNode(value));\n }\n }\n }else if(upOrDown == 2){\n attributes.appendChild(document.createTextNode(\"Attributes: \"))\n for(var i = 0; i < card.face_down.length; i++){\n var value = card.face_down[i];\n if(i != 0){\n attributes.appendChild(document.createTextNode(\",\" + value));\n }else {\n attributes.appendChild(document.createTextNode(value));\n }\n }\n }\n\n displayDiv.appendChild(element);\n displayDiv.appendChild(attributes);\n displayDiv.appendChild(description);\n displayDiv.appendChild(cardImage);\n displayDiv.appendChild(cardName);\n displayDiv.appendChild(suit);\n}", "title": "" }, { "docid": "d8d800a834943ee090577a9b17642b79", "score": "0.54344356", "text": "function buildCards(selector, rooms) {\n selector.innerHTML = ''\n for(let i = 0; i < rooms.length; i++){\n\n const id = rooms[i].id\n const image = replaceSizeImage(rooms[i].photo)\n const name = toCapitalize(rooms[i].name)\n const price = formatCurrency(rooms[i].price)\n const property_type = rooms[i].propertyType\n const style_props = stylePropertyType(property_type)\n selector.innerHTML += `\n <div class=\"col-sm-6 col-md-4 col-xl-3 mt-4\">\n <div class=\"card\">\n <img class=\"card-img-top\" height=\"246\" src=\"${image}\" alt=\"#\">\n <div class=\"card-body\">\n <h6 class=\"card-title\">${name}</h6>\n <span class=\"badge ${style_props}\">${property_type}</span>\n <div class=\"mt-34px\">\n ${price}\n </div>\n </div>\n <div class=\"card-footer c-white\">\n <i class=\"fa fa-plus pr-1\"></i>\n <a id=\"link-details\" href class=\"c-white text-decoration-none\" data-card-id=\"${id}\" data-toggle=\"modal\" data-target=\"#modal_response\">\n Mais detalhes\n </a>\n </div>\n </div>\n </div>\n `;\n }\n}", "title": "" }, { "docid": "05955700e50f757ce8c1570ad4097f3c", "score": "0.5430847", "text": "function displayPreferredDeal(currencySymbol, flightData, index) {\n var flightCard = '<div class=\"card center\">'\n + '<div class=\"card-body row\">'\n + '<div class=\"col\">'\n + '<p class=\"results\">' + getCarrierName(flightData.Carriers, flightData.Quotes[index].OutboundLeg.CarrierIds[0]) + '</p>'\n + '<p class=\"results\">' + getFlightStatus(flightData.Quotes[index].Direct) + '</p>'\n + '<p class=\"results\">' + currencySymbol + \" \" + flightData.Quotes[index].MinPrice + '</p>'\n + '</div>'\n + '<div class=\"col\">'\n + '<img class=\"float-right\" src=\"images/star3.gif\" width=\"50\" height=\"50\">'\n + '</div>'\n + '</div>'\n + '</div>'\n + '<br>';\n return flightCard;\n}", "title": "" }, { "docid": "2efd82594265775a798d97b32425e0ef", "score": "0.5429943", "text": "static showCards() {\n let numberOfCardPairs = UI.getNumberOfCardPairs();\n let cardUrlArray = UI.getCardUrls(numberOfCardPairs);\n cardUrlArray.forEach((url, i) => {\n document.querySelector('.cards').innerHTML += `\n <div class=\"cardCtn\">\n <img src=\"img/card-back.jpg\" data-onclick=\"${url}\" alt=\"card${i + 1}\" data-show=\"false\" data-permanentShow=\"no\" id=\"card${i + 1}\" />\n </div>\n `;\n })\n }", "title": "" }, { "docid": "a2b104be08f2b1678566ac5629136395", "score": "0.5427952", "text": "getCardsHTML() {\n return `<div class=\"tCity\"> \n <div class=\"flex1Items\"> \n <div class=\"citname\">${this.cityName}</div>\n <div class=\"cittime\">${this.getTime()}</div>\n <div class=\"citdate\">${this.getDate()}</div>\n <div class=\"cithum\"><img src=\"assets/Weather Icons/humidityIcon.svg\" alt=\"weather\"><span class=\"hpValue\">${\n this.humidity\n }</span></div>\n <div class=\"citwind\"><img src=\"assets/Weather Icons/precipitationIcon.svg\" alt=\"weather\"><span class=\"hpValue\">${\n this.precipitation\n }</span></div>\n </div>\n <div class=\"flex2Items\">\n <img id=\"citweat\" src=\"assets/Weather Icons/${weatherIcon}.svg\" alt=\"weather\">\n <div class=\"deg\">${this.temperature}</div>\n </div>\n </div> `;\n }", "title": "" }, { "docid": "b972528d49a80cd00061567938b61810", "score": "0.5425393", "text": "function DisplayCards() {\r\n // logic to displayCards\r\n var list = CardsMacker();\r\n replacer(list);\r\n}", "title": "" }, { "docid": "49febbb058f73cdaa01d09717b6a7444", "score": "0.5423918", "text": "function updateTurnInfo(numActions, numBuys, numTreasures, cardStr, actionText) {\n if (cardStr !== undefined) {\n var card = cardInfo[cardStr];\n $(\"#playedCards\").append(\"<div class='card-wrapper'>\" + \n \"<img src='\" + card.src + \"' data-card='\" + cardStr + \"'class='\" + card.classes + \"'>\" + \n \"</div>\");\n }\n if (numActions !== undefined) {\n $(\"#numActions\").prop(\"innerHTML\", numActions);\n } \n if (numBuys !== undefined) {\n $(\"#numBuys\").prop(\"innerHTML\", numBuys);\n }\n if (numTreasures !== undefined) {\n $(\"#numTreasures\").prop(\"innerHTML\", numTreasures);\n }\n if (actionText !== undefined) {\n $(\"#actionText\").prop(\"innerHTML\", actionText);\n }\n }", "title": "" }, { "docid": "cf4f4ef9a744969d0d2562130bd34fc2", "score": "0.5419321", "text": "function ClozeCard(fullText, cloze) {\n this.fullText = fullText; \n this.cloze = cloze;\n this.partial = fullText.replace(cloze, \"...\");\n if (!fullText.includes(cloze)) {\n\t\tconsole.log('ERROR: the word(s) <'+ cloze +'> does not appear within full text.');\n }\n \n\n}", "title": "" }, { "docid": "9318d54964e4f0b02283c72d82fbf0a4", "score": "0.5414902", "text": "getInfo() {\n return \"Hi, I am a cat named \" + this.name + \". I weigh \" + this.weight + \" pounds and cost $\" + this.cost + \".\";\n }", "title": "" }, { "docid": "b60a2c03044cca8bd488122ab5063246", "score": "0.54042184", "text": "function displayDeal(currencySymbol, flightData, index) {\n var flightCard = '<div class=\"card center\">'\n + '<div class=\"card-body\">'\n + '<p class=\"results\">' + getCarrierName(flightData.Carriers, flightData.Quotes[index].OutboundLeg.CarrierIds[0]) + '</p>'\n + '<p class=\"results\">' + getFlightStatus(flightData.Quotes[index].Direct) + '</p>'\n + '<p class=\"results\">' + currencySymbol + \" \" + flightData.Quotes[index].MinPrice + '</p>'\n + '</div>'\n + '</div>'\n + '<br>';\n return flightCard;\n}", "title": "" }, { "docid": "ffb43d5d91fc3e0e379359a761745740", "score": "0.5397524", "text": "function getInfo(){}", "title": "" }, { "docid": "f5018101ce395493f7fe528fbf389d3d", "score": "0.53845483", "text": "function getCustomerInfo(nfcCode) {\n\twcfRequest('get', '/cards/' + nfcCode, callback);\n\n\tfunction callback(err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Some errors occurred: \", err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (response.statusCode === 200) {\n\t\t\t//console.log(\"Yup, customer info:\", JSON.stringify(body, null, 4))\n\t\t} else {\n\t\t\tconsole.log(\"Response code\", response.statusCode)\n\t\t\tconsole.log(\"Response body\", body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f5018101ce395493f7fe528fbf389d3d", "score": "0.53845483", "text": "function getCustomerInfo(nfcCode) {\n\twcfRequest('get', '/cards/' + nfcCode, callback);\n\n\tfunction callback(err, response, body) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Some errors occurred: \", err);\n\t\t\treturn;\n\t\t}\n\n\t\tif (response.statusCode === 200) {\n\t\t\t//console.log(\"Yup, customer info:\", JSON.stringify(body, null, 4))\n\t\t} else {\n\t\t\tconsole.log(\"Response code\", response.statusCode)\n\t\t\tconsole.log(\"Response body\", body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c37f0656fa9334372f0a7f08e97c5707", "score": "0.538386", "text": "function createCard(value){\n\n var card_content = document.createElement(\"div\");\n $(card_content).addClass(\"card-panel center-align custom-bg \");\n // create img\n var img = createImg(value.avatar);\n card_content.append(img);\n\n // create card_title\n var title = document.createElement('h5');\n $(title).text(value.name);\n card_content.append(title);\n\n //create town and county_name\n var local = document.createElement('p');\n $(local).text(value.town + ' ' + value.county_name);\n if (value.tag =='groupes'){\n // create type and musicial genre\n var type_mg = document.createElement('p');\n $(type_mg).text(value.type + ' ' + value.musical_genre);\n $(card_content).append(type_mg);\n //here insert localisation\n $(card_content).append(local);\n // create bio\n var bio = document.createElement('p');\n var short_bio = $.trim(value.bio).substring(0, 100);\n $(bio).text(short_bio+' ...');\n // create link to profile\n var link= linkProfileBand(value.slug);\n bio.append(link);\n $(card_content).append(bio);\n }\n\n else if (value.tag == 'musicians'){\n $.each(value.instrument, function(index, instru){\n var instrument = document.createElement('p');\n $(instrument).text(instru);\n $(card_content).append(instrument);\n });\n //here insert localisation\n $(card_content).append(local);\n var link= linkProfileMusicians(value.pk);\n $(card_content).append(link);\n\n }\n return card_content;\n\n}", "title": "" }, { "docid": "3ee71a8b3d30fa07b5f7c639958e18cf", "score": "0.5378922", "text": "function displayCards(responseJson) {\r\n console.log(responseJson);\r\n $('.results').empty();\r\n const cardSearch = responseJson.cards.filter(card => Object.keys(card).includes(\"imageUrl\"));\r\n console.log(cardSearch); \r\n\r\n if(cardSearch.length === 0) {\r\n $('.results').append(`\r\n <div class=\"unknown-search\">\r\n\t\t\t <h2>No card found with that title!</h2>\r\n\t\t\t <p>Please enter any part of the card's title(followed by a comma for multiple searches.</p>\r\n </div>\r\n `)\r\n }\r\n else {\r\n for(i = 0;i < cardSearch.length; i++) {\r\n $('.results').append(`\r\n <div class=\"result-box\">\r\n <h2>${cardSearch[i].name}</h2>\r\n <div class=\"card\">\r\n <img src=\"${cardSearch[i].imageUrl}\" alt=\"${cardSearch[i].name}\" id=\"${cardSearch[i].name}\">\r\n <ul>\r\n <li>Rarity: ${cardSearch[i].rarity} </li>\r\n <li>Set Name: ${cardSearch[i].setName}</li>\r\n <li>Card Description: \"${cardSearch[i].text}\"</li>\r\n\t </ul>\r\n </div>\r\n </div>\r\n `)};\r\n }\r\n}", "title": "" }, { "docid": "9522af7267e0ce5022603c20bfc3a802", "score": "0.53688776", "text": "createCard(textFront, textBack) {\n this.card = this.add.image(0, 0, \"card\").setInteractive();\n this.card.setScale(2.75);\n this.card.alpha = 0.7;\n\n let textStyle = {\n color:'#000000',\n align:\"center\",\n fontFamily: 'Abel',\n boundsAlignH: \"center\",\n fontSize: '60px',\n wordWrap: {\n width: this.card.width * 2.25,\n useAdvancedWrap: false\n }\n };\n\n this.question = this.add.text(0, 0, textFront, textStyle).setOrigin(0.5);\n this.info = this.add.text(0, 0, textBack, textStyle).setOrigin(0.5);\n this.info.visible = false;\n //container for the card\n this.container = this.add.container(this.canvasGame.width / 2, this.canvasGame.height / 2)\n .setSize(this.canvasGame.width * 0.5, this.canvasGame.width * 0.5)\n .setInteractive();\n this.container.add([this.card, this.question, this.info]);\n }", "title": "" }, { "docid": "13bc13e209ff1b680547eff7a8a3b7c8", "score": "0.53634185", "text": "function scry(cards)\n{\n\tvar result = []\n\tfor (var i in cards)\n\t{\n\t\tvar c = cards[i]\n\t\tvar cardResult = {}\n\t\tcardResult.name = c.name\n\t\tcardResult.count = c.count\n\t\tif (c.no)\n\t\t{\n\t\t\tvar req = new XMLHttpRequest()\n\t\t\treq.open(\"GET\", \"https://api.scryfall.com/cards/\"+c.set.toLowerCase()+\"/\"+c.no, false)\n\t\t\treq.onreadystatechange = function()\n\t\t\t{\n\t\t\t\tif (this.readyState != 4 || this.status != 200)\n\t\t\t\t{\n\t\t\t\t\tif (this.status == 404)\n\t\t\t\t\t\talert(`Card not found: ${c.set}/${c.no} (${c.name})`)\n\t\t\t\t}\n\t\t\t\tif (req.response == \"\")\n\t\t\t\t{ }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar resp = JSON.parse(req.response)\n\t\t\t\t\t// TODO handle manage double-faced cards\n\t\t\t\t\tcardResult.alternatives=[ buildCuratedCard(resp) ] \n\t\t\t\t}\n\t\t\t}\n\t\t\treq.send()\n\n\t\t}\n\t\telse\n\t\t{\n\t\tvar req = new XMLHttpRequest()\n\t\treq.open(\"GET\", \"https://api.scryfall.com/cards/named/?fuzzy=\"+c.name.replace(\" \", \"+\"), false)\n\t\treq.onreadystatechange = function()\n\t\t{\n\t\t\tif (this.readyState != 4 || this.status != 200)\n\t\t\t\treturn\n\t\t\t//console.log(req.response.toString())\n\t\t\tif (req.response == \"\")\n\t\t\t{ }\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar resp = JSON.parse(req.response)\n\t\t\t\t// TODO untangle this later\n\t\t\t\tvar nreq = new XMLHttpRequest()\n\t\t\t\tnreq.open(\"GET\", resp.prints_search_uri, false)\n\t\t\t\tnreq.onreadystatechange = function()\n\t\t\t\t{\n\t\t\t\t\tif (this.readyState != 4 || this.status != 200)\n\t\t\t\t\t\treturn\n\t\t\t\t\tif (req.response == \"\")\n\t\t\t\t\t{ }\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar nresp = JSON.parse(nreq.response)\n\t\t\t\t\t\tvar alternates = []\n\t\t\t\t\t\tfor (var d in nresp.data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talternates.push(buildCuratedCard(nresp.data[d]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//console.log(alternates)\n\t\t\t\t\t\tcardResult.alternatives = alternates\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnreq.send()\n\t\t\t}\n\t\t}\n\t\treq.send()\n\n\t\t}\n\t\tresult.push(cardResult)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "b21e40daed736a2f9abc00b0d6a22fe4", "score": "0.5361685", "text": "function getCollectibleCardsJSON(){\n return new Promise(resolve => {\n request('https://api.hearthstonejson.com/v1/latest/enUS/cards.collectible.json', function (error, response, body) {\n resolve(JSON.parse(body));\n });\n });\n}", "title": "" }, { "docid": "072d573550928508e58d045825430275", "score": "0.53588104", "text": "function buildCuratedCard(sfData)\n{\n\tvar r = {}\n\tr.set = sfData.set\n\tr.set_name = sfData.set_name\n\tr.no = sfData.collector_number\n\tr.artist = sfData.artist\n\tif (sfData.image_uris)\n\t\tr.url = sfData.image_uris.small\n\telse\n\t{\n\t\tr.url = sfData.card_faces[0].image_uris.small\n\t\tr.url_back = sfData.card_faces[1].image_uris.small\n\t}\n\treturn r\n}", "title": "" }, { "docid": "2d17379e68a42247c901ae343548dbe5", "score": "0.53561795", "text": "function clozeCard (text, cloze) {\n\tif(!(this instanceof clozeCard)) {\n\t\treturn new clozeCard (text, cloze);\n\t}\n\n\tthis.text = text;\n\tthis.cloze = cloze;\n\n\tvar replace = this.text.replace(this.cloze, \"...\");\n\n\t// if user inputs \"cloze\", the user will be shown the cloze which contains the missing word\n\tif (side === \"cloze\") {\n\t\tconsole.log(\"Cloze: \" + replace);\n\t}\n\t// if the user inputs \"text\", the user will be shown the text with the missing word answered\n\telse if (side === \"text\") {\n\t\tconsole.log(\"Text: \" + this.text);\n\t}\n\t// if the user inputs \"both\", the user will be shown both sides of the card which contains the cloze and the text\n\telse if (side === \"both\") {\n\t\tconsole.log(\"Cloze: \" + replace);\n\t\tconsole.log(\"Text: \" + this.text);\n\t}\n\t// if the side is not recognized, it will let the user know\n\telse {\n\t\tconsole.log(\"Error: Input not recognized\");\n\t}\n}", "title": "" }, { "docid": "a3c89a30d9ffcbd7f72bf4dbb8d2bc92", "score": "0.5355125", "text": "function renderCocktail(drinkInfo) {\n\n //Creating column to append to #choices row\n let column = $(\"<div>\");\n column.addClass(\"col s12 m6\");\n\n //create card\n let card = $(\"<div>\");\n card.addClass(\"card z-depth-4\");\n //set up image with title\n let cardImg = $(\"<div>\");\n cardImg.addClass(\"card-image\");\n let img = $(\"<img>\");\n img.attr(\"src\", drinkInfo.strDrinkThumb);\n //set up title\n let titleSpan = $(\"<span>\");\n titleSpan.addClass(\"card-title\");\n let title = $(\"<h3>\");\n title.text(drinkInfo.strDrink);\n titleSpan.append(title);\n cardImg.append(img);\n cardImg.append(titleSpan);\n //done setting up image wit title\n\n //setting up content\n let content = $(\"<div>\");\n content.addClass(\"card-content\");\n\n //Recipe and ingredients ---------\n let ingredientH = $(\"<h4>\");\n ingredientH.text(\"Ingredients:\");\n content.append(ingredientH);\n\n let ingredient = $(\"<p>\");\n ingredient.text(`${1}. ${drinkInfo.strGlass}`);\n content.append(ingredient);\n\n for (let i = 1; i <= 15; i++) {\n\n let measure = eval(\"drinkInfo.strMeasure\" + i);\n let name = eval(\"drinkInfo.strIngredient\" + i);\n\n if (!measure)\n measure = \"\";\n if (name) {\n let ingredient = $(\"<p>\");\n ingredient.text(`${i + 1}. ${measure} ${name}`);\n content.append(ingredient);\n }\n }\n\n let recipeH = $(\"<h4>\");\n recipeH.text(\"Recipe:\");\n let recipe = $(\"<p>\");\n recipe.text(drinkInfo.strInstructions);\n\n content.append(recipeH);\n content.append(recipe);\n\n\n //done setting up content / append to card\n\n card.append(cardImg);\n card.append(content);\n column.append(card);\n $(\"#choices\").append(column);\n}", "title": "" }, { "docid": "13581d066f620900e151375213abf9e9", "score": "0.5347669", "text": "function Cards(data){\n\n data.forEach(character => {\n\n const col = document.createElement('div');\n col.classList.add('col');\n container.appendChild(col);\n\n const card = document.createElement('div');\n card.classList.add('card');\n card.setAttribute('data-bs-toggle',\"modal\");\n card.setAttribute('data-bs-target',\"#exampleModal\");\n card.style.width = '18rem';\n col.appendChild(card);\n\n const img = document.createElement('img');\n img.classList.add('card-img-top');\n img.src = character.image;\n card.appendChild(img);\n\n const cardBody = document.createElement('div');\n cardBody.classList.add('card-body');\n card.appendChild(cardBody);\n\n const title = document.createElement('h5');\n title.classList.add('card-title');\n title.innerHTML = character.name;\n card.appendChild(title);\n\n const species = document.createElement('p');\n species.classList.add('card-text1');\n species.innerHTML = character.species;\n card.appendChild(species);\n\n const status = document.createElement('p');\n status.classList.add('card-text2');\n status.innerHTML = character.status;\n card.appendChild(status);\n\n }) \n}", "title": "" }, { "docid": "d2908f05e41464b4b0d878f34fa89857", "score": "0.53346086", "text": "async function displayInfo(id) {\r\n //giving each card id\r\n index = id;\r\n id = await getCoinsInfo(arrCoins[id].id);\r\n $(`#collapseExample${index}`).html(`\r\n <div class=\"card card-body-info \">\r\n dollar: ${id.market_data?.current_price.usd}$<br>\r\n shekel: ${id.market_data?.current_price.ils}₪<br>\r\n Euro: ${id.market_data?.current_price.eur}€<br>\r\n <img src=${id.image?.small}>\r\n </div>\r\n `);\r\n}", "title": "" }, { "docid": "544af7e3465ac32b89bb0b8e65ccbaea", "score": "0.5330727", "text": "function getCardHtml(currentBuilding) {\n const ratio_string = isNaN(currentBuilding[ratio_key]) ? 'There is no data for this building' : `${parseFloat(currentBuilding[ratio_key]).toFixed(2) * 100}%`;\n return `\n <div style = \"width: 500px\" class=\"ui card\">\n <div style=\"width: 500px\" class=\"image\">\n <img src=\"${building_images[currentBuilding.name] || fallback_image}\">\n </div>\n <div style=\"width: 500px\" class=\"content\">\n <h5 class=\"header\">${currentBuilding.name}</h5>\n <div style=\"text-align: left\" class=\"description\">\n There are ${currentBuilding[number_of_devices_key]} devices connected to the Wifi in ${currentBuilding.name}\n . Maximum number of WiFi devices connected in the last week: ${Math.round(currentBuilding[max_number_of_devices_key])}. \n </div>\n <div class=\"description\">\n <span style=\"font-size: 15px; padding: 0px; line-height: 80%; opacity: 80%\" class=\"date\">Estimated Occupancy: ${ratio_string}</span>\n </div>\n <div style=\"font-size: 15px; text-align: center; opacity: 80%\" class=\"meta\">\n Last Updated: ${currentBuilding[timestamp_key]}\n </div>\n \n `;\n }", "title": "" }, { "docid": "eca84f6f1446c37498ce65b748070fa2", "score": "0.5322597", "text": "function Cards({ data }) {\n const { image, description, title } = data;\n\n console.log(data);\n return (\n <div className=\"flip-card\">\n <div className=\"flip-card__image\">\n <img\n className=\"flip-card__image\"\n src={image}\n alt=\"Inkscape\"\n style={{ width: 175, height: 175 }}\n />\n <img class=\"play\" src={play} alt=\"\" />\n </div>\n <div className=\"flip-card__flip-container\">\n <div className=\"flip-card__inner\">\n <div className=\"flip-card__front\">\n <div className=\"flip-card__info-container\">\n <div className=\"flip-card__info-container--top\">\n <div>\n <h3 className=\"flip-card__title\">{title}</h3>\n <p className=\"flip-card__author\">\n by{\" \"}\n <span className=\"flip-card__author--highlight\">\n Oliver Lyu\n </span>\n </p>\n </div>\n <div className=\"flip-card__info-sub\">\n <p className=\"flip-card__track-info\">2:35</p>\n <p className=\"flip-card__track-info\">95 BPM</p>\n <svg\n className=\"flip-card__arrow\"\n width=\"10\"\n height=\"6\"\n viewBox=\"0 0 10 6\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8.825 -3.85753e-07L5 3.7085L1.175 -5.13609e-08L-2.12363e-07 1.1417L5 6L10 1.1417L8.825 -3.85753e-07Z\"\n fill=\"#1D1D1D\"\n />\n </svg>\n </div>\n </div>\n </div>\n\n <div className=\"flip-card__description\">\n <p>{description}</p>\n </div>\n </div>\n <div className=\"flip-card__back\">\n <div className=\"flip-card__categories\">\n <h4 className=\"flip-card__headings\">Moods</h4>\n <p className=\"flip-card__buttons\">Atmospheric</p>\n <p className=\"flip-card__buttons\">Bright</p>\n <p className=\"flip-card__buttons\">Dreamy</p>\n <p className=\"flip-card__buttons\">Ethereal</p>\n <p className=\"flip-card__buttons\">Fun</p>\n </div>\n\n <div className=\"flip-card__categories\">\n <h4 className=\"flip-card__headings\">Genres</h4>\n <p className=\"flip-card__buttons\">Chill Out</p>\n <p className=\"flip-card__buttons\">Dance/Electronic</p>\n </div>\n\n <div className=\"flip-card__categories\">\n <h4 className=\"flip-card__headings\">Instruments</h4>\n <p className=\"flip-card__buttons\">Drums</p>\n <p className=\"flip-card__buttons\">Percussion</p>\n <p className=\"flip-card__buttons\">Piano</p>\n <p className=\"flip-card__buttons\">Synthesizer</p>\n </div>\n\n <svg\n width=\"10\"\n height=\"6\"\n viewBox=\"0 0 10 6\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8.825 6L5 2.2915L1.175 6L-2.12363e-07 4.8583L5 2.18557e-07L10 4.8583L8.825 6Z\"\n fill=\"#1D1D1D\"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "a0ab2612f8adb673555fc70f65075776", "score": "0.532193", "text": "function constructCard(cardData, type) {\n const toReturn = document.createElement(\"div\");\n toReturn.classList.add(\"res-card\");\n toReturn.classList.add((type === \"product\") ? \"product-card\" : \"invent-card\");\n\n const cardTop = document.createElement(\"div\");\n cardTop.classList.add(\"card-top\");\n\n const cardBottom = document.createElement(\"div\");\n cardBottom.classList.add(\"card-bottom\");\n\n const spanTopTitle = document.createElement(\"span\");\n spanTopTitle.classList.add(\"card-title\");\n spanTopTitle.innerText = (type === \"product\") ? \"PRODUCT\" : \"INVENTORY\";\n\n const spanTopDate = document.createElement(\"span\");\n spanTopDate.classList.add(\"item-date\"); \n spanTopDate.innerText = cardData.date;\n\n const spanBottomName = document.createElement(\"span\");\n spanBottomName.classList.add(\"item-name\");\n spanBottomName.innerText = cardData.name;\n\n const spanBottomSerial = document.createElement(\"span\");\n spanBottomSerial.classList.add(\"item-serial\");\n spanBottomSerial.innerText = \"Serial: \" + ((type === \"product\") ? cardData.serials[0] : cardData.serial);\n\n const spanBottomQty = document.createElement(\"span\");\n spanBottomQty.classList.add(\"item-qty\");\n spanBottomQty.innerText = \"Qty. x\" + cardData.quantity;\n\n cardTop.append(spanTopTitle, spanTopDate);\n cardBottom.append(spanBottomName, spanBottomSerial, spanBottomQty);\n\n // Main Div => Card Top, Card Bottom\n toReturn.append(cardTop, cardBottom);\n toReturn.tabIndex = tab_index++;\n\n toReturn.addEventListener('click', createInfoBox);\n\n // Final Constructed Card\n return toReturn;\n}", "title": "" }, { "docid": "21e4f09164e5b85613b94b8d2b0690eb", "score": "0.5320663", "text": "function getCard(){\n DBinfo([\"getCard\"]);\n getParseCard().then(function(card){\n if(card){\n let suit = card.get(\"suit\");\n let rank = card.get(\"rank\");\n card.set(\"deal\",false);\n card.save();\n DBinfo([\"dealt card: \", rank , \" of \", suit]);\n var cardDealt = { suit: suit,\n rank: rank};\n DBinfo([\"getCard: check 1\"]);\n var curState = gameState.get();\n let venueIndex = curState.nextMIndex;\n DBinfo([\"getCard: check 2\"]);\n\n (curState.hand).push(cardDealt);\n gameState.set(curState);\n let notfSettings = { title: crawl.name,\n subTitle: '',\n body: 'You got a card!',\n timeInterval: 0.1, repeats: false,\n sound: 'default', image: 'default',\n showInApp: false };\n present('notification', notfSettings );\n DBinfo([\"getCard: calling setupMainPage\"]);\n setupMainPage();\n DBinfo([\"about to check for venueIndex\"])\n if(venueIndex == (crawl.locs).length - 1){\n DBinfo([\"venueIndex- \"+ venueIndex + \" calling scoreHand - with delay\"]);\n scoreHand(5000);\n }\n\n }\n });\n}", "title": "" }, { "docid": "adf6d9195c9e42776081b7611d0e1e74", "score": "0.5319595", "text": "function loadcard() {\n \n console.log(\"load card function running\");\n var topCard = ships[p1deck[0]];\n var image = document.getElementById(\"p1Image\");\n var built = document.getElementById(\"built\");\n var tonnage = document.getElementById(\"tonnage\");\n var len = document.getElementById(\"len\");\n var capacity = document.getElementById(\"capacity\");\n var name = document.getElementById(\"name\");\n\n image.setAttribute(\"src\", \"Data/\" + topCard.filename);\n name.innerHTML = \"Name: \" + topCard.name;\n built.innerHTML = \"Built: \" + topCard.built;\n tonnage.innerHTML = \"Tonnage: \" + topCard.tonnage;\n len.innerHTML = \"Length: \" + topCard.len;\n capacity.innerHTML = \"Capacity: \" + topCard.capacity;\n\n}", "title": "" }, { "docid": "6d8336afcd765576bd5f307e6daae382", "score": "0.53177935", "text": "generateCards(dataList) {\n return dataList.map((data) => {\n const dataCore = data[\"translations\"][randomInt(data[\"translations\"].length)]; //takes a random translation for a chn word\n return {\n title: dataCore[\"simplified\"],\n target: dataCore[\"pinyin\"], //.replace(/[1-5]/g, '')\n body: dataCore[\"definition\"],\n input: \"\",\n key: data[\"traditional\"] + \"-card\",\n inputCallback: this.handleInputUpdate\n }\n });\n }", "title": "" }, { "docid": "c82d0f03de5940dd7eee9cdaa3eaea6e", "score": "0.5316988", "text": "function getPartnershipCard() {\n var number = Math.floor(Math.random() * partnershipCards[countryValue].length);\n var specialMsg = \"\"; //TEMP TESTING\n // debug to test specific cards\n if (pCard != -1) {\n if (pCard >= partnershipCards[countryValue].length) {\n console.log(\"pCard value out of bounds!!\");\n }\n else {\n number = pCard;\n console.log(\"debugging specific card\");\n }\n }\n console.log(\"Partnership Card! - \" + number);\n // UpdateUserMessage(\"Partnership Card!\\n\\n\" + partnershipCards[number].title + \"\\n\" + partnershipCards[number].text + \"\\n\" + partnershipCards[number].impact);\n \tvar _title = partnershipCards[countryValue][number].title;\n var _msg = partnershipCards[countryValue][number].text + \"<br><br>\" + partnershipCards[countryValue][number].impact;\n UpdatePopup(_title, _msg, \"green\");\n if (partnershipCards[countryValue][number].special) {\n \tspecialMsg = partnershipCards[countryValue][number].special;\n \tspecialCards(partnershipCards[countryValue][number].special); \t \t\n }\n impactStats(partnershipCards[countryValue][number].hp, partnershipCards[countryValue][number].wp, partnershipCards[countryValue][number].ep, partnershipCards[countryValue][number].gb);\n UpdateHUD(player1.hp, player1.wp, player1.gb, player1.ep);\n // pass data to console\n console.log(\"**********CARD DATA**********\");\n console.log(_title);\n console.log(partnershipCards[countryValue][number].impact);\n console.log(specialMsg);\n console.log(\"*****************************\");\n}", "title": "" }, { "docid": "dcf111a060b65557c6110ec045598656", "score": "0.53166306", "text": "function displayComicInfo() {\n // grabbing user input\n var characterName = $('#characterSearch').val();\n // Variables needed for the hash\n var ts = new Date().getTime(); \n var PRIV_KEY = \"9ced83e38521d6850703a1c54a18fea775a60964\"\n var API_KEY = \"bdcf4ef10cbcac4120f014ab0e020243\";\n var hash = CryptoJS.MD5(ts+PRIV_KEY + API_KEY);\n // apikey for the end of the url\n var apiKey = \"bdcf4ef10cbcac4120f014ab0e020243\";\n // url to pass through the ajax call\n var url = \"https://gateway.marvel.com/v1/public/characters?name=\" + characterName + \"&ts=\" + ts + \"&hash=\" + hash + \"&apikey=\" + apiKey;\n console.log(url); // console log of url\n // ajax call\n $.ajax({ url: url, method: \"GET\" }).done(function(data) {\n // console.log(data); // console log of full data return\n // drilling down to the needed data and place in a variable\n var refinedResults = data.data.results[0];\n console.log(characterName); // console log of hero name\n console.log(refinedResults); // console log of comic result\n // Useful results from refinded results\n // 1. comics -- its an object, a resource list containing comics which feature this character.\n // 2. description -- description of the comic, a short bio or description of the character. \n // 3. events -- its an object, a resource list of events in which this character appears.\n // 4. name -- name of the comic, the name of the character.,\n // 5. series -- its an object, a resource list of series in which this character appears.\n // 6. stories -- its an object, a resource list of stories in which this character appears.\n // 7. thumbnail -- its an object, a representative image for this character.\n // store the refined results in variables\n var comicResults = refinedResults.comics.items; // comics object\n var descriptionResults = refinedResults.description; // description item\n var eventsResults = refinedResults.events.items; // events object\n var nameResults = refinedResults.name; // name item\n var seriesResults = refinedResults.series.items; // series object\n var storiesResults = refinedResults.stories.items; // stories object\n var thumbnailResultsPath = refinedResults.thumbnail.path; // thumbnail path item\n var thumbnailResultsExtension = refinedResults.thumbnail.extension; // thumbnail extension item\n var thumbnailResults = thumbnailResultsPath + \".\" +thumbnailResultsExtension; // thumbnail concatinated item\n\n // creating a div for the comic info to go in\n var comicDiv = $('<div class=\"comicDiv\">');\n makeElem('<h1 class=\"infoTitle\">', \"Comic Info\", comicDiv);\n if (thumbnailResults != \"N/A\"){\n var image = $(\"<img>\").attr(\"src\", thumbnailResults);\n image.addClass(\"images\");\n comicDiv.append(image);\n }\n makeElem(\"<h3>\", nameResults, comicDiv);\n // gets the plot of the comic if there is one\n if (descriptionResults != \"\"){\n makeElem(\"<p>\", \"Comic Plot: \" + descriptionResults, comicDiv);\n }\n // gets the image of the comic if there is one\n \n // injecting comic info to html doc\n $(\"#comicsView\").prepend(comicDiv);\n });\n }", "title": "" }, { "docid": "e82f0be52e4ee599fab5a64d240b0401", "score": "0.53154945", "text": "displayCard () {\r\n this.computeHtmlTags(\"tag--disabled\", \"-1\");\r\n return Template.fillTemplate(\"photographer-card\", this);\r\n }", "title": "" }, { "docid": "8d23b2092e91d39d1598a6c18a4e8fe6", "score": "0.5310614", "text": "function showMoreInfoOfCurrentCurrencyOnUI(moreInfoOjbect, content) {\n let imageURL = moreInfoOjbect.imageURL;\n let USDPrice = moreInfoOjbect.USDPrice;\n let EURPrice = moreInfoOjbect.EURPrice;\n let ILSPrice = moreInfoOjbect.ILSPrice;\n let image = $(\"<img>\");\n console.log(USDPrice)\n //more info data validation\n imageURL = MoreInfoDataValidation(imageURL);\n USDPrice = MoreInfoDataValidation(USDPrice);\n EURPrice = MoreInfoDataValidation(EURPrice);\n ILSPrice = MoreInfoDataValidation(ILSPrice);\n //displaying the more info data on the UI\n displayMoreInfoUiWithrelevantInformation(imageURL, USDPrice, EURPrice, ILSPrice, image, content)\n\n }", "title": "" }, { "docid": "fe02536b0616465dd194ece8ef0de83d", "score": "0.5304223", "text": "async function getInfo() {\n const crypto = currencyOneSelect.value;\n const currency = currencyTwoSelect.value;\n\n await fetch(`https://api.coingecko.com/api/v3/coins/markets?vs_currency=${currency}&ids=${crypto}&order=market_cap_desc&per_page=100&page=1&sparkline=false`)\n .then(res => res.json()) \n .then(data => {\n info.innerHTML = `\n <div id=\"crypto-image\" class=\"crypto-img\">\n <img src=\"${data[0].image}\" alt=\"\">\n </div>\n <ul class=\"list\">\n <li class=\"info-list\">${data[0].symbol.toUpperCase()}</li>\n <br>\n <li class=\"info-list\">Name: ${data[0].name}</li>\n <li class=\"info-list\">Current Price: ${data[0].current_price}</li>\n <li class=\"info-list\">Market Cap: ${data[0].market_cap}</li>\n <li class=\"info-list\">Market Cap Rank: ${data[0].market_cap_rank}</li>\n <br>\n <li class=\"info-list\">24hr High: ${data[0].high_24h}</li>\n <li class=\"info-list\">24hr Low: ${data[0].low_24h}</li>\n <li class=\"info-list\">24hr Price Change: ${data[0].price_change_24h}</li>\n <li class=\"info-list\">24hr Price Percentage: ${data[0].price_change_percentage_24h.toFixed(2)}%</li>\n <br>\n <li class=\"info-list\">Circulating Supply: ${data[0].circulating_supply}</li>\n </ul>\n `;\n })\n }", "title": "" }, { "docid": "9ff57c418ebb2f80dc5fd89b4151734a", "score": "0.53012514", "text": "function populateList( forceScroll ){\n\t\n\t\tvar minIndex = context.pageLength * context.currentPage;\n\t\tvar maxIndex = Math.min( minIndex + context.pageLength - 1, context.cardCount - 1 );\n\t\tvar list = '';\n\t\t\n\t\t// Compose an entry for every card on the current page\n\t\tfor ( var i = minIndex; i <= maxIndex; i++ ){\n\t\t\tvar card = context.sortedCards[ i ];\n\t\t\n\t\t\t// Preflight various card values to use in the HTML\n\t\t\tvar key = keyFromName( card.name );\n\t\t\tvar commander = 0;\n\t\t\tif ( context.deck.commander ){\n\t\t\t\tif ( card.name == context.deck.commander.name )\n\t\t\t\t\tcommander = 1;\n\t\t\t}\n\t\t\tvar count = context.deck.cards[ card.name ] ? context.deck.cards[ card.name ].count : 0;\n\t\t\tif ( !count && card.names )\n\t\t\t\tcount = context.deck.cards[ card.names[ 0 ] ] ? context.deck.cards[ card.names[ 0 ] ].count : 0;\n\t\t\t\n\t\t\tvar image = 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=' + card.multiverseid + '&type=card';\n\t\t\tvar link = 'http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=' + card.multiverseid;\n\t\t\tif ( !card.multiverseid ){\n\t\t\t\timage = 'images/cardback.jpg';\n\t\t\t\tlink = 'http://gatherer.wizards.com/Pages/Default.aspx';\n\t\t\t}\n\t\t\tif ( !card.text )\n\t\t\t\tcard.text = \"\";\n\t\t\tvar rarityTitle = \"\";\n\t\t\tif ( card.rarity ){\n\t\t\t\tif ( card.rarity == \"L\" ) rarityTitle = \"Basic Land\";\n\t\t\t\telse if ( card.rarity == \"C\" ) rarityTitle = \"Common\";\n\t\t\t\telse if ( card.rarity == \"U\" ) rarityTitle = \"Uncommon\";\n\t\t\t\telse if ( card.rarity == \"R\" ) rarityTitle = \"Rare\";\n\t\t\t\telse if ( card.rarity == \"M\" ) rarityTitle = \"Mythic Rare\";\n\t\t\t}\n\t\t\t\n\t\t\t// Compose left hand section with the card image\n\t\t\tlist += '<tr key=\"' + key + '\" legal=\"1\" commander=\"' + commander + '\" count=\"' + count + '\"><td>';\n\t\t\tlist += '<a href=\"' + link + '\" target=\"_blank\"><img class=\"cardImage\" src=\"' + image + '\" onerror=\"this.src = \\'images/cardback.jpg\\'\" /></a>';\n\t\t\tlist += '</td><td>';\n\t\t\t\n\t\t\t// Compose the card entry with its various data fields\n\t\t\tlist += '<a class=\"cardTitle\" href=\"' + link + '\" target=\"_blank\">' + card.name + '</a>';\n\t\t\tif ( card.manaCost )\n\t\t\t\tlist += '<span class=\"cardManaCost\">' + card.manaCost + '</span>';\n\t\t\tlist += '<span class=\"cardCMC\">(' + card.cmc + ')</span>';\n\t\t\tif ( card.rarity )\n\t\t\t\tlist += ' <span class=\"cardRarity\" rarity=\"' + card.rarity + '\" title=\"' + rarityTitle + '\"></span>';\n\t\t\tif ( card.userRating )\n\t\t\t\tlist += ' <span class=\"cardRating\">\\u2605' + formatRating( card.userRating ) + '</span>';\n\t\t\tlist += '<br><span class=\"cardType\">' + card.type + '</span>';\n\t\t\tif ( card.power !== undefined && card.toughness !== undefined )\n\t\t\t\tlist += '<span class=\"cardStats\">(<span class=\"cardPower\">' + card.power + '</span>/<span class=\"cardToughness\">' + card.toughness + '</span>)</span>';\n\t\t\tlist += '<br><span class=\"cardText\">' + formatHelperText( replaceBreaks( card.text ) ) + '</span></td><td>';\n\t\t\t\n\t\t\t// Compose the UI section to the right of the card entry\n\t\t\tlist += '<a class=\"add\" title=\"Add to Deck\" onclick=\"DECK.addCard( this.parentNode.parentNode.getAttribute(\\'key\\'), 1 );\"><span>+</span></a>';\n\t\t\tlist += '<div class=\"cardCount\" count=\"0\">' + count + '</div>';\n\t\t\tlist += '<a class=\"remove\" title=\"Remove from Deck\" onclick=\"DECK.removeCard( this.parentNode.parentNode.getAttribute(\\'key\\'), 1 );\"><span>-</span></a>';\n\t\t\tlist += '<a title=\"Make Commander\" class=\"commanderFlag\" onclick=\"DECK.setCommander( this.parentNode.parentNode.getAttribute(\\'key\\') );\"><span>&#9813;</span></a>';\n\t\t\tlist += '</td></tr>';\n\t\t\t\n\t\t}\n\t\t\n\t\t// Replace in special symbols and add the entry to the list\n\t\tcontext.listElement.innerHTML = replaceSymbols( list );\n\t\t\n\t\t// Update validation for the card entries\n\t\tcontext.refreshPage();\n\t\t\n\t\t// Update the page navigation at the bottom\n\t\tupdateNavigation();\n\t\t\n\t\t// Scroll back to the top of the list if specified by parameter\n\t\tif ( ( forceScroll || context.forceScroll ) && context.listElement.parentNode.scrollTop != 0 )\n\t\t\tcontext.listElement.parentNode.scrollTop = 0;\n\t\t\t\n\t}", "title": "" }, { "docid": "33fca9a94d7c2e06a1b816e6a89a6731", "score": "0.5300258", "text": "function addCardText(cardData) {\n\t\t$.each(cardData, function(idx, line) {\n\t\t\tswitch (line.type) {\n\t\t\t\tcase 'headline':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'subheadline':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bullet':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "38ac9a91540c71deef4692d51d329ad3", "score": "0.52920896", "text": "function ClozeCard(full, answer, partial){\n\tthis.full = full;\n\tthis.answer = answer;\n\tthis.partial = partial;\n}", "title": "" }, { "docid": "746cdddac57ce7996de090476d01b79f", "score": "0.52904135", "text": "function cardInfo(id){\n let picture;\n let email;\n let city;\n let cellNumber;\n let streetNumber;\n let streetName;\n let state;\n let postCode;\n let birthday;\n let firstName;\n let LastName;\n\n employeeArray.forEach( o => {\n picture = o.results[id].picture.medium;\n email = o.results[id].email;\n city = o.results[id].location.city;\n cellNumber = o.results[id].cell;\n streetNumber = o.results[id].location.street.number;\n streetName = o.results[id].location.name;\n state = o.results[id].location.state;\n postCode = o.results[id].location.postcode;\n birthday = o.results[id].dob.date;\n firstName = o.results[id].name.first;\n LastName = o.results[id].name.last;\n\n })\nmodal(picture,email,city,cellNumber,streetNumber,streetName,state,postCode,birthday,firstName,LastName);\n\n}", "title": "" }, { "docid": "a59178a31df6f0d6c2fc502318ae9eed", "score": "0.5289621", "text": "function CardDisplay() {\n return (\n <CardDeck>\n <Card>\n <Card.Img\n variant=\"top\"\n src=\"images/pic04.sm.jpg\"\n crop=\"fill\"\n alt=\"Woman, wearing backpack and jacket, and 4 children hike on path in woods, arm around a child, while others play ahead\"\n aspect-ratio=\"attr(width) / attr(height)\"\n accessibility=\"colorblind\"\n />\n <Card.Body>\n <Card.Title> Check the Weather Forecast & Daylight Hours </Card.Title>\n <Card.Text>\n Here comes the sun...confirm weather and sunshine hours to walk during peak\n preferences. {\"\"}\n </Card.Text>\n </Card.Body>\n </Card>\n\n <Card>\n <Card.Img\n variant=\"top\"\n src=\"images/pic11.citysmiles.sm.jpg\"\n crop=\"fill\"\n accessibility=\"colorblind\"\n alt=\"Young man of colour in foreground, wearing jean jacket and backpack, brightly smiles at camera with blurred background of people and city\"\n />\n <Card.Body>\n <Card.Title>Map Your Desitination</Card.Title>\n <Card.Text>\n Walking on sunshine...map your preferences to hit favourite spots whether a\n playground, dog or skate park or something completely new.{\"\"}\n </Card.Text>\n </Card.Body>\n </Card>\n\n <Card>\n <Card.Img\n variant=\"top\"\n src=\"images/pic03.sm.jpg\"\n crop=\"fill\"\n accessibility=\"colorblind\"\n alt=\"Smiling woman, wearing jacket and hair windblown, offers stick to interested dog, with man smiling in immediate background\"\n />\n <Card.Body>\n <Card.Title>Rate Your Walks</Card.Title>\n <Card.Text>\n Was your walk \"You are my sunshine\" or more like \"Ain't no sunshine\"...rate\n your walks and repeat the great ones...again and again. {\"\"}\n </Card.Text>\n </Card.Body>\n </Card>\n </CardDeck>\n );\n}", "title": "" }, { "docid": "06bc008f66ad2cb9a65f6bd94b89c03a", "score": "0.5277855", "text": "function build2cards(coin_data,update_time) { // console.log(\"start build 2 cards\");\r\n let coin_id = card.firstChild.innerText;\r\n\r\n /******* 'General-Info' card + 'Recent-Info' card elements *********/\r\n let genrl_card = card.cloneNode(false); // false-> avoid duplication(cloning) of descendants(children)\r\n genrl_card.id = \"genrl_card\" ; // genrl_card: the card to present the \"General Info\" \r\n\r\n let recnt_card = card.cloneNode(false); // \r\n recnt_card.id = \"recnt_card\" ; // card_temp: the card to present the \"Recent Info\" \r\n recnt_card.className = \"well card_tmplt\"; \r\n\r\n /* ### ### ### 'General Info' card ### ### ### ### ### ### */\r\n /* components:\r\n DIV: gnrl_crd_titl\r\n gnrl_crd_symbl\r\n DIV: gnrl_crd_body_div\r\n header:Desciption\r\n crd_descrpt\r\n DIV: gnrl_crd_footer_div\r\n gnrl_crd_back_btn\r\n */\r\n let gnrl_crd_titl_div = document.createElement(\"div\"); // DIV to contain the title:'Desciption' \r\n genrl_card.appendChild(gnrl_crd_titl_div);\r\n let gnrl_crd_body_div = document.createElement(\"div\"); // DIV to contain Coin Desciption \r\n genrl_card.appendChild(gnrl_crd_body_div);\r\n let gnrl_crd_footr_div = document.createElement(\"div\"); // for Back btn \r\n genrl_card.appendChild(gnrl_crd_footr_div);\r\n let gnrl_crd_symbl = card.children[1].cloneNode(true);// coin symbol\r\n gnrl_crd_symbl.id = \"gnrl_crd_symble\";\r\n gnrl_crd_titl_div.appendChild(gnrl_crd_symbl);\r\n const gnrl_crd_hed = document.createElement(\"p\"); // header for desciption(general card)\r\n gnrl_crd_hed.id = \"gnrl_crd_hed\";\r\n gnrl_crd_body_div.appendChild(gnrl_crd_hed);\r\n gnrl_crd_hed.innerHTML = \"<b> <p style='text-align:center; font-size:14px; font-weight:bold''> DESCRIPTION </p></b>\";\r\n let gnrl_crd_descrpt = document.createElement(\"p\"); // coin description\r\n gnrl_crd_descrpt.id = \"gnrl_crd_descrpt\";\r\n gnrl_crd_body_div.appendChild(gnrl_crd_descrpt);\r\n let gnrl_crd_back_btn = card.children[4].cloneNode(true);// genrl_info_btn\r\n gnrl_crd_back_btn.id = \"gnrl_crd_back_btn\";\r\n gnrl_crd_footr_div.appendChild(gnrl_crd_back_btn);\r\n gnrl_crd_back_btn.innerText = \"Back\"; // 'MoreInfo' btn is changed to 'Back' btn\r\n \r\n gnrl_crd_back_btn.addEventListener(\"click\", show_rglr_card );\r\n\r\n /*********** 'General Info' card STYLES ************/\r\n genrl_card.style.position = \"relative\" ;\r\n genrl_card.style.top= \"0px\";\r\n genrl_card.style.left= \"0px\";\r\n genrl_card.style.height= \"200px\";\r\n genrl_card.style.width= \"inherint\";\r\n genrl_card.style.zIndex= \"+1\";\r\n // gnrl_crd_titl_div\r\n gnrl_crd_titl_div.style.position = \"absolute\" ; // \"relative\" rcnt_crd_fresh_div\r\n gnrl_crd_titl_div.style.top = \"10%\";\r\n gnrl_crd_titl_div.style.height = \"10%\";\r\n gnrl_crd_titl_div.style.left = \"1%\";\r\n gnrl_crd_titl_div.style.width = \"98%\";\r\n //gnrl_crd_symbl\r\n gnrl_crd_symbl.style.position = \"absolute\" ;// rcnt_crd_fresh_div\r\n gnrl_crd_symbl.style.top = \"0%\";\r\n gnrl_crd_symbl.style.left = \"2%\"; \r\n gnrl_crd_symbl.style.width = \"50%\";\r\n gnrl_crd_symbl.style.fontSize = \"28px\";\r\n gnrl_crd_symbl.style.color = \"DarkGoldenrod\";\r\n // gnrl_crd_body_div\r\n gnrl_crd_body_div.style.position = \"absolute\" ;// \r\n gnrl_crd_body_div.style.top = \"25%\";\r\n gnrl_crd_body_div.style.height = \"75%\";\r\n gnrl_crd_body_div.style.left = \"1%\";// \r\n gnrl_crd_body_div.style.width = \"98%\";\r\n gnrl_crd_body_div.style.overflowY = \"auto\";\r\n gnrl_crd_body_div.style.wordBreak = \"normal\";\r\n //gnrl_crd_footr_div\r\n gnrl_crd_footr_div.position = \"absolute\" ;\r\n gnrl_crd_footr_div.top = \"3px\";\r\n gnrl_crd_footr_div.style.height = \"20px\";\r\n //gnrl_crd_back_btn \r\n gnrl_crd_back_btn.style.position = \"absolute\" ;\r\n gnrl_crd_back_btn.style.top = \"3px\";\r\n gnrl_crd_back_btn.style.height = \"18px\";\r\n gnrl_crd_back_btn.style.width = \"96%\";\r\n\r\n /* ### ### ### ''Recent Info' card ### ### ### ### ### ### */\r\n /* components:\r\n DIV: rcnt_crd_titl_div\r\n rcnt_crd_pic\r\n txt_symbl\r\n coin_name\r\n back_btn\r\n DIV: rcnt_crd_fresh_div\r\n header1:PRICES\r\n usd_valu\r\n eur_valu\r\n ils_valu\r\n header2:CHANGES\r\n 24h change\r\n 30d change\r\n */\r\n let rcnt_crd_titl_div = document.createElement(\"div\"); // DIV \r\n rcnt_crd_titl_div.id = \"rcnt_crd_titl_div\";\r\n recnt_card.appendChild(rcnt_crd_titl_div);\r\n rcnt_crd_titl_div.style.position = \"flex\";\r\n let rcnt_crd_fresh_div = document.createElement(\"div\"); // DIV to contain fresh market values info\r\n rcnt_crd_fresh_div.id = \"rcnt_crd_fresh_div\";\r\n recnt_card.appendChild(rcnt_crd_fresh_div);\r\n rcnt_crd_fresh_div.style.position = \"flex\";\r\n rcnt_crd_fresh_div.style.borderLeft = \"1px solid DimGray\";\r\n\r\n let rcnt_crd_pic = document.createElement(\"img\"); // coin logo \r\n rcnt_crd_pic.id = \"rcnt_crd_pic\";\r\n rcnt_crd_titl_div.appendChild(rcnt_crd_pic);\r\n\r\n let txt_symbl = card.children[1].cloneNode(true);\r\n rcnt_crd_titl_div.appendChild(txt_symbl);\r\n let coin_name = card.children[2].cloneNode(true);\r\n rcnt_crd_titl_div.appendChild(coin_name);\r\n\r\n let back_btn = card.children[4].cloneNode(true);// _btn\r\n rcnt_crd_titl_div.appendChild(back_btn);\r\n back_btn.id = \"back_btn\"; // 'MoreInfo' btn is changed to 'Back' btn\r\n back_btn.innerText = \"Back\"; // 'MoreInfo' btn is changed to 'Back' btn\r\n back_btn.addEventListener(\"click\", show_rglr_card );\r\n\r\n const rcnt_crd_hed1 = document.createElement(\"p\"); // header for the coin PRICES\r\n rcnt_crd_hed1.id = \"rcnt_crd_hed1\";\r\n rcnt_crd_fresh_div.appendChild(rcnt_crd_hed1);\r\n rcnt_crd_hed1.innerHTML = \"<b> <p style='text-align:center; font-size:12px; font-weight:bold'>&nbsp TODAY'S PRICE </p></b>\";\r\n\r\n let rcnt_crd_id = document.createElement(\"p\"); // \r\n rcnt_crd_id.id = \"rcnt_crd_id\";\r\n rcnt_crd_titl_div.appendChild(rcnt_crd_id);\r\n\r\n let rcnt_crd_usd_valu = document.createElement(\"p\"); // US Dollar($) value // string from API\r\n rcnt_crd_usd_valu.id = \"rcnt_crd_usd_valu\";\r\n rcnt_crd_fresh_div.appendChild(rcnt_crd_usd_valu);\r\n\r\n let rcnt_crd_eur_valu = document.createElement(\"p\"); // EURO(€) value\r\n rcnt_crd_eur_valu.id = \"rcnt_crd_eur_valu\";\r\n rcnt_crd_fresh_div.appendChild(rcnt_crd_eur_valu);\r\n\r\n let rcnt_crd_ils_valu = document.createElement(\"p\"); // Israel-Shekel(‏₪) value\r\n rcnt_crd_ils_valu.id = \"rcnt_crd_ils_valu\";\r\n rcnt_crd_fresh_div.appendChild(rcnt_crd_ils_valu);\r\n\r\n const rcnt_crd_hed2 = document.createElement(\"p\"); // header for the coin CHANGES OF prices\r\n rcnt_crd_hed2.id = \"rcnt_crd_hed2\";\r\n rcnt_crd_fresh_div.appendChild(rcnt_crd_hed2);\r\n rcnt_crd_hed2.innerHTML = \" &nbsp CHANGES\"; // position:absolute; top:60%;\r\n\r\n let chang_percntg_24h = document.createElement(\"p\"); // 24hours chang(in %)\r\n chang_percntg_24h.id = \"chang_percntg_24h\"; \r\n rcnt_crd_fresh_div.appendChild(chang_percntg_24h);\r\n\r\n let chang_percntg_30d = document.createElement(\"p\"); // last 30 days chang(in %)\r\n chang_percntg_30d.id = \"chang_percntg_30d\";\r\n rcnt_crd_fresh_div.appendChild(chang_percntg_30d);\r\n\r\n /*********** 'Recent Info' card STYLES ************/\r\n recnt_card.style.position = \"relative\" ;\r\n recnt_card.style.top= \"0px\";\r\n recnt_card.style.left= \"0px\";\r\n //rcnt_crd_titl_div\r\n rcnt_crd_titl_div.style.position = \"absolute\" ;// rcnt_crd_fresh_div\r\n rcnt_crd_titl_div.style.top = \"0px\";\r\n rcnt_crd_titl_div.style.left = \"0px\";// \r\n rcnt_crd_titl_div.style.width = \"45%\";// \r\n rcnt_crd_titl_div.style.height = \"100%\";\r\n // rcnt_crd_pic\r\n rcnt_crd_pic.style.position = \"absolute\"; \r\n rcnt_crd_pic.style.top = \"3%\";// symbl_pic: coin logo picture\r\n rcnt_crd_pic.style.height = \"30%\";// symbl_pic: coin logo picture\r\n rcnt_crd_pic.style.left = \"30%\";// symbl_pic: coin logo picture\r\n rcnt_crd_pic.style.width = \"40%\";// symbl_pic: coin logo picture\r\n rcnt_crd_pic.style.backgroundColor = \"white\";// symbl_pic: coin logo picture\r\n rcnt_crd_pic.className=\"img-rounded\"; \r\n // txt_symbl\r\n txt_symbl.style.top = \"25%\";\r\n txt_symbl.style.left = \"5%\"; \r\n txt_symbl.style.width = \"90%\"; \r\n txt_symbl.style.textAlign = \"center\"; \r\n // coin_name\r\n coin_name.style.top = \"55%\";\r\n coin_name.style.left = \"1%\"; \r\n coin_name.style.width = \"98%\"; \r\n coin_name.style.textAlign = \"center\"; \r\n //rcnt_crd_fresh_div\r\n rcnt_crd_fresh_div.style.position = \"absolute\" ;// rcnt_crd_fresh_div\r\n rcnt_crd_fresh_div.style.top = \"0px\";\r\n rcnt_crd_fresh_div.style.right = \"0px\";// \r\n rcnt_crd_fresh_div.style.width = \"55%\";// \r\n rcnt_crd_fresh_div.style.height = \"100%\";\r\n //rcnt_crd_hed1\r\n rcnt_crd_hed1.style.position = \"absolute\"; // header for the coin PRICES \r\n rcnt_crd_hed1.style.top = \"3%\";\r\n rcnt_crd_hed1.style.left = \"0px\";\r\n //rcnt_crd_usd_valu\r\n rcnt_crd_usd_valu.style.position = \"absolute\"; // styling new element- usd_valu\r\n rcnt_crd_usd_valu.style.top = \"12%\"; // styling new element- usd_valu\r\n rcnt_crd_usd_valu.style.width = \"100px\"; // USD_valu\r\n rcnt_crd_usd_valu.style.height = \"5px\"; // USD_valu\r\n rcnt_crd_usd_valu.style.textAlign = \"center\"; \r\n //rcnt_crd_eur_valu\r\n rcnt_crd_eur_valu.style.position = \"absolute\"; // styling new element- eur_valu\r\n rcnt_crd_eur_valu.style.top = \"24%\"; // styling new element- eur_valu\r\n rcnt_crd_eur_valu.style.width = \"100px\"; // eur_valu\r\n rcnt_crd_eur_valu.style.height = \"5px\"; // eur_valu\r\n rcnt_crd_eur_valu.style.textAlign = \"center\"; \r\n //rcnt_crd_ils_valu\r\n rcnt_crd_ils_valu.style.position = \"absolute\"; // styling new element- ils_valu\r\n rcnt_crd_ils_valu.style.top = \"36%\"; // styling new element- ils_valu\r\n rcnt_crd_ils_valu.style.width = \"100px\"; // ils_valu\r\n rcnt_crd_ils_valu.style.height = \"5px\"; // ils_valu\r\n rcnt_crd_ils_valu.style.textAlign = \"center\"; \r\n //rcnt_crd_hed2: CHANGES\r\n rcnt_crd_hed2.style.position = \"absolute\"; // // header for the coin CHANGES OF prices \r\n rcnt_crd_hed2.style.top = \"60%\";\r\n rcnt_crd_hed2.style.textAlign =\"center\";\r\n rcnt_crd_hed2.style.fontSize =\"12px\";\r\n rcnt_crd_hed2.style.fontWeight =\"bold\"; \r\n //chang_percntg_24h\r\n chang_percntg_24h.style.position = \"absolute\"; // styling new element- chang_percntg_24h\r\n chang_percntg_24h.style.top = \"68%\"; // styling new element- chang_percntg_24h\r\n chang_percntg_24h.style.width = \"115px\"; // chang_percntg_24h\r\n chang_percntg_24h.style.height = \"0px\"; // chang_percntg_24h\r\n //chang_percntg_30d\r\n chang_percntg_30d.style.position = \"absolute\"; // styling new element- chang_percntg_30d \r\n chang_percntg_30d.style.top = \"82%\"; // styling new element- chang_percntg_30d \r\n chang_percntg_30d.style.width = \"115px\"; // chang_percntg_30d\r\n chang_percntg_30d.style.height = \"0px\"; // chang_percntg_30d\r\n /* ************END BUILD 2 CARDS *********************************************** */\r\n\r\n /**********Begin Inject data from API into the 2 cards *************************** */\r\n console.log(update_time); //update_time is time_of_fetch\r\n\r\n rcnt_crd_pic.src = coin_data.image.small;\r\n rcnt_crd_usd_valu.innerHTML = \"<b> $</b>\"+coin_data.market_data.current_price.usd;//$\r\n rcnt_crd_eur_valu.innerHTML = \"<b> &#8364</b>\"+coin_data.market_data.current_price.eur;//EUR\r\n rcnt_crd_ils_valu.innerHTML = \"<b> &#8362 </b>\" +coin_data.market_data.current_price.ils;//NIS\r\n // gnrl_crd_descrpt\r\n if(coin_data.description.en){\r\n gnrl_crd_descrpt.innerHTML= coin_data.description.en;\r\n } else {\r\n gnrl_crd_descrpt.innerHTML= \"Not Available...\";\r\n }\r\n\r\n crd_fetch_info_time.value = update_time;// time stamp of fetch\r\n\r\n let chang_24h_numbr = coin_data.market_data.price_change_percentage_24h;\r\n if(chang_24h_numbr) { chang_24h_numbr = chang_24h_numbr.toFixed(2);}\r\n let chang_30d_numbr = coin_data.market_data.price_change_percentage_30d;\r\n if(chang_30d_numbr) { chang_30d_numbr = chang_30d_numbr.toFixed(2);}\r\n chang_percntg_24h.innerHTML = '<p><b>&nbsp 24h: <img src=\"'+ up_down_arrow(chang_24h_numbr)+' \" width=\"13\" height=\"13\"><span style=\"background-color:'+green_red_color(chang_24h_numbr) +'\">&nbsp' +chang_24h_numbr +'% &nbsp</span></b></p>'; // src<=up_down_arrow(chang_24h_numbr)\r\n chang_percntg_30d.innerHTML = '<p><b>&nbsp 30d: <img src=\"'+ up_down_arrow(chang_30d_numbr)+' \" width=\"13\" height=\"13\"><span style=\"background-color:'+green_red_color(chang_30d_numbr) +'\">&nbsp' +chang_30d_numbr +'% &nbsp</span></b></p>'; // src<=up_down_arrow(chang_24h_numbr)\r\n\r\n function up_down_arrow(valu){\r\n if (valu>0) { return \"./images/Arrow-green.gif\";}\r\n else if (valu<0){ return \"./images/Arrow-red.gif\";}\r\n else { return \"./images/No-Change.jpg\";}\r\n }\r\n function green_red_color(valu){\r\n if (valu>0) { return \"green\";}\r\n else if (valu<0){ return \"red\";}\r\n else { return \"gray\";}\r\n }\r\n /**********END Inject data from API into the 2 cards ********************************** */\r\n\r\n /* ********** display the apropriare cards ******************************************** */\r\n if (disply_card) { card.style.display = \"flex\"; } // console.log (\"card display\");\r\n else { card.style.display = \"none\"; } // console.log (\"card NOT disp\");\r\n\r\n if (disply_genrl_card) { genrl_card.style.display = \"flex\"; } //console.log (\"genrl card display\");\r\n else { genrl_card.style.display = \"none\"; } //console.log (\"genrl card NOT dis\");\r\n\r\n if (disply_recnt_card) { recnt_card.style.display = \"flex\";} // console.log (\"Recnt card display\"); \r\n else { recnt_card.style.display = \"none\"; } // console.log (\"Recnt car dNOT disp\");\r\n\r\n function show_rglr_card(){// show regular card\r\n disply_card = true;\r\n card.style.display = \"flex\";\r\n\r\n disply_genrl_card = false;\r\n genrl_card.style.display = \"none\";\r\n \r\n disply_recnt_card = false;\r\n recnt_card.style.display = \"none\";\r\n\r\n }// func.show_rglr_card close\r\n\r\n\r\n /******* 'General-Info' + 'Recent-Info' cards Appendings *********/\r\n //genrl_card \r\n card_contnr.appendChild(genrl_card); // make 'genrl_card' to be a child of 'card container'\r\n if(card_marked) {\r\n let genrl_card_copy;\r\n genrl_card_copy ='<div class=\"unit\"><h5>About ' + genrl_card.children[0].innerText// ZRX\r\n genrl_card_copy = genrl_card_copy + '</h5><p>' +genrl_card.children[1].children[1].innerText +' </p></div>' // ZRX designed to offer ...\r\n v_side_div2.innerHTML += genrl_card_copy;\r\n } // if(card_marked) close\r\n\r\n //recnt_card \r\n card_contnr.appendChild(recnt_card); // make 'recnt_card' to be a child of 'card container'\r\n if(card_marked) { \r\n let recnt_card_copy = (recnt_card.cloneNode(true));\r\n recnt_card_copy.id = \"recnt_card_copy\";\r\n recnt_card_copy.children[0].children[3].style.display = \"none\"; // back btn\r\n v_side_div1.appendChild(recnt_card_copy);\r\n } // if(card_marked) close\r\n\r\n /* <<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<< ACORDION SCRIPT <<<<<<<<<<<<<<<<<<<<<<<<<<< <<< */\r\n let units = document.querySelectorAll('.unit');\r\n units.forEach(unit => unit.addEventListener('click', () => {\r\n if(unit.classList.contains('open')){\r\n unit.classList.remove('open');\r\n } else {\r\n units.forEach(unit2 => unit2.classList.remove('open'));\r\n unit.classList.add('open');\r\n }\r\n }));\r\n /* <<< <<<<<<<<<<<<<<<<<<<<<<<<< END ACORDION SCRIPT <<<<<<<<<<<<<<<<<<<<<<<<<< <<< */\r\n\r\n }", "title": "" } ]
e7256297baf5f4591163aa6ca418e8e4
Creamos un prototipo HIJO.
[ { "docid": "a225f687ae109a73364248759b42b713", "score": "0.0", "text": "function Development (name, surname) {\n this.name = name\n this.surname = surname\n}", "title": "" } ]
[ { "docid": "416f14c602cf3ba7cd928b8cf7f3d230", "score": "0.66459095", "text": "function heredaDe(protipoHijo, protipoPadre){\n //Asignarle un prototipo a la clase hija\n var fn = function(){}\n fn.prototype = protipoPadre.prototype\n protipoHijo.prototype = new fn\n //asignar funcion constructora\n protipoHijo.prototype.constructor = protipoHijo\n}", "title": "" }, { "docid": "bc0d27d66fb7a5517d5c6a5dae51b106", "score": "0.66398484", "text": "function heredade (prototipohijo,prototipopadre) { \n var fn = function () {}\n fn.prototype = prototipopadre.prototype\n prototipohijo.prototype = new fn\n prototipohijo.prototype.constructor = prototipohijo\n}", "title": "" }, { "docid": "1cc4d37d1336bd80e89d5e04d97d419a", "score": "0.6008696", "text": "static get properties() {\n return {\n peli: { type: Object}\n };\n }", "title": "" }, { "docid": "101f5302e6f122135ebfb87739dbcb75", "score": "0.5990236", "text": "constructor(pro){\n this._pro = pro;\n }", "title": "" }, { "docid": "9fd2321fe6e7fdfd2d26b75febe50fac", "score": "0.59758806", "text": "function Produto(nome, preco) {\n this.nome = nome;\n this.preco = preco;\n}", "title": "" }, { "docid": "aa1b4cee9f1ea8154259c410b93b3f50", "score": "0.579482", "text": "function objPromedio(id,valor) {\n this.id = id;\n this.valor = valor;\n }", "title": "" }, { "docid": "b5b47b8011a950b17936889087982cee", "score": "0.5748238", "text": "function TipoExame(codigo, nome){\n this.codigo = codigo;\n this.nome = nome;\n}", "title": "" }, { "docid": "9b520dc7a2e74622efec5f2391b95e54", "score": "0.573073", "text": "function Pessoa(nome, sobrenome) {\n this.nome = nome;\n this.sobrenome = sobrenome; \n}", "title": "" }, { "docid": "ff2758f08897360c86df7fec8ccfc1a8", "score": "0.57251054", "text": "function proptype() { }", "title": "" }, { "docid": "5b1dcb55d97100f1df91a7f2c7591b7b", "score": "0.56879336", "text": "static get properties() {\n return {\n elemento: { type: Object }\n }\n }", "title": "" }, { "docid": "c7ea4fcdb01ad0fd0c849c0f51c3bceb", "score": "0.5583247", "text": "function paella(type){\n\n\tthis.type = type;\n\tthis.defineType = function(){\n\t\treturn this.type;\n\t}\n}", "title": "" }, { "docid": "1bdadfebbcbffec467023b0c410c3c2b", "score": "0.55066115", "text": "function objeto() {\n Swal.fire('Se pueden determinar como una lista estructurada de pares de claves y valores en donde se pueden agregar datos')\n}", "title": "" }, { "docid": "8d719d30f8b599d5a8125bac5217666e", "score": "0.54589295", "text": "function Pessoa2(nome, sobrenome){\n this.nome = nome;\n this.sobrenome = sobrenome;\n}", "title": "" }, { "docid": "6b0b4ec8d15bd8ccd56f8602d3b02d87", "score": "0.542167", "text": "function PROFISSAO(profissao) {\r\n try {\r\n var self = this;\r\n\r\n self.id \t\t\t= ko.observable( profissao ? (profissao.id || 0) : 0);\r\n self.profissao \t\t= ko.observable( profissao ? (profissao.profissao || \"\") : \"\");\r\n \tself.renda \t\t\t= ko.observable( profissao ? (profissao.renda || 0) : 0);\r\n \tself.dataAdmissao\t= ko.observable( profissao ? (profissao.dataAdmissao || 0) : 0);\r\n \tself.parentId \t\t= ko.observable( profissao ? (profissao.parentId || 0) : 0);\r\n self.createUser \t= ko.observable( profissao ? (profissao.create_user || \"system\") : \"system\");\r\n \tself.createDateUTC \t= ko.observable( profissao ? (profissao.create_date || 0) : 0);\r\n \tself.modifyUser \t= ko.observable( profissao ? (profissao.modify_user || \"system\") : \"system\");\r\n \tself.modifyDateUTC \t= ko.observable( profissao ? (profissao.modify_date || 0) : 0);\r\n\t\t\tself.modelAction\t= ko.observable( profissao ? (profissao.modelAction || \"NONE\") : \"NONE\");\r\n\r\n } catch (e) {\r\n\t\t\tdebugger\r\n \tconsole.log(e);\r\n }\r\n }", "title": "" }, { "docid": "49e667181217761748f69c37d94a8142", "score": "0.54021364", "text": "function Pessoa(nome, sobrenome){\n\n this.nome = nome;\n this.sobrenome = sobrenome;\n\n this.nomeCompleto = function(){\n return this.nome + ' ' + this.sobrenome;\n };\n\n}", "title": "" }, { "docid": "34c7350670c3f4d97c382d3c0c19c5af", "score": "0.5388736", "text": "constructor (nombre, direccion, telefono, tipo){\n super(nombre, direccion, telefono)\n this._tipo = tipo; \n }", "title": "" }, { "docid": "677c3b5f1d3181e0616f036fc83a7e87", "score": "0.53870964", "text": "function imprimirPropiedades(objeto){\n\n const {nombre,altura } = objeto\n console.log(`Extraemos ${nombre} y ${altura} del objeto`)\n}", "title": "" }, { "docid": "43914219c46d95ef2cd2bfcfbb37550b", "score": "0.5367785", "text": "function Propiedades() {\n this.texto = \"Palabra\";\n this.numero = 5;\n this.boleana = true;\n this.arreglo = [this.texto, this.numero, this.boleana];\n this.cualquiera = { \"propiedad1\": \"valor1\",\n \"propiedad2\": \"valor2\",\n \"propiedad3\": \"valor3\" };\n }", "title": "" }, { "docid": "0fe67d519cef66bfa926ef69d47dc93d", "score": "0.5362316", "text": "function P(nome, sobrenome, idade){\r\n\tthis.name = nome;\r\n\tthis.midleName= sobrenome;\r\n\tthis.age= idade;\r\n}", "title": "" }, { "docid": "22cd9753e8ca78298888b9390b845ba7", "score": "0.5346239", "text": "function Persona (altura, peso) {\n this.altura = altura;\n this.peso = peso;\n}", "title": "" }, { "docid": "0d582ccce22b20790549557c1a631b55", "score": "0.5338084", "text": "function Producto(nombre, precio){\n this.nombre = nombre;\n this.precio = precio;\n}", "title": "" }, { "docid": "80a0e0273083cdb5a66e19455c7a4521", "score": "0.53312945", "text": "function Producto(nombre, precio, disponible) { // Class o generador de objetos, funcion para generar objetos\n this.nombre = nombre; //aquí definimos la funcion para construir los objetos\n this.precio = precio;\n this.disponible = disponible;\n}", "title": "" }, { "docid": "718e800bf1b1c64034401477ddaa18e6", "score": "0.52907825", "text": "function Producto(nombre, precio){\n this.nombre = nombre;\n this.precio = precio;\n}", "title": "" }, { "docid": "57eae9ad0dc7035fa7c1d5c05ccb45d3", "score": "0.526548", "text": "constructor(uno, dos, tres){\n // SUPER: palabra reservada que da de entender que son las 2 propiedades que estan llegando de la clase 1\n super(uno, dos)\n\n this.tercero = tres\n }", "title": "" }, { "docid": "3ea6dde543b859e5b0e94f2cddb1d4e1", "score": "0.5235081", "text": "function getHijo1():NodoDialogo{\nreturn hijo1;\n}", "title": "" }, { "docid": "16fdb954065a865c2bc657c7e5087401", "score": "0.5231685", "text": "function identificandoDatos(param) {\n console.log(\"El Dato Ingresado Es Tipo: \" + typeof param);\n console.log(param instanceof Persona);\n}", "title": "" }, { "docid": "566b27e5e5c890e75a4d1d2aa5b92386", "score": "0.5228764", "text": "function Profesor(nombreProfesor, apellidosProfesor) {\n this.nombreProfesor = nombreProfesor;\n this.apellidosProfesor = apellidosProfesor;\n}", "title": "" }, { "docid": "94af2c3ffb3179c55c6595db51c4b78b", "score": "0.5227046", "text": "function AgregarProfesor(){\r\n /*Se crean las variables de Profesor */\r\n var nombProf = document.getElementById(\"nombreProfesor\").value;\r\n var apellProf = document.getElementById(\"apellidosProfesor\").value;\r\n /*Se crea la fila a insertar en la tabla */\r\n var filaprof = \"<tr><td>\"+nombProf+\"</td><td>\"+apellProf+\"</td><tr>\";\r\n /*Se crea la variable para crear elemento TR */\r\n var trprof = document.createElement(\"TR\");\r\n /*Se inserta en el TR la fila*/\r\n trprof.innerHTML = filaprof;\r\n /*Se le asigna a la tabla profesor el objeto creado*/\r\n document.getElementById(\"tablaProfesor\").appendChild(trprof);\r\n /*Se crea una variable para guardar el objeto profesor*/\r\n var p = new Profesor (nombProf, apellProf);\r\n /*Se muestra por consola el objeto profesor */\r\n console.log(p);\r\n Mensajito();\r\n}", "title": "" }, { "docid": "96da6aae91c6287100975ac92831df5c", "score": "0.52069294", "text": "function Pruductos(nombre, categoria, cantidad){\n this.nombre = nombre;\n this.cantidad = cantidad;\n this.categoria = categoria;\n}", "title": "" }, { "docid": "aab6666927c56bc755c0d5825dc15a4a", "score": "0.5203833", "text": "function Ph(a){Ph.w.constructor.call(this,a);this.Ia=a.Ia;this.ad=a.ad;a=[];a[1]=new Ch;a[2]=new Ch;a[3]=new Ch;a[4]=new Ch;this.O=a;this.J=Object.create(null)}", "title": "" }, { "docid": "0dfe993d695494b57336e6da3cd02e28", "score": "0.516139", "text": "function Oferta(nombre, genero) {\n //Atributos\n this.nombre = nombre;\n this.genero = genero;\n\n}", "title": "" }, { "docid": "ba706d460b7bfa741613f6e1938d3c0d", "score": "0.5150326", "text": "constructor(nombre,apellido,altura)\n {\n super(nombre,apellido,altura)\n \n }", "title": "" }, { "docid": "db163a7ba2801a01b7c027a39423696f", "score": "0.51388717", "text": "function Promettez() {\n _classCallCheck(this, Promettez);\n\n this.keys = [];\n }", "title": "" }, { "docid": "ead3d4c452458e01f08a64dab4bf94a1", "score": "0.5137137", "text": "function Producto(codigo, marca, precio) {\r\n this.codigo = codigo;\r\n this.marca = marca;\r\n this.precio = precio;\r\n }", "title": "" }, { "docid": "1ee4f1d455fbb4ae38c0a2d479af2ee3", "score": "0.5131624", "text": "function Persona(nombre,apellido,altura) { \n //3.-\n this.nombre = nombre\n this.apellido = apellido\n this.altura = altura\n}", "title": "" }, { "docid": "662f235b22a1e7f83f62b43baa4523be", "score": "0.5117955", "text": "function mhs2(nama,energi){\n\tlet siswa = Object.create(mahasiswa2);\n\t// object.create ini akan menghubungkan parent Object\n\t// object disini terhubung dngn objek mana\n\tsiswa.nama = nama;\n\tsiswa.energi = energi;\n\n\treturn siswa;\n}", "title": "" }, { "docid": "634569293fef33e3ef8367755bc205bd", "score": "0.511428", "text": "function TarjetaResultados(){\n this.grid = new Grid()\n this.popup = new Popup()\n this.popup_nuevo = new PopupNuevo()\n this.popup_informacion = new PopupInformacion()\n}", "title": "" }, { "docid": "3bfebe75c35b1f338a25b3740ba9fe5e", "score": "0.511066", "text": "function Loro(tipo,color){\n Pajaro.call(this,tipo,color)\n this.hablar = function(){\n return `El ${this.tipo} ${this.color} está hablando`\n }\n}", "title": "" }, { "docid": "7b1c3df2433f999f0a3612b6cea35827", "score": "0.5109899", "text": "buscaProprietarios() {\n let proprietarios = [];\n for (let i = 0; i < this.proprietarios.length; i++) {\n proprietarios.push({...this.proprietarios[i]});\n }\n\n return proprietarios;\n }", "title": "" }, { "docid": "0109a446c63c5990fbe5d126be25da85", "score": "0.51005685", "text": "function Pembeli(parName, parNik, parAlamat, parHp, parKode, parJenis, parharga) {\n var intro = '<== SELAMAT DATANG DI BILLET ==>'\n var name = parName\n var nik = parNik\n var alamat = parAlamat\n var hp = parHp\n var kode = parKode\n var jenis = parJenis\n var harga = parharga\n\n this.getIntro = function(){ \n return intro; \n }\n\n this.getName = function() {\n return name;\n }\n\n this.getNik = function() {\n return nik;\n }\n\n this.getAlamat = function() {\n return alamat;\n }\n\n this.getHp = function() {\n return hp;\n }\n \n this.getKode = function() {\n return kode;\n }\n\n this.getJenis = function() {\n return jenis;\n }\n\n this.getHarga = function() {\n return harga;\n }\n}", "title": "" }, { "docid": "3345d590f47100750446c0ab3b58b9e9", "score": "0.5097911", "text": "constructor(entidad, hijos, padre){\n\t\t// Definimos las variables de clase\n\t\tthis.removable = false;\t// Si el nodo va a ser eliminado\n\t\tthis.entidad = entidad;\n\t\thijos != null ? this.hijos = hijos : this.hijos = [];\n\t\tthis.padre = padre;\n\t}", "title": "" }, { "docid": "c2e5db229f331bb85f9892245444f495", "score": "0.5096532", "text": "function Perro(nombre, genero, size) {\n this.super = Animal // de quien hereda\n this.super(nombre, genero) // que hereda\n this.size = size // agrega nuevos atributos\n}", "title": "" }, { "docid": "5f822bf526f76189c4b8e7935804c5da", "score": "0.5093558", "text": "function extinde(Copil, Parinte) {\n\n // 'CREAREA' UNUI 'OBIECT' CU UN 'PROTOTIP/PARINTE DAT'\n Copil.prototype = Object.create(Parinte.prototype);\n\n // RESETARE 'CONSTRUCTOR' === LA FUNC. CONSTRUCTOR 'CERC'\n Copil.prototype.constructor = Copil;\n}", "title": "" }, { "docid": "5f822bf526f76189c4b8e7935804c5da", "score": "0.5093558", "text": "function extinde(Copil, Parinte) {\n\n // 'CREAREA' UNUI 'OBIECT' CU UN 'PROTOTIP/PARINTE DAT'\n Copil.prototype = Object.create(Parinte.prototype);\n\n // RESETARE 'CONSTRUCTOR' === LA FUNC. CONSTRUCTOR 'CERC'\n Copil.prototype.constructor = Copil;\n}", "title": "" }, { "docid": "31609ee28ebd219617e2544c106681e7", "score": "0.50676996", "text": "miMetodoUno(){\n return this.uno\n }", "title": "" }, { "docid": "6bbd1431cc4277418bf3aeca4559afa3", "score": "0.5044077", "text": "function pizzaObject(flavour,size,crust)\n {\n this.flavour=flavour;\n this.size=size;\n this.crust=crust;\n this.delivery=delivery;\n this.price=flavour[1]+size[1]+crust[1]+deliverySelect[1];\n \n }", "title": "" }, { "docid": "bb83f4d3e4333f61d56dc2d497036d67", "score": "0.5029026", "text": "function HormigaComun(cantidad){\n\tthis.cantidadDeAlimentoTransportado=cantidad;\n}", "title": "" }, { "docid": "e25b9fed91c1fa0a7b013a4182caaa37", "score": "0.5021436", "text": "function creandoObjeto(producto, precio){\n const objeto = {producto, precio}\n arrayList = [...arrayList, objeto];\n // arregando en el html\n agregandoEnHTML(arrayList);\n}", "title": "" }, { "docid": "b828ef765353cb1f88663063782388e6", "score": "0.5018805", "text": "para (nombre en obj) {\n\t\t\tbuildParams (prefijo + \"[\" + nombre + \"]\", obj [nombre], tradicional, añadir);\n\t\t}", "title": "" }, { "docid": "5660b1f7388d7c46826fd717d1a13c84", "score": "0.50171846", "text": "constructor(nombre,apellido){\n // se coloca un _ para decir que ese metodo se puede soobrescribir\n this._nombre = nombre;\n this._apellido = apellido;\n Persona.contadorDeObjetosPersona++;\n }", "title": "" }, { "docid": "f2dfdfbd0e83733b7f96c9576b806963", "score": "0.50115234", "text": "function pi(e,t){if(\"function\"!==typeof t&&null!==t)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function n(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "8f7e736f68202368d1ca75fd9b20c8ab", "score": "0.50060844", "text": "function Profesor(nom, ape, anios, espec, fec_alta) {\n Persona.call(this,nom,ape,anios);\n this.especialidad=espec;\n this.fecha_alta= fec_alta;\n //metodo\n this.mostrarDatProfe=function(){\n document.write(`<br> la especialidad es: ${this.especialidad} y la fecha de alta es: ${this.fecha_alta}`);\n }\n \n}", "title": "" }, { "docid": "c14c0732df9d63107cc442ceb89b6f58", "score": "0.50038785", "text": "function clique(evento){\r\n\t//chamar o metodo pulo do personagem\r\n\tpersonagem.pula();\r\n}", "title": "" }, { "docid": "e55a95fc7935fb52ac7fe9440fa1274f", "score": "0.5001997", "text": "function imprimir(tipo){\n console.log(tipo.obtenerDetalles());\n //palabra instaceof\n if(tipo instanceof Gerente){\n console.log('El es Gerente');\n }\n}", "title": "" }, { "docid": "b096cf128f0816f6e4b9932dcfd40394", "score": "0.49996084", "text": "function producto(codigo, descripcion, unidad, unidadAbrev, cantidad, peso, volumen, precio, importe, iva, total, precioOriginal) {\n this.codigo = codigo;\n this.descripcion = descripcion;\n this.unidad = unidad;\n this.unidadAbrev = unidadAbrev;\n this.cantidad = cantidad;\n this.peso = peso;\n this.volumen = volumen;\n this.precio = precio;\n this.importe = importe;\n this.iva = iva;\n this.total = total;\n this.precioOriginal = precioOriginal;\n }", "title": "" }, { "docid": "96d293a0d1a75d17e1ba1a214fca9a69", "score": "0.49956614", "text": "function ProgObjSav(pO) {\r\n\r\n this.fileName = pO.fileName;\r\n\r\n this.allModules = new Array(); // all modules in this prog\r\n\r\n for (var m = 0; m < pO.allModules.length; m++) {\r\n this.allModules.push(new ModuleObjSav(pO.allModules[m]));\r\n }\r\n\r\n // Currently active module\r\n //\r\n this.curModNum = pO.curModNum;\r\n}", "title": "" }, { "docid": "e8fa43da8e7fbcfc6adde4f023008335", "score": "0.4984512", "text": "constructor(parenet){\r\n this.parenet = parenet;\r\n }", "title": "" }, { "docid": "721169f706467d5203885834c642fe05", "score": "0.49796093", "text": "static get properties() { return { \r\n response: { type: Object },\r\n //item for list of the products\r\n item:{ \r\n type: Array,\r\n notify: true,\r\n value: null\r\n },\r\n //Existing entries products\r\n existingEntries:{ \r\n type: Array,\r\n value: null\r\n },\r\n //productlist list new array\r\n productlist:{ \r\n type: Array,\r\n value: null\r\n },\r\n //cartcost is the cort total amount\r\n cartCost:{ \r\n type: Number,\r\n value: null\r\n },\r\n //calculating for delivary carges based on cartcost\r\n dellivarycharges:{ \r\n type: Number,\r\n value: null\r\n },\r\n //calculating for Tax amount based on cartcost\r\n taxamount:{ \r\n type: Number,\r\n value: null\r\n },\r\n //order amount including delivary carges, tax and cartcost\r\n summarytotalamount:{ \r\n type: Number,\r\n value: null\r\n },\r\n cartquantity:{\r\n type: Number,\r\n value: null,\r\n notify: true,\r\n reflectToAttribute: true\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c28d76ad89c2b0809cc39fe52850a6b5", "score": "0.4977336", "text": "function Pessoa(nome, idade) {\n this.nome = nome,\n this.idade = idade,\n this.abraçar = function() {\n return 'Abraçou';\n }\n this.andar = function() {\n return 'Andou pelo objeto';\n }\n}", "title": "" }, { "docid": "857913461ef7d575f8f586a0aab9343d", "score": "0.49668893", "text": "function Persona(nombre,apellido,altura){\n console.log('me ejecutaron')\n this.nombre = nombre //this guardamos en memoria los parametros recibidos\n this.apellido = apellido\n this.altura = altura\n \n }", "title": "" }, { "docid": "6760136be591e9c0c487b55c6d7bca2d", "score": "0.4966496", "text": "function Produit(codepdt,libelle,prixU){\n\n this.codepdt=codepdt;\n\n this.libelle=libelle;\n\n this.prixU=prixU;\n }", "title": "" }, { "docid": "8978985e112dadf96bb8cb4ad231ad67", "score": "0.49650386", "text": "function carta(valor,tipo){\n this.img=\"\";\n this.valor=valor;\n this.tipo=tipo;\n}", "title": "" }, { "docid": "cae066b5a64345394cea2b2b3398c3e6", "score": "0.49642417", "text": "super(nombre, apellido,altura) {\r\n this.nombre = nombre\r\n this.apellido = apellido\r\n }", "title": "" }, { "docid": "6ffc8d1f6e58a58176b88d18f1ffdd66", "score": "0.49631453", "text": "function Java(name , profecion){\r\nthis.name = name\r\nthis.profecion = profecion\r\n}", "title": "" }, { "docid": "518df037aeda7bb5d1a8d6310aef486e", "score": "0.495439", "text": "constructor(parametroNombre,parametroTemporadas,parametroCapitulo,parametroGenero){\n //crear las propiedades del objeto\n this.nombre = parametroNombre;\n this.temporadas = parametroTemporadas;\n this.capitulo = parametroCapitulo;\n this.genero = parametroGenero;\n }", "title": "" }, { "docid": "57b6b602a9d543fbd04c20e38afab3e5", "score": "0.49519902", "text": "function SubclassOfPlainObject() {}", "title": "" }, { "docid": "57b6b602a9d543fbd04c20e38afab3e5", "score": "0.49519902", "text": "function SubclassOfPlainObject() {}", "title": "" }, { "docid": "7426f3a5b116de9470682dc22e0dbc33", "score": "0.4950393", "text": "constructor(entidad, metodo){\n this.entidad = entidad;\n this.metodo = metodo;\n }", "title": "" }, { "docid": "99922bd31694ef9b484fc1a3ad4b2f12", "score": "0.49497154", "text": "function Produto (nome, preco, desc){ // creamos nuestra propia funcion costructora \n this.nome = nome // usamos el this para que sea visible al estoco global\n this.getPrecoComDesconto = () => preco * (1 - desc)\n}", "title": "" }, { "docid": "d2e81d84dae7e4f629f64e37e9860a6a", "score": "0.49335304", "text": "function Ph(a) {\n Ph.w.constructor.call(this, a);\n this.Ia = a.Ia;\n this.ad = a.ad;\n a = [];\n a[1] = new Ch;\n a[2] = new Ch;\n a[3] = new Ch;\n a[4] = new Ch;\n this.O = a;\n this.J = Object.create(null)\n}", "title": "" }, { "docid": "f6406d9df86cf541681f8e8c264d936c", "score": "0.4921953", "text": "para (nombre en opciones) {\n\t\t\t\tcopiar = opciones [nombre];\n\n\t\t\t\t// Prevenir la contaminación de Object.prototype\n\t\t\t\t// Evita un bucle sin fin\n\t\t\t\tif (nombre === \"__proto__\" || destino === copiar) {\n\t\t\t\t\tSeguir;\n\t\t\t\t}\n\n\t\t\t\t// Recurrir si estamos fusionando objetos simples o matrices\n\t\t\t\tif (deep && copy && (jQuery.isPlainObject (copy) ||\n\t\t\t\t\t(copyIsArray = Array.isArray (copia)))) {\n\t\t\t\t\tsrc = objetivo [nombre];\n\n\t\t\t\t\t// Asegúrate del tipo adecuado para el valor fuente\n\t\t\t\t\tif (copyIsArray &&! Array.isArray (src)) {\n\t\t\t\t\t\tclon = [];\n\t\t\t\t\t} else if (! copyIsArray &&! jQuery.isPlainObject (src)) {\n\t\t\t\t\t\tclon = {};\n\t\t\t\t\t} demás {\n\t\t\t\t\t\tclon = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = falso;\n\n\t\t\t\t\t// Nunca mueva objetos originales, clónelos\n\t\t\t\t\ttarget [nombre] = jQuery.extend (deep, clone, copy);\n\n\t\t\t\t// No introduzcas valores indefinidos\n\t\t\t\t} más si (copiar! == indefinido) {\n\t\t\t\t\tdestino [nombre] = copiar;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "ffd2f7bfebedb0984829743a8674bdb4", "score": "0.49154437", "text": "function objectConstctor(nombre2,precio2) { // Aqui indicaremso los valores que le daremos despues\n this.nombre = nombre2;\n// Llave Valor (Aqui es donde le pondremos el valor que cacharemos arriba)\n this.precio = precio2;\n// Llave Valor (Aqui es donde le pondremos el valor que cacharemos arriba)\n this.cantidad = 1; // No hay problema si no estan en la perte de arriba ya que este lo queremos que se encuentre por defaul entonces no necesitamos perdir el valor.\n this.objetLiteal = false; // No hay problema si no estan en la perte de arriba ya que este lo queremos que se encuentre por defaul entonces no necesitamos perdir el valor.\n}", "title": "" }, { "docid": "8ced281632e121852990f799a7172911", "score": "0.49141055", "text": "mostrarDatos(){\n document.write('serie: '+ this.nombre +' Temporadas: '+ this.temporadas+'<br>');\n\n mostrarDatosExtendido(){\n //mostrar todas las propiedades del objeto \n }\n }", "title": "" }, { "docid": "a838461f9e049f5ba5901a35da90c520", "score": "0.49136218", "text": "function BranchPro(){\n this.type = 'branchpro'\n}", "title": "" }, { "docid": "9cd9ca9ae0cc9626638e3ab5d7c4ef1f", "score": "0.49115962", "text": "constructor(nombre, precio){ //-------------> Constructor es la funcion para \n this.nombre = nombre;\n this.precio = precio;\n }", "title": "" }, { "docid": "f65be0134c570453eda7970eb67ba869", "score": "0.49045923", "text": "function POM() {\n Strata.call(this);\n ColourStrata.call(this);\n BrightnessStrata.call(this);\n OpacityStrata.call(this);\n MagnetismStrata.call(this);\n PorosityStrata.call(this);\n CohesionStrata.call(this);\n HardnessStrata.call(this);\n CrackingStrata.call(this);\n POMCompositionStrata.call(this);\n InterfaceTransitionStrata.call(this);\n InterfaceRoughnessStrata.call(this);\n InterfaceAdherenceStrata.call(this);\n\n this.natureFamily = \"Pseudomorph of organic material\";\n this.shortNatureFamily = \"POM\";\n this.natureFamilyUid = \"pomCharacteristic\";\n\n this.dependencies.push('colourFamily');\n this.dependencies.push('brightnessFamily');\n this.dependencies.push('opacityFamily');\n this.dependencies.push('magnetismFamily');\n this.dependencies.push('porosityFamily');\n this.dependencies.push('cohesionFamily');\n this.dependencies.push('hardnessFamily');\n this.dependencies.push('crackingFamily');\n this.dependencies.push('pomcompositionFamily');\n this.dependencies.push('interfacetransitionFamily');\n this.dependencies.push('interfaceroughnessFamily');\n this.dependencies.push('interfaceadherenceFamily');\n\n this.getJsonCharacteristics = function() {\n var c = this.toJsonCharacteristics();\n if (this.colourFamily != \"\")\n c.push(this.getJsonColour());\n if (this.cohesionFamily != \"\")\n c.push(this.getJsonCohesion());\n if (this.hardnessFamily != \"\")\n c.push(this.getJsonHardness());\n if (this.crackingFamily != \"\")\n c.push(this.getJsonCracking());\n if (this.porosityFamily != \"\")\n c.push(this.getJsonPorosity());\n if (this.brightnessFamily != \"\")\n c.push(this.getJsonBrightness());\n if (this.opacityFamily != \"\")\n c.push(this.getJsonOpacity());\n if (this.magnetismFamily != \"\")\n c.push(this.getJsonMagnetism());\n if (this.pomcompositionFamily != \"\")\n c.push(this.getJsonPomcomposition());\n\n return c;\n }\n\n this.getJsonInterface = function() {\n var json = [];\n if (this.interfaceprofileFamily != \"\")\n json.push({'name' : this.interfaceprofileFamily});\n if (this.interfacetransitionFamily != \"\")\n json.push({'name' : this.interfacetransitionFamily});\n if (this.interfaceroughnessFamily != \"\")\n json.push({'name' : this.interfaceroughnessFamily});\n if (this.interfaceadherenceFamily != \"\")\n json.push({'name' : this.interfaceadherenceFamily});\n return json;\n };\n}", "title": "" }, { "docid": "cd1e6fd46192b7e6e8ff17e0562936e7", "score": "0.48963153", "text": "function moto(marca, linea, modelo, cilindraje) {\n this.marca = marca;\n this.linea = linea;\n this.modelo = modelo;\n this.cilindraje = cilindraje;\n} // Primero contruimos una plantilla de este tipo", "title": "" }, { "docid": "807323040dac05d0af71f3426aac7819", "score": "0.48900408", "text": "static get properties() {\n return {\n data: {\n type: Object\n }\n };\n }", "title": "" }, { "docid": "3817e478e5b05d0b4a89f70c5e727f16", "score": "0.48845807", "text": "function load_proyecto() {\n\t\ttareas = Persister.loadObj('tareas', \"[]\");\n\t\tif (idt==null || idt == \"\"){\n\t\t\t\n\t\t}\t\n\t\t$('#nombreProy').html('');\n\t\t$('#imgproy').html('');\n\t\t$('#numProy').html('');\n\t\t\tproyectos = Persister.loadObj('proyectos', \"[]\");\n\t\t\tdocument.getElementById('imgproy').src = proyectos[idt].icono ;\n\t\t\t$(\"#nombreProy\").html(proyectos[idt].nombre);\n\t\t\t$(\"#numProy\").html(proyectos[idt].id);\n\t\t\tnumP = proyectos[idt].id;\n\t\t\tdocument.getElementById('numProy').value = proyectos[idt].id; \n\t\t\t\n\t}", "title": "" }, { "docid": "0b7a7a408f5fb145d92bf9a430532158", "score": "0.48842502", "text": "function Persona() {\n //propiedad publica\n this.nombre;\n this.edad;\n}", "title": "" }, { "docid": "0f13c65ff8951685c6609eae2b02822d", "score": "0.4882821", "text": "function loadProperties(clsName, type) {\n properties = {};\n properties.clsName = clsName;\n properties.type = type;\n clicked = true;\n }", "title": "" }, { "docid": "b1b4521f609a9c17d7f31d8cce43b976", "score": "0.48737967", "text": "toString(){\n // se aplica polimorfismo (multiples formas en tiempo de ejecucion)\n // el metodo que se ejecuta depende si es una referencia de tipo padre o de tipo hijo\n return this.nombreComleto()\n }", "title": "" }, { "docid": "01058fd918c36fd6e9ab0f4ecf990aba", "score": "0.48665258", "text": "function BENEFICIOPESSOA(beneficio) {\r\n try {\r\n var self = this;\r\n\r\n self.id \t\t\t= ko.observable( beneficio ? (beneficio.id || 0) : 0);\r\n\t\t\t//self.idFunc\t\t\t= ko.observable( beneficio ? (beneficio.idFunc || 0) : 0);\r\n self.benefId \t\t= ko.observable( beneficio ? (new beneficioModule.BENEFICIO(beneficio.benefId) || {}) : {});\r\n \tself.createUser \t= ko.observable( beneficio ? (beneficio.create_user || \"\") : \"\");\r\n \tself.createDateUTC \t= ko.observable( beneficio ? (beneficio.create_date || 0) : 0);\r\n \tself.modifyUser \t= ko.observable( beneficio ? (beneficio.modify_user || \"\") : \"\");\r\n \tself.modifyDateUTC \t= ko.observable( beneficio ? (beneficio.modify_date || 0) : 0);\r\n\t\t\tself.modelAction\t= ko.observable( beneficio ? (beneficio.modelAction || \"INSERT\") : \"INSERT\");\r\n\r\n } catch (e) {\r\n\t\t\tdebugger\r\n \tconsole.log(e);\r\n }\r\n }", "title": "" }, { "docid": "40038a07c2bb5005a16f88ce0f2332cd", "score": "0.48598063", "text": "function HelioObject (obj) {\n this.o = obj;\n }", "title": "" }, { "docid": "753c88189a1c5407bcea7d257d35539e", "score": "0.48581976", "text": "toString(){\n //Se aplica polimorfismo (multiples formas en tiempo de ejecucion)\n //el metodo que se ejecuta depende si es una referencia de tipo padres\n //o de tipo hijo\n return this.nombreCompleto();\n }", "title": "" }, { "docid": "330e9ffaec4bce4d012c378cd2da669e", "score": "0.48546073", "text": "function Largepizza(large)\n{\n this.largeSize=large;\n this.largeCost=[];\n}", "title": "" }, { "docid": "b5fc26201119b36d1dfd09c793d8925c", "score": "0.4852425", "text": "function createObyP(protoObj)\r\n{\r\n var tmpO = null;\r\n if(Object.create)\r\n {\r\n tmpO = Object.create(protoObj);//Create an object from an prototype\r\n }\r\n else\r\n {\r\n tmpf = function(){};\r\n tmpf.prototype = protoObj;\r\n tmpO = new tmpf();\r\n }\r\n return tmpO;\r\n}", "title": "" }, { "docid": "dbbb0d4fce9a8833be36684959526562", "score": "0.4848594", "text": "constructor(P_props)\n {\n super (P_props);\n }", "title": "" }, { "docid": "dbbb0d4fce9a8833be36684959526562", "score": "0.4848594", "text": "constructor(P_props)\n {\n super (P_props);\n }", "title": "" }, { "docid": "e4a4fe7f7d7fc1d44601302dfb7e6862", "score": "0.48485366", "text": "constructor(nombre, tipo, numPatas) {\n this.nombre = nombre;\n this.tipo = tipo;\n this.numPatas = numPatas;\n }", "title": "" }, { "docid": "1ddb716ce59aeaba446fee7dfa02ff16", "score": "0.4844486", "text": "function Hh(a){Hh.p.constructor.call(this,a);eh(this)}", "title": "" }, { "docid": "9225687b9bcca9ce3635b522171a27e0", "score": "0.48424664", "text": "function Persona(nombre, apellido,altura) {\n //this.nombre atributo del objeto que se esta creando\n this.nombre = nombre;\n this.apellido = apellido;\n this.edad = 20\n this.altura = altura\n}", "title": "" }, { "docid": "567733c4a44f6d56c63b714aa038269d", "score": "0.4842056", "text": "function comprobarPremioMinimo(premio) {\n // debe ser un objecto\n var comprobado = 'object' === typeof premio;\n // propiedades no nulas\n comprobado = (comprobado && premio.hasOwnProperty('idPremio'));\n return comprobado;\n}", "title": "" }, { "docid": "48e49cc2355d8d07c684cb2890adcf9e", "score": "0.48349375", "text": "function SE_Obj (){}", "title": "" }, { "docid": "e2691e22340abebe8d6652f5a95ed6d7", "score": "0.4831978", "text": "function Profesor(name, surname, salary, officeNum) {\n Empoloyee.call(this, name, surname, salary)\n this.officeNum = officeNum;\n}", "title": "" }, { "docid": "6a093b4dce6a03d22884d91a0b66cf9c", "score": "0.4830009", "text": "static loadObject(srcobj){\n\t\t\n\t\t//console.log(srcobj);\n\t\t\n\t\tif ( Array.isArray( srcobj ) ){\n\t\t\t\n\t\t\tvar destobj = [];\n\t\t\t\n\t\t\tfor (var i = 0; i < srcobj.length; i++){\n\t\t\t\t\n\t\t\t\tdestobj[i] = this.loadObject(srcobj[i]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else if ( typeof srcobj == 'object' && ( srcobj != null ) ){\n\t\t\t\n\t\t\tif ( srcobj.type ){\n\t\t\t\t\n\t\t\t\t// We remove all non alphanumeric characters so that when eval goes to evaluate the Class name there is no possibility for funny bisnis \n\t\t\t\t\n\t\t\t\tvar typestring = srcobj.type.replace(/\\W/g, '')\n\t\t\t\tvar p = eval(typestring); \n\t\t\t\t\n\t\t\t\t// We ensure that only permissible base classes are used in the world construction\n\t\t\t\tvar perm = false;\n\t\t\t\tfor ( var classname in this.acceptedBaseClasses ){\n\t\t\t\t\tvar cl = this.acceptedBaseClasses[classname];\n\t\t\t\t\t\n\t\t\t\t\tif ( new p() instanceof cl){ perm = true; break; }\n\t\t\t\t}\n\t\t\t\tif (!perm){ console.log(\"Non-allowed class found: \" + typestring); return null; }\n\t\t\t\t\n\t\t\t\tvar destobj = new p();\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tvar destobj = {};\n\t\t\t}\n\t\t\t\n\t\t\tfor (var property in srcobj){\n\t\t\t\t\n\t\t\t\t//console.log(property);\n\t\t\t\t//destobj[property] = srcobj[property];\n\t\t\t\t\n\t\t\t\t//if (typeof srcobj[property] == 'object' && srcobj[property] != null){\n\t\t\t\t\n\t\t\t\tdestobj[property] = this.loadObject(srcobj[property]);\n\t\t\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t}else{\n\t\t\treturn srcobj;\n\t\t}\n\t\t\n\t\treturn destobj;\n\t\t\n\t}", "title": "" }, { "docid": "1571d1a2fe630c947a31f1f49263bcc5", "score": "0.48265314", "text": "function ajouterProduit($container) {\n// Dans le contenu de l'attribut « data-prototype », on\n// - le texte \"__name__label__\" qu'il contient par le label du champ\n// - le texte \"__name__\" qu'il contient par le numéro du champ\n var $prototype = $($container.attr('data-prototype').replace(/__name__label__/g, 'Produit n°' + (index+1)) .replace(/__name__/g, index));\n // On ajoute au prototype un lien pour pouvoir supprimer le produit\n ajouterLienSuppression($prototype);\n// On ajoute le prototype modifié à la fin de la balise <div>\n $container.append($prototype);\n// Enfin, on incrémente le compteur pour que le prochain ajout se fasse avec un autre numéro\n index++;\n}", "title": "" }, { "docid": "a97ead75b4638c00948ea1648c7ed39c", "score": "0.48228744", "text": "function processObj(obj){\r\n\t\t\t\t\tif(obj.type=='class' && obj['extends']){\r\n\t\t\t\t\t\tvar extObj=api.getNSObject(obj['extends']);\r\n\t\t\t\t\t\tif(extObj){\r\n\t\t\t\t\t\t\tif(!extObj.subclasses)\r\n\t\t\t\t\t\t\t\textObj.subclasses=[];\r\n\t\t\t\t\t\t\textObj.subclasses.push(obj);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(obj.children)\r\n\t\t\t\t\t\tfor(var c in obj.children)\r\n\t\t\t\t\t\t\tprocessObj(obj.children[c]);\r\n\t\t\t\t}", "title": "" }, { "docid": "a7bb7db55f33f3092e326ee785487564", "score": "0.4822742", "text": "function criaObjeto(pontos, canvas, func, tipo) {\n var obj = {\n id: idObjetos++,\n tipo: tipo,\n matriz: [[], [], []]\n };\n pontos.forEach(function (data, index) {\n obj['ponto' + (index + 1)] = data;\n obj.matriz[0].push(data.x);\n obj.matriz[1].push(data.y);\n obj.matriz[2].push(1);\n });\n desenhaMatriz(obj.matriz, canvas);\n listaObjetos.push(obj);\n desabilitaFerramenta(canvas, func);\n}", "title": "" }, { "docid": "62a6627b0560c1e497cb0d19410c1c9c", "score": "0.482085", "text": "function buatObjectMahasiswa(nama,nim,email,jurusan) {\n var mhs = {};\n mhs.nama = nama;\n mhs.nim = nim;\n mhs.email = email;\n mhs.jurusan = jurusan;\n\n return mhs;\n}", "title": "" }, { "docid": "e9bc260c316dd2a5f95d4d6d1c5cdd56", "score": "0.48191923", "text": "constructor(sobrenome, profissao = 'Professor') {\n super(sobrenome) //super chama a funcao construtora da super classe\n this.profissao = profissao\n }", "title": "" } ]
4bbab287876f3f99d099ef244727bc1f
Print a file upload done notification
[ { "docid": "e140dd370aae16846d3ca019c2145bd1", "score": "0.80909115", "text": "function fileUploadDone() {\n signale.complete('File upload done');\n}", "title": "" } ]
[ { "docid": "d68386a6c9fb9677ce29711361dc8ddc", "score": "0.7652515", "text": "function onUploadComplete(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传完毕\";\r\n\t\t}", "title": "" }, { "docid": "b32fab7f9d8b2520e4f116e46860d5bb", "score": "0.7521302", "text": "function onUploadFinished(e) {\n\ttotFileUploaded += document.getElementById('files').files[uploadedFiles].size;\n\tuploadedFiles++;\n\tdebug('complete ' + uploadedFiles + \" of \" + totFileCount);\n\tdebug('totalFileUploaded: ' + totFileUploaded);\n\tif (uploadedFiles < totFileCount) {\n\t\tuploadNextFile();\n\t} else {\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = '100%';\n\t\tbar.innerHTML = '100 % completed';\n\t\tbootbox.alert('File uploading Finished');\n\t}\n\n}", "title": "" }, { "docid": "a755cc183d87cc2bd486818e4230429b", "score": "0.7368505", "text": "function onUploadComplete(e) {\r\n\ttotalUploaded += document.getElementById('files').files[filesUploaded].size;\r\n\tfilesUploaded++;\r\n\t// debug('complete ' + filesUploaded + \" of \" + fileCount);\r\n\t// debug('totalUploaded: ' + totalUploaded);\r\n\tif (filesUploaded < fileCount) {\r\n\t\tuploadNext();\r\n\t} else {\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = '100%';\r\n\t\tbar.innerHTML = '100% complete';\r\n\t\t//notification();\r\n\t}\r\n}", "title": "" }, { "docid": "71e1159d3c9579d55050719ca2a40d18", "score": "0.73374516", "text": "function fileUploaded(status) {\r\n document.getElementById('issuePicFormlet').style.display = 'none';\r\n document.getElementById('output').innerHTML = status;\r\n }", "title": "" }, { "docid": "0128d5502ca88a04413ccb0778206612", "score": "0.72946453", "text": "function onUploadComplete(e) {\n totalUploaded += document.getElementById('files').files[filesUploaded].size;\n filesUploaded++;\n debug('complete ' + filesUploaded + \" of \" + fileCount);\n debug('totalUploaded: ' + totalUploaded);\n if (filesUploaded < fileCount) {\n uploadNext();\n } else {\n var bar = document.getElementById('bar');\n bar.style.width = '100%';\n bar.innerHTML = '100% complete';\n }\n }", "title": "" }, { "docid": "36daab1844c07cfd1c00b7af374f3119", "score": "0.7274781", "text": "function queueComplete(numFilesUploaded) {\n\tvar status = document.getElementById(\"divStatus\");\n\tstatus.innerHTML = numFilesUploaded + \" 文件\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" 上传成功.\";\n}", "title": "" }, { "docid": "0cb4d30509e1c0299de7b308190387d6", "score": "0.72371805", "text": "function onUploadComplete(event) {\n $('#' + event[\"id\"]).html('Complete');\n uploader.removeFile(event[\"id\"]);\n fileCount--;\n}", "title": "" }, { "docid": "03ed817f7241da8c7a75f79b81035dc5", "score": "0.7233086", "text": "function queueComplete(numFilesUploaded) {\n\tvar status = document.getElementById(\"divStatus\");\n\tstatus.innerHTML = \"已上传 \"+numFilesUploaded + \" 文件\";\n}", "title": "" }, { "docid": "30210f46f73bb0af726fe5ec2d4cde37", "score": "0.72151995", "text": "function onloadHandler(evt) {\n\t\t\t\t\t//var div = document.getElementById('upload-status');\n\t\t\t\t\t//div.innerHTML += '<' + 'br>File uploaded. Waiting for response.';\n\t\t\t\t}", "title": "" }, { "docid": "2a814643dcf3ecb0cfffdb22cdf01d31", "score": "0.7195726", "text": "function onloadHandler(evt) {\r\n var div = document.getElementById('upload-status');\r\n div.innerHTML += '<' + 'br>File uploaded. Waiting for response.';\r\n}", "title": "" }, { "docid": "e2db9467b53c2241c5585f8642d7e766", "score": "0.7173631", "text": "function onloadHandler(evt) {\n\tvar div = document.getElementById('upload-status');\n\tdiv.innerHTML += '<' + 'br>File uploaded. Waiting for response.';\n}", "title": "" }, { "docid": "98a06dc4cc09841dc1f236fed5393fed", "score": "0.7162055", "text": "handleUploadFinished(event) {\n\n try {\n const uploadedFiles = event.detail.files;\n //show success toast message \n const evt = new ShowToastEvent({\n title: 'File Upload Status...',\n message: uploadedFiles.length + 'file(s) uploaded successfully.',\n variant: 'success',\n });\n this.dispatchEvent(evt);\n showSuccessMessage(this, `${uploadedFiles.length} file(s) uploaded successfully.`);\n\n let childCmp = this.template.querySelector('c-attachments-viewer');\n if (childCmp) {\n childCmp.refresh(this.recordId);\n }\n } catch (e) {\n showAsyncErrorMessage(this, e);\n }\n }", "title": "" }, { "docid": "a690ad538d7c3bb7bdf7e92336803e8f", "score": "0.71062475", "text": "function uploadCompleteHandler() {\n console.log(\"Upload finished.\");\n getAllFiles();\n /*\n Do what you like here.\n */\n}", "title": "" }, { "docid": "f3bf86603b92bb04a3c44fbdcd5195eb", "score": "0.70759887", "text": "function queueComplete(numFilesUploaded) {\n\t//var status = document.getElementById(\"divStatus\");\n\t//status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "f3bf86603b92bb04a3c44fbdcd5195eb", "score": "0.70759887", "text": "function queueComplete(numFilesUploaded) {\n\t//var status = document.getElementById(\"divStatus\");\n\t//status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "b2e6922473199cd2d8e0e56dc3fdc199", "score": "0.7041214", "text": "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "title": "" }, { "docid": "011fc532c0b0c6e99adf252670772efe", "score": "0.69880277", "text": "function queueComplete(numFilesUploaded) {\r\r\n\tvar status = document.getElementById(\"divStatus\");\r\r\n\tstatus.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\r\r\n}", "title": "" }, { "docid": "6658a957762189465fbc6f4b4d25184a", "score": "0.6945951", "text": "function uploadComplete(evt) {\n /* This event is raised when the server send back a response */\n console.log(evt.target.responseText);\n }", "title": "" }, { "docid": "91a0e48b0a7882c5ca34d26fd1cd7b89", "score": "0.6882029", "text": "function fileDownloadDone(filePath) {\n signale.complete('File download done, file saved to: ' + filePath);\n}", "title": "" }, { "docid": "9cc495672345c55b27d81cf321560746", "score": "0.6869613", "text": "function uploadDone(file, event, response) {\n // Update file infos\n file.isUploading = false;\n file.done = true;\n file.progress = 100;\n\n // Execute file-specific callback\n (file.callback || angular.noop)();\n\n // Emit event\n Uploader.onUploadDone(file, event, response);\n\n queueChanged();\n }", "title": "" }, { "docid": "d99221459f0c39fa22604215470b50b5", "score": "0.68660545", "text": "function queueComplete(numFilesUploaded) {\r\n//\talert('aas');\r\n}", "title": "" }, { "docid": "e8027286ecbe2342d429139eba895131", "score": "0.68640834", "text": "function queueComplete(numFilesUploaded) {\n //var status = document.getElementById(\"divStatus\");\n //status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";\n}", "title": "" }, { "docid": "b701e05068e40748b4ebad8468965173", "score": "0.68549603", "text": "function fileDialogComplete(numFilesSelected, numFilesQueued) {\r\n\t//this.startUpload();\r\n\tthis.startResizedUpload(undefined, 1000, 1000, SWFUpload.RESIZE_ENCODING.JPEG, 100);\r\n}", "title": "" }, { "docid": "3a4cfc3205e0a1e07c465a726a633db1", "score": "0.68500185", "text": "function onFileUploadProgress(e) {\n\tif (e.lengthComputable) {\n\t\tvar percentComplete = parseInt((e.loaded + totFileUploaded) * 100 / totFileLength);\n\n\t\tif(percentComplete>100)\n\t\t\tpercentComplete = 100;\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = percentComplete + '%';\n\t\tbar.innerHTML = percentComplete + ' % completed';\n\t\tbootbox.alert('File uploading Finished');\n\t} else {\n\t\tdebug('computation failed');\n\t}\n}", "title": "" }, { "docid": "c6e7d536120d23ecb6e218ca27a3f6dc", "score": "0.68078756", "text": "function handle_job_done(status_fn) {\n const result_fn = status_fn.replace('_log.log', '_output.mp3');\n $(\"#upload_result_button\").show();\n\n if (is_uploaded(result_fn)) {\n populate_upload_result_link(result_fn);\n } else {\n $(\"#upload_result_button\").click(function () {\n upload_result(result_fn);\n });\n $(\"#upload_result_button\").prop(\"disabled\", false);\n }\n}", "title": "" }, { "docid": "d587e97f6b74d160c2c277fc8da0e368", "score": "0.679715", "text": "function queueComplete(numFilesUploaded) {\r\n\tvar status = document.getElementById(\"divStatus\");\r\n\tstatus.innerHTML = \"Завантажено файлів:\" + numFilesUploaded ;\r\n}", "title": "" }, { "docid": "0a535f24b412a052f4d7d921044f1d58", "score": "0.6771358", "text": "function queueComplete(numFilesUploaded) {\r\n\ttry {\r\n\t\tuploadSWFmessage = (numFilesUploaded - missedFilesCount) + \" file\"\r\n\t\t\t\t+ ((numFilesUploaded - missedFilesCount) === 1 ? \"\" : \"s\")\r\n\t\t\t\t+ \" uploaded.\" + refreshString;\r\n\r\n\t\tmissedFilesCount = 0;\r\n\t\tprogressTarget = this.customSettings.progressTarget;\r\n\t\t// showStatusMessage(message);\r\n\t\tvar hideQueue = function() {\r\n\t\t\tdocument.getElementById(progressTarget).style.display = \"none\";\r\n\t\t\tshowStatusMessage(uploadSWFmessage);\r\n\t\t};\r\n\t\tsetTimeout(function() {\r\n\t\t\t\t\thideQueue.call(self)\r\n\t\t\t\t}, 3 * 1000);\r\n\t\tvar btnCancel;\r\n\t\tbtnCancel = document.getElementById(this.customSettings.cancelButtonId);\r\n\t\tif (btnCancel) {\r\n\t\t\tbtnCancel.style.display = \"none\";\r\n\t\t}\r\n\t} catch (ex) {\r\n\t\tthis.debug(ex);\r\n\t}\r\n}", "title": "" }, { "docid": "456f771663ca28a65e8696c897ebfcd5", "score": "0.6761083", "text": "function queueComplete(numFilesUploaded)\n{\n /*var status = document.getElementById(\"divStatus\");\n status.innerHTML = numFilesUploaded + \" file\" + (numFilesUploaded === 1 ? \"\" : \"s\") + \" uploaded.\";*/\n}", "title": "" }, { "docid": "02e74cfd05e570a6f4b1b5b88b1ba91c", "score": "0.67412686", "text": "function onloadstartHandler(evt) {\r\n var div = document.getElementById('upload-status');\r\n div.innerHTML = 'Upload started.';\r\n}", "title": "" }, { "docid": "dc0f58f738466706c4caeb189bb83395", "score": "0.6730324", "text": "function onloadstartHandler(evt) {\n\t\t\t\t\t//var div = document.getElementById('upload-status');\n\t\t\t\t\t//div.innerHTML = 'Upload started.';\n\t\t\t\t}", "title": "" }, { "docid": "511e0dcd514cc5a74ef0fa0b3c0abe22", "score": "0.6695225", "text": "function fileSuccess(file, message) {\n // Iterate through the file list, find the one we\n // are added as a temp and replace its data\n // Normally you would parse the message and extract\n // the uploaded file data from it\n angular.forEach(vm.files, function (item, index)\n {\n if ( item.id && item.id === file.uniqueIdentifier )\n {\n // Normally you would update the file from\n // database but we are cheating here!\n\n // Update the file info\n item.name = file.file.name;\n item.type = 'document';\n\n // Figure out & upddate the size\n if ( file.file.size < 1024 )\n {\n item.size = parseFloat(file.file.size).toFixed(2) + ' B';\n }\n else if ( file.file.size >= 1024 && file.file.size < 1048576 )\n {\n item.size = parseFloat(file.file.size / 1024).toFixed(2) + ' Kb';\n }\n else if ( file.file.size >= 1048576 && file.file.size < 1073741824 )\n {\n item.size = parseFloat(file.file.size / (1024 * 1024)).toFixed(2) + ' Mb';\n }\n else\n {\n item.size = parseFloat(file.file.size / (1024 * 1024 * 1024)).toFixed(2) + ' Gb';\n }\n }\n });\n }", "title": "" }, { "docid": "d0ac4cd10b6cc43778efc68ea900ed81", "score": "0.6676188", "text": "function onloadstartHandler(evt) {\n\tvar div = document.getElementById('upload-status');\n\tdiv.innerHTML = 'Upload started.';\n}", "title": "" }, { "docid": "2eaf276d8d26339cd284cccf3431b1b0", "score": "0.6671593", "text": "function progressHandler(e) {\n console.log(\"uploaded \" + e.currentBytes + \" / \" + e.totalBytes);\n}", "title": "" }, { "docid": "7bad4513f70a193bb2d9df11b50ff5d6", "score": "0.6638075", "text": "function uploadComplete(result)\n{\n\tif ( result == 1 )\n\t{\n\t\t$(\".ui-progressbar-progress\").width(\"100%\");\n\t\t$(\".ui-progressbar-text\").html(\"Der Upload wurde erfolgreich abgeschlossen!\");\n\t\t$(\".ui-progressbar\").addClass(\"ui-progress-completed\");\n\t\t$(\"#nocheine\").show();\n\t\t\n\t\tvar dateiWert = $(\"input[type='file']\").val();\n\t\tvar dateiWertArray = dateiWert.split(\"\\\\\");\n\t\t$(\"label[for='eingabe_datei']\").children(\"span\").html( \" \" + dateiWertArray[dateiWertArray.length-1] + \" wurde erfolgreich hochgeladen\" );\n\t}\n\telse\n\t{\n\t\t$(\".ui-progressbar-text\").html(\"Der Upload ist gescheitert!\");\n\t\t$(\".ui-progressbar\").addClass(\"ui-progress-error\");\n\t\t$(\"#error\").show();\n\t}\n}", "title": "" }, { "docid": "6f955d306943a3ca497667d1acc2dbdb", "score": "0.6588849", "text": "function fileQueued(fileObj) {\n\t\t\t//var items = jQuery('#media-items').children();\n\t\t\tvar uploadtitle = '<div class=\"uploading-item-wrapper\"><div class=\"uploading-item-name clearfix\"><span class=\"filename original\">'+fileObj.name+'</span></div></div>';\n\t\t\tvar uploadprocess = '<div class=\"progress\"><div class=\"bar\"></div></div>';\n\t\t\tvar uploadinfo = '<div class=\"uploading-item-info clearfix\"><div class=\"percent\">0%</div><div class=\"filesize\"></div></div>';\n\t\t\t// Create a progress bar containing the filename\n\t\t\tjQuery('<div class=\"uploading-item\">').attr( 'id', 'media-item-' + fileObj.id ).append(uploadtitle+uploadprocess+uploadinfo).prependTo( jQuery('#media-items' ) );\n\t\t}", "title": "" }, { "docid": "97d76357981f2d6e5dcc0f4208f73d7f", "score": "0.65784335", "text": "function uploadDone()\n {\n \ttry\n {\n $swfUpload.destroy();\n $widget.parents('form:first')\n .unbind('submit', doUpload)\n .submit();\n \t}\n catch(ex)\n {\n \t\talert(\"Error submitting form\");\n \t}\n }", "title": "" }, { "docid": "fe051025db3436f4978c68053a5d2bb6", "score": "0.65568244", "text": "function uploadFile(){\n localUpload();\n publicUpload();\n alert(\"File uploaded.\\nWaiting to get analyze result.\");\n window.location.href = \"index.php?upload&filename=\" + fileName;\n }", "title": "" }, { "docid": "cd566920453e0e5fae3a166210ecc5f0", "score": "0.65520984", "text": "handleFileUploadFinished() {\n this.isWorking = false\n }", "title": "" }, { "docid": "88b1a766c2312b4509cc8425624d7f24", "score": "0.6541906", "text": "function fileUploadFailed() {\n console.log(\"Failed to upload file\");\n}", "title": "" }, { "docid": "3741b969e7be64a6c311fead6f0977b7", "score": "0.65413797", "text": "function upload() {\n gtag('event', 'Event Uploader Submit');\n formatEvents();\n showHide('results', 'preview');\n apiWorker.postMessage(array);\n}", "title": "" }, { "docid": "3868f8c974629caed3ecadab2c942e6a", "score": "0.65382606", "text": "onFileProcessed (fileAction) {\n this.filesOk++\n fileAction.progress = `${this.filesOk}/${this.sourceFiles.length}`\n\n if (fileAction.status === 'success') {\n Log.successAction(fileAction)\n } else {\n Log.errorAction(fileAction)\n }\n }", "title": "" }, { "docid": "4a80a790fdb9b4484dc583431baf4e7e", "score": "0.6520762", "text": "function onUploadStart(event) {\n\n}", "title": "" }, { "docid": "db7c152c1314c598291052c25d60e316", "score": "0.650012", "text": "function onUpload(files) {\n\tvar file = files[0]\n\tconsole.log(\"sending to background\")\n\t// Sending the file to background\n\tsendToBackground(file)\n}", "title": "" }, { "docid": "77c99cc3cce44bb61389420d76bb2774", "score": "0.6476661", "text": "function uploadStart(event, file) {\n\t\t\t\tresetUploadUI();\n\t\t\t\tuploadElement.addClass('uploading');\n\t\t\t}", "title": "" }, { "docid": "8428744214161b07311eae0d1b60dcde", "score": "0.6461557", "text": "function onUploadProgress(event) {\r\n\t\t\tprog = Math.round(100*(event[\"bytesLoaded\"]/event[\"bytesTotal\"]));\r\n\t\t\tthis.progressReport.innerHTML = \"已上传 \" + prog + \"% ...\";\r\n\t\t}", "title": "" }, { "docid": "58ac35923bf52d5d0b78753fd86efa5a", "score": "0.6457574", "text": "function onUploadFailed(e) {\n alert(\"Error uploading file\");\n }", "title": "" }, { "docid": "a87f6b2e92769d5b8e66e63ec4881333", "score": "0.64575535", "text": "function uploadProgress(event, file, bytes, maxBytes) {\n\t\t\t\tvar percent = Math.floor((bytes/maxBytes)*100);\n\n\t\t\t\t// Upload finished, we mark as finalizing\n\t\t\t\tif (percent>=100) {\n\t\t\t\t\tpercent=100;\n\t\t\t\t\t// If the finalizing process is too long, we add sample preview\n\t\t\t\t\ttimeoutSamplePreview = setTimeout(function() {\n\t\t\t\t\t\tif (uploadElement.is('.finished')) return;\n\t\t\t\t\t\tuploadElement.removeClass('uploading').addClass('finalizing');\n\t\t\t\t\t\tpreviewElement.html(file.name);\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t\t// Updating UI\n\t\t\t\tbarElement.css('width', percent+'%');\n\t\t\t\tpercentElement.text(percent+' %');\n\t\t\t}", "title": "" }, { "docid": "64ad24452e685994924d14b95aff961f", "score": "0.6444317", "text": "function onUploadFailed(e) {\r\n\talert(\"Error uploading file\");\r\n}", "title": "" }, { "docid": "a6f3972ac3dd6a7493e71fa8f0fb2952", "score": "0.6423667", "text": "function display_file_name(event) {\n // alert(event.fpfile.filename );\n $('.uploaded_file_name').text(event.fpfile.filename)\n}", "title": "" }, { "docid": "839d67b11d830f39636d1a4d055f1a1f", "score": "0.642017", "text": "function upload()\n{\n\t// indicate that the uploading is starting.\n\t$element = $('.photo-display .progress-element').addClass('uploading');\n\t\n $(\"#photo-upload\").submit();\n}", "title": "" }, { "docid": "91aee8fd1695cfa15420391f514a5681", "score": "0.6387808", "text": "function handleFileProgress(event) {\n\n}", "title": "" }, { "docid": "cc0b00e01aace14804167751f5043aee", "score": "0.63562393", "text": "function uploadFailed(evt) {\n alert(\"There was an error attempting to upload the file.\");\n }", "title": "" }, { "docid": "1d778897414c91f70472cb4feacb99b0", "score": "0.63550895", "text": "function uploadCallback (data) {\n if (! (data && data.total)) return;\n \n // update the display\n var kbps = Math.floor(data.done / (data.nowtime - data.starttime) / 1024)\n var percent = Math.floor(data.done * 100 / data.total);\n $j(\"#progress-bar\").css('width', percent + \"%\");\n var status = Math.floor(data.done / 1024) + \" kB of \" + Math.floor(data.total / 1024) + \" kB (\" + kbps + \"kB/s), \" + percent + \"% Complete\";\n $j(\"#upload-status\").html(status);\n}", "title": "" }, { "docid": "fa5e1ecdf72d383daf747020c2cc7dc3", "score": "0.6336116", "text": "function cancelledHandler(e) {\n console.log(\"upload cancelled\");\n}", "title": "" }, { "docid": "32c3eed976268c681353689dbf79f832", "score": "0.6326207", "text": "function fileQueued(file) {\r\r\n\ttry {\r\r\n\t\tvar progress = new FileProgress(file, this.customSettings.progressTarget);\r\r\n\t\tprogress.setStatus(\"Pending...\");\r\r\n\t\tprogress.toggleCancel(true, this);\r\r\n\r\r\n\t} catch (ex) {\r\r\n\t\tthis.debug(ex);\r\r\n\t}\r\r\n\r\r\n}", "title": "" }, { "docid": "6fd0218179a16023467b2cb741c8c8d4", "score": "0.63026136", "text": "function done() {\n\t$destination.innerHTML = store + fileName;\n\t$status.innerHTML = \"Done\";\n}", "title": "" }, { "docid": "3923abc502bd1b423393232b1d916a0c", "score": "0.62955844", "text": "function captureSuccess(mediaFiles) {\n var i, len;\n for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n \n\t\t\tvar mediaFile = mediaFiles[i];\n\t\t\tuploadFile(mediaFiles[i]);\n\t\t\t//navigator.notification.alert(mediaFile.fullPath, null, mediaFile.name);\n } \n }", "title": "" }, { "docid": "913531ba51eb40dfda56cb898d57465f", "score": "0.62814754", "text": "function onUploadError(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传失败\";\r\n\t\t}", "title": "" }, { "docid": "d4da75dcdcb1f1bcc469023f2aa14088", "score": "0.6262541", "text": "handleSuccessfulUpload(file) {\n const json = JSON.parse(file.xhr.response);\n\n // SilverStripe send back a success code with an error message sometimes...\n if (typeof json[0].error !== 'undefined') {\n this.handleFailedUpload(file);\n return;\n }\n\n this.props.actions.queuedFiles.removeQueuedFile(file._queuedAtTime);\n this.props.actions.gallery.addFiles(json, this.props.count + 1);\n }", "title": "" }, { "docid": "ce77734451e711d41d161bf57b2483be", "score": "0.6257874", "text": "get uploadingMsg() {\n return `Bezig met het opladen van ${this.fileQueue.files.length} bestand(en). (${this.fileQueue.progress}%)`;\n }", "title": "" }, { "docid": "57f54ccb211ca1e87677a3c72632af7e", "score": "0.6251844", "text": "function fileQueued(fileObj) {\n\t// Get rid of unused form\n\tjQuery('.media-blank').remove();\n\t// Collapse a single item\n\tif ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {\n\t\tjQuery('.toggle').toggle();\n\t\tjQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');\n\t}\n\t// Create a progress bar containing the filename\n\tjQuery('#media-items').append('<div id=\"media-item-' + fileObj.id + '\" class=\"media-item child-of-' + post_id + '\"><div class=\"progress\"><div class=\"bar\"></div></div><div class=\"filename original\">' + fileObj.name + '</div></div>');\n\t// Display the progress div\n\tjQuery('#media-item-' + fileObj.id + ' .progress').show();\n\n\t// Disable the submit button\n\tjQuery('#insert-gallery').attr('disabled', 'disabled');\n}", "title": "" }, { "docid": "2404dfb228769baf6e954b4385559ee0", "score": "0.62488765", "text": "handleOnClickFinalize() {\n this.startUpload();\n }", "title": "" }, { "docid": "b82f472c43398140bfd092e8625d5ad0", "score": "0.62474567", "text": "function fileQueued(file) {\n\ttry {\n\t\tvar progress = new FileProgress(file, this.customSettings.progressTarget);\n\t \tprogress.setStatus(\"等待...\");\n\t\tprogress.toggleCancel(true, this);\n\n\t} catch (ex) {\n\t\tthis.debug(ex);\n\t}\n\n}", "title": "" }, { "docid": "b8faa62e6a9ce33d555bcec875099457", "score": "0.62467664", "text": "function startUpload() {\n totalUploaded = filesUploaded = 0;\n uploadNext();\n }", "title": "" }, { "docid": "ae6937109e19fff86de40956313b4f5d", "score": "0.62347454", "text": "handleFileUploadStarted() {\n this.isWorking = true\n }", "title": "" }, { "docid": "ed75d7459df0d0a62a8fa58c48fe4268", "score": "0.62209314", "text": "function uploadSuccess(event, file, data, response) {\n\t\t\t\t// Getting JSON answer\n\t\t\t\ttry { data = $.parseJSON(data); }\n\t\t\t\t//Not JSON\n\t\t\t\tcatch(e) {\n\t\t\t\t\tresetUploadUI();\n\t\t\t\t\treturn $.ui.dialog.error(__('serverResponseUnknown'), __('error'));\n\t\t\t\t}\n\n\t\t\t\t// JSON return error\n\t\t\t\tif (data.error) {\n\t\t\t\t\tif (timeoutSamplePreview) clearTimeout(timeoutSamplePreview);\n\t\t\t\t\tresetUploadUI();\n\t\t\t\t\t$.ui.dialog.error(data.message, { 'title' : __('error') });\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Passing in finished mode\n\t\t\t\tuploadElement.removeClass('uploading finalizing').addClass('finished');\n\t\t\t\t// Getting the newly id based on the document type (document or image)\n\t\t\t\tif (documentType==\"image\") {\n\t\t\t\t\tidField.val(data.data.Image.id);\n\t\t\t\t} else {\n\t\t\t\t\tidField.val(data.data.Document.id);\n\t\t\t\t}\n\t\t\t\tpreviewElement.html(data.html);\n\t\t\t\treturn true;\n\t\t\t}", "title": "" }, { "docid": "b778946c29846992351a5467098579a7", "score": "0.6213551", "text": "function fileDialogStart()\n {\n \t$swfUpload.cancelUpload();\n \n if (typeof(handlers.file_dialog_start_handler) == 'function')\n {\n handlers.file_dialog_start_handler();\n }\n }", "title": "" }, { "docid": "e3d02cb0ab8413f5d46b35e8b21a9ceb", "score": "0.6207158", "text": "function api_completeupload(t, uq, k, ctx) {\n // Close nsIFile Stream\n if (is_chrome_firefox && uq._close) uq._close();\n if (uq.repair) uq.target = M.RubbishID;\n api_completeupload2({\n callback: api_completeupload2,\n t: base64urlencode(t),\n path: uq.path,\n n: uq.name,\n k: k,\n fa: uq.faid ? api_getfa(uq.faid) : false,\n ctx: ctx\n }, uq);\n}", "title": "" }, { "docid": "6300c2644e77ab7b51be5b06a338be8a", "score": "0.6207056", "text": "function updateAndCheckProgress(totalFiles, altStatusText) {\r\n\tvar currentProgress = $(\"#upload-status-progressbar\").progressbar(\"option\", \"value\");\r\n\tcurrentProgress = currentProgress + (100 / totalFiles);\r\n\t\r\n\t// Update the progress bar\r\n\t$(\"#upload-status-progressbar\").progressbar({value: currentProgress});\r\n\t\r\n\t// Check if that was the last file and hide the animation if it was\r\n\tif(currentProgress >= 99) {\r\n\t\t$(\"#upload-status-text\").html((altStatusText ? altStatusText : \"Please wait..\"));\r\n\r\n setTimeout(function() {\r\n \r\n $(\"#upload-box\").fadeOut(300);\r\n $(\"#upload-animation\").hide();\r\n //sendToServer();\r\n calculateAndShowResults();\r\n \r\n },1000);\r\n\t}\r\n}", "title": "" }, { "docid": "e80d8c104d55a62d74b561d68fbfc0d7", "score": "0.6198719", "text": "function file_selected( e ) {\n\tif( e.files.length == 1 ) {\n\t\t$('#upload_button').button('enable');\n\t\t$('#new_file_name_container').html( '<span id=\"new_file_name\">' + e.files[0].name + '</span>' );\n\t} else {\n\t\t$('#upload_button').button('disable');\n\t\t$('#new_file_name_container').html( '(Use \\'pick file\\' to select a tradition file to upload.)' );\n\t}\n}", "title": "" }, { "docid": "8420b6a7d0794b2b66ccb5cbf6da909d", "score": "0.6195487", "text": "function onTransferInProgress() {\n isFileTransferInProgress = true;\n}", "title": "" }, { "docid": "64817c4f45da9ba1dec1e8cebe593279", "score": "0.61933357", "text": "function completeHandler(data){\n\t\tclearMessages(); \n\t\tvar mess = [];\n\t\tvar mess =data.split(\"|\");\n\n\t\tswitch(mess[0]) {\n\t\t\tcase 'fileUpload':\n\t\t\t\t_(\"artStatus\").innerHTML = mess[1];\n\t\t\t\t_(\"status\").innerHTML = mess[2];\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fileRemove':\n\t\t\t\t_(\"artStatus\").innerHTML = 'removed';\n\t\t\t\t_(\"status\").innerHTML = mess[1];\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'uploadError':\n\t\t\t\t_(\"loaded_n_total\").innerHTML = '';\n\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// failed\n\t\t\t\t_(\"loaded_n_total\").innerHTML = 'System Error <br />';\n\t\t\t\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "517bafeb1da840021b11ef9fa826fbb0", "score": "0.6188373", "text": "function onUploadProgress(e) {\n if (e.lengthComputable) {\n var percentComplete = parseInt((e.loaded + totalUploaded) * 100 / totalFileLength);\n var bar = document.getElementById('bar');\n bar.style.width = percentComplete + '%';\n bar.innerHTML = percentComplete + ' % complete';\n } else {\n debug('unable to compute');\n }\n }", "title": "" }, { "docid": "2ba2f356f6f723c944e3c51817d000b9", "score": "0.61831295", "text": "uploadSuccess(fileItem, res){\n // 设置好状态\n fileItem.isUploading = false;\n fileItem.isClient = false;\n fileItem.remoteSrc = res;\n\n //抛出消息\n this.dispatch(UploadController.eventTypes.onProgress, 1, fileItem);\n\n if (this.checkIsComplete()) {\n this.dispatch(UploadController.eventTypes.onCompleteUpload, this.getFilesList());\n }\n }", "title": "" }, { "docid": "e7ed0e4ee18ce1f47a49ca8264d02852", "score": "0.617522", "text": "function startUploading()\n{\n try{\n lastRead=0;\n uploadDone=0;\n \n\tdocument.getElementById('cancelupload').style.display ='';\n document.getElementById('uploaderror').style.display ='none';\n document.getElementById('uploadwindow').style.display ='none';\n document.getElementById('emailwindow').style.display ='none';\n document.getElementById('uploadoverview').style.display='none';\n document.getElementById('uploadresults').style.display ='none';\n \n document.getElementById('progressbar').style.display ='';\n document.getElementById('progressbar2').style.display ='';\n document.getElementById('helpwindow').style.display ='';\n \n stopupload = false;\n }catch (e) {\n alert('startUploading:'+e)\n }\n}", "title": "" }, { "docid": "3f28928dc543976b1ecc5858ee3f383f", "score": "0.6159561", "text": "function lemurlog_Upload_Log(event)\n{\n var result = confirm(\"Would you like to upload log files?\");\n if(!result)\n {\n return;\n }\n \n lemurlog_DoActualUpload_Log();\n}", "title": "" }, { "docid": "3df31ecda816824332cb50cd40440a4d", "score": "0.6156", "text": "function upload_success(status_code, doc_url,file_org_name,file_name){\n\t\tswitch(status_code){\n\t\t\tcase 200:\n\t\t\t\tvar d = new Date();\n\t\t\t\tend_time = d.getTime();\n\t\t\t\tvar total_time = (end_time - start_time)/1000;\n\t\t\t\tconsole.log('uploaded document url:<-> ', doc_url, 'Total upload time: ',total_time,'F_NAME: ', file_name);\n\t\t\t\tvar info = {\n\t\t\t\t\tvc_id \t\t: f_handle.identity.vc_id,\n\t\t\t\t\tu_name \t\t: f_handle.identity.id,\n\t\t\t\t\tcontent_url \t: doc_url,\n\t\t\t\t\tfile_name \t: file_name,\n\t\t\t\t\tfile_org_name\t: file_org_name\n\t\t\t\t};\n\t\t\t\tf_handle.send_info (null, 'content_conversion',info);\n\t\t\t\tbreak;\n\t\t\tcase 401:\n\t\t\tcase 403:\n\t\t\t\talert('Permission issue ', status_code);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "title": "" }, { "docid": "e0a8a072e95c296397bd359442cdc9f9", "score": "0.6151052", "text": "fileWasDeleted() {\n alert('The Markdown file has been deleted!', 'warning', 3);\n }", "title": "" }, { "docid": "27fa451ba8870269e6b14ef65e71df40", "score": "0.6129852", "text": "function log() {\n const percent = Math.floor((finished / total) * 1000) / 10;\n if (percent - lastLogged >= 20) {\n lastLogged = percent - (percent % 20);\n console.log(` Uploaded ${percent}% of files`);\n }\n }", "title": "" }, { "docid": "7a9104ccb0cc3411b1d882e76e692c94", "score": "0.61055565", "text": "function afterSuccess(){\n $('#submit-btn').show(); //hide submit button\n $('#loading-img').hide(); //hide submit button\n $('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar\n //var filename = $(\"#output\").html();\n // parseFile(filename);\n}", "title": "" }, { "docid": "bfdc13b47260e164bf49e72637fc1fd3", "score": "0.6102685", "text": "function uploadCallback(e,data){\n\tvar filename = data.files[0][\"name\"];\n\tvar publicurl = data.result[0].publicUrl;\n\tvar path = data.result[0].location;\n\t$(\"#Post_fileFolder\").val(data.result[0].fileFolder); // add the folder with the files to the form\n\t$(\"#attachments ul\").append('<li><i name=\"'+path+'\" class=\"icon-remove cursor delAttachment\"></i> <a href=\"'+publicurl+'\" title=\"'+filename+'\"><img src=\"'+publicurl+'\" title=\"'+filename+'\" height=\"75\" width=\"75\"/></a></li>');\n}", "title": "" }, { "docid": "02ea1d585c39516904a2d204d59eb1f9", "score": "0.6098998", "text": "function startUpload() {\r\n\r\n\ttotalUploaded = filesUploaded = 0;\r\n\tuploadNext();\r\n\r\n}", "title": "" }, { "docid": "09499ea37be8de5d96070e43454559df", "score": "0.609452", "text": "function uploadOnChange() {\n var input = document.getElementById('file_btn_comment');\n var output = document.getElementById('display_file_comment');\n output.innerHTML = '<ul> Selected File :';\n for (var i = 0; i < input.files.length; ++i) {\n output.innerHTML += '<li>' + input.files.item(i).name + '</li>';\n }\n output.innerHTML += '</ul>';\n output.style.display = 'block';\n var cancelBtn = document.getElementById('cancel_btn_comment');\n\n cancelBtn.addEventListener('click', function () {\n output.style.display = 'none';\n })\n}", "title": "" }, { "docid": "325d656a30baabc73e04f4c6651e4fba", "score": "0.6092652", "text": "function onUploadSuccess(scope, event) {\n // if post call failure because of 403 forbidden error,\n if (event.target.status === 403) {\n scope.uploadedFiles = [];\n onUploadError(scope, event);\n return;\n }\n if (window.FormData) { // Check for IE9\n var response = getSuccessResponse(event);\n if (response) {\n scope.uploadedFiles.push(response[0]);\n } else {\n onUploadError(scope, event);\n return;\n }\n }\n Utils.triggerFn(scope.onSuccess, {'$event': event, '$scope': scope});\n if (!scope.multiple) {\n wmToaster.show('success', 'File Uploaded');\n }\n }", "title": "" }, { "docid": "96ff4d6ad9b61afced1d188578f93d86", "score": "0.6092481", "text": "function uploadProgress(file, event) {\n // Update file progress\n file.progress = (event.loaded / event.total)*100;\n\n // Emit event\n Uploader.onUploadProgress(file, event);\n }", "title": "" }, { "docid": "d90bdc11edf5a50bc49957a2268a8b82", "score": "0.60773027", "text": "function uploadChange($this) {\n\t\t\t//remove upload text after uploaded\n\t\t\tvar uploadText = $(pxUploadForm).data('upload');\n\t\t\tif (uploadText) {\n\t\t\t\t$('.uploadData', pxUploadForm).remove();\n\t\t\t\t$(pxUploadForm).removeData('upload');\n\t\t\t}\n\t\t\tvar $form = $this.parents('form');\n\t\t\t//validate file\n\t\t\tvar filename = px.validateFile( $this.val() );\n\t\t\tif (filename == -1){\n\t\t\t\talert ('Invalid file!');\n\t\t\t\t$(e).val('');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//remove disabled attr\n\t\t\t$(buttonM).removeAttr('disabled');\n\t\t\tvar loader = 'Uploading...';\n\t\t\tif ($.trim(config.imageLoader) != ''){\n\t\t\t\tloader = '<img src=\"'+ config.imageLoader +'\" alt=\"uploader\" />';\n\t\t\t}\n\t\t\tvar display = ' \\\n\t\t\t\t<div class=\"uploadData\" id=\"pxupload'+ itr +'_text\" title=\"pxupload'+ itr +'\"> \\\n\t\t\t\t\t<div class=\"close\">&nbsp;</div> \\\n\t\t\t\t\t<span class=\"fname\">'+ filename +'</span> \\\n\t\t\t\t\t<span class=\"loader\" style=\"display:none\">'+ loader +'</span> \\\n\t\t\t\t\t<div class=\"status\">Pending...</div> \\\n\t\t\t\t</div> \\\n\t\t\t';\n\t\t\t$(pxUploadForm).append(display);\n\t\t\t$form.appendTo(pxUploadForm + ' #pxupload'+ itr +'_text');\n\t\t\t//hide the input file\n\t\t\tpx.hideInputFile( '#' + $form.attr('id') );\n\t\t\t//increment for printing form\n\t\t\titr++;\n\t\t\t//Limit\n\t\t\tif (!isLimit) {\n\t\t\t\tpx.printForm();\n\t\t\t} else if (--limit) {\n\t\t\t\tpx.printForm();\n\t\t\t}\n\t\t\t//Callback on file Changed\n\t\t\tconfig.onFileChange($this, $form);\n\t\t}", "title": "" }, { "docid": "c76e6711526fb55aee3ecd460e66c35b", "score": "0.60683626", "text": "function uploadDone() {\n try {\n document.forms[0].submit();\n } catch (ex) {\n alert(\"Error submitting form\");\n }\n}", "title": "" }, { "docid": "e560f06bd62c1c5336428c9a55ab12f5", "score": "0.60682714", "text": "function upload()\n {\n messageBox.confirm({\n \"title\": \"Import Tasks\",\n \"message\": \"Do you wish import a file with your tasks?\",\n \"success\": function(e){\n var successFile = function(reason){\n if( window.cordova ){\n window.plugins.toast.show(reason, 'long', 'top');\n }\n BadgeHelper.redirectBadge();\n },\n errorFile = function(reason){\n Log.err(\"$cordovaFile.writeFile.err: \"+reason);\n messageBox.alert('Validation Error', reason, $rootScope, [{\n text: '<b>Ok</b>',\n type: 'button-blue-inverse',\n onTap: function(e){\n BadgeHelper.redirectBadge();\n }\n }]);\n };\n if( 'fileChooser' in window)\n {\n window.fileChooser.open(function(uri) {\n Log.success(\"window.fileChooser.open.success: \"+uri);\n window.FilePath.resolveNativePath(uri, function(fileName){\n Log.success(\"window.FilePath.resolveNativePath.success: \"+fileName);\n window.resolveLocalFileSystemURL(fileName, function (fileEntry)\n {\n Log.success(\"window.resolveLocalFileSystemURL.success: \", fileEntry);\n fileEntry.file(function (file) { \n saveByExport(file).then(successFile, errorFile);\n });\n });\n });\n });\n }\n else{\n var element = document.getElementById('upload-file-item');\n element.value = \"\";\n element.click();\n \n element.onchange = function()\n {\n saveByExport(this.files[0]).then(successFile, errorFile);\n };\n }\n }\n });\n }", "title": "" }, { "docid": "a5ca6768ef4aa3aed163dbc56bc1da86", "score": "0.6066963", "text": "function handlePicked() {\n displayFile(this.files);\n}", "title": "" }, { "docid": "6c2bee11c600311ee08aa3df5184f963", "score": "0.6055659", "text": "function upload() {\n ntAlert('请提供upload方法!');\n}", "title": "" }, { "docid": "48820f3d1dfaa809125e68d66fa718e8", "score": "0.60515094", "text": "function uploadedFile(id, textId){\n // get the files input and the text that indicates how many files did you upload\n let files = document.getElementById(id).files;\n let text = document.getElementById(textId);\n // it sets the text of textId as the number of files plus the string\n // if the files contain 0 or more than 1 object it says \"files\", if not it says \"file\"\n text.innerText = files.length>1||files.length==0 ? files.length+\" files selected\" : files.length+\" file selected\";\n}", "title": "" }, { "docid": "a1d431c19851646afe8279191c66e676", "score": "0.60495263", "text": "progressHandler(file, progress) {\n const filename = file.name\n const percentage = parseFloat(progress.bytesUploaded / progress.bytesTotal * 100).toFixed(2)\n const sizeUploaded = (progress.bytesUploaded / 1024 / 1024).toFixed(3)\n const sizeTotal = (progress.bytesUploaded / 1024 / 1024).toFixed(3)\n\n const bar = document.createElement('div')\n bar.innerHTML = \"~=\".repeat(200)\n bar.style.cssText = `position: absolute; left: 0; bottom: 0; width: ${percentage}%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`\n\n if (parseInt(percentage) == 100) {\n this.infoTarget.innerHTML = `Upload finished<br>${file.id}`\n } else {\n this.infoTarget.innerHTML = `${sizeUploaded}&thinsp;/&thinsp;${sizeTotal} MB, ${percentage}%<br>uploading ${file.id}`\n this.infoTarget.appendChild(bar)\n }\n }", "title": "" }, { "docid": "8a754d27813273f0dce0b339bf521955", "score": "0.6039968", "text": "function uploadComplete(data){\n\n // check for errors in the RTE submit\n if ($j('#jiveBridgeComposeMessageForm', data).length > 0) {\n\n // found an error, kill the existing RTE instance\n var editor = window.editor.get('wysiwygbridge');\n if (typeof(editor) != \"undefined\") {\n editor.killYourself();\n }\n\n // insert the html back into the dom\n $j('#bridge-compose-message').html(data);\n\n // make sure the help bar is reset\n $j('.jive-bridge-help').hide();\n $j('.jive-help-show').show();\n $j('.jive-help-hide').hide();\n\n // begin slew of RTE goodness\n jive.rte.multiRTE.push(\"wysiwygbridge\");\n if(typeof(window.editor) == \"undefined\") {\n window.editor = new jive.ext.y.HashTable();\n }\n buildBridgeRTE();\n }\n else if (data.indexOf('jive-body-intro') != -1) {\n var msg = \"Unexpected form token validation, please close this page and try again\";\n $j('<p />').html(msg).message({ style: 'error' });\n }\n else {\n // we are good,display the progress bar\n $j('#bridge-upload').html(data);\n // delay for 3 seconds for good measure\n setTimeout(function(){\n $j('#done').show('fast');\n $j('#spaceused1_percentText').hide();\n $j('#upload-status').show('fast');\n $j('#progress').removeClass(\"jive-upload-status\");\n $j('#progress').addClass(\"jive-upload-status-done\");\n $j('#viewmsg').prop('disabled', false);\n $j('#viewmsg2').prop('disabled', false);\n $j('#cancel').hide();\n }, 3000);\n }\n }", "title": "" }, { "docid": "8ca52b188db7b7c9347d4dea82434942", "score": "0.6033391", "text": "function finalizeUploading() {\n\n}", "title": "" }, { "docid": "5a42515546463411ccf1ad23005797c9", "score": "0.60284066", "text": "function handleUploads() {\n \n}", "title": "" }, { "docid": "ddfa60e3a6a397bbb5c1c92195653331", "score": "0.60267127", "text": "function completeUpload(success, fileName) {\n if(success == 1){\n $('#imagePreview').attr(\"src\", \"\");\n $('#imagePreview').attr(\"src\", fileName);\n $('#fileInput').attr(\"value\", fileName);\n $('.uploadProcess').hide();\ndocument.location.reload();\n }else{\n $('.uploadProcess').hide();\n alert('There was an error during file upload!');\n }\n return true;\n}", "title": "" }, { "docid": "76daac14c6c614ac2b02b25deabb9fb2", "score": "0.60139555", "text": "async function handleUpload(){\n let uService = service;\n if (uService instanceof UploadService) {\n uService = new UploadService();\n }\n await uService.handleUpload(document.getElementById(\"fileArea\"));\n if (uService.success) {\n NotificationManager.success(t(\"upload.successMessage\"), t(\"upload.successTitle\"), 2000);\n document.getElementById(\"fileArea\").value = \"\"; // Clear input file\n } else if (uService.error) {\n NotificationManager.error(t(\"upload.errorMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (document.getElementById(\"fileArea\").value === \"\") {\n NotificationManager.error(t(\"upload.errorEmptyMessage\"), t(\"upload.errorTitle\"), 3000);\n } else if (uService.errorPermissions) {\n NotificationManager.error(t(\"upload.errorPermissionsMessage\"), t(\"upload.errorTitle\"), 3000);\n }\n }", "title": "" }, { "docid": "38949d74ce987c3997f82cea5168dd0c", "score": "0.6013653", "text": "onUploadFail() {\n $(this.options.progressBar)\n .removeClass(\"progress-bar-animated progress-bar-striped\")\n .addClass(\"bg-danger\");\n\n new Noty({\n timeout: 5000,\n text: $(this.options.fileInput).attr(\"data-upload-fail-message\"),\n type: \"error\"\n }).show();\n\n this.enableAddFileButton();\n }", "title": "" }, { "docid": "83204a824cce2fcd461880b39652846a", "score": "0.60135883", "text": "function clearFileUploadMessage() {\n $('#fileupload-message').text('')\n}", "title": "" }, { "docid": "bafd427178eb80bccd31bd27efb1959e", "score": "0.60133064", "text": "function uploadProgress(evt) {\n if (evt.lengthComputable) {\n var uploaded = Math.round(evt.loaded * 100 / evt.total);\n $(\"#upload_progress\").show();\n $(\"#upload_progress_bar\").attr(\"style\",\"width:\" + uploaded + \"%;\")\n //document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';\n }\n else {\n //document.getElementById('progressNumber').innerHTML = 'unable to compute';\n }\n }", "title": "" } ]
70e93c36a1c54ed36b0700eeb6b1878e
use this for initialization
[ { "docid": "484ef78a3906aed06adec817325b119e", "score": "0.0", "text": "onLoad() {\n if (cc.vv == null) {\n return;\n }\n\n cc.vv.chat = this;\n\n this.btnChat = this.node.getChildByName('btn_chat');\n this.btnChat.active = cc.vv.replayMgr.isReplay() === false;\n\n this.chatRoot = this.node.getChildByName('chat');\n this.chatRoot.active = false;\n\n this.tabQuick = this.chatRoot.getChildByName('quickchatlist');\n this.tabEmoji = this.chatRoot.getChildByName('emojis');\n\n this.iptChat = this.chatRoot\n .getChildByName('iptChat')\n .getComponent(cc.EditBox);\n\n this.quickChatInfo = {};\n this.quickChatInfo.item0 = {\n index: 0,\n content: '快点啊,都等到我花儿都谢谢了!',\n sound: 'fix_msg_1.mp3'\n };\n this.quickChatInfo.item1 = {\n index: 1,\n content: '怎么又断线了,网络怎么这么差啊!',\n sound: 'fix_msg_2.mp3'\n };\n this.quickChatInfo.item2 = {\n index: 2,\n content: '不要走,决战到天亮!',\n sound: 'fix_msg_3.mp3'\n };\n this.quickChatInfo.item3 = {\n index: 3,\n content: '你的牌打得也太好了!',\n sound: 'fix_msg_4.mp3'\n };\n this.quickChatInfo.item4 = {\n index: 4,\n content: '你是妹妹还是哥哥啊?',\n sound: 'fix_msg_5.mp3'\n };\n this.quickChatInfo.item5 = {\n index: 5,\n content: '和你合作真是太愉快了!',\n sound: 'fix_msg_6.mp3'\n };\n this.quickChatInfo.item6 = {\n index: 6,\n content: '大家好,很高兴见到各位!',\n sound: 'fix_msg_7.mp3'\n };\n this.quickChatInfo.item7 = {\n index: 7,\n content: '各位,真是不好意思,我得离开一会儿。',\n sound: 'fix_msg_8.mp3'\n };\n this.quickChatInfo.item8 = {\n index: 8,\n content: '不要吵了,专心玩游戏吧!',\n sound: 'fix_msg_9.mp3'\n };\n }", "title": "" } ]
[ { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.8326856", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.8228847", "text": "function init() {\n \n }", "title": "" }, { "docid": "14e171dec3b81d98fffed636dab7fc9a", "score": "0.80894524", "text": "init() {\n }", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.8057222", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.8055226", "text": "initalizing() {}", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.8009523", "text": "function init() {\n\n }", "title": "" }, { "docid": "2832696e8ee8ac31265dea83a6982adf", "score": "0.7973206", "text": "function init() {\n \n }", "title": "" }, { "docid": "1f10edc3e4f2f2c069d925bcb24fe5d8", "score": "0.79364794", "text": "function init()\n {\n\n }", "title": "" }, { "docid": "b051776c4a331e59a98728903a7dc95a", "score": "0.79248905", "text": "initialize(){}", "title": "" }, { "docid": "fc0ef87020777844289c37cfba197a39", "score": "0.7849326", "text": "function init() {\n\n\n }", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.783962", "text": "init() {\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.783962", "text": "init() {\n\t}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.78327405", "text": "function init() {}", "title": "" }, { "docid": "e35dcaad55ad8e12fd5a61bcd85d99a4", "score": "0.78303665", "text": "init(){}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.78091544", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.78091544", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.78091544", "text": "init() { }", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.7790073", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.7774638", "text": "init () {}", "title": "" }, { "docid": "ecabce8c50aa1ec7af9ddc2e3bf6d2ab", "score": "0.7749536", "text": "function init() {\n\n\t}", "title": "" }, { "docid": "26bbd14ad45ce1fbbac0119ebd6a3961", "score": "0.7688697", "text": "function init() {\n //\n }", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.7673198", "text": "initialize() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.76718813", "text": "init() {}", "title": "" }, { "docid": "24cb8731187123a09eea629536469320", "score": "0.7639044", "text": "_init() {\n this._initConfig();\n }", "title": "" }, { "docid": "d9db5422cb6f88834eca544f45be3291", "score": "0.759192", "text": "constructor() {\n super();\n this.init();\n }", "title": "" }, { "docid": "25c10cf908dc288b9dd238ad7b8ca4b8", "score": "0.75797206", "text": "function init(){}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.754163", "text": "initialise () {}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.754163", "text": "initialise () {}", "title": "" }, { "docid": "cd83ab189c3f7dbe7a2be5bf56646d76", "score": "0.75137836", "text": "function _init() {\n\t\t\t// do the pre-work in here\n\t\t\t\n\t\t}", "title": "" }, { "docid": "571fea20efadbf48175fc5efee96a62e", "score": "0.75050235", "text": "constructor() {\n this.init();\n }", "title": "" }, { "docid": "571fea20efadbf48175fc5efee96a62e", "score": "0.75050235", "text": "constructor() {\n this.init();\n }", "title": "" }, { "docid": "b4c47a8d4e3d20310b2e27593f701d30", "score": "0.7502579", "text": "function _init() {\n\n }", "title": "" }, { "docid": "34756a39f585fb7f0636bc1a8eabf528", "score": "0.7479215", "text": "constructor() {\n this._setup(); // DO NOT REMOVE\n }", "title": "" }, { "docid": "04f4314f66c4d4d46c1ec493b4a82950", "score": "0.74693304", "text": "init() {\n super.init();\n }", "title": "" }, { "docid": "0d9f6f0208fc35b49710a9bdb27c5830", "score": "0.7468336", "text": "init() {\n\n }", "title": "" }, { "docid": "365dd013b57d702131e4abc507d3de83", "score": "0.741566", "text": "async init(){}", "title": "" }, { "docid": "cbd06bf1de98fdca2a359bc67d8602a1", "score": "0.74152195", "text": "constructor() {\n super();\n this.initialize();\n }", "title": "" }, { "docid": "1208c56835f41d5a393af058ad50684f", "score": "0.740487", "text": "constructor() {\n this.initialize();\n }", "title": "" }, { "docid": "3ce43d32acc7ae6545d739091e4dee84", "score": "0.7383626", "text": "constructor()\n\t{\n\t\n\t}", "title": "" }, { "docid": "8deaa1518eab1bfe322091ee4e82ab6c", "score": "0.7368781", "text": "function init() {\n\n }", "title": "" }, { "docid": "4aa0b97e43092636a5fe38cff5704aad", "score": "0.7321634", "text": "initialize() {\n return;\n }", "title": "" }, { "docid": "3c49f292da5582462f6395a5cd676b1b", "score": "0.7313729", "text": "init(){\n }", "title": "" }, { "docid": "fa1554020e1f9c918264cc9b69ff7f10", "score": "0.73022467", "text": "init() {\n\n }", "title": "" }, { "docid": "9d2d0433cd5ec0133b346e75222493ff", "score": "0.72740763", "text": "async init () {}", "title": "" }, { "docid": "26b3f49783708b9cafad1573eaa86dcf", "score": "0.7249946", "text": "_init(){\n\t}", "title": "" }, { "docid": "73b86c83d2c0a6c851a47388d96cc0c0", "score": "0.7249175", "text": "init() {\n this.initialize();\n }", "title": "" }, { "docid": "a3436e33e77600a923e3f8fcca24e03e", "score": "0.7232833", "text": "init() {\n\t\tDebug.success(`${this.name} initialized`);\n\t}", "title": "" }, { "docid": "de58938241555d2fc66b4ec8e0928f02", "score": "0.72236717", "text": "init() {\n }", "title": "" }, { "docid": "6ce53f311dbe87257cef3fab34eca53c", "score": "0.71869284", "text": "init() {\n return;\n }", "title": "" }, { "docid": "042853c4749209bf69e915454ed98968", "score": "0.7170144", "text": "init() {\n // empty\n }", "title": "" }, { "docid": "eaa47ba9e8a0cb7b90a6fa16906f7613", "score": "0.7137206", "text": "function init(){\r\n\t\t\r\n}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.7131763", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.7131763", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.7076266", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "6134a2395e3d0847155ddc1ffe419275", "score": "0.7059435", "text": "function init() {\n}", "title": "" }, { "docid": "6134a2395e3d0847155ddc1ffe419275", "score": "0.7059435", "text": "function init() {\n}", "title": "" }, { "docid": "6134a2395e3d0847155ddc1ffe419275", "score": "0.7059435", "text": "function init() {\n}", "title": "" }, { "docid": "1ba66427dceeddd72c4280781887d1f4", "score": "0.70407397", "text": "constructor() {\n super();\n super.init(this.settings);\n }", "title": "" }, { "docid": "f4dabd581d30a07b44f0b82f4c93fa49", "score": "0.7028201", "text": "init () {\n this._initSelectors()\n this._initElements()\n this._initProperties()\n }", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.7018437", "text": "initialize() {\n\n }", "title": "" }, { "docid": "bec3105e921c1357afd382adb060faaa", "score": "0.7013304", "text": "init() {\n super.init();\n }", "title": "" }, { "docid": "9f82e5cb04bc8519089dd9196f165fed", "score": "0.70071954", "text": "function init() {\r\n\r\n}", "title": "" }, { "docid": "61ca88693656d589c172066000bfffa2", "score": "0.69994175", "text": "initialize() {\n }", "title": "" }, { "docid": "f7940f066c4966bb9de58a8273612c12", "score": "0.6993415", "text": "function init() {\n\n}", "title": "" }, { "docid": "f7940f066c4966bb9de58a8273612c12", "score": "0.6993415", "text": "function init() {\n\n}", "title": "" }, { "docid": "f7940f066c4966bb9de58a8273612c12", "score": "0.6993415", "text": "function init() {\n\n}", "title": "" }, { "docid": "f7940f066c4966bb9de58a8273612c12", "score": "0.6993415", "text": "function init() {\n\n}", "title": "" }, { "docid": "f7940f066c4966bb9de58a8273612c12", "score": "0.6993415", "text": "function init() {\n\n}", "title": "" } ]
9e77d0faa10a2ead316f342aa25994a5
This is responsible for what happens after the page is loaded
[ { "docid": "6570d3b25a5a11636463b5d3d79d8432", "score": "0.0", "text": "function start() {\n //Create 6 enemies\n enemies.create(6);\n //Create 2 gems\n gems.create(2);\n}", "title": "" } ]
[ { "docid": "295fccdb08c39b1b256e1c3ae062f0c0", "score": "0.71425676", "text": "onPageReady () {}", "title": "" }, { "docid": "9d00e3e3771517d1be7f0f14a8dc1684", "score": "0.6996353", "text": "function mainPageLoad() {\n // Page load safety check\n if (mainPageHasLoaded) {\n return;\n }\n mainPageHasLoaded = true;\n\n setupMainPage();\n }", "title": "" }, { "docid": "b0a2150ef7281dc61fcc427008a6bde1", "score": "0.6929659", "text": "function onPageInit() {\n log('Kiu : onPageInit');\n\n updateLists();\n\n fixWidows();\n convertAmpersands();\n\n this.hasWait = false;\n }", "title": "" }, { "docid": "c8c1ceae7af90195b8b3bb26e0fcca2b", "score": "0.6851213", "text": "function onPageLoad(){\n\n // Call all the functions in both temp and system cues\n triggerEvent(events.onPageLoad);\n\n // Since page load is the last event, we call clearTempEvents\n // to clear all temporary events created by a page/route controller\n clearTempEvents();\n\n }", "title": "" }, { "docid": "e2dadfe287edcfe34674d2d2da2692d8", "score": "0.6842879", "text": "function handlePageLoaded() {\n appendStartStopAlertsDiv();\n getUserProfile(ids.DUKE);\n }", "title": "" }, { "docid": "5c2ed079ca83de02dd78af7b5902b088", "score": "0.6815884", "text": "function onLoad() {\n tab.removeListener(safaridriver.message.Alert.TYPE, onAlert);\n if (response.isPending()) {\n goog.log.info(safaridriver.extension.commands.LOG_,\n 'Page load finished; returning');\n tab.removeListener(safaridriver.message.Alert.TYPE, onAlert);\n response.fulfill();\n }\n }", "title": "" }, { "docid": "d57a4a6f065de6de679336f0e1b96784", "score": "0.68149924", "text": "function LoadNewContentDone()\r\n{\r\n pageLoadingFlag = false;\r\n OpenThoughtComplete();\r\n}", "title": "" }, { "docid": "8f244672eceeab626d8fc4cb39150483", "score": "0.68027043", "text": "function bodyLoadCommonAfter()\r\n{\r\n wireUpEventHandlers();\r\n loadSettings();\r\n\r\n // make body visible, now that we're ready to render\r\n document.body.style.visibility = \"visible\";\r\n \r\n // if this is web output, sync the TOC\r\n syncToc(); \r\n}", "title": "" }, { "docid": "0b628e8caf5e2ad4a96d7c25c23bd19f", "score": "0.68008", "text": "function bevPageLoaded() {\n\tcheckLang();\n\tconnectAPI();\n restoreCart();\n}", "title": "" }, { "docid": "5de53caecebd5d16551597e7487663a9", "score": "0.6759703", "text": "function pageLoaded() {\n\n\t\tvar elHeader = document.getElementsByTagName('header')[0];\n\n\t\telHeader.addEventListener(animationEvent, removeFOUT);\n\n\t\tfunction removeFOUT() {\n\n\t\t\tclassie.add(elHTML, 'ready');\n\t\t\telHeader.removeEventListener(animationEvent, removeFOUT);\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "0560560d0e71fa39a95f1d81b07ebed4", "score": "0.6718549", "text": "dashboard_page_loaded() {\n Action.waitForJSReadystate();\n Action.setFrMainFrame(); // Sets frMain frame as the base frame\n \tif (this.athenaTextNotification.isVisible()) this.athenaTextNotificationClose.click();\n \tAction.waitForPageToLoad(this.devInfo, \"Dashboard - Non Clinician Page\");\n }", "title": "" }, { "docid": "c8e5ce6138ee26a69222b053302554ad", "score": "0.6604141", "text": "onPageLoaded() {\n this.dispatchEvent(\n new CustomEvent('loaded', {bubbles: true, composed: true}));\n this.loading = false;\n this.$['next-button'].focus();\n if (!this.hidden && !this.screenShown_) {\n this.browserProxy_.screenShown(RELATED_INFO_SCREEN_ID);\n this.screenShown_ = true;\n }\n }", "title": "" }, { "docid": "455be625bd268c795deafcff8f824161", "score": "0.65850705", "text": "function handlePageLoad() {\n log('handlePageLoad');\n let targetNode = document.querySelector(\"#mainContainer > div.content-wrapper > div.userlist-wrapper.hospital-list-wrapper\" +\n \" > div.users-list-title\");\n\n if (!validPointer(targetNode)) {setTimeout(handlePageLoad, 500); return;}\n let parentNode = targetNode.parentNode;\n $(separator).insertBefore(targetNode);\n $(xedx_filter_div).insertBefore(targetNode);\n\n installHandlers();\n\n filterDisplay();\n }", "title": "" }, { "docid": "edcff3b11b8012477f7e3d6ae3bb06a5", "score": "0.65764713", "text": "function pageReady() {\n initSelectric();\n }", "title": "" }, { "docid": "2d8e3563a4af3efef0775a729a388ec0", "score": "0.6564764", "text": "async function pageLoaded() {\n loadLoginData();\n prepareHandles();\n addEventListeners();\n}", "title": "" }, { "docid": "a27b4217b03f285ef894860b40c66ccb", "score": "0.6549535", "text": "setPageLoading() {\n this.pageReady = false\n }", "title": "" }, { "docid": "a27b4217b03f285ef894860b40c66ccb", "score": "0.6549535", "text": "setPageLoading() {\n this.pageReady = false\n }", "title": "" }, { "docid": "a27b4217b03f285ef894860b40c66ccb", "score": "0.6549535", "text": "setPageLoading() {\n this.pageReady = false\n }", "title": "" }, { "docid": "bb1b65f5e0c5b885e131f4eb417af022", "score": "0.65247124", "text": "function initPage(){\n savedArticleDisplay.empty();\n $.get(\"/api/headlines?saved=true\").then(function(data) {\n if (data && data.length) {\n renderArticles(data);\n } else {\n renderEmpty();\n }\n })\n }", "title": "" }, { "docid": "880cfa3e324d648365253dc97c06d4a3", "score": "0.6518173", "text": "function afterScriptsLoad(){\n\t//after all the js files have been loaded, render the gradebystep display\n\trender(contentUrl, userUrl, getDataUrl, contentBaseUrl, getAnnotationsUrl, postAnnotationsUrl, runId);\n}", "title": "" }, { "docid": "52f60574a23de48d6d0fad4e96d71892", "score": "0.6515016", "text": "function pageReady() {\n initMasks();\n initSelectric();\n initValidations();\n initSlider();\n initPopup();\n }", "title": "" }, { "docid": "b6d97090fb008b2e4525499248d9d45b", "score": "0.6508501", "text": "function onDocumentLoad() {\n log.i('onDocumentLoad');\n\n reset();\n }", "title": "" }, { "docid": "41fa909ccf6ded707377b5c37d4ccdd3", "score": "0.64741516", "text": "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"balloon.html\");\n\t\t\t\t}", "title": "" }, { "docid": "b3f951cf6542dc83d79106341ba2fc2f", "score": "0.6465506", "text": "function HtmlContentPostLoadPorocessing(){\r\n //TODO: throw it off somewhere\r\n $(content_selector+\" textarea\").autogrow();\r\n $(content_selector+\" a\").click(NavigateLink);\r\n // update the page title \r\n document.title = $(content_selector+\" title\").text() + \" | School\";\r\n // this will not acually load page but will \r\n // ensure that page title in history is current\r\n window.location.replace(window.location); \r\n}", "title": "" }, { "docid": "759bea21ae5d8ecf80f4530e69e15997", "score": "0.6437657", "text": "function Done(){\n\tconsole.log(\"page done!\");\n\t\n\t//load google charting package\n\t\n\tgoogle.load(\"visualization\", \"1\", {packages:[\"corechart\"], \"callback\":gVizloaded});\n}", "title": "" }, { "docid": "558c31d4c0c490e324c1af89f243280d", "score": "0.64373434", "text": "function pageReady() {\n legacySupport();\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initLazyLoad();\n initFormElements();\n initFixers();\n }", "title": "" }, { "docid": "3fe7bd0e5925538b904f379127bbaec7", "score": "0.6408039", "text": "function onPageLoading(){\n triggerEvent(events.onPageLoading);\n }", "title": "" }, { "docid": "a22d04b7e6eaa595e55c07aeb3d059ed", "score": "0.64076674", "text": "processPage() {\n this.els = learnCustomElementNames(this.document);\n this.applyBehaviors();\n }", "title": "" }, { "docid": "32071fc7937b4681dd2d4ede9ee4d7ba", "score": "0.63808924", "text": "function pageUnloaded() {\r\n\r\n\r\n}", "title": "" }, { "docid": "316bfb2aba54633d213ff2bc9b7bd4c4", "score": "0.6376135", "text": "initializeAfterDomLoaded_() {\n this.isDomLoaded_ = true;\n this.bindToWebview_();\n }", "title": "" }, { "docid": "e7c33a1ac30e0fbc0655de4fbbc23b99", "score": "0.63609606", "text": "_callbackAfterDataLoad_DOM_AboveMainTableUpdated() {\r\n\t\ttry {\r\n\t\t\tviewSearchProteinPageCommonCrosslinkLooplinkCoverage.createPartsAboveMainTableSearchProteinPageCommon( {} );\r\n\t\t} catch( e ) {\r\n\t\t\treportWebErrorToServer.reportErrorObjectToServer( { errorException : e } );\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tthis._finalDisplayOfAboveTableSection();\r\n\t\t} catch( e ) {\r\n\t\t\treportWebErrorToServer.reportErrorObjectToServer( { errorException : e } );\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tthis.initialize_saveView_dataPages();\r\n\t\t} catch( e ) {\r\n\t\t\treportWebErrorToServer.reportErrorObjectToServer( { errorException : e } );\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "a445b599f8adf12730cddd2797c3b7f5", "score": "0.6347772", "text": "preparePage () {\n this.spinnerTarget.classList.add('loading--active');\n this.footer = document.querySelector('.footer');\n this.footer.style.display = 'none';\n this.footer.setAttribute('aria-hidden', true);\n this.paginatorTarget.style.display = 'none';\n this.paginatorTarget.setAttribute('aria-hidden', true);\n }", "title": "" }, { "docid": "d2a79bf57e1f2530867e9e7e3072e6fd", "score": "0.63426167", "text": "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tonBlurPrincipalAmount();\n\t\tformSubmit();\n\t}", "title": "" }, { "docid": "151f4242ac3e5016cead87742101cc41", "score": "0.63396114", "text": "function htmlLoaded(){\n var el = $('#' + curId);\n\n if(htmlEnhancement){\n htmlEnhancement();\n }\n\n loadHandlers(el[0], curId);\n\n // Run handlers\n loadPageData();\n }", "title": "" }, { "docid": "1d7d7b171c5d230ff142d984d540b0d1", "score": "0.6338583", "text": "function loadPage() {\n initCalendarMonth()\n setupEventListeners()\n filterTasks()\n}", "title": "" }, { "docid": "7bb63d53e9317653934cd533f13d5d46", "score": "0.63274705", "text": "function _pageLoad() {\r\n window.dataLayerObj = window.dataLayerObj || {};\r\n var currentUrl = window.location ? location.href : '',\r\n languageVal = dataLayerObj.language ? dataLayerObj.language : '',\r\n countryVal = dataLayerObj.country ? dataLayerObj.country : ''; \r\n \r\n var loginStatus = { \r\n 'loginStatus': window.loginStatus ? 'Logged In' : 'Not Logged In',\r\n },\r\n attributeVals = {\r\n 'country': countryVal.toUpperCase(),\r\n 'language': languageVal.toUpperCase(),\r\n 'org': 'MYPROJECT' \r\n },\r\n articleVals = {\r\n 'author': dataLayerObj.author ? dataLayerObj.author : '',\r\n 'title': dataLayerObj.title ? dataLayerObj.title : '',\r\n 'dop': dataLayerObj.dop ? dataLayerObj.dop : '',\r\n };\r\n _userInfo(loginStatus);\r\n _attributes(attributeVals);\r\n _article(articleVals); \r\n _urlRelatedValues(languageVal, currentUrl, countryVal);\r\n _videoName();\r\n }", "title": "" }, { "docid": "ab5c79f5da88a4d6e7df04c0fef3a570", "score": "0.6311368", "text": "function readyNow() {\n console.log('document loaded');\n addClickHandlers();\n updateHistory();\n}", "title": "" }, { "docid": "208d4d94f8efb0455b603f2babb1b5eb", "score": "0.63077074", "text": "function afterChange() {\n\n\t\t\t// Make current page inactive\n\t\t\tcurrentContentPage.classList.remove('active');\n\t\t\thelper.setData(currentContentPage, 'currentcontent', false);\n\n\t\t\t// Set the title\n\t\t\telems.dashboardContentTitle.innerHTML = helper.getData(newPage, 'title');\n\n\t\t\tdocument.title = pageTitleBase + \" - \" + helper.getData(newPage, 'title');\n\t\t\tcallback();\n\t\t}", "title": "" }, { "docid": "0d10f96fb0cf23ab085e9dc8fab75c64", "score": "0.6296409", "text": "function pageReady(){\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initTeleport();\n\n revealFooter();\n _window.on('resize', throttle(revealFooter, 100));\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "50948d0fde8e95aba80d5d0d81d1a09b", "score": "0.6287421", "text": "function pageLoaded () {\n\t\n\t//console log checks to make sure that page loaded works.\n\tconsole.log (\"Got to page loaded.\");\n\t\n\t//Load the google visualization library with the callback googleLoaded. This will tell the browser to load the function\n\t//googleLoaded. This is using the google visualization script to work. But now I have to make sure that I have\n\t//my function googleLoaded working.\n\tgoogle.load(\"visualization\", \"1\", {packages:[\"geochart\"], callback: \"googleLoaded\"});\n\t//now I have to define my function googleLoaded next.....\t\n\t\n}", "title": "" }, { "docid": "cd8fc81a432bb4e7f087f9555bb51844", "score": "0.6287359", "text": "function pageLoad() {\n basicSetup();\n scrollMagicSetup();\n textAnimateSetup();\n menuBurgerSetup();\n contactFormSetup();\n initMap();\n}", "title": "" }, { "docid": "96fa508bc63ec14af6652508e15b60bd", "score": "0.6285266", "text": "function HtmlContentPostLoadPorocessing(){\r\n $(\"#main textarea\").autogrow();\r\n $(\"#main a\").click(NavigateLink);\r\n // update the page title \r\n document.title = $(\"#main title\").text() + \" | ToBeDone\";\r\n // this will not acually load page but will \r\n // ensure that page title in history is current\r\n window.location.replace(window.location); \r\n}", "title": "" }, { "docid": "68d6675a1021d44789d80aa02dc4bcac", "score": "0.6277688", "text": "function setUpPage() {\r\n createEventListeners();\r\n removeSelectDefaults();\r\n validate();\r\n }", "title": "" }, { "docid": "970d7b4188582e2421a1685a809c0b3f", "score": "0.62658584", "text": "function setupPage() {\n\tclearJsInterval();\n}", "title": "" }, { "docid": "e7e98f100144afa87ff8a340888df9c6", "score": "0.62608606", "text": "function pageReady(){\n legacySupport();\n updateHeaderActiveClass();\n initHeaderScroll();\n // benefitsTabFix();\n defaultQuery();\n loadCards();\n\n initSelectric();\n initPopups();\n initSliders();\n initScrollMonitor();\n initMasks();\n initLazyLoad();\n initPerfectScrollbar();\n initRangeSlider();\n initAutocompleate();\n initSticky();\n initTeleport();\n initValidations();\n initMaps();\n\n hookPrint();\n parseQueryToVal();\n\n positionScrollTop();\n _window.on('resize', debounce(positionScrollTop, 250));\n _window.on('scroll', throttle(showScrollTop, 50));\n\n controlTabsMobileClass();\n _window.on('resize', debounce(controlTabsMobileClass, 250));\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "title": "" }, { "docid": "5f87a42822fc625b89fdcc610305cb15", "score": "0.6256983", "text": "function qodeOnWindowLoad() {\r\n qodeInitElementorContentMenu();\r\n }", "title": "" }, { "docid": "672e4c78d8395b284bfbc278a7d03317", "score": "0.62558866", "text": "function onPageLoaded()\n{\n $(\"#search\").submit(onSubmit);\n $(\"#objectForm\").submit(onSave);\n schedule = new Array();\n\n // First time the user sees the page, load the items on the schedule\n if (window.location.href.indexOf('firsttime') == -1)\n loadElements();\n}", "title": "" }, { "docid": "946b1adc14f0620d22dddd8937c07c14", "score": "0.6252172", "text": "function initializePage() {\n\n}", "title": "" }, { "docid": "1131b879dc3ee343cbf42f23a45abffc", "score": "0.6243712", "text": "function initPage() {\n\tgetActeurs();\n}", "title": "" }, { "docid": "c3727965bd7294c831685e7a107e7db7", "score": "0.6243544", "text": "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (\n document.addEventListener ||\n window.event.type === \"load\" ||\n document.readyState === \"complete\"\n ) {\n detach();\n jQuery.ready();\n }\n }", "title": "" }, { "docid": "1cbc353ebc8fb576181007b3b46110db", "score": "0.6233246", "text": "function _completeCallback() {\n scope.observer.publish(scope.eventManager.eventList.afterSwitchToPage, page);\n }", "title": "" }, { "docid": "892b64fad2376f872406a60e7d21431d", "score": "0.6227197", "text": "function loadPage() {\n getUserData();\n createLogoutUrl();\n fetchBlobstoreUrlAndShowProfileForm();\n //tfidf();\n}", "title": "" }, { "docid": "c5ab549de0fd301befc1b187b4fa84e3", "score": "0.6226613", "text": "onload() {\n // do something to the UI when this fires to signify that it's done\n console.log('done loading');\n }", "title": "" }, { "docid": "5d542e8283d6c625524d4647af06de0e", "score": "0.62131524", "text": "function pageLoaded() {\n if (!isPageLoaded) {\n isPageLoaded = true;\n if (scrollIntervalId) {\n clearInterval(scrollIntervalId);\n }\n\n callReady();\n }\n }", "title": "" }, { "docid": "5d542e8283d6c625524d4647af06de0e", "score": "0.62131524", "text": "function pageLoaded() {\n if (!isPageLoaded) {\n isPageLoaded = true;\n if (scrollIntervalId) {\n clearInterval(scrollIntervalId);\n }\n\n callReady();\n }\n }", "title": "" }, { "docid": "5d542e8283d6c625524d4647af06de0e", "score": "0.62131524", "text": "function pageLoaded() {\n if (!isPageLoaded) {\n isPageLoaded = true;\n if (scrollIntervalId) {\n clearInterval(scrollIntervalId);\n }\n\n callReady();\n }\n }", "title": "" }, { "docid": "fb3e1b252f7e939693907386aaaaf7b2", "score": "0.6202937", "text": "function qodeOnWindowLoad() {\n qodeInitElementorWorkflow();\n }", "title": "" }, { "docid": "33ff8bca76df0a16ada31bfc27c3af12", "score": "0.62026983", "text": "function onLoad() {\r\n }", "title": "" }, { "docid": "c3b0b88b413e73602faf4e6eae36e9df", "score": "0.6198287", "text": "function onLoad() {}", "title": "" }, { "docid": "274a30a795e85683b0ca193961126c32", "score": "0.61954135", "text": "function setUpPage() {\n removeSelectDefault();\n createEventListeners();\n generatePlaceholder();\n}", "title": "" }, { "docid": "b5b8d21e3e90b9ab677456c0a4676fb5", "score": "0.61846155", "text": "loaded() {\n if (!this.shouldDestroy) {\n this.instance && this.instance.onPageLoaded && this.instance.onPageLoaded();\n }\n }", "title": "" }, { "docid": "f12f74004f82c01d2a172c563258f6a0", "score": "0.6165819", "text": "function pageLoad() {\n //only show start page. Hide other content.\n highscoreScreen.setAttribute(\"class\", \"hide\");\n quizScreen.setAttribute(\"class\", \"hide\");\n scoreDisplay.setAttribute(\"class\", \"hide\");\n randomFactCard.setAttribute(\"class\", \"hide\");\n}", "title": "" }, { "docid": "9c9a43093e4e5d29b36777c9a9955e59", "score": "0.6164216", "text": "function completed() {\n\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener ||\n window.event.type === \"load\" ||\n document.readyState === \"complete\" ) {\n\n detach();\n jQuery.ready();\n }\n }", "title": "" }, { "docid": "e479fd93050c84f90a5122722557e20c", "score": "0.61555505", "text": "async onPageLoad() {\n\n }", "title": "" }, { "docid": "f6507e05becbc2a8bd69d5a9634dcf21", "score": "0.6143975", "text": "function pageLoaded() {\n\t if (!isPageLoaded) {\n\t isPageLoaded = true;\n\t if (scrollIntervalId) {\n\t clearInterval(scrollIntervalId);\n\t }\n\n\t callReady();\n\t }\n\t }", "title": "" }, { "docid": "c00a6eb878ca6ff8fb76eda6bd42b4a2", "score": "0.6143539", "text": "function onDocumentReady() {\n\tloadGuestbookEntries();\n\tconnectReloadButton();\n\tconnectEntryButton();\n}", "title": "" }, { "docid": "c00a6eb878ca6ff8fb76eda6bd42b4a2", "score": "0.6143539", "text": "function onDocumentReady() {\n\tloadGuestbookEntries();\n\tconnectReloadButton();\n\tconnectEntryButton();\n}", "title": "" }, { "docid": "3f0c4d962bcc33bb444f6546a634ba79", "score": "0.6137769", "text": "function pageReady(){\n legacySupport();\n initHeaderScroll();\n\n initPopups();\n initSliders();\n // initScrollMonitor();\n initMasks();\n // initLazyLoad();\n\n // development helper\n _window.on('resize', debounce(setBreakpoint, 200))\n\n }", "title": "" }, { "docid": "b66d3b4b2665650797d93bb0639569a2", "score": "0.61357635", "text": "function pageLoaded() {\r\n setTimeout(refreshTimer, 1000);\r\n getState();\r\n mapimage.src = mapPath;\r\n generateDynamicHTML();\r\n}", "title": "" }, { "docid": "cb5a77deeee907b297b08f5ec021baa3", "score": "0.61223555", "text": "onLoad() {\n if (this._load) {\n this._load.raise();\n }\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6115518", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "abba681931845c108f7c7d27295dad33", "score": "0.6115518", "text": "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "title": "" }, { "docid": "a6ac8760d2734a84315a045b6df5a45e", "score": "0.61077106", "text": "function setUpPage() {\r\n\t\tcreateEventListeners();\r\n\t\tpopulateFigures(currentImage);\r\n\t}", "title": "" }, { "docid": "b35feb135f7da20b7b3aaddec649c101", "score": "0.6104291", "text": "function edgtOnWindowLoad() {\n\n }", "title": "" }, { "docid": "4a7cb805ddfb716faa642770d7473602", "score": "0.610394", "text": "function setUpPage() {\n createEventListeners();\n populateFigures();\n }", "title": "" }, { "docid": "0d4f9c06521f749990fe22b29cb2f595", "score": "0.6103678", "text": "function mkdfOnDocumentReady() {\n mkdfHeaderBehaviour();\n mkdfSideArea();\n mkdfSideAreaScroll();\n mkdfFullscreenMenu();\n mkdfInitMobileNavigation();\n mkdfMobileHeaderBehavior();\n mkdfSetDropDownMenuPosition();\n mkdfDropDownMenu();\n mkdfSearch();\n mkdfVerticalMenu().init();\n }", "title": "" }, { "docid": "3523a5b445de1129ed0884130d485f60", "score": "0.60933334", "text": "function initPage() {\n\trandomizeImageAndSound();\n\tgenerateGarbledWord();\n\tpopulateCharOptions();\n\tvar newWordBtn = document.getElementById('new-word-btn');\n\tif (newWordBtn) {\n\t\taddEventHandler(newWordBtn, 'click', function() {\n\t\t\tlocation.reload();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "686ed57a5869ac0e75a411ce16de0ae8", "score": "0.6092263", "text": "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftNodeSelectLi\").addClass(\"active\");\r\n\t\tresetPage();\r\n\t\t$(\"#messageAlert\").hide();\r\n\t}", "title": "" }, { "docid": "e621637c3a08eb68df5d78285a841fae", "score": "0.60897946", "text": "function runAtDocumentLoadProgressComplete () {\n // run something everytime new content loads\n}", "title": "" }, { "docid": "c602deb39f6940cf758bf4a902bbf053", "score": "0.60890424", "text": "function loadPage() {\n addUserInfo();\n}", "title": "" }, { "docid": "c602deb39f6940cf758bf4a902bbf053", "score": "0.60890424", "text": "function loadPage() {\n addUserInfo();\n}", "title": "" }, { "docid": "ea0e5d9222cea31ddffb77afd3d5aa8a", "score": "0.608814", "text": "function AssetDepreciationPageInit() {\n\twindow.onbeforeunload = '';\n}", "title": "" }, { "docid": "54aff6f6c1cb65cb75c915e547de3f7d", "score": "0.6082473", "text": "function initializePage() {\n\t// add any functionality and listeners you want here\n\t\n}", "title": "" }, { "docid": "07e77435d4f0f17defdbab77affa1e96", "score": "0.6079848", "text": "function completed() {\n\n\t\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\t\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\t\t\tdetach();\n\t\t\t\tjQuery.ready();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "bc3eb37cf1b2b39b8f6b273847c4e69e", "score": "0.6077004", "text": "function setUpPage() {\n createEventListeners();\n removeSelectDefaults();\n}", "title": "" }, { "docid": "64b656f12f4151304c804de4ebe249d8", "score": "0.6069942", "text": "function completed() {\r\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\r\n if (document.addEventListener || event.type === \"load\" || document.readyState === \"complete\") {\r\n detach();\r\n jQuery.ready();\r\n }\r\n }", "title": "" }, { "docid": "4de1ebab46fede91b1f3c2b2af27756d", "score": "0.60684943", "text": "function handlePageLoad() {\n\n // set default log/trace settings.\n wl_app._logEnabled = true;\n wl_app._traceEnabled = false;\n\n checkDocumentReady(function () {\n // Invoke wlAsyncInit, if it is defined.\n var appInit = window.wlAsyncInit;\n if (appInit && (typeof (appInit) === TYPE_FUNCTION)) {\n appInit.call();\n }\n });\n}", "title": "" }, { "docid": "b7b00c057c9bb5aa834bb629441cec76", "score": "0.6065056", "text": "function init() {\n loadComplete();\n}", "title": "" }, { "docid": "7d6456d4187ed81653ed0ffd7b5ebce2", "score": "0.6064739", "text": "function initializePage() {\n console.log(\"Page ready\");\n initCamera();\n initGestures();\n initRSVPForm();\n }", "title": "" }, { "docid": "1da0194e9e280ce19f367784363574a0", "score": "0.60614884", "text": "function onPageStable() {\n AxeBuilder(browser.driver)\n .configure(this.config || {})\n .analyze(results => handleResults(this, results));\n}", "title": "" }, { "docid": "caa3c53eec5b54a2683e1d3ae1637e20", "score": "0.6057567", "text": "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n getProjectTasks($(\"#txtId\").val());\n }", "title": "" }, { "docid": "c0e8e1f5ddfdbc8a79fae29ea317091c", "score": "0.6056898", "text": "function injectFinalCallbacks() {\r\n if ((redirectOptions.display === undefined || redirectOptions.display === \"none\") && /Out$/.test(effectName)) {\r\n $.each(elements.nodeType ? [elements] : elements, function (i, element) {\r\n Velocity.CSS.setPropertyValue(element, \"display\", \"none\");\r\n });\r\n }\r\n\r\n redirectOptions.complete && redirectOptions.complete.call(elements, elements);\r\n\r\n if (promiseData) {\r\n promiseData.resolver(elements || element);\r\n }\r\n }", "title": "" }, { "docid": "25815c98eb319257f3f22ca5ebd10597", "score": "0.6053447", "text": "function onHtmlLoaded(){\n \n //if nobody is logged stop script execution\n if(loggedUser.isLogged === false){\n return;\n }\n \n //atatch click event to cancel button on any window\n $(\".cancel-button\").on('click',closeWindow);\n \n //add top menu\n addTopMenu();\n \n //add command buttons\n addCommandButtons();\n \n //get user data from the server\n user.getUserData(user.loggedUserId).done(function(response){\n \n //check server response\n if(response.success === true){\n \n user = new User(response[0]);\n fillUserData(); //display user data\n \n }else{\n popUp(\"error\",response.message); //show error message\n }\n }); //get user data completed\n \n}//END onHtmlLoaded function", "title": "" }, { "docid": "1bfd31a2abf5ae5afb8df7f61f4dabcb", "score": "0.60523766", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "c63c34e159689289d647c634f39f6f23", "score": "0.6050575", "text": "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }", "title": "" }, { "docid": "543e986679bdeaae544d3038c7e21851", "score": "0.60420823", "text": "function pageReady(){\n legacySupport();\n // updateHeaderActiveClass();\n // initHeaderScroll();\n\n initPopups();\n initSliders();\n // initScrollMonitor();\n initMasks();\n initSelectric();\n initValidations();\n\n // development helper\n // _window.on('resize', function() {\n // \tdebounce(setBreakpoint, 200);\n // });\n\n // AVAILABLE in _components folder\n // copy paste in main.js and initialize here\n // initPerfectScrollbar();\n // initLazyLoad();\n // initTeleport();\n // parseSvg();\n // revealFooter();\n // _window.on('resize', throttle(revealFooter, 100));\n }", "title": "" }, { "docid": "3d49e98cebc870cce0e4b339ef7076ac", "score": "0.6038401", "text": "init() {\n window.Squarespace.AFTER_BODY_LOADED = false;\n window.Squarespace.afterBodyLoad();\n }", "title": "" }, { "docid": "b62a2ef1ec02f82e49799d0c021b44a6", "score": "0.60374844", "text": "onPageLoadedHandler() {\n d3.select('#'+this.DOM_ID).classed('hidden', true);\n }", "title": "" }, { "docid": "77f5e5f2cb016e6e6a28347511c8944c", "score": "0.603435", "text": "onLoad() {\n this.fire('ready');\n this.off('load', this.onLoad, this);\n }", "title": "" }, { "docid": "90900426d568e287e85806babcbceafa", "score": "0.60334986", "text": "function init_page() {\n get_Data();\n}", "title": "" }, { "docid": "a8fb3c43b5ebd68222cc708318561775", "score": "0.6033053", "text": "function injectFinalCallbacks () {\n if ((redirectOptions.display === undefined || redirectOptions.display === \"none\") && /Out$/.test(effectName)) {\n $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {\n Velocity.CSS.setPropertyValue(element, \"display\", \"none\");\n });\n }\n\n redirectOptions.complete && redirectOptions.complete.call(elements, elements);\n\n if (promiseData) {\n promiseData.resolver(elements || element);\n }\n }", "title": "" } ]
b914012c657b149255843c3553b91bf6
Visit a parse tree produced by CobolParserevaluateValue.
[ { "docid": "5e67300d5174a63f7c4b60b0dd8980d4", "score": "0.66287893", "text": "visitEvaluateValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" } ]
[ { "docid": "fb3110194d527d65a30a754e2daa55f1", "score": "0.5995239", "text": "function findValueNode( ast ) {\n if( ast.value == 'value' ) {\n return ast;\n } else {\n for( let i=0; i<ast.children.length; i++ ) {\n const res = findValueNode( ast.children[i] );\n if( res ) {\n return res;\n }\n }\n }\n }", "title": "" }, { "docid": "559d7a4f942cb1b77d81b7e914224730", "score": "0.59123063", "text": "visitElementValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "bc69d2b581cb565370134aa8c4c7a32c", "score": "0.57660025", "text": "function evaluateAst(ast) {\nswitch(ast.type){\n case 'num':\n return ast.value;\n}\n}", "title": "" }, { "docid": "6574103f9974fdcbf4e91f32bcbc413f", "score": "0.5763389", "text": "function visitAll(node) {\n if (!node) {\n\n // Nothing to do\n return;\n } else if ((\"Literal\" === node.type) && (\"string\" === typeof(node.value))) {\n\n // Log string literal\n console.log(node.value.trim());\n } else if (\"object\" === typeof(node)) {\n\n // For each key/value pair...\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (Array.isArray(value)) {\n\n // Visit all array elements\n value.forEach(visitAll);\n } else {\n\n // Visit value\n visitAll(value);\n }\n });\n }\n}", "title": "" }, { "docid": "bed875a27e8eb251b2ec8e456822199e", "score": "0.56845665", "text": "visitValueOfClause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "be0bd4ab9047fbb1f668925ac6bb6947", "score": "0.5632019", "text": "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "title": "" }, { "docid": "be0bd4ab9047fbb1f668925ac6bb6947", "score": "0.5632019", "text": "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "title": "" }, { "docid": "be0bd4ab9047fbb1f668925ac6bb6947", "score": "0.5632019", "text": "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "title": "" }, { "docid": "be0bd4ab9047fbb1f668925ac6bb6947", "score": "0.5632019", "text": "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "title": "" }, { "docid": "be0bd4ab9047fbb1f668925ac6bb6947", "score": "0.5632019", "text": "function parse() {\n var self = this;\n var value = String(self.file);\n var start = {line: 1, column: 1, offset: 0};\n var content = xtend(start);\n var node;\n\n /* Clean non-unix newlines: `\\r\\n` and `\\r` are all\n * changed to `\\n`. This should not affect positional\n * information. */\n value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);\n\n if (value.charCodeAt(0) === 0xFEFF) {\n value = value.slice(1);\n\n content.column++;\n content.offset++;\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {\n start: start,\n end: self.eof || xtend(start)\n }\n };\n\n if (!self.options.position) {\n removePosition(node, true);\n }\n\n return node;\n}", "title": "" }, { "docid": "f5d532b7321f395a5df10ebfca154395", "score": "0.5497399", "text": "function evaluate(node, mt, callback, hook) {\n\tif (checkEvalueted(node)) {\n\t\t// console.log(count++);\n\t\treturn node.value;\n\t}\n\tfunction evalNodelist(node) {\n\t\tvar nodes = node.nodes;\n\t\tvar values = nodes.map(function(node) {\n\t\t\treturn evaluate(node, mt, callback);\n\t\t});\n\t\tvar value = new ValueSequence(node.src, values);\n\t\tif (checkEvalueted(nodes)) {\n\t\t\tnode.value = value;\n\t\t}\n\t\treturn value;\n\t}\n\tif (node instanceof NodeTopLevel) {\n\t\tvar value = evalNodelist(node);\n\t\treturn value;\n\t} else if (node instanceof NodeSkippedEOL || node instanceof NodeLineComment || node instanceof NodeBlockComment) {\n\t\tvar value = new Value(node.src, undefined);\n\t\tnode.value = value;\n\t\treturn value;\n\t} else if (node instanceof NodeString || node instanceof NodeVerbatim || node instanceof NodeCharRef || node instanceof NodeEscaped) {\n\t\tvar str = node.str;\n\t\tvar value = new Value(node.src, str);\n\t\tnode.value = value;\n\t\treturn value;\n\t} else if (node instanceof NodeMacro) {\n\t\treturn evalMacroCall(node, mt, callback);\n\t} else if (node instanceof NodeArg) {\n\t\tvar nodes = node.nodes;\n\t\tvar macros = mt.saveMacros();\n\t\tif (typeof hook === \"function\") {\n\t\t\thook(mt, node);\n\t\t}\n\t\tvar value = evalNodelist(node);\n\t\tmt.restoreMacros(macros);\n\t\treturn value;\n\t}\n}", "title": "" }, { "docid": "bb1aa8196a19d431d4f342014ef7e42b", "score": "0.54968584", "text": "function ParseNode(type, value, mode) {\n\t this.type = type;\n\t this.value = value;\n\t this.mode = mode;\n\t}", "title": "" }, { "docid": "b72a75fb868c3a65eee9b3bfe3785b09", "score": "0.549613", "text": "parseValue() {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'));\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString);\n }\n\n if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString);\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS$1) {\n return this.goto(this.parseNumberSign);\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf);\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan);\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime);\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean);\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue);\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue);\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'));\n }\n }", "title": "" }, { "docid": "f4f27b82ac3c1600381fba85c473e4dd", "score": "0.53919315", "text": "visitCallByValuePhrase(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b155f2706aacb99bc6fcce62a6adbae9", "score": "0.53386474", "text": "visitEvaluateStatement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "6c9f4b9876273bc4cd8543217d228651", "score": "0.5323016", "text": "parseExpressionStatement (node) {}", "title": "" }, { "docid": "b94abc1a87340570cc509398ed3d4bd2", "score": "0.5302568", "text": "visitObjectval(ctx) {\n return this.visit(ctx.objectParamValue());\n\n }", "title": "" }, { "docid": "b393e70a426c6861f842f08784ea4b05", "score": "0.5255121", "text": "function Node(type, value) {\n\t// Void -> Bool\n\t// check if node can have children i.e. expand\n\tvar _canExpand = function() {\n\t\treturn _node.type == NodeTypes.Program\n\t\t\t|| _node.type == NodeTypes.Operator\n\t\t\t|| _node.type == NodeTypes.Expression\n\t\t\t|| _node.type == NodeTypes.Condition;\n\t};\n\t// Void -> Bool\n\t// check if node's value can change i.e.\n\tvar _isValueChangeable = function() {\n\t\treturn isNodeValueChangeable(_node.type);\n\t\t// return _node === undefined\n\t\t// \t|| _node.type == NodeTypes.Variable\n\t\t// \t|| _node.type == NodeTypes.Number;\n\t};\n\n\t// Int -> Void\n\t// Expand node using given rule\n\tvar _expand = function(ruleIndex) {\n\t\tif (_canExpand()) {\n\t\t\t_node.children = \n\t\t\t\tgetDerivations(_node.type)[ruleIndex];\n\t\t\t// for chaining, may be removed if unnecessary\n\t\t\treturn _node;\n\t\t} else {\n\t\t\tthrow(\"Node isn't expandable\");\n\t\t}\n\t};\n\n\t// String -> Void\n\t// Check if node's value corresponds to node's type\n\t// throws exception otherwise\n\tvar _valueValid = function(value) {\n\t\tvar maxLength = 10;\n\n\t\tif (value.length > maxLength) {\n\t\t\tthrow (\"Value is too long\");\n\t\t}\n\n\t\t// valid number\n\t\tif (_node.type == NodeTypes.Number){\n\t\t\tif (!value.match(\"^-?[0-9]+$\")) \n\t\t\t\tthrow (\"Incorrect value for Number type\");\n\t\t\telse\n\t\t\t\tvalue = String(Number(value)); // erase leading zeros\n\t\t}\n\t\t// valid variable\n\t\tif (_node.type == NodeTypes.Variable) {\n\t\t\tif (value.match(\"^[_a-zA-Z][_a-zA-Z0-9]*$\")) {\n\t\t\t\tvar reservedWords = [\"begin\", \"end\", \"if\", \"then\", \"skip\", \"do\", \"else\", \"or\", \"while\"];\n\t\t\t\tif (reservedWords.indexOf(value) > -1) {\n\t\t\t\t\tthrow (\"Name of varriable can't match reserved word\");\n\t\t\t\t}\t\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow(\"Name of variable is incorrect\");\n\t\t} \n\n\n\t}\n\n\t// String -> Void\n\t// Set node's value. Throws exception if value is invalid\n\tvar _setValue = function(newval) {\n\t\tif (!_isValueChangeable()) {\n\t\t\tthrow(\"Value can't change for this node\");\n\t\t}\n\n\t\t_valueValid(newval);\n\t\t_value = newval;\n\t}\n\t// Void -> String\n\t// Get current value\n\tvar _getValue = function() {\n\t\treturn _value;\n\t}\n\t\n\tvar _node = {\n\t\texpand : _expand,\n\t\tcanExpand : _canExpand,\n\t\tisValueChangeable : _isValueChangeable,\n\t\tsetValue: _setValue,\n\t\tvalue: _getValue,\n\t\ttype: type,\n\t\tchildren: []\n\t}\n\n\n\t// private variables\n\tvar _value;\n\tif(value === undefined) \n\t\t_value = type;\n\telse \n\tif(type == NodeTypes.Terminal)\n\t\t_value = value;\n\telse\n\t\t_setValue(value);\n\t\t\n\n\treturn _node;\n}", "title": "" }, { "docid": "9db80e4d839dc5ce841066a47a78ca09", "score": "0.5235466", "text": "enterValue_token(ctx) {\n\t}", "title": "" }, { "docid": "46d1139295e126fd81460636587d0ed4", "score": "0.5233448", "text": "visitProcedureDivisionByValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b814afb5e8c7c4d617740fd82953348b", "score": "0.52280605", "text": "function parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}", "title": "" }, { "docid": "004405ca58d81668698dd0fdc3912b7e", "score": "0.5227529", "text": "visitValuePair(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "873de8f2661ed45f95b1ad358a6ec99c", "score": "0.5190853", "text": "visitCallByValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "82e1586fbb30c486cc3f2f8204a84cfa", "score": "0.51856756", "text": "parseObjectExpression (node) {}", "title": "" }, { "docid": "e0bea7663cc915929f118e991c8a1d68", "score": "0.51779777", "text": "function visitor(node) {\n return visitorWorker(node, /*valueIsDiscarded*/ false);\n }", "title": "" }, { "docid": "1c138107cc48f70c27126ec333a9a079", "score": "0.51653373", "text": "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(locationType);\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isLeafType\"])(type)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"]) {\n context.reportError(error);\n } else {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "title": "" }, { "docid": "1c138107cc48f70c27126ec333a9a079", "score": "0.51653373", "text": "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(locationType);\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isLeafType\"])(type)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"]) {\n context.reportError(error);\n } else {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "title": "" }, { "docid": "5a5c5221f0a434dcaa968bcad9aa9213", "score": "0.5158947", "text": "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = (0, _definition.getNamedType)(locationType);\n\n if (!(0, _definition.isLeafType)(type)) {\n var typeStr = (0, _inspect.default)(locationType);\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = (0, _inspect.default)(locationType);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = (0, _inspect.default)(locationType);\n\n if (error instanceof _GraphQLError.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat((0, _printer.print)(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "title": "" }, { "docid": "867d7628d82d666a16b4c34ed57954cb", "score": "0.5148183", "text": "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n const locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n const type = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(locationType);\n\n if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isLeafType)(type)) {\n const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType);\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError(\n `Expected value of type \"${typeStr}\", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n try {\n const parseResult = type.parseLiteral(\n node,\n undefined,\n /* variables */\n );\n\n if (parseResult === undefined) {\n const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType);\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError(\n `Expected value of type \"${typeStr}\", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n } catch (error) {\n const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType);\n\n if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError(\n `Expected value of type \"${typeStr}\", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}; ` +\n error.message,\n {\n nodes: node,\n originalError: error,\n },\n ),\n );\n }\n }\n}", "title": "" }, { "docid": "0d9ac11c5144c9dd3e93fea0872ff092", "score": "0.51450694", "text": "*values(node) {\n if (node) {\n yield* this.values(node.left);\n yield node.value;\n yield* this.values(node.right);\n }\n }", "title": "" }, { "docid": "b94c0ae483c3e54b3f1496a50fc0a2dd", "score": "0.51411515", "text": "function visit(statement, index, program) {\n switch (statement.type) {\n case 'VariableDeclaration':\n statement.declarations.forEach(function (declaration, idx) {\n visit(declaration.init, idx, program);\n });\n break;\n case 'BinaryExpression':\n case 'LogicalExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.right,\n 'property': {\n 'type': 'Identifier',\n 'name': funcNames[statement.operator]\n }\n };\n visit(statement.left, index, program);\n visit(statement.right, index, program);\n statement['arguments'] = [statement.left];\n } else {\n visit(statement.left, index, program);\n visit(statement.right, index, program);\n }\n break;\n case 'ExpressionStatement':\n visit(statement.expression, index, program);\n break;\n case 'CallExpression':\n statement['arguments'].forEach(function (argument, idx) {\n visit(argument, idx, program);\n });\n visit(statement.callee, index, program);\n break;\n case 'AssignmentExpression':\n if (statement.operator && funcNames[statement.operator]) {\n var rightOld = statement.right;\n statement.right = {\n 'type': 'BinaryExpression',\n 'operator': statement.operator.replace(/=/, '').trim(),\n 'left': statement.left,\n 'right': rightOld\n };\n statement.operator = '=';\n visit(statement.left, index, program);\n visit(statement.right, index, program);\n } else {\n visit(statement.right, index, program);\n }\n break;\n case 'UnaryExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.argument,\n 'property': {\n 'type': 'Identifier',\n 'name': (statement.operator === '+' || statement.operator === '-') ? funcNames['u' + statement.operator] : funcNames[statement.operator]\n }\n };\n visit(statement.argument, index, program);\n statement['arguments'] = [];\n } else {\n visit(statement.argument, index, program);\n }\n break;\n case 'UpdateExpression':\n if (statement.operator && funcNames[statement.operator]) {\n statement.type = 'CallExpression';\n statement.callee = {\n 'type': 'MemberExpression',\n 'computed': false,\n 'object': statement.argument,\n 'property': {\n 'type': 'Identifier',\n 'name': funcNames[statement.operator]\n }\n };\n visit(statement.argument, index, program);\n statement['arguments'] = [];\n }\n break;\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n visit(statement.body, index, program);\n break;\n case 'BlockStatement':\n statement.body.forEach(function (statement) {\n visit(statement, index, program);\n });\n break;\n case 'ReturnStatement':\n visit(statement.argument, index, program);\n break;\n case 'MemberExpression':\n visit(statement.object, index, program);\n break;\n case 'SwitchStatement':\n statement.cases.forEach(function(_case, idx){\n visit(_case, idx, program);\n });\n break;\n case 'SwitchCase':\n statement.consequent.forEach(function(con, idx){\n visit(con, idx, program);\n });\n break;\n //We don't ned to transform following nodes! Phew!\n case 'Literal':\n case 'Identifier':\n break;\n }\n}", "title": "" }, { "docid": "429effd259e417d49aa125a4f3e25a79", "score": "0.5139278", "text": "visitEvaluateThrough(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "932b0b593ffbf708591614a58477bb61", "score": "0.5127444", "text": "visitCicsDfhValueLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f5e427955b274e79344e56fc970542ef", "score": "0.51208836", "text": "function visit(text,visitor,options){var _scanner=createScanner(text,false);function toNoArgVisit(visitFunction){return visitFunction?function(){return visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength());}:function(){return true;};}function toOneArgVisit(visitFunction){return visitFunction?function(arg){return visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength());}:function(){return true;};}var onObjectBegin=toNoArgVisit(visitor.onObjectBegin),onObjectProperty=toOneArgVisit(visitor.onObjectProperty),onObjectEnd=toNoArgVisit(visitor.onObjectEnd),onArrayBegin=toNoArgVisit(visitor.onArrayBegin),onArrayEnd=toNoArgVisit(visitor.onArrayEnd),onLiteralValue=toOneArgVisit(visitor.onLiteralValue),onSeparator=toOneArgVisit(visitor.onSeparator),onError=toOneArgVisit(visitor.onError);var disallowComments=options&&options.disallowComments;var allowTrailingComma=options&&options.allowTrailingComma;function scanNext(){while(true){var token=_scanner.scan();switch(token){case SyntaxKind.LineCommentTrivia:case SyntaxKind.BlockCommentTrivia:if(disallowComments){handleError(ParseErrorCode.InvalidSymbol);}break;case SyntaxKind.Unknown:handleError(ParseErrorCode.InvalidSymbol);break;case SyntaxKind.Trivia:case SyntaxKind.LineBreakTrivia:break;default:return token;}}}function handleError(error,skipUntilAfter,skipUntil){if(skipUntilAfter===void 0){skipUntilAfter=[];}if(skipUntil===void 0){skipUntil=[];}onError(error);if(skipUntilAfter.length+skipUntil.length>0){var token=_scanner.getToken();while(token!==SyntaxKind.EOF){if(skipUntilAfter.indexOf(token)!==-1){scanNext();break;}else if(skipUntil.indexOf(token)!==-1){break;}token=scanNext();}}}function parseString(isValue){var value=_scanner.getTokenValue();if(isValue){onLiteralValue(value);}else{onObjectProperty(value);}scanNext();return true;}function parseLiteral(){switch(_scanner.getToken()){case SyntaxKind.NumericLiteral:var value=0;try{value=JSON.parse(_scanner.getTokenValue());if(typeof value!=='number'){handleError(ParseErrorCode.InvalidNumberFormat);value=0;}}catch(e){handleError(ParseErrorCode.InvalidNumberFormat);}onLiteralValue(value);break;case SyntaxKind.NullKeyword:onLiteralValue(null);break;case SyntaxKind.TrueKeyword:onLiteralValue(true);break;case SyntaxKind.FalseKeyword:onLiteralValue(false);break;default:return false;}scanNext();return true;}function parseProperty(){if(_scanner.getToken()!==SyntaxKind.StringLiteral){handleError(ParseErrorCode.PropertyNameExpected,[],[SyntaxKind.CloseBraceToken,SyntaxKind.CommaToken]);return false;}parseString(false);if(_scanner.getToken()===SyntaxKind.ColonToken){onSeparator(':');scanNext();// consume colon\nif(!parseValue()){handleError(ParseErrorCode.ValueExpected,[],[SyntaxKind.CloseBraceToken,SyntaxKind.CommaToken]);}}else{handleError(ParseErrorCode.ColonExpected,[],[SyntaxKind.CloseBraceToken,SyntaxKind.CommaToken]);}return true;}function parseObject(){onObjectBegin();scanNext();// consume open brace\nvar needsComma=false;while(_scanner.getToken()!==SyntaxKind.CloseBraceToken&&_scanner.getToken()!==SyntaxKind.EOF){if(_scanner.getToken()===SyntaxKind.CommaToken){if(!needsComma){handleError(ParseErrorCode.ValueExpected,[],[]);}onSeparator(',');scanNext();// consume comma\nif(_scanner.getToken()===SyntaxKind.CloseBraceToken&&allowTrailingComma){break;}}else if(needsComma){handleError(ParseErrorCode.CommaExpected,[],[]);}if(!parseProperty()){handleError(ParseErrorCode.ValueExpected,[],[SyntaxKind.CloseBraceToken,SyntaxKind.CommaToken]);}needsComma=true;}onObjectEnd();if(_scanner.getToken()!==SyntaxKind.CloseBraceToken){handleError(ParseErrorCode.CloseBraceExpected,[SyntaxKind.CloseBraceToken],[]);}else{scanNext();// consume close brace\n}return true;}function parseArray(){onArrayBegin();scanNext();// consume open bracket\nvar needsComma=false;while(_scanner.getToken()!==SyntaxKind.CloseBracketToken&&_scanner.getToken()!==SyntaxKind.EOF){if(_scanner.getToken()===SyntaxKind.CommaToken){if(!needsComma){handleError(ParseErrorCode.ValueExpected,[],[]);}onSeparator(',');scanNext();// consume comma\n}else if(needsComma){handleError(ParseErrorCode.CommaExpected,[],[]);}if(!parseValue()){handleError(ParseErrorCode.ValueExpected,[],[SyntaxKind.CloseBracketToken,SyntaxKind.CommaToken]);}needsComma=true;}onArrayEnd();if(_scanner.getToken()!==SyntaxKind.CloseBracketToken){handleError(ParseErrorCode.CloseBracketExpected,[SyntaxKind.CloseBracketToken],[]);}else{scanNext();// consume close bracket\n}return true;}function parseValue(){switch(_scanner.getToken()){case SyntaxKind.OpenBracketToken:return parseArray();case SyntaxKind.OpenBraceToken:return parseObject();case SyntaxKind.StringLiteral:return parseString(true);default:return parseLiteral();}}scanNext();if(_scanner.getToken()===SyntaxKind.EOF){return true;}if(!parseValue()){handleError(ParseErrorCode.ValueExpected,[],[]);return false;}if(_scanner.getToken()!==SyntaxKind.EOF){handleError(ParseErrorCode.EndOfFileExpected,[],[]);}return true;}", "title": "" }, { "docid": "e6b5732b37b910aca5b3004be6014b7b", "score": "0.5096396", "text": "visitDataValueClause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "0568b14c897b784cf04825c6f03a6460", "score": "0.5088394", "text": "function parseValueLiteral(parser, isConst) {\n\t\t var token = parser.token;\n\t\t switch (token.kind) {\n\t\t case _lexer.TokenKind.BRACKET_L:\n\t\t return parseList(parser, isConst);\n\t\t case _lexer.TokenKind.BRACE_L:\n\t\t return parseObject(parser, isConst);\n\t\t case _lexer.TokenKind.INT:\n\t\t advance(parser);\n\t\t return {\n\t\t kind: _kinds.INT,\n\t\t value: token.value,\n\t\t loc: loc(parser, token.start)\n\t\t };\n\t\t case _lexer.TokenKind.FLOAT:\n\t\t advance(parser);\n\t\t return {\n\t\t kind: _kinds.FLOAT,\n\t\t value: token.value,\n\t\t loc: loc(parser, token.start)\n\t\t };\n\t\t case _lexer.TokenKind.STRING:\n\t\t advance(parser);\n\t\t return {\n\t\t kind: _kinds.STRING,\n\t\t value: token.value,\n\t\t loc: loc(parser, token.start)\n\t\t };\n\t\t case _lexer.TokenKind.NAME:\n\t\t if (token.value === 'true' || token.value === 'false') {\n\t\t advance(parser);\n\t\t return {\n\t\t kind: _kinds.BOOLEAN,\n\t\t value: token.value === 'true',\n\t\t loc: loc(parser, token.start)\n\t\t };\n\t\t } else if (token.value !== 'null') {\n\t\t advance(parser);\n\t\t return {\n\t\t kind: _kinds.ENUM,\n\t\t value: token.value,\n\t\t loc: loc(parser, token.start)\n\t\t };\n\t\t }\n\t\t break;\n\t\t case _lexer.TokenKind.DOLLAR:\n\t\t if (!isConst) {\n\t\t return parseVariable(parser);\n\t\t }\n\t\t break;\n\t\t }\n\t\t throw unexpected(parser);\n\t\t}", "title": "" }, { "docid": "bc38b92d26890304a8c1b18d3f933480", "score": "0.50738186", "text": "function treeGetValue(tree) {\n return tree.node.value;\n}", "title": "" }, { "docid": "bc38b92d26890304a8c1b18d3f933480", "score": "0.50738186", "text": "function treeGetValue(tree) {\n return tree.node.value;\n}", "title": "" }, { "docid": "8af0f1d4b49ccb0324b7ab31864e8045", "score": "0.50667703", "text": "visitProcedureDivisionByValuePhrase(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "7fb34840c2e0bc841d62c856a8447345", "score": "0.5066585", "text": "parseCallExpression (node) {}", "title": "" }, { "docid": "b1b6f7b7b435d0a7583cd1ebed22d35b", "score": "0.50617576", "text": "visitEvaluateSelect(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "4ab36a1531d1f9bf7526835714992f40", "score": "0.5046489", "text": "function process_node(ast_node, /*state,*/ parent, root, opts)\n{\n// opts = process_node.opts; //kludge; get from caller\n if (!opts.codegen) return; //false; //not interested\n// opts.opcodes || (opts.opcodes = []);\n if (!ast_node.uid) error(`unknown ast node: ${JSON.stringify(objclone(ast_node, 1))}`); //, show_object_placeholder)}`);\n// if (!ast_node) return;\n switch (ast_node.type)\n {\n case \"VariableDeclarator\": //{type, id, init{}, kind-inherited}\n// traverse(ast_node.init, symtab);\n// parent ${(parent || {}).type || `ary-${(parent || []).length}`}`.blue_lt, JSON.stringify(objclone(ast_node, 1)).blue_lt);\n opts.opcodes.push(`\\tvar ${ast_node.id.name}; //kind ${ast_node.kind}, uid ${ast_node.uid}, parent ${(parent || {}).uid || \"NONE\"}, scope ${ast_node.which_scope}`.blue_lt);\n return;\n//don't care about these ones:\n case \"CallExpression\": //{type, callee{}, arguments[]}\n// (ast_node.arguments || []).forEach((arg, inx, all) => { traverse(arg, symtab); });\n// break;\n case \"BinaryExpression\": //{type, operator, left{}, right{}}\n case \"LogicalExpression\": //{type, operator, left{}, right{}}\n case \"AssignmentExpression\": //{type, operator, left{}, right{}}\n// traverse(ast_node.left, symtab);\n// traverse(ast_node.right, symtab);\n// break;\n case \"BlockStatement\": //{type, body[]}\n case \"ClassBody\": //{type, body[]\n// (ast_node.body || []).forEach((stmt, inx, all) => { traverse(stmt, symtab); });\n// break;\n case \"ExpressionStatement\": //{type, expression{}}\n// traverse(ast_node.expression, symtab);\n// break;\n case \"Identifier\": //{type, name}\n// symtab[nameof(ast_node)] = symtab[nameof(ast_node)] || null; //create fwd ref if not defined yet\n// break;\n case \"FunctionExpression\": //{type, id{}, params[], defaults[], body{}, generator, expression}\n case \"FunctionDeclaration\": //{type, id{}, params[], defaults[], body{}, generator, expression}\n case \"ArrowFunctionExpression\": //{type, id{}, params[], defaults[], body{}, generator, expression}\n// const locals = Object.assign({}, symtab); //shallow copy to new stack frame\n// (ast_node.params || []).forEach((param, inx, all) => { traverse(param, locals); }); //treat as defined vars\n// (ast_node.defaults || []).forEach((def, inx, all) => { traverse(def, locals); });\n// traverse(ast_node.body, locals);\n// break;\n case \"IfStatement\": //{type, test{}, consequent{}, alternate{}}\n case \"ConditionalExpression\": //{type, test{}, consequent{}, alternate{}}\n// traverse(ast_node.test, symtab);\n// traverse(ast_node.consequent, symtab);\n// traverse(ast_node.alternate, symtab);\n// break;\n case \"ForStatement\": //{type, init{}, test{}, update{}, body{}}\n// traverse(ast_node.init, symtab);\n// traverse(ast_node.test, symtab);\n// traverse(ast_node.update, symtab);\n// traverse(ast_node.body, symtab);\n// break;\n case \"ForInStatement\": //{type, left{}, right{}, body{}}\n// break;\n case \"WhileStatement\": //{type, test{}, body{}}\n// traverse(ast_node.test, symtab);\n// traverse(ast_node.body, symtab);\n// break;\n case \"UnaryExpression\": //{type, operator, argument{}}\n case \"UpdateExpression\": //{type, operator, argument{}, prefix}\n// traverse(ast_node.argument, symtab);\n// break;\n case \"YieldExpression\": //{type, argument{}, delegate}\n// traverse(ast_node.argument, symtab);\n// break;\n//////////////\n case \"MethodDefinition\": //{type, key{}, computed, value{}}\n// break;\n case \"ClassDeclaration\": //{type, id{}, superClass{}, body{}}\n// break;\n case \"VariableDeclaration\": //{type, declarations[], kind}\n// (ast_node.declarations || []).forEach((dcl, inx, all) => { traverse(dcl, symtab); });\n// break;\n case \"ObjectExpression\": //{type, properties[]}\n// break;\n case \"Property\": //{type, key{}, computed, value{}, kind, method, shorthand}\n// break;\n case \"ArrayExpression\": //{type, elements[]}\n// (ast_node.elements || []).forEach((expr, inx, all) => { traverse(expr, symtab); });\n// break;\n case \"ThrowStatement\": //{type, argument{}}\n case \"ReturnStatement\": //{type, argument{}}\n case \"ThisExpression\": //{type}\n case \"Super\": //{type}\n// traverse(ast_node.argument, symtab);\n// break;\n case \"NewExpression\": //{type, callee{}, arguments[]}\n// (ast_node.arguments || []).forEach((arg, inx, all) => { traverse(arg, symtab); });\n// traverse(ast_node.callee, symtab);\n// break;\n case \"SwitchStatement\": //{type, discriminant{}, cases[]}\n// traverse(ast_node.discriminant, symtab);\n// (ast_node.cases || []).forEach((casestmt, inx, all) => { traverse(casestmt, symtab); });\n// break;\n case \"SwitchCase\": //{type, test{}, consequent[]}\n// traverse(ast_node.test, symtab);\n// (ast_node.consequent || []).forEach((conseq, inx, all) => { traverse(conseq, symtab); });\n// break;\n case \"TemplateLiteral\": //{type, quasis[], expressions[]}\n// (ast_node.quasis || []).forEach((quasi, inx, all) => { traverse(quasi, symtab); });\n// (ast_node.expressions || []).forEach((expr, inx, all) => { traverse(expr, symtab); });\n// break;\n case \"TemplateElement\": //{type, value{}, tail}\n// traverse(ast_node.value, symtab);\n// break;\n case \"MemberExpression\": //{type, computed, object{}, property{}}\n// traverse(ast_node.object, symtab);\n// traverse(ast_node.property, symtab);\n// break;\n case \"BreakStatement\": //{type, label}\n case \"EmptyStatement\": //{type}\n case \"Literal\" : //{type, value, raw}\n// break;\n// debug(\"PIC8-ignore\", JSON.stringify({type: ast_node.type, uid: ast_node.uid}).blue_lt);\n break; //true; //quietly ignore ast node, but continue processing\n default: //for debug\n /*throw*/ error(`PIC8-DSL node evt: unhandled node type '${`${ast_node.type}`.cyan_lt}', parent type '${(parent || {}).type}', node ${JSON.stringify(objclone(ast_node, 2), null, 2)}`.red_lt);\n return;\n }\n debug(`PIC8: ignore type ${ast_node.type}, node ${ast_node.uid}, parent ${ast_node.parent_uid}`.blue_lt);\n// if (opts.debug)\n// {\n//no const node = AstNode(ast_node);\n// Object.keys(node).forEach((key) =>\n// {\n// if (typeof node[key] == \"object\") //node[key] = \"[object]\";\n// for (var k in node[key])\n//no; don't change node data if (typeof node[key][k] == \"object\") node[key][k] = `[${k.toUpperCase()}]`;\n// else if()\n// }); //reduce clutter\n// function show_object_placeholder(key, value) //this[key] === value\n// {\n// return (typeof value != \"object\")? value:\n// (key == \"id\")? `[${value.name || \"ID\"}]`:\n// key? `[${key.toUpperCase()}]`:\n// value;\n// }\n// debug(`PIC8 node: parent ${(parent || {}).type || `ary-${(parent || []).length}`}`.blue_lt, JSON.stringify(objclone(ast_node, 1)).blue_lt);\n// }\n// return ast_node;\n// return true; //continue processing\n}", "title": "" }, { "docid": "9a566bf0b353f49d7e673a9682c36ead", "score": "0.5016675", "text": "parse(value) {\n let ast = lib(value);\n let result = [];\n let param = [];\n for (let node of ast.nodes) {\n param.push(node);\n if (node.type === 'div' && node.value === ',') {\n result.push(param);\n param = [];\n }\n }\n result.push(param);\n return result.filter(i => i.length > 0)\n }", "title": "" }, { "docid": "31e1f4d869ba1cde4f8e271f6b845a78", "score": "0.5013617", "text": "function valueFromNode(node, onVariable) {\n if (onVariable === void 0) { onVariable = defaultValueFromVariable; }\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(function (v) { return valueFromNode(v, onVariable); });\n case 'ObjectValue': {\n var value = {};\n for (var _i = 0, _a = node.fields; _i < _a.length; _i++) {\n var field = _a[_i];\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}", "title": "" }, { "docid": "832b30ef76eef7831db7c2174fceae0b", "score": "0.5012543", "text": "visit(node) {\n switch (node.type) {\n case \"Alternative\":\n this.visitAlternative(node);\n break;\n case \"Assertion\":\n this.visitAssertion(node);\n break;\n case \"Backreference\":\n this.visitBackreference(node);\n break;\n case \"CapturingGroup\":\n this.visitCapturingGroup(node);\n break;\n case \"Character\":\n this.visitCharacter(node);\n break;\n case \"CharacterClass\":\n this.visitCharacterClass(node);\n break;\n case \"CharacterClassRange\":\n this.visitCharacterClassRange(node);\n break;\n case \"CharacterSet\":\n this.visitCharacterSet(node);\n break;\n case \"Flags\":\n this.visitFlags(node);\n break;\n case \"Group\":\n this.visitGroup(node);\n break;\n case \"Pattern\":\n this.visitPattern(node);\n break;\n case \"Quantifier\":\n this.visitQuantifier(node);\n break;\n case \"RegExpLiteral\":\n this.visitRegExpLiteral(node);\n break;\n default:\n throw new Error(`Unknown type: ${node.type}`);\n }\n }", "title": "" }, { "docid": "5376f13e97db9d3e56bbeea0f3e2429f", "score": "0.5004759", "text": "enterWindow_value_expression(ctx) {\n\t}", "title": "" }, { "docid": "68c206fef115628f127ec522636bf680", "score": "0.4942101", "text": "visitNumericLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "2c6055b24fd6a397335e2160ab126829", "score": "0.49365258", "text": "visitLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "2c6055b24fd6a397335e2160ab126829", "score": "0.49365258", "text": "visitLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c9f27b34581291b581a1881c0d4dad70", "score": "0.49330947", "text": "visitEvaluateCondition(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "19da96d74c2dce9e26af763d38b8d65d", "score": "0.4930331", "text": "function processNode(key, value) {\r\n var result = \"\";\r\n if (key === '#list') { //It's a \"no-key\" list\r\n if (!(value instanceof Array))\r\n self.error (\"Malformed JSON node with key \" + key + \" and value\" + JSON.stringify(value));\r\n for (var i=0; i< value.length; i++) {\r\n for (var innerKey in value[i]) {\r\n result += processNode (innerKey, value[i][innerKey]);\r\n }\r\n } \r\n } else { //It's a \"regular\" node\r\n result += '<' + key;\r\n if (typeof value === \"string\") { //\"regular\" value\r\n result += '>' + value;\r\n } else if (value instanceof Array) { //it's a \"key\" list\r\n result += '>\\n';\r\n for (var i=0; i< value.length; i++) {\r\n for (var innerKey in value[i]) {\r\n result += processNode (innerKey, value[i][innerKey]);\r\n }\r\n } \r\n } else if (value instanceof Object) { //the value is an object\r\n var innerKeys = Object.keys(value);\r\n var attributes = [];\r\n var textValue = null;\r\n var other = [];\r\n for (var i=0; i<innerKeys.length; i++) {\r\n if (innerKeys[i].startsWith('@'))\r\n attributes.push(innerKeys[i].substringFrom('@'));\r\n else if (innerKeys[i] === '#value')\r\n textValue = value[innerKeys[i]];\r\n else\r\n other.push(innerKeys[i]);\r\n }\r\n //check the attributes first\r\n for (var i=0; i<attributes.length; i++) {\r\n result += ' ' + attributes[i] + '=\"' + value[\"@\"+attributes[i]] + '\"';\r\n }\r\n //close the tag\r\n result += '>\\n';\r\n //check the text value\r\n if (textValue)\r\n result += textValue;\r\n //check the rest of nodes\r\n for (var i=0; i<other.length; i++) {\r\n result += processNode(other[i], value[other[i]]);\r\n }\r\n }\r\n //close the tag\r\n result += '</' + key + '>\\n';\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "df00431349f4cba311a467dca1124245", "score": "0.492742", "text": "function parse() {\n \"use strict\";\n \n var $root = $(this);\n var $tokens = $root.children().clone();\n $root.children().remove();\n \n parseBlock($root);\n \n function parseBlock($this){\n $this = ast($this, 'body');\n while (true) {\n var $tok = peekToken();\n if ($tok.length === 0) {\n return; // EOF\n } else if(testKeyword($tok, 'for')) {\n parseFor($this);\n } else if(testKeyword($tok, 'if')) {\n parseIf($this);\n } else if(testKeyword($tok, 'end', 'elseif', 'else')) {\n return; // end of block\n } else if($tok.hasClass('ident')) {\n parseFunctionCall($this);\n } else{\n err($this, \"ERROR: Unknown token - \", $tok);\n }\n }\n }\n \n function ast($this, className) {\n var $stmt = $(\"<div>\").addClass('ast').addClass(className);\n $this.append($stmt);\n return $stmt;\n }\n \n function peekToken() {\n return $tokens.filter('.token').first();\n }\n \n function testKeyword() {\n var rg = $.makeArray(arguments);\n var $this = rg.shift();\n if(!$this.hasClass('keyword')) {\n return false;\n }\n return rg.indexOf($this.text()) !== -1;\n }\n \n function err($this, text, $tok) {\n $this.append($('<span>').addClass('parseError').text(text).append($tok));\n throw [text, $tok];\n }\n \n function parseFunctionCall($this) {\n $this = ast($this, 'function');\n parseLhs($this); // TODO: arbitrary expressions [[ HERE ]](...)\n expect($this, 'op', '(');\n parseExpr($this); // TODO: commas in function calls\n expect($this, 'op', ')');\n }\n \n function parseLhs($this){\n $this = ast($this, 'lhs');\n var $tok = nextToken($this);\n if(!$tok.hasClass('ident')) {\n err($this, 'Expected identifier, found ', $tok);\n }\n $this.append($tok);\n }\n \n function nextToken($this) {\n while (true) {\n var $el = $tokens.shift();\n if ($el.length === 0) {\n err($this, 'Unexpected end of file!');\n } else if (!$el.hasClass('token')) {\n $this.append($el);\n } else {\n return $el;\n }\n }\n }\n \n function expect($this, expectedClass, expectedText) {\n var $tok = nextToken($this);\n if(!$tok.hasClass(expectedClass)) {\n err($this, 'Unexpected token - expected ' + expectedClass + ' ' + expectedText + ', found ', $tok);\n } else if ($tok.text() !== expectedText) {\n err($this, 'Unexpected value - expected ' + expectedText + ', found ', $tok);\n } else {\n $this.append($tok);\n }\n }\n \n function parseExpr($this) {\n // BUG: this parses with right-associative precedence\n $this = ast($this, 'expr');\n var $tok = nextToken($this);\n if ($tok.hasClass('op') && $tok.text() == '(') {\n parseParen($this, $tok);\n } else {\n $this.append(ast($this, 'expr').append($tok));\n }\n tryParseOp($this);\n }\n \n function parseParen($this, $tok) {\n $this = ast($this, 'expr');\n $this.append($tok);\n parseExpr($this);\n expect($this, 'op', ')');\n }\n \n function tryParseOp($this) {\n var $tok = peekToken();\n if ($tok === undefined) {\n return;\n } else if(!$tok.hasClass('op')) {\n // not an op\n return;\n } else if(['(', ')', ','].indexOf($tok.text()) !== -1){\n // not an op; '(' should have been parseParen\n return;\n }\n \n var $prev = $this.children().last();\n $prev.remove();\n var $next = ast($this, 'expr');\n $next.append($prev);\n $next.append(nextToken($next));\n parseExpr($next);\n }\n \n function parseFor($this) {\n $this = ast($this, 'for');\n expect($this, 'keyword', 'for');\n parseLhs($this);\n expect($this, 'op', '=');\n parseExpr($this);\n expect($this, 'op', ',');\n parseExpr($this);\n expect($this, 'op', ',');\n parseExpr($this);\n expect($this, 'keyword', 'do');\n parseBlock($this);\n expect($this, 'keyword', 'end');\n }\n \n function parseIf($this) {\n $this = ast($this, 'if');\n expect($this, 'keyword', 'if');\n parseExpr($this);\n expect($this, 'keyword', 'then');\n parseBlock($this);\n \n while(testKeyword(peekToken(), 'elseif')) {\n parseElseIf($this);\n }\n if(testKeyword(peekToken(), 'else')) {\n var $else = ast($this, 'else');\n expect($else, 'keyword', 'else');\n parseBlock($else);\n }\n expect($this, 'keyword', 'end');\n }\n \n function parseElseIf($this) {\n $this = ast($this, 'elseif');\n expect($this, 'keyword', 'elseif');\n parseExpr($this);\n expect($this, 'keyword', 'then');\n parseBlock($this);\n }\n}", "title": "" }, { "docid": "2245e722e359cf990e4336b8551c802b", "score": "0.4918241", "text": "visitParExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "df29139f465af8abf35069d4b37bc7ed", "score": "0.49179852", "text": "visitSetToValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3aa6568ff2d6f0863565d511ed2af66b", "score": "0.4912289", "text": "visitCompilationUnit(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3aa6568ff2d6f0863565d511ed2af66b", "score": "0.4912289", "text": "visitCompilationUnit(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "dffef09be38cb8a00af4fc244cd48150", "score": "0.49055505", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "fc472a601630a4cc6b1b3b585b04a24c", "score": "0.48969176", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "badbbe88436a1c667c54b9f0f052204a", "score": "0.48943123", "text": "visitExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "87f06448a8fd91bbd6c80cf6d5ecd142", "score": "0.4892439", "text": "parseObjectExpressionProperty (node) {}", "title": "" }, { "docid": "1283ed1983321a1bc22cbcacbb66e76e", "score": "0.48751566", "text": "visitElementValuePairs(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b04eee13104502b5b0e1f87c35047e90", "score": "0.4869144", "text": "function eval_tree(node) {\n switch (node.type) {\n case 'ConstantNode':\n\treturn dimval(node.value);\n case 'SymbolNode':\n\tif (node.name in units)\n\t return units[node.name];\n\telse\n\t throw \"Unknown unit: \"+node,name;\n case 'ParenthesisNode':\n\treturn eval_tree(node.content);\n case 'OperatorNode':\n\tswitch (node.fn) {\n\tcase 'add':\n\t return dim_add(eval_tree(node.args[0]), eval_tree(node.args[1]));\n\tcase 'subtract':\n\t return dim_subtract(eval_tree(node.args[0]), eval_tree(node.args[1]));\n\tcase 'multiply':\n\t return dim_multiply(eval_tree(node.args[0]), eval_tree(node.args[1]));\n\tcase 'divide':\n\t return dim_divide(eval_tree(node.args[0]), eval_tree(node.args[1]));\n\tcase 'pow':\n\t return dim_pow(eval_tree(node.args[0]), eval_tree(node.args[1]));\n\tcase 'unaryPlus':\n\t return eval_tree(node.args[0]);\n\tcase 'unaryMinus':\n\t return dim_unaryMinus(eval_tree(node.args[0]));\n\tdefault:\n\t throw \"operator \"+node.fn+\" not implemented\";\n\t}\n case 'FunctionNode':\n\tif (node.name==\"sqrt\") {\n\t let arg = eval_tree(node.args[0]);\n\t return dimval(math.sqrt(arg.v), math.divide(arg.u, 2));\n\t} else {\n\t for (let i=0; i<node.args.length; i++) {\n\t\tlet arg = eval_tree(node.args[i]);\n\t\tif (math.unequal(arg.u, 0))\n\t\t throw \"Dimensional function arg\";\n\t\tnode.args[i] = new math.expression.node.ConstantNode(arg.v);\n\t }\n\t return dimval(node.eval(), 0);\n\t}\n default:\n\tthrow \"eval: \"+node.type+\" not implemented\";\n }\n}", "title": "" }, { "docid": "7c826cdc207246aebfb31e548a838e69", "score": "0.48653358", "text": "function traverse(val){_traverse(val,seenObjects);seenObjects.clear();}", "title": "" }, { "docid": "cd947948bbd14c86f8c72537496f3781", "score": "0.48613554", "text": "function parseValueLiteral(parser, isConst) {\n\t var token = parser.token;\n\t switch (token.kind) {\n\t case _lexer.TokenKind.BRACKET_L:\n\t return parseList(parser, isConst);\n\t case _lexer.TokenKind.BRACE_L:\n\t return parseObject(parser, isConst);\n\t case _lexer.TokenKind.INT:\n\t advance(parser);\n\t return {\n\t kind: _kinds.INT,\n\t value: token.value,\n\t loc: loc(parser, token.start)\n\t };\n\t case _lexer.TokenKind.FLOAT:\n\t advance(parser);\n\t return {\n\t kind: _kinds.FLOAT,\n\t value: token.value,\n\t loc: loc(parser, token.start)\n\t };\n\t case _lexer.TokenKind.STRING:\n\t advance(parser);\n\t return {\n\t kind: _kinds.STRING,\n\t value: token.value,\n\t loc: loc(parser, token.start)\n\t };\n\t case _lexer.TokenKind.NAME:\n\t if (token.value === 'true' || token.value === 'false') {\n\t advance(parser);\n\t return {\n\t kind: _kinds.BOOLEAN,\n\t value: token.value === 'true',\n\t loc: loc(parser, token.start)\n\t };\n\t } else if (token.value !== 'null') {\n\t advance(parser);\n\t return {\n\t kind: _kinds.ENUM,\n\t value: token.value,\n\t loc: loc(parser, token.start)\n\t };\n\t }\n\t break;\n\t case _lexer.TokenKind.DOLLAR:\n\t if (!isConst) {\n\t return parseVariable(parser);\n\t }\n\t break;\n\t }\n\t throw unexpected(parser);\n\t}", "title": "" }, { "docid": "e3e6b870d62e06e681cd4ee5e83e6f74", "score": "0.48550367", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_3__.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "3f740a93760b7b6e44c4ea0d8b72ddda", "score": "0.48544937", "text": "visitSetByValue(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "831e058469f756d200cdb7365f7cef46", "score": "0.4844552", "text": "function numeric_evaluate(node, sub)\n{\n if(sub === undefined) sub = {};\n var ret = 0;\n\n if(!node)\n return 0;\n\n switch( node.type)\n {\n case NODE_OP:\n switch(node.value)\n {\n case OP_ADD:\n var sum = 0;\n for(var i = 0; i < node.children.length; i++)\n {\n sum += numeric_evaluate(node.children[i], sub)*10; //javascript accuracy is not good\n }\n ret = sum/10; //javascript accuracy is not good\n break;\n case OP_SUB:\n ret = numeric_evaluate(node.children[0], sub) - numeric_evaluate(node.children[1], sub);\n break;\n case OP_DIV:\n ret = numeric_evaluate(node.children[0], sub) / numeric_evaluate(node.children[1], sub);\n break;\n case OP_MUL:\n var prod = 1;\n for(var i = 0; i < node.children.length; i++)\n {\n prod *= numeric_evaluate(node.children[i], sub);\n }\n ret = prod;\n break;\n case OP_NEG:\n ret = -numeric_evaluate(node.children[0], sub);\n break;\n case OP_POW:\n if(kind(node.children[0]) == NODE_SYM && node.children[0].value == SYM_EULER)\n {\n ret = Math.exp(numeric_evaluate(node.children[1], sub));\n }\n else\n {\n ret = Math.pow(numeric_evaluate(node.children[0], sub), numeric_evaluate(node.children[1], sub));\n }\n break;\n }\n break;\n\n case NODE_FUNC:\n switch(node.value)\n {\n case FUNC_SIN:\n ret = Math.sin(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_COS:\n ret = Math.cos(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_TAN:\n ret = Math.tan(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_SINH:\n ret = Math.sinh(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_COSH:\n ret = Math.cosh(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_TANH:\n ret = Math.tanh(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ASIN:\n ret = Math.asin(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ACOS:\n ret = Math.acos(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ATAN:\n ret = Math.atan(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ASINH:\n ret = Math.asin(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ACOSH:\n ret = Math.acosh(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ATANH:\n ret = Math.atanh(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_CSC:\n ret = 1 / Math.sin(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_SEC:\n ret = 1 / Math.cos(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_COT:\n ret = 1 / Math.tan(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_CSCH:\n ret = 1 / Math.sin(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_SECH:\n ret = 1 / Math.cos(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_COTH:\n ret = 1 / Math.tan(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ACSC:\n ret = Math.asin(1 / numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ASEC:\n ret = Math.acos(1 / numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_ACOT:\n ret = Math.atan(1 / numeric_evaluate(node.children[0], sub)) ;\n break;\n case FUNC_ACSCH:\n var func_numeric_evaluated = numeric_evaluate(node.children[0], sub);\n ret = Math.log(1 / func_numeric_evaluated + Maths.sqrt(1 / Math.pow(func_numeric_evaluated, 2) + 1));\n break;\n case FUNC_ASECH:\n var func_numeric_evaluated = numeric_evaluate(node.children[0], sub);\n ret = Math.log(Math.sqrt(1 / Math.pow(func_numeric_evaluated, 2) - 1) + 1 / func_numeric_evaluated);\n break;\n case FUNC_ACOTH:\n var func_numeric_evaluated = numeric_evaluate(node.children[0], sub);\n ret = (Math.log((func_numeric_evaluated+ 1) / func_numeric_evaluated) + Math.log(func_numeric_evaluated/(func_numeric_evaluated-1))) / 2;\n break;\n case FUNC_SQRT:\n ret = Math.sqrt(numeric_evaluate(node.children[0], sub));\n break;\n // case FUNC_EXP:\n // ret = Math.exp(numeric_evaluate(node.children[0], sub));\n // break;\n case FUNC_NLOG:\n ret = Math.log(numeric_evaluate(node.children[0], sub));\n break;\n case FUNC_BLOG:\n ret = Math.log(numeric_evaluate(node.children[1], sub)) / Math.log(numeric_evaluate(node.children[0], sub));\n break;\n }\n break;\n\n case NODE_SYM:\n if(node.value == SYM_EULER)\n {\n ret = Math.exp(1);\n }\n else if(node.value == SYM_PI)\n {\n ret = Math.PI;\n }\n else\n {\n ret = sub[node.value];\n }\n break;\n\n case NODE_INT:\n ret = Number(node.value);\n break;\n }\n\n return ret;\n}", "title": "" }, { "docid": "1ef626ec659815f8ded98440b8a66075", "score": "0.4843589", "text": "parseExp4() {\n const currentTokenRef = this.getCurrentToken()\n const node = new TreeNode()\n\n /* ID Exp4Linha */\n if (this.match(TOKEN.ID)) {\n this.parseExp4Linha()\n\n /* Semantic phase check */\n const tokenFromSymbolTable = this.getSymbolTable().get(currentTokenRef.getValue())\n if (!tokenFromSymbolTable) {\n this.throwSemanticError(`Variable ${currentTokenRef.getValue()} not declared`)\n node.setType(TYPE.error)\n }\n\n else\n node.setType(tokenFromSymbolTable.getType())\n\n return node\n }\n\n /* ( Expressao ) */\n else if (this.match(TOKEN.OPN_RND_BRACKET)) {\n const nodeExpressao = this.parseExpressao()\n\n if (!this.match(TOKEN.CLS_RND_BRACKET))\n this.printError(')')\n\n /* Semantic phase check */\n node.setType(nodeExpressao.getType())\n\n return node\n }\n\n /* OpUnario Exp4 */\n /* FIRST(OpUnario) */\n else if (\n this.isToken(TOKEN.OP_NGT) ||\n this.isToken(TOKEN.OP_NE)\n ) {\n const nodeOpUnario = this.parseOpUnario()\n const nodeExp4 = this.parseExp4()\n\n /* Semantic phase check */\n if (\n nodeOpUnario.getType() === nodeExp4.getType() &&\n nodeOpUnario.getType() === TYPE.numerical\n ) {\n node.setType(TYPE.numerical)\n }\n\n else if (\n nodeOpUnario.getType() === nodeExp4.getType() &&\n nodeOpUnario.getType() === TYPE.bool\n ) {\n node.setType(TYPE.bool)\n }\n\n else\n node.setType(TYPE.error)\n\n return node\n }\n\n /* ConstInteger | ConstDouble */\n else if (\n this.match(TOKEN.CONST_INT) ||\n this.match(TOKEN.CONST_DBL)\n ) {\n node.setType(TYPE.numerical)\n return node\n }\n\n /* ConstString */\n else if (this.match(TOKEN.CONST_STR)) {\n node.setType(TYPE.string)\n return node\n }\n\n /* true | false */\n else if (\n this.match(TOKEN.KW_TRUE) ||\n this.match(TOKEN.KW_FALSE)\n ) {\n node.setType(TYPE.bool)\n return node\n }\n\n else {\n /* Synch: FOLLOW(Exp4) */\n if (\n this.isToken(TOKEN.OP_MULT) ||\n this.isToken(TOKEN.OP_DIV) ||\n this.isToken(TOKEN.OP_SUM) ||\n this.isToken(TOKEN.OP_SUB) ||\n this.isToken(TOKEN.OP_LT) ||\n this.isToken(TOKEN.OP_LTE) ||\n this.isToken(TOKEN.OP_GT) ||\n this.isToken(TOKEN.OP_GE) ||\n this.isToken(TOKEN.OP_EQ) ||\n this.isToken(TOKEN.OP_NE) ||\n this.isToken(TOKEN.KW_OR) ||\n this.isToken(TOKEN.KW_AND) ||\n this.isToken(TOKEN.CLS_RND_BRACKET) ||\n this.isToken(TOKEN.SEMI_COLON) ||\n this.isToken(TOKEN.COMMA)\n ) {\n this.printError('ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | (')\n return node\n }\n\n /* Skip: Panic mode */\n else {\n this.skip('ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | (')\n if (!this.isToken(TOKEN.EOF))\n return this.parseExp4()\n }\n }\n }", "title": "" }, { "docid": "5f8c72d55788db0c697f9a2ec73eebe1", "score": "0.48373097", "text": "function values(tokens, tokenContent, type = \"\") {\r\n switch (tokens[0]) {\r\n case \"Variable\":\r\n addHtml(tokens.shift(), tokenContent.shift());\r\n operations(tokens, tokenContent, type);\r\n break;\r\n case \"Entero\":\r\n addHtml(tokens.shift(), tokenContent.shift());\r\n operations(tokens, tokenContent, type);\r\n break;\r\n case \"Real\":\r\n addHtml(tokens.shift(), tokenContent.shift());\r\n operations(tokens, tokenContent, type);\r\n break;\r\n case \"Parentesis-inicial\":\r\n addHtml(tokens.shift(), tokenContent.shift());\r\n checkParentesis(tokens, tokenContent, \"final\");\r\n break;\r\n case undefined:\r\n return;\r\n default:\r\n sintaxError(tokens, tokenContent.shift());\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "e2fec7ccf41631602688239954372304", "score": "0.4836504", "text": "parseExp2() {\n const expected = 'ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | ('\n const treeNodeExp2 = new TreeNode()\n\n /* FIRST(Exp3) */\n if (\n this.isToken(TOKEN.ID) ||\n this.isToken(TOKEN.CONST_INT) ||\n this.isToken(TOKEN.CONST_DBL) ||\n this.isToken(TOKEN.CONST_STR) ||\n this.isToken(TOKEN.KW_TRUE) ||\n this.isToken(TOKEN.KW_FALSE) ||\n this.isToken(TOKEN.OP_NGT) ||\n this.isToken(TOKEN.OP_NOT) ||\n this.isToken(TOKEN.OPN_RND_BRACKET)\n ) {\n const treeNodeExp3 = this.parseExp3()\n const treeNodeExp2Linha = this.parseExp2Linha()\n\n /* Semantic phase check */\n if (treeNodeExp2Linha.getType() === TYPE.void)\n treeNodeExp2.setType(treeNodeExp3.getType())\n\n else if (\n treeNodeExp2Linha.getType() === treeNodeExp3.getType() &&\n treeNodeExp2Linha.getType() === TYPE.numerical\n ) {\n treeNodeExp2.setType(TYPE.numerical)\n }\n\n else\n treeNodeExp2.setType(TYPE.error)\n\n return treeNodeExp2\n }\n\n else {\n /* Synch: Exp2 */\n /* FOLLOW(Exp2) */\n if (\n this.isToken(TOKEN.OP_LT) ||\n this.isToken(TOKEN.OP_LTE) ||\n this.isToken(TOKEN.OP_GT) ||\n this.isToken(TOKEN.OP_GE) ||\n this.isToken(TOKEN.OP_EQ) ||\n this.isToken(TOKEN.OP_NE) ||\n this.isToken(TOKEN.KW_OR) ||\n this.isToken(TOKEN.KW_AND) ||\n this.isToken(TOKEN.CLS_RND_BRACKET) ||\n this.isToken(TOKEN.SEMI_COLON) ||\n this.isToken(TOKEN.COMMA)\n ) {\n this.printError(expected)\n return treeNodeExp2\n }\n\n /* Skip: Panic mode */\n else {\n this.skip(expected)\n if (!this.isToken(TOKEN.EOF))\n return this.parseExp2()\n }\n }\n }", "title": "" }, { "docid": "8202866b0561cac769cf30e90221b509", "score": "0.48362783", "text": "function parseTree(text,errors,options){if(errors===void 0){errors=[];}var currentParent={type:'array',offset:-1,length:-1,children:[]};// artificial root\nfunction ensurePropertyComplete(endOffset){if(currentParent.type==='property'){currentParent.length=endOffset-currentParent.offset;currentParent=currentParent.parent;}}function onValue(valueNode){currentParent.children.push(valueNode);return valueNode;}var visitor={onObjectBegin:function onObjectBegin(offset){currentParent=onValue({type:'object',offset:offset,length:-1,parent:currentParent,children:[]});},onObjectProperty:function onObjectProperty(name,offset,length){currentParent=onValue({type:'property',offset:offset,length:-1,parent:currentParent,children:[]});currentParent.children.push({type:'string',value:name,offset:offset,length:length,parent:currentParent});},onObjectEnd:function onObjectEnd(offset,length){currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length);},onArrayBegin:function onArrayBegin(offset,length){currentParent=onValue({type:'array',offset:offset,length:-1,parent:currentParent,children:[]});},onArrayEnd:function onArrayEnd(offset,length){currentParent.length=offset+length-currentParent.offset;currentParent=currentParent.parent;ensurePropertyComplete(offset+length);},onLiteralValue:function onLiteralValue(value,offset,length){onValue({type:getLiteralNodeType(value),offset:offset,length:length,parent:currentParent,value:value});ensurePropertyComplete(offset+length);},onSeparator:function onSeparator(sep,offset,length){if(currentParent.type==='property'){if(sep===':'){currentParent.columnOffset=offset;}else if(sep===','){ensurePropertyComplete(offset);}}},onError:function onError(error){errors.push({error:error});}};visit(text,visitor,options);var result=currentParent.children[0];if(result){delete result.parent;}return result;}", "title": "" }, { "docid": "2bedb2c856ac932121016e39034aac6b", "score": "0.4824834", "text": "static getNodeType() {\n return ASTNodeType.VALUE;\n }", "title": "" }, { "docid": "27a85291348fca0cf7930d1df9c7a2a5", "score": "0.4822198", "text": "function Visitor(ast) {\n function visit(options, node, visit, resume) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op && node.args, \"2000: Visitor.visit() op=\" + node.op + \" args = \" + node.args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM:\n node = visit.numeric(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH: // set operator\n if (node.args.length === 1) {\n node = visit.unary(node, resume);\n } else {\n node = visit.additive(node, resume);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT:\n node = visit.multiplicative(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n node = visit.exponential(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n node = visit.variable(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORALL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EXISTS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].IN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EXP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TO:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DERIV:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PROD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CUP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BIGCUP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BIGCAP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PIPE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ION:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLINE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].UNDERSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATHBF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATHFIELD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACKET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OPERATORNAME:\n node = visit.unary(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVAL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALLEFTOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALRIGHTOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIST:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SET:\n node = visit.comma(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NI:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUPSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUPSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NNI:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUBSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUPSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUBSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUPSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].IMPLIES:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PROPTO:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PARALLEL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NPARALLEL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CONG:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAPRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGLEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAPLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n node = visit.equals(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT:\n // Only supported by normalizeSyntax\n node = visit.format(node);\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Should not get here. Unhandled node operator: \" + node.op);\n if (visit.name !== \"normalizeLiteral\" &&\n visit.name !== \"sort\") {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Should not get here. Unhandled node operator: \" + node.op);\n console.trace(JSON.stringify(node, null, 2));\n }\n break;\n }\n return node;\n }\n\n // Compute the degree (Number value) of the right most term of an equation.\n // If name is provided then return the degree of the part with that variable\n // name.\n function degree(root, notAbsolute) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Invalid node\");\n return visit(options, root, {\n name: \"degree\",\n exponential: function (node) {\n var args = node.args;\n var d;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var expo = mathValue(options, args[1], true);\n if (expo) {\n if (notAbsolute) {\n // Return the raw degree, not the absolute value of the degree\n d = degree(args[0], notAbsolute) * toNumber(expo);\n } else {\n d = degree(args[0], notAbsolute) * Math.abs(toNumber(expo));\n }\n } else {\n if (!isNeg(options, args[1])) {\n d = Number.POSITIVE_INFINITY; // degree of variable power\n } else {\n d = Number.NEGATIVE_INFINITY;\n }\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n // In, ln x, the degree isn't known so we call it infinity\n d = Number.POSITIVE_INFINITY;\n }\n return d;\n },\n multiplicative: function (node) {\n var args = node.args;\n var d = 0;\n args.forEach(function (n) {\n d += degree(n, notAbsolute);\n });\n return d;\n },\n additive: function (node) {\n // Return the degree of the highest degree term.\n var args = node.args;\n var d = 0;\n var t;\n args.forEach(function (n) {\n t = degree(n, notAbsolute);\n if (t > d) {\n d = t;\n }\n });\n return d;\n },\n numeric: function(node) {\n return 0;\n },\n unary: function(node) {\n var args = node.args;\n var d = degree(args[0], notAbsolute);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n return d;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n // Degree of a function is 1.\n return 1;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n// assert(args.length === 1, message(2003));\n return Number.POSITIVE_INFINITY;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n if (d !== 0) {\n return nodePositiveInfinity;\n }\n return 0;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL:\n return Number.POSITIVE_INFINITY;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE:\n default:\n return 0;\n }\n },\n variable: function(node) {\n return 1;\n },\n comma: function(node) {\n return [];\n },\n equals: function(node) {\n // Return the degree of the highest degree term.\n var args = node.args;\n var d = 0;\n var t;\n args.forEach(function (n) {\n t = degree(n, notAbsolute);\n if (t > d) {\n d = t;\n }\n });\n return d;\n }\n });\n }\n\n // Compute the constant part of an expression. The result of 'constantPart'\n // and 'variablePart' are complements. Their product are equivSymbolic with\n // the original expression.\n function constantPart(root) {\n // console.trace(\"constantPart() root=\" + JSON.stringify(root, null, 2));\n var env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"constantPart\",\n exponential: function (node) {\n if (variablePart(node) === null) {\n // No variable part, so it's all constant part.\n // console.trace(\"constantPart() exponential node=\" + JSON.stringify(node, null, 2));\n return node;\n }\n return nodeOne;\n },\n multiplicative: function (node) {\n var args = [];\n let isNeg = false;\n node.args.forEach(function (n) {\n var cp = constantPart(n);\n if (!isOne(cp)) {\n // No vars so we have a constant.\n var mv = mathValue(options, cp, env, true);\n if (isOne(mv)) {\n // Got one, skip it.\n } else if (isMinusOne(mv)) {\n isNeg = !isNeg;\n } else if (isZero(mv)) {\n args.shift(nodeZero);\n } else {\n args.push(n);\n }\n } // Otherwise it's a variable part. Skip it.\n });\n // console.trace(\"constantPart() multiplicative isNeg=\" + isNeg + \" args=\" + JSON.stringify(args, null, 2));\n if (args.length === 0) {\n return isNeg && nodeMinusOne || nodeOne;\n } else if (args.length === 1) {\n return isNeg && negate(args[0]) || args[0];\n }\n return isNeg && negate(multiplyNode(args)) || multiplyNode(args);\n },\n additive: function (node) {\n // (x + 2)(x - 1)\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is not a constant part.\n return variablePart(n) !== null;\n });\n if (!result) {\n return node;\n }\n return nodeOne;\n },\n unary: function(node) {\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is not a constant part.\n return variablePart(n) !== null;\n });\n if (!result) {\n return node;\n }\n return nodeOne;\n },\n numeric: function(node) {\n return node;\n },\n variable: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n },\n comma: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n },\n equals: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n }\n });\n }\n\n // Compute the unique variables of an expression.\n function variables(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"variables\",\n exponential: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n multiplicative: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n additive: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n unary: function(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OPERATORNAME) {\n // Skip the operator name.\n return variables(node.args[1]);\n }\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n numeric: function(node) {\n return [];\n },\n variable: function(node) {\n if (node.args[0] === \"0\") {\n // Is synthetic.\n return [];\n }\n var v = unpack(node);\n return [v];\n function unpack(node) {\n var v = \"\";\n node.args.forEach(function (n) {\n if (v === \"\") {\n if (n.op) {\n v = unpack(n);\n } else {\n v = n;\n }\n } else {\n v += \"_\" + unpack(n);\n }\n });\n return v;\n }\n },\n comma: function(node) {\n var args = node.args;\n var val = [];\n // FIXME should this be a list of strings or a list of arrays of\n // strings?\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n equals: function(node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n }\n });\n }\n\n function hint(root) {\n // Collect all of the hints attached to this node.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"hints\",\n exponential: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n if (!node.args[1].lbrk) {\n hints.push(Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2016));\n }\n return hints;\n },\n multiplicative: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n additive: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n unary: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n numeric: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n return hints;\n },\n variable: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n return hints;\n },\n comma: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n equals: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n }\n });\n }\n\n // Compute the variable part of the expression. The result of 'coeff' and\n // 'variablePart' are complements. Their product are equivSymbolic with the\n // original expression.\n function variablePart(root) {\n var env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"variablePart\",\n exponential: function (node) {\n if (variablePart(node.args[0]) ||\n variablePart(node.args[1])) {\n // Either base or exponent has a variable part, so the whole is a variable part.\n return node;\n }\n return null;\n },\n multiplicative: function (node) {\n // 3x^2y^3\n var args = [];\n node.args.forEach(function (n) {\n var v = variablePart(n);\n if (v !== null) {\n args.push(v);\n }\n });\n if (args.length === 0) {\n return null;\n } else if (args.length === 1) {\n return args[0];\n }\n return multiplyNode(args);\n },\n additive: function (node) {\n // (x + 2)(x - 1)\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is a variable part.\n return variablePart(n) !== null;\n });\n if (result) {\n return node;\n }\n return null;\n },\n unary: function(node) {\n var vp = variablePart(node.args[0]);\n if (vp !== null) {\n return node;\n }\n return null;\n },\n numeric: function(node) {\n return null;\n },\n variable: function(node) {\n var val;\n if (mathValue(options, node, true) === null &&\n node.args[0] !== \"i\") {\n // If it doesn't have a math value and is not 'i'.\n return node;\n }\n return null;\n },\n comma: function(node) {\n var vars = [];\n node.args.forEach(function (n) {\n vars = vars.concat(variables(n, env));\n });\n if (vars.length !== 0) {\n return node;\n }\n return null;\n },\n equals: function(node) {\n var vars = [];\n node.args.forEach(function (n) {\n vars = vars.concat(variables(n, env));\n });\n if (vars.length !== 0) {\n return node;\n }\n return null;\n }\n });\n }\n\n // Get the terms of an expression\n function terms(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"terms\",\n exponential: function (node) {\n return [node];\n },\n multiplicative: function (node) {\n return [node];\n },\n additive: function (node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n },\n unary: function(node) {\n return [node];\n },\n numeric: function(node) {\n return [node];\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n },\n equals: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n }\n });\n }\n\n function subexprs(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"terms\",\n exponential: function (node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n multiplicative: function (node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n additive: function (node) {\n var exprs = [];\n if (node.isRepeating) {\n return [node];\n }\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n unary: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n numeric: function(node) {\n return [node];\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n equals: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n }\n });\n }\n\n function normalizeFormatObject(fmt) {\n // Normalize the fmt object to an array of objects\n var list = [];\n switch (fmt.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR:\n list.push({\n code: fmt.args[0]\n });\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n var code = \"\";\n var length = undefined; // undefined and zero have different meanings.\n fmt.args.forEach(function (f) {\n if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR) {\n code += f.args[0];\n } else if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n length = +f.args[0];\n }\n });\n list.push({\n code: code,\n length: length\n });\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n fmt.args.forEach(function (f) {\n list = list.concat(normalizeFormatObject(f));\n });\n break;\n }\n return list;\n }\n\n function checkNumberFormat(fmt, node) {\n var fmtList = normalizeFormatObject(fmt);\n return fmtList.some(function (f) {\n var code = f.code;\n var length = f.length;\n switch (code) {\n case \"\\\\integer\":\n if (node.numberFormat === \"integer\") {\n if (length === undefined || length === node.args[0].length) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\decimal\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return true;\n } else {\n // Repeating is infinite.\n return false;\n }\n }\n if (node.numberFormat === \"decimal\" ||\n node.numberFormat === \"integer\") {\n if (length === undefined ||\n length === 0 && node.args[0].indexOf(\".\") === -1 ||\n length === node.args[0].substring(node.args[0].indexOf(\".\") + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\number\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return true;\n } else {\n // Repeating is infinite.\n return false;\n }\n }\n if (node.numberFormat === \"integer\" ||\n node.numberFormat === \"decimal\") {\n var brk = node.args[0].indexOf(\".\");\n if (length === undefined ||\n length === 0 && brk === -1 ||\n brk >= 0 && length === node.args[0].substring(brk + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\scientific\":\n if (node.isScientific) {\n var coeff = node.args[0].args[0];\n if (length === undefined ||\n length === 0 && coeff.indexOf(\".\") === -1 ||\n length === coeff.substring(coeff.indexOf(\".\") + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\fraction\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n case \"\\\\simpleFraction\":\n case \"\\\\nonMixedNumber\": // Deprecated\n if (node.isFraction ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n case \"\\\\mixedFraction\": // Deprecated\n case \"\\\\mixedNumber\":\n var mv;\n if (node.isMixedNumber ||\n node.numberFormat === \"integer\") {\n return true;\n } else if (node.isFraction &&\n (mv = mathValue(options, normalize(options, node), true)) &&\n mv.cmp(bigMinusOne) === 1 &&\n mv.cmp(bigOne) === -1) {\n return true;\n }\n break;\n case \"\\\\fractionOrDecimal\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"decimal\" ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n });\n }\n\n function toMixedNumber(node) {\n var n, d, nmv, dmv;\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC:\n n = node.args[0];\n d = node.args[1];\n nmv = mathValue(options, n);\n dmv = mathValue(options, d);\n if (isLessThan(nmv, dmv)) {\n return node;\n } else {\n // I+(N-I*D)/D\n var mv = mathValue(options, normalize(options, node), true);\n var ip = mv.mant.slice(0, mv.mant.length + mv.exp).join(\"\");\n var np = String(nmv - dmv.times(toDecimal(ip)));\n var dp = String(dmv);\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, [numberNode(options, ip), binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [numberNode(options, np), numberNode(options, dp)])]);\n node.isMixedNumber = true;\n return node;\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM:\n if (node.numberFormat === \"decimal\") {\n var mv = mathValue(options, normalize(options, node), true);\n var ip = mv.mant.slice(0, mv.mant.length + mv.exp).join(\"\");\n var np = mv.mant.slice(mv.mant.length + mv.exp).join(\"\");\n var dp = String(Math.pow(10, Math.abs(mv.exp)));\n var fp = simplify(options, expand(options, fractionNode(numberNode(options, np), numberNode(options, dp))));\n if (fp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fp.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // dp\n fp.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n fp.args[1].args[0] === \"-1\");\n np = nodeOne;\n dp = fp.args[0];\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n fp.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // np\n fp.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n fp.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // dp\n fp.args[1].args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n fp.args[1].args[1].args[0] === \"-1\");\n np = fp.args[0];\n dp = fp.args[1].args[0];\n }\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, [numberNode(options, ip), binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [np, dp])]);\n node.isMixedNumber = true;\n } else {\n return node;\n }\n default:\n return node;\n }\n }\n\n function formatExpression(fmt, node) {\n var fmtList = normalizeFormatObject(fmt);\n // TODO support multiple format strings. Return all formats.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fmtList.length === 1, \"2000: Internal error.\");\n var fmt = fmtList[0];\n var code = fmt.code;\n var length = fmt.length;\n switch (code) {\n case \"\\\\integer\":\n if (node.numberFormat === \"integer\") {\n if (length === undefined || length === node.args[0].length) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\decimal\":\n case \"\\\\scientific\":\n case \"\\\\number\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return node;\n } else {\n // Repeating is infinite.\n return node; // FIXME round?\n }\n }\n return formatNumber(fmt, node);\n case \"\\\\fraction\":\n if (node.isFraction ||\n node.isMixedNumber) {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction\")\n break;\n case \"\\\\simpleFraction\":\n case \"\\\\nonMixedFraction\": // Deprecated\n if (node.isFraction) {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction\")\n break;\n case \"\\\\mixedFraction\":\n case \"\\\\mixedNumber\":\n if (node.isMixedNumber) {\n return node;\n }\n return toMixedNumber(node);\n case \"\\\\fractionOrDecimal\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"decimal\") {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction or decimal\")\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n }\n\n // function formatNumber(fmt, node) {\n // // TODO rewrite to remove Decimal dependency, which is incomplete\n // var mv = mathValue(options, normalize(options, node), true);\n // var before = -1,\n // after = -1,\n // explaces = -1,\n // exdigits = -1,\n // exform = MathContext.SCIENTIFIC,\n // exround = -1;\n // switch (fmt.code) {\n // case \"\\\\decimal\":\n // after = fmt.length;\n // break;\n // case \"\\\\scientific\":\n // case \"\\\\engineering\":\n // exdigits = 1;\n // after = fmt.length || -1;\n // break;\n // default:\n // // Use defaults.\n // break;\n // }\n // var str = mv.format(before, after, explaces, exdigits, exform, exround);\n // if (fmt.code === \"\\\\scientific\" && str.indexOf(\"E+\") >= 0) {\n // str = str.replace(\"E+\", \"\\\\times10^{\") + \"}\";\n // }\n // return str;\n // }\n function formatNumber(fmt, node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"Update for Decimal class\");\n var mv = mathValue(options, normalize(options, node), true);\n switch (fmt.code) {\n case \"\\\\decimal\":\n break;\n case \"\\\\scientific\":\n case \"\\\\engineering\":\n break;\n default:\n // Use defaults.\n break;\n }\n var str = mv.toString();\n if (fmt.code === \"\\\\scientific\" && str.indexOf(\"E+\") >= 0) {\n str = str.replace(\"E+\", \"\\\\times10^{\") + \"}\";\n }\n return str;\n }\n\n function formatMath(options, root, ref) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n options = options || {};\n if (!ref || !ref.args) {\n // If not ref, then the structure of nodes is different, so just return original root.\n ref = {args:[]};\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"formatMath\",\n numeric: function (node) {\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n ref.args.length === 1 &&\n ref.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n // We have unary minus. Strip minus.\n ref = ref.args[0];\n }\n return formatExpression(ref.args[0], node);\n },\n additive: function (node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n multiplicative: function(node) {\n ref = flattenNestedMultiplyNodes(ref);\n node = flattenNestedMultiplyNodes(node);\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return multiplyNode(args);\n },\n unary: function(node) {\n var arg0 = formatMath(options, node.args[0], ref.args[0]);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n node = unaryNode(node.op, [arg0]); // Percent compares only to other percent forms\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node = negate(arg0, true);\n break;\n default:\n node = unaryNode(node.op, [arg0]);\n break;\n }\n return node;\n },\n variable: function(node) {\n return node;\n },\n exponential: function(node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n, i) {\n vals = vals.concat(formatMath(options, n, ref.args[i]));\n });\n var node = newNode(node.op, vals);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function checkVariableFormat(fmt, id) {\n var fmtList = normalizeFormatObject(fmt);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fmtList.length === 1, \"2000: Internal error.\");\n var code = fmtList[0].code;\n var length = fmtList[0].length; // Possibly undefined.\n var name;\n switch (code) {\n case \"\\\\variable\":\n if (length === undefined) {\n // If length is undefined, then accept any variable.\n name = \"_\";\n } else if (!(name = varMap[id])) {\n // If not in the map then add it.\n // But only if the synthetic name is not already taken.\n if (varNames.indexOf(\"_\" + length) < 0) {\n varMap[id] = name = \"_\" + length;\n varNames.push(name);\n } else {\n name = id; // No match, so use the original name.\n }\n }\n break;\n case \"\\\\integer\":\n case \"\\\\decimal\":\n case \"\\\\number\":\n case \"\\\\scientific\":\n case \"\\\\fraction\":\n case \"\\\\mixedFraction\": // Deprecated\n case \"\\\\mixedNumber\":\n case \"\\\\nonMixedNumber\":\n case \"\\\\fractionOrDecimal\":\n name = id; // Do nothing.\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n return name;\n }\n\n function isEmptyNode(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && node.args[0] === \"0\";\n }\n\n function flattenNestedMultiplyNodes(node) {\n var args = [];\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL || node.isScientific) {\n // Scientific notation is a special case that needs to keep its shape.\n return node;\n }\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n n.args.forEach(function (n) {\n args = args.concat(flattenNestedMultiplyNodes(n));\n });\n } else {\n args.push(n);\n }\n });\n return multiplyNode(args, true);\n }\n\n function normalizeSyntax(options, root, ref) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n options = options || {};\n if (!ref || !ref.args) {\n // If not ref, then the structure of nodes is different, so just return original root.\n ref = {args:[]};\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalizeSyntax\",\n format: function(node) {\n var fmtList = normalizeFormatObject(node.args[0]);\n if (fmtList[0].code === \"\\\\variable\") {\n var id;\n if (fmtList[0].length === undefined) {\n id = \"_\";\n } else {\n id = \"_\" + fmtList[0].length;\n }\n return variableNode(id);\n }\n return normalNumber;\n },\n numeric: function (node) {\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n ref.args.length === 1 &&\n ref.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n // We have unary minus. Strip minus.\n ref = ref.args[0];\n }\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n return normalNumber;\n }\n let arg;\n if (ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (arg = ref.args[0]).indexOf(\".\") === arg.length - 1) {\n // Trim off trailing decimal separator.\n ref.args[0] = arg.slice(0, arg.length - 1);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (arg = node.args[0]).indexOf(\".\") === arg.length - 1) {\n // Ditto.\n node.args[0] = arg.slice(0, arg.length - 1);\n }\n return node;\n },\n additive: function (node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n // Found a mixed fraction.\n return normalNumber;\n }\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return addNode(args);\n },\n multiplicative: function(node) {\n ref = flattenNestedMultiplyNodes(ref);\n node = flattenNestedMultiplyNodes(node);\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n return normalNumber;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = multiplyNode(node.args);\n }\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n if (!isMinusOne(n)) {\n args.push(n);\n }\n });\n return binaryNode(node.op, args);\n },\n unary: function(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && node.args.length === 1 && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n ref = ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && ref.args[0] || ref;\n return normalizeSyntax(options, node.args[0], ref);\n }\n var args = [];\n node.args.forEach(function (n, i) {\n args = args.concat(normalizeSyntax(options, n, ref.args[i]));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n node = unaryNode(node.op, args); // Percent compares only to other percent forms\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n node = args[0];\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n // Check the original node.\n checkNumberFormat(ref.args[0], node.args[0])) {\n return normalNumber;\n }\n node = negate(args[0], true);\n break;\n default:\n node = newNode(node.op, args);\n break;\n }\n return node;\n },\n variable: function(node) {\n var id = node.args[0];\n var name;\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n name = checkVariableFormat(ref.args[0], id);\n } else {\n name = id;\n }\n return variableNode(name);\n },\n exponential: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n, i) {\n vals = vals.concat(normalizeSyntax(options, n, ref.args[i]));\n });\n var node = newNode(node.op, vals);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function cancelFactors(options, node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return node;\n }\n var changed = false;\n var numers = {};\n var denoms = {};\n let hasMinusOne = false;\n node.args.forEach(function(n, i) {\n var f;\n var ff = factors(options, n, {}, false, true, true);\n ff.forEach(function (f) {\n var isDenom = f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, f.args[1]);\n var k = isDenom && isMinusOne(f.args[1]) && f.args[0] || // Strip exponent.\n isDenom && newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [f.args[0], negate(f.args[1])]) || // Invert exponent.\n f;\n var mv = mathValue(options, k, true);\n if (isOne(mv)) {\n // Skip 1s.\n return;\n }\n if (isMinusOne(f)) {\n hasMinusOne = !hasMinusOne;\n changed = true;\n } else {\n var key = mv !== null ? String(mv) : \"nid$\" + ast.intern(k);\n if (isDenom) {\n if (!denoms[key]) {\n denoms[key] = [];\n }\n denoms[key].push(f);\n } else {\n if (!numers[key]) {\n numers[key] = [];\n }\n numers[key].push(f);\n }\n }\n });\n });\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!numers[\"1\"] && !denoms[\"1\"], \"2000: Identity multiplication should be factored out by now.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!numers[\"-1\"] && !denoms[\"-1\"], \"2000: Negative multiplication should be factored out by now.\");\n var nKeys = Object.keys(numers);\n var dKeys = Object.keys(denoms);\n if (nKeys.length === 0 || dKeys.length === 0 ||\n dKeys.length === 1 && dKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with no other denoms.\n return node;\n }\n // Now do the canceling.\n nKeys.forEach(function (k) {\n var nn = numers[k];\n var dd = denoms[k];\n if (dd) {\n var count = dd.length > nn.length ? nn.length : dd.length;\n numers[k] = k === \"0\" ? nn.slice(0, 1) : nn.slice(count); // Slice off count items.\n denoms[k] = k === \"0\" ? dd.slice(0, 1) : dd.slice(count); // Keep zeros.\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n var nargs = [];\n var dargs = [];\n nKeys.forEach(function (k) {\n nargs = nargs.concat(numers[k]); // Save survivors.\n });\n dKeys.forEach(function (k) {\n dargs = dargs.concat(denoms[k]);\n });\n\n if (hasMinusOne) {\n if (dargs.length > 0) {\n dargs.unshift(negate(dargs.shift()));\n } else {\n nargs.unshift(negate(nargs.shift()));\n }\n }\n var n, d;\n if (nargs.length) {\n n = multiplyNode(nargs, true);\n } else {\n n = null;\n }\n if (dargs.length > 0) {\n d = multiplyNode(dargs, true);\n } else {\n d = null;\n }\n if (!n && !d) {\n return nodeOne;\n } else if (!d) {\n return n;\n } else if (!n) {\n return d;\n } else {\n return multiplyNode([n, d], true);\n }\n }\n\n function cancelTerms(node, location) {\n // Cancel like terms of opposite sign.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n return node;\n }\n var pos = {};\n var neg = {};\n node.args.forEach(function(n, i) {\n var isNegative = false;\n var f;\n if (isNeg(options, constantPart(n))) {\n isNegative = true;\n f = negate(n);\n } else {\n f = n;\n }\n var mv = mathValue(options, f, true);\n var key = mv !== null ? String(mv) : \"nid$\" + ast.intern(f);\n if (isNegative) {\n if (!neg[key]) {\n neg[key] = [];\n }\n neg[key].push(n);\n } else {\n if (!pos[key]) {\n pos[key] = [];\n }\n pos[key].push(n);\n }\n });\n var pKeys = Object.keys(pos);\n var nKeys = Object.keys(neg);\n if (pKeys.length === 0 || nKeys.length === 0 ||\n nKeys.length === 1 && nKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with not other denoms.\n return node;\n }\n // Now do the canceling.\n var args = [];\n var changed = false;\n pKeys.forEach(function (k) {\n var nn = pos[k];\n var dd = neg[k];\n if (dd) {\n var count = dd.length > nn.length ? nn.length : dd.length;\n pos[k] = nn.slice(count); // Slice off count items.\n neg[k] = dd.slice(count);\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n pKeys.forEach(function (k) {\n args = args.concat(pos[k]); // Save survivors.\n });\n nKeys.forEach(function (k) {\n args = args.concat(neg[k]);\n });\n if (args.length) {\n return addNode(args);\n } else {\n return nodeZero;\n }\n }\n\n function cancelEquals(node) {\n // Cancel like constants on both sides of a comparision.\n if (!isComparison(node.op) ||\n node.args.length != 2 ||\n isZero(node.args[0]) ||\n isZero(node.args[1])) {\n return node;\n }\n var lnode = node.args[0];\n var rnode = node.args[1];\n var largs, rargs;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n largs = lnode.args;\n } else {\n largs = [lnode];\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n rargs = rnode.args;\n } else {\n rargs = [rnode];\n }\n // We have multiplication on each side.\n var lhs = {};\n var rhs = {};\n largs.forEach(function(n) {\n var mv = mathValue(options, n, true);\n var key = mv !== null ? String(mv) : \"lvars\";\n if (!lhs[key]) {\n lhs[key] = [];\n }\n lhs[key].push(n);\n });\n rargs.forEach(function(n) {\n var mv = mathValue(options, n, true);\n var key = mv !== null ? String(mv) : \"rvars\";\n if (!rhs[key]) {\n rhs[key] = [];\n }\n rhs[key].push(n);\n });\n var lKeys = Object.keys(lhs);\n var rKeys = Object.keys(rhs);\n // Now do the canceling.\n var args = [];\n var changed = false;\n lKeys.forEach(function (k) {\n var ll = lhs[k];\n var rr = rhs[k];\n if (rr) {\n var count = rr.length > ll.length ? ll.length : rr.length;\n lhs[k] = ll.slice(count); // Slice off count items from each set.\n rhs[k] = rr.slice(count);\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n var largs = [];\n var rargs = [];\n lKeys.forEach(function (k) {\n largs = largs.concat(lhs[k]); // Save survivors.\n });\n rKeys.forEach(function (k) {\n rargs = rargs.concat(rhs[k]);\n });\n var larg, rarg;\n if (largs.length === 0) {\n larg = nodeOne;\n } else {\n larg = multiplyNode(largs);\n }\n if (rargs.length === 0) {\n rarg = nodeOne;\n } else {\n rarg = multiplyNode(rargs);\n }\n var lmv, rmv;\n if ((lmv = mathValue(options, larg)) && (rmv = mathValue(options, rarg)) &&\n lmv.comparedTo(rmv) === 0) {\n larg = rarg = nodeZero;\n }\n return binaryNode(node.op, [larg, rarg]);\n }\n\n function factorQuadratic(node) {\n var coeffs, vars, roots;\n // If not, check to see if there are any integer solutions to the\n // quadratic equation.\n if ((coeffs = isPolynomial(node)) &&\n coeffs.length === 3 &&\n (vars = variables(node)).length === 1) {\n roots = solveQuadratic(options, coeffs[2], coeffs[1], coeffs[0]);\n if (roots) {\n node = multiplyNode([\n addNode([variableNode(vars[0]), negate(numberNode(options, roots[0]))]),\n addNode([variableNode(vars[0]), negate(numberNode(options, roots[1]))]),\n ]);\n }\n }\n return node;\n }\n function combineLikeFactors(ff) {\n if (!ff || ff.length === 0) {\n return [];\n }\n if (ff.length === 1) {\n return ff;\n }\n var base;\n var expo = bigZero;\n var baseNid = 0;\n ff.forEach(function (f) {\n var b, e;\n if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n b = f.args[0];\n e = mathValue(options, f.args[1], true);\n } else {\n b = f;\n e = bigOne;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(e !== null);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(baseNid === 0 || ast.intern(b) === baseNid);\n baseNid = ast.intern(b);\n base = b;\n expo = expo.plus(e);\n });\n return [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, numberNode(options, expo)])];\n }\n function factorCommonExpressions(node) {\n // ff1(e1)+e2+e3+e4, ff1=e1, e1=1\n // ff2(e1+e2)+e3+e4\n // ff3(e1+e2+e3)+e4\n // ff4(e1+e2+e3+e4)\n // Start with e1 being the potential factors. Iterate over each term and\n // put back factors to the previous term that are not in the current term.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // FIXME handle the case of more than two args.\n return node;\n }\n var changed = false;\n var nargs = node.args.slice(0);\n var n1 = nargs.shift();\n var nn1 = {};\n var nnf = {};\n var args = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ? n1.args : [n1];\n // Get the factors for each term.\n args.forEach(function(n, i) {\n // For integer exponents, use base as key and later reduce\n // exponents.\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nnf[key]) {\n nnf[key] = [];\n }\n nnf[key].push(n);\n });\n nn1[\"1\"] = [nodeOne];\n // Iterate over the remaining terms.\n var ttt = [nn1]; // The list of previous terms.\n var nnn2 = []; // Tail terms\n nargs.forEach(function (n2) {\n var nn2 = {};\n nnn2.push(nn2);\n var args = n2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ? n2.args : [n2];\n args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn2[key]) {\n nn2[key] = [];\n }\n nn2[key].push(n);\n });\n // Keys represent possible like exprs.\n var n1Keys = Object.keys(nn1);\n var n2Keys = Object.keys(nn2);\n var nfKeys = Object.keys(nnf);\n // Now do the factoring.\n var ff = [];\n // To be a common factor an expr must be in every term, so just pick one\n // and iterate over its factors.\n nfKeys.forEach(function (k) {\n if (nn2[k] && nn2[k].length) {\n // We have a common factor.\n var fff = (nnf[k] = combineLikeFactors(nnf[k]));\n var ff1 = (nn1[k] = combineLikeFactors(nn1[k]));\n var ff2 = (nn2[k] = combineLikeFactors(nn2[k]));\n var fffLength = fff.length;\n var ff2Length = ff2.length;\n while (fffLength-- > 0 && ff2Length-- > 0) {\n // If match is POW and exponent is numeric, then factor number of exponents\n // 2x^4+x^3 => x^3(2x+1)\n var ff = fff.pop();\n var f2 = ff2.pop();\n var ef = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1])\n ? mathValue(options, ff.args[1], true)\n : bigOne;\n var e2 = f2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, f2.args[1])\n ? mathValue(options, f2.args[1], true)\n : bigOne;\n if (isLessThan(ef, e2)) {\n // The common factor is smaller than the current term so adjust\n // the current term.\n var e = e2.minus(ef);\n var b = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1], true) ? ff.args[0] : ff;\n if (!isZero(e)) {\n // Put back remaining factor.\n ff2.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n }\n if (!isZero(ef)) {\n // Save the common part as a factor.\n fff.push(isOne(ef) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, ef)]));\n }\n } else {\n // The common factor is bigger than the current term so make the\n // current term the common factor and adjust the previous terms.\n var e = ef.minus(e2);\n var b = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1], true) ? ff.args[0] : ff;\n if (!isZero(e)) {\n // Put back remaining factor.\n ttt.forEach(function (nf1) {\n var ff1 = nf1[k];\n ff1.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n });\n }\n if (!isZero(e2)) {\n // Save the common part as a factor.\n fff.push(isOne(e2) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e2)]));\n }\n }\n }\n changed = true;\n } else {\n // The common factor doesn't exist in the current term so remove\n // from the common factor and adjust the previous terms.\n var fff = nnf[k];\n while (fff.length > 0) {\n // If match is POW and exponent is numeric, then factor number of exponents\n // 2x^4+x^3 => x^3(2x+1)\n var ff = fff.pop();\n ttt.forEach(function (nf1) {\n var ff1 = nf1[k] || (nn1[k] = []);\n ff1.push(ff);\n });\n }\n changed = true;\n }\n });\n ttt.push(nn2);\n });\n if (!changed) {\n return node;\n }\n var args = [];\n var addArgs = [];\n let hasMinusOne = false;\n Object.keys(nn1).forEach(function (k) {\n nn1[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n1 = nodeOne;\n } else if (args.length === 1) {\n n1 = args[0];\n } else {\n n1 = multiplyNode(args, true);\n }\n addArgs.push(n1);\n nnn2.forEach(function (nn2) {\n var args = [];\n var n2;\n let hasMinusOneTerm = false;\n Object.keys(nn2).forEach(function (k) {\n nn2[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOneTerm = !hasMinusOneTerm;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOneTerm) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n2 = nodeOne;\n } else if (args.length === 1) {\n n2 = args[0];\n } else {\n n2 = multiplyNode(args, true);\n }\n addArgs.push(n2);\n });\n var args = [];\n Object.keys(nnf).forEach(function (k) {\n args = args.concat(nnf[k]);\n });\n if (args.length === 0) {\n // No factors so return the original node.\n return node;\n }\n return multiplyNode(args.concat(addNode(addArgs)), true);\n }\n\n function crossMultiply(options, n1, n2) {\n // Get each expr as a single fraction.\n n1 = fractionize(options, together(options, n1));\n n2 = fractionize(options, together(options, n2));\n // Cross multiply.\n const n10n21 = multiplyNode([n1.args[0], n2.args[1]], true);\n const n11n20 = multiplyNode([n1.args[1], n2.args[0]], true);\n n10n21.flags = {\"isAlgebraic\": true};\n n11n20.flags = {\"isAlgebraic\": true};\n return [n10n21, n11n20];\n }\n\n function getFlags(node) {\n const flags = {};\n Object.keys(node).forEach(key => {\n if (key !== 'op' && key !== 'args') {\n flags[key] = node[key];\n }\n });\n return flags;\n }\n\n function setFlags(node, flags) {\n Object.keys(flags).forEach(key => {\n node[key] = flags[key];\n });\n }\n\n function radicalToPower(options, node) {\n const flags = getFlags(node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT) {\n var base = node.args[0];\n var nthRoot = node.args[1];\n nthRoot.numberFormat = \"integer\";\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [nodeOne, nthRoot])]);\n }\n var args = [];\n node.args.forEach(function (arg) {\n if (arg.op) {\n arg = radicalToPower(options, arg);\n }\n args.push(arg);\n });\n node = newNode(node.op, args);\n setFlags(node, flags);\n return node;\n }\n\n function together(options, node) {\n // Puts an algebraic expr together by denesting and combining fractional subexpressions.\n node = radicalToPower(options, node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var base = node.args[0];\n var expo = node.args[1];\n base = together(options, base);\n expo = together(options, expo);\n // (\\frac{x}{y})^a => \\frac{x^a}{y^a}\n if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[0], expo]),\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[1], expo])\n ]);\n }\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = expo.args[0];\n var denom = expo.args[1];\n // x^{\\frac{-a}{b}} => x^{-\\frac{a}{b}}\n if (numer.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && numer.args.length === 1) {\n expo = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [numer.args[0], denom])]);\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, expo]);\n }\n }\n // x^{-a} => \\frac{1}{x^a}\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && expo.args.length === 1) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n nodeOne,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, expo.args[0]])\n ]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = node.args[0];\n var denom = node.args[1];\n numer = together(options, numer);\n denom = together(options, denom);\n if (denom.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = multiplyNode([\n numer,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [denom.args[1], denom.args[0]])\n ]);\n } else if (numer.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = multiplyNode([numer, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [nodeOne, denom])]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var numers = [];\n var denoms = [];\n node.args.forEach(function (arg) {\n arg = together(options, arg);\n if (arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n numers.push(arg.args[0]);\n denoms.push(arg.args[1]);\n } else {\n numers.push(arg);\n }\n });\n if (denoms.length) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [multiplyNode(numers), multiplyNode(denoms)]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args.length === 2) {\n var minuend = node.args[0];\n var subtrahend = node.args[1];\n minuend = together(options, minuend);\n subtrahend = together(options, subtrahend);\n if (subtrahend.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = addNode([\n minuend,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [subtrahend.args[0]]),\n subtrahend.args[1]\n ])\n ]);\n } else {\n node = addNode([minuend, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [subtrahend])]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args.length ===1) {\n node.args[0] = together(options, node.args[0]);\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = node.args[0].args[0];\n var denom = node.args[0].args[1];\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [numer]), denom]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && !node.isRepeating) {\n var numers = [];\n var denoms = [];\n var hasFraction;\n node.args.forEach(function (arg) {\n arg = together(options, arg);\n if (arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n numers.push(arg.args[0]);\n denoms.push(arg.args[1]);\n hasFraction = true;\n } else {\n numers.push(arg);\n denoms.push(nodeOne);\n }\n });\n if (hasFraction) {\n for (var i = 0; i < numers.length; i++) {\n var commonDenomFactor = denoms.slice(0, i).concat(denoms.slice(i+1, denoms.length+1));\n numers[i] = multiplyNode(commonDenomFactor.concat(numers[i]));\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [addNode(numers), multiplyNode(denoms)]);\n }\n }\n return node;\n }\n\n function fractionize(options, node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [node, nodeOne]);\n }\n return node;\n }\n\n function normalizeMul(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n if (node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // We have a denom with an exponent, so just invert it.\n var denom = node.args[1];\n var b = denom.args[0];\n var e = denom.args[1];\n node = multiplyNode([node.args[0], newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, negate(e, true)])], true);\n } else {\n node = fractionNode(node.args[0], node.args[1]);\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = multiplyNode(node.args, true);\n }\n return node;\n }\n\n function eraseCommonExpressions(options, n1, n2) {\n // console.log(\"[1] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[1] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = factorCommonExpressions(n1);\n n2 = factorCommonExpressions(n2);\n // console.log(\"[2] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[2] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = cancelFactors(options, n1);\n n2 = cancelFactors(options, n2);\n // console.log(\"[3] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[3] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n if (n1.op === n2.op && n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n n1.args.length === 2 && n2.args.length === 2 &&\n ast.intern(n1.args[1]) === ast.intern(n2.args[1]) &&\n mathValue(options, n1.args[1], true) === null) {\n // Have the same non-numeric power so compare base exprs.\n n1 = n1.args[0];\n n2 = n2.args[0];\n }\n if (n1.op !== n2.op ||\n n1.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return [n1, n2];\n }\n var changed = false;\n var nn1 = {};\n var nn2 = {};\n // console.log(\"[4] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[4] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1.args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n // For numeric exponents, use base as key and later reduce\n // exponents.\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn1[key]) {\n nn1[key] = [];\n }\n nn1[key].push(n);\n });\n n2.args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn2[key]) {\n nn2[key] = [];\n }\n nn2[key].push(n);\n });\n var nKeys = Object.keys(nn1);\n var dKeys = Object.keys(nn2);\n if (nKeys.length === 0 || dKeys.length === 0 ||\n dKeys.length === 1 && dKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with not other nn2.\n return [n1, n2];\n }\n // Now do the canceling.\n nKeys.forEach(function (k) {\n if (!isNaN(+k)) {\n // Skip factors.\n return;\n }\n var nn = nn1[k];\n var dd = nn2[k];\n if (dd) {\n // If match is POW then cancel number of exponents\n // x^2x^4, x^3 => x^4, x => x^3, 1\n while (nn.length > 0 && dd.length > 0) {\n var n1 = nn.pop();\n var n2 = dd.pop();\n var e1 = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1])\n ? mathValue(options, n1.args[1], true)\n : bigOne;\n var e2 = n2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n2.args[1])\n ? mathValue(options, n2.args[1], true)\n : bigOne;\n if (isLessThan(e1, e2)) {\n var e = e2.minus(e1);\n var b = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1], true) ? n1.args[0] : n1;\n dd.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n } else {\n var e = e1.minus(e2);\n var b = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1], true) ? n1.args[0] : n1;\n if (!isZero(e)) {\n nn.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n }\n }\n }\n changed = true;\n }\n });\n if (!changed) {\n return [cancelFactors(options, n1), cancelFactors(options, n2)];\n }\n var args = [];\n let hasMinusOne = false;\n nKeys.forEach(function (k) {\n nn1[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n1 = nodeOne;\n } else if (args.length === 1) {\n n1 = args[0];\n } else {\n n1 = newNode(n1.op, args);\n }\n args = [];\n hasMinusOne = false;\n dKeys.forEach(function (k) {\n nn2[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n2 = nodeOne;\n } else if (args.length === 1) {\n n2 = args[0];\n } else {\n n2 = newNode(n2.op, args);\n }\n // console.log(\"[5] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[5] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = cancelFactors(options, n1);\n n2 = cancelFactors(options, n2);\n // console.log(\"[6] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[6] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n return [n1, n2];\n }\n\n // normalize() replaces subtraction with addition and division with\n // multiplication. It does not perform expansion or simplification so that\n // the basic structure of the expression is preserved. Also, flattens binary\n // trees into N-ary nodes.\n var normalizedNodes = [];\n var normalizeLevel = 0;\n function normalize(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error. root=\" + JSON.stringify(root) + \" options=\" + JSON.stringify(options));\n var nid = ast.intern(root);\n if (root.normalizeNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = normalizedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n // if (normalizeLevel === 0) {\n // console.log(\"normalize() node: \" + JSON.stringify(stripMetadata(root), null, 2));\n // }\n normalizeLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalize\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n node = addNode([node.args[0], negate(node.args[1], true)], true /*flatten*/);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Operator \\pm can only be used on binary nodes\");\n node = addNode([\n node.args[0],\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node.args[1]])\n ]);\n } else if (node.args.some(function (arg) {\n return arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL && arg.args.length === 3;\n })) {\n // Have at least one definite integral.\n return normalizeIntegralAddition(node);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't flatten matrix nodes.\n return node;\n }\n if (isRepeating(node) && option(options, \"convertRepeatingDecimalToFraction\")) {\n node = repeatingDecimalToFraction(options, node);\n return node;\n }\n var mv = bigZero;\n var args = [];\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && mathValue(options, n, true) &&\n !option(options, \"doingSimplified\")) {\n // The last condition is a secret handshake that says we are in\n // isSimplified so don't merge number.\n mv = mv.plus(mathValue(options, n, true));\n } else {\n args = args.concat(normalize(options, n));\n }\n });\n var isMixedNumber = node.isMixedNumber;\n var isRepeatingFlag = node.isRepeating;\n if (!isZero(mv) || args.length === 0) {\n // Have non-zero term or solo zero term.\n args.unshift(numberNode(options, mv));\n }\n node = newNode(node.op, args);\n if (mathValue(options, node, true) && !option(options, \"doingSimplified\")) {\n // The last condition is a secret handshake that says we are in\n // isSimplified so don't merge number.\n node = commonDenom(node);\n }\n node.isMixedNumber = isMixedNumber;\n node = flattenNestedNodes(node);\n node.isMixedNumber = isMixedNumber;\n node.isRepeating = isRepeatingFlag;\n return sort(node);\n },\n multiplicative: function(node) {\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = normalizeMul(node);\n }\n var args = [];\n // Flatten nested multiplication.\n // FIXME can't use flattenNestedNode because of slight differences\n var hasPM;\n let hasMinusOne = false;\n node.args.forEach(function (n) {\n n = normalize(options, n);\n if (isOne(n)) {\n // If number node one, then erase it.\n } else if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten\n args = args.concat(n.args);\n } else if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n hasPM = true;\n args.push(n.args[0]);\n } else {\n args.push(n);\n }\n }\n });\n var isRepeatingFlag = node.isRepeating;\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = sort(binaryNode(node.op, sortFactors(args), true));\n }\n if (hasPM) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n node.isRepeating = isRepeatingFlag;\n return node;\n },\n unary: function(node) {\n if (isGrouping(options, node, normalizeLevel)) {\n return normalize(options, node.args[0]);\n }\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EVALAT) {\n var n = node.args[1];\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR);\n name = n.args[0].args[0];\n n = n.args[1];\n } else {\n var vv = variables(node.args[0]);\n name = vv[0];\n }\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[name] = {\n type: \"param\",\n node: n,\n };\n node = node.args[0].args[0];\n }\n break;\n }\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalize(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EVALAT) {\n }\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, node.args[0].args[1])) {\n node = negate(node.args[0]);\n } else {\n node = negate(node.args[0], true);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n if (args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n var mv = mathValue(options, args[0]);\n node = numberNode(options, divide(mv, 100));\n } else {\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n numberNode(options, \"100\"),\n nodeMinusOne\n ]), args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n if (isNeg(options, mathValue(options, args[0], true))) {\n var args = node.args.slice(0);\n node = newNode(node.op, [negate(args.shift(), true)].concat(args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var mv = mathValue(options, args[0]);\n if (mv) {\n node = numberNode(options, factorial(mv));\n } else {\n node = unaryNode(node.op, [args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n if (!normalizeArithmetic) {\n var base = node.args[0];\n var root = node.args[1];\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [root, nodeMinusOne])]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INT:\n node = normalizeIntegral(node);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n if (!normalizeArithmetic) {\n node = normalizeTrigIdent(node);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n var arg0 = normalize(options, node.args[0]);\n // tan x = sin x / cos x\n if (!normalizeArithmetic) {\n const s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n const c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n node = multiplyNode([\n newNode(s, [arg0]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(c, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n var arg0 = normalize(options, node.args[0]);\n var s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n var c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n if (!normalizeArithmetic) {\n node = multiplyNode([\n newNode(c, [arg0]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(s, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n var arg0 = normalize(options, node.args[0]);\n if (!normalizeArithmetic) {\n const c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(c, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n var arg0 = normalize(options, node.args[0]);\n if (!normalizeArithmetic) {\n const s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(s, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n node = normalizeAbs(node);\n break;\n default:\n // Do nothing.\n break;\n }\n return node;\n },\n variable: function(node) {\n var val;\n if (node.args[0] === \"i\" && !option(options, \"dontSimplifyImaginary\")) {\n node = nodeImaginary;\n } else if (node.args[0] === \"\\\\infty\") {\n node = nodePositiveInfinity;\n } else if (node.args[0] === \"\\\\radian\") {\n node = nodeOne; // Assume radians\n } else if (node.args[0] === \"\\\\degree\") {\n node = fractionNode(nodePI, numberNode(options, \"180\"));\n } else if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].type === \"param\") {\n node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].node;\n } else if (option(options, \"treatLettersAsVariables\") &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].type === \"unit\") {\n var vv = [];\n node.args[0].split(\"\").forEach(function (v) {\n vv.push(variableNode(v));\n });\n return multiplyNode(vv);\n } else if ((val = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]]) &&\n val.type === \"param\") {\n node = val.value;\n }\n return node;\n },\n exponential: function(node) {\n let n0 = node;\n if (node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].args[0].indexOf(\"'\") === 0) {\n // Merge primes. We use POW to encode primes.\n node = variableNode(node.args[0].args[0] + node.args[1].args[0]);\n return node;\n }\n var isUnit = false;\n var base = node.args[0];\n var expo = node.args[1];\n // TODO more identities here.\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // tanh^2 = 1 - sech^2\n return addNode([\n nodeOne,\n negate(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args),\n nodeTwo]),\n nodeMinusOne\n ]))\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 &&\n base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH && ast.intern(expo) === ast.intern(nodeTwo)) {\n // sinh^2 = cosh^2 - 1\n return addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args),\n nodeTwo]),\n nodeMinusOne\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // coth^2 = 1 + csch^2 = (1 + sin^2)/sin^2\n return addNode([\n nodeOne, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH, base.args),\n nodeTwo]),\n nodeMinusOne\n ])\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // sech^2 = 1/cosh^2\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args), nodeTwo]), nodeMinusOne]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // csch^2 = 1/sinh^2\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH, base.args), nodeTwo]), nodeMinusOne]);\n } else if (option(options, \"treatLettersAsVariables\") &&\n base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[base.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[base.args[0]].type === \"unit\") {\n isUnit = true;\n }\n var args = [];\n let hasMinusOne = false;\n node.args.forEach(function (n) {\n args = args.concat(normalize(options, n));\n });\n node = newNode(node.op, args);\n var args = [];\n switch(node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n // log_e has special meaning so don't normalize 'e' in that case.\n if (ast.intern(node.args[0]) === ast.intern(nodeE)) {\n args.push(nodeE);\n } else {\n args.push(normalize(options, node.args[0]));\n }\n if (node.args.length > 1) {\n args = args.concat(node.args.slice(1));\n }\n node = normalizeLogIdent(args[0], args[1]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n if (isMinusOne(node.args[0]) && toNumber(mathValue(options, node.args[1], true)) === 0.5) {\n return nodeImaginary;\n } else if (isMinusOne(node.args[0]) && isMinusOne(node.args[1])) {\n return nodeMinusOne;\n } else if (node.args.length === 2 && node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n // y^{log{x}} => x^{log{y}}\n var n1 = node.args[0];\n var n2 = node.args[1].args[1];\n var base = node.args[1].args[0];\n var args = sort(multiplyNode([n1, n2])).args; // Synthetic node for sorting.\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n args[0],\n binaryNode(node.args[1].op, [base, args[1]])\n ]);\n } else if (option(options, \"treatLettersAsVariables\") && isUnit && node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Associate power to last variable of base.\n var base = node.args[0];\n var last = base.args.pop();\n base = base.args.length === 1 && base[0] || base;\n node = multiplyNode([base, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [last, node.args[1]])]);\n }\n break;\n default:\n break;\n }\n return node;\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(normalize(options, n));\n });\n var node = newNode(node.op, vals);\n return sort(node);\n },\n equals: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n var args = [];\n node.args.forEach(function (n) {\n n = normalize(options, n);\n args.push(n);\n });\n node = binaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS) {\n // Normalize inequalities to LT and LE. (GE || NLESS) --> LE\n node.op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE;\n // Swap args.\n var t = node.args[0];\n node.args[0] = node.args[1];\n node.args[1] = t;\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR) {\n // Normalize NGTR --> LE. Don't need to swap args.\n node.op = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE;\n }\n node = sort(node); // Sort so that the lnodes after reconstruction compare\n // Doesn't seem to help, yet.\n // node = cancelEquals(node);\n // If the rhs is not already normalized to 0, then normalize it now.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON &&\n !isZero(mathValue(options, node.args[1], true))) {\n // a=b -> a-b=0\n node = binaryNode(node.op, [\n addNode([\n node.args[0],\n multiplyNode([nodeMinusOne, node.args[1]], true) // Flatten, don't use negate.\n ], true),\n nodeZero,\n ]);\n } else if (!isZero(mathValue(options, node.args[1], true)) && !isOne(mathValue(options, node.args[1], true))) {\n node = binaryNode(node.op, [\n multiplyNode([\n node.args[0],\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node.args[1], nodeMinusOne])\n ]),\n nodeOne,\n ]);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON) {\n // RHS is now 1 the ratio is expressed by the LHS.\n node = node.args[0];\n }\n return node;\n }\n }), root.location);\n normalizeLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"normalize() nid=\" + nid);\n // if (nid === 91 || nid === 94) {\n // console.log(\"normalize() node=\" + JSON.stringify(stripMetadata(JSON.parse(JSON.stringify(node))), null, 2))\n // }\n node = normalize(options, node);\n }\n node.normalizeNid = nid;\n normalizedNodes[rootNid] = node;\n return node;\n }\n\n function tagNode(node) {\n node.flags = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags;\n if (node.flags.hasSum || node.flags.hasIntegral ||\n node.flags.hasLim || node.flags.hasDeriv) {\n node.flags.hasCalculus = true;\n } else if (!node.flags.hasRel &&\n !node.flags.hasMatrix &&\n !node.flags.hasComma) {\n if (mathValue(options, normalize(options, node), true) || variablePart(node) === null) {\n node.flags.isNumeric = true;\n } else if (node.flags.hasTrig || node.flags.hasHyperTrig ||\n node.flags.hasExpo || node.flags.hasLog) {\n node.flags.isAlgebraic = false;\n } else {\n node.flags.isAlgebraic = true;\n }\n }\n }\n\n var normalizeSympyLevel = 0;\n function normalizeSympy(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n // if (normalizeSympyLevel === 0) {\n // console.log(\"normalizeSympy() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n normalizeSympyLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalize\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n // if (node.isRepeating) {\n // // Strip leading '0.' from repeating part.\n // assert(args[1].op === Model.NUM && args[1].args[0].charAt(0) === '0' && args[1].args[0].charAt(1) === '.');\n // args[1].args[0] = args[1].args[0].slice(2);\n // }\n return Object.assign({}, node, newNode(node.op, args));\n },\n multiplicative: function(node) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC;\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n return Object.assign({}, node, binaryNode(node.op, args, true));\n },\n unary: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2002));\n if (isGrouping(options, node, normalizeSympyLevel)) {\n return normalizeSympy(options, node.args[0]);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && node.args.length === 1 && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n return normalizeSympy(options, node.args[0]);\n }\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasAbs =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasAbs ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasSum =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasSum ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUM;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasIntegral =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasIntegral ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasDeriv =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasDeriv ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DERIV;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLim =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLim ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIM;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasTrig =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasTrig ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasHyperTrig =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasHyperTrig ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH;\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n return Object.assign({}, node, newNode(node.op, args));\n },\n variable: function(node) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasComma =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasComma ||\n node.args[0] === \"\\\\emptyset\";\n return node;\n },\n exponential: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLog =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLog ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LN;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasExpo =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasExpo ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n (node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR || variablePart(node.args[1]) !== null);\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n (variablePart(node.args[1]) === null && isNeg(options, mathValue(options, node.args[1], true)));\n return Object.assign({}, node, newNode(node.op, args));\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {};\n args = args.concat(normalizeSympy(options, n));\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {\n hasMatrix: true,\n };\n } else {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {\n hasComma: true,\n };\n }\n return Object.assign({}, node, newNode(node.op, args));\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasRel = true;\n return Object.assign({}, node, newNode(node.op, args));\n }\n }), root.location);\n normalizeSympyLevel--;\n if (normalizeSympyLevel === 0) {\n tagNode(node);\n }\n return node;\n }\n\n //var normalizeCalculateLevel = 0;\n function normalizeCalculate(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeCalculateNid === nid) {\n return root;\n }\n var rootNid = nid;\n // if (normalizeCalculateLevel === 0) {\n // console.log(\"normalizeCalculate() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n // normalizeCalculateLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalizeCalculate\",\n numeric: function (node) {\n if (isNeg(options, node)) {\n // FIXME what's this doing?\n node = numberNode(options, node.args[0]); // NormalizeCalculate negatives\n }\n return node;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n node = addNode([node.args[0], negate(node.args[1])], true /*flatten*/);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Operator \\pm can only be used on binary nodes\");\n node = addNode([\n node.args[0],\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node.args[1]])\n ]);\n }\n var args = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n // Don't flatten matrix nodes.\n return node;\n }\n node = flattenNestedNodes(node);\n return sort(node);\n },\n multiplicative: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV, \"2000: Divsion should be eliminated during parsing\");\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = normalizeMul(node);\n }\n var args = [];\n // Flatten nested multiplication.\n // FIXME can't use flattenNestedNode because of slight differences\n var hasPM;\n node.args.forEach(function (n) {\n n = normalizeCalculate(options, n);\n if (ast.intern(n) === ast.intern(nodeOne)) {\n // If number node one, then erase it. Can't use mathValue here,\n // because it simplifies constant expressions.\n return;\n }\n if (args.length > 0) {\n if (isMinusOne(args[args.length-1])) {\n if (isMinusOne(n)) {\n // Double negative, so erase both.\n args.pop();\n return;\n }\n if (isPositiveInfinity(n)) {\n // Collapse.\n args.pop();\n args.push(nodeNegativeInfinity);\n return;\n }\n if (isNegativeInfinity(n)) {\n // Collapse.\n args.pop();\n args.push(nodePositiveInfinity);\n return;\n }\n }\n }\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten\n args = args.concat(n.args);\n } else if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n hasPM = true;\n args.push(n.args[0]);\n } else {\n args.push(n);\n }\n });\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = sort(binaryNode(node.op, args));\n }\n if (hasPM) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeCalculate(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n return args[0];\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n node = negate(args[0]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n if (args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n var mv = mathValue(options, args[0]);\n node = numberNode(options, divide(mv, 100));\n } else {\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n numberNode(options, \"100\"),\n nodeMinusOne\n ]), args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n if (isNeg(options, mathValue(options, args[0], true))) {\n var args = node.args.slice(0);\n node = newNode(node.op, [negate(args.shift())].concat(args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var mv = mathValue(options, args[0]);\n if (mv) {\n node = numberNode(options, factorial(mv));\n } else {\n node = unaryNode(node.op, [args[0]]);\n }\n break;\n default:\n // Do nothing.\n break;\n }\n return node;\n },\n variable: function(node) {\n if (node.args[0] === \"i\" && !option(options, \"dontSimplifyImaginary\")) {\n node = nodeImaginary;\n }\n if (node.args[0] === \"\\\\infty\") {\n node = nodePositiveInfinity;\n }\n return node;\n },\n exponential: function(node) {\n var args = [];\n switch(node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n // log_e has special meaning so don't normalizeCalculate 'e' in that case.\n if (ast.intern(node.args[0]) === ast.intern(nodeE)) {\n args.push(nodeE);\n } else {\n args.push(normalizeCalculate(options, node.args[0]));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n if (isMinusOne(node.args[0]) && toNumber(mathValue(options, node.args[1], true)) === 0.5) {\n return nodeImaginary;\n } else if (isOne(node.args[0])) {\n return nodeOne;\n } else if (isMinusOne(node.args[0]) && isMinusOne(node.args[1])) {\n return nodeMinusOne;\n } else if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].indexOf(\"'\") === 0) {\n // Merge previous var with current '.\n return variableNode(node.args[0].args[0] + node.args[1].args[0]);\n }\n // Fall through.\n default:\n args.push(normalizeCalculate(options, node.args[0]));\n break;\n }\n args.push(normalizeCalculate(options, node.args[1]));\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(normalizeCalculate(options, n));\n });\n var node = newNode(node.op, vals);\n return sort(node);\n },\n equals: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2006));\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(isZero(node.args[1]), \"2000: Internal error.\");\n var coeffs = isPolynomial(node);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(coeffs.length === 2, \"2000: Internal error.\");\n var c0 = coeffs[0] === undefined ? \"1\" : coeffs[0];\n var c1 = coeffs[1] === undefined ? \"1\" : coeffs[1];\n return fractionNode(negate(numberNode(options, c0)), numberNode(options, c1));\n }\n }), root.location);\n // normalizeCalculateLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = normalizeCalculate(options, node);\n }\n node.normalizeCalculateNid = nid;\n return node;\n }\n\n var sortedNodes = [];\n function sort(root) {\n try {\n _assert_js__WEBPACK_IMPORTED_MODULE_0__[\"Assert\"].checkTimeout();\n } catch (e) {\n return root;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.sortNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = sortedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n var node = visit(options, root, {\n name: \"sort\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n // Sort by descending degree\n var args = [];\n node.args.forEach(function (n, i) {\n if (i > 0 && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n n = negate(n);\n }\n args.push(sort(n));\n });\n var op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD : node.op;\n var isMixedNumber = node.isMixedNumber;\n var isRepeatingFlag = node.isRepeating;\n node = binaryNode(op, args, true);\n node.isMixedNumber = isMixedNumber;\n node.isRepeating = isRepeatingFlag;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't sort these kinds of nodes.\n return node;\n }\n var d0, d1;\n var n0, n1;\n var v0, v1;\n var c0, c1;\n var s0, s1;\n var cp0, cp1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n d0 = degree(node.args[i]);\n d1 = degree(node.args[i + 1]);\n if (d0 < d1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (d0 === d1) {\n v0 = variables(n0);\n v1 = variables(n1);\n if (v0.length !== v1.length) {\n if (v0.length < v1.length) {\n // Swap\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if(v0.length > 0) {\n if ((s0=v0.join(\",\")) !== (s1=v1.join(\",\"))) {\n if (s0 < s1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if ((c0 = isPolynomial(n0)) && (c1 = isPolynomial(n1)) &&\n (s0=c0.join(\",\")) !== (s1=c1.join(\",\"))) {\n if (s0 < s1) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (isLessThan(constantPart(n0), constantPart(n1))) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (d0 === 0) {\n if (exponent(n0) !== exponent(n1)) {\n if (exponent(n0) < exponent(n1)) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (isLessThan((cp0 = mathValue(options, constantPart(n0)), true), (cp1 = mathValue(options, constantPart(n1)), true))) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (!cp0 && cp1) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n }\n return node;\n },\n multiplicative: function (node) {\n // Sort by ascending degree.\n var args = [];\n let hasMinusOne = false;\n node.args.forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(sort(n));\n }\n });\n if (args.length === 0) {\n return nodeOne;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n // Don't sort numerators and denominator or coefficients.\n return hasMinusOne && negate(binaryNode(node.op, args, true)) || binaryNode(node.op, args, true);\n }\n var d0, d1;\n var n0, n1;\n var v0, v1;\n var c0, c1;\n for (var i = 0; i < args.length - 1; i++) {\n var s0, s1;\n n0 = args[i];\n n1 = args[i + 1];\n d0 = degree(n0);\n d1 = degree(n1);\n if (d0 !== d1) {\n if (d0 > d1) {\n // Swap adjacent elements\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (Math.abs(d0) === Math.abs(d1)) {\n v0 = n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && variables(n0.args[0]) || variables(n0);\n v1 = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && variables(n1.args[0]) || variables(n1);\n var e0 = exponent(n0);\n var e1 = exponent(n1);\n if (e0 !== e1 && !isNaN(e0) && !isNaN(e1)) {\n if (e0 < e1) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (v0.length !== v1.length) {\n if (v0.length < v1.length) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n v0.length === 0) {\n // We have exponential exprs with the same exponent and no\n // variables so compare constant operands.\n if (isLessThan(mathValue(options, n0.args[0], true), mathValue(options, n1.args[0], true))) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (n0.op !== n1.op) {\n if (hashCode(n0.op) < hashCode(n1.op)) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if(v0.length > 0) {\n if ((s0=v0.join(\",\")) !== (s1=v1.join(\",\"))) {\n if (s0 < s1) {\n // Swap adjacent elements\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if ((c0 = isPolynomial(n0)) && (c1 = isPolynomial(n1)) &&\n (s0=c0.join(\",\")) !== (s1=c1.join(\",\"))) {\n if (s0 < s1) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (isLessThan(constantPart(n0), constantPart(n1))) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (isLessThan(leadingCoeff(n0), leadingCoeff(n1))) {\n // Keep last\n args[i] = n1;\n args[i + 1] = n0;\n }\n }\n }\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n node = binaryNode(node.op, args, true);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!(node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && isMinusOne(node.args[node.args.length - 1])), \"node=\" + JSON.stringify(node, null, 2));\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(sort(n));\n });\n return newNode(node.op, args);\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n, i) {\n args.push(sort(n));\n });\n node = binaryNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sort(n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n // If its a bare comma expression then sort.\n args.sort(function (a, b) {\n a = JSON.stringify(a);\n b = JSON.stringify(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n break;\n default:\n break;\n }\n return newNode(node.op, args);\n },\n equals: function(node) {\n node.args.forEach(function (n, i) {\n node.args[i] = sort(n);\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS ||\n node.args.length === 2 && isZero(node.args[1])) {\n // If already normalized or ratio or chem, then don't sort toplevel terms.\n return node;\n }\n // Sort by descending degree\n var d0, d1;\n var n0, n1;\n var v0, v1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n if ((d0 = degree(node.args[i], true)) < (d1 = degree(node.args[i + 1], true))) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (d0 === d1) {\n v0 = variables(n0);\n v1 = variables(n1);\n if (v0.length !== v1.length) {\n if(v0.length < v1.length) {\n // Swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (v0.length > 0) {\n if (v0[0] < v1[0]) {\n // Swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (!isZero(n1) && isLessThan(mathValue(options, n0), mathValue(options, n1))) {\n // Unless the RHS is zero, swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n return node;\n }\n });\n // If the node has changed, sort again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = sort(node);\n }\n node.sortNid = nid;\n sortedNodes[rootNid] = node;\n return node;\n }\n\n var sortedLiteralNodes = [];\n function sortLiteral(root) {\n _assert_js__WEBPACK_IMPORTED_MODULE_0__[\"Assert\"].checkTimeout();\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.sortLiteralNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = sortedLiteralNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n var node = visit(options, root, {\n name: \"sortLiteral\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = binaryNode(node.op, args, true);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't sort these kinds of nodes.\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n return node;\n },\n multiplicative: function (node) {\n let args = [];\n let negs = 0;\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && n.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES)) {\n // Pull negative signs out of multiplication args\n negs += 1;\n args.push(sortLiteral(n.args[0]));\n } else {\n args.push(sortLiteral(n));\n }\n });\n node = binaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV) {\n // Don't sort fraction or division nodes\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n args = [];\n for ( ; negs > 0; negs--) {\n // Put minus operators back to the leading args.\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [node.args.shift()]));\n }\n args = args.concat(node.args); // Concatentate the remaining args as they are.\n node = binaryNode(node.op, args);\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = unaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAP || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CUP) {\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n return node;\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = binaryNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n // If its a bare comma expression then sort.\n args.sort(function (a, b) {\n a = JSON.stringify(a);\n b = JSON.stringify(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n break;\n default:\n break;\n }\n return newNode(node.op, args);\n },\n equals: function(node) {\n node.args.forEach(function (n, i) {\n node.args[i] = sortLiteral(n);\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS) {\n // If already normalized or ratio or chem, then don't sort toplevel terms.\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n return node;\n }\n });\n // If the node has changed, sort again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = sortLiteral(node);\n }\n node.sortLiteralNid = nid;\n sortedLiteralNodes[rootNid] = node;\n return node;\n }\n\n function isGrouping(options, node, level) {\n return (\n ((node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACE || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACKET) ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SET && option(options, \"inSet\")) &&\n node.args.length === 1 &&\n node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA &&\n (level > 1 || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN)\n );\n }\n\n let normalizeLiteralLevel = 0;\n function normalizeLiteral(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeLiteralNid === nid) {\n return root;\n }\n normalizeLiteralLevel++;\n var node = visit(options, root, {\n name: \"normalizeLiteral\",\n numeric: function (node) {\n const ignoreTrailingZeros = option(options, 'ignoreTrailingZeros');\n const hasTrailingZeros = node.hasTrailingZeros && !ignoreTrailingZeros;\n const hasDecimalSeparator = node.args[0].indexOf('.') >= 0;\n if (hasTrailingZeros) {\n // Use newNode since numberNode messes with the trailing zeros.\n const zeros = new Array(node.hasTrailingZeros).fill(0).join('');\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM, [node.args[0] + (!hasDecimalSeparator && '.' || '') + zeros]);\n } else if (node.args.length === 1 && node.args[0] === '0.') {\n node = nodeZero;\n } else if (node.args[0].charAt(node.args[0].length - 1) === '.') {\n node = numberNode(options, node.args[0].slice(0, node.args[0].length - 1));\n }\n return node;\n },\n additive: function (node) {\n var args = [];\n var compareGrouping = node.lbrk && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"ignoreOrder\") && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Internal error.\");\n node = addNode([args[0], normalizeLiteral(options, unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [args[1]]))]);\n } else {\n node = binaryNode(node.op, args, true); // Flatten in case there was redundant grouping.\n }\n if (compareGrouping) {\n // Reconstitute brackets\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN, [node]);\n }\n return node;\n },\n multiplicative: function (node) {\n if (option(options, 'normalizeArithmetic') && (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV)) {\n node = normalizeMul(node);\n }\n var args = [];\n var compareGrouping = node.lbrk && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n var flatten = !compareGrouping;\n node.args.forEach(function (n) {\n // (x')y vs y(x')\n if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compatibility\") === \"v1.37\") {\n args.push(normalizeLiteral(options, n));\n } else {\n if (n.isPolynomialTerm && args.length > 0 &&\n (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM ||\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args[0].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM)) {\n let t = multiplyNode([args.pop(), normalizeLiteral(options, n)], true);\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF, t.args));\n } else {\n args.push(normalizeLiteral(options, n));\n }\n }\n });\n let op;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT && (!isAggregate(node.args[0]) || !isAggregate(node.args[1]))) {\n // Convert explicit multiplication to times.\n op = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES;\n } else {\n op = node.op;\n }\n node = binaryNode(op, args, flatten);\n if (compareGrouping) {\n // Reconstitute brackets\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN, [node]);\n }\n return node;\n },\n unary: function(node) {\n const compareGrouping = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n if (isGrouping(options, node, normalizeLiteralLevel)) {\n return normalizeLiteral(options, node.args[0]);\n }\n if (node.args[0].args.length === 1 &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) &&\n (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB)) {\n // Don't strip redundant + or - inside another unary + or -.\n node.args[0].args[0] = normalizeLiteral(options, node.args[0].args[0]);\n return node;\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (isMultiplicative(node.args[0])) {\n // Push unary minus down to first factor.\n let arg = node.args[0];\n let op =\n arg.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ||\n arg.op; // If double SUB then use MUL for COEFF.\n return binaryNode(op, [unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [arg.args.shift()])].concat(arg.args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n // Strip redundant +, unless followed by unary + or -.\n if (node.args[0].args.length > 1 || node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n return normalizeLiteral(options, node.args[0]);\n }\n break;\n }\n return node;\n },\n exponential: function (node) {\n if (node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].args[0].indexOf(\"'\") === 0) {\n // Merge primes.\n node = variableNode(node.args[0].args[0] + node.args[1].args[0]);\n } else {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n }\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n if (option(options, \"ignoreOrder\") &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR)) {\n // Swap adjacent elements and reverse the operator.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Comparisons have only two operands.\");\n var t = args[0];\n args[0] = args[1];\n args[1] = t;\n node.op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT : node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS;\n node = newNode(node.op, args);\n } else {\n node = newNode(node.op, args);\n }\n return node;\n }\n });\n normalizeLiteralLevel--;\n node.normalizeLiteralNid = ast.intern(node);\n return node;\n }\n\n function normalizeExpanded(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeExpandedNid === nid) {\n return root;\n }\n var node = visit(options, root, {\n name: \"normalizeExpanded\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return groupLikes(node);\n },\n multiplicative: function (node) {\n var equivLiteralDivAndFrac = false;\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return flattenNestedNodes(groupLikes(node));\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n }\n });\n // If the node has changed, normalizeExpanded again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = normalizeExpanded(node);\n }\n node.normalizeExpandedNid = nid;\n return node;\n }\n\n function isRepeating(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && isAdditive(node), \"2000: Internal error.\");\n return node.isRepeating;\n }\n\n function findRepeatingPattern(s, p, x) {\n if (!p) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])((typeof s === \"string\") && s.length > 0, \"2000: Internal error.\");\n p = s.charAt(0);\n s = s.substring(1);\n x = \"\";\n }\n if (s.length === 0) {\n return p;\n }\n if (s.indexOf(p) === 0) {\n // p is a prefix of s, so continue checking\n x += p;\n s = s.substring(p.length);\n return findRepeatingPattern(s, p, x);\n } else {\n // p is not a prefix of s, so extend p by skipped digits\n p += x + s.charAt(0);\n x = \"\";\n s = s.substring(1);\n return findRepeatingPattern(s, p, x);\n }\n }\n\n function repeatingDecimalToFraction(options, node) {\n // (add (decimalPart) (overline (repeatingPart)))\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(isRepeating(node), \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM, \"2000: Internal error.\");\n var decimalPart = node.args[0].args[0];\n var repeatingPart = node.args[1].args[0];\n var decimalPos = decimalPart.indexOf(\".\");\n var leadingZeros = node.args[1].hasLeadingZero || 0;\n repeatingPart = findRepeatingPattern(repeatingPart);\n var decimalPlaces = decimalPart.length - decimalPos - 1; // Don't count '.'.\n var repeatingPlaces = repeatingPart.length + leadingZeros;\n // 0.\\overline{3} --> 3/9\n // 0.\\overline{12} --> 12/99 --> 4/33\n // 0.0\\overline{6} --> 1/15\n // 0.\\overline{06} --> 2/33\n var numer = numberNode(options, repeatingPart);\n var denom = addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, \"10\"), numberNode(options, repeatingPlaces)]),\n nodeMinusOne\n ]);\n var scaleNode = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, \"10\"), negate(numberNode(options, decimalPlaces))]);\n node = multiplyNode([scaleNode, fractionNode(numer, denom)]);\n node = addNode([numberNode(options, decimalPart), node]);\n return node;\n }\n\n function isLessThan(n1, n2) {\n if (n1 && n1.op !== undefined) {\n n1 = mathValue(options, n1, true);\n }\n if (n2 && n2.op !== undefined) {\n n2 = mathValue(options, n2, true);\n }\n if (n1 === null || !(n1 instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) ||\n n2 === null || !(n1 instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n return false;\n }\n return n1.comparedTo(n2) < 0;\n }\n\n function isPos(bd) {\n return bd.comparedTo(bigZero) > 0;\n }\n function pow(b, e) {\n var val;\n if (isNaN(b) || isNaN(e) || b === null || e === null) {\n return null;\n }\n var bmv = toDecimal(b);\n var emv = toDecimal(e);\n if (bmv && emv) {\n val = bmv.pow(emv);\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"Should not get here\");\n val = toDecimal(Math.pow(toNumber(b), toNumber(e)));\n }\n return val;\n }\n function divide(n, d) {\n if (n === null || d === null) {\n return null;\n }\n if (!(n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n n = toDecimal(n);\n }\n if (!(d instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n d = toDecimal(d);\n }\n if (isZero(d)) {\n return null;\n }\n return n.dividedBy(d);\n }\n\n function sqrt(n) {\n if (n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) { // Assume d is too.\n if (n === null) {\n return null;\n }\n n = toNumber(n);\n }\n if (isNaN(n)) {\n return null;\n }\n return toDecimal(Math.sqrt(n)).toDecimalPlaces(option(options, \"decimalPlaces\"), decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"].ROUND_HALF_UP);\n }\n\n function trig(n, op) {\n if (n === null) {\n return null;\n } else if (n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) { // Assume d is too.\n n = toNumber(n);\n } else {\n if (isNaN(n)) {\n return null;\n }\n }\n var f;\n switch (op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n f = Math.sin;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n f = Math.cos;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n f = Math.tan;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n f = Math.asin;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n f = Math.acos;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n f = Math.atan;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n f = Math.sinh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n f = Math.cosh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n f = Math.tanh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n f = Math.asinh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n f = Math.acosh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n f = Math.atanh;\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Internal error.\");\n break;\n }\n return toDecimal(f(n));\n }\n\n function normalizeLogIdent(base, expo) {\n var args = [];\n var node;\n if (isMultiplicative(expo)) {\n // If log and multiplicative, then add log of each term.\n var aa = [];\n expo.args.forEach(function (e) {\n if (e.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n aa.push(multiplyNode([\n e.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e.args[0]])\n ]));\n } else {\n aa.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e]));\n }\n });\n args.push(addNode(aa));\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, args);\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // log x^y -> y log x\n args.push(multiplyNode([\n expo.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo.args[0]])\n ]));\n // x^2, x^y\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length > 0, \"2000: Internal error\");\n if (args.length > 1) {\n node = multiplyNode(args);\n } else if (args.length === 1) {\n node = args[0];\n }\n } else {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo]);\n }\n return node;\n }\n function normalizeTrigIdent(node) {\n var op = node.op;\n var args = node.args;\n var neg = sign(args[0]) < 0;\n var tt = terms(args[0]);\n var mv = bigZero;\n var cp = [], vp = [];\n tt.forEach(function (t, i) {\n if (variablePart(t) === null) {\n mv = mv.plus(mathValue(options, t, true, true)); // normalizeUnits=true\n cp.push(t);\n } else {\n vp.push(t);\n }\n });\n // mv is the math value of the angle in radians.\n // cp is the array of constant terms.\n // vp is the array of variable terms.\n // pi/2, pi, 3pi.\n var cycles = Math.floor(toNumber(mv) / (2 * Math.PI));\n // shift is the angle minus the number of cycles times 2pi.\n // phase is shift modulo PI. Many identities depend on the phase.\n var shiftNode;\n if (cycles) {\n shiftNode = addNode(cp.concat(\n negate(multiplyNode([numberNode(options, cycles), nodeTwo, nodePI]))\n ));\n } else {\n shiftNode = addNode(cp);\n }\n var phase = toNumber(mv) % (2 * Math.PI) / Math.PI;\n var node;\n var arg;\n if (vp.length > 0) {\n if (phase) {\n arg = addNode(vp.concat(shiftNode));\n } else {\n arg = addNode(vp);\n }\n } else {\n // Make sure there is something in the vp array.\n vp.push(nodeZero);\n arg = args[0];\n }\n switch (op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n if (neg) {\n // Normalize negative arg.\n arg = negate(arg);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n node = neg ? negate(node) : node;\n } else {\n // Phase shift identities.\n switch(phase) {\n case 1:\n case -1:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n node = negate(node);\n break;\n case 1/2:\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [addNode(vp)]);\n break;\n case -1/2:\n node = negate(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [addNode(vp)]));\n break;\n case 0:\n if (vp.length === 1) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n } else {\n var arg1 = vp[0];\n var arg2 = addNode(vp.slice(1).concat(cp));\n node = addNode([\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg2]),\n ]),\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg2]),\n ])\n ]);\n }\n break;\n default:\n if (!isZero(vp[0])) {\n // sin(x) => cos(pi/2-x)\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [\n addNode([\n fractionNode(nodePI, nodeTwo),\n negate(addNode(args)),\n ])\n ]);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, args);\n }\n break;\n }\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n if (neg) {\n // Normalize negative arg.\n arg = negate(arg);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n } else {\n switch(phase) {\n case 1:\n case -1:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n node = negate(node);\n break;\n case 1/2:\n arg = addNode(vp);\n node = negate(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]));\n break;\n case -1/2:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n break;\n case 0:\n if (vp.length === 1) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n } else {\n var arg1 = vp[0];\n var arg2 = addNode(vp.slice(1).concat(cp));\n node = addNode([\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg2]),\n ]),\n negate(multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg2]),\n ]))\n ]);\n }\n break;\n default:\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, args);\n break;\n }\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n var arg = args[0];\n var doNegate;\n if (isNeg(options, arg)) {\n arg = negate(arg);\n doNegate = true;\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [\n nodeE,\n addNode([\n arg,\n sqrtNode(addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [arg, nodeTwo]),\n nodeOne\n ]))\n ])\n ]);\n if (doNegate) {\n node = negate(node);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n var arg = args[0];\n var doNegate;\n if (isNeg(options, arg)) {\n arg = negate(arg);\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [\n nodeE,\n addNode([\n arg,\n sqrtNode(addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [arg, nodeTwo]),\n nodeMinusOne\n ]))\n ])\n ]);\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Internal error.\");\n break;\n }\n return node;\n }\n\n function normalizeAbs(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, \"2000: Internal error\");\n switch (node.args[0].op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n if (node.args[0].args.every(function (n) {\n return !isNeg(options, n);\n })) {\n // Every term is positive so we can rewrite as abs terms.\n var args = [];\n node.args[0].args.forEach(function (n) {\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [n]));\n });\n node = addNode(args);\n }\n break;\n }\n return node;\n }\n\n function integralNode(start, stop, expr) {\n if (start) {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL, [start, stop, expr]);\n } else {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL, [expr]);\n }\n }\n function normalizeIntegralAddition(node) {\n var terms = {};\n var args = [];\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL && n.args.length === 3) {\n var nid = ast.intern(n.args[2]);\n if (!terms[nid]) {\n terms[nid] = [];\n }\n terms[nid].push(n);\n } else {\n // Not a candidate for folding, so just keep it as is.\n args.push(n);\n }\n });\n var kk = Object.keys(terms);\n kk.forEach(function (k) {\n // \\int_a^b e + \\int_b^c e\n var tt = terms[k];\n var expr = tt[0].args[2];\n var starts = [], stops = [];\n tt.forEach(function (t) {\n var start = t.args[0];\n var stop = t.args[1];\n starts.push(ast.intern(start));\n stops.push(ast.intern(stop));\n });\n starts.forEach(function (start, stopIndex) {\n var startIndex = stops.indexOf(start);\n if (startIndex >= 0) {\n // We have a start and stop that align, so fold them. The new start\n // is the start at the index of the matched stop.\n args.push(integralNode(ast.node(starts[startIndex]), ast.node(stops[stopIndex]), expr));\n delete starts[startIndex];\n delete stops[startIndex];\n delete starts[stopIndex];\n delete stops[stopIndex];\n }\n });\n starts.forEach(function (start, i) {\n // Now add unfolded definite integral terms.\n var stop = stops[i];\n args.push(integralNode(ast.node(start), ast.node(stop), expr));\n });\n });\n return binaryNode(node.op, args);\n }\n function normalizeIntegral(node) {\n var start, stop, expr;\n if (node.args.length === 3) {\n start = node.args[0];\n stop = node.args[1];\n expr = node.args[2];\n } else {\n expr = node.args[0];\n }\n var cp, vp;\n if (start && ast.intern(start) === ast.intern(stop)) {\n node = nodeZero;\n } else if (isAdditive(expr)) {\n var args = [];\n expr.args.forEach(function (e) {\n args.push(integralNode(start, stop, e));\n });\n node = binaryNode(expr.op, args);\n } else if ((cp = constantPart(expr))) {\n vp = variablePart(expr);\n if (vp) {\n if (start && isNeg(options, cp)) {\n // If definite integral with negative constant, swap limits.\n cp = negate(cp);\n var t = start;\n start = stop;\n stop = t;\n }\n if (isOne(cp)) {\n node = integralNode(start, stop, vp);\n } else {\n node = multiplyNode([cp, integralNode(start, stop, vp)]);\n }\n } else if (start) {\n // \\int_a^b 5dx => 5(b-a)\n node = multiplyNode([cp, addNode([stop, negate(start)])]);\n }\n }\n return node;\n }\n\n function flattenNestedNodes(node, doSimplify) {\n var args = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR) {\n return node;\n }\n node.args.forEach(function (n) {\n if (doSimplify) {\n n = simplify(options, n);\n }\n // Normalize to get the correct shape node.\n n = normalize(options, n);\n if (n.op === node.op) {\n args = args.concat(n.args);\n } else {\n args.push(n);\n }\n });\n var isMixedNumber = node.isMixedNumber;\n node = binaryNode(node.op, args);\n node.isMixedNumber = isMixedNumber;\n return node;\n }\n\n // Map like factors to the same key.\n function factorGroupingKey(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"factorGroupingKey\",\n exponential: function (node) {\n return factorGroupingKey(node.args[1]) + _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW + factorGroupingKey(node.args[0]);\n },\n multiplicative: function (node) {\n var key = \"\";\n key += variables(node).join(\"\");\n if (!key) {\n key = factorGroupingKey(node.args[0]);\n }\n return key;\n },\n additive: function (node) {\n var key = \"\";\n node.args.forEach(function (n) {\n key += \"+\" + factorGroupingKey(n);\n });\n return key;\n },\n unary: function(node) {\n return factorGroupingKey(node.args[0]);\n },\n numeric: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM;\n },\n variable: function(node) {\n return node.args[0];\n },\n comma: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA;\n },\n equals: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL;\n }\n });\n }\n\n // Group like factors and terms into nodes that will simplify nicely.\n // We don't use the visitor mechanism because this is not recursive.\n var groupedNodes = [];\n function groupLikes(node) {\n var hash = {};\n var vp, keyid;\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // We only care about factors and terms.\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length > 1, \"2000: Internal error.\");\n var nid = ast.intern(node);\n var cachedNode;\n if ((cachedNode = groupedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n node = flattenNestedNodes(node);\n node.args.forEach(function (n, i) {\n var key;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // If factors, then likes have same variables.\n key = factorGroupingKey(n);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // If terms, likes have the same variable parts.\n key = variablePart(n);\n }\n if (!key) {\n var mv;\n // No variable key, so get a constant based key\n if ((mv = mathValue(options, n, true)) !== null) {\n // Group nodes that have computable math values.\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n mv = abs(mathValue(options, n.args[0], true));\n if (mv !== null) {\n key = \"number\";\n } else {\n key = \"none\";\n }\n } else {\n mv = abs(mv);\n if (mv !== null) {\n key = \"number\";\n } else {\n key = \"none\";\n }\n }\n } else {\n key = n;\n }\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(key, \"2000: Internal error.\");\n if (typeof key === \"string\") {\n key = variableNode(key);\n }\n keyid = ast.intern(key);\n var list = hash[keyid] ? hash[keyid] : (hash[keyid] = []);\n list.push(n);\n });\n var args = [];\n var numberArgs = [];\n var isMixedNumber = node.isMixedNumber;\n Object.keys(hash).forEach(function (k) {\n // Group elements that hashed together. Keep a set of singleton numbers\n // to group together later.\n var exprs = hash[k];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(exprs, \"2000: Internal error.\");\n var cp = [];\n var vp = [];\n // Separate the constant part from the variable part.\n exprs.forEach(function (n) {\n var c = constantPart(n);\n if (c) {\n cp.push(c);\n }\n });\n exprs.forEach(function (n) {\n var c = variablePart(n);\n if (c) {\n vp.push(c);\n }\n });\n if (cp.indexOf(null) >= 0) {\n // We've got some strange equation, so just return it as is.\n return node;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n var nd;\n if (cp.length > 0) {\n // Combine all the constants.\n nd = binaryNode(node.op, cp);\n nd.isMixedNumber = node.isMixedNumber;\n var mv = mathValue(options, nd);\n var tempArgs = [];\n if (mv !== null) {\n nd = numberNode(options, mv);\n } else {\n nd = simplify(options, nd, {dontGroup: true});\n }\n } else {\n nd = nodeOne;\n }\n if (vp.length > 0) {\n var v = vp[0]; // Each element is the same.\n if (isZero(nd)) {\n args.push(nodeZero);\n } else if (isOne(nd)) {\n args.push(v);\n } else {\n args.push(simplify(options, multiplyNode([nd, v], true), {dontGroup: true}));\n }\n } else if (nd) {\n if (nd.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n // At this point any node that has a math value will be a number node.\n numberArgs.push(nd);\n } else {\n args.push(nd);\n }\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var nd;\n if (cp.length > 0) {\n // Combine all the constants.\n nd = binaryNode(node.op, cp);\n var mv = mathValue(options, nd);\n var tempArgs = [];\n if (mv !== null) {\n if (isOne(mv)) {\n } else {\n numberArgs.push(numberNode(options, mv.toString()));\n }\n nd = null; // Factor out coefficient\n } else {\n nd = simplify(options, nd, {dontGroup: true});\n }\n } else {\n nd = null;\n }\n if (vp.length > 0) {\n if (nd === null || isOne(nd)) {\n args.push(simplify(options, multiplyNode(vp), {dontGroup: true}));\n } else if (isZero(nd)) {\n args.push(nodeZero);\n } else {\n args.push(simplify(options, multiplyNode([nd].concat(vp)), {dontGroup: true}));\n }\n } else if (nd) {\n if (mathValue(options, nd, true)) {\n numberArgs.push(nd);\n } else {\n args.push(nd);\n }\n }\n args = sortFactors(args);\n } else {\n args.push(binaryNode(node.op, exprs));\n }\n });\n if (numberArgs.length > 0) {\n var nd = binaryNode(node.op, numberArgs);\n var mv = mathValue(options, nd);\n if (mv === null) {\n args.push(nd);\n } else {\n args.push(numberNode(options, mv));\n }\n }\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = binaryNode(node.op, args);\n }\n node = sort(node);\n groupedNodes[rootNid] = node;\n node.isMixedNumber = isMixedNumber;\n return node;\n }\n\n // Special case. Check for like factors to avoid isExpanded|Factorised \"x*x\"\n // to evaluate to true.\n function hasLikeFactors(node) {\n if (!isMultiplicative(node)) {\n return false;\n }\n var hash = {};\n var vp, vpnid, list;\n var result = node.args.some(function (n) {\n // Return true if there is a dup.\n // (x+3)(x+3) (xy^2)\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n hasLikeFactors(n)) {\n return true;\n }\n vpnid =\n isMinusOne(n) && ast.intern(n) || // -1 is special.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (mathValue(options, n, true) && \"0\" || ast.intern(n)) || // Treat numbers as likes.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && (\n mathValue(options, n.args[1]) && !!variablePart(n.args[0]) && ast.intern(variablePart(n.args[0])) ||\n !!constantPart(n.args[0]) && mathValue(options, n.args[1])) ||\n !!variablePart(n) && ast.intern(variablePart(n));\n if (hash[vpnid]) {\n return true;\n }\n hash[vpnid] = true;\n return false;\n });\n return result;\n }\n\n function hasLikeFactorsOrTerms(node) {\n if (!isMultiplicative(node) &&\n !isAdditive(node) ||\n node.isRepeating ||\n node.isMixedNumber) {\n return false;\n }\n var hash = {};\n var vp, vpnid, list;\n var result = node.args.some(function (n) {\n // Return true if there is a dup.\n // (x+3)(x+3) (xy^2)\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && isNeg(options, n)) {\n n = negate(n); // This erases synthetic -1 factor.\n }\n if ((n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) &&\n hasLikeFactorsOrTerms(n)) {\n return true;\n }\n vpnid =\n isMinusOne(n) && ast.intern(n) || // -1 is special.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && mathValue(options, n, true) && \"0\" || // Treat numbers as likes.\n !!variablePart(n) && ast.intern(variablePart(n)) ||\n ast.intern(n);\n if (hash[vpnid]) {\n return true;\n }\n hash[vpnid] = true;\n return false;\n });\n return result;\n }\n\n function listNodeIDs(node) {\n var aa = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n node.args.forEach(function(n) {\n aa.push(ast.intern(n));\n });\n } else {\n aa.push(ast.intern(node));\n }\n return aa;\n }\n\n function diffSets(n1, n2) {\n if (n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n1.args.length === 2, \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n1.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2002));\n // Swap operands to undo sorting.\n var t = n2;\n n2 = n1.args[1];\n n1 = t;\n }\n var a1 = listNodeIDs(n1);\n var a2 = listNodeIDs(n2);\n var nids = a1.filter(function(i) {\n return a2.indexOf(i) < 0;\n });\n var args = [];\n nids.forEach(function (nid) {\n args.push(ast.node(nid));\n });\n if (args.length === 1) {\n return args[0];\n } else {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA, args);\n }\n }\n\n function isPolynomialDenominatorWithNegativeTerm(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n isMinusOne(node.args[1]) &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD &&\n variables(node.args[0]).length > 0 &&\n node.args[0].args.some(function (n) {\n // Limit the complexity allowed.\n return isNeg(options, constantPart(n));\n });\n }\n\n function commonDenom(node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // Not additive so create and add node so we can have the following code\n // collect denom factors into a single node.\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD, [node]);\n }\n // 1/2+2/3\n // ((1/2)(2*3)+(2/3)(2*3))/6\n // (3+4)/6\n // 7/6\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD);\n var n0 = node.args;\n if (!isChemCore()) {\n // Make common denominator.\n // Get denominators.\n var denoms = [];\n var deg = 0;\n n0.forEach(function (n1) {\n // Add current node's denominator to the list.\n denoms = denom(n1, denoms);\n denoms.forEach(function (n) {\n // This is a kind of adhoc complexity check. If one of the\n // denominator is of higher degree than 2 then don't find\n // common denominator.\n var d = degree(n);\n deg = d > deg && d || deg;\n });\n });\n if (denoms.length > 1 && deg < 3 ||\n (denoms.length === 1 && !isMinusOne(denoms[0]) && !isOne(denoms[0]))) {\n // We have a non-trivial common denominator.\n let hasMinusOne = false;\n let denomsNew = [];\n denoms.forEach(denom => {\n if (isMinusOne(denom)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(denom)) {\n denomsNew.push(denom);\n }\n });\n var denominator = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [multiplyNode(denomsNew, true), nodeMinusOne]);\n var numers = [];\n // For each term get the numerator based on the common denominator.\n n0.forEach(function (n1) {\n var d, n;\n // 2/x+3/y -> (2y+3x)/(xy)\n // .5x+.2y -> (2x+5y)/10\n d = denom(n1, []);\n n = numer(n1, d[0], denoms);\n numers = numers.concat(n);\n });\n let numersNew = [];\n numers.forEach(numer => {\n if (isMinusOne(numer)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(numer)) {\n numersNew.push(numer);\n }\n });\n // Now add the numerator and multiply it by the denominator.\n if (numers.length > 0) {\n n0 = binaryNode(node.op, numers);\n var mv;\n if ((mv = mathValue(options, n0))) {\n n0 = numberNode(options, mv);\n }\n node = multiplyNode([n0, denominator]);\n } else {\n node = denominator;\n }\n if (hasMinusOne) {\n node = negate(node);\n }\n } else {\n // Just return the original node.\n }\n }\n return node;\n }\n function numer(n, d, denoms) {\n // Denominators are in positive power form.\n // n = node to get numerator of.\n // d = denominator of current node.\n // denoms = all common denominators.\n // n/d/denoms\n denoms = denoms.slice(0); // Copy\n var ff = factors(options, n, {}, true, true);\n var hasNumer = false;\n var n0, nn = [];\n let hasMinusOne = false;\n ff.forEach(function (n) {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else if (n.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW || !isNeg(options, mathValue(options, n.args[1], true))) {\n // Is a numerator.\n nn.push(n);\n }\n });\n if (hasMinusOne) {\n if (nn.length === 0) {\n nn.unshift(nodeMinusOne);\n } else {\n nn.unshift(negate(nn.shift()));\n }\n }\n if (nn.length === 0 || nn.length === 1 && isOne(nn[0])) {\n // If no numerator or numerator of one, then use an empty array\n // that gets concat'd away. This happens when there are no factors\n // with a non-negative exponent.\n n0 = [];\n } else {\n n0 = [multiplyNode(nn)];\n }\n // See if the common denominator has an expression that matches\n // the current terms denominator. If so remove it from the list.\n var nid0 = d ? ast.intern(d) : 0; // If no denom then use 0 as nid.\n var index = -1;\n denoms.some(function (n, i) {\n var nid1 = ast.intern(n);\n if (nid0 === nid1) {\n index = i;\n return true;\n }\n return false\n });\n if (index > -1) {\n // Remove element that is in the numerator's denominator.\n denoms.splice(index, 1);\n }\n // Multiply top common denominator. Simplify to cancel factors.\n if (n0.length !== 0 || denoms.length !== 0) {\n let args = sortFactors(n0.concat(denoms));\n return multiplyNode(args, true);\n }\n return nodeOne; // Otherwise everthing degenerates to 1.\n }\n function denom(n, denoms) {\n // If the current node has a different denominator as those in denoms,\n // then add it. Denominators are in positive power form.\n var ff = factors(options, n, {}, true, true);\n var hasDenom = false;\n var d0, dd = [];\n ff.forEach(function (n) {\n d0 = n.args[0];\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && !isOne(n.args[0])) {\n // If denominator is 1 then skip it.\n if (isMinusOne(n.args[1])) {\n if (dd.length === 0) {\n dd.unshift(nodeMinusOne);\n } else {\n dd.unshift(negate(dd.shift(dd)));\n }\n } else if (isNeg(options, mathValue(options, n.args[1], true))) {\n dd.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [d0, simplify(options, negate(n.args[1]), env)]));\n }\n }\n });\n if (dd.length === 0) {\n // If no new denominators, then return original set.\n return denoms;\n } else {\n d0 = multiplyNode(dd);\n }\n // Add to denoms if not already there.\n if (denoms.every(function (d) {\n return ast.intern(d) !== ast.intern(d0);\n })) {\n denoms.push(d0);\n }\n return denoms;\n }\n var simplifiedNodes = [];\n // var simplifyLevel = 0;\n function simplify(options, root, env, resume) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL || root.args.length > 1, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.simplifyNid === nid) {\n return root;\n }\n // if (simplifyLevel === 0) {\n // console.log(\"simplify() nid=\" + nid + \" node: \" + JSON.stringify(root, null, 2));\n // }\n // simplifyLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"simplify\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB,\n \"2000: simplify(options, ) additive node not normalized: \" + JSON.stringify(node));\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return node;\n }\n var isMixedNumber = node.isMixedNumber;\n node = cancelTerms(node);\n if (!env || !env.dontGroup) {\n node = groupLikes(node);\n }\n if (!isAdditive(node)) {\n // Have a new kind of node so start over.\n return node;\n }\n // Simplify kids.\n var args = [];\n node.args.forEach(function (n, i) {\n args = args.concat(simplify(options, n, env));\n });\n node = binaryNode(node.op, args);\n node.isMixedNumber = isMixedNumber;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return node;\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD &&\n node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args[0].args.length === 2 &&\n node.args[0].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n node.args[0].args[0].args[0] === \"-1\" &&\n node.args[0].args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n return diffSets(node.args[0], node.args[1]);\n }\n // Make denominators common.\n if (!option(options, \"dontFactorDenominators\") || !isMixedNumber && mathValue(options, node, true)) {\n // It's a numeric expression so simplify it anyway.\n node = commonDenom(node);\n }\n if (!isAdditive(node)) {\n // Have a new kind of node so start over.\n return node;\n }\n // Now fold other terms\n var args = node.args.slice(0); // Make a copy.\n var n0 = [simplify(options, args.shift(), env)];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n node = n0[0];\n } else {\n node = binaryNode(node.op, n0);\n }\n node.isMixedNumber = isMixedNumber;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length > 0, \"2000: Internal error.\");\n return node;\n function fold(lnode, rnode) {\n var ldegr = degree(lnode);\n var rdegr = degree(rnode);\n var lcoeff = constantPart(lnode);\n var rcoeff = constantPart(rnode);\n if (isZero(lcoeff)) {\n return rnode;\n }\n if (isZero(rcoeff)) {\n return lnode;\n }\n if (ldegr === rdegr) {\n // Have two terms of the same degree.\n var lvpart = variablePart(lnode);\n var rvpart = variablePart(rnode);\n // Combine terms with like factors.\n if (lvpart !== null && rvpart !== null &&\n ast.intern(lvpart) === ast.intern(rvpart)) {\n var c = addNode([lcoeff, rcoeff]);\n var cmv = mathValue(options, c);\n if (isZero(cmv)) {\n return nodeZero;\n } else if (isOne(cmv)) {\n return lvpart;\n }\n return multiplyNode([c, lvpart]);\n } else if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG &&\n (ast.intern(lnode.args[0]) === ast.intern(rnode.args[0]))) {\n return simplify(options, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [lnode.args[0], multiplyNode([lnode.args[1], rnode.args[1]])]), env);\n } else if (ldegr === 0 && rdegr === 0) {\n // Have two constants.\n var mv1 = mathValue(options, lnode, true);\n var mv2 = mathValue(options, rnode, true);\n if (isInteger(mv1) && isInteger(mv2)) {\n return numberNode(options, mv1.plus(mv2));\n } else if (ast.intern(lnode) === ast.intern(rnode)) {\n return multiplyNode([nodeTwo, lnode]);\n } else if ((!env || !env.dontGroup) && !option(options, \"dontFactorTerms\") && commonFactors(options, lnode, rnode).length > 0) {\n return [factorTerms(lnode, rnode)];\n } else {\n return [lnode, rnode];\n }\n } else if (ldegr === 2 && rdegr === 2 &&\n isOne(lcoeff) && isOne(rcoeff) &&\n (lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN) &&\n ast.intern(lnode.args[0].args[0]) === ast.intern(rnode.args[0].args[0])) {\n // Special case: sin^2(x)+cos^2(x)\n return nodeOne;\n } else if (ldegr === 2 && rdegr === 2 &&\n isOne(lcoeff) && isOne(rcoeff) &&\n (lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN) &&\n ast.intern(lnode.args[0].args[0]) === ast.intern(rnode.args[0].args[0])) {\n // Special case: sin^2(x)+cos^2(x)\n return nodeOne;\n }\n }\n if (ast.intern(lnode) === ast.intern(rnode)) {\n return multiplyNode([nodeTwo, lnode]);\n } else if (isZero(mathValue(options, lcoeff))) {\n return rnode;\n } else if (isZero(mathValue(options, rcoeff))) {\n return lnode;\n } else if (!option(options, \"dontFactorTerms\") && !isOne(mathValue(options, lcoeff)) && !isOne(mathValue(options, rcoeff))) {\n if (commonFactors(options, lnode, rnode).length > 0) {\n var node = [factorTerms(lnode, rnode)];\n return node;\n }\n }\n return [lnode, rnode];\n }\n },\n multiplicative: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, \"2000: simplify() multiplicative node not normalized: \" + JSON.stringify(node));\n node = cancelFactors(options, node);\n if (!env || !env.dontGroup) {\n node = groupLikes(node);\n }\n if (!isMultiplicative(node)) {\n // Have a new kind of node start over.\n return node;\n }\n var nid = ast.intern(node);\n var args = node.args.slice(0);\n var n0 = [simplify(options, args.shift(), env)];\n if (n0[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten.\n n0 = n0[0].args.slice(0);\n }\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n0.length, \"2000: Internal error.\");\n node = n0[0];\n } else {\n node = sort(multiplyNode(n0, true));\n }\n return node;\n function fold(lnode, rnode) {\n var ldegr = degree(lnode);\n var rdegr = degree(rnode);\n var lvars = variables(lnode);\n var rvars = variables(rnode);\n var lvpart = variablePart(lnode);\n var rvpart = variablePart(rnode);\n var lcoeff = constantPart(lnode);\n var rcoeff = constantPart(rnode);\n var lcoeffmv = mathValue(options, lcoeff, true);\n var rcoeffmv = mathValue(options, rcoeff, true);\n var lmv, rmv;\n if (ldegr === 0 && isZero(lcoeffmv) && !isUndefined(rnode) ||\n rdegr === 0 && isZero(rcoeffmv) && !isUndefined(lnode)) {\n if (units(lnode).length || units(rnode).length) {\n // Don't erase units.\n return [lnode, rnode];\n } else {\n return nodeZero;\n }\n } if (isInteger(lmv = mathValue(options, lnode)) && isInteger(rmv = mathValue(options, rnode))) {\n return numberNode(options, lmv.times(rmv));\n } else if (ldegr === 0 && isOne(lcoeffmv)) {\n return rnode;\n } else if (rdegr === 0 && isOne(rcoeffmv)) {\n return lnode;\n } else if (isInfinity(lnode)) {\n if (isNeg(options, rnode)) {\n return negate(lnode);\n } else {\n return lnode;\n }\n } else if (isInfinity(rnode)) {\n if (isNeg(options, lnode)) {\n return negate(rnode);\n } else {\n return rnode;\n }\n } else if (ldegr === 0 && rdegr === 0) {\n if (isOne(rcoeffmv) && isOne(lcoeffmv)) {\n // Have two constants that have the math value of one.\n return nodeOne;\n } else if (isImaginary(lnode) && isImaginary(rnode)) {\n return nodeMinusOne;\n }\n var lexpo = exponent(lnode);\n var rexpo = exponent(rnode);\n var lbase = base(lnode);\n var rbase = base(rnode);\n if (lbase !== null && rbase !== null &&\n Math.abs(lexpo) === 1 && Math.abs(rexpo) === 1) {\n if (lexpo === rexpo) {\n // 2^3*3^3, combine bases\n if (isMinusOne(lbase) || isMinusOne(rbase)) {\n node = [lnode, rnode];\n } else {\n node = multiplyNode([numberNode(options, lbase), numberNode(options, rbase)], true); // Flatten because numberNode creates mul nodes for negatives.\n if ((mv = mathValue(options, node))) {\n node = numberNode(options, mv);\n }\n if (lexpo === -1) {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node, nodeMinusOne]);\n }\n }\n } else {\n // We've got a fraction to simplify.\n var mv;\n if (isZero(lnode)) {\n node = nodeZero;\n } else if ((mv = mathValue(options, multiplyNode([lnode, rnode])))) {\n node = numberNode(options, mv);\n } else {\n var lbaseN = toNumber(lbase);\n var rbaseN = toNumber(rbase);\n var d = gcd(lbaseN, rbaseN);\n if (d === (d | 0)) {\n // Have integer GCD.\n lbase = divide(lbase, toDecimal(d));\n rbase = divide(rbase, toDecimal(d));\n }\n if (lexpo < 0 && isOne(lbase)) {\n node = numberNode(options, rbase);\n } else if (rexpo < 0 && isOne(rbase)) {\n node = numberNode(options, lbase);\n } else {\n var n = lexpo === 1 ? lbase : rbase;\n var d = lexpo === 1 ? rbase : lbase;\n if (isOne(n)) {\n // If the numerator is 1, erase it.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, d), nodeMinusOne]);\n } else {\n var q = divide(n, d);\n if (isInteger(q)) {\n // Got an integer, use it.\n node = numberNode(options, q);\n } else {\n // Otherwise, make a new simplified fraction.\n if (isNeg(options, n) && isNeg(options, d)) {\n n = n.times(toDecimal(\"-1\"));\n d = d.times(toDecimal(\"-1\"));\n }\n node = [\n numberNode(options, n),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, d), nodeMinusOne])\n ];\n }\n }\n }\n }\n }\n } else if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n ast.intern(lnode.args[1]) === ast.intern(rnode.args[1])) {\n // x^z*y^z -> (x*y)^z\n var lbase = lnode.args[0];\n var rbase = rnode.args[0];\n var lexpo = exponent(lnode);\n var rexpo = exponent(rnode);\n if (lexpo === 0.5 &&\n ast.intern(lbase) === ast.intern(rbase)) {\n // Found square of square roots, so simplify.\n node = lbase;\n } else if (lexpo !== -1 && !isMinusOne(lbase) && !isMinusOne(rbase)) {\n // FIXME simplifying \"1/cos{1.03}\" causes infinite recursion. So avoid for now.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [simplify(options, multiplyNode([lbase, rbase])), lnode.args[1]]);\n } else {\n node = [lnode, rnode];\n }\n } else {\n node = [lnode, rnode];\n }\n } else if (lvpart && rvpart && ast.intern(lvpart) === ast.intern(rvpart)) {\n // One or both nodes contain var.\n var lnode =\n isOne(lcoeff) && rcoeff ||\n isOne(rcoeff) && lcoeff ||\n multiplyNode([lcoeff, rcoeff]);\n if (lvpart.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // FIXME if lvpart (and therefore rvpart) base is additive and\n // expos are the same, then multiply out bases\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lvpart.args.length === 2 && rvpart.args.length === 2, \"2000: Exponents of exponents not handled here.\");\n var lexpo = lvpart.args[1];\n var rexpo = rvpart.args[1];\n var rnode = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n lvpart.args[0],\n addNode([lexpo, rexpo])\n ]);\n } else {\n var rnode = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [lvpart, nodeTwo]);\n }\n if (isZero(mathValue(options, lnode))) {\n node = [];\n } else if (isOne(mathValue(options, lnode))) {\n node = rnode;\n } else {\n node = [lnode, rnode];\n }\n } else if (ast.intern(lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? lnode.args[0] : lnode) ===\n ast.intern(rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? rnode.args[0] : rnode)) {\n // Same base, different exponents.\n var b, el, er;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n b = lnode.args[0];\n } else {\n b = lnode;\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n el = lnode.args[1];\n } else {\n el = nodeOne;\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n er = rnode.args[1];\n } else {\n er = nodeOne;\n }\n var e = simplify(options, addNode([el, er]), env);\n if (isZero(e)) {\n // x^0 = 1\n node = nodeOne;\n } else if (isOne(e)) {\n // x^1 = x\n node = b;\n } else {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, e]);\n }\n } else if (ldegr === 0 && isOne(lcoeffmv)) {\n return rnode;\n } else if (rdegr === 0 && isOne(rcoeffmv)) {\n return lnode;\n } else if (ldegr === 0) {\n if (sign(lnode) < 0 && isPolynomialDenominatorWithNegativeTerm(rnode)) {\n // If lnode is negative and rnode is a polynomial denominator, then invert.\n return [negate(lnode), expand(options, negate(rnode))];\n }\n var v = mathValue(options, lnode);\n if (v !== null) {\n node = [numberNode(options, v), rnode];\n } else {\n node = [lnode, rnode];\n }\n } else if (rdegr === 0) {\n var v = mathValue(options, rnode);\n if (v !== null) {\n node = [numberNode(options, v), lnode]; // Coeffs first.\n } else {\n node = [lnode, rnode];\n }\n } else if (option(options, \"dontExpandPowers\") &&\n lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n ast.intern(lnode.args[1]) === ast.intern(rnode.args[1])) {\n // x^z*y^z -> (xy)^z\n var lbase = lnode.args[0];\n var rbase = rnode.args[0];\n var args = [];\n if (lbase.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten nested multiplication.\n args = args.concat(lbase.args);\n } else {\n args.push(lbase);\n }\n if (rbase.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten nested multiplication.\n args = args.concat(rbase.args);\n } else {\n args.push(rbase);\n }\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [simplify(options, multiplyNode(args)), lnode.args[1]]);\n } else {\n node = [lnode, rnode];\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n if (node instanceof Array) {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, node);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n }\n return node;\n }\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n // Remove unary SUBs\n node = negate(node.args[0]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n var arg = simplify(options, node.args[0]);\n var cp = constantPart(arg);\n var vp = variablePart(arg);\n var ep;\n if (vp && vp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && vp.args.length === 2) {\n ep = vp.args[1];\n vp = vp.args[0];\n }\n if (vp && sign(vp) < 0) {\n // If the variable part has a negative sign, then invert it.\n // Make sure we simplify before continuing to avoid thrashing.\n vp = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [simplify(options, expand(options, negate(vp)))]);\n } else {\n vp = vp ? unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [vp]) : nodeOne;\n }\n if (ep) {\n vp = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [vp, ep]);\n }\n\n if (isOne(cp) || isMinusOne(cp)) {\n node = vp;\n } else if (isNeg(options, cp)) {\n // If the expression is negative, move inverse of constant part\n // outside of the \\abs.\n node = multiplyNode([\n // Make sure we simplify before continuing to avoid thrashing.\n simplify(options, expand(options, negate(cp))),\n vp,\n ]);\n } else {\n // If positive, move constant part outside of the \\abs.\n node = multiplyNode([\n cp,\n vp,\n ]);\n }\n // Otherwise already positive.\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n var mv = mathValue(options, node);\n if (mv !== null) {\n node = numberNode(options, mv);\n }\n // Otherwise, don't simplify.\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n default:\n node = unaryNode(node.op, args);\n }\n return node;\n },\n exponential: function (node) {\n var base = node.args[0];\n // Make a copy of and reverse args to work from right to left.\n var nid = ast.intern(node);\n var args = node.args.slice(0).reverse();\n var n0 = [simplify(options, args.shift(), env)];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(node.op, n0.pop(), n1));\n });\n if (n0.length === 1) {\n var n = n0[0];\n if (n.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM || isInteger(n) ||\n isInfinity(n) ||\n isUndefined(n)) {\n // If the result is not a number or is a whole number, then return it.\n node = n;\n } // Otherwise return the orginal expression.\n } else {\n if (isInfinity(n0[1]) && isNeg(options, n0[0])) {\n return nodeZero;\n }\n node = binaryNode(node.op, n0.reverse());\n }\n return node;\n function fold(op, expo, base) {\n var mv, node;\n var bmv = mathValue(options, base);\n var emv = mathValue(options, expo, {}, true);\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n if (isZero(bmv)) {\n // 0^x\n if (isNeg(options, emv)) {\n return [undefinedNode(newNode(op, [base, expo]))];\n } else {\n return [nodeZero];\n }\n } else if (isZero(emv)) {\n // x^0\n return [nodeOne]\n } else if (isOne(bmv)) {\n // 1^x\n return [nodeOne];\n } else if (isOne(emv)) {\n // x^1\n return [base];\n } else if (isImaginary(base) && emv !== null) {\n if (emv.modulo(bigFour).comparedTo(bigZero) === 0) {\n return [nodeOne];\n } else if (emv.modulo(bigTwo).comparedTo(bigZero) === 0) {\n return [nodeMinusOne];\n } else if (emv.modulo(bigThree).comparedTo(bigZero) === 0) {\n return [negate(nodeImaginary)];\n } else if (emv.modulo(bigFive).comparedTo(bigZero) === 0) {\n return [nodeImaginary];\n }\n return [expo, base];\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // Flatten nested exponents.\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[0], multiplyNode(sortFactors([base.args[1], expo]))]);\n } else if (isMinusOne(base) && isOddFraction(expo)) {\n // Move the minus outside of the power unless its {-1}^{-1} which is a\n // synthetic idiom for negative coefficients.\n // Odd integers qualify as odd fractions. Key is that numerator\n // and denominator are both odd.\n if (isMinusOne(expo)) {\n return nodeMinusOne;\n } else {\n return multiplyNode([nodeMinusOne, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, sortFactors([negate(base), expo]))]);\n }\n } else if (!option(options, \"dontExpandPowers\") && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Expand factors.\n var args = [];\n let hasMinusOne = false;\n base.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // Flatten.\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n.args[0], multiplyNode(sortFactors([n.args[1], expo]))]));\n } else if (isMinusOne(n) && isMinusOne(expo)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n, expo]));\n }\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n return multiplyNode(args, true);\n } else if (bmv !== null && emv !== null && !isNeg(options, bmv)) {\n // 2^3, 16^(-1*1^-2)\n var b = pow(bmv, emv)\n base = numberNode(options, b);\n return base;\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG &&\n ast.intern(base) === ast.intern(expo.args[0])) {\n return expo.args[1];\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH && ast.intern(expo) === ast.intern(nodeTwo)) {\n // sinh^2 = cosh^2 - 1\n return addNode([binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args), nodeTwo]), nodeMinusOne]);\n } else {\n var b = pow(bmv, emv);\n if (b !== null) {\n return numberNode(options, b);\n }\n }\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n if (emv !== null && isE(base)) {\n var mv = toDecimal(Math.log(toNumber(emv)));\n if (isInteger(mv)) {\n return numberNode(options, mv);\n }\n } else if (ast.intern(base) === ast.intern(expo)) {\n return nodeOne;\n } else if (!option(options, \"dontExpandPowers\") && !isE(base)) {\n // If LOG and not base e, then normalize to base e.\n // var base = node.args[0];\n // var expo = node.args[1];\n return multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [nodeE, expo]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [nodeE, base]),\n nodeMinusOne\n ])\n ]);\n }\n }\n // x^2, x^y\n return [expo, base];\n }\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Internal error.\");\n if (isZero(args[1])) {\n var mv = mathValue(options, args[0], true);\n if (mv !== null) {\n // If its a number, then we're done.\n return newNode(node.op, args);\n }\n var ff = factors(options, args[0], {}, true, true, true);\n var erasedMinus = false;\n if (isMinusOne(ff[0])) {\n // Drop the leading negative one.\n ff.shift();\n erasedMinus = true;\n }\n var args0 = [];\n var foundZero = false;\n ff.forEach(function (n) {\n var mv = mathValue(options, n, true);\n if (erasedMinus && isInequality(node.op) ||\n mv !== null && !isZero(mv) && ff.length > 1 ||\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && units(n).length > 0 && ff.length > 1 || // $, cm, s^2\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && units(n.args[0]).length > 0 && mathValue(options, n.args[0]) !== null && ff.length > 1 || // $, cm, s^2\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, n.args[1])) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX /*&& isNeg(options, n)*/) {\n // We are erasing a negative so multiply by -1 to preserve inequality.\n if (args0.length > 0) {\n args0.push(expand(options, negate(args0.pop())));\n } else if (ff.length === 1) {\n args0.push(expand(options, negate(n)));\n }\n }\n // Ignore constant factors including units, unless they are alone.\n } else if (isZero(mv)) {\n // Result is zero.\n args0 = [nodeZero];\n foundZero = true;\n } else {\n args0 = args0.concat(n);\n }\n });\n if (args0.length > 0) {\n // Multiply the remaining numerator terms.\n args[0] = multiplyNode(args0);\n } else {\n // LHS has no more terms, so is zero.\n args[0] = nodeZero;\n }\n }\n return newNode(node.op, args);\n }\n }), root.location);\n // simplifyLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"simplify() nid=\" + nid);\n // if (nid === 175 || nid === 178) {\n // console.log(\"simplify() node=\" + JSON.stringify(node, null, 2));\n // }\n node = simplify(options, node, env);\n }\n node.simplifyNid = nid;\n // simplifiedNodes[rootNid] = node;\n return node;\n }\n\n function sign(node) {\n var s = 0;\n var tt = terms(node);\n tt.forEach(function (n) {\n var mv = mathValue(options, n);\n if (isNeg(options, leadingCoeff(n))) {\n s -= 1;\n } else {\n s += 1;\n }\n });\n if (s === 0) {\n if (isNeg(options, (leadingCoeff(tt[0])))) {\n s = -1;\n } else {\n s = 1;\n }\n }\n return s;\n }\n\n function base(node) {\n // Return the base if it is a number.\n var op = node.op;\n var base = op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW\n ? mathValue(options, node.args[0])\n : mathValue(options, node);\n return base;\n }\n\n function exponent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? toNumber(mathValue(options, node.args[1], {}, true)) : 1;\n }\n\n function log(b, x) {\n return Math.log(x) / Math.log(b);\n }\n\n // Return the math value of an expression, or null if the expression does\n // not have a math value.\n\n let mathValueLevel = 0;\n function mathValue(options, root, env, allowDecimal, normalizeUnits) {\n if (!root || !root.args) {\n return null;\n }\n// assert(root && root.args, \"2000: Internal error.\");\n if (env === undefined) {\n env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n } else if (typeof env === \"boolean\") {\n normalizeUnits = allowDecimal;\n allowDecimal = env;\n env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n }\n mathValueLevel++;\n let node = visit(options, root, {\n name: \"mathValue\",\n numeric: function (node) {\n if (isUndefined(node)) {\n return null;\n }\n return toDecimal(node.args[0]);\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM || isRepeating(node)) {\n return null;\n }\n // Simplify each side.\n var val = bigZero;\n node.args.forEach(function (n) {\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (mv && val) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n val = val.minus(mv);\n } else {\n val = val.plus(mv);\n }\n } else {\n val = null;\n }\n });\n if (allowDecimal || isInteger(val)) {\n return val;\n } else {\n return null;\n }\n },\n multiplicative: function (node) {\n // Allow decimal if the option 'allowDecimal' is set to true or\n // if at least one of the operands is a decimal.\n // (1+1/10)^3 --> 11^3*10^{-3} --> (11/10)^3\n var val = bigOne;\n var hasDecimal = false;\n node.args.forEach(function (n) {\n hasDecimal = hasDecimal || isDecimal(n);\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (val !== null && mv != null) {\n val = val.times(mv);\n } else {\n val = null;\n }\n });\n if (allowDecimal || isInteger(val) ||\n hasDecimal && option(options, \"doingSimplified\")) {\n // The last alternative is a secret handshake that says we are in\n // isSimplified so mutliply decimals.\n return val;\n }\n return null;\n },\n unary: function(node) {\n if (isGrouping(options, node, mathValueLevel)) {\n return mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n }\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n var val = mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n if (val === null) {\n return null;\n }\n return val.times(bigMinusOne);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var n = mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n if (n) {\n return toDecimal(factorial(n));\n } else {\n return null;\n }\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n var args = [];\n // M.args[0] -> ADD.args\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n node.args[0].args.forEach(function (n) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR, \"2000: Invalid arguments to the \\M tag\");\n var sym = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[n.args[0]];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(sym && sym.mass, \"2000: Missing chemical symbol\");\n var count = n.args[1] ? toNumber(mathValue(options, n.args[1], env, allowDecimal, normalizeUnits)) : 1;\n args.push(numberNode(options, sym.mass * count));\n });\n } else {\n // Just have one VAR node.\n var n = node.args[0];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR, \"2000: Invalid arguments to the \\M tag\");\n var sym = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[n.args[0]];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(sym && sym.mass, \"2000: Missing chemical symbol\");\n var count = n.args[1] ? toNumber(mathValue(options, n.args[1], env, allowDecimal, normalizeUnits)) : 1;\n args.push(numberNode(options, sym.mass * count));\n }\n return mathValue(options, makeTerm(args), env, allowDecimal, normalizeUnits);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n return abs(mathValue(options, node.args[0], env, allowDecimal, normalizeUnits));\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n if (allowDecimal) {\n var val;\n if (isPositiveInfinity(node.args[0])) {\n val = Number.POSITIVE_INFINITY;\n } else if (isNegativeInfinity(node.args[0])) {\n val = Number.NEGATIVE_INFINITY;\n } else {\n val = mathValue(options, toRadians(node.args[0]), env, allowDecimal, normalizeUnits);\n }\n return trig(val, node.op);\n }\n return null;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n return mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n return mathValue(options, toRadians(node.args[0]), env, allowDecimal, normalizeUnits);\n default:\n return null;\n }\n },\n exponential: function (node) {\n // Allow decimal if the option 'allowDecimal' is set to true or\n // if at least one of the operands is a decimal.\n var args = node.args.slice(0).reverse();\n var val = mathValue(options, args.shift(), env, allowDecimal, normalizeUnits);\n var op = node.op;\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n args.forEach(function (n) {\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (val !== null && mv != null) {\n val = pow(mv, val);\n } else {\n val = null;\n }\n });\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 1, \"2000: Internal error.\");\n var mv;\n var emv = val;\n var base = args[0];\n var bmv = mathValue(options, base, true, normalizeUnits);\n if (emv !== null) {\n if (bmv !== null) {\n val = logBase(bmv, emv);\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && base.args[0] === \"e\") {\n val = toDecimal(Math.log(toNumber(emv)));\n }\n }\n }\n if (allowDecimal || isInteger(val)) {\n return val;\n }\n return null;\n },\n variable: function(node) {\n var val, n;\n if ((val = env[node.args[0]]) &&\n (val.type === \"const\" || val.type === \"unit\" && normalizeUnits)) {\n n = val.value;\n }\n if (n && (allowDecimal || isInteger(n))) {\n return toDecimal(n);\n }\n return null;\n },\n comma: function(node) {\n return null;\n },\n equals: function(node) {\n return null;\n }\n });\n mathValueLevel--;\n return node;\n function exponent(node) {\n // FIXME this is brittle. need way to handle general exponents\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? +node.args[1].args[0] : 1;\n }\n }\n function getUnique(list) {\n var u = {}, a = [];\n for(var i = 0, l = list.length; i < l; ++i){\n if(u.hasOwnProperty(list[i])) {\n continue;\n }\n a.push(list[i]);\n u[list[i]] = 1;\n }\n return a;\n }\n // Get the list of units used in an expression.\n function units(root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"units\",\n exponential: function (node) {\n var uu = units(node.args[0], env);\n if (uu.length > 0) {\n return [node];\n }\n return [];\n },\n multiplicative: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n additive: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n unary: function(node) {\n return [];\n },\n numeric: function(node) {\n return [];\n },\n variable: function(node) {\n var val, env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n if (env && (val = env[node.args[0]])) {\n if (val.type === \"unit\") {\n return [node];\n }\n }\n return [];\n },\n comma: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n equals: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n }\n });\n }\n\n function multiplyMatrix(lnode, rnode) {\n var snode, mnode;\n // Scalar * Matrix\n if (lnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyScalarAndMatrix(lnode, rnode);\n } else if (rnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyScalarAndMatrix(rnode, lnode);\n }\n // Matrix * Matrix\n var rowArgs = [];\n var rows = lnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = rnode.args[0].args[0].args; // Use cols in first row as reference.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(rows.length === cols.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n cols.forEach(function (col, n) {\n col = getMatrixCol(rnode, n); // Get actual column.\n colArgs.push(multiplyVectors(row.args, col));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function addMatrix(lnode, rnode) {\n var snode, mnode;\n // Scalar + Matrix\n if (lnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addScalarAndMatrix(lnode, rnode);\n } else if (rnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addScalarAndMatrix(rnode, lnode);\n }\n // Matrix + Matrix\n var rowArgs = [];\n var lrows = lnode.args[0].args;\n lrows.forEach(function (lrow, i) {\n var colArgs = [];\n var rrows = rnode.args[0].args; // Use cols in first row as reference.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lrows.length === rrows.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n var rrow = rrows[i];\n colArgs = addVectors(lrow.args, rrow.args);\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function getMatrixCol(mnode, n) {\n var vec = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var cols = row.args;\n vec.push(cols[n]);\n });\n return vec;\n }\n\n function addVectors(v1, v2) {\n // v1, v2 : Array of nodes\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(v1.length === v2.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n var args = [];\n v1.forEach(function (n1, i) {\n var n2 = v2[i];\n args.push(addNode([n1, n2]));\n });\n return args;\n }\n\n function multiplyVectors(v1, v2) {\n // v1, v2 : Array of nodes\n var args = [];\n v1.forEach(function (n1, i) {\n var n2 = v2[i];\n args.push(multiplyNode([n1, n2]));\n });\n return addNode(args);\n }\n\n function multiplyScalarAndMatrix(snode, mnode) {\n // For each row, for each column.\n var rowArgs = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = row.args;\n cols.forEach(function (col) {\n colArgs.push(multiplyNode([snode, col]));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function addScalarAndMatrix(snode, mnode) {\n // For each row, for each column.\n var rowArgs = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = row.args;\n cols.forEach(function (col) {\n colArgs.push(addNode([snode, col]));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function sortFactors(args) {\n let argsNew = [];\n let hasMinusOne = false;\n args.forEach(arg => {\n if (isMinusOne(arg)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(arg)) { // Erase one.\n argsNew.push(arg);\n }\n });\n let node;\n if (argsNew.length > 1) {\n // If we have multiple args, then sort them.\n let node = sort(multiplyNode(argsNew, true));\n args = node.args;\n } else {\n args = argsNew;\n }\n if (hasMinusOne) {\n args = negateFactors(args);\n }\n return args;\n }\n\n function multiplyTerms(lterms, rterms, expo) {\n var args = [];\n lterms.forEach(function (n0) {\n rterms.forEach(function (n1) {\n // Multiply the terms.\n var args1 = [];\n if (n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n args1 = args1.concat(n0.args);\n } else {\n args1.push(n0);\n }\n if (n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n args1 = args1.concat(n1.args);\n } else {\n args1.push(n1);\n }\n args1 = sortFactors(args1);\n args.push(multiplyNode(args1, true));\n });\n });\n var node = sort(addNode(args));\n if (expo !== undefined) {\n // Reapply the power.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node, numberNode(options, expo.toString())]);\n }\n return [node];\n }\n\n let expandedNodes = [];\n let expandLevel = 0;\n function expand(options, root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.expandNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = expandedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n // if (expandLevel === 0) {\n // console.log(\"expand() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n expandLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"expand\",\n numeric: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(typeof node.args[0] === \"string\", \"2000: Internal error.\");\n return node;\n },\n additive: function (node) {\n var nid = ast.intern(node);\n var isMixedNumber = node.isMixedNumber;\n var args = node.args.slice(0); // Make copy.\n var n0 = [expand(options, args.shift())];\n args.forEach(function (n1) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n node = n0[0];\n } else {\n node = binaryNode(node.op, n0);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || option(options, \"normalizeArithmetic\")) {\n // Nothing more to do here.\n }\n node = cancelTerms(node, \"expand\");\n node.isMixedNumber = isMixedNumber;\n return node;\n function unfold(lnode, rnode) {\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addMatrix(lnode, rnode);\n }\n return [lnode, rnode];\n }\n },\n multiplicative: function (node) {\n var nid = ast.intern(node);\n var args = node.args.slice(0); // Make copy.\n var n0 = [expand(options, args.shift())];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(n0.pop(), n1));\n });\n args = n0;\n var isNeg = false;\n n0 = [];\n var normalizeArithmetic =\n option(options, \"normalizeArithmetic\") &&\n args.length > 1;\n args.forEach(function (n, i) {\n if (isOne(n)) {\n // Erase.\n } else if (isMinusOne(n)) {\n isNeg = !isNeg;\n } else {\n n0.push(n);\n }\n });\n if (isNeg) {\n // Put back one minus one.\n if (n0.length === 0) {\n n0.unshift(nodeMinusOne);\n } else {\n n0.unshift(negate(n0.shift()));\n }\n }\n if (n0.length === 0) {\n node = nodeOne;\n } else if (n0.length === 1) {\n node = n0[0];\n } else {\n node = multiplyNode(n0, true);\n }\n return node;\n function unfold(lnode, rnode) {\n // FIXME if the bases are additive and the expo are the same power,\n // then expand the base and reapply the power.\n var expo, lterms, rterms;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyMatrix(lnode, rnode);\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n exponent(lnode) === exponent(rnode)) {\n lterms = terms(lnode.args[0]);\n rterms = terms(rnode.args[0]);\n expo = exponent(lnode);\n } else {\n lterms = terms(lnode);\n rterms = terms(rnode);\n }\n if (!normalizeArithmetic && lterms && rterms &&\n (!isAggregate(lnode) && lterms.length > 1 ||\n !isAggregate(rnode) && rterms.length > 1) &&\n lterms.length * rterms.length < 64) {\n // (x + 2)(x - 3)\n // Limit the number of terms to avoid runaway expansion.\n return multiplyTerms(lterms, rterms, expo);\n }\n var result = [];\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n result = result.concat(lnode.args);\n } else {\n result.push(lnode);\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n result = result.concat(rnode.args);\n } else {\n result.push(rnode);\n }\n return result;\n }\n },\n unary: function(node) {\n // assert(node && node.op !== Model.SQRT, \"2000: SQRT removed during parsing\");\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n var arg0 = expand(options, node.args[0]);\n if (arg0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var args = [];\n arg0.args.forEach(function (n) {\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [n]));\n });\n node = multiplyNode(args);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [arg0]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n node = multiplyNode([expand(options, node.args[0]), nodeMinusOne]);\n node.args[0] = expand(options, node.args[0]);\n break;\n default:\n var args = [];\n node.args.forEach(function (n) {\n args.push(expand(options, n));\n });\n node = unaryNode(node.op, args);\n break;\n }\n return node;\n },\n exponential: function (node) {\n // (xy)^z -> x^zy^z\n // Make a copy of and reverse args to work from right to left.\n var nid = ast.intern(node);\n var args = node.args.slice(0).reverse();\n var n0 = [expand(options, args.shift())];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(node.op, n0.pop(), n1));\n });\n var node2;\n if (n0.length < 2) {\n var n = n0[0];\n // If the result is not a number or is a whole number, then return it.\n node2 = n;\n } else {\n node2 = binaryNode(node.op, n0.reverse());\n }\n return node2;\n function unfold(op, expo, base) {\n var node;\n var dontExpandPowers = option(options, \"dontExpandPowers\");\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n var emv = mathValue(options, expo);\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n if (dontExpandPowers && (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR || base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM)) {\n return [expo, base];\n }\n if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && !(isNeg(options, base.args[1]) || isNeg(options, expo))) {\n // Flatten exponents unless base is a denom.\n expo = multiplyNode(base.args.slice(1).concat(expo));\n base = base.args[0];\n return [expo, base];\n }\n var ff = factors(options, base, null, false, true);\n if (ff.length === 0) {\n // No factors means we have a node with math value '1', so just\n // return it.\n return nodeOne;\n }\n var args = [];\n // Raise each factor to the expo power and then multiply them together.\n let hasMinusOne = false;\n ff.forEach(function (n) {\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // If additive, then multiply base raised to each term.\n // x^(y+z) -> x^y*x^z\n expo.args.forEach(function (e) {\n args.push(newNode(op, [n, e]));\n });\n } else if (isInteger(emv)) {\n // x^2 -> x*x\n var ea = Math.abs(toNumber(emv));\n var bmv;\n if (isZero(emv)) {\n args.push(nodeOne);\n } else if (!normalizeArithmetic && isNeg(options, (bmv = mathValue(options, n))) && !isNeg(options, emv)) {\n // We have a factor that has an integer math value, so just do the math.\n var mv = pow(bmv, emv);\n args.push(numberNode(options, mv));\n } else if (!normalizeArithmetic && (ea < 5 || ea < 10 && !isPolynomial(n)) && !dontExpandPowers) {\n // Expand if the base is additive, or exponent is an integer and\n // dontExpandPowers is false. We limit the power of the expansion\n // to avoid long running computations.\n var invert = isNeg(options, emv);\n for (var i = 0; i < ea; i++) {\n if (invert) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isMinusOne(n.args[1])) {\n // x^{-1}^{-1} -> x\n args.push(n.args[0]);\n } else if (isOne(n) && isMinusOne(emv)) {\n // 1^{-1} -> 1\n args.push(n);\n } else if (isMinusOne(n) && isMinusOne(emv)) {\n hasMinusOne = !hasMinusOne;\n } else {\n if (hasMinusOne) {\n n = negate(n);\n hasMinusOne = false;\n }\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n, nodeMinusOne]));\n }\n } else {\n args.push(n);\n }\n }\n } else if (isMinusOne(n) && isMinusOne(emv)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(newNode(op, [n, expo]));\n }\n } else {\n args.push(newNode(op, [n, expo]));\n }\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n hasMinusOne = false;\n }\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n var args = [];\n if (isMultiplicative(expo)) {\n // If log and multiplicative, then add log of each term.\n var aa = [];\n expo.args.forEach(function (e) {\n if (e.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n aa.push(multiplyNode([\n e.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e.args[0]])\n ]));\n } else {\n aa.push(newNode(op, [base, e]));\n }\n });\n args.push(addNode(aa));\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // log x^y -> y log x\n args.push(multiplyNode([\n expo.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo.args[0]])\n ]));\n } // Otherwise, do nothing.\n }\n // x^2, x^y\n if (args.length > 1) {\n return [multiplyNode(args)];\n } else if (args.length === 1) {\n return [args[0]];\n }\n return [expo, base];\n }\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(expand(options, n));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n // x/10+5=0 -> x+50=0\n // x/(y+1)+10=0 -> x+10(y+1) -> x+10y+10\n // x/y+2/z=0 -> xz+2y=0\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(expand(options, n));\n });\n // For each term, for each factor, if denom.\n return newNode(node.op, args);\n }\n }), root.location);\n expandLevel--;\n // If the node has changed, simplify again.\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"expand() nid=\" + nid);\n node = expand(options, node);\n }\n node.expandNid = nid;\n expandedNodes[rootNid] = node;\n return node;\n }\n\n function factors(options, root, env, ignorePrimeFactors, preserveNeg, factorAdditive) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"factors\",\n numeric: function (node) {\n if (ignorePrimeFactors || isInfinity(node)) {\n return [node];\n }\n var ff = [];\n let hasNeg = false;\n if (preserveNeg && isNeg(options, node)) {\n hasNeg = !hasNeg;\n }\n var absv = Math.abs(+node.args[0]);\n var pff = primeFactors(absv);\n if (pff.length === 0 && !isOne(absv)) {\n ff.push(numberNode(options, absv)); // e.g. 0.4\n } else {\n primeFactors(+node.args[0]).forEach(function (n) {\n ff.push(numberNode(options, n));\n });\n }\n if (hasNeg) {\n ff.unshift(nodeMinusOne);\n }\n return ff;\n },\n additive: function (node) {\n if (!factorAdditive) {\n // Actually, we have a repeating decimal. So no factors here.\n return [node];\n }\n node = factorQuadratic(node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return [node];\n }\n var args = node.args.slice(0); // Make a copy.\n var n0 = [multiplyNode(factors(options, args.shift(), {}, true, true))];\n // For each next value, pop last value and look for common factors with the next value.\n args.forEach(function (n1, i) {\n n1 = multiplyNode(factors(options, n1, {}, true, true));\n var n;\n if (commonFactors(options, (n = n0.pop()), n1).length > 0) {\n n0 = n0.concat(factorTerms(n, n1));\n } else {\n n0 = n0.concat([n, n1]);\n }\n });\n if (n0.length === 1 && n0[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return n0[0].args;\n }\n return [node];\n },\n multiplicative: function (node) {\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES:\n var ff = [];\n node.args.forEach(function (n) {\n ff = ff.concat(factors(options, n, env, ignorePrimeFactors, preserveNeg));\n });\n return ff;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Node not normalized\");\n break;\n }\n return [node];\n },\n unary: function(node) {\n return [node];\n },\n exponential: function (node) {\n if (option(options, \"dontExpandPowers\")) {\n return [node];\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var isDenom;\n if (isNeg(options, mathValue(options, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, node.args.slice(1)), true))) {\n // isNeg(options, ) doesn't handle powers so use mathValue(options, ) to help.\n isDenom = true;\n }\n var ff = [];\n var e = mathValue(options, node.args[1]);\n var ea = Math.abs(toNumber(e));\n if (ea < 5 || ea < 10 && !isPolynomial(node.args[0])) {\n // Limit complexity of polynomial expansion.\n var args = factors(options, node.args[0], {}, false, true, true);\n for (var j = 0; j < args.length; j++) {\n var f;\n if (isMinusOne(args[j])) {\n f = nodeMinusOne;\n } else {\n f = isDenom ? newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [args[j], nodeMinusOne]) : args[j];\n }\n for (var i = ea; i > 0; i--) {\n ff.push(f);\n }\n }\n return ff;\n } else {\n return [node];\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n return [node];\n }\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n return [node];\n },\n equals: function(node) {\n return [node];\n }\n });\n }\n\n function commonFactors(options, lnode, rnode) {\n var t1 = [lnode, rnode];\n var t;\n var t2 = [];\n // Factorise each term and intern its factors (giving each unqiue\n // sub-expression an id.\n t1.forEach(function (n) {\n t = factors(options, n, null, false, true);\n var ff = [];\n t.forEach(function (n) {\n ff.push(ast.intern(n));\n });\n t2.push(ff);\n });\n // Check to see if there are any common factors (ids).\n var intersect = t2.shift();\n t2.forEach(function (a) {\n intersect = intersect.filter(function (n) {\n var i = a.indexOf(n);\n if (i !== -1) {\n delete a[i]; // Erase matches.\n return true;\n }\n return false;\n });\n });\n return intersect;\n }\n\n function factorTerms(lnode, rnode) {\n // Eliminate the common factors from each term and sum the unique parts.\n var cfacts = commonFactors(options, lnode, rnode);\n var lfacts = factors(options, lnode, null, false, true);\n var rfacts = factors(options, rnode, null, false, true);\n var lfacts2 = [], rfacts2 = [];\n var cf = cfacts.slice(0);\n var i;\n lfacts.forEach(function (f) {\n if ((i = cf.indexOf(ast.intern(f))) === -1) {\n lfacts2.push(f);\n } else {\n delete cf[i]; // Erase the matched factor.\n }\n });\n var cf = cfacts.slice(0);\n rfacts.forEach(function (f) {\n if ((i = cf.indexOf(ast.intern(f))) === -1) {\n rfacts2.push(f);\n } else {\n delete cf[i]; // Erase the matched factor.\n }\n });\n var aa = [];\n aa = aa.concat(makeFactor(lfacts2));\n aa = aa.concat(makeFactor(rfacts2));\n var args = [];\n if (aa.length > 0) {\n args.push(makeTerm(aa));\n }\n cfacts.forEach(function (i) {\n args.push(ast.node(i));\n });\n let node = makeFactor(args);\n return node[0];\n }\n\n function makeFactor(args) {\n if (args.length === 0) {\n return [nodeOne]; // No factors, means times one.\n } else if (args.length === 1) {\n return args;\n }\n args = sortFactors(args);\n return [multiplyNode(args, true)];\n }\n\n function makeTerm(args) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length > 0, \"2000: Too few arguments in makeTerm()\");\n if (args.length === 1) {\n return args[0];\n }\n return addNode(args);\n }\n\n function isHyperbolicTangent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n isMinusOne(node.args[1].args[1]);\n }\n function isHyperbolicCotangent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n isMinusOne(node.args[1].args[1]);\n }\n function isHyperbolicSecant(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n isMinusOne(node.args[1]);\n }\n function isHyperbolicCosecant(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n isMinusOne(node.args[1]);\n }\n\n // Scale the numbers in an expression.\n function scale(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"scale\",\n exponential: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n if (isHyperbolicSecant(node)) {\n // sech(x) = 1/cosh(x) = 2/(e^x+e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = nodeTwo;\n var denom = addNode([epx, emx]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n } else if (isHyperbolicCosecant(node)) {\n // csch(x) = 1/sinh(x) = 2/(e^x-e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = nodeTwo;\n var denom = addNode([epx, negate(emx)]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n },\n multiplicative: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n if (isHyperbolicTangent(node)) {\n // tanh(x) = (e^x-e^-x)/(e^x+e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = addNode([epx, negate(emx)]);\n var denom = addNode([epx, emx]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n return node;\n } else if (isHyperbolicCotangent(node)) {\n // coth(x) = (e^x+e^-x)/(e^x-e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = addNode([epx, emx]);\n var denom = addNode([epx, negate(emx)]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n return node;\n }\n var args = [];\n var mv2;\n node.args.forEach(function (n, i) {\n if ((mv = mathValue(options, n, true))) {\n if (mv2 === undefined) {\n mv2 = mv;\n } else {\n mv2 = mv2.times(mv);\n }\n } else if (isEmptyNode(n)) {\n // Erase.\n } else {\n args.push(scale(options, n));\n }\n });\n var n;\n if (!isOne((n = numberNode(options, mv2, true)))) {\n args.unshift(n);\n }\n node = multiplyNode(args);\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n return node;\n },\n additive: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n var args = [];\n var mv2 = bigZero;\n node.args.forEach(function (n) {\n if ((mv = mathValue(options, addNode([numberNode(options, mv2), n]), true))) {\n // Accumulate a constant term.\n mv2 = mv;\n } else {\n args.push(scale(options, n));\n }\n });\n if (!isZero(mv2)) {\n args.unshift(numberNode(options, mv2, true));\n }\n if (args.length === 1) {\n node = args[0];\n } else {\n node = addNode(args);\n }\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n return node;\n },\n unary: function(node) {\n var mv;\n if ((mv = mathValue(options, node, true))) {\n return numberNode(options, mv, true);\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n var arg = args[0];\n node = addNode([\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n arg]), nodeTwo),\n fractionNode(negate(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n negate(arg)])), nodeTwo)\n ]);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n var arg = args[0];\n node = addNode([\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n arg]), nodeTwo),\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n negate(arg)]), nodeTwo),\n ]);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n break;\n default:\n node = newNode(node.op, args);\n break;\n }\n return node;\n },\n numeric: function(node) {\n if (isUndefined(node)) {\n return node;\n }\n return numberNode(options, node.args[0], true);\n },\n variable: function(node) {\n var val;\n if ((val = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]])) {\n if (val.type === \"unit\") {\n if (val.base === \"\\\\radian\") {\n // Strip radian units.\n node = numberNode(options, val.value);\n } else if (val.value !== 1) {\n // If value is not one, then convert to base units.\n node = multiplyNode([numberNode(options, val.value, true), variableNode(val.base)]);\n }\n } else if (val.type === \"const\") {\n node = numberNode(options, val.value, true);\n }\n }\n return node; // Nothing to do here.\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n var args = [];\n // If equality and LHS leading coefficient is negative, then multiply by -1\n var c, cc;\n if ((node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX) &&\n ((cc = isPolynomial(node.args[0])) && cc[cc.length-1] < 0 ||\n !cc && sign(node.args[0]) < 0)) {\n node.args[0] = simplify(options, expand(options, negate(node.args[0])));\n }\n if (isComparison(node.op)) {\n var lc, args = [];\n var lnode = node.args[0];\n if (isPolynomial(lnode) && isAdditive(lnode) && !isOne(abs(leadingCoeff(lnode)))) {\n // Normalize leading coefficient to one. Skip if already 1 or -1.\n lnode.args.forEach(function (n, i) {\n if (i === 0) {\n lc = constantPart(n);\n var vp = variablePart(n);\n if (vp) {\n args.push(vp);\n }\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lc, \"2000: Internal error.\");\n args.push(fractionNode(n, lc));\n }\n });\n // This is a bit of a hack, making a unary additive node to continue\n // in this block.\n node.args[0] = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD, [multiplyNode([lc, addNode(args)])]);\n }\n }\n args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function isExpanded(options, root) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].fn.isExpanded(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, root), options);\n }\n\n // Returns true if 'root' has no factors with coefficients in the integers.\n function isFactorised(options, root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"isFactorised\",\n numeric: function (node) {\n // We don't care about prime factors.\n return true;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return true;\n }\n var vars = variables(node);\n var coeffs, vals;\n var t1 = terms(normalize(options, node));\n var t;\n var t2 = [];\n // Factorise each term and intern its factors (giving each unqiue\n // sub-expression an id.\n t1.forEach(function (n) {\n t = factors(options, n);\n var ff = [];\n t.forEach(function (n) {\n ff.push(ast.intern(n));\n });\n t2.push(ff);\n });\n // Check to see if there are any common factors (ids). Start with the\n // factors of the first term.\n var intersect = t2.shift();\n t2.forEach(function (a) {\n intersect = intersect.filter(function (n) {\n return a.indexOf(n) != -1;\n });\n });\n // If so, then root is not factorised.\n if (intersect.length > 0) {\n return false;\n }\n // If not, check to see if there are any integer solutions to the\n // quadratic equation.\n if ((coeffs = isPolynomial(node)) && coeffs.length < 3) {\n return true; // 0 or 1 degree equations that get here are factored.\n } else if (coeffs !== null && variables(node).length === 1) {\n if (coeffs.length === 3) {\n return !solveQuadratic(options, coeffs[2], coeffs[1], coeffs[0]);\n }\n return !hasRoot(options, node, coeffs);\n } else if (t1.some(function (n) {\n var d = degree(n, true);\n if (d === Number.POSITIVE_INFINITY) {\n // x^y\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2003));\n return undefined;\n }\n })) {\n return true;\n } else if (t1.some(function (n) {\n var d = degree(n, true);\n if (d >= 0 && d < 2) {\n // x+y^2+xy\n return true;\n }\n })) {\n return true;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(vars.length < 2, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2001));\n // FIXME What other checks can we add here?\n return true;\n },\n multiplicative: function (node) {\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result; //&& !hasLikeFactors(node);\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: isFactorised(): node not normalized\");\n break;\n }\n return false;\n },\n unary: function(node) {\n return true;\n },\n exponential: function (node) {\n return true;\n },\n variable: function(node) {\n return true;\n },\n comma: function(node) {\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result;\n },\n equals: function(node) {\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result;\n }\n });\n }\n\n var primes = [\n 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,\n 71, 73, 79, 83, 89, 97\n ];\n\n // Table of values and their primality.\n var primesCache = {};\n primes.forEach(function (v) {\n primesCache[v] = true;\n });\n\n function findPossibleRoots(coeffs) {\n var c0 = coeffs[0]; // Zero degree.\n var c1 = coeffs[coeffs.length-1]; // Highest degree.\n // FIXME eliminate dups\n // FIXME sort by most likely roots\n var f0 = primeFactors(c0);\n var f1 = primeFactors(c1);\n f0.push(1);\n f0.push(c0);\n f1.push(1);\n f1.push(c1);\n var possibleRoots = [];\n f0.forEach(function (n) {\n var n0 = numberNode(options, n);\n var n1 = negate(numberNode(options, n));\n f1.forEach(function (d) {\n var d = numberNode(options, d);\n possibleRoots.push(fractionNode(n0, d));\n possibleRoots.push(fractionNode(n1, d));\n });\n });\n return possibleRoots;\n }\n\n function hasRoot(options, node, coeffs) {\n var rr = findPossibleRoots(coeffs);\n var field = option(options, \"field\");\n return rr.some(function (r) {\n r = toNumber(mathValue(options, r, true));\n var nn = variables(node);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(nn.length === 1, \"2000: Internal error.\");\n var env = {};\n env[nn[0]] = {\n type: \"const\",\n value: r\n };\n // Evalutate expression for each possible root.\n var x = toNumber(mathValue(options, node, env, true));\n return x === 0 &&\n (field === \"integer\" && r === (r | 0) ||\n field === \"real\"); // FIXME document that this actually only works for rational, not all reals\n });\n }\n\n function solveQuadratic(options, a, b, c) {\n a = toNumber(a); // FIXME do math in BD\n b = toNumber(b);\n c = toNumber(c);\n var x0 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);\n var x1 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);\n var opt = option(options, \"field\");\n var hasSolution =\n opt === \"integer\" && ((x0 === (x0 | 0)) && (x1 === (x1 | 0))) ||\n opt === \"real\" && (b * b - 4 * a * c) >= 0 ||\n opt === \"complex\"; // Redundant, but okay.\n if (hasSolution) {\n return [x0, x1]; //[new Decimal(x0.toString()), new Decimal(x1.toString())];\n }\n return null;\n }\n function primeFactors(n) { // n : Number\n var absN = Math.abs(n);\n if (absN <= 1 || isNaN(n) || isInfinity(n) || isImaginary(n)) {\n return [];\n } else if (isPrime(absN)) {\n return [absN];\n }\n var maxf = Math.sqrt(absN);\n for (var f = 2; f <= maxf; f++) {\n if (n % f === 0) {\n return primeFactors(f).concat(primeFactors(absN / f));\n }\n }\n }\n function isPrime(n) {\n if (primesCache[n] !== void 0) {\n return primesCache[n];\n }\n if (n <= 1) {\n primesCache[n] = false;\n return false;\n } else {\n if (n <= 1 || n > 2 && n % 2 === 0) {\n return primesCache[n] = false;\n } else {\n for (var i = 3, sqrt = Math.sqrt(n); i <= sqrt; i += 2) {\n if (n % i === 0) {\n return primesCache[n] = false;\n }\n }\n }\n return primesCache[n] = true;\n }\n }\n\n function gcd(a, b) {\n if (arguments.length > 2) {\n var rest = [].slice.call(arguments, 1);\n return gcd(a, gcd.apply(rest));\n } else {\n var mod;\n a = Math.abs(a);\n b = Math.abs(b);\n while (b) {\n mod = a % b;\n a = b;\n b = mod;\n }\n return a;\n }\n }\n\n function lcm(a, b) {\n if (arguments.length > 2) {\n var rest = [].slice.call(arguments, 1);\n return lcm(a, lcm.apply(rest));\n } else {\n return Math.abs(a * b) / gcd(a, b);\n }\n }\n\n // Visitor exports\n this.normalize = normalize;\n this.normalizeSympy = normalizeSympy;\n this.normalizeExpanded = normalizeExpanded;\n this.normalizeLiteral = normalizeLiteral;\n this.normalizeSyntax = normalizeSyntax;\n this.normalizeCalculate = normalizeCalculate;\n this.degree = degree;\n this.constantPart = constantPart;\n this.variables = variables;\n this.variablePart = variablePart;\n this.sort = sort;\n this.sortLiteral = sortLiteral;\n this.simplify = simplify;\n this.formatMath = formatMath;\n this.expand = expand;\n this.terms = terms;\n this.subexprs = subexprs;\n this.factors = factors;\n this.isFactorised = isFactorised;\n this.isExpanded = isExpanded;\n this.mathValue = mathValue;\n this.units = units;\n this.scale = scale;\n this.hasLikeFactors = hasLikeFactors;\n this.hasLikeFactorsOrTerms = hasLikeFactorsOrTerms;\n this.factorGroupingKey = factorGroupingKey;\n this.hint = hint;\n this.eraseCommonExpressions = eraseCommonExpressions;\n this.crossMultiply = crossMultiply;\n }", "title": "" }, { "docid": "47e26ca830d0892e0878d70166d68a64", "score": "0.4817801", "text": "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "title": "" }, { "docid": "47e26ca830d0892e0878d70166d68a64", "score": "0.4817801", "text": "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "title": "" }, { "docid": "56e7104b50711e42bec014c1a41d9494", "score": "0.48170775", "text": "function _processNode<ParentValue, LeafValue, Node, Children>(\n NodeView: SearchableNodeView<ParentValue, LeafValue, Node, Children>,\n searchResults: SearchResults<ParentValue, LeafValue>,\n matcher: StringMatcher,\n node: Node,\n): void {\n if (node === undefined || node === null) {\n return;\n }\n\n const value = NodeView.value(node);\n const {\n leavesThatMatchSearch,\n parentsThatMatchSearch,\n parentsWithChildrenThatMatchSearch,\n } = searchResults;\n\n const matchedSearch = _doesNodeMatchSearch(NodeView, node, matcher);\n\n if (NodeView.isLeaf(node) && matchedSearch) {\n leavesThatMatchSearch.add(((value: $Cast): LeafValue));\n } else if (matchedSearch) {\n parentsThatMatchSearch.add(((value: $Cast): ParentValue));\n } else {\n // if this group did not match the search, maybe one of its\n // children did?\n const doesAChildPassSearch = _doNodeChildrenMatchSearch(\n NodeView,\n matcher,\n node,\n );\n if (doesAChildPassSearch) {\n parentsWithChildrenThatMatchSearch.add(((value: $Cast): ParentValue));\n }\n }\n}", "title": "" }, { "docid": "8c9b93522b0258122807398a131fb524", "score": "0.4805091", "text": "function parseValueLiteral(parser, isConst) {\n var token = parser.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(parser, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(parser, isConst);\n case _lexer.TokenKind.INT:\n advance(parser);\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(parser, token.start)\n };\n case _lexer.TokenKind.FLOAT:\n advance(parser);\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(parser, token.start)\n };\n case _lexer.TokenKind.STRING:\n advance(parser);\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(parser, token.start)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n advance(parser);\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(parser, token.start)\n };\n } else if (token.value !== 'null') {\n advance(parser);\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(parser, token.start)\n };\n }\n break;\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(parser);\n }\n break;\n }\n throw unexpected(parser);\n}", "title": "" }, { "docid": "96d1e71522a8aa97f7d7f58df93bb761", "score": "0.48018986", "text": "function valueEval(expr, cont) {\n eval_count++;\n expr = \"eval(\" + JSON.stringify(expr) + \")\";\n var vname = \"__eval$\" + eval_count;\n var e = \"var \" + vname + \" = \" + expr + \"; if (\" + vname + \" instanceof Buffer) \" + vname + \"=String(\" + vname + \"); \" + vname;\n conn.command(\"evaluate\", {expression:e, global: true}, function (resp) {\n if (!resp.body) {\n cont({result:{result:{type:\"error\", description: resp.message}}});\n return;\n }\n var ctx = {};\n ctx[resp.body.handle] = resp.body;\n resp.refs.forEach(function (r) { ctx[r.handle] = r; });\n cont({result:{result:valueFromHandle(ctx, resp.body, vname)}});\n });\n}", "title": "" }, { "docid": "edc05cead3721f8f731037174c1e3d11", "score": "0.47989526", "text": "function revalue(node, depth) {\n var children = node.children,\n v = 0;\n if (children && (n = children.length)) {\n var i = -1,\n n,\n j = depth + 1;\n while (++i < n) v += revalue(children[i], j);\n } else if (value) {\n v = +value.call(hierarchy, node, depth) || 0;\n }\n if (value) node.value = v;\n return v;\n }", "title": "" }, { "docid": "4c64bf7e1b4a3dfa9e920f12ec382de8", "score": "0.4790636", "text": "function extract(value){// Value will not have the expression property when we recurse.\nvar expression=value.expression||value;var type=expression.type;if(TYPES[type]===undefined){throw new Error(errorMessage(type));}return TYPES[type](expression);}", "title": "" }, { "docid": "b3f47c9330c55648ee61036edf917864", "score": "0.47805128", "text": "sumValues() {\n if(!this.root) return 0\n\n let toVisitStack = [this.root]\n let total = 0\n\n while (toVisitStack.length) {\n let current = toVisitStack.pop()\n\n total += current.val\n\n for (let child of current.children) toVisitStack.push(child)\n }\n\n return total\n }", "title": "" }, { "docid": "7f104aad48f29a23a3df5d39e854eebe", "score": "0.4774072", "text": "visitReportGroupValueClause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b08b0b45796bfd813f5442c177e2157f", "score": "0.4760609", "text": "parseFunctionExpression (node) {}", "title": "" }, { "docid": "db4f0777c61fd393ace93a57e175ba8f", "score": "0.47562373", "text": "enterValue(ctx) {\n\t}", "title": "" }, { "docid": "83febbbb6806ac57d983f9d566264252", "score": "0.475532", "text": "parseExp1() {\n const expected = 'ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | ('\n const treeNodeExp1 = new TreeNode()\n\n /* FIRST(Exp2) */\n if (\n this.isToken(TOKEN.ID) ||\n this.isToken(TOKEN.CONST_INT) ||\n this.isToken(TOKEN.CONST_DBL) ||\n this.isToken(TOKEN.CONST_STR) ||\n this.isToken(TOKEN.KW_TRUE) ||\n this.isToken(TOKEN.KW_FALSE) ||\n this.isToken(TOKEN.OP_NGT) ||\n this.isToken(TOKEN.OP_NOT) ||\n this.isToken(TOKEN.OPN_RND_BRACKET)\n ) {\n const treeNodeExp2 = this.parseExp2()\n const treeNodeExp1Linha = this.parseExp1Linha()\n\n /* Semantic phase check */\n if (treeNodeExp1Linha.getType() === TYPE.void)\n treeNodeExp1.setType(treeNodeExp2.getType())\n\n else if (\n treeNodeExp2.getType() === treeNodeExp1Linha.getType() &&\n treeNodeExp2.getType() === TYPE.numerical\n ) {\n treeNodeExp1.setType(TYPE.bool)\n }\n\n else\n treeNodeExp1.setType(TYPE.error)\n\n return treeNodeExp1\n }\n\n else {\n /* Synch: Exp1 */\n /* FOLLOW(Exp1) */\n if (\n this.isToken(TOKEN.KW_OR) ||\n this.isToken(TOKEN.KW_AND) ||\n this.isToken(TOKEN.CLS_RND_BRACKET) ||\n this.isToken(TOKEN.SEMI_COLON) ||\n this.isToken(TOKEN.COMMA)\n ) {\n this.printError(expected)\n return treeNodeExp1\n }\n\n /* Skip: Panic mode */\n else {\n this.skip(expected)\n if (!this.isToken(TOKEN.EOF))\n return this.parseExp1()\n }\n }\n }", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.47540474", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.47540474", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.47540474", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "a3b7b7f6e90b332643209c4919661028", "score": "0.47415033", "text": "function getValue(n, v, t){\n\tif (!v)\n\t\treturn null;\n\t\n\tif (n in this.parser){\n\t\treturn this.parser[n](n, v, t);\n\t}\n\treturn v;\n}", "title": "" }, { "docid": "0570e156ae07cbf8df255b69968625bd", "score": "0.47346014", "text": "function processExpression() {\n if (output[i] == -1) { // -1: FUNCTION_START\n var fragment = processFunction();\n if (fragment === undefined) {\n return\n }\n return fragment;\n }\n else if (output[i] == -4) { // -4: Simple value\n i=i+2;\n return output[i-1];\n }\n else {\n// console.log('Unexpected token. Expected FUNCTION_START or SIMPLE_VALUE. Got: ' + output[i] + '. exiting');\n return;\n }\n }", "title": "" }, { "docid": "80d33ba8d5db697275c0c62dacaa57b7", "score": "0.4734026", "text": "parseExp3() {\n const node = new TreeNode()\n\n /* FIRST(Exp4) */\n if (\n this.isToken(TOKEN.ID) ||\n this.isToken(TOKEN.CONST_INT) ||\n this.isToken(TOKEN.CONST_DBL) ||\n this.isToken(TOKEN.CONST_STR) ||\n this.isToken(TOKEN.KW_TRUE) ||\n this.isToken(TOKEN.KW_FALSE) ||\n this.isToken(TOKEN.OP_NGT) ||\n this.isToken(TOKEN.OP_NOT) ||\n this.isToken(TOKEN.OPN_RND_BRACKET)\n ) {\n const nodeExp4 = this.parseExp4()\n const nodeExp3Linha = this.parseExp3Linha()\n\n /* Semantic phase check */\n if (nodeExp3Linha.getType() === TYPE.void)\n node.setType(nodeExp4.getType())\n\n else if (\n nodeExp4.getType() === nodeExp3Linha.getType() &&\n nodeExp3Linha.getType() === TYPE.numerical\n ) {\n node.setType(TYPE.numerical)\n }\n\n else\n node.setType(TYPE.error)\n\n return node\n }\n\n else {\n /* Synch: Exp3 */\n /* FOLLOW(Exp3) */\n if (\n this.isToken(TOKEN.OP_SUM) ||\n this.isToken(TOKEN.OP_SUB) ||\n this.isToken(TOKEN.OP_LT) ||\n this.isToken(TOKEN.OP_LTE) ||\n this.isToken(TOKEN.OP_GT) ||\n this.isToken(TOKEN.OP_GE) ||\n this.isToken(TOKEN.OP_EQ) ||\n this.isToken(TOKEN.OP_NE) ||\n this.isToken(TOKEN.KW_OR) ||\n this.isToken(TOKEN.KW_AND) ||\n this.isToken(TOKEN.CLS_RND_BRACKET) ||\n this.isToken(TOKEN.SEMI_COLON) ||\n this.isToken(TOKEN.COMMA)\n ) {\n this.printError('ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | (')\n return node\n }\n\n /* Skip: Panic mode */\n else {\n this.skip('ID | ConstInteger | ConstDouble | ConstString | true | false | - | ! | (')\n if (!this.isToken(TOKEN.EOF))\n return this.parseExp3()\n }\n }\n }", "title": "" }, { "docid": "d7a1b2ad98863a13b473f2395f96bb6e", "score": "0.47197944", "text": "visitEvaluateWhen(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "8bcf9e8f6dd011d79893eaea5c6b3595", "score": "0.4714181", "text": "function value(synode){\n var str = synode.symbol\n for(f of value_parsers){\n var res = f(str)\n if(res!==undefined){\n return res\n }\n }\n return synode\n}", "title": "" }, { "docid": "1ae4d47b07d3d12b4615e104cdbe117b", "score": "0.4709617", "text": "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n if (!variables || Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(variables[variableName])) {\n // No valid return value.\n return;\n }\n // Note: we're not doing any checking that this variable is correct. We're\n // assuming that this query has been validated and the variable usage here\n // is of the correct type.\n return variables[variableName];\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fields = Object(_jsutils_objectValues__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields());\n for (var _i = 0; _i < fields.length; _i++) {\n var field = fields[_i];\n var fieldNode = fieldNodes[field.name];\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (!Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(field.defaultValue)) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[field.name] = fieldValue;\n }\n return coercedObj;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isEnumType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM) {\n return; // Invalid: intentionally return no value.\n }\n var enumValue = type.getValue(valueNode.value);\n if (!enumValue) {\n return; // Invalid: intentionally return no value.\n }\n return enumValue.value;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_4__[\"isScalarType\"])(type)) {\n // Scalars fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result = void 0;\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(result)) {\n return; // Invalid: intentionally return no value.\n }\n return result;\n }\n\n /* istanbul ignore next */\n throw new Error('Unknown type: ' + type + '.');\n}", "title": "" }, { "docid": "173166eed0f4f34c51d48bbd65864b15", "score": "0.4707772", "text": "function parseValueLiteral(lexer, isConst) {\n\t var token = lexer.token;\n\t switch (token.kind) {\n\t case _lexer.TokenKind.BRACKET_L:\n\t return parseList(lexer, isConst);\n\t case _lexer.TokenKind.BRACE_L:\n\t return parseObject(lexer, isConst);\n\t case _lexer.TokenKind.INT:\n\t lexer.advance();\n\t return {\n\t kind: _kinds.INT,\n\t value: token.value,\n\t loc: loc(lexer, token)\n\t };\n\t case _lexer.TokenKind.FLOAT:\n\t lexer.advance();\n\t return {\n\t kind: _kinds.FLOAT,\n\t value: token.value,\n\t loc: loc(lexer, token)\n\t };\n\t case _lexer.TokenKind.STRING:\n\t lexer.advance();\n\t return {\n\t kind: _kinds.STRING,\n\t value: token.value,\n\t loc: loc(lexer, token)\n\t };\n\t case _lexer.TokenKind.NAME:\n\t if (token.value === 'true' || token.value === 'false') {\n\t lexer.advance();\n\t return {\n\t kind: _kinds.BOOLEAN,\n\t value: token.value === 'true',\n\t loc: loc(lexer, token)\n\t };\n\t } else if (token.value !== 'null') {\n\t lexer.advance();\n\t return {\n\t kind: _kinds.ENUM,\n\t value: token.value,\n\t loc: loc(lexer, token)\n\t };\n\t }\n\t break;\n\t case _lexer.TokenKind.DOLLAR:\n\t if (!isConst) {\n\t return parseVariable(lexer);\n\t }\n\t break;\n\t }\n\t throw unexpected(lexer);\n\t}", "title": "" }, { "docid": "c47caaf7c1ef4e68e82ccaad28c7f105", "score": "0.47051784", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "c2391fdce93a7266242595a7aa9b9784", "score": "0.47001633", "text": "function evaluate(node, context) {\n /* eslint-disable no-case-declarations */\n switch (node.type) {\n case NODE_TYPE.Array:\n const v1 = node.elements.map((n) => evaluate(n, context)[0]);\n if (v1.some(v => v === undefined))\n return EMPTY;\n return [v1, undefined];\n case NODE_TYPE.BinaryOp:\n const left = evaluate(node.left, context)[0];\n const right = evaluate(node.right, context)[0];\n if ('+-**/%'.includes(node.operator) && (left === undefined || right === undefined))\n return EMPTY;\n return [BINARY_OPS[node.operator](left, right), undefined];\n case NODE_TYPE.Call:\n // Note: we evaluate arguments even if fn is undefined.\n const [fn, self] = evaluate(node.callee, context);\n const args = node.args.map((n) => evaluate(n, context)[0]);\n if (args.some(v => v === undefined) || typeof fn !== 'function')\n return EMPTY;\n return [fn.apply(self, args), undefined];\n case NODE_TYPE.Conditional:\n // Note: we evaluate all possible options of the unary operator.\n const consequent = evaluate(node.consequent, context);\n const alternate = evaluate(node.alternate, context);\n return evaluate(node.test, context)[0] ? consequent : alternate;\n case NODE_TYPE.Identifier:\n return [context[node.name], undefined];\n case NODE_TYPE.Literal:\n return [node.value, undefined];\n case NODE_TYPE.Member:\n const object = evaluate(node.object, context)[0];\n const property = node.computed ? evaluate(node.property, context)[0] :\n node.property.name;\n return object ? [object[property], object] : [undefined, undefined];\n case NODE_TYPE.UnaryOp:\n const arg = evaluate(node.argument, context)[0];\n if (arg === undefined)\n return EMPTY;\n return [UNARY_OPS[node.operator](arg), undefined];\n }\n }", "title": "" }, { "docid": "269a2ab153860a282c485188fb9bdd4f", "score": "0.4698595", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "269a2ab153860a282c485188fb9bdd4f", "score": "0.4698595", "text": "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "9f89e351f768efb799f64eacc7c00d59", "score": "0.46959788", "text": "parseExp1Linha() {\n const treeNodeExp1Linha = new TreeNode()\n\n /*\n * Exp1Linha -> < Exp2 Exp1Linha | <= Exp2 Exp1Linha | > Exp2 Exp1Linha |\n * >= Exp2 Exp1Linha | == Exp2 Exp1Linha | != Exp2 Exp1Linha\n */\n if (\n this.match(TOKEN.OP_LT) ||\n this.match(TOKEN.OP_LTE) ||\n this.match(TOKEN.OP_GT) ||\n this.match(TOKEN.OP_GE) ||\n this.match(TOKEN.OP_EQ) ||\n this.match(TOKEN.OP_NE)\n ) {\n const treeNodeExp2 = this.parseExp2()\n const treeNodeExp1Linha2 = this.parseExp1Linha()\n\n /* Semantic phase check */\n if (\n treeNodeExp1Linha2.getType() === TYPE.void &&\n treeNodeExp2.getType() === TYPE.numerical\n ) {\n treeNodeExp1Linha.setType(TYPE.numerical)\n }\n\n else if (\n treeNodeExp1Linha2.getType() === treeNodeExp2.getType() &&\n treeNodeExp2.getType() === TYPE.numerical\n ) {\n treeNodeExp1Linha.setType(TYPE.numerical)\n }\n\n else\n treeNodeExp1Linha.setType(TYPE.error)\n\n return treeNodeExp1Linha\n }\n\n /* Exp1Linha -> epsilon */\n /* FOLLOW(Exp1Linha) */\n else if (\n this.isToken(TOKEN.KW_OR) ||\n this.isToken(TOKEN.KW_AND) ||\n this.isToken(TOKEN.CLS_RND_BRACKET) ||\n this.isToken(TOKEN.SEMI_COLON) ||\n this.isToken(TOKEN.COMMA)\n ) {\n treeNodeExp1Linha.setType(TYPE.void)\n return treeNodeExp1Linha\n }\n\n /* Skip: Panic mode */\n else {\n this.skip('< | <= | > | >= | == | != | or | and | ) | ; | ,')\n if (!this.isToken(TOKEN.EOF))\n return this.parseExp1Linha()\n }\n }", "title": "" } ]
0258a36b91697fa6c16e51083b7021a9
[POST] change Account Password
[ { "docid": "f7e2d6c51c0cf16a3980efbd38ae23d3", "score": "0.0", "text": "async processChangePassword(req,res,next){\n const formData = req.body;\n let email = formData.email;\n let checkResult = await userService.checkExistOfEmail(formData);\n let userInfo = await userService.getPassword(formData);\n let password = userInfo.password;\n if(checkResult==false){\n res.render('forgotPassword',{layout:'backend',notification:'wrongMessage'});\n\n }\n else{\n //hustFinalProject\n //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\n const sendgridApiKey = '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';\n let link = `http://localhost:3000/reset-password?valToken=${password}`\n sgMail.setApiKey(sendgridApiKey);\n let sendEmail = (email)=>\n {\n sgMail.send({\n to:email,\n from:'[email protected]',\n subject:'Hệ thống học trực tuyến_Xử lý quên mật khẩu',\n html: `<h4>Chúng tôi đã nhận được phản hồi quên mật khẩu của bạn </h4><p>Hãy click vào link sau để tiến hành reset mật khẩu</p><a href='http://localhost:3000/reset-password?valToken=${password}'>http://localhost:3000/reset-password</a>`\n })\n }\n sendEmail(email);\n\n //sendgrid using for password -- API Key\n res.render('confirmSendingEmail',{layout:'backend'});\n // onlineSchool\n }\n\n }", "title": "" } ]
[ { "docid": "81bc539abbb3f615724286bb465a976e", "score": "0.7691978", "text": "function changePassword() {\n if ( newPassword !== confirmedPassword ) {\n alert(t('changePasswordNotIdentical'));\n return;\n }\n axios.patch(process.env.REACT_APP_SERVER_URL + '/user/password', {\n company: getCompany(),\n username: getUsername(),\n token: getToken(),\n currentPassword: currentPassword,\n newPassword: newPassword\n }).then(function (response) {\n if ( response.status === 200 ) {\n alert(t('changePasswordSuccess'));\n navigate(\"/\")\n }\n }).catch(function (error) {\n alert(t('changePasswordError'));\n });\n }", "title": "" }, { "docid": "f8ba3173eff5c6d4b7c326b56ef9c1ae", "score": "0.7365049", "text": "async function changePassword(req, res) {\n const userId = req.user._id\n const {\n oldPassword,\n newPassword\n } = req.body\n}", "title": "" }, { "docid": "6dedf01b9d666f2b5f2f8de7a46ea59e", "score": "0.7334006", "text": "function changePassword(req, res) {\n // Mandatory Fields\n const { username } = req.params;\n const { oldPassword, newPassword } = req.body;\n if (!oldPassword || !newPassword){\n return res.status(401).json({ error: 'Password fields are blank' });\n }\n repo.changePassword(username, oldPassword, newPassword, (err, passwordMismatch) => {\n if(err){\n res.status(500).json({ error: \"Internal Server Error, try again\" })\n }\n else if(passwordMismatch)\n {\n res.status(401).json({ status: \"unauthorized\" });\n }\n else\n {\n res.status(200).json({ status: \"success\" });\n }\n })\n}", "title": "" }, { "docid": "084b222ec5f71114bf1e0b3100de4989", "score": "0.7317246", "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": "1500aeb1f5a92ecc842c534ea631da65", "score": "0.7315191", "text": "function changePassword(req, res) {\n // TODO check old password and store new password\n let reqOldPassword = req.body.oldPassword;\n let reqNewPassword = req.body.newPassword;\n if(user.password === reqOldPassword) {\n updateUser(reqNewPassword);\n res.status(200).end();\n } else\n res.status(401).end();\n }", "title": "" }, { "docid": "f10adef79fc45e030f716bba8d6c88df", "score": "0.7288403", "text": "function clickSubmitOnNewPasswordPage() {\n let token = getTokenFromUrl()\n let username = usernameField.value\n let newPassword = newPasswordField.value\n\n fetch('orch.prov.org/changePassword', { // orch -> change password\n body: JSON.stringify({token, username, newPassword}),\n method: 'POST'\n })\n}", "title": "" }, { "docid": "13efd5ef543b32cb129bd18c65d63629", "score": "0.7234042", "text": "function setPassword() {\n postPassword(\n success = function () {\n console.log('Password set');\n setPermissions();\n },\n error = null,\n email,\n password);\n }", "title": "" }, { "docid": "3916699b4eb8e58e2c5253176f8c9e23", "score": "0.7197946", "text": "function changePassword()\n\t{\n\t\tapp.linkToObject('loginChangePassword');\n\t}", "title": "" }, { "docid": "945e00ff17c53704ad9e5a94c74d74be", "score": "0.71400505", "text": "changeMyPassword(password) {\n return this.httpClient.put(environment.apiUrl + 'magic/modules/system/auth/change-password', {\n password,\n });\n }", "title": "" }, { "docid": "5a702f8f77ff560533af79a189646551", "score": "0.7042725", "text": "function changePasswordFn(newPassword) {\n var obj = {\n \"id\" : vm.data.id,\n \"newPassword\": newPassword\n };\n\n UserService\n .resetPassword(obj)\n .then(\n (res) => {\n var res = res.data;\n\n if (res.code === \"OK\" && res.data) {\n $scope.setFlash(\"s\", res.message);\n }\n else {\n $scope.setFlash(\"e\", res.message);\n }\n\n $(\"#password-strength-label\").text(\"\");\n $(\"#password-strength-label\").removeClass(\"p15 btn-rounded\");\n $(\".strength-meter-fill\").removeAttr(\"data-strength\");\n\n vm.passForm = {\"showPassword\": false};\n },\n (err) => {\n $(\"#password-strength-label\").text(\"\");\n $(\"#password-strength-label\").removeClass(\"p15 btn-rounded\");\n $(\".strength-meter-fill\").removeAttr(\"data-strength\");\n\n vm.passForm = {\"showPassword\": false};\n $scope.flashHttpErrorFn(err);\n });\n }", "title": "" }, { "docid": "3b5626f2ccde3e565d2856770995b477", "score": "0.7003549", "text": "changePassword(newPass){\n this.pass= newPass\n }", "title": "" }, { "docid": "fabf090cda701b8a8a573a238ccf085b", "score": "0.6997852", "text": "update() {\n Spark.put('/settings/password', this.form);\n }", "title": "" }, { "docid": "3c1c31bd127030e3b6b1a283c150df07", "score": "0.69779575", "text": "function changePassword() {\n\tvar ref = new Firebase(\"https://cse134bteam3-hw5.firebaseio.com\");\n\tref.changePassword({\n\t email: $(\"#currEmail\").val(),\n\t oldPassword: $(\"#oldEmailPass\").val(),\n\t newPassword: $(\"#newEmailPass\").val()\n\t}, function(error) {\n\t if (error) {\n\t\t switch (error.code) {\n\t\t case \"INVALID_PASSWORD\":\n\t\t alert(\"The specified user account password is incorrect.\");\n\t\t break;\n\t\t case \"INVALID_USER\":\n\t\t alert(\"The specified user account does not exist.\");\n\t\t break;\n\t\t default:\n\t\t alert(\"Error changing password:\", error);\n\t\t }\n\t \t} else {\n\t \talert(\"User password changed successfully!\");\n\t \t}\n\t});\n}", "title": "" }, { "docid": "36afa46a221bbc5d917b293bf7f7a680", "score": "0.6962617", "text": "function modifyPassword(req, res) {\n // Recovering user id from access token\n var token = req.headers[\"authorization\"].replace(\"Bearer \", \"\");\n tokenUtils.getUserFromAccessToken(token, function(err, result) {\n const userId = result[0].id;\n const StoredUserPassword = result[0].password;\n //\n var password = req.body.password;\n var newPassword = req.body.newPassword;\n var confirmPassword = req.body.confirmPassword;\n if (password && newPassword && confirmPassword) {\n // Check if right password\n bcrypt.compare(password, StoredUserPassword, function(err, result) {\n if (!result) {\n sendResponse(res, 400, \"Wrong password\");\n } else {\n var checkedPassword = utils.checkPassword(newPassword);\n if (checkedPassword) {\n if (newPassword == confirmPassword) {\n // Update user password\n userUtils.updateUserPassword(userId, newPassword, function() {\n sendResponse(res, 200, \"Password successfully changed\");\n });\n } else {\n sendResponse(res, 403, \"You haven't entered the same password\");\n }\n } else {\n sendResponse(res, 401, \"Password not safe enough\");\n }\n }\n });\n } else {\n sendResponse(res, 400, \"One or many required data is missing\");\n }\n });\n}", "title": "" }, { "docid": "89b342149507b81957d9245c0e0ba096", "score": "0.69328535", "text": "function postPassword(success, error, email, password, oldPassword) {\n $.ajax({\n url: \"/zebedee/password\",\n dataType: 'json',\n contentType: 'application/json',\n type: 'POST',\n data: JSON.stringify({\n password: password,\n email: email,\n oldPassword: oldPassword\n }),\n success: function () {\n if(success) {\n success();\n }\n },\n error: function (response) {\n if(error) {\n error(response);\n } else {\n handleApiError(response);\n }\n }\n });\n}", "title": "" }, { "docid": "0e4bbf334b692cd9b6f61d53a1456e69", "score": "0.6910536", "text": "update() {\n http.put(`/users/${this.user.id}/password`, this.form);\n }", "title": "" }, { "docid": "27974ac191bc1b4cb3daea47d92d0aa6", "score": "0.6897789", "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": "fc213867dca487022e7e0c866e9e9060", "score": "0.68778336", "text": "function api_changepw(ctx, passwordkey, masterkey, oldpw, newpw, email) {\r\n var req, res;\r\n var oldkey;\r\n\r\n var newkey = prepare_key_pw(newpw);\r\n\r\n if (oldpw !== false) {\r\n var oldkey = prepare_key_pw(oldpw);\r\n\r\n // quick check of old pw\r\n if (oldkey[0] != passwordkey[0] || oldkey[1] != passwordkey[1] || oldkey[2] != passwordkey[2] || oldkey[3] != passwordkey[3]) return 1;\r\n\r\n if (oldkey[0] == newkey[0] && oldkey[1] == newkey[1] && oldkey[2] == newkey[2] && oldkey[3] == newkey[3]) return 2;\r\n }\r\n\r\n var aes = new sjcl.cipher.aes(newkey);\r\n\r\n // encrypt masterkey with the new password\r\n var cmasterkey = encrypt_key(aes, masterkey);\r\n\r\n req = {\r\n a: 'up',\r\n k: a32_to_base64(cmasterkey)\r\n };\r\n\r\n if (email.length) req.email = email;\r\n\r\n api_req([req], ctx);\r\n}", "title": "" }, { "docid": "2fc347f4ce822ca742f565ad8f487d1e", "score": "0.684321", "text": "function setPassword(req, res) {\n\n User.get(req.body.userId).run().then(function (user) {\n\n if (user.code !== req.body.code) {\n //code doesn't match\n return res.status(200).send(JSON.stringify({\n success: false,\n message: 'Code mismatch, please contact project admin.'\n }))\n }\n\n\n User.get(user.id).update({\n password: CryptoJS.MD5(req.body.password).toString(),\n color: colors[Math.floor(Math.random() * colors.length)],\n code: '',\n codeUpdatedAt: null\n }).then(function (user) {\n return res.status(200).send(JSON.stringify({success: true, message: 'Password was successfully set'}))\n }).error(handleError(res))\n\n }).error(handleError(res));\n\n}", "title": "" }, { "docid": "49f3ca069e5c63adf00a4dd702f69f06", "score": "0.68188035", "text": "function changePassword(req, res, callback) {\n var b = new Buffer(req.params.id, 'base64')\n var s = b.toString();\n db.run(\"UPDATE user SET passwd = ? WHERE id = ?\", [req.body.password, s], function(err) {\n if (err) {\n console.log(err);\n } else {\n res.sendStatus(200);\n }\n });\n}", "title": "" }, { "docid": "c24e6c214e6619e1738408bfb95a59ab", "score": "0.68180174", "text": "function change_password(old_password, new_password, callback_function) { \n var data = {};\n data.old_password = (old_password !== undefined) ? old_password : null;\n data.new_password = (new_password !== undefined) ? new_password : null;\n \n dojo.xhrPost({\n\t\"url\": api_full_url + '{% url api_change_password %}', \n \"handleAs\": \"text\",\n \"postData\": encodeURIComponent(dojo.toJson(data)),\n \"failOk\": true,\n\t\"headers\": {\"Content-Type\":\"application/json\",\n \"X-CSRFToken\": getCookie( CSRF_Cookie_Name )},\n\t \n \"handle\": function(response, ioArgs) {\n if(callback_function !== undefined) {\n callback_function({\"status_code\": ioArgs.xhr.status,\n \"message\": ioArgs.xhr.responseText});\n }\n }\n });\n}", "title": "" }, { "docid": "49e174a2c70955c62f004a579a1ce242", "score": "0.6790546", "text": "function resetPassword() {\n app.config.set('username', username);\n getPassword(function (err, password) {\n if (err) {\n return callback(err);\n }\n\n app.users.forgot(username, {\n shake: shake,\n 'new-password': password\n }, function (err, res) {\n if (err) {\n app.log.error('Unable to set new password for ' + username.magenta);\n app.log.error(err.message);\n return callback(err);\n }\n\n app.config.set('password', password);\n app.config.save(callback);\n });\n });\n }", "title": "" }, { "docid": "b58cb940000f1712fe31d33245897289", "score": "0.67806107", "text": "ChangeMailboxPassword(exchangeService, organizationName, password, primaryEmailAddress) {\n let url = `/email/exchange/${organizationName}/service/${exchangeService}/account/${primaryEmailAddress}/changePassword`;\n return this.client.request('POST', url, { password });\n }", "title": "" }, { "docid": "f34e35f13d835fbc749237dcf00731ca", "score": "0.67749447", "text": "function changePassword(req, res) {\n\n\t\tvar response = {\n\t\t\ttype: 'change',\n\t\t\terror: '401',\n\t\t\tdata: \"Argument(s) missing !\"\n\t\t};\n\n\t\tconsole.log(JSON.stringify(req.body));\n\n\t\tif(!req.body.nickname || !req.body.resetPasswordToken || !req.body.password){\n\t\t\treturn res.end(JSON.stringify(response));\n\t\t} \n\n\t\tuserInfos = new Object({\n\t\t\tuserName : req.body.nickname,\n\t\t\tresetPasswordToken : req.body.resetPasswordToken,\n\t\t\tpassword: bcrypt.hashSync(req.body.password,8)\n\t\t});\n\n\t\tuserModel.getUser(userInfos.userName,function(err, callback){\n\t\t\tif(err){\n\t\t\t\tresponse = {\n\t\t\t\t\ttype: 'change',\n\t\t\t\t\terror: '500',\n\t\t\t\t\tdata: err.message\n\t\t\t\t};\n\t\t\t\treturn res.end(JSON.stringify(response));\n\t\t\t}\n\n\t\t\tif(callback == null){\n\t\t\t\tresponse = {\n\t\t\t\t\ttype: 'change',\n\t\t\t\t\terror: '400',\n\t\t\t\t\tdata: \"User not found\"\n\t\t\t\t};\n\t\t\t\treturn res.end(JSON.stringify(response));\n\t\t\t}\n\n\t\t\tresponse = {\n\t\t\t\ttype: 'change',\n\t\t\t\terror: '400',\n\t\t\t\tdata: \"Invalid token or expired!!!\",\n\t\t\t};\n\n\t\t\tif(callback == null || !bcrypt.compareSync(userInfos.resetPasswordToken, callback[\"resetPasswordToken\"]) || Date.now() > callback[\"resetPasswordExpires\"]) { \n\t\t\t\t\treturn res.end(JSON.stringify(response));\n\t\t\t}\n\n\t\t\tchangePassword(userInfos, function(err, callback) {\n\t\t\t\tif(err){\n\t\t\t\t\tresponse = {\n\t\t\t\t\t\ttype: 'change',\n\t\t\t\t\t\terror: '500',\n\t\t\t\t\t\tdata: err.message,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tresponse = {\n\t\t\t\t\ttype: 'change',\n\t\t\t\t\terror: '0',\n\t\t\t\t\tdata: callback,\n\t\t\t\t};\n\n\t\t\t\treturn res.end(JSON.stringify(response));\n\t\t\t});\n\n\t\t});\n\t}", "title": "" }, { "docid": "9210b337cd240213fb829996f964f096", "score": "0.67346907", "text": "changePassword() {\n const url = GLOBAL.BASE_URL + '/api/user/updatePassword';\n const body = 'mail=' + Globals.email + '&oldPassword=' + this.state.oldPassword + '&newPassword=' + this.state.password;\n fetch(url, {\n method: 'POST',\n headers: new Headers({\n \"token_api\": GLOBAL.token_api,\n 'Content-Type': 'application/x-www-form-urlencoded',\n }),\n body: body\n })\n .then((response) => {\n response.text();\n console.log(response.status);\n if (response.status == 400) {\n alert(\"Problème sur l'ancien mot de passe\");\n }\n else if (response.status == 201) {\n alert('Changement de mot de passe réussi !');\n }\n })\n .then((responseText) => { })\n .catch((error) => {\n console.error(error);\n });\n }", "title": "" }, { "docid": "44e023fb94bf53e8c75969d9ceef4794", "score": "0.6720684", "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": "1339e08ceaef6118ff2f0bc9a9d42b0d", "score": "0.67163277", "text": "function sendNewPassword(req, res, next) {\n var newPass = makePassword();\n var query = User.where( 'username', new RegExp('^'+req.params.username+'$', 'i') );\n query.findOne(function (err, user) {\n if (err) {\n res.send(err);\n return next();\n } else if (!user) {\n return next(new restify.NotAuthorizedError(\"Invalid username.\"));\n return next();\n } else {\n user.password = newPass;\n user.tempPasswordFlag = true;\n user.save(function (err, user) {\n if (!err) {\n // send the new password\n var refer = req.toString().substring(req.toString().indexOf('referer:')+8).trim();\n var host = req.header('Host');\n refer = refer.substring(0, refer.indexOf(host) + host.length);\n var fullURL = refer + \"/\";\n var messageBody = \"Hello \" + user.name + \",</br><p>Here is your new password. Please login and change it.</p><p>\" + newPass + \"</p>\";\n messageBody = messageBody + \"<a href='\" + fullURL + \"' target='_blank'>Login to your account</a>\"\n\n var mailAddress = user.email;\n mail.sendMail(mailAddress, 'Temporary Password Email', messageBody, true);\n res.send(user);\n return next();\n } else {\n return next(err);\n }\n });\n }\n\n });\n }", "title": "" }, { "docid": "2f6a2773843ed63c96131a1a8b57cd2c", "score": "0.67143965", "text": "function updatePassword() {\n if (vm.temp.passwordNew !== vm.temp.passwordConfirm) {\n return msUtils.toast(translate('PROFILE.PASSWORD_NO_MATCH'));\n }\n\n vm.working = true;\n\n Auth.email.updatePassword(vm.user.email, vm.temp.passwordCurrent, vm.temp.passwordNew)\n .then(function () {\n msUtils.toast(translate('CORE.UPDATED'));\n })\n .catch(msUtils.toast)\n .finally(function () {\n vm.working = false;\n });\n }", "title": "" }, { "docid": "6a9e0a78406b2c897621f9c63d7b3ada", "score": "0.67134875", "text": "function setPassword(req, res, next) {\n // Body validations\n req.checkBody(\"password\", \"Password is required\").notEmpty();\n req.checkBody(\"password2\", \"Password2 is required\").notEmpty();\n\n // check the validation object for errors\n let errors = req.validationErrors();\n\n if (errors) {\n res.json({ status: false, messages: errors });\n } else {\n if (req.body.password !== req.body.password2) {\n res.json({\n success: false,\n message: \"Passwords do not match\"\n });\n } else {\n userService.setPassword(req.params.token, req.body.password);\n res.status(200).json({ success: true, token: req.params.token });\n }\n }\n}", "title": "" }, { "docid": "7826f5e329ab855d88c43914c94c49d4", "score": "0.6703658", "text": "changePassword(oldPassword, newPassword) {\n this.getCognitoUser().changePassword(\n oldPassword,\n newPassword,\n function(err, result) {\n if (err) {\n logger.log(err)\n return\n }\n logger.log(result)\n })\n }", "title": "" }, { "docid": "7932308004a51eaa11afcc9523413a42", "score": "0.665117", "text": "changeAccountPassword(req,res,next){\n res.render('forgotPassword',{layout:'backend'});\n }", "title": "" }, { "docid": "c65c86b83730e996dc5f30545a7ef57a", "score": "0.6648173", "text": "function changePassword(obj) {\n var deferred = $q.defer();\n var URL = APPCONFIG.APIURL + 'change-password';\n $http({\n method: 'POST',\n url: URL,\n processData: false,\n transformRequest: function (data) {\n var formData = new FormData();\n formData.append(\"token\", authServices.getAuthToken());\n formData.append(\"oldpassword\", obj.oldpassword);\n formData.append(\"password\", obj.newpassword);\n formData.append(\"cpassword\", obj.confirmpassword);\n return formData;\n },\n headers: {\n 'Content-Type': undefined\n }\n }).then(function (response) {\n deferred.resolve(response);\n }, function (response) {\n deferred.reject(response);\n });\n return deferred.promise;\n } //END changePassword();", "title": "" }, { "docid": "53ecab6ad4108bc33e221be610282a8f", "score": "0.6622888", "text": "async function dashboard__changePassword(req, res) {\n try {\n let { currentPassword, newPassword, confirmPassword } = req.body;\n currentPassword = currentPassword.trim(), newPassword = newPassword.trim(), confirmPassword = confirmPassword.trim()\n // server side validation\n if (!currentPassword || !newPassword || !confirmPassword) {\n throw new Error(\"Please fill out all the fields\")\n }\n if (confirmPassword !== newPassword) {\n throw new Error(\"Passwords don't match\")\n }\n \n if(!minimumLength(newPassword, 6))\n throw new Error(\"Password must be at least six characters long\")\n if(!maximumLength(newPassword, 20))\n throw new Error(\"Password cannot be more than twenty characters long\")\n\n // get active user from DB\n const activeUserID = req.session.uid;\n const user = (await pool.query(\"SELECT * FROM users WHERE uid = $1\", [activeUserID])).rows[0];\n\n if (!user) {\n throw new Error(\"Something went wrong!\")\n }\n\n // check if currentPassword matches the user's password from DB\n const isValidPassword = await bcrypt.compare(currentPassword, user.password)\n\n if (!isValidPassword){\n throw new Error(\"Incorrect password. Please try again\")\n }\n // hash the new password and update the database for the active user\n const salt = await bcrypt.genSalt(10);\n const hashedPassword = await bcrypt.hash(newPassword.trim(), salt);\n\n await pool.query(\"UPDATE users SET password = $1 WHERE uid = $2\", [hashedPassword, activeUserID])\n return res.status(200).json({message: \"Password updated successfully\", success: true})\n\n } catch (error) {\n return res.status(400).json({error: error.message, success: false})\n }\n}", "title": "" }, { "docid": "ccea21394e5def416e8c26b08dec9176", "score": "0.6619182", "text": "async updatePatientPassword(ctx, args) {\n args = JSON.parse(args);\n let patientId = args.patientId;\n let newPassword = args.newPassword;\n\n if (newPassword === null || newPassword === '') {\n throw new Error(`Empty or null values should not be passed for newPassword parameter`);\n }\n\n const patient = await this.readPatient(ctx, patientId);\n patient.password = crypto.createHash('sha256').update(newPassword).digest('hex');\n if(patient.pwdTemp){\n patient.pwdTemp = false;\n patient.changedBy = patientId;\n }\n const buffer = Buffer.from(JSON.stringify(patient));\n await ctx.stub.putState(patientId, buffer);\n }", "title": "" }, { "docid": "fd5b5b71dd775ef4ca9add10d3d2f8b0", "score": "0.66190636", "text": "setPassword(password, options) {\r\n return this.client.userChangePassword({ name: this.name, password }, options).then(() => this);\r\n }", "title": "" }, { "docid": "143a05db16f2604fd05dcb0b4dc7841d", "score": "0.6611526", "text": "function onConfirmChangePasswordClick() {\n let vOldPassWord = $('#inp-old-password').val().trim();\n let vNewPassword = {\n password: $('#inp-new-password').val().trim(),\n };\n let vRepeatPassword = $('#inp-new-password-repeat').val().trim();\n if (validatePassword(vOldPassWord, vNewPassword, vRepeatPassword)) {\n $.ajax({\n url: `${G_BASE_URL}/customer/change-password/customers/${gUserId}/old-password/${vOldPassWord}`,\n method: `put`,\n headers: {\n Authorization: `Token ${gUserToken}`,\n },\n data: JSON.stringify(vNewPassword),\n contentType: `application/json ; charset=utf-8`,\n success: (res) => {\n alert('Đã cập nhật mật khẩu thành công. Xin hãy đăng nhập lại');\n setCookie('user', '', 1);\n window.location.href = `login.html`;\n },\n error: (e) => alert(e.responseText),\n });\n }\n }", "title": "" }, { "docid": "0f6bf6ec3b9b52c97579368ffc391186", "score": "0.65826017", "text": "function serviceUpdateUserPassword(req, resp) {\n\t\tlogger.info(\"<Service> UpdateUserPassword.\");\n\t\tvar userData = parseRequest(req, ['userId', 'password']);\n\t\t\n\t\twriteHeaders(resp);\n\t\tupdateUserPassword(userData.userId, userData.password, function(err, status) {\n\t\t\tif (err) error(2, resp);\n\t\t\telse resp.end(JSON.stringify({ status: status })); \n\t\t});\n\t}", "title": "" }, { "docid": "c1b3dfaa5e0646d428e5362cb7985a80", "score": "0.658223", "text": "static changePassword($form) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch(`${apiHost}change-password`, getOptionsForPut(getFormData($form)))\n\t\t\t.then(response => { if (response.ok) { return response.json(); } throw new Error(); }, error => { throw new Error(); })\n\t\t\t.then(response => resolve(true))\n\t\t\t.catch(_ => resolve(false));\n\t\t});\n\t}", "title": "" }, { "docid": "4a5bfb821f35bba016bfd072e298af91", "score": "0.6559319", "text": "changeWalletPassword(oldPassword: string, newPassword: string) {\n const client = getClientInstance()\n return client.command('walletpassphrasechange', oldPassword, newPassword)\n }", "title": "" }, { "docid": "ea4a56b7b81c6895cf4deb79f8fea5da", "score": "0.6558748", "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": "43599ebbaabc50a5531dacd9113ba196", "score": "0.65508443", "text": "changePassword(prePass, newPass) { \n if(prePass === listOfUsers.get(this.email)){\n this.password = newPass;\n console.log(\"Successful Password Change\")\n }\n else{\n console.log(\"Your password does not match our records.\");\n }\n }", "title": "" }, { "docid": "5ae4d11d041d73768578986012d41a8b", "score": "0.6542063", "text": "function changePasswordWithU2f(oldPsw, newPsw) {\n\t var promise = _auth2.default.changePasswordWithU2f(oldPsw, newPsw);\n\t _handleChangePasswordPromise(promise);\n\t}", "title": "" }, { "docid": "6aaa6b153b820bc5cf85ebd9fd2f16e7", "score": "0.6538361", "text": "function resetPassword() {\n Onyx.merge(ONYXKEYS.ACCOUNT, {loading: true, forgotPassword: true});\n API.ResetPassword({email: credentials.login})\n .finally(() => {\n Onyx.merge(ONYXKEYS.ACCOUNT, {loading: false});\n });\n}", "title": "" }, { "docid": "91b4578e35b5cd7d23ffb2a1649c8974", "score": "0.65012276", "text": "function updateNewPassword(txtOldpassword, newPassword) {\n var model = MODEL.changepw;\n \n $.messager.confirm(MODEL.buttons.message, MODEL.changepw.confirminfo, function () {\n var changePasswordJson = {\n \"username\" : EL.Auth.username\n , \"oldpassword\" : txtOldpassword\n , \"newpassword\" : newPassword\n };\n $.ajax({\n url: \"private/password.json\",\n data: changePasswordJson,\n dataType : \"json\",\n success: function(data) {\n if (EL.UpdateStatus(data)) {\n EL.Auth.update(EL.Auth.username, user.password);\n\n location.reload();\n // $('#mydialog').dialog('destroy');\n // $('#mydialog').html('');\n } else {\n $changepsw_result\n // .html('Change Password Failed.')\n .html(model.chgpwfail)\n .show();\n }\n }\n });\n });\n }", "title": "" }, { "docid": "7a451c1e142856fe0889d42ca9ab51bb", "score": "0.6488216", "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": "8efb25cbc67647424aa231583cc96b16", "score": "0.648231", "text": "function goToChangePwd(){\n\tperformAction('changePwd');\n}", "title": "" }, { "docid": "271c50091aca3a2cc107094611bdb53c", "score": "0.64780647", "text": "function UpdateChangePassword(e) {\n\n\n event.preventDefault();\n\n var formData = $('#ChangePassword');\n var Url = '/User/PersonalChangePassword';\n if (formData.valid()) {\n fnButtonLoader(e);\n var posting = $.post(Url, formData.serialize());\n posting.done(function (result) {\n if (forceLogOut(result)) {\n fnRemoveBtnDisableData(e);\n\n if (parseInt(result) <= 0) {\n if (parseInt(result) < 0) {\n Alert(_msgError, \"Error\");\n fnRemoveBtnDisableData(e);\n return false;\n }\n\n }\n if (parseInt(result) == 5) {\n Alert(_ErrorPassword, \"Error\");\n fnRemoveBtnDisableData(e);\n return false;\n }\n\n Alert(_SavePassword, \"Success\");\n $(\"#UserDataPersonal\").html(result);\n }\n });\n }\n}", "title": "" }, { "docid": "8ad72f9892e5f0bf0bdca67afadc0c5b", "score": "0.6476287", "text": "function apiUpdatePassword(password) {\n profile = JSON.parse(localStorage.getItem(\"userProfile\"));\n var postdata = {\n option: \"password\",\n email: profile.email,\n username: profile.username,\n jwt: profile.JWT,\n password: password\n }\n\n $.ajax({\n url: 'https://teamgamma.ga/api/umtg/update',\n type: 'post',\n dataType: 'json',\n contentType: 'application/json',\n success: function(data) {\n $('.modal').modal('hide');\n console.log(data);\n \n successfullUpdate.showToast();\n },\n error: function(data) {\n //Toast message: Register Failed\n var failedUpdate = Toastify({\n close: true,\n gravity: \"bottom\",\n text: \"Update Failed: \" + data.responseJSON.message,\n backgroundColor: \"linear-gradient(135deg, #9E1A1A, #9E1A1A)\",\n duration: 5000\n });\n failedUpdate.showToast();\n },\n data: JSON.stringify(postdata)\n });\n }", "title": "" }, { "docid": "98d892db7dc83063216e3440773ab888", "score": "0.6474536", "text": "async resetPassword(req, res) {\n // NOTE: Handle confirmPassword value on FE && old password equaling newPassword.\n if (\n !(req.body && req.body.email && req.body.newPassword && req.body.token)\n ) {\n return Errors.Network.missingFields(res);\n }\n const {\n email,\n newPassword,\n token\n } = req.body;\n console.log(email, newPassword, token);\n RPC.request({\n method: 'POST',\n url: `${persist_base}/api/search/persist/auth/query`,\n body: {\n attributes: ['id', 'password'],\n where: {\n email: email,\n password_reset_token: token\n }\n },\n headers: null,\n }).then(async response => {\n if (!response.success) throw response.error;\n // TODO: handle if is token expired\n // if(Date.now() > currentUser.password_reset_expires * 1000) {\n // return res.json({ error: 'Token expired.', success: false });\n // }\n let currentUser = response.user;\n let storedPassword = await genPassword(newPassword);\n console.log(`storedPassword:\\n${storedPassword}`);\n bcrypt.compare(\n newPassword,\n currentUser.password,\n async (error, isMatch) => {\n if (error) {\n return res.json({\n error,\n success: false\n });\n }\n if (isMatch) {\n return res.json({\n error: 'This password is on file!',\n success: false,\n });\n }\n\n RPC.request({\n method: 'PUT',\n url: `${persist_base}/api/persist/auth/update?email=${email}`,\n body: {\n updatedValues: {\n password: storedPassword,\n password_reset_expires: null,\n password_reset_token: null,\n },\n },\n })\n .then(response => {\n if (!response.success) throw response.error;\n return res.json({\n success: true,\n error: null\n });\n })\n .catch(error => {\n throw error;\n })\n },\n );\n })\n .catch(error => {\n return Errors.Network.rpcFailure('Persist', error, res);\n })\n }", "title": "" }, { "docid": "63fc3d3ccec4da66dde75dc528714fe3", "score": "0.6472626", "text": "function forgotPassword() {\n if (checkForgotPasswordForm()) {\n //localStorage.setItem(\"account\"., JSON.stringify($(\"#sec-new-password\").val()));\n console.log(\"account\" + localStorage.getItem(\"account\"));\n let account = JSON.parse(localStorage.getItem(\"account\"));\n account.password = ($(\"#sec-new-password\").val());\n localStorage.setItem(\"account\", JSON.stringify(account));\n\n clearContents();\n }\n\n}", "title": "" }, { "docid": "5361317d2f9b14e6d15dc4a7b4c872dd", "score": "0.6470993", "text": "function writePassword() {\n var password = passReqs.passResult();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "56d245e615018ea204edc1b87de2e115", "score": "0.64700294", "text": "function submitPassword() {\n $log.debug(\"Password submitted: %s\", self.password);\n self.loginDisabled = true;\n authnService.login(self.password)\n .then(function () {\n $log.debug(\"Sucessfull login\");\n self.password = \"\";\n self.loginDisabled = false;\n self.loginFailed = false;\n }, function (error) {\n $log.debug(\"Login failed\");\n self.password = \"\";\n self.loginFailed = true;\n self.loginDisabled = false;\n });\n }", "title": "" }, { "docid": "158d4230f4f218d9faa0f6d0d2ef4397", "score": "0.6467196", "text": "static updatePwd(uname, pwd) {\n const resetToken = cryptoRS(64);\n return(db.execute(\n 'UPDATE t_user ' +\n 'SET usr_pwd = ?, usr_resetToken = ? ' +\n 'WHERE usr_uname = ?;',\n [pwd, resetToken, uname]\n ));\n }", "title": "" }, { "docid": "7f9f1d752b4d24415fc3a2ffa4852342", "score": "0.6459582", "text": "function sendPassword( req, res, next ){\n if( !req.user ){ return next(); }\n caminio.mailer.send(\n req.user.email,\n req.i18n.t('auth.mailer.subject_reset_password'), \n 'auth/reset_password', \n { \n locals: { \n user: req.user,\n url: (caminio.config.hostname + '/caminio/accounts/' + req.user.id + '/reset/' + req.user.confirmation.key)\n } \n },\n function( err ){\n req.sentOK = true;\n next( err );\n });\n }", "title": "" }, { "docid": "efb5faa6eabfdeacb5c57f8137625991", "score": "0.6457725", "text": "async function onChangePassword(passwordData){\n const result = await fetch('api/user/change-password',{\n method:\"PATCH\",\n body:JSON.stringify(passwordData),\n headers:{\n \"Content-type\":'application/json'\n }\n\n })\n const data = await result.json();\n console.log(data)\n}", "title": "" }, { "docid": "d8cc422ac3064e940c1cd4a8a65b9920", "score": "0.64541817", "text": "onUpdatePass() {\n\t\tthis.user.onChangePassword(this.state.newPass).then((newPass) => {\n\t\t\tthis.setState({password:newPass,newPass:\"\"})\n\t\t})\n\t}", "title": "" }, { "docid": "f40aac84adcfa6c3cc0e1f8e1c92e9e1", "score": "0.64508134", "text": "function updatePassword() {\n var self = this;\n var body = self.body;\n var id = self.params.id;\n try {\n var decoded = self.token;\n console.log(\"decoded ------\", decoded, md5(body.password))\n var mnosql = new Agent();\n // update\n //console.log(\"UPDATE ADMIN USER\")\n mnosql.update('updateAdmin', 'admin_users').make(function (builder) {\n builder.where('id', id);\n builder.set('password', md5(body.password));\n builder.set('dateupdated', new Date());\n });\n\n\n //var addAdmin = await mnosql.promise('addAdmin');\n mnosql.exec(function (err, response) {\n console.log(\"MONGO err\", err)\n if (err) {\n return self.json({\n status: false,\n message: err\n })\n }\n //console.log(\"resp\", response.updateAdmin);\n self.json({\n status: true,\n message: \"Password Updated Successfully\"\n })\n })\n\n\n } catch (err) {\n console.log(\"err\", err)\n self.json({\n status: false,\n message: \"Sorry some thing went wrong\"\n });\n return;\n }\n}", "title": "" }, { "docid": "9e31961ff43c95aafce1a001708efa1c", "score": "0.64437884", "text": "function changePassword(form_flag){\n\tvar form_data=\"\";\n\tif (form_flag==0) {\n\t\t//we need to fetch the form to display\n\t\tdType=\"html\";\n\t\tform_data='form_flag='+form_flag;\n\t} else {\n\t\t//Get the changed pw inputs from form\n\t\tdType=\"json\";\n\t\tif( $(\"#current_password\").length )\n\t\t\t\tvar cur_pw=$('#current_password').val();\n\t\tif( $(\"#new_password\").length )\n\t\t\t\tvar new_pw= $('#new_password').val();\n\t\tif( $(\"#confirm_new_password\").length )\n\t\t \t\tvar conf_pw=$('#confirm_new_password').val();\n\t\tform_data = 'form_flag='+form_flag+'&current_password='+ cur_pw+'&new_password='+new_pw+\n\t\t\t\t\t\t\t\t'&confirm_new_password='+conf_pw;\n\t}\n\t$.ajax({\n url: global_siteurl+'/testwell/testwell/change_password',\n data: form_data,\n\t\tdataType: dType,\n\t\ttype: 'post',\n success: function (retval) { \n\t\t\t//alert(retval);\n\t\t\tprocessChangePassword(form_flag,retval);\n }\n });\n}", "title": "" }, { "docid": "6dc01eb4c78797181c337fd243e3df04", "score": "0.64418036", "text": "function change() {\n\n return security.changePassword(vm.user)\n .then(function (res) {\n vm.close();\n }, function (error) {\n\n $scope.error = {};\n Errors.user(error.errors, $scope.error);\n });\n }", "title": "" }, { "docid": "a3a422e75c91d82d1f7f993328d3c8e7", "score": "0.643755", "text": "function toggleChangePasswordMode(el, userName, changePasswordMode) {\n var form = el.find(\"form\");\n if (changePasswordMode == 'link') {\n $(\".controls-password\").find(\"input[type='password']\").prop('disabled', true);\n // Form submits password reset request\n form.attr({\n method: 'POST',\n action: site.uri.public + '/userWallet/api/users/u/' + userName + '/password-reset'\n });\n\n var validator = form.validate();\n if (validator) {\n //Iterate through named elements inside of the form, and mark them as error free\n el.find(\"input[type='password']\").each(function() {\n validator.successList.push(this); //mark as error free\n });\n validator.resetForm();//remove error class on name elements and clear history\n validator.reset();//remove all error and success data\n }\n el.find(\"input[type='password']\").closest('.form-group')\n .removeClass('has-error has-success');\n el.find('.form-control-feedback').each(function () {\n $(this).remove();\n });\n } else {\n $(\".controls-password\").find(\"input[type='password']\").prop('disabled', false);\n // Form submits direct password update\n form.attr({\n method: 'PUT',\n action: site.uri.public + '/userWallet/api/users/u/' + userName + '/password'\n });\n }\n}", "title": "" }, { "docid": "c1b9f92af9ab65129038772c1fb475c6", "score": "0.6431489", "text": "ChangePasswordOfTheDynHostLogin(login, password, zoneName) {\n let url = `/domain/zone/${zoneName}/dynHost/login/${login}/changePassword`;\n return this.client.request('POST', url, { password });\n }", "title": "" }, { "docid": "9ebba286443b61e831938000a790532a", "score": "0.64270276", "text": "function resetPassword({ params, token }) {\n const endpoint = \"/user/password/change\";\n return baseurl.post(\n endpoint,\n { ...params },\n {\n headers: { Authorization: `Bearer ${token}`, Apptoken },\n }\n );\n}", "title": "" }, { "docid": "d50ccc474049b67e4f76ee388212c516", "score": "0.64213777", "text": "async setPassword() {\n this.log.info('set password');\n await this.bot.waitForSelector('#password');\n await this.bot.type('#password', this.config.password, { delay: 100 });\n }", "title": "" }, { "docid": "343c63b1ae873c5f5b67284739c74d3e", "score": "0.64176613", "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": "4abfa804b2e394d4326affe9c681c84e", "score": "0.6414206", "text": "function updatePassword(e) {\n password = e.target.value;\n }", "title": "" }, { "docid": "ae14e7683aa6c8d1d4c8f9dfa342fe9d", "score": "0.6409969", "text": "setPassword(password){\n genericActions.clearSetText(loginPage.passwordInput, password);\n }", "title": "" }, { "docid": "1f5fe57929cc33f8035254d1d2063e1e", "score": "0.6408297", "text": "function updateUserPassword(userID, correctPassword){\n $.ajax({\n method: 'POST',\n url: '/update-user-password',\n data: {userID:userID, password:correctPassword, _token:token},\n success: function success(response){\n },\n error: function error(response){\n console.log(response.error);\n }\n });\n}", "title": "" }, { "docid": "7f77b52986067035eb84912292ecde5d", "score": "0.6405202", "text": "static updatePassword(req, res, next) {\n const BCRYPT_SALT_ROUNDS = 12;\n const { password, email } = req.body;\n\n User.findOne({ email })\n .then(user => {\n if (!user) {\n res.status(404).json(\n 'There is no user in the database which needs updated.'\n );\n } else {\n bcrypt\n .hash(password, BCRYPT_SALT_ROUNDS)\n .then(hashedPassword => {\n user.update({\n password: hashedPassword,\n token: null,\n tokenExp: null,\n });\n })\n .then(() => {\n res.status(200).send({\n message: 'password-updated',\n });\n })\n .catch(err =>\n res\n .status(401)\n .json({ error: 'Could not update password' })\n );\n }\n })\n .catch(err =>\n res\n .status(401)\n .json({ error: 'Could not check user in database' })\n );\n }", "title": "" }, { "docid": "21b296c5a25c49ea848991dc88f74126", "score": "0.63745356", "text": "function changePassword(password, accessToken) {\n let passwordChangePromise = $.ajax({\n timeout: TIMEOUT,\n type: 'PUT',\n url: API_URL + '/clients/password',\n headers: {\n 'Authorization': 'Bearer ' + accessToken,\n 'password': password\n }\n }).done((data) => {\n console.log(data);\n if (typeof data.status === \"undefined\") {\n console.log(\"Error: can't change password!\");\n } else {\n console.log(\"Changed password successfully\");\n }\n return data;\n }).fail((data) => {\n console.log(data);\n console.log(\"Changing password failed\");\n return null;\n });\n\n return passwordChangePromise;\n}", "title": "" }, { "docid": "cec03a0e55651c0f3c1e9c7d2cb928db", "score": "0.6373031", "text": "updatePass(url) {\n // Envoyé le mot de passe courant\n this.data.password = this.currentPassword;\n this.userProvider.updatePassword(url, this.data).subscribe((userUpdated) => {\n // mettre à jour la session\n if (this.action !== 'updateByManager') {\n this.session.setItem('user', userUpdated);\n this.session.setItem('password', userUpdated.password);\n }\n this.errorType = 'validate';\n this.errorMsg = this.translate.getMessageInstant('COMPONENTS.AFRICLEAN_PASSWORD.PASSWORD.VALIDATE');\n });\n }", "title": "" }, { "docid": "0088c290497aaee6539ac0b272048ea2", "score": "0.6367674", "text": "passwordFields(oldPw, newPw) {\n this.oldPassword.setValue(oldPw);\n this.newPassword.setValue(newPw);\n this.confirmNewPassword.setValue(newPw);\n }", "title": "" }, { "docid": "db9e336a4c91091552fdf13e95f95423", "score": "0.63660705", "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": "bc2c96b66a8e0c8dd39268e2c6fc4e65", "score": "0.6359153", "text": "requestNewPassword(userId, cb) {\n this.request('GET', '/api/users/reset/' + userId, null, cb)\n }", "title": "" }, { "docid": "5bc9ad21fe61de8f6690531b32cafcb2", "score": "0.63538086", "text": "resetPassword() {\n this.http.post('/api/session/users/' + this.username + '/password', {\n password: this.form.controls['password'].value\n }).subscribe(res => {\n if (res) {\n /**\n * User is authenticated and we can grant them access\n */\n this.cookieService.set('sessionUser', this.username, 1);\n this.router.navigate(['/repair-services']);\n }\n else {\n this.errorMessage = 'Password must contain at least one uppercase letter, one number, and be 8 characters long.';\n }\n }, err => {\n console.log('error message', err);\n });\n }", "title": "" }, { "docid": "60488f46d71a7cf44e8c64fd537152ce", "score": "0.6346806", "text": "function modifyPassword() {\r\n\r\n let xhr = XMLHttpRequest();\r\n xhr.open('GET', 'http://localhost/http_getChangePassword?idClient='+ idCli +'&password1='+ formValid.password1.value + '&password2=' + formValid.password2.value)\r\n xhr.onload = function () {\r\n xhr.responseText();\r\n }\r\n xhr.send();\r\n console.log('La mise à jour a été faite');\r\n}", "title": "" }, { "docid": "06d2b13be4c5d2024bdcfe14efac8dd7", "score": "0.6346724", "text": "updatePassword(userId, newHashedPwd, currentResumeLoginToken) {\n var user = this.Users.findOne(userId);\n if (!user)\n throw new Error('User not found');\n \n user.services.password.bcrypt = newHashedPwd;\n delete user.services.password.reset;\n this.Users.update(user);\n \n this.removeOtherHashedLoginTokens(userId,currentResumeLoginToken);\n \n }", "title": "" }, { "docid": "ab28a363e9ec9c3d42787cd772680c57", "score": "0.6322836", "text": "function resetPassword(req, res, user){\n\tconsole.log('Password changed');\n\treq.login(user, function(err){\n\t\tif(err){\n\t\t\treturn err;\n\t\t} else{\n\t\t\tres.send(user.data);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7cf981e38581004096b2e5cdba310d02", "score": "0.6318144", "text": "function setPassword() {\n if (params.newpassword) {\n return UserModel.encryptPassword(params.newpassword)\n .then(encryptedPassword => {\n fieldsToSet.password = encryptedPassword;\n });\n }\n\n return Promise.resolve();\n }", "title": "" }, { "docid": "de620823c6bd2e5257550115df1f5bac", "score": "0.63008", "text": "ChangePrivateCloudUserPassword(serviceName, userId, password) {\n let url = `/dedicatedCloud/${serviceName}/user/${userId}/changePassword`;\n return this.client.request('POST', url, { password });\n }", "title": "" }, { "docid": "9098f297426ee266ccaa4f50cafdda74", "score": "0.629408", "text": "function modifica_password(obj){\n\tif((xhr=getXMLHttpRequest())==null){\n\t\talert(\"Il tuo browser non supporta Ajax!\");\n\t\treturn;\n\t}\n\tvar vpass=getObj(\"old_password\");\n\tvar pass=getObj(\"inseriscipassword\");\n\tif(pass.value==\"\" || vpass.value==\"\"){\n\t\talert(\"Ci sono campi vuoti\");\n\t\treturn;\n\t}else if(checkPassword==0){\n\t\talert(\"Errore Password\");\n\t\treturn;\n\t}\n\tvar old_pass=getObj(\"old_password\");\n\tvar url=\"server.php?cosa=\"+obj+\"_\"+pass.value+\"_\"+old_pass.value+\"&dove=modifica_password&sid=\"+Math.random();\n\txhr.onreadystatechange=risposta_server;\n\txhr.open(\"GET\",url,true);\n\txhr.send(null);\n}", "title": "" }, { "docid": "1a419e921886f6087d91f1e7ecd75171", "score": "0.6292545", "text": "static async resetPassword(req, res) {\n // password;\n // token;\n const { password, token } = req.body;\n if (!password) {\n util.setError(400, 'password is required field');\n return util.send(res);\n }\n if (!token) {\n util.setError(400, 'token is required field');\n return util.send(res);\n }\n try {\n let user = {};\n try {\n const decoded = jwt.verify(token, process.env.SECRET_KEY);\n user = decoded.user;\n } catch (ex) {\n // if invalid token\n util.setError(400, 'Token is expired.');\n return util.send(res);\n }\n const hash = await bcrypt.hash(password, saltRounds);\n const updatedUser = await UserService.updateUser(user.id, {\n password: hash,\n });\n util.setSuccess(200, 'Password changed!!!!', updatedUser);\n return util.send(res);\n } catch (error) {\n util.setError(500, error);\n return util.send(res);\n }\n }", "title": "" }, { "docid": "ef1f237897dc34a0160352cefc2d513f", "score": "0.6289353", "text": "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n\n password.reset();\n\n passwordLength();\n passwordText.value = password.pw;\n\n}", "title": "" }, { "docid": "687a64160299a2387c05110bffac4e66", "score": "0.6286089", "text": "function recoverPassword() {\n if(!confirm(lang(\"login.htm\", \"recover_confirm\", document.getElementById(\"login_account\").value))) return;\n var user = document.getElementById(\"login_account\").value;\n if(putRest(\"/rest/system/session\", { name: \"reset\", value: user })) {\n setInnerText(\"warning\", lang(\"login.htm\", \"recover_ok\"));\n }\n else {\n setInnerText(\"warning\", lang(\"login.htm\", \"recover_fail\"));\n }\n document.getElementById(\"warning\").style.display = \"\";\n}", "title": "" }, { "docid": "ffd6d94d058411ba9089a2ad5c35c2b8", "score": "0.6272419", "text": "changePassword() {\n\n // Validate the form\n this.validate().then(({ validations })=> {\n\n this.set('validations.didValidate', true);\n if (validations.get('isValid')) {\n\n // Get the current user id\n const currentUserId = this.get('sessionUser.user.id');\n Ember.assert('User id cannot be null', currentUserId);\n\n // Set controller in loading state\n this.set('isLoading', true);\n\n // Prepare URL\n const adapter = this.store.adapterFor('application');\n const url = [adapter.get('host'), adapter.get('namespace'), 'users', currentUserId, 'change-password'].join('/');\n\n // Update password\n const promise = this.get('ajax').post(url, {\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({\n newPassword: this.get('password')\n })\n });\n\n promise.then(()=> {\n this.get('notify').success(this.get('i18n').t('notify.informationUpdated'));\n this.transitionToRoute('user.edit', currentUserId);\n });\n\n promise.finally(()=> {\n this.set('isLoading', false);\n });\n } else {\n this.get('notify').error(this.get('i18n').t('notify.submissionInvalid'));\n }\n });\n }", "title": "" }, { "docid": "8dc0edda0623c9f254c6fce1ec6ca690", "score": "0.62676376", "text": "function adminForgetPasswordCall(payload) {\n return request('post', urls.ADMIN_FORGET_PASSWORD_URL, payload);\n}", "title": "" }, { "docid": "912f87f1c0948aeafe47bf82f388ae4d", "score": "0.626454", "text": "function updateAccountSettings() {\n\n var name = document.getElementById('name').value;\n var email = document.getElementById('email').value;\n var newPassword = document.getElementById('newPassword').value;\n var oldPassword = document.getElementById('oldPassword').value;\n\n // If current password is not given\n if (oldPassword === null || oldPassword === \"\") {\n document.getElementById('error-msgAS').innerHTML = \"Please enter your current password to make any change(s)\";\n return false;\n }\n\n // If no field is filled in\n else if ((name === null || name === \"\") && (email === null || email === \"\") && (newPassword === null || newPassword === \"\")) {\n document.getElementById('error-msgAS').innerHTML = \"Please fill in the field(s) you want to update\";\n return false;\n }\n\n else{\n\n // If the name field is filled in\n if (name !== null && name !== '') {\n\n // Validate name to allow only alphabets\n if (nameValidation(name) == false) {\n document.getElementById(\"error-msgAS\").innerHTML = \"Name must only contain alphabets\";\n return false;\n }\n }\n\n // If the email field is filled in\n if (email !== null && email !== '') {\n\n // Validate email to only allow email format\n if (emailValidation(email) == false) {\n document.getElementById('error-msgAS').innerHTML = \"Invalid email format\";\n return false;\n }\n }\n\n // If the new password field is filled in\n if (newPassword !== null && newPassword !== '') {\n\n // Validate password to be a minimum 4 characters\n if (passwordValidation(newPassword) == false) {\n document.getElementById('error-msgAS').innerHTML = \"Password must be at least 4 characters long\";\n return false;\n }\n }\n\n // XMLHTTPREQUEST to server\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById('error-msgAS').innerHTML = \"\";\n console.log(this.responseText);\n if (this.responseText == 'Wrong password') {\n document.getElementById('error-msgAS').innerHTML = \"The password provided is incorrect\";\n }\n else if (this.responseText == 'Error updating') {\n document.getElementById('error-msgAS').innerHTML = \"An error occured, please try again\";\n }\n\n else if(this.responseText == \"Email exists\") {\n document.getElementById('error-msgAS').innerHTML = \"The email provided is already in use\";\n }\n else if (this.responseText == \"Update successful\") {\n document.getElementById('error-msgAS').innerHTML = \"Your details have been updated\";\n\n // If needed, change name on the page\n if (name !== null && name !== \"\"){\n document.getElementById('nav-user-name').innerHTML = 'Hello ' + name;\n document.getElementById('name').setAttribute(\"placeholder\", name);\n document.getElementById('name').value = \"\";\n }\n }\n else{\n document.getElementById('error-msgAS').innerHTML = \"An error occured\";\n }\n }\n else if (this.readyState == 4 && this.status != 200) {\n document.getElementById('error-msgAS').innerHTML = \"An error occured, please try again\";\n return false;\n }\n }\n\n // Create new header request\n xmlhttp.open(\"POST\", \"update-account.php\", true);\n\n // Creating data variable\n var data = new FormData();\n data.append('name', name);\n data.append('email', email);\n data.append('newPassword', newPassword);\n data.append('oldPassword', oldPassword);\n // Sends the request with the data to PHP file\n xmlhttp.send(data);\n\n return false;\n } \n}", "title": "" }, { "docid": "c91650ad247567895bce25a4911df014", "score": "0.6264172", "text": "function confirmPassword() {\n event.preventDefault();\n let $changeButton = $('#change-password-button');\n let confirmPass = $('#confirm-password-input').val();\n let newPass = $('#change-password-input').val();\n\n if (confirmPass === newPass) {\n $changeButton.removeAttr('disabled');\n $changeButton.html('<i class=\"fa fa-share\" aria-hidden=\"true\"></i><i class=\"fa fa-lock\" aria-hidden=\"true\"></i>');\n } else {\n $changeButton.attr('disabled', true);\n $changeButton.html('<i class=\"fa fa-ban\" aria-hidden=\"true\"></i> <i class=\"fa fa-lock\" aria-hidden=\"true\"></i>');\n };\n }", "title": "" }, { "docid": "0b9b222b86dcec1ef93f08760122728b", "score": "0.62571263", "text": "function verifyPasswordChangeRequest(req, res, next) {\n userController.verifySecurityAnswer(req, res, next)\n .then(function() {\n res.status(HTTPStatus.OK);\n res.json({\n message: messageConfig.user.passwordChangeConfirmationEmail\n });\n })\n .catch(function(err) {\n return next(err);\n });\n }", "title": "" }, { "docid": "c07b4e4797dfaca28492b5326ff88c4d", "score": "0.62565356", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n resetInitialPassword();\n}", "title": "" }, { "docid": "3eb2102f5c5e69384e405e8413420d23", "score": "0.62542343", "text": "forgot ({ email }) {\n return Vue.prototype.$account.sendResetPwd({ email })\n }", "title": "" }, { "docid": "637855718a4979312850b3bb21c0d986", "score": "0.6246748", "text": "changePass(event) {\n event.preventDefault();\n let loadingCallback = this.loadingStatus;\n loadingCallback(true);\n var data = { 'username': this.state.targetUser.basic.username, 'new_pass': this.password.value }\n fetch(process.env.REACT_APP_API + '/api/users/passchange', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n }).then((resp) => resp.text())\n .then((responseText) => {\n loadingCallback(false);\n alert('Success!');\n }).catch(function(e) {\n console.error(\"Error: \" + e);\n });\n this.password.value = '';\n }", "title": "" }, { "docid": "188b96ab0455242267a10b0535930a8f", "score": "0.62217057", "text": "function updateUserPassword(req, res) {\n var today = new Date();\n var user = {\n \"username\": req.body.username,\n \"password\": req.body.password,\n \"modified\": today\n };\n\n\n //lets encrypt the password, when its done creating the hashed value we can save it to the db\n bcrypt.hash(user.password, 10).then(function (hash) {\n\n //override user password with hashed value\n user.password = hash;\n\n\n //save to db\n connection.query('UPDATE users SET password = \"' + hash + '\" where username = \"' + user.username + '\"', function (error, results, fields) {\n\n if (error) {\n console.log(\"database error ocurred\", error);\n res.send({\n \"code\": 400,\n \"message\": \"database error ocurred\"\n })\n } else {\n // res.send({\n // \"code\": 200,\n // \"message\": \"password set\"\n // });\n\n login(req, res);\n\n }\n });\n\n });\n\n}", "title": "" }, { "docid": "64d6cbcf8dbe580da427d74e5e32f07d", "score": "0.6216805", "text": "function writePassword() {\n var newPassword = generatePassword();\n var password = document.querySelector(\"#password\");\n password.value = newPassword;\n}", "title": "" }, { "docid": "67a96779da50541222dec5d2348f2968", "score": "0.62100446", "text": "function UpdatePassword(password,passwordConfirm) {\n\n if (password!=null){\n if (password!= passwordConfirm){\n\n alert(\"Password and Password confirm should be the same\")\n }\n else{\n\n apiService.putPassword({'password': password}).$promise.then(function(result) {\n vm.passwordPlaceHolder = result.status\n document.getElementById('pwdmsg').innerHTML = 'password changed'\n }, function(error) {\n console.log('Update Password error', error)\n })\n }\n }\n\n }", "title": "" }, { "docid": "5768c56a4d348217bf5d08ce3c6ab6fc", "score": "0.6205048", "text": "function writePassword() {\n reset();\n chooseCharacters();\n generatePassword();\n var newPasswordText = document.querySelector(\"#password\");\n newPasswordText.value = newPassword;\n }", "title": "" }, { "docid": "6ad102495b27cd441abbd49bc2a17dda", "score": "0.6202896", "text": "function updatePassword(username, passwordResetToken, newPassword) {\n // promise to reset password\n var updatePasswordPromise = $.ajax({\n timeout: TIMEOUT,\n type: 'PUT',\n url: AEI_AI_URL + '/update-password',\n headers: {\n 'username': username,\n 'token': passwordResetToken,\n 'password': newPassword\n }\n }).done((data) => {\n console.log(data);\n if (data.status.code !== 200) {\n console.log(\"Error: can't update password!\");\n } else {\n console.log(\"Updated password successfully\");\n }\n return data;\n }).fail((data) => {\n console.log(data);\n console.log(\"Updating password failed\");\n return data;\n });\n\n return updatePasswordPromise;\n}", "title": "" }, { "docid": "c1e89efb739d9b456c31c507f185a75f", "score": "0.61933696", "text": "function editPassword(oldPassword, newPassword, invalidNewPasswordHandler) {\n return utils.httpPromiseHandler($http.post('/user/edit/password', {\n oldPassword: oldPassword,\n newPassword: newPassword\n }), function(data) {\n if (angular.isFunction(invalidNewPasswordHandler) && data.code === 80) {\n invalidNewPasswordHandler(data.errors || {});\n }\n else return $q.reject(data.code);\n });\n }", "title": "" }, { "docid": "9bbaa51f90d3930765bc57a36c5e3098", "score": "0.61832505", "text": "function passwordChange(e) {\n setPassword(e.target.value)\n }", "title": "" }, { "docid": "2d9054a6d5b93e2101ddab6dafbcf251", "score": "0.6177842", "text": "function change_pass(){\n\n var current_pass = $(\"#current_password\").val();\n var new1_pass = $(\"#new_password_1\").val();\n var new2_pass = $(\"#new_password_2\").val();\n\n\n // Pass data to the server for a password change\n $.postJSON( Flask.url_for(\"change_password\"), { current_password: current_pass, new_password_1: new1_pass, new_password_2 : new2_pass })\n\n // Notify a user about the result of password change\n .done(function(data) {\n if (data['status'] == 'Password was successfully updated'){\n alerts(data['status'], 'alert alert-success');\n }\n else{\n alerts(data['status'], 'alert alert-danger');\n }\n $(\"#current_password\").val('');\n $(\"#new_password_1\").val('');\n $(\"#new_password_2\").val('');\n });\n}", "title": "" }, { "docid": "ba8423dd5a80c0bcb0ae720ae7947e37", "score": "0.6172509", "text": "function updatePassword(email,password) {\n\tgetConnection(function (err, con) {\n if (err) throw err;\n var sql = \"UPDATE users set password = ? where email = ?\";\n //binding input data into update sql\n var values = [password, email];\n con.query(sql, values, function (err, result) {\n if (err) {\n con.rollback(function() {\n throw err;\n });\n }\n con.commit(function(err) {\n if (err) {\n con.rollback(function() {\n throw err;\n });\n }\n con.release();\n if (err) throw err;\n });\n });\n });\n}", "title": "" }, { "docid": "94e7ef4d1e2628e1cdcbef98930b2ff1", "score": "0.6168759", "text": "onSubmit(e) {\n e.preventDefault();\n\n let email = this.refs.email.value.trim();\n let oldPassword = this.refs.oldPassword.value.trim();\n let newPassword = this.refs.newPassword.value.trim();\n let confirmPassword = this.refs.confirmPassword.value.trim();\n if (newPassword === confirmPassword) {\n Accounts.changePassword(oldPassword, newPassword, (err) => {\n // console.log('forgot password callback',err);\n if (err) {\n this.setState({error: err.reason});\n } else {\n this.setState({error: ''});\n }\n });\n }\nbrowserHistory.push('/q1');\n }", "title": "" } ]
182a064146d90ef6f3b922b819aef6fd
Run configuration methods on the Express instance.
[ { "docid": "6e741611de212be2fecd4f22ec074da2", "score": "0.5823779", "text": "function App() {\n this.express = express_1.default();\n this.middleware();\n this.routes();\n }", "title": "" } ]
[ { "docid": "d408dd82d604b4414322d45cfc88088b", "score": "0.7359419", "text": "constructor() {\n this.app = express();\n this.config();\n }", "title": "" }, { "docid": "8fc387f87fd358546e4eff10de90abbb", "score": "0.68864405", "text": "function Setup(app) {\n\n\n /**\n * Set `development` only settings\n */\n\n app.configure('development', function() {\n\n // Log config settigs load\n log( 'development settings' );\n\n /**\n * Build\n */\n\n app.use(require('lib/build').middleware);\n\n });\n\n\n /**\n * Set `test` only settings\n */\n\n app.configure('test', function() {\n\n // Log config settigs load\n log( 'test settings' );\n\n });\n\n\n /**\n * Set `production` only settings\n */\n\n app.configure('production', function() {\n\n // Log config settigs load\n log( 'production settings' );\n\n /**\n * Set `nowww` middleware helper\n */\n\n app.use( nowww() );\n\n /**\n * Set `native` express compression middleware\n */\n\n app.use( express.compress() );\n\n });\n\n /**\n * Set `common` settings\n */\n\n app.configure(function() {\n // Log config settigs load\n log( 'common settings' );\n\n /**\n * Save config in app\n */\n\n app.set('config', config);\n\n /**\n * Basic HTTP-Auth restriction middleware\n * for production access only.\n */\n\n if (config.auth.basic && config.auth.basic.username && config.auth.basic.password) {\n var basic = auth({\n authRealm: 'Authentication required',\n authList : [config.auth.basic.username+':'+config.auth.basic.password]\n });\n app.use(function(req, res, next) {\n basic.apply(req, res, function(username) {\n return next();\n });\n });\n }\n\n /**\n * Set `public-assets` default path\n */\n\n app.use(express.static(resolve('public')));\n\n app.use(express.urlencoded());\n app.use(express.json());\n\n /**\n * Cross Origin Resource Sharing\n */\n\n var domains = config.corsDomains;\n if (domains && domains.length) {\n var options;\n if (domains.length == 1 && domains[0] == '*') {\n options = null;\n } else {\n options = {\n origin: function(origin, callback){\n var originIsWhitelisted = domains.indexOf(origin) !== -1;\n callback(null, originIsWhitelisted);\n }\n };\n }\n app.use(cors(options));\n }\n\n /**\n * Use `passport` setup & helpers middleware\n */\n\n app.use(passport.initialize());\n\n /**\n * Configure native `express` cookie parser\n */\n\n app.use(cookieParser(config.jwtSecret));\n\n /**\n * JSON Web Tokens\n */\n\n app.use(jwt.middlewares.user());\n\n /**\n * Fetch user locale\n */\n\n app.use(l10n.middleware);\n\n /**\n * Set template local variables\n */\n\n app.use(function(req, res, next) {\n\n // Set user as local var if authenticated\n if(req.isAuthenticated() && req.user) res.locals.citizen = req.user;\n\n res.locals.t = t;\n\n // Call next middleware\n next();\n\n });\n\n /**\n * Ensure SSL redirection if necessary\n */\n\n sslRedirect(app, {\n protocol: config.protocol,\n https: config.https\n });\n\n /**\n * Use `twitter-card` and 'facebook-card' middlewares\n */\n\n app.use(require('lib/twitter-card/middleware'));\n app.use(require('lib/facebook-card/middleware'));\n });\n}", "title": "" }, { "docid": "2b6506680d01bf63f9184061ecb86445", "score": "0.66478646", "text": "constructor() {\n this.app = express();\n this._configureServer();\n this._configfureDatabase();\n this._attachRoutes();\n this._attachErrorHandler();\n }", "title": "" }, { "docid": "90facc4cefccc2221ce71ea083cff2ed", "score": "0.6637604", "text": "function setup() {\n app.configure(function() {\n app.disable('x-powered-by');\n app.use(express.favicon(\"public/favicon.png\"));\n app.use(express.compress());\n app.use(express.bodyParser());\n app.use(express.cookieParser());\n app.use(express.session({\n secret: env.secret || \"default cookie secret is so secretive O_O\",\n cookie: { expires: false }\n }));\n app.use(express.methodOverride());\n app.use(stylus.middleware({ src: \"./public\" }));\n\n // static binding for all user images\n store.findAll(function(err, docs) {\n docs.forEach(function(doc) {\n var name = doc.user_name,\n stat = fs.statSync(userdir + \"/\" + name);\n if(stat.isDirectory) {\n app.use(\"/\" + name + \"/images\", express.static(userdir + \"/\" + name + \"/images\"));\n }\n });\n });\n\n app.use(express.static(\"public\"));\n logger.log(express, app, env);\n });\n\n /**\n * setup server routes:\n */\n require(\"../routes\")(app, env, Flickr);\n\n /**\n * Start the server process:\n */\n app.listen(env.get(\"port\"), function(err) {\n console.log(\"Node server listening on http://127.0.0.1:\" + env.get(\"port\"));\n });\n }", "title": "" }, { "docid": "b48cbcffc329b1232b4009066b9a546d", "score": "0.65184426", "text": "function configure() {\n app.use(bodyParser.json());\n app.use(base, router);\n}", "title": "" }, { "docid": "eeb098dcc8083a2edf0a172074ec5ef4", "score": "0.6489096", "text": "config() {\n // parse application/x-www-form-urlencoded\n this.app.use(bodyParser.urlencoded({ extended: false }));\n // parse application/json\n this.app.use(bodyParser.json());\n this.app.set('port', process.env.PORT || 8080);\n this.app.use(morgan_1.default('dev'));\n this.app.use(cors_1.default());\n this.app.use(express_1.default.json());\n this.app.use(express_1.default.urlencoded({ extended: false }));\n }", "title": "" }, { "docid": "33dbe96830c0f3165e7bdb3dd0164776", "score": "0.6480649", "text": "initConfig() {\n this.port = this.config.serverConfig.getPort();\n this.app.set('port', this.port);\n }", "title": "" }, { "docid": "f3d3d573b606e6129c5cb89276fd2538", "score": "0.64412516", "text": "configure() {\n // add auth middlewares here, e.g. passport\n this.server\n .use(cors())\n .use(morgan(\"combined\"))\n .use(express.urlencoded({ extended: false }))\n .use(express.json())\n .use(`/${this.apiPrefix}`, mainController)\n .use(errorsInterceptor)\n }", "title": "" }, { "docid": "5548d10f2f5b90c6866aee270548fc3f", "score": "0.64204824", "text": "start() {\n return __awaiter(this, void 0, void 0, function* () {\n dotenv_1.default.config();\n this.express.use(body_parser_1.default.urlencoded({ extended: true }));\n this.express.use(body_parser_1.default.json());\n yield this.beforeRoutes(this.express);\n yield this.locateControllers();\n yield this.afterRoutes(this.express);\n this.express.all('*', (req, res) => res.sendStatus(404));\n this.express.listen(process.env.APP_PORT, () => {\n utils_1.log(`Server listening on port: ${process.env.APP_PORT}`);\n });\n });\n }", "title": "" }, { "docid": "c2dd8989b27a7ae59789ebc63a4644f5", "score": "0.6420172", "text": "constructor() {\n this.app = express();\n //configure application\n this.config();\n //add api\n this.db();\n //add api\n this.api();\n //add routes\n this.routes();\n }", "title": "" }, { "docid": "808c08732bcd78d8ff59c5d8253a912b", "score": "0.64049214", "text": "function startExpress() {\n let server;\n const routes = require('./js/routes');\n const app = express();\n \n app.use(express.json());\n app.use(routes);\n app.use(helmet());\n\n server = app.listen(_.get(configuration, 'port'), function() {\n logger.info('app.startExpress(): Listening on port ' + _.get(configuration, 'port'));\n logger.info('app.startExpress(): Protocol: HTTP');\n });\n}", "title": "" }, { "docid": "15ba1600c70e3f448c4b176812f9a07a", "score": "0.63923556", "text": "configure () {\n const RunkitController = this.app.controllers.RunkitController\n const context = this.app.config.runkit.context\n\n context.endpoint = function (request, response) {\n response.end(RunkitController.runkitEndpoint(request))\n }\n }", "title": "" }, { "docid": "06c2755358bc18ba528857a9f8d3f521", "score": "0.6227882", "text": "constructor() {\n this.express = express();\n this.middleware();\n this.routes();\n }", "title": "" }, { "docid": "06c2755358bc18ba528857a9f8d3f521", "score": "0.6227882", "text": "constructor() {\n this.express = express();\n this.middleware();\n this.routes();\n }", "title": "" }, { "docid": "20b1493739a188ec9e7f5059e2fb8ba5", "score": "0.6206402", "text": "config() {\n this.app.use(compression());\n const staticSrc = path.resolve(process.cwd(), 'public');\n this.app.use(express.static(staticSrc, { maxAge: 31557600000 }));\n this.app.use(cors());\n this.app.use(session({\n resave: true,\n saveUninitialized: true,\n secret: secrets_1.SESSION_SECRET,\n store: new MongoStore({\n url: secrets_1.MONGODB_URI,\n autoReconnect: true,\n }),\n }));\n this.app.use(expressValidator());\n this.app.use(passport.initialize());\n this.app.use(passport.session());\n this.app.use(lusca.xframe('SAMEORIGIN'));\n this.app.use(lusca.xssProtection(true));\n this.app.use((req, res, next) => {\n res.on('finish', () => {\n logger.debug(res.statusCode && res.statusCode.toString(), req.method, req.originalUrl);\n });\n next();\n });\n }", "title": "" }, { "docid": "e146fade4b8260d0c7afc3166d0a3294", "score": "0.6198729", "text": "constructor() {\n this.express = express();\n this.middleware();\n this.routes();\n this.express.listen(3005, function () {\n console.log(\"Listening on 3005\");\n });\n }", "title": "" }, { "docid": "0238bac02ffbd1de69a4b44ab81f8215", "score": "0.61616427", "text": "function configureExpress(app) {\n app.configure(function() {\n\n app.use(express.logger());\n app.use(express.cookieParser());\n app.use(express.bodyParser());\n app.use(express.methodOverride());\n \n app.use(passport.initialize());\n app.use(passport.session());\n \n app.use(express.session({userId: \"\", secret: Util.generateConnKey(9)}));\n app.use(express.static(path.join(__dirname, '../www')));\n\n app.use(function(request, response, next) {\n response.header('Access-Control-Allow-Origin', '*');\n response.header('Access-Control-Allow-Methods', 'PUT,GET,POST,DELETE,OPTIONS');\n response.header('Access-Control-Allow-Headers', 'Content-Type,X-Requested-With');\n\n next();\n });\n\n app.use(app.router);\n app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));\n });\n}", "title": "" }, { "docid": "c5a67423db7b257c8e5dcaabde6c938b", "score": "0.6159562", "text": "constructor() {\n this.express = express();\n this.middleware();\n this.routes();\n }", "title": "" }, { "docid": "f76cea3d6a8a4a500e2bfd28bfe14f6c", "score": "0.6123142", "text": "function init_app() {\n\t// all environments\n\tapp.set('port', process.env.PORT || 8080);\n\n\t// Use Jade to do views\n\tapp.set('views', __dirname + '/views');\n\tapp.set('view engine', 'jade');\n\n\tapp.use(express.favicon());\n\t// Set the express logger: log to the console in dev mode\n\tapp.use(express.logger('dev'));\n\n\tapp.use(express.json());\n\tapp.use(express.urlencoded());\n\tapp.use(express.cookieParser());\n\tapp.use(express.session({ secret: 'groupbyawesomeness' }));\n\tapp.use(express.bodyParser());\n\tapp.use(express.methodOverride());\n\tapp.use(app.router);\n\tapp.use(express.static(path.join(__dirname, 'public')));\n\n\t// Use Stylus, which compiles .styl --> CSS\n\tapp.use(stylus.middleware(\n\t{ src: __dirname + '/public'\n\t, compile: compile\n\t}\n\t));\n\n\t// development only\n\tif ('development' == app.get('env')) {\n\t\tapp.use(express.errorHandler());\n\t}\n}", "title": "" }, { "docid": "26c85a38589e4029c43404b29e49637a", "score": "0.6100504", "text": "run() {\n\t\tif (module === require.main) {\n\t\t\tthis.httpserver.listen(this.port);\n\t\t\tconsole.log(`Server Listening on port ${this.port}`);\n\t\t}\n\n\t\tmodule.exports = this.app;\n\t}", "title": "" }, { "docid": "cb8e4a332e5d29e2471168fe6e56526a", "score": "0.6099332", "text": "function setup_routes_and_start() {\n\tlogger = tools.log_lib.build_server_logger(ev);\n\ttools.client_logger = tools.log_lib.build_client_logger(ev);\t// rebuild loggers using db settings\n\n\t// rebuild tools with the log level from settings db (this logger will have the client's log level instead of the default log level)\n\ttools.ot_misc = require('./libs/ot_misc.js')(logger, tools);\n\ttools.couch_lib = require('./libs/couchdb.js')(logger, tools, process.env.DB_CONNECTION_STRING);\n\ttools.http_metrics = require('./libs/http_metrics.js')(logger, tools, metric_opts);\n\n\t// http_metrics needs to be one of the first app.use() instances, as soon as possible after ev.update()\n\tapp.use(tools.http_metrics.start);\n\tapp.use(setHeaders);\n\n\t// --- Graceful Shutoff --- // - this route should be right after http_metrics\n\tapp.use((req, res, next) => {\n\t\tif (req.path.includes('/requests/start')) {\t\t\t\t\t// let this route go regardless of state, else we can't ever start it again...\n\t\t\treturn next();\n\t\t} else if (tools.ot_misc.server_is_closed()) {\t\t\t\t// server is performing a graceful shutoff, reject request\n\t\t\tlogger.warn('[http] server is shutting off gracefully, rejecting new request');\n\t\t\tres.status(503).json({ message: 'not accepting requests at this time. process is in graceful shutoff. ' + process.env.ATHENA_ID });\n\t\t} else {\n\t\t\treturn next();\n\t\t}\n\t});\n\n\t// browser cache constants\n\tconst DAYS_CACHE_STAGING = 7;\t\t\t\t\t\t// number of days to have the browser cache static content in a staging env\n\tconst DAYS_CACHE_PROD = 30;\t\t\t\t\t\t\t// number of days to have the browser cache static content in a production env\n\tconst DAY_SECS = 60 * 60 * 24;\t\t\t\t\t\t// number of seconds in a day\n\tconst cache_max_age_secs = (ev.ENVIRONMENT === 'prod') ? (DAYS_CACHE_PROD * DAY_SECS) : (DAYS_CACHE_STAGING * DAY_SECS);\n\tconst cache_max_age_str = (ev.ENVIRONMENT === 'prod') ? (DAYS_CACHE_PROD + 'd') : (DAYS_CACHE_STAGING + 'd');\n\n\tif (!ev.DISABLED_COMPACTION) {\n\t\tconst comp_delay = Math.round(1000 * DAY_SECS - (1000 * 60 * 60 * Math.random()));\n\t\tlogger.debug('[db] compaction will run in', tools.misc.friendly_ms(comp_delay));\n\t\tsetTimeout(() => {\n\t\t\tev.compact_all_dbs();\t\t\t\t\t\t\t\t\t\t\t\t// compact dbs after running for 24ish hours (23-24hrs)\n\t\t}, comp_delay);\n\t}\n\n\tif (ev.TRUST_PROXY) {\n\t\tlogger.debug('[startup] setting trust proxy to:', JSON.stringify(ev.TRUST_PROXY));\n\t\tapp.set('trust proxy', ev.TRUST_PROXY);\t\t\t\t\t\t\t\t// trust first local proxy\n\t}\n\n\t// function that serves our react app (this is apollo)\n\tfunction serve_index(req, res, next) {\n\t\tres.setHeader('Cache-Control', 'public, max-age=' + cache_max_age_secs);\n\t\tres.sendFile(tools.path.join(__dirname, '..', 'apollo', 'build', 'index.html'));\n\t}\n\n\t//---------------------\n\t// API Rate Limiters\n\t//---------------------\n\tconst rate_limiter_reqs_low = make_rate_limiter('[Session Requests] exceeded the low volume rate limit', ev.MAX_REQ_PER_MIN);\n\tconst rate_limiter_reqs_high = make_rate_limiter('[Session Requests] exceeded the high volume rate limit', ev.MAX_REQ_PER_MIN * 16);\n\tconst rate_limiter_ak_reqs_low = make_rate_limiter('[AK Requests] exceeded the low volume rate limit', ev.MAX_REQ_PER_MIN_AK);\n\tconst rate_limiter_ak_reqs_high = make_rate_limiter('[AK Requests] exceeded the high volume rate limit', ev.MAX_REQ_PER_MIN_AK * 4);\n\n\t// add rate limit middleware\n\tapp.use((req, res, next) => {\n\t\tconst route_exceptions = [\t\t\t\t// some routes should be given the higher rate limit\n\t\t\t'^/api/v[123]/proxy', \t\t\t\t// proxy route used for getting node status, method is POST but give it the high rate-limit\n\t\t\t'^/grpcwp/',\t\t\t\t\t\t// proxy route used to talk to peers, like get blocks/txs, method is POST but give it the high rate-limit\n\t\t\t'^/configtxlator/',\t\t\t\t\t// not positive we need this route, but I think we are decoding txs using a POST\n\t\t\t'^/api/v[123]/components/status', \t// bulk status route, method is POST but give it the high rate limit\n\t\t];\n\t\tlet is_high_volume_route = false;\n\n\t\tif (req.method === 'GET') {\n\t\t\tis_high_volume_route = true;\n\t\t} else {\n\t\t\tfor (let i in route_exceptions) {\n\t\t\t\tif (RegExp(route_exceptions[i]).test(req.path)) {\n\t\t\t\t\tis_high_volume_route = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (req.path.indexOf('/ak/') === 0) {\t\t\t\t\t\t// /ak/api/v1 routes\n\t\t\tif (is_high_volume_route === true) {\n\t\t\t\treturn rate_limiter_ak_reqs_high(req, res, next);\n\t\t\t} else {\n\t\t\t\treturn rate_limiter_ak_reqs_low(req, res, next);\n\t\t\t}\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t// all other routes\n\t\t\tif (is_high_volume_route === true) {\n\t\t\t\treturn rate_limiter_reqs_high(req, res, next);\n\t\t\t} else {\n\t\t\t\treturn rate_limiter_reqs_low(req, res, next);\n\t\t\t}\n\t\t}\n\t});\n\n\tapp.options('/ak/', cors());\t\t\t\t\t\t\t\t\t// enable pre-flight cors OPTIONS res\n\tapp.use('/ak/', cors());\t\t\t\t\t\t\t\t\t\t// cors * only on api routes\n\n\t// routes that do not need to be protected nor need user context go before setup_session()\n\tapp.get(['/version.txt', '/releaseNotes.json'], (req, res) => {\t\t\t\t\t\t\t\t// list files in public folder that should not be cached\n\t\tno_cache_headers(res);\n\t\tif (req.path && req.path.includes('.txt')) {\n\t\t\tres.setHeader('Content-Type', 'text/plain; charset=UTF-8');\n\t\t} else if (req.path && req.path.includes('.json')) {\n\t\t\tres.setHeader('Content-Type', 'application/json; charset=UTF-8');\n\t\t}\n\t\tres.send(tools.fs.readFileSync(tools.path.join(__dirname + '/public/', req.path)));\n\t});\n\n\tapp.use('/data/', tools.express.static(__dirname + '/../apollo/build/data', { maxAge: cache_max_age_str })); \t\t// apollo dir\n\tapp.use('/static/', tools.express.static(__dirname + '/../apollo/build/static', { maxAge: cache_max_age_str })); \t// apollo dir\n\tapp.use(tools.express.static(__dirname + '/../stitch/dist', { maxAge: cache_max_age_str })); \t\t\t\t\t\t// serve stitch's directory\n\tapp.use(tools.express.static(__dirname + '/public', { maxAge: cache_max_age_str })); \t\t\t\t\t\t\t// setup athena's static directory\n\tapp.get('/favicon.ico', (req, res) => {\n\t\tres.setHeader('Cache-Control', 'public, max-age=' + cache_max_age_secs);\n\t\tres.sendFile(tools.path.join(__dirname, '..', 'apollo', 'build', 'favicon.ico'));\n\t});\n\tapp.head('/', function (req, res) {\n\t\tres.status(204).end();\n\t});\n\n\tsetup_session();\n\tsetup_debug_log();\n\tsetup_passport();\n\n\t// parse ace_config on homepage route, its not served here though - this might be legacy...\n\tapp.get('/', function (req, res, next) {\n\t\tconst url_parts = tools.url.parse(req.url, true);\n\t\tif (url_parts.query && url_parts.query['ace_config']) {\n\t\t\tlogger.debug('[startup] parsed ace_config params:', url_parts.query);\n\t\t\ttry {\n\t\t\t\treq.session.ace_config = JSON.parse(url_parts.query['ace_config']);\n\t\t\t} catch (e) { }\n\t\t}\n\t\tnext();\n\t});\n\n\t// ---------------\n\t// Add other libs to tools\n\t// ---------------\n\ttools.caches = require('./app_setup/cache.js')(logger, ev, tools);\n\ttools.ca_lib = require('./libs/ca_lib.js')(logger, ev, tools);\n\ttools.proxy_lib = require('./libs/proxy_lib.js')(logger, ev, tools);\n\ttools.component_lib = require('./libs/component_lib.js')(logger, ev, tools);\n\ttools.event_tracker = require('./libs/event_tracker.js')(logger, ev, tools);\n\ttools.middleware = require('./libs/middleware/middleware.js')(logger, ev, tools);\n\ttools.cryptoSuite = require('./libs/fabric_ca_services/create_crypto_suite.js')(logger, ev, tools).createCryptoSuite();\n\ttools.enroll_lib = require('./libs/fabric_ca_services/enroll_lib.js')(logger, ev, tools);\n\ttools.signing_lib = require('./libs/fabric_ca_services/signing_lib.js')(logger, ev, tools);\n\ttools.fabric_utils = require('./libs/fabric_ca_services/fabric_utils.js')(logger, ev, tools);\n\ttools.key_lib = require('./libs/fabric_ca_services/key_lib.js')(logger, ev, tools);\n\ttools.asn1 = js_rsa.asn1;\n\ttools.KEYUTIL = js_rsa.KEYUTIL;\n\ttools.ECDSA = js_rsa.ECDSA;\n\ttools.js_rsa = js_rsa;\n\ttools._ecdsa = new EC(_ecdsaCurve);\n\ttools.pillow = require('./libs/pillow_talk.js')(logger, ev, tools, { db_name: ev.DB_SYSTEM });\n\ttools.notifications = require('./libs/notifications_lib.js')(logger, ev, tools);\n\ttools.deployer = require('./libs/deployer_lib.js')(logger, ev, tools);\n\ttools.comp_fmt = require('./libs/comp_formatting_lib.js')(logger, ev, tools);\n\ttools.webhook = require('./libs/webhook_lib.js')(logger, ev, tools);\n\ttools.user_preferences = require('./libs/user_preferences_lib.js')(logger, ev, tools);\n\ttools.auth_scheme = require('./libs/auth_scheme_lib.js')(logger, ev, tools);\n\ttools.keys_lib = require('./libs/keys_lib.js')(logger, ev, tools);\n\ttools.logging_apis_lib = require('./libs/logging_apis_lib.js')(logger, ev, tools);\n\ttools.notification_apis_lib = require('./libs/notification_apis_lib.js')(logger, ev, tools);\n\ttools.other_apis_lib = require('./libs/other_apis_lib.js')(logger, ev, tools);\n\ttools.permissions_lib = require('./libs/permissions_lib.js')(logger, ev, tools);\n\ttools.signature_collection_lib = require('./libs/signature_collection_lib.js')(logger, ev, tools);\n\ttools.auth_lib = require('./libs/authentication_lib.js')(logger, ev, tools);\n\ttools.auth_header_lib = require('./libs/auth_header_lib.js')(logger, ev, tools);\n\ttools.validate = require('./libs/validation_lib.js')(logger, ev, tools, { files: ev.OPEN_API_DOCS });\n\ttools.patch_lib = require('./libs/patch_lib')(logger, ev, tools);\n\ttools.perf = require('./libs/performance_lib')(logger, ev, tools);\n\ttools.segment_lib = require('./libs/segment_lib.js')(logger, ev, tools);\n\ttools.activity_tracker = require('./libs/activity_tracker.js')(logger, ev, tools);\n\ttools.dbs = require('./libs/db_backup.js')(logger, ev, tools);\n\ttools.lock_lib = require('./libs/lochness.js')(logger, ev, tools);\n\ttools.lockout = require('./libs/lockout.js')(logger, ev, tools);\n\n\tupdate_settings_doc(() => {\n\t\tsetup_pillow_talk();\n\t});\n\n\t// Used to update the passport when the URL changes\n\ttools.update_passport = () => {\n\t\tsetup_passport();\n\t};\n\n\t// run any db patches\n\t// delay call on start to scatter calls from multiple athenas starting at once (though that won't matter, 409 conflicts are harmless here)\n\tsetTimeout(() => {\n\t\ttools.patch_lib.apply();\n\t}, 1000 * Math.random() * 10);\n\n\t//---------------------------------------------------------------------------------------------\n\t// Most routes here (routes that need a session/user context)\n\t//---------------------------------------------------------------------------------------------\n\tapp.get(['/', '/index.html'], (req, res, next) => {\t\t\t\t\t\t\t\t// serve apollo's output file\n\t\treturn serve_index(req, res, next);\n\t});\n\tapp.get(['/package-lock.json', '/package.json', '/npm_ls_prod.txt'], tools.middleware.verify_settings_action_session, (req, res) => {\n\t\tconst content_type = (req.path.includes('.json')) ? 'application/json; charset=utf-8' : 'text/plain; charset=UTF-8';\n\t\tno_cache_headers(res);\n\t\tres.setHeader('Content-Type', content_type);\n\t\tres.send(tools.fs.readFileSync(tools.path.join(__dirname, req.path)));\t\t// used to debug versions, only logged in users\n\t});\n\n\t// json parsing error\n\tapp.use((error, req, res, next) => {\n\t\tif (error && error.toString().includes('Unexpected token')) {\t\t\t\t// body parser creates this error if given malformed json\n\t\t\tlogger.error('[body-parser.js] invalid json', error.toString());\n\t\t\treturn res.status(400).json({ statusCode: 400, msg: 'invalid json', details: error.toString() });\n\t\t} else {\n\t\t\treturn next();\n\t\t}\n\t});\n\n\t// lockout\n\tapp.use((req, res, next) => {\n\t\treturn tools.lockout.reject_if_exceeded(req, res, next);\n\t});\n\n\t// valid routes\n\tev.HEALTHCHECK_ROUTE = healthcheck_route;\t\t// pass route to lib\n\tapp.use('/', require('./routes/authentication.js')(logger, ev, tools, passport));\n\tapp.use('/', require('./routes/auth_scheme_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/ca_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/user_preferences_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/keys_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/logging_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/other_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/component_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/legacy/component_apis_v1.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/proxy_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/deployer_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/legacy/deployer_apis_v1.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/notification_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/permission_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/signature_collection_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/webhook_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/performance_apis.js')(logger, ev, tools));\n\tapp.use('/', require('./routes/db_backups_apis.js')(logger, ev, tools));\n\n\t// setup http metrics and build metrics route\n\ttools.http_metrics.set_wildcard_routes(build_wildcard_routes(app));\n\ttools.http_metrics.enable_http_metrics(ev.HTTP_METRICS_ENABLED);\n\tev.HTTP_METRICS_ROUTE = http_metrics_route.replace(/\\/:[^/]+\\?/, '');\t\t// pass it into ev so we can grab it outside of app.js\n\tapp.get(http_metrics_route, tools.middleware.verify_logs_action_session, (req, res, next) => {\n\t\tget_metrics_via_pillow_talk(req, res, next);\n\t});\n\tapp.get('/ak' + http_metrics_route, tools.middleware.verify_logs_action_ak, (req, res, next) => {\n\t\tget_metrics_via_pillow_talk(req, res, next);\n\t});\n\tlet clear_metrics_timer = null;\n\tfunction get_metrics_via_pillow_talk(req, res, next) {\n\t\tif (ev.HTTP_METRICS_ENABLED !== true) {\n\t\t\treturn next();\n\t\t} else {\n\t\t\tlogger.debug('[metrics] using pillow talk to ask for access logs');\n\t\t\tconst msg = {\n\t\t\t\tmessage_type: 'req_http_metrics',\n\t\t\t\tmessage: 'asking for all athena processes to send their access logs',\n\t\t\t\tby: tools.misc.censorEmail(tools.middleware.getEmail(req)),\n\t\t\t\tuuid: tools.middleware.getUuid(req),\n\t\t\t\ttx_id: Date.now(),\t\t\t\t\t\t\t\t\t\t\t\t// the tx_id must always increase, else we may overwrite the wrong data\n\t\t\t};\n\t\t\ttools.pillow.broadcast(msg);\n\n\t\t\tclearTimeout(clear_metrics_timer);\t\t\t\t\t\t\t\t\t// only need one of these active at a time, clear to prevent duplicates\n\t\t\tclear_metrics_timer = setTimeout(() => {\t\t\t\t\t\t\t// delay long enough to aggregate data, its a setting, use your best guess\n\t\t\t\tres.status(200).json(tools.http_metrics.get_aggregated_metrics(req.params.days));\t// send the data we have\n\t\t\t\ttools.http_metrics.clear_aggregated_metrics();\t\t\t\t\t// clear data so we don't infinitely append\n\t\t\t}, ev.HTTP_METRICS_WAIT);\n\t\t}\n\t}\n\n\t// 404 on api routes\n\tapp.use(['/ak/api', '/api'], function (req, res, next) {\t\t\t\t\t// any other API request gets caught here...\n\t\tlogger.debug('I can\\'t do that dave - api route unknown');\n\t\treturn res.status(404).json({ statusCode: 404, msg: 'route not found' });\n\t});\n\n\t// 404 on GET reqs - have apollo handle it\n\tapp.get('*', function (req, res, next) {\t\t\t\t\t\t\t\t\t// any other request gets caught here... apollo will deal with it\n\t\tconst file_extensions = ['.js', '.html', '.css', '.map', '.png', '.svg', '.ico', '.jpg', '.jpeg', '.txt', '.json', '.scss', '.woff2'];\n\t\tfor (let i in file_extensions) {\n\t\t\tif (req.path.indexOf(file_extensions[i]) >= 0) {\t\t\t\t\t// if its a file request and we made it this far..\n\t\t\t\treturn next();\t\t\t\t\t\t\t\t\t\t\t\t\t// send these req to the 404 page\n\t\t\t}\n\t\t}\n\t\treturn serve_index(req, res, next);\n\t});\n\n\t// 404 generic req - 404 GET reqs are handled above, all other methods handled here\n\tapp.use(function (req, res, next) {\n\t\tlogger.debug('I can\\'t do that dave - route unknown');\n\t\treturn res.status(404).send('404 Route Not Found :(');\n\t});\n\n\t// load protobuf files, needed for signature validation\n\tprotobufjs.load('../stitch/dist/v2.0-protobuf-bundle.json', (pb_error, pb_root) => {\n\t\tif (pb_error) {\n\t\t\tlogger.error('[startup] could not load pb files, error:', pb_error);\n\t\t} else {\n\t\t\ttools.protobufjs = pb_root;\n\t\t}\n\t\tsetup_tls_and_start_app(1);\n\t});\n\tsetTimeout(() => {\n\t\ttry {\n\t\t\tlogger.debug('[startup] version.txt file:\\n' + tools.fs.readFileSync('./public/version.txt', 'utf8'));\n\t\t} catch (e) {\n\t\t\tlogger.debug('[startup] unable to load version file, (this is fine) file error:', e);\n\t\t}\n\t}, 500);\n\n\t// on startup get the list of deployer components - this preheats the cache\n\tsetTimeout(() => {\n\t\tload_component_cache();\n\t}, 1000 * Math.random() * 60 * 2);\t\t\t\t\t\t\t\t// delay call on start, to scatter calls from multiple athenas starting at once\n\n\tclearInterval(load_cache_interval);\n\tload_cache_interval = setInterval(() => {\n\t\tload_component_cache();\n\t\ttools.patch_lib.auto_upgrade_orderers();\n\t}, (1000 * 60 * 60 * 24) + (1000 * Math.random() * 60 * 2));\t// once per day + scatter calls from multi athenas\n}", "title": "" }, { "docid": "3544909e4f9ce407355c0cc881df99a0", "score": "0.6067932", "text": "configureHealthCheck() {\n this.server.get(this.healthCheckUrl, (req, res, next) => {\n res.send(200, `${this.config.app.name} is running with ${this.config.app.env} environment on ${os.hostname()}`);\n return next();\n });\n }", "title": "" }, { "docid": "04d098a1e3569585b90c15b337d1746d", "score": "0.6052169", "text": "function init_app() {\n\t// all environments\n\tapp.set('port', process.env.PORT || 8080);\n\n\t// Use Jade to do views\n\tapp.set('views', __dirname + '/views');\n\tapp.set('view engine', 'jade');\n\n\tapp.use(express.favicon());\n\t// Set the express logger: log to the console in dev mode\n\tapp.use(express.logger('dev'));\n\tapp.use(express.bodyParser());\n\tapp.use(express.methodOverride());\n\tapp.use(app.router);\n\t// Use Stylus, which compiles .styl --> CSS\n\tapp.use(stylus.middleware(\n\t { src: __dirname + '/public'\n\t , compile: compile\n\t }\n\t));\n\tapp.use(express.static(path.join(__dirname, 'public')));\n\n\t// development only\n\tif ('development' == app.get('env')) {\n\t app.use(express.errorHandler());\n\t}\n\n}", "title": "" }, { "docid": "da70d51d933711b50319320c0e233104", "score": "0.6030972", "text": "function configuration(){}", "title": "" }, { "docid": "1e63510be1d94082fa18d64af270edd5", "score": "0.60140693", "text": "configureMiddlewares() {\n // applying the web server plugins\n this.server.use(this.baseServer.plugins.acceptParser(this.server.acceptable));\n this.server.use(this.baseServer.plugins.authorizationParser());\n this.server.use(this.baseServer.plugins.gzipResponse());\n this.server.use(this.baseServer.plugins.queryParser());\n this.server.use(this.baseServer.plugins.bodyParser());\n\n // enable the automatic request and response logs\n RequestAndResponseLogger.configure(this.server);\n\n // enable the limit of the quantity of requests per user in a time interval\n if (this.config.throttle) this.server.use(this.baseServer.plugins.throttle(this.config.throttle));\n\n // enable the origin plugin\n if (this.origin) this.server.use(this.origin.proccess.bind(this.origin));\n\n this.configureCors();\n\n this.configureCache();\n\n this.configureSession();\n }", "title": "" }, { "docid": "4be06b0e7120473ae88c376476df2463", "score": "0.5997017", "text": "function Express() {\n //@ts-ignore\n this.express = express();\n this.mountDotEnv();\n this.mountMiddlewares();\n this.mountRoutes();\n }", "title": "" }, { "docid": "5f0416075a1ff22ea06018b12daf4e31", "score": "0.59969735", "text": "_startExpress() {\n let app = express();\n\n // Install the middlewares.\n mongoose.Promise = Promise;\n // app.use(favicon('www/images/favicon.ico'));\n _.noop(favicon);\n app.use(JsonParser.middleware());\n app.use(compression());\n app.use(RestLogger.middleware());\n\n // Start listening and set up the Express server routes.\n return SystemService.systemInfo\n .then(info => {\n let version = info.version;\n let serverOpts = info.api;\n\n return new Promise(resolve => {\n this._server = app.listen(serverOpts.port, () => {\n routes.initRoutes(app);\n\n console.info(`Application server v${version} started. ` +\n `Listening for requests on port ${serverOpts.port}.\\n` +\n `Use ctrl-c to quit.`);\n resolve();\n });\n\n // Use stoppable to allow the server to end all idle keep-alive\n // connections when it closes.\n stoppable(this._server);\n });\n });\n }", "title": "" }, { "docid": "f2cd37eb1b7cb85615e7afe4abe5b158", "score": "0.59843546", "text": "constructor() {\n this.router = express_1.Router();\n this.config();\n }", "title": "" }, { "docid": "d8685631c18f313b6a126804c22c216d", "score": "0.59839696", "text": "function configureExpress (connection) {\n\n var router = express.Router();\n app.use('/api', router);\n restRouter(router, connection);\n startServer();\n}", "title": "" }, { "docid": "eedce005cec12857eecd6cfa0b0a2e8c", "score": "0.5961666", "text": "function init() {\n configureBodyParser();\n configureEndPoints();\n configureBrowserPolyFills();\n\n // Configure the server to begin listening for requests.\n app.listen(3000, () => {\n console.log('Server running on port 3000');\n });\n}", "title": "" }, { "docid": "6faf62f6a651f931d70bda77ca783418", "score": "0.5930296", "text": "function setAppRoutes() {\n\t/**\n\t * Default API Entry Point.\n\t */\n\tapp.get('/', (req, res) => {\n\t\tres.json({\n\t\t\tmessage: `${APP_CONFIG.NAME} v${APP_CONFIG.VERSION}`,\n\t\t});\n\t});\n\n\troutes(app, server);\n\n\t/** Express default error handlers */\n\tapp.use(NotFoundHandler());\n\tapp.use(GlobalErrorHandler());\n}", "title": "" }, { "docid": "ac531c9b140afe782b0f6224574d9cf3", "score": "0.5918078", "text": "init({ config, db }) {\n const app = this.app\n\n // Initialize Express middleware\n this.initMiddleware(config)\n\n // Initialize Helmet security headers\n this.initHelmetHeaders()\n\n // Initialize CORS\n this.initCrossDomain(config)\n\n // Initialize passport configuration\n passport.init({ app, config, db })\n\n // Initialize Graphql\n this.initGraphQL({ config, db })\n\n // Initialize routes\n this.initRoutes({ config, db })\n\n // Initialize error routes\n this.initErrorRoutes()\n\n return app\n }", "title": "" }, { "docid": "f4d9c43451ac1b7446cf6187c7ad69e0", "score": "0.5914717", "text": "constructor() {\n this.server = express();\n this.middlewares();\n this.routes();\n }", "title": "" }, { "docid": "8f2d16817b2276cc399eee432530c942", "score": "0.59009004", "text": "init () {\n this.app = express()\n }", "title": "" }, { "docid": "d03e179f05366b9c808f420d102ef42b", "score": "0.58940256", "text": "static setupRoutes() {\n // this is a route. the asterisk denotes that the route applies to \n // all incoming path requests.\n //\n // *** IMPORTANT ***\n //\n // it's very *important* the order in which routes are added, since \n // an incoming request will be checked against the available routes in\n // order!\n Server.app.all('*', function(req, res, next) {\n console.log('Requested path: ', req.path); // the reuested URI\n console.log('Query string: ', req.query); // the querystring for GET requests\n\n // our req object tells about the HTTP request.\n // our res object gives us access to control the response.\n // our next object allows us to programmatically goto the next route\n next(); // goto the next routes\n\n // if we didn't call next, we'd never fulfill the request!\n });\n }", "title": "" }, { "docid": "76c579f5c52001fffa79eb759836f1ba", "score": "0.58686364", "text": "init() {\n acpManager.app = express();\n acpManager.app.use(express.json());\n acpManager.app.use(express.urlencoded({ extended: true }));\n acpManager.app.listen(acpManager.port, () => {\n alt.log(\"ACP Started at : \" + acpManager.getAcpAddress());\n acpManager.registerListeners();\n });\n }", "title": "" }, { "docid": "526a18eb8efefefb291d16a9ac4c4864", "score": "0.5862552", "text": "function main() {\n const app = express() // Export app for other routes to use\n const handlers = new HandlerGenerator()\n const port = process.env.PORT || 5000\n app.use(bodyParser.urlencoded({ // Middleware\n extended: true,\n }))\n app.use(bodyParser.json())\n // Routes & Handlers\n app.post('/login', handlers.login)\n app.get('/', checkToken, handlers.index)\n app.listen(port, () => console.log(`Server is listening on port: ${port}`))\n}", "title": "" }, { "docid": "2ae3626ccb4b08543b1953a6944d3f7b", "score": "0.58456314", "text": "async initialise() {\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // //\n // Config file parsing //\n // //\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // Parse the config file\n let yamlData\n try {\n yamlData = await parseConfigFile(this.configFile);\n } catch (err) {\n this.logger.error('Config file is invalid.');\n this.logger.error(err.message);\n\n throw err;\n }\n\n // Resources\n const resources = parseResources(yamlData['x-walder-resources'], this.cwd, this.logger);\n\n // Data sources\n const graphQLLDHandler = new GraphQLLDHandler(this.logger);\n const dataSources = await parseDataSources(yamlData['x-walder-datasources'], graphQLLDHandler, resources['pipe-modules'],{cache: this.cache});\n\n\n // Parse the default error pages section\n const defaultErrorPages = parseHTML(yamlData['x-walder-errors'], resources.views, resources.layouts);\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // //\n // Config file validation //\n // //\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n this.templateLoader = new TemplateLoader();\n const validator = new Validator({templateLoader: this.templateLoader, logger:this.logger});\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // //\n // Start static server //\n // //\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n // Start static file server\n this.logger.info('Starting static server...');\n this.app.use(express.static(resources.public));\n this.logger.info('Static server running.');\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // //\n // Express Route initialisation //\n // //\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n this.requestHandler = new RequestHandler(this.logger, graphQLLDHandler, this.templateLoader);\n\n // Iterate over routes\n for (let path in yamlData.paths) {\n this.logger.info('Parsing route %s', path);\n for (let method in yamlData.paths[path]) {\n this.logger.info(' - Parsing method %s', method);\n\n // Parse required route, GraphQL-LD and postprocessing info\n this.logger.verbose(' * Parsing the express route information');\n const routeInfo = parseRoute(path, method);\n\n this.logger.verbose(' * Parsing the parameters description');\n const parameters = parseParameter(yamlData.paths[path][method].parameters);\n\n this.logger.verbose(' * Parsing the GraphQL-LD information');\n const graphQLLDInfo = parseGraphQLLD(yamlData.paths[path][method]['x-walder-query'], {defaultDataSources: dataSources, cache: this.cache, lenient: this.lenient, parameters});\n\n this.logger.verbose(' * Parsing the pipe modules section');\n const pipeModules = parsePipeModule(yamlData.paths[path][method]['x-walder-postprocessing'], resources['pipe-modules']);\n\n this.logger.verbose(' * Parsing the html template(s)');\n const htmlInfoDictionary = parseHTML(yamlData.paths[path][method].responses, resources.views, resources.layouts);\n\n // Validate current path and build the cache - method\n this.logger.verbose(' * Validating the current path and method');\n await validator.validateAll({routeInfo, parameters, graphQLLDInfo, htmlInfoDictionary});\n\n // Complete the htmlInfoDictionary object with possible missing default error pages\n for (let statusCode in defaultErrorPages) {\n if (!(statusCode in htmlInfoDictionary)) {\n htmlInfoDictionary[statusCode] = defaultErrorPages[statusCode];\n }\n }\n\n // Load remote and local pipe modules\n try {\n const pipeFunctions = PipeModuleLoader.load(pipeModules);\n\n const callBack = this.requestHandler.handle(graphQLLDInfo, pipeFunctions, htmlInfoDictionary);\n\n switch (method) {\n case 'get':\n this.app.get(routeInfo.path, callBack);\n break;\n case 'post':\n this.app.post(routeInfo.path, callBack);\n break;\n case 'put':\n this.app.put(routeInfo.path, callBack);\n break;\n case 'patch':\n this.app.patch(routeInfo.path, callBack);\n break;\n case 'head':\n this.app.head(routeInfo.path, callBack);\n break;\n default:\n throw Error(util.format('\"%s\" is not a supported HTTP routing method.', method));\n }\n } catch (e) {\n this.logger.error(e.message);\n }\n }\n }\n\n // Validate default error pages\n this.logger.verbose('Validating the default error pages');\n await validator.validateAll({routeInfo: new RouteInfo('default error pages', 'any'), htmlInfoDictionary: defaultErrorPages});\n\n // Finish the input validation\n validator.finish();\n\n // The 404 Route\n this.app.get('*', this.requestHandler.handle({}, [], defaultErrorPages, 404));\n }", "title": "" }, { "docid": "a67abcc35f5829f52ab938338359c872", "score": "0.58439165", "text": "constructor() {\n /* ENROUTADOR */\n this.router = express_1.Router();\n this.config();\n }", "title": "" }, { "docid": "ae541cbcdfe1ef6eaa77536298e049af", "score": "0.5839496", "text": "function setupExpress() {\n const app = express();\n app.use(bodyParser.json());\n\n const PORT = process.env.PORT || 3000;\n\n app.use(express.static('dist'));\n\n const httpServer = app.listen(PORT, () => {\n console.log(`Up and running on port ${PORT}`);\n });\n return httpServer;\n}", "title": "" }, { "docid": "a0a89c506ae91adb1ad9b3456e8b4d7e", "score": "0.5838399", "text": "function getConfiguredApp(config, ezConfig) {\n var app = express();\n\n app.use(express.cookieParser());\n if(config.use_redis_session){\n require('./lib/session-redis')(app, express, constants, config, ezConfig, winston);\n } else {\n app.use(express.session({ secret: config.cookie_secret }));\n }\n\n // Authentication\n //require('./lib/basic-auth').configureBasic(express, app, config);\n //require('./lib/google-oauth').configureOAuth(express, app, config);\n //require('./lib/cas-auth.js').configureCas(express, app, config);\n require('./lib/ezsecurity-auth.js').configureEzSecurity(express, app, config, ezConfig, mustache, winston);\n\n // Setup ES proxy\n if (!config.es_host) {\n config.es_host = ezConfig.getString(constants.elasticSearch.ezConfigHost);\n }\n if (!config.es_port) {\n config.es_port = ezConfig.getString(constants.elasticSearch.ezConfigPort);\n }\n require('./lib/es-proxy').configureESProxy(app, config.base_relative_path, config.es_host, config.es_port,\n config.es_username, config.es_password, winston);\n // Serve config.js for kibana3\n // We should use special config.js for the frontend and point the ES to __es/\n app.get(path.join(config.base_relative_path, '/config.js'), function kibana3configjs(req, res) {\n function getKibanaIndex() {\n var raw_index = config.kibana_es_index;\n var user_type = config.which_auth_type_for_kibana_index;\n var user;\n if (raw_index.indexOf('%user%') > -1) {\n if (user_type === 'google') {\n user = req.googleOauth.id;\n } else if (user_type === 'basic') {\n user = req.user;\n } else if (user_type === 'cas') {\n user = req.session.cas_user_name;\n } else {\n user = 'unknown';\n }\n return raw_index.replace(/%user%/gi, user);\n } else {\n return raw_index;\n }\n }\n res.setHeader('Content-Type', 'application/javascript');\n res.end(\"define(['settings'], \" +\n \"function (Settings) {'use strict'; return new Settings({elasticsearch: '\"+path.join(config.base_relative_path, '__es')+\"', default_route : '/dashboard/file/ezlogger.json',\" +\n \"kibana_index: '\" +\n getKibanaIndex() +\n \"', default_search_index: '[\"+req.session.EZBAKE_APPLICATION+\"-]YYYY.MM.DD', panel_names: ['histogram', 'map', 'pie', 'table', 'filtering', 'timepicker', 'text', 'hits', 'column', 'trends', 'bettermap', 'query', 'terms', 'sparklines'] }); });\");\n });\n\n // Serve all kibana3 frontend files\n app.use(express.compress());\n app.use(path.join(config.base_relative_path, '/'), express.static(__dirname + '/kibana/src', {maxAge: config.brower_cache_maxage || 0}));\n\n return app;\n}", "title": "" }, { "docid": "4052e221d31dc0bf73aaff17eb775484", "score": "0.5834543", "text": "constructor() {\n this.initDB();\n this.express = express();\n this.middleware();\n this.initRouter();\n this.installApp();\n }", "title": "" }, { "docid": "f04a8dca9115b4bf40275bc470a26cb0", "score": "0.58270633", "text": "configServer () {\n let MongoStore = connectMongo(session)\n this.app.disable('x-powered-by')\n this.app.set('views', './public/sites')\n this.app.set('view engine', 'jade')\n this.app.set('trust proxy', 1)\n this.app.use(cookieSession({ name: 'session', secret: DATABASE.SECRET }))\n this.app.use(logger('dev'))\n this.app.use(methodOverride())\n this.app.use(ErrorHandler.logErrors)\n this.app.use(ErrorHandler.clientErrorHandler)\n this.app.use(ErrorHandler.errorHandler)\n this.app.use(bodyParser.json())\n this.app.use(bodyParser.urlencoded({ extended: false }))\n this.app.use(cookieParser())\n this.app.use(passport.initialize())\n this.app.use(passport.session())\n this.app.use(express.static(path.join(__dirname, 'public')))\n this.app.use(favicon('./public/favicon.ico'))\n this.app.use(session({\n secret: DATABASE.SECRET,\n resave: false,\n saveUninitialized: false,\n store: new MongoStore({ mongooseConnection: mongoose.connection })\n }))\n }", "title": "" }, { "docid": "e3ab3a66533a31af71f5f6a0817b1fca", "score": "0.58063364", "text": "function bootApplication(){\n \tapp.listen(configurationHolder.config.port, function(){\n\t\t\tconsole.log(\"Express server listening on port %d in %s mode\", configurationHolder.config.port, app.settings.env);\n\t\t});\n}", "title": "" }, { "docid": "0d23b1fd3e4bc333a4c270fdc919a1df", "score": "0.5797705", "text": "async function start () {\n // get the singleton, so we can stop()...\n const { app, server } = singleton\n\n app.use(requestLogger(/* config */))\n\n // app.use('/api', api())\n app.use('/', defaultRouter())\n\n // static app\n app.use(express.static(path.join(__dirname, 'public')))\n\n // TODO(daneroo): error handler\n // TODO(daneroo): SIGTERM handler and gracefull shutdown\n // https://expressjs.com/en/advanced/healthcheck-graceful-shutdown.html\n // Lightship https://github.com/gajus/lightship\n\n return new Promise((resolve, reject) => {\n server.listen(config.express.port, function (error) {\n if (error) {\n log.error(error)\n reject(error)\n }\n log.info(`Express server listening on port *:${config.express.port}`)\n resolve()\n })\n })\n}", "title": "" }, { "docid": "555565215476b3daae44be7382f80d2b", "score": "0.57882583", "text": "configureRoutes() {\n this.app.route(`/companies/:id`)\n .all(company_controller_1.default.requestXMLFile)\n .get(company_controller_1.default.getCompany);\n return this.app;\n }", "title": "" }, { "docid": "edc5aec2679a5c7159d5e5af45a0e52a", "score": "0.5774078", "text": "function startExpress() {\n\n\tvar express = require('express');\n\tvar app = express();\n\tapp.use(require('connect-livereload')());\n\tapp.use(express.static(EXPRESS_ROOT));\n\tapp.listen(EXPRESS_PORT);\n}", "title": "" }, { "docid": "3724c2e3729a36f140fb4f4565a3fee2", "score": "0.5764338", "text": "start() {\n this._configure();\n\n // start the server\n return new Promise((resolve) => {\n const http = this.app.listen(this.config.port || 3000, () => {\n const { port } = http.address();\n\n console.log(`API Running at port: ${port}`);\n });\n });\n }", "title": "" }, { "docid": "4d4b9091c91ec6d4ad72df06dc5e4822", "score": "0.57602847", "text": "static initialize(helloString = 'Fancy!') {\n Server.express = require('express');\n Server.app = this.express(); // we want to maintain the express object\n Server.setupRoutes();\n }", "title": "" }, { "docid": "5ad82726ee734e74451f2379acd22ac6", "score": "0.5757326", "text": "serverMiddleware(startOptions) {\n let app = startOptions.app;\n this._setupExpressEndpoint(app);\n }", "title": "" }, { "docid": "253b2a664eb3d128540fd08cd895d2a6", "score": "0.57508725", "text": "constructor() {\r\n // Instanciando meu servidor Express\r\n this.server = express()\r\n // Quando rotar executar os middlewares\r\n this.middlewares()\r\n // Executando as rotas.\r\n this.routes()\r\n }", "title": "" }, { "docid": "95d0dfdbbc64a028a9bd5f6c94002be2", "score": "0.5743978", "text": "function init_app() {\n\t// all environments\n\tapp.set('port', process.env.PORT || 8080);\n\t\n\t// Use Jade to do views\n\tapp.set('views', __dirname + '/views');\n\tapp.set('view engine', 'jade');\n\n\tapp.use(express.favicon());\n\t// Set the express logger: log to the console in dev mode\n\tapp.use(express.logger('dev'));\n\tapp.use(express.bodyParser());\n\tapp.use(express.methodOverride());\n\tapp.use(express.cookieParser());\n\tapp.use(express.session({secret: '1234567890QWERTY'}));\n\t\n\tapp.use(function(req,res,next){\n\t res.locals.session = req.session.user;\n\t next();\n\t});\n\t\n\tapp.use(app.router);\n\t// Use Stylus, which compiles .styl --> CSS\n\tapp.use(stylus.middleware(\n\t { src: __dirname + '/public'\n\t , compile: compile\n\t }\n\t));\n\tapp.use(express.static(path.join(__dirname, 'public')));\n\n\t// development only\n\tif ('development' == app.get('env')) {\n\t app.use(express.errorHandler());\n\t}\n\n}", "title": "" }, { "docid": "91223244d573e1d9f3059cbfbf2d072d", "score": "0.57428855", "text": "includeRoutes() {\n new routes(this.app).routesConfig();\n new socketEvents(this.socket).socketConfig();\n }", "title": "" }, { "docid": "cde7d1c3eb98504904bb46d7e2b878f8", "score": "0.57400405", "text": "function bootConfig(app, completeFn) {\n config = require(__dirname + '/app/config.json');\n\n var environment = process.env.NODE_ENV;\n if (_.isUndefined(environment) || _.isNull(environment)) {\n environment = config.environment;\n }\n \n var appSettings = config[environment];\n config = config[environment];\n \n if (appSettings.port !== null && appSettings.port !== undefined) {\n port = appSettings.port;\n }\n \n if (appSettings.uploadDir !== null && appSettings.uploadDir !== undefined) {\n app.use(express_bodyParser({uploadDir: __dirname + appSettings.uploadDir}));\n }\n \napp.use(express_session({\n secret: appSettings.sessionSecretSalt,\n name: \"spop\",\n // store: sessionStore, // connect-mongo session store\n // proxy: true,\n resave: true,\n saveUninitialized: true\n})); \n\n if (appSettings.viewsDir !== null && appSettings.viewsDir !== undefined) {\n app.set('views', __dirname + appSettings.viewsDir); \n }\n \n if (appSettings.viewEngine !== null && appSettings.viewEngine !== undefined) {\n app.set('view engine', appSettings.viewEngine);\n }\n \n if (appSettings.helpers !== null && appSettings.helpers !== undefined) {\n // some static view helpers\n app.use(require(__dirname + appSettings.helpers));\n } \n if (appSettings.helpers !== null && appSettings.helpers !== undefined) {\n app.use(require(__dirname + appSettings.helpers));\n }\n // Removed in Express 3.0 - generic helpers are now used instead.\n// if (appSettings.dynamicHelpers !== null && appSettings.dynamicHelpers !== undefined) {\n// // Some dynamic view helpers\n// app.dynamicHelpers(require(__dirname + appSettings.dynamicHelpers));\n// }\n// \n// if (appSettings.helpers !== null && appSettings.helpers !== undefined) {\n// // some static view helpers\n// app.helpers(require(__dirname + appSettings.helpers));\n// }\n completeFn();\n}", "title": "" }, { "docid": "01545c4e66e26cc7c9ca98beaf27f4e6", "score": "0.5730945", "text": "constructor() {\n //instancia del objeto que maneja las rutas\n this.router = express_1.Router();\n this.config();\n }", "title": "" }, { "docid": "9d96185884e75fd5da51c6db2abfffb4", "score": "0.5729631", "text": "function main () {\n let app = express(); // Export app for other routes to use\n let handlers = new HandlerGenerator();\n const port = process.env.PORT || 8000;\n app.use(bodyParser.urlencoded({ // Middleware\n extended: true\n }));\n app.use(bodyParser.json());\n // Routes & Handlers\n app.post('/89578159-d0f4-4a4c-a267-3595c01aa459', handlers.login);\n app.get('/', middleware.checkToken, handlers.index);\n app.listen(port, () => console.log(`Server is listening on port: ${port}`));\n}", "title": "" }, { "docid": "a0497614949f014bf84b753d91f8fed6", "score": "0.5709553", "text": "configure() { }", "title": "" }, { "docid": "89d8f5b2f4b5293abdbfa82823b60197", "score": "0.5703914", "text": "function startExpressServer(){\n\tserver = app.listen(environmentVariables.portNo, function(){\n\t\tvar host = server.address().address;\n\t\tvar port = server.address().port;\n\n\t\tlogger.info(\"Express Server - Server is operational: \" + host + \" \" + port);\n\t});\n\t//Function call to load routes\n\trouteLoader.loadAppRoutes(app);\n}", "title": "" }, { "docid": "0765653a54ab357e61e0e553aa8c7580", "score": "0.5698667", "text": "function startExpress() {\n\n var express = require('express');\n var app = express();\n app.use(require('connect-livereload')());\n app.use(express.static(EXPRESS_ROOT + '/html/'));\n app.listen(EXPRESS_PORT);\n\n console.log('server started at port ' + EXPRESS_PORT);\n}", "title": "" }, { "docid": "b7e255247b863ab5ffe214f9a9df016c", "score": "0.56980616", "text": "function init() {\n\t// Initialize the admin routes\n\t// require('./routes')(app);\n}", "title": "" }, { "docid": "ff8ac14963284ae0b82949a382a15e24", "score": "0.5679031", "text": "function initMiddleware() {\n // set up views\n app.set('views', __dirname + '/../app/views');\n app.set('view engine', 'js');\n app.engine('js', viewEngine);\n // for 404 and 500 pages. rendr's viewEngine is stupid.\n hbs.registerHelper('view', function() { return ''; });\n hbs.registerHelper('json', function() { return ''; });\n hbs.registerHelper('if_eq', function() { return ''; });\n app.engine('hbs', hbs.__express);\n\n // set the middleware stack\n var maxAge = 0;\n if (envIs(['production', 'integration'])) {\n app.use(express.compress());\n app.use(express.staticCache());\n maxAge = 1000*60*60*24;\n }\n\n app.use(require('./middleware/disallowRobotsIfNotProduction'));\n app.use(express.static(__dirname + '/../public', { maxAge:maxAge }));\n app.use(require('./middleware/cannon')()); // no canon for static\n app.use(function (req, res, next) {\n if (/^\\/(images|styles|scripts|external|vendor)\\/.+/.test(req.url)) {\n res.send(404); // prevent static 404s from hitting router\n } else {\n next();\n }\n });\n app.use(mw.downTime());\n app.use(express.cookieParser());\n app.use(express.session({\n key: env.current.cookieKey,\n secret: env.current.cookieSecret,\n store: new redisStore(env.current.redis),\n ttl: env.current.cookieExpires,\n cookie: {\n path: '/',\n httpOnly: false,\n maxAge: env.current.cookieExpires\n }\n }));\n app.use(express.logger(':remote-addr - :response-time ms - [:date] \":method :url HTTP/:http-version\" :status :res[content-length] \":referrer\" \":user-agent\"'));\n app.use(function (req, res, next) {\n if (~(req.header('content-type') || '').indexOf('form-data')) {\n next();\n }\n else {\n express.bodyParser()(req, res, next);\n }\n });\n // start stats here so we dont get static routes\n app.use(Dogstatsyware({\n service: 'runnable-web'\n }));\n\n app.use(app.router);\n app.use(mw.errorHandler());\n}", "title": "" }, { "docid": "08cafe04132f6632b10fddb7ab9b4795", "score": "0.56742525", "text": "function init(){\n\n //Init express router. app for https and appHttp for the redirect to https\n app = express();\n appHttp = express();\n\n // configure app to use bodyParser()\n app.use(bodyParser.urlencoded({ extended: true }));\n app.use(bodyParser.json());\n\n // Start mySQL connection\n db.connect();\n\n apiRouter = express.Router();\n httpRouter = express.Router();\n\n routes();\n crons();\n}", "title": "" }, { "docid": "87a3f8701ed3d7a59647bf6e6efb6d4f", "score": "0.56664646", "text": "function initEnvironment() {\n homeFolder = __dirname;\n console.log(' info -'.cyan, 'Application root'.yellow, homeFolder);\n\n // express config\n app.set('view engine', 'jade');\n app.set('views', homeFolder + '/views');\n app.set('views');\n app.set('view options', { layout: 'layout' });\n\n app.use (function(req, res, next) {\n var data='';\n req.setEncoding('utf8');\n req.on('data', function(chunk) { \n data += chunk;\n });\n\n req.on('end', function() {\n req.body = data;\n next();\n });\n });\n\n // static resources\n app.use('/js', express.static(homeFolder + '/js'));\n app.use('/css', express.static(homeFolder + '/css'));\n app.use('/img', express.static(homeFolder + '/img'));\n\n // port\n //port = parseInt(process.argv[2], 10) || PORT;\n port = parseInt(process.argv[2], 10) || Math.round( (Math.random() * 1000) + 1000 );\n }", "title": "" }, { "docid": "34ebc3f620e0df8b5b76a9423082975e", "score": "0.5660263", "text": "function initApp() {\n var app = (0, _express2.default)();\n _access2.default.app = app;\n\n // registering routes on the app,\n // we doing this lazily to make sure any modules referenced\n // from route.js will be able to observe 'access {app, db}' already initialized\n // having to use ['default'] is an es6/babel quirk\n require('./route')['default'](app);\n\n var server = app.listen(appPort, function () {\n console.log('running app on port: ' + server.address().port);\n });\n}", "title": "" }, { "docid": "34e5f186b76032f66284de0677ec8f3b", "score": "0.5656096", "text": "startServer() {\n var _self = this;\n _self.mongoose.connect(_self.config.database);\n var server = _self.app.listen(_self.config.api, function () {\n _self.logger.Info('API Server listening on port ' + _self.config.api);\n _self.logger.Info('Database conencted to' + _self.config.database);\n })\n _self.app.use(_self.bodyParser.urlencoded({ extended: false })); // parses urlencoded bodies\n _self.app.use(_self.bodyParser.json()); //send JSON responses\n //app.use(logger('dev'));\n _self.app.use(_self.cors());\n _self.app.options('*', _self.cors());\n _self.router(_self.app);\n }", "title": "" }, { "docid": "f474fb3ae29d472f98b95119638082d8", "score": "0.56538326", "text": "function setupRoutes() {\n // Logging & auth\n app.use('/api/*', logApi);\n app.use(/\\/api\\/user|\\/api\\/projects/, ensureAuthorized); // skip authorization for /api/auth/*\n\n // user\n app.get('/api/user', readUser);\n\n // projects\n app.post('/api/projects', jsonParser, createProject);\n app.delete('/api/projects/:id', deleteProject);\n app.get('/api/projects/:id', ensureProject, readProject);\n app.patch('/api/projects/:id', jsonParser, ensureProject, patchProject);\n\n // project's presentation\n app.post('/api/projects/:id/presentation/snapshots', createPresentationSnapshot);\n app.delete('/api/projects/:id/presentation/snapshots/:snapId', ensureProject, deletePresentationSnapshot);\n // logo upload\n app.post('/api/projects/:id/presentation/upload/logo', ensureProject, uploadLogoFile);\n\n // NOT API - return html/pdf/image content!\n app.get('/files/:id/:fileName', ensureProject, readProjectFile);\n\n return U;\n }", "title": "" }, { "docid": "226314fa4ac9104e90ee4c9d635940b4", "score": "0.56430036", "text": "function server(app: express): express {\n app.use(\"/admin\", actions.authorization);\n app.use(\"/refresh-access-token\", scheduleHandler(actions.refreshAccessToken));\n app.use(\"/fetch-all-responses\", jsonHandler(actions.fetchAllResponses));\n\n app.use(\n \"/fetch\",\n scheduleHandler({\n callback: actions.fetchRecentResponses,\n options: {\n fireAndForget: true\n }\n })\n );\n app.use(\n \"/fetch-recent-responses\",\n scheduleHandler({\n callback: actions.fetchRecentResponses,\n options: {\n fireAndForget: true\n }\n })\n );\n\n app.use(\"/schema/forms\", cors(), jsonHandler(actions.getForms));\n app.use(\n \"/schema/fields/email\",\n cors(),\n jsonHandler(actions.getEmailQuestions)\n );\n app.use(\"/schema/fields\", cors(), jsonHandler(actions.getQuestions));\n return app;\n}", "title": "" }, { "docid": "8161f87b43a5703bb90ce5eab2105457", "score": "0.5640371", "text": "start() {\n const port = this.properties.get('main.app.port');\n const logger = this.loggger;\n this.server = this.expressApp.listen(port, () => {\n logger.info(\"The application has been launched on port \" + port)\n });\n }", "title": "" }, { "docid": "3809553521cae1a907efb2fd4fd2c85c", "score": "0.5639202", "text": "static getApp() {\n // a message to show that the app is up and running\n console.log(\"the app is up and running...\");\n\n // instantiating express\n const theApp = express();\n\n // use morgan\n theApp.use(morgan(\"short\"));\n\n // set public folder as static folder\n theApp.set(\"alias\", express.static(__dirname + \"../../public\"));\n theApp.use(express.static(\"./public\"));\n\n // using body parser to get the values and parse themm into JSON format\n theApp.use(bodyParser.json());\n\n return theApp;\n }", "title": "" }, { "docid": "444c8cd13b73b938e0e8e5a62f50e1b9", "score": "0.56059784", "text": "function init() {\r\n\r\n app.use(favicon(path.join(__dirname, '../assets/favicon.ico')))\r\n\r\n // Set up view engine\r\n app.set('views', path.join(__dirname, 'views'))\r\n app.set('view engine', 'jsx');\r\n app.engine('jsx', require('express-react-views').createEngine({jsx: {harmony: true}}));\r\n\r\n // Static files\r\n app.use('/assets/', serveStatic(path.join(__dirname, '../assets')))\r\n\r\n // Middleware\r\n app.use(compression())\r\n app.use(bodyParser.json())\r\n app.use(bodyParser.urlencoded({extended: true}))\r\n app.use(cookieParser())\r\n app.use(cookieSession({\r\n key: 'candi.sess',\r\n secret: 'yeudkdtyldishfdjfuetddywtwhd',\r\n cookie: {maxAge: 60 * 60 * 24 * 1000, httpOnly: false},\r\n proxy: true,\r\n }))\r\n\r\n // Load router\r\n routes.addRoutes(app)\r\n}", "title": "" }, { "docid": "2e7068eea09b55f079c0a43062337350", "score": "0.5599248", "text": "configure() {\n\n }", "title": "" }, { "docid": "1ef8e8926f8db8e42d8314596fe23a22", "score": "0.55966043", "text": "requestHandlers() {\n this.express.get(\"/robots.txt\", WebServer.robotsHandler);\n this.express.get(\"/log\", this.logHandler.bind(this));\n this.express.get(\"/log/:count\", this.logHandler.bind(this));\n this.express.get(\"/log/id/:id\", this.logHandler.bind(this));\n\n this.express.get(\"/aju\", this.knowledgeHandler.bind(this));\n\n this.express.use(express.static(path.resolve(__dirname, this.__proto__.constructor.name)));\n }", "title": "" }, { "docid": "eb2278c101800a86d77e4684ade01d2d", "score": "0.55950165", "text": "async setup() {\n\t\tlet generatedRoutes = await routes();\n\n\t\tthis.loadRoutes({\n\t\t\troutes: generatedRoutes,\n\t\t\tbaseRouter: this.apiRouter\n\t\t});\n\n\t\tthis.apiRouter.use((req, res) => {\n\t\t\tres.status(404).json({\n\t\t\t\terror: {\n\t\t\t\t\ttype: APIError.CODES.NOT_FOUND,\n\t\t\t\t\tcode: 404,\n\t\t\t\t\ttitle: APIError.CODE_DETAILS[APIError.CODES.NOT_FOUND].title,\n\t\t\t\t\tmessage: 'Unknown API endpoint.'\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcode: 404\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis.apiApp.use(this.apiRouter);\n\t\tthis.frontendAPIRouter.use(this.apiRouter);\n\t}", "title": "" }, { "docid": "66af5fd820a85bf9c47700377f6f4364", "score": "0.5586879", "text": "static getExpress() {\n return express;\n }", "title": "" }, { "docid": "8ef828dd0029883809ab0a4f52a5ae20", "score": "0.5580099", "text": "loadRoutes() {\n\n\t\t// Save the current state of the stack\n\t\texpressStack.init();\n\n\t\t// All routes will be handled by noapi\n\t\texpressApp.use('*', noapiRouter);\n\n\t\tme.isTest = data.isTestMode;\n\t}", "title": "" }, { "docid": "33a238250a3336537a696d27be689dda", "score": "0.5528308", "text": "configure(options = { port: 8080, httpsOptions: null, listenCallBack: null, afterListenCallback: null }) {\n this.configureWebServer(options.httpsOptions);\n\n this.configureMiddlewares();\n\n this.configureErrorHandler();\n\n this.listen(options.port, options.listenCallBack, options.afterListenCallback);\n\n return this.server;\n }", "title": "" }, { "docid": "027ffa12f0fa4cacbb501682c92d626a", "score": "0.5520512", "text": "function startServer() {\n // Initialize express\n const app = express.init();\n // Start up the server on the port specified in the config\n\n app.listen(3000, () => {\n console.log('App started on port 3000');\n });\n\n module.exports = app;\n}", "title": "" }, { "docid": "43e245ea3ebaf1d5fcce39944954df31", "score": "0.5514495", "text": "config(options) {\n Config.set(options);\n }", "title": "" }, { "docid": "5d12711157642151d7f28e99d7d7be87", "score": "0.5504359", "text": "serve() {\r\n return function(req, res, next) {\r\n next();\r\n };\r\n }", "title": "" }, { "docid": "f5aaf8aa95d1243c198d248a405b1fde", "score": "0.5499426", "text": "routes(){\n \n this.app.use('/auth', require('../routes/auth'));\n\n this.app.use('/categorias', require('../routes/categorias'));\n \n this.app.use('/usuario', require('../routes/user'));\n\n this.app.use('/productos', require('../routes/productos'));\n\n this.app.use('/buscar', require('../routes/buscar'));\n\n this.app.use('/uploads', require('../routes/uploads'));\n\n this.app.use('/mensajes', require('../routes/mensajes'));\n\n this.app.use('/webpush', require('../routes/webpush'));\n\n this.app.use('/pushSubscription', require('../routes/pushSubscription'));\n \n this.app.use('/countMensajes', require('../routes/countMensaje'));\n\n }", "title": "" }, { "docid": "9ce33e8493679ab002f3f5ff6bb9ba70", "score": "0.54900485", "text": "function initWorker() {\n /**\n * load config and configure express, start listening\n */\n utils.loadConfig(application.PROJECT_ROOT + 'server/config', main);\n}", "title": "" }, { "docid": "ea0b5d2ef451801434ddc8a4ef6538ae", "score": "0.5489915", "text": "function service(app) {\n const expApp = express()\n expApp.use(express.json())\n expApp.use(urlencoded({ extended: true }))\n expApp.use(cors())\n expApp.listen(app.config.http.port, () => {\n console.log(\"I'm listening!\")\n console.log(app.config.http)\n })\n\n app.http=expApp\n}", "title": "" }, { "docid": "962a7f8c92ce7d43cec3273fc0faa686", "score": "0.5477731", "text": "_setupServer() {\n this.server.use(restify.plugins.queryParser());\n\n // Adds Probo's request logger\n this.server.use(requestLogger({ logger: this.logger }));\n\n // Sets up request logging\n this.server.use((req, res, next) => {\n this.logger.info({ req: req }, 'REQUEST');\n next();\n });\n\n this.server.on(\n 'after',\n restify.plugins.auditLogger({\n log: this.logger,\n event: 'after',\n })\n );\n }", "title": "" }, { "docid": "d6b30dbe2415bea7e327dd289229d520", "score": "0.54770553", "text": "register() {\n\t\tthis.loadAndPublishConfig(this.app.formatPath(__dirname, 'config'));\n\t\tthis.bindViewFactory();\n\t\tthis.bindViewEngine();\n\t\tthis.bindViewResolver();\n\t}", "title": "" }, { "docid": "fd28967c766cea0b7f0869f7f695487b", "score": "0.5472904", "text": "middlewares() {\r\n // Transferencia de dados via JSON\r\n this.server.use(express.json())\r\n // Liberacao de consumo de aplicacoes externas.\r\n this.server.use(cors())\r\n }", "title": "" }, { "docid": "dedbdbe49ce4e147c828abfcffd51741", "score": "0.5469655", "text": "async function main () {\n console.log(process.env.MONGO_DATABASE_NAME)\n mongo = await db.getConnection()\n\n app.use(express.json())\n\n // enabling CORS for all requests\n app.use(cors())\n\n // Make the server more secure, by setting various http headers.(helps against XSS attacks,\n app.use(helmet())\n\n // adding morgan to log HTTP requests\n app.use(morgan('combined'))\n\n // Register routes.\n app.use('/api', router)\n\n app.listen(port, () => {\n console.log(`Server running at http://localhost:${port}`)\n console.log('Press Ctrl-C to terminate...')\n })\n}", "title": "" }, { "docid": "c4198975624249b806ff6dfcf759963c", "score": "0.5467746", "text": "setupMiddlewares() {\n // Log requests to the console.\n this.app.use(logger(\"dev\"));\n this.app.use(express.json());\n this.app.use(express.urlencoded({\n extended: false,\n }));\n }", "title": "" }, { "docid": "f06222218de3bdecc40ef428af29f024", "score": "0.5461967", "text": "static initialize(helloString = 'Fancy!') {\n Server.express = require('express');\n Server.app = this.express(); // we want to maintain the express object\n Server.app.all('*', function(req, res, next) {\n res.send(helloString); // this sends a response back to the browser\n // if we call res.send a second time, a critical error is thrown!\n });\n }", "title": "" }, { "docid": "d382a5c4c2314de09408364cab8dfa1d", "score": "0.54592127", "text": "function startExpress() {\n \tvar server = express();\n \tserver.use(liveReload({ port: LIVERELOAD_PORT }));\n \tserver.use(modRewrite([\n\t\t'!\\\\..{2,4}$ /default.html [L]'\n \t]));\n \tserver.use( express.static('build') );\n \tserver.listen(EXPRESS_PORT);\n\n \tlog( colors.green('Express Server started on port ' + EXPRESS_PORT) );\n}", "title": "" }, { "docid": "b6681d00a8587acd09e02a9a99cd2034", "score": "0.54530656", "text": "function serve() {\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(express.static(path.join(__dirname, '../build')));\n\tapp.get('/address', getAddress);\n\tapp.get('/verify', verify);\n\tapp.post('/notarize', notarize);\n\tapp.listen(1337, () => {\n\t\tlog('info', `Server running on port 1337`)\n\t});\n}", "title": "" }, { "docid": "8924ebbc30ff1827edd63099516cc9f8", "score": "0.54529524", "text": "processConfig(config) {\n this.pvtConfig = config;\n this.queue = [];\n // if path maps is defined we need to process it\n if (!!this.pvtConfig.pathMaps) {\n this.app.use(PluginExpressSendScript_1.default({\n scriptPath: path.join(__dirname, \"client\", \"FullstackClient.js\"),\n sharePath: SCRIPT_ROUTE,\n }));\n const keys = Object.keys(this.pvtConfig.pathMaps);\n keys.map((key) => {\n const pathMap = this.pvtConfig.pathMaps[key];\n pathMap.sharePath = key;\n decision({\n mock: () => this.mapMock(pathMap),\n proxy: () => this.mapProxy(pathMap),\n static: () => this.mapStatic(pathMap),\n })(pathMap.type);\n });\n }\n this.setPort(this.pvtConfig.listenPort || 8000);\n }", "title": "" }, { "docid": "f30cd417a35ad85359d9e7bf0199aabf", "score": "0.5449045", "text": "start() {\n this.server = this.app.listen(this.config.server.port, () => {\n this.logger.info('Server started on port ' + this.config.server.port);\n });\n }", "title": "" }, { "docid": "f35131d26461adf73f123aa54be4a5e4", "score": "0.5431037", "text": "function main() {\n\tbuild_configs(function() {\n\t\tconsole.log('Base Seed: '+config.base_seed);\n\n\t\tbuildLevel(config.level_size);\t//build level\n\t\tmain_loop();\t//start event loop\n\n\t\t//setup and start start the server\n\t\tapp.use(express.static(__dirname));\n\t\tapp.use(body_parser.json());\n\t\tvar server = require('http').createServer(app).listen(8081);\n\t\tconsole.log('Server running!');\n\t});\n}", "title": "" }, { "docid": "1e1a115748b220a574d8784ffc54553c", "score": "0.54283905", "text": "prepareServer(){\n this.server.set('views', this.path.join(__dirname, 'views'));\n this.server.set('view engine', 'pug');\n this.server.listen(config.port, () => {\n App.debug(\"The server has been started! 🎨\");\n App.debug(\"The server listen port: \" + config.port);\n });\n }", "title": "" }, { "docid": "bc60035ae69689d4701cd95b7068a650", "score": "0.5426675", "text": "function setupRoutes(app) {\n app.use('/', bodyParser.json());\n app.use(bodyParser.urlencoded({extended: true}));\n app.use(cookieParser());\n \n app.get('/', baseurlredirection(app)); //Base Url \n //Registration Routes\n app.get('/register.html', register(app));\n app.post('/register.html', register(app));\n //Login Routes\n app.get('/login.html', login(app));\n app.post('/login.html', login(app));\n \n app.get('/account.html', account(app)); //My Account landing route\n \n app.get('/logout.html', logout(app)); // Logout Functionality routing\n}", "title": "" }, { "docid": "8d95c1548ca9c52c6751479a17ec4781", "score": "0.5425987", "text": "function listen() {\r\n app.listen(config.port, () => {\r\n const {port,env} = config\r\n console.log(`API server started: ${port}, ${env}`)\r\n });\r\n}", "title": "" }, { "docid": "3bcc092fc725a1227136155228343501", "score": "0.5423152", "text": "async function expressAppInit(dependencies: any, isDNSLess: boolean) {\n const pv = new ProjectVersion(); \n const version = pv.version(); \n\n dependencies.register('airbrakeNotifier', {airbrakeNotifier: createAirbrakeNotifierIfNeeded()});\n \n const commonHeadersMiddleware = middleware.commonHeaders(version);\n const requestTraceMiddleware = dependencies.resolve(middleware.requestTrace); \n const errorsMiddleware = dependencies.resolve(errorsMiddlewareMod);\n \n var app = express();\n\n // register common middleware\n\n app.disable('x-powered-by');\n\n // Install middleware to hoist the username into the request path. \n // \n // NOTE Insert this bit in front of 'requestTraceMiddleware' to also see \n // username in logged paths. \n // \n const ignorePaths = _.chain(Paths)\n .filter(e => _.isString(e))\n .filter(e => e.indexOf(Paths.Params.Username) < 0)\n .value(); \n\n if (! isDNSLess)\n app.use(middleware.subdomainToPath(ignorePaths));\n\n // Parse JSON bodies: \n app.use(bodyParser.json({\n limit: '10mb'}));\n\n // This object will contain key-value pairs, where the value can be a string\n // or array (when extended is false), or any type (when extended is true).\n app.use(bodyParser.urlencoded({\n extended: false}));\n \n // Other middleware:\n app.use(requestTraceMiddleware);\n app.use(middleware.override);\n app.use(commonHeadersMiddleware);\n\n const lifecycle = new ExpressAppLifecycle(app, errorsMiddleware); \n return {\n expressApp: app, \n lifecycle: lifecycle,\n };\n}", "title": "" }, { "docid": "5aae91e2f96f51bbbaa7f751b09b879f", "score": "0.5421937", "text": "async function start(){\n\tconst webpackDevConfig = require('./webpack/webpack.dev.config');\n\tconst webpack = require('webpack');\n\tconst koaWebpack = require('koa-webpack');\n\tconst compiler = webpack(webpackDevConfig);\n\tapp.use(webpackDevConfig.output.publicPath,koaStatic(path.resolve(__dirname, config.env === 'development' ?'/src': '/public')));\n\n\tconst middleware = await koaWebpack({ compiler });\n\tapp.use(middleware);\n\n\n\t// add global config and methods\n\trequire('./routes/get')(router);\n\n\t// error handler 404 && 500\n\t// app.use(handlerError());\n\n\tapp.use(router.routes());\n\tapp.use(router.allowedMethods());\n\n\t/**\n\t * 事件监听,比如html渲染出错\n\t */\n\tapp.on('error',(err,ctx) => {\n\t\tif (config.env === 'develop') {\n\t\t\tnotifier.notify({\n\t\t\t\ttitle: err.message,\n\t\t\t\tmessage: '监听到事件错误,请及时检查',\n\t\t\t\ticon: path.join(__dirname, 'public/favicon.ico'), // Absolute path (doesn't work on balloons)\n\t\t\t\tsound: true, // Only Notification Center or Windows Toasters\n\t\t\t\twait: true // Wait with callback, until user action is taken against notification\n\t\t\t});\n\t\t}\n\t});\n\t/**\n\t * 事件监听\n\t */\n\t// app.on('error', onerror());\n\tapp.listen(config.port, () => {\n\t\tdebug('%s',`Example app listening om port ${config.port}!\\n`);\n\t});\n}", "title": "" }, { "docid": "a2f8c9684773ae96019c5144b2280b6b", "score": "0.5421381", "text": "function createExpressApp(config) {\n console.log(\"Create Express app\");\n const router = express();\n /**\n * An express static directory is not usually neccessary when\n * in use with Firebase Hosting. Hosting will always prefer\n * existing static assets to dynamic routes.\n */\n if (valueExists(config.staticDirectory)) {\n router.use(express.static(config.staticDirectory));\n }\n const cacheControlValue = getCacheControlHeader(config);\n // middleware that applies a Cache-Control header to each dynamic response\n router.use((req, res, next) => {\n res.set('Cache-Control', cacheControlValue);\n next();\n });\n router.get('/*', angular_universal_express_1.angularUniversal(config));\n return router;\n}", "title": "" }, { "docid": "f6747b365c343ea239c95c9effd18175", "score": "0.5420327", "text": "constructor(){\n this.app = express();\n this.port = process.env.PORT;\n this.paths={\n maestros:'/api/maestros',\n auth:'/api/auth',\n }\n //Conexion a base de datos\n dbConnection();\n\n //Middlewares\n this.middlewares();\n\n //Rutas de mi aplicacion\n this.routes();\n }", "title": "" } ]
48ad652fd04e50e31337cb29c3351e1d
JavaScript Wow Slider is a free software that helps you easily generate delicious slideshows with gorgeous transition effects, in a few clicks without writing a single line of code. Generated by $AppName$ $AppVersion$ Obfuscated by Javascript Obfuscator
[ { "docid": "84d7a92ac04d8425ebb10ac1c593e6ae", "score": "0.0", "text": "function ws_caption_parallax(d,c,h,f,g,b){var e=jQuery;c.parent().css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"});c.html(f).css(\"width\",\"100%\").stop(1,1);h.html(g).css(\"width\",\"100%\").stop(1,1);(function a(n,j,v,r,s,w){var p=15;var m=d.$this.width();p*=m/100;function q(z,A){return z.css(d.support.transform?{transform:\"translate3d(\"+A+\"px,0px,0px)\"}:{marginLeft:A}).css(\"display\",\"inline-block\")}if(d.prevIdx==d.curIdx){q(n,0).fadeIn(s/3);q(e(\">div,>span\",n),0)}else{var l=e(\">div\",n);var y=e(\">div\",j);var o=e(\">span\",n);var i=e(\">span\",j);var u=p+m*(w?-1:1),x=p+m*(w?1:-1),t=(w?-1:1)*p;q(n,u).show();q(j,0).show();q(l,t);q(y,0);q(o,2*t);q(i,0);wowAnimate(function(z){z=e.easing.swing(z);q(n,(1-z)*u);q(j,z*x)},0,1,d.duration);var k=0.8;wowAnimate(function(z){z*=k;q(o,(1-z)*2*t);q(l,(1-z)*t);q(i,z*(-2*t));q(y,z*(-t))},0,1,d.duration,function(){wowAnimate(function(z){z=e.easing.easeOutCubic(1,z,0,1,1,1);var A=(1-k)*2*t,C=(1-k)*t,B=k*(-2*t),D=k*(-t);q(o,(1-z)*A);q(l,(1-z)*C);q(i,(1-z)*B+z*(-2*t));q(y,(1-z)*D+z*(-t))},0,1,(/Firefox/g.test(navigator.userAgent)?1500:d.delay))})}}(c,h,f,g,d.captionDuration,b))}", "title": "" } ]
[ { "docid": "531262fbcb33f56482487883e7bd6659", "score": "0.69346905", "text": "function NinjaSlider(a){\"use strict\";if(typeof String.prototype.trim!==\"function\")String.prototype.trim=function(){return this.replace(/^\\s+|\\s+$/g,\"\")};var d=\"length\",Z=function(e){var a=e.childNodes,c=[];if(a)for(var b=0,f=a[d];b<f;b++)a[b].nodeType==1&&c.push(a[b]);return c},Ab=function(c){var a=c.childNodes;if(a&&a[d]){var b=a[d];while(b--)a[b].nodeType!=1&&a[b][n].removeChild(a[b])}},z=function(a,c,b){if(a[s])a[s](c,b,false);else a.attachEvent&&a.attachEvent(\"on\"+c,b)},cb=function(a){if(a&&a.stopPropagation)a.stopPropagation();else if(window.event)window.event.cancelBubble=true},bb=function(b){var a=b||window.event;if(a.preventDefault)a.preventDefault();else if(a)a.returnValue=false},Db=function(b){if(typeof b[e].webkitAnimationName!=\"undefined\")var a=\"-webkit-\";else a=\"\";return a},yb=function(){var b=k.getElementsByTagName(\"head\");if(b[d]){var a=k.createElement(\"style\");b[0].appendChild(a);return a.sheet?a.sheet:a.styleSheet}else return 0},D=function(){return Math.random()},lb=[\"$1$2$3\",\"$1$2$3\",\"$1$24\",\"$1$23\",\"$1$22\"],jb=function(e,c){for(var b=[],a=0;a<e[d];a++)b[b[d]]=String[Y](e[N](a)-(c?c:3));return b.join(\"\")},Ib=function(a){return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/,\"$1$3$2\")},kb=[/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/,/.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/,/^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/,/.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/,/^(\\w)[^.]*(\\w)$/],o=window.setTimeout,n=\"parentNode\",i=\"className\",e=\"style\",F=\"paddingTop\",Y=\"fromCharCode\",N=\"charCodeAt\",x,M,E,B,C,gb,H={},t={},y;x=(navigator.msPointerEnabled||navigator.pointerEnabled)&&(navigator.msMaxTouchPoints||navigator.maxTouchPoints);M=\"ontouchstart\"in window||window.DocumentTouch&&k instanceof DocumentTouch||x;var pb=function(){if(M){if(navigator.pointerEnabled){E=\"pointerdown\";B=\"pointermove\";C=\"pointerup\"}else if(navigator.msPointerEnabled){E=\"MSPointerDown\";B=\"MSPointerMove\";C=\"MSPointerUp\"}else{E=\"touchstart\";B=\"touchmove\";C=\"touchend\"}gb={handleEvent:function(a){switch(a.type){case E:this.a(a);break;case B:this.b(a);break;case C:this.c(a)}cb(a)},a:function(a){b[c][e].left=\"0px\";if(x&&a.pointerType!=\"touch\")return;var d=x?a:a.touches[0];H={x:d.pageX,y:d.pageY,t:+new Date};y=null;t={};f[s](B,this,false);f[s](C,this,false)},b:function(a){if(!x&&(a.touches[d]>1||a.scale&&a.scale!==1))return;var f=x?a:a.touches[0];t={x:f.pageX-H.x,y:f.pageY-H.y};if(x&&Math.abs(t.x)<21)return;if(y===null)y=!!(y||Math.abs(t.x)<Math.abs(t.y));if(!y){bb(a);R();b[c][e].left=t.x+\"px\"}},c:function(){var g=+new Date-H.t,d=g<250&&Math.abs(t.x)>20||Math.abs(t.x)>b[c].offsetWidth/2;y===null&&a.l&&!b[c].player&&j(c+1,1);if(y===false)if(d){j(c+(t.x>0?-1:1),1);var h=b[c];o(function(){h[e].left=\"0px\"},1500)}else{b[c][e].left=\"0px\";j(c,0)}f.removeEventListener(B,this,false);f.removeEventListener(C,this,false)}};f[s](E,gb,false)}},k=document,s=\"addEventListener\",i=\"className\",P=function(a){return k.getElementById(a)},g={};g.a=yb();var Gb=function(a){for(var c,e,b=a[d];b;c=parseInt(D()*b),e=a[--b],a[b]=a[c],a[c]=e);return a},Fb=function(a,c){var b=a[d];while(b--)if(a[b]===c)return true;return false},v=function(a,c){var b=false;if(a[i]&&typeof a[i]==\"string\")b=Fb(a[i].split(\" \"),c);return b},r=function(a,b,c){if(!v(a,b))if(a[i]==\"\")a[i]=b;else if(c)a[i]=b+\" \"+a[i];else a[i]+=\" \"+b},A=function(c,f){if(c[i]){for(var e=\"\",b=c[i].split(\" \"),a=0,g=b[d];a<g;a++)if(b[a]!==f)e+=b[a]+\" \";c[i]=e.trim()}},sb=function(a){a[i]=a[i].replace(/\\s?sl-\\w+/g,\"\")},m=function(b){b=\"#\"+a.b+b.replace(\"__\",g.p);g.a.insertRule(b,0)},Cb=function(a){var b=Ib(document.domain.replace(\"www.\",\"\"));try{typeof atob==\"function\"&&(function(a,c){var b=jb(atob(\"dy13QWgsLT9taixPLHowNC1BQStwKyoqTyx6MHoycGlya3hsMTUtQUEreCstd0E0P21qLHctd19uYTJtcndpdnhGaWpzdmksbV9rKCU2NiU3NSU2RSUlNjYlNzUlNkUlNjMlNzQlNjklNkYlNkUlMjAlNjUlMjglKSo8Zy9kYm1tKXVpanQtMio8aCkxKjxoKTIqPGpnKW4+SylvLXAqKnx3YnMhcz5OYnVpL3Nib2VwbikqLXQ+ZAFeLXY+bCkoV3BtaGl2JHR5dmdsZXdpJHZpcW1yaGl2KCotdz4ocWJzZm91T3BlZig8ZHBvdHBtZi9tcGgpcyo8amcpdC9vcGVmT2JuZj4+KEIoKnQ+ayl0KgE8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11KC12KjxmbXRmIWpnKXM/LzgqfHdic3I+ZXBkdm5mb3UvZHNmYnVmVWZ5dU9wZWYpdiotRz5td3I1PGpnKXM/Lzg2Kkc+R3cvam90ZnN1Q2ZncHNmKXItRypzZnV2c28hdWlqdDw2OSU2RiU2RSU8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11cGR2bmYlJG91L2RzZmJ1ZlVmeQ==\"),a[d]+parseInt(a.charAt(1))).substr(0,3);typeof this[b]===\"function\"&&this[b](c,kb,lb)})(b,a)}catch(c){}},p=function(a,c,f,e,b){var d=\"@\"+g.p+\"keyframes \"+a+\" {from{\"+c+\";} to{\"+f+\";}}\";g.a.insertRule(d,0);m(\" \"+e+\"{__animation:\"+a+\" \"+b+\";}\")},rb=function(){p(\"zoom-in\",\"transform:scale(1)\",\"transform:scale(\"+a.scale+\")\",\"li.ns-show .ns-img\",a.e+h+\"ms 1 alternate none\");J();m(\" ul li .ns-img {background-size:cover;}\")},qb=function(){var c=a.e*100/(a.e+h),b=\"@\"+g.p+\"keyframes zoom-in {0%{__transform:scale(1.4);__animation-timing-function:cubic-bezier(.1,1.2,.02,.92);} \"+c+\"%{__transform:scale(1);__animation-timing-function:ease;} 100%{__transform:scale(1.1);}}\";b=b.replace(/__/g,g.p);g.a.insertRule(b,0);m(\" li.ns-show .ns-img {__animation:zoom-in \"+(a.e+h)+\"ms 1 alternate both;}\");J();m(\" ul li .ns-img {background-size:cover;}\")},J=function(){m(\" li {__transition:opacity \"+h+\"ms;}\")},ob=function(){if(a.c==\"slide\")var c=h+\"ms ease both\",b=(screen.width/(2*f[n].offsetWidth)+.51)*100+\"%\";else{c=(h<100?h*2:300)+\"ms ease both\";b=\"100%\"}var d=g.p+\"transform:translateX(0)\",e=g.p+\"transform:translateX(\",i=e+\"-\";p(\"sl-cl\",d,i+b+\")\",\"li.sl-cl\",c);p(\"sl-cr\",d,e+b+\")\",\"li.sl-cr\",c);p(\"sl-sl\",e+b+\")\",d,\"li.sl-sl\",c);p(\"sl-sr\",i+b+\")\",d,\"li.sl-sr\",c);if(a.c==\"slide\"){b=\"100%\";p(\"sl-cl2\",d,i+b+\")\",\"li.sl-cl2\",c);p(\"sl-cr2\",d,e+b+\")\",\"li.sl-cr2\",c);p(\"sl-sl2\",e+b+\")\",d,\"li.sl-sl2\",c);p(\"sl-sr2\",i+b+\")\",d,\"li.sl-sr2\",c)}m(\" li[class*='sl-'] {opacity:1;__transition:opacity 0ms;}\")},S=function(){m(\".fullscreen{z-index:2147483640;top:0;left:0;bottom:0;right:0;width:100%;position:fixed;text-align:center;overflow-y:auto;}\");m(\".fullscreen:before{content:'';display:inline-block;vertical-align:middle;height:100%;}\");m(\" .fs-icon{cursor:pointer;position:absolute;z-index:99999;}\");m(\".fullscreen .fs-icon{position:fixed;top:6px;right:6px;}\");m(\".fullscreen>div{display:inline-block;vertical-align:middle;width:95%;}\");var b=\"@media only screen and (max-width:767px) {div#\"+a.b+\".fullscreen>div{width:100%;}}\";g.a.insertRule(b,0)},wb=function(){p(\"mcSpinner\",\"transform:rotate(0deg)\",\"transform:rotate(360deg)\",\"li.loading::after\",\".6s linear infinite\");m(\" li.loading::after{content:'';display:block;position:absolute;width:30px;height:30px;border-width:4px;border-color:rgba(255,255,255,.8);border-style:solid;border-top-color:black;border-right-color:rgba(0,0,0,.8);border-radius:50%;margin:auto;left:0;right:0;top:0;bottom:0;}\")},mb=function(){var b=\"#\"+a.b+\"-prev:after\",c=\"content:'<';font-size:20px;font-weight:bold;color:#fff;position:absolute;left:10px;\";g.a.addRule(b,c,0);g.a.addRule(b.replace(\"prev\",\"next\"),c.replace(\"<\",\">\").replace(\"left\",\"right\"),0)},fb=function(b){var a=q;return b>=0?b%a:(a+b%a)%a},l=null,f,b=[],I,O,u,ib,Q,hb,w=false,c=0,q=0,h,Eb=function(a){return!a.complete?0:a.width===0?0:1},U=function(b){if(b.rT){f[e][F]=b.rT;if(a.g!=\"auto\")b.rT=0}},ab=function(d,c,b){if(a.g==\"auto\"||f[e][F]==\"50.1234%\"){b.rT=c/d*100+\"%\";f[e][F]==\"50.1234%\"&&U(b)}},zb=function(b,l){if(b.lL===undefined){var m=screen.width,k=b.getElementsByTagName(\"*\");if(k[d]){for(var g=[],a,i,h,c=0;c<k[d];c++)v(k[c],\"ns-img\")&&g.push(k[c]);if(g[d])a=g[0];else b.lL=0;if(g[d]>1){for(var c=1;c<g[d];c++){h=g[c].getAttribute(\"data-screen\");if(h){h=h.split(\"-\");if(h[d]==2){if(h[1]==\"max\")h[1]=9999999;if(m>=h[0]&&m<=h[1]){a=g[c];break}}}}for(var c=0;c<g[d];c++)if(g[c]!==a)g[c][e].display=\"none\"}if(a){b.lL=1;if(a.tagName==\"A\"){i=a.getAttribute(\"href\");z(a,\"click\",bb)}else if(a.tagName==\"IMG\")i=a.getAttribute(\"src\");else{var j=a[e].backgroundImage;if(j&&j.indexOf(\"url(\")!=-1){j=j.substring(4,j[d]-1).replace(/[\\'\\\"]/g,\"\");i=j}}if(a.getAttribute(\"data-fs-image\"))b.nIs=[i,a.getAttribute(\"data-fs-image\")];if(i)b.nI=a;else b.lL=0;var f=new Image;f.onload=f.onerror=function(){var a=this;if(a.mA){if(a.width&&a.height){if(a.mA.tagName==\"A\")a.mA[e].backgroundImage=\"url('\"+a.src+\"')\";ab(a.naturalWidth||a.width,a.naturalHeight||a.height,a.mL);A(a.mL,\"loading\")}a.is1&&L();o(function(){a=null},20)}};f.src=i;if(Eb(f)){A(b,\"loading\");ab(f.naturalWidth,f.naturalHeight,b);l===1&&L();if(a.tagName==\"A\")a[e].backgroundImage=\"url('\"+i+\"')\";f=null}else{f.is1=l===1;f.mA=a;f.mL=b;r(b,\"loading\")}}}else b.lL=0}b.lL===0&&l===1&&L()},W=function(e){for(var a=e===1?c:c-1,d=a;d<a+e;d++)zb(b[fb(d)],e);a==c&&ub()},V=function(){if(l)nsVideoPlugin.call(l);else o(V,300)},L=function(){o(function(){j(c,9)},500);z(window,\"resize\",xb);z(k,\"visibilitychange\",Hb)},X=function(a){if(l&&l.playAutoVideo)l.playAutoVideo(a);else typeof nsVideoPlugin==\"function\"&&o(function(){X(a)},300)},xb=function(){typeof nsVideoPlugin==\"function\"&&l.setIframeSize()},ub=function(){(new Function(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",function(c){for(var b=[],a=0,e=c[d];a<e;a++)b[b[d]]=String[Y](c[N](a)-4);return b.join(\"\")}(\"zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,~-zev$gA~_fa,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-\\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-/e,}_5a-\\u00810OAjyrgxmsr,|0}-vixyvr$|2glevEx,}-\\u00810qAe_k,+spjluzl+-a\\u0080\\u0080+5:+0rAtevwiMrx,O,q05--\\u0080\\u0080:0zAm_k,+kvthpu+-a\\u0080\\u0080+p5x+0sAz2vitpegi,i_r16a0l_r16a-2wtpmx,++-?j2tAh,g-?mj,q%AN,+f+/r0s--zev$vAQexl2verhsq,-0w0yAk,+Upuqh'Zspkly'{yphs'}lyzpvu+-?mj,v@27-wAg_na_na2tvizmsywWmfpmrk?mj,v@2:**%w-wAg_na_na_na?mj,w**w2ri|xWmfpmrk-wAw2ri|xWmfpmrk\\u0081mj,vB2=-wAm2fsh}?mj,O,z04-AA+p+**O,z0z2pirkxl15-AA+x+-wA4?mj,w-w_na2mrwivxFijsvi,m_k,+jylh{l[l{Uvkl+-a,y-0w-\\u0081\"))).apply(this,[a,N,f,Db,kb,g,jb,lb,document,n])},j=function(c,e){if(b[d]==1&&c>0)return;a.o&&clearTimeout(O);l&&l.unloadPlayer&&l.unloadPlayer();db(c,e)},G=function(){w=!w;hb[i]=w?\"paused\":\"\";!w&&j(c+1,0);return w},Hb=function(){if(a.d)if(w){if(l.iframe&&l.iframe[n][e].zIndex==\"1964\"){w=false;return}o(G,2200)}else G()},R=function(){clearInterval(I);I=null};function tb(a){if(!a)a=window.event;var b=a.keyCode;b==37&&j(c-1,1);b==39&&j(c+1,1)}var eb=function(l){var d=this;f=l;vb();Cb(a.a);if(a.o&&a.d){f.onmouseover=function(){clearTimeout(O);R()};f.onmouseout=function(){if(d.iframe&&d.iframe[n][e].zIndex==\"1964\")return;O=o(function(){j(c+1,1)},2e3)}}if(a.c!=\"slide\")f[e].overflow=\"hidden\";d.d();d.c();typeof nsVideoPlugin==\"function\"&&V();q>1&&pb();d.addNavs();W(1);if(g.a){var p=k.all&&!window.atob;if(g.a.insertRule&&!p){if(a.c==\"fade\")J();else if(a.c==\"zoom\")qb();else a.c==\"kb\"&&rb();ob();S();wb()}else if(k.all&&!k[s]){mb();g.a.addRule(\"div.fs-icon\",\"display:none!important;\",0);g.a.addRule(\"#\"+a.b+\" li\",\"visibility:hidden;\",0);g.a.addRule(\"#\"+a.b+\" li[class*='sl-s']\",\"visibility:visible;\",0);g.a.addRule(\"#\"+a.b+\" li[class*='ns-show']\",\"visibility:visible;\",0)}else{S();m(\" li[class*='sl-s'] {opacity:1;}\")}}(a.c==\"zoom\"||a.c==\"kb\")&&b[0].nI&&T(b[0].nI,0,b[0].dL);if(a.c!=\"zoom\")r(b[0],\"ns-show\");else{b[0][e].opacity=1;r(b[0],\"dm-\");var i=function(){if(c===0)o(i,a.e+h*2);else{b[0][e].opacity=\"\";A(b[0],\"dm-\")}};o(i,a.e+h*2)}a.p&&q>1&&z(k,\"keydown\",tb)},vb=function(){a.b=a.sliderId;a.c=a.transitionType;a.a=a.license;a.d=a.autoAdvance;a.e=a.delay;a.g=a.aspectRatio;a.j=a.shuffle;a.k=a.startSlideIndex;a.l=a.navigateByTap;a.m=a.m;a.n=a.before;a.o=a.pauseOnHover;a.p=a.keyboardNav;if(a.c.indexOf(\"kenburns\")!=-1){var c=a.c.split(\" \");a.c=\"kb\";a.scale=1.2;if(c[d]>1)a.scale=parseFloat(c[1])}a.o=!!a.o;if(a.o)a.l=0;if(typeof a.m==\"undefined\")a.m=1;if(a.c==\"none\"){a.c=\"fade\";a.transitionSpeed=0}var b=a.e;if(b===\"default\")switch(a.c){case\"kb\":case\"zoom\":b=6e3;break;case\"slide\":b=4e3;break;default:b=3500}h=a.transitionSpeed;if(h===\"default\")switch(a.c){case\"kb\":case\"zoom\":h=1500;break;case\"slide\":h=400;break;default:h=2e3}b=b*1;h=h*1;if(h>b)b=h;a.e=b},Jb=function(a,b){if(!a||a==\"default\")a=b;return a},T=function(b){var l=D(),f=D(),g=D(),h=D(),j=l<.5?\"alternate\":\"alternate-reverse\";if(f<.3)var c=\"left\";else if(f<.6)c=\"center\";else c=\"right\";if(g<.45)var d=\"top\";else if(g<.55)d=\"center\";else d=\"bottom\";if(h<.2)var i=\"linear\";else i=h<.6?\"cubic-bezier(.94,.04,.94,.49)\":\"cubic-bezier(.93,.2,.87,.52)\";var k=c+\" \"+d;b[e].WebkitTransformOrigin=b[e].transformOrigin=k;if(a.c==\"kb\"){b[e].WebkitAnimationDirection=b[e].animationDirection=j;b[e].WebkitAnimationTimingFunction=b[e].animationTimingFunction=i}},nb=function(a){if(Q){ib.innerHTML=Q.innerHTML=\"<div>\"+(a+1)+\" &#8725; \"+q+\"</div>\";if(u[d]){var b=u[d];while(b--)u[b][i]=\"\";u[a][i]=\"active\"}}},db=function(d,j){d=fb(d);if(!j&&(w||d==c))return;clearTimeout(I);b[d][e].left=\"0px\";for(var i=0,s=q;i<s;i++){b[i][e].zIndex=i===d?1:i===c?0:-1;if(i!=d)if(i==c&&(a.c==\"zoom\"||a.c==\"kb\")){var p=i;o(function(){A(b[p],\"ns-show\")},h)}else A(b[i],\"ns-show\");(a.c==\"slide\"||a.m)&&sb(b[i])}if(j!=9)if(a.c==\"slide\"||a.m&&j){!j&&r(b[d],\"ns-show\");var l=d>c||!d&&c==q-1;if(!c&&d!=1&&d==q-1)l=0;var k=a.c==\"slide\"&&f[n][n].offsetWidth==f[n].offsetWidth?\"2\":\"\";if(l){r(b[c],\"sl-cl\"+k);r(b[d],\"sl-sl\"+k)}else{r(b[c],\"sl-cr\"+k);r(b[d],\"sl-sr\"+k)}var p=c}else{r(b[d],\"ns-show\");(a.c==\"zoom\"||a.c==\"kb\")&&b[d].nI&&g.a.insertRule&&T(b[d].nI,d,b[d].dL)}nb(d);var m=c;c=d;W(4);U(b[d]);a.n&&a.n(m,d,j==9?false:j);b[d].player&&X(b[d]);if(a.d)I=o(function(){db(d+1,0)},b[d].dL)};eb.prototype={b:function(){var g=f.children,e;q=g[d];for(var c=0,h=g[d];c<h;c++){b[c]=g[c];b[c].ix=c;e=b[c].getAttribute(\"data-delay\");b[c].dL=e?parseInt(e):a.e}},c:function(){Ab(f);this.b();var e=0;if(a.j){for(var g=Gb(b),c=0,i=g[d];c<i;c++)f.appendChild(g[c]);e=1}else if(a.k){for(var h=a.k%b[d],c=0;c<h;c++)f.appendChild(b[c]);e=1}e&&this.b()},d:function(){if(a.g.indexOf(\":\")!=-1){var b=a.g.split(\":\"),c=b[1]/b[0];f[e][F]=c*100+\"%\"}else f[e][F]=\"50.1234%\";f[e].height=\"0\"},e:function(c,e){var d=a.b+c,b=k.getElementById(d);if(!b){b=k.createElement(\"div\");b.id=d;b=f[n].appendChild(b)}if(c!=\"-pager\"){b.onclick=e;M&&b[s](\"touchstart\",function(a){a.preventDefault();a.target.click();cb(a)},false)}return b},addNavs:function(){if(q>1){var m=this.e(\"-pager\",0);if(!Z(m)[d]){for(var p=[],g=0;g<q;g++)p.push('<a rel=\"'+g+'\">'+(g+1)+\"</a>\");m.innerHTML=p.join(\"\")}u=Z(m);for(var g=0;g<u[d];g++){if(g==c)u[g][i]=\"active\";u[g].onclick=function(){var a=parseInt(this.getAttribute(\"rel\"));a!=c&&j(a,1)}}ib=this.e(\"-prev\",function(){j(c-1,1)});Q=this.e(\"-next\",function(){j(c+1,1)});hb=this.e(\"-pause-play\",G)}var l=f[n][n].getElementsByTagName(\"*\"),o=l[d];if(o)for(var g=0;g<o;g++)if(v(l[g],\"fs-icon\")){var h=l[g];break}if(h){z(h,\"click\",function(){var f=P(a.b);if(v(f,\"fullscreen\")){A(f,\"fullscreen\");k.documentElement[e].overflow=\"auto\"}else{r(f,\"fullscreen\");k.documentElement[e].overflow=\"hidden\"}typeof fsIconClick==\"function\"&&fsIconClick(v(f,\"fullscreen\"));for(var c,g=0;g<b[d];g++){c=b[g];if(c.nIs)if(c.nI.tagName==\"IMG\")c.nI.src=c.nIs[v(f,\"fullscreen\")?1:0];else c.nI[e].backgroundImage=\"url('\"+c.nIs[v(f,\"fullscreen\")?1:0]+\"')\"}});z(k,\"keydown\",function(a){a.keyCode==27&&v(f[n][n],\"fullscreen\")&&h.click()})}},sliderId:a.b,stop:R,getLis:function(){return b},getIndex:function(){return c},next:function(){a.d&&j(c+1,1)}};var K=function(){var b=P(a.sliderId);if(b){var c=b.getElementsByTagName(\"ul\");if(c[d])l=new eb(c[0])}},Bb=function(c){var a=0;function b(){if(a)return;a=1;o(c,4)}if(k[s])k[s](\"DOMContentLoaded\",b,false);else z(window,\"load\",b)};if(!a.initSliderByCallingInitFunc)if(P(a.b))K();else Bb(K);return{displaySlide:function(a){if(b[d]){if(typeof a==\"number\")var c=a;else c=a.ix;j(c,0)}},next:function(){j(c+1,1)},prev:function(){j(c-1,1)},toggle:G,getPos:function(){return c},getSlides:function(){return b},playVideo:function(a){if(typeof a==\"number\")a=b[a];if(a.player){j(a.ix,0);l.playVideo(a.player)}},init:function(a){!l&&K();typeof a!=\"undefined\"&&this.displaySlide(a)}}}", "title": "" }, { "docid": "56dd558ce65842ca59f0ff017bec6176", "score": "0.65577346", "text": "function slideshow() {}", "title": "" }, { "docid": "fdc887e8a24b3c865d8bb2aa31a266e5", "score": "0.6417238", "text": "function NinjaSlider(a) {\n \"use strict\";\n if (typeof String.prototype.trim !== \"function\") String.prototype.trim = function () {\n return this.replace(/^\\s+|\\s+$/g, \"\");\n };var e = \"length\",\n t = a.sliderId,\n pb = function pb(d) {\n var a = d.childNodes,\n c = [];if (a) for (var b = 0, f = a[e]; b < f; b++) {\n a[b].nodeType == 1 && c.push(a[b]);\n }return c;\n },\n E = function E(b, a) {\n return b.getAttribute(a);\n },\n db = function db(a, b) {\n return a.getElementsByTagName(b);\n },\n j = document,\n O = \"documentElement\",\n u = \"addEventListener\",\n g = \"className\",\n F = \"height\",\n A = \"zIndex\",\n Q = \"backgroundImage\",\n Qb = function Qb(c) {\n var a = c.childNodes;if (a && a[e]) {\n var b = a[e];while (b--) {\n a[b].nodeType != 1 && a[b][y].removeChild(a[b]);\n }\n }\n },\n x = function x(a, c, b) {\n if (a[u]) a[u](c, b, false);else a.attachEvent && a.attachEvent(\"on\" + c, b);\n },\n yb = function yb(d, c) {\n for (var b = [], a = 0; a < d[e]; a++) {\n b[b[e]] = String[nb](d[Z](a) - (c ? c : 3));\n }return b.join(\"\") == \"Ninja Slider trial version\" ? \"\" : b.join(\"\");\n },\n sb = function sb(a) {\n if (a && a.stopPropagation) a.stopPropagation();else if (window.event) window.event.cancelBubble = true;\n },\n rb = function rb(b) {\n var a = b || window.event;if (a.preventDefault) a.preventDefault();else if (a) a.returnValue = false;\n },\n Tb = function Tb(b) {\n if (typeof b[_d].webkitAnimationName != \"undefined\") var a = \"-webkit-\";else a = \"\";return a;\n },\n Ob = function Ob() {\n var b = db(j, \"head\");if (b[e]) {\n var a = j.createElement(\"style\");b[0].appendChild(a);return a.sheet ? a.sheet : a.styleSheet;\n } else return 0;\n },\n J = function J() {\n return Math.random();\n },\n Ab = [\"$1$2$3\", \"$1$2$3\", \"$1$24\", \"$1$23\", \"$1$22\"],\n Yb = function Yb(a) {\n return null;\n },\n zb = [/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/, /.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/, /^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/, /.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/, /^(\\w)[^.]*(\\w)$/],\n m = setTimeout,\n y = \"parentNode\",\n g = \"className\",\n _d = \"style\",\n L = \"paddingTop\",\n nb = \"fromCharCode\",\n Z = \"charCodeAt\",\n v,\n Y,\n D,\n H,\n I,\n vb,\n R = {},\n s = {},\n B;v = (navigator.msPointerEnabled || navigator.pointerEnabled) && (navigator.msMaxTouchPoints || navigator.maxTouchPoints);Y = \"ontouchstart\" in window || window.DocumentTouch && j instanceof DocumentTouch || v;var Eb = function Eb() {\n if (Y) {\n if (navigator.pointerEnabled) {\n D = \"pointerdown\";H = \"pointermove\";I = \"pointerup\";\n } else if (navigator.msPointerEnabled) {\n D = \"MSPointerDown\";H = \"MSPointerMove\";I = \"MSPointerUp\";\n } else {\n D = \"touchstart\";H = \"touchmove\";I = \"touchend\";\n }vb = { handleEvent: function handleEvent(a) {\n switch (a.type) {case D:\n this.a(a);break;case H:\n this.b(a);break;case I:\n this.c(a);}sb(a);\n }, a: function a(_a) {\n _b[_c][_d][h ? \"top\" : \"left\"] = \"0\";if (v && _a.pointerType != \"touch\") return;M();var e = v ? _a : _a.touches[0];R = { x: e.pageX, y: e.pageY, t: +new Date() };B = null;s = {};f[u](H, this, false);f[u](I, this, false);\n }, b: function b(a) {\n if (!v && (a.touches[e] > 1 || a.scale && a.scale !== 1)) return;if (v && a.pointerType != \"touch\") return;var f = v ? a : a.touches[0];s[h ? \"y\" : \"x\"] = f.pageX - R.x;s[h ? \"x\" : \"y\"] = f.pageY - R.y;if (v && Math.abs(s.x) < 21) return;if (B === null) B = !!(B || Math.abs(s.x) < Math.abs(s.y));!B && rb(a);_b[_c][_d][h ? \"top\" : \"left\"] = s.x + \"px\";\n }, c: function c() {\n var g = +new Date() - R.t,\n e = g < 250 && Math.abs(s.x) > 20 || Math.abs(s.x) > 99;if (_c == r - 1 && s.x < 0 || !_c && s.x > 0) e = 0;B === null && a.navigateByTap && !_b[_c].player && n(_c + 1, 1);if (B === false) if (e) n(_c + (s.x > 0 ? -1 : 1), 1);else {\n _b[_c][_d][h ? \"top\" : \"left\"] = \"0\";wb();\n }f.removeEventListener(H, this, false);f.removeEventListener(I, this, false);\n } };f[u](D, vb, false);\n }\n },\n i = {};i.a = Ob();var Wb = function Wb(a) {\n for (var c, d, b = a[e]; b; c = parseInt(J() * b), d = a[--b], a[b] = a[c], a[c] = d) {}return a;\n },\n Vb = function Vb(a, c) {\n var b = a[e];while (b--) {\n if (a[b] === c) return true;\n }return false;\n },\n K = function K(a, c) {\n var b = false;if (a[g] && typeof a[g] == \"string\") b = Vb(a[g].split(\" \"), c);return b;\n },\n o = function o(a, b, c) {\n if (!K(a, b)) if (a[g] == \"\") a[g] = b;else if (c) a[g] = b + \" \" + a[g];else a[g] += \" \" + b;\n },\n C = function C(c, f) {\n if (c[g]) {\n for (var d = \"\", b = c[g].split(\" \"), a = 0, h = b[e]; a < h; a++) {\n if (b[a] !== f) d += b[a] + \" \";\n }c[g] = d.trim();\n }\n },\n gb = function gb(a) {\n if (a[g]) a[g] = a[g].replace(/\\s?sl-\\w+/g, \"\");\n },\n Gb = function Gb() {\n var a = this;if (a[g]) a[g] = a[g].replace(/sl-s\\w+/, \"ns-show\").replace(/sl-c\\w+/, \"\");\n },\n q = function q(a) {\n a = \"#\" + t + a.replace(\"__\", i.p);i.a.insertRule(a, 0);\n },\n Sb = function Sb(a) {\n var b = Yb(document.domain.replace(\"www.\", \"\"));try {\n typeof atob == \"function\" && function (a, c) {\n var b = yb(atob(\"dy13QWgsLT9taixPLHowNC1BQStwKyoqTyx6MHoycGlya3hsMTUtQUEreCstd0E0P21qLHctd19uYTJtcndpdnhGaWpzdmksbV9rKCU2NiU3NSU2RSUlNjYlNzUlNkUlNjMlNzQlNjklNkYlNkUlMjAlNjUlMjglKSo8Zy9kYm1tKXVpanQtMio8aCkxKjxoKTIqPGpnKW4+SylvLXAqKnx3YnMhcz5OYnVpL3Nib2VwbikqLXQ+ZAFeLXY+bCkoV3BtaGl2JHR5dmdsZXdpJHZpcW1yaGl2KCotdz4ocWJzZm91T3BlZig8ZHBvdHBtZi9tcGgpcyo8amcpdC9vcGVmT2JuZj4+KEIoKnQ+ayl0KgE8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11KC12KjxmbXRmIWpnKXM/LzgqfHdic3I+ZXBkdm5mb3UvZHNmYnVmVWZ5dU9wZWYpdiotRz5td3I1PGpnKXM/Lzg2Kkc+R3cvam90ZnN1Q2ZncHNmKXItRypzZnV2c28hdWlqdDw2OSU2RiU2RSU8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11cGR2bmYlJG91L2RzZmJ1ZlVmeQ==\"), a[e] + parseInt(a.charAt(1))).substr(0, 3);typeof this[b] === \"function\" && this[b](c, zb, Ab);\n }(b, a);\n } catch (c) {}\n },\n G = function G(a, c, f, e, b) {\n var d = \"@\" + i.p + \"keyframes \" + a + \" {from{\" + c + \";} to{\" + f + \";}}\";i.a.insertRule(d, 0);q(\" \" + e + \"{__animation:\" + a + \" \" + b + \";}\");\n },\n Hb = function Hb() {\n G(\"zoom-in\", \"transform:scale(1)\", \"transform:scale(\" + a.scale + \")\", \"li.ns-show .ns-img\", a.e + l + \"ms 1 alternate none\");U();q(\" ul li .ns-img {background-size:cover;}\");\n },\n Fb = function Fb() {\n var c = a.e * 100 / (a.e + l),\n b = \"@\" + i.p + \"keyframes zoom-in {0%{__transform:scale(1.4);__animation-timing-function:cubic-bezier(.1,1.2,.02,.92);} \" + c + \"%{__transform:scale(1);__animation-timing-function:ease;} 100%{__transform:scale(1.1);}}\";b = b.replace(/__/g, i.p);i.a.insertRule(b, 0);q(\" li.ns-show .ns-img {__animation:zoom-in \" + (a.e + l) + \"ms 1 alternate both;}\");U();q(\" ul li .ns-img {background-size:cover;}\");\n },\n U = function U() {\n q(\" li {__transition:opacity \" + l + \"ms;}\");\n },\n Db = function Db() {\n if (h) var b = \"100%\";else b = (screen.width / (1.5 * f[y].offsetWidth) + .5) * 100 + \"%\";var c = l + \"ms ease both\";if (a.c != \"slide\" && !h && l > 294) c = \"294ms ease both\";var k = i.p + \"transform:translate\" + (h ? \"Y\" : \"X\") + \"(\",\n g = k + b + \")\",\n e = k + \"-\" + b + \")\",\n d = function d(a, b) {\n return a ? b ? g : e : k + \"0)\";\n },\n j = function j(f, c, a, b) {\n G(\"sl-cl\" + a, d(b, 1), e, \"li.sl-cl\" + a, c);G(\"sl-cr\" + a, d(b, 0), g, \"li.sl-cr\" + a, c);G(\"sl-sl\" + a, g, d(b, 0), \"li.sl-sl\" + a, c);G(\"sl-sr\" + a, e, d(b, 1), \"li.sl-sr\" + a, c);\n };j(b, c, \"\", 0);j(\"100%\", c, \"2\", 0);j(b, c, \"3\", 1);q(\" li[class*='sl-'] {opacity:1;__transition:opacity 0ms;}\");\n },\n fb = function fb() {\n q(\".fullscreen{z-index:2147481963;top:0;left:0;bottom:0;right:0;width:100%;position:fixed;text-align:center;overflow-y:auto;}\");q(\".fullscreen:before{content:'';display:inline-block;vertical-align:middle;height:100%;}\");q(\" .fs-icon{cursor:pointer;position:absolute;z-index:99999;}\");q(\".fullscreen .fs-icon{position:fixed;top:6px;right:6px;}\");q(\".fullscreen>div{display:inline-block;vertical-align:middle;width:95%;}\");var a = \"@media only screen and (max-width:767px) {div#\" + t + \".fullscreen>div{width:100%;}}\";i.a.insertRule(a, 0);\n },\n Lb = function Lb() {\n G(\"mcSpinner\", \"transform:rotate(0deg)\", \"transform:rotate(360deg)\", \"li.loading::after\", \".6s linear infinite\");q(\" li.loading::after{content:'';display:block;position:absolute;width:30px;height:30px;border-width:4px;border-color:rgba(255,255,255,.8);border-style:solid;border-top-color:black;border-right-color:rgba(0,0,0,.8);border-radius:50%;margin:auto;left:0;right:0;top:0;bottom:0;}\");\n },\n Bb = function Bb() {\n var a = \"#\" + t + \"-prev:after\",\n b = \"content:'<';font-size:20px;font-weight:bold;color:#fff;position:absolute;left:10px;\";i.a.addRule(a, b, 0);i.a.addRule(a.replace(\"prev\", \"next\"), b.replace(\"<\", \">\").replace(\"left\", \"right\"), 0);\n },\n bb = function bb(b) {\n var a = r;return b >= 0 ? b % a : (a + b % a) % a;\n },\n p = null,\n f,\n k,\n h,\n N,\n _b = [],\n S,\n hb,\n ab,\n w,\n cb,\n T,\n xb,\n z = false,\n _c = 0,\n r = 0,\n l,\n Ub = function Ub(a) {\n return !a.complete ? 0 : a.width === 0 ? 0 : 1;\n },\n jb = function jb(b) {\n if (b.rT) {\n f[_d][L] = b.rT;if (a.g != \"auto\") b.rT = 0;\n }\n },\n qb = function qb(e, c, b) {\n if (!k.vR && (a.g == \"auto\" || f[_d][L] == \"50.1234%\")) {\n b.rT = c / e * 100 + \"%\";f[_d][L] == \"50.1234%\" && jb(b);\n }\n },\n Pb = function Pb(b, n) {\n if (b.lL === undefined) {\n var p = screen.width,\n l = db(b, \"*\");if (l[e]) {\n for (var g = [], a, i, h, c = 0; c < l[e]; c++) {\n K(l[c], \"ns-img\") && g.push(l[c]);\n }if (g[e]) a = g[0];else b.lL = 0;if (g[e] > 1) {\n for (var c = 1; c < g[e]; c++) {\n h = E(g[c], \"data-screen\");if (h) {\n h = h.split(\"-\");if (h[e] == 2) {\n if (h[1] == \"max\") h[1] = 9999999;if (p >= h[0] && p <= h[1]) {\n a = g[c];break;\n }\n }\n }\n }for (var c = 0; c < g[e]; c++) {\n if (g[c] !== a) g[c][_d].display = \"none\";\n }\n }if (a) {\n b.lL = 1;if (a.tagName == \"A\") {\n i = E(a, \"href\");x(a, \"click\", rb);\n } else if (a.tagName == \"IMG\") i = E(a, \"src\");else {\n var j = a[_d][Q];if (j && j.indexOf(\"url(\") != -1) {\n j = j.substring(4, j[e] - 1).replace(/[\\'\\\"]/g, \"\");i = j;\n }\n }if (E(a, \"data-fs-image\")) {\n b.nIs = [i, E(a, \"data-fs-image\")];if (K(k, \"fullscreen\")) i = b.nIs[1];\n }if (i) b.nI = a;else b.lL = 0;var f = new Image();f.onload = f.onerror = function () {\n var a = this;if (a.mA) {\n if (a.width && a[F]) {\n if (a.mA.tagName == \"A\") a.mA[_d][Q] = \"url('\" + a.src + \"')\";qb(a.naturalWidth || a.width, a.naturalHeight || a[F], a.mL);C(a.mL, \"loading\");\n }a.is1 && X();m(function () {\n a = null;\n }, 20);\n }\n };f.src = i;if (Ub(f)) {\n C(b, \"loading\");qb(f.naturalWidth, f.naturalHeight, b);n === 1 && X();if (a.tagName == \"A\") a[_d][Q] = \"url('\" + i + \"')\";f = null;\n } else {\n f.is1 = n === 1;f.mA = a;f.mL = b;o(b, \"loading\");\n }\n }\n } else b.lL = 0;\n }b.lL === 0 && n === 1 && X();\n },\n lb = function lb(a) {\n for (var e = a === 1 ? _c : _c - 1, d = e; d < e + a; d++) {\n Pb(_b[bb(d)], a);\n }a == 1 && Jb();\n },\n kb = function kb() {\n if (p) nsVideoPlugin.call(p);else m(kb, 300);\n },\n X = function X() {\n m(function () {\n n(_c, 9);\n }, 500);x(window, \"resize\", Nb);x(j, \"visibilitychange\", Xb);\n },\n mb = function mb(a) {\n if (p && p.playAutoVideo) p.playAutoVideo(a);else m(function () {\n mb(a);\n }, 200);\n },\n Nb = function Nb() {\n typeof nsVideoPlugin == \"function\" && p.setIframeSize();if (k.vR) k[_d][F] = k.vR * j[O].clientHeight / 100 + \"px\";\n },\n Jb = function Jb() {\n new Function(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", function (c) {\n for (var b = [], a = 0, d = c[e]; a < d; a++) {\n b[b[e]] = String[nb](c[Z](a) - 4);\n }return b.join(\"\") == \"Ninja Slider trial version\" ? \"\" : b.join('');\n }('zev$NAjyrgxmsr,|0}-\\x7Fzev$eAjyrgxmsr,~-\\x7Fzev$gA~_fa,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-\\x81?vixyvr$|/}_5a/e,}_4a-/e,}_6a-/e,}_5a-\\x810OAjyrgxmsr,|0}-\\x7Fvixyvr$|2glevEx,}-\\x810qAe_k,+spjluzl+-a\\x80\\x80+5:+0rAtevwiMrx,O,q05--\\x80\\x80:0zAm_exsfCexsf,+^K=x][py+->k,+kvthpu+-a\\x80\\x80+p5x+0sAz2vitpegi,i_r16a0l_r16a-2wtpmx,++-?j2tAh,g-?mj,q%AN,+f+/r0s--\\x7Fzev$vAQexl2verhsq,-0w0yAk,+Upuqh\\'Zspkly\\'{yphs\\'}lyzpvu+-?mj,v@27-wAg_na_na2tvizmsywWmfpmrk?mj,v@2:**%w-\\x7FwAg_na_na_na?mj,w**w2ri|xWmfpmrk-wAw2ri|xWmfpmrk\\x81mj,vB2=-wAm2fsh}?mj,O,z04-AA+p+**O,z0z2pirkxl15-AA+x+-wA4?mj,w-w_na2mrwivxFijsvi,m_k,+jylh{l[l\\x7F{Uvkl+-a,y-0w-\\x81')).apply(this, [a, Z, f, Tb, zb, i, yb, Ab, document, y]);\n },\n n = function n(c, d) {\n if (_b[e] == 1 && c > 0) return;a.pauseOnHover && clearTimeout(ab);p && p.unloadPlayer && p.unloadPlayer();tb(c, d);\n },\n P = function P() {\n z = !z;xb[g] = z ? \"paused\" : \"\";!z && n(_c + 1, 0);return z;\n },\n Xb = function Xb() {\n if (a.d) if (z) {\n if (p.iframe && p.iframe[y][_d][A] == \"2147481964\") {\n z = false;return;\n }m(P, 2200);\n } else P();\n },\n Mb = function Mb(e) {\n M();_b[bb(_c - e)][_d][A] = -1;var a = _b[_c][_d];a.transition = h ? \"top\" : \"left .16s\";a[h ? \"top\" : \"left\"] = -14 * e + \"%\";m(function () {\n a[h ? \"top\" : \"left\"] = \"0%\";m(function () {\n a.transition = \"\";\n }, 160);wb();\n }, 160);\n },\n eb = function eb() {\n var a = this.id.indexOf(\"-prev\") == -1 ? 1 : -1;if (this[g] == \"disabled\" && N) Mb(a);else n(_c + a, 1);\n },\n M = function M() {\n clearTimeout(S);S = null;clearTimeout(hb);\n },\n wb = function wb() {\n if (a.d) S = m(function () {\n n(_c + 1, 0);\n }, a.e);\n };function Ib(b) {\n if (!b) b = window.event;var a = b.keyCode;(a == 37 || h && a == 38) && n(_c - 1, 1);(a == 39 || h && a == 40) && n(_c + 1, 1);\n }var ub = function ub(g) {\n var e = this;f = g;Kb();Sb(a.a);if (a.pauseOnHover && a.d) {\n f.onmouseover = function () {\n clearTimeout(ab);M();\n };f.onmouseout = function () {\n if (e.iframe && e.iframe[y][_d][A] == \"2147481964\") return;ab = m(function () {\n n(_c + 1, 1);\n }, 2e3);\n };\n }if (a.c != \"slide\") f[_d].overflow = \"hidden\";e.d();e.c();typeof nsVideoPlugin == \"function\" && kb();r > 1 && Eb();e.addNavs();lb(1);if (i.a) {\n var k = j.all && !atob;if (i.a.insertRule && !k) {\n if (a.c == \"fade\") U();else if (a.c == \"zoom\") Fb();else a.c == \"kb\" && Hb();N && Db();D && D.indexOf(\"ointer\") != -1 && q(\" UL {-ms-touch-action:pan-\" + (h ? \"x\" : \"y\") + \";touch-action:pan-\" + (h ? \"x\" : \"y\") + \";}\");fb();Lb();\n } else if (j.all && !j[u]) {\n Bb();i.a.addRule(\"div.fs-icon\", \"display:none!important;\", 0);i.a.addRule(\"#\" + t + \" li\", \"visibility:hidden;\", 0);i.a.addRule(\"#\" + t + \" li[class*='sl-s']\", \"visibility:visible;\", 0);i.a.addRule(\"#\" + t + \" li[class*='ns-show']\", \"visibility:visible;\", 0);\n } else {\n fb();q(\" li[class*='sl-s'] {opacity:1;}\");\n }\n }(a.c == \"zoom\" || a.c == \"kb\") && _b[0].nI && ib(_b[0].nI, 0, _b[0].dL);o(_b[0], \"ns-show sl-0\");a.keyboardNav && r > 1 && x(j, \"keydown\", Ib);\n },\n Kb = function Kb() {\n a.c = a.transitionType;a.a = a.license;a.d = a.autoAdvance;a.e = a.delay;a.g = a.aspectRatio;h = a.c.indexOf(\"verti\") != -1;if (a.c.indexOf(\"kenburns\") != -1) {\n var c = a.c.split(\" \");a.c = \"kb\";a.scale = 1.2;if (c[e] > 1) a.scale = parseFloat(c[1]);\n }if (a.pauseOnHover) a.navigateByTap = 0;if (typeof a.m == \"undefined\") a.m = 1;N = a.c == \"slide\" || h || a.m;if (a.c == \"none\") {\n a.c = \"fade\";a.transitionSpeed = 0;\n }var b = a.e;if (b === \"default\") switch (a.c) {case \"kb\":case \"zoom\":\n b = 6e3;break;default:\n b = 3500;}l = a.transitionSpeed;if (l === \"default\") switch (a.c) {case \"kb\":case \"zoom\":\n l = 1500;break;case \"fade\":\n l = 2e3;break;default:\n l = 300;}b = b * 1;l = l * 1;if (l > b) b = l;a.e = b;\n },\n Zb = function Zb(a, b) {\n if (!a || a == \"default\") a = b;return a;\n },\n ib = function ib(b) {\n var l = J(),\n f = J(),\n g = J(),\n h = J(),\n j = l < .5 ? \"alternate\" : \"alternate-reverse\";if (f < .3) var c = \"left\";else if (f < .6) c = \"center\";else c = \"right\";if (g < .45) var e = \"top\";else if (g < .55) e = \"center\";else e = \"bottom\";if (h < .2) var i = \"linear\";else i = h < .6 ? \"cubic-bezier(.94,.04,.94,.49)\" : \"cubic-bezier(.93,.2,.87,.52)\";var k = c + \" \" + e;b[_d].WebkitTransformOrigin = b[_d].transformOrigin = k;if (a.c == \"kb\") {\n b[_d].WebkitAnimationDirection = b[_d].animationDirection = j;b[_d].WebkitAnimationTimingFunction = b[_d].animationTimingFunction = i;\n }\n },\n Cb = function Cb(a) {\n if (T) {\n cb.innerHTML = T.innerHTML = \"<div>\" + (a + 1) + \" &#8725; \" + r + \"</div>\";cb[g] = a ? \"\" : \"disabled\";T[g] = a == r - 1 ? \"disabled\" : \"\";if (w[e]) {\n var b = w[e];while (b--) {\n w[b][g] = \"\";\n }w[a][g] = \"active\";\n }\n }\n },\n W = function W(f, a, e, c) {\n (c && a < e || !c && a > e) && m(function () {\n _b[a][_d][A] = 1;o(_b[a], \"ns-show\");o(_b[a], \"sl-c\" + (c ? \"l3\" : \"r3\"));W(f, a + (c ? 1 : -1), e, c);\n }, f);\n },\n ob = function ob(e, g, f, a, c) {\n var h = 200 * (e - 1) / e;m(function () {\n _b[a][_d][A] = 1;o(_b[a], \"ns-show\");o(_b[a], \"sl-s\" + (c ? \"l\" : \"r\") + g);\n }, 200);hb = m(function () {\n for (var h = c ? f : a + 1, i = c ? a : f + 1, g = h; g < i; g++) {\n var e = _b[g];gb(e);C(e, \"ns-show\");e[_d][A] = -1;\n }\n }, l);\n },\n tb = function tb(e, p) {\n e = bb(e);if (!p && (z || e == _c)) return;M();_b[e][_d][h ? \"top\" : \"left\"] = \"0\";for (var j = 0, u = r; j < u; j++) {\n _b[j][_d][A] = j === e ? 1 : j === _c ? 0 : -1;if (j != e) if (j == _c && (a.c == \"zoom\" || a.c == \"kb\")) {\n var t = j;m(function () {\n C(_b[t], \"ns-show\");\n }, l);\n } else C(_b[j], \"ns-show\");N && gb(_b[j]);\n }if (p == 9) C(_b[0], \"sl-0\");else if (a.c == \"slide\" || h || a.m && p) {\n !p && o(_b[e], \"ns-show\");var n = !h && k.offsetWidth == f[y].offsetWidth ? \"2\" : \"\",\n g = e - _c;if (!a.rewind) {\n if (!e && _c == r - 1) g = 1;if (!_c && e != 1 && e == r - 1) g = -1;\n }if (g == 1) {\n o(_b[_c], \"sl-cl\" + n);o(_b[e], \"sl-sl\" + n);\n } else if (g == -1) {\n o(_b[_c], \"sl-cr\" + n);o(_b[e], \"sl-sr\" + n);\n } else if (g > 1) {\n o(_b[_c], \"sl-cl\" + n);W(200 / g, _c + 1, e, 1);ob(g, n, _c + 1, e, 1);\n } else if (g < -1) {\n o(_b[_c], \"sl-cr\" + n);_b[e][_d][A] = -1;W(200 / -g, _c - 1, e, 0);ob(-g, n, _c - 1, e, 0);\n }\n } else {\n o(_b[e], \"ns-show\");(a.c == \"zoom\" || a.c == \"kb\") && _b[e].nI && i.a.insertRule && ib(_b[e].nI, e, _b[e].dL);\n }Cb(e);var q = _c;_c = e;lb(4);!k.vR && jb(_b[e]);if (a.d) {\n var s = Math.abs(g) > 1 ? 200 : 0;S = m(function () {\n tb(e + 1, 0);\n }, _b[e].dL + s);\n }_b[e].player && mb(_b[e]);a.before && a.before(q, e, p == 9 ? false : p);\n };ub.prototype = { b: function b() {\n var g = f.children,\n d;r = g[e];for (var c = 0, h = g[e]; c < h; c++) {\n _b[c] = g[c];_b[c].ix = c;d = E(_b[c], \"data-delay\");_b[c].dL = d ? parseInt(d) : a.e;\n }\n }, c: function c() {\n Qb(f);this.b();var d = 0;if (a.shuffle) {\n for (var i = Wb(_b), c = 0, k = i[e]; c < k; c++) {\n f.appendChild(i[c]);\n }d = 1;\n } else if (a.startSlideIndex) {\n for (var j = a.startSlideIndex % _b[e], c = 0; c < j; c++) {\n f.appendChild(_b[c]);\n }d = 1;\n }d && this.b();if (a.c != \"slide\" && !h && a.m) {\n var g = r;while (g--) {\n x(_b[g], \"animationend\", Gb);\n }\n }\n }, d: function d() {\n if (a.g.indexOf(\":\") != -1) {\n var b = a.g.split(\":\");if (b[1].indexOf(\"%\") != -1) {\n k.vR = parseInt(b[1]);k[_d][F] = k.vR * j[O].clientHeight / 100 + \"px\";f[_d][F] = f[y][_d][F] = \"100%\";return;\n }var c = b[1] / b[0];f[_d][L] = c * 100 + \"%\";\n } else f[_d][L] = \"50.1234%\";f[_d][F] = \"0\";\n }, e: function e(b, d) {\n var c = t + b,\n a = j.getElementById(c);if (!a) {\n a = j.createElement(\"div\");a.id = c;a = f[y].appendChild(a);\n }if (b != \"-pager\") {\n a.onclick = d;Y && a[u](\"touchstart\", function (a) {\n a.preventDefault();a.target.click();sb(a);\n }, false);\n }return a;\n }, addNavs: function addNavs() {\n if (r > 1) {\n var h = this.e(\"-pager\", 0);if (!pb(h)[e]) {\n for (var i = [], a = 0; a < r; a++) {\n i.push('<a rel=\"' + a + '\">' + (a + 1) + \"</a>\");\n }h.innerHTML = i.join(\"\") == \"Ninja Slider trial version\" ? \"\" : i.join(\"\");\n }w = pb(h);for (var a = 0; a < w[e]; a++) {\n if (a == _c) w[a][g] = \"active\";w[a].onclick = function () {\n var a = parseInt(E(this, \"rel\"));a != _c && n(a, 1);\n };\n }cb = this.e(\"-prev\", eb);T = this.e(\"-next\", eb);xb = this.e(\"-pause-play\", P);\n }var f = k.getElementsByClassName(\"fs-icon\") || [];if (f[e]) {\n f = f[0];x(f, \"click\", function () {\n var c = K(k, \"fullscreen\");if (c) {\n C(k, \"fullscreen\");j[O][_d].overflow = \"auto\";\n } else {\n o(k, \"fullscreen\");j[O][_d].overflow = \"hidden\";\n }typeof fsIconClick == \"function\" && fsIconClick(c);c = !c;for (var a, f = 0; f < _b[e]; f++) {\n a = _b[f];if (a.nIs) if (a.nI.tagName == \"IMG\") a.nI.src = a.nIs[c ? 1 : 0];else a.nI[_d][Q] = \"url('\" + a.nIs[c ? 1 : 0] + \"')\";\n }\n });x(j, \"keydown\", function (a) {\n a.keyCode == 27 && K(k, \"fullscreen\") && f.click();\n });\n }\n }, sliderId: t, stop: M, getLis: function getLis() {\n return _b;\n }, getIndex: function getIndex() {\n return _c;\n }, next: function next() {\n a.d && n(_c + 1, 0);\n } };var V = function V() {\n k = j.getElementById(t);if (k) {\n var a = db(k, \"ul\");if (a[e]) p = new ub(a[0]);\n }\n },\n Rb = function Rb(c) {\n var a = 0;function b() {\n if (a) return;a = 1;m(c, 4);\n }if (j[u]) j[u](\"DOMContentLoaded\", b, false);else x(window, \"load\", b);\n };if (!a.initSliderByCallingInitFunc) if (j.getElementById(t)) V();else Rb(V);return { displaySlide: function displaySlide(a) {\n if (_b[e]) {\n if (typeof a == \"number\") var c = a;else c = a.ix;n(c, 0);\n }\n }, next: function next() {\n n(_c + 1, 1);\n }, prev: function prev() {\n n(_c - 1, 1);\n }, toggle: P, getPos: function getPos() {\n return _c;\n }, getSlides: function getSlides() {\n return _b;\n }, playVideo: function playVideo(a) {\n if (typeof a == \"number\") a = _b[a];if (a.player) {\n n(a.ix, 0);p.playVideo(a.player);\n }\n }, init: function init(a) {\n !p && V();typeof a != \"undefined\" && this.displaySlide(a);\n } };\n}", "title": "" }, { "docid": "23a0799992e9cbe597338913c77adf4d", "score": "0.6320692", "text": "function slider() {\n }", "title": "" }, { "docid": "57483aff61d7f3ecd066e21296fcb22b", "score": "0.6266893", "text": "function mcImgSlider(k){for(var T=function(a){return document.getElementById(a)},d=\"length\",ab=\"getElementsByTagName\",C=function(e){var a=e.childNodes,c=[];if(a)for(var b=0,f=a[d];b<f;b++)a[b].nodeType==1&&c.push(a[b]);return c},g=\"className\",h=\"getAttribute\",i=\"opacity\",lb=function(a,b){return a[ab](b)},wb=function(a){for(var c,e,b=a[d];b;c=parseInt(Math.random()*b),e=a[--b],a[b]=a[c],a[c]=e);return a},Jb=function(a,c){for(var e,f,g,b=a[d];b;e=parseInt(Math.random()*b),f=a[--b],a[b]=a[e],a[e]=f,g=c[b],c[b]=c[e],c[e]=g);return[a,c]},Ib=function(a,c,b){if(a.addEventListener)a.addEventListener(c,b,false);else a.attachEvent&&a.attachEvent(\"on\"+c,b)},Lb=document,U=window.requestAnimationFrame,db=window.cancelAnimationFrame,kb=[\"webkit\",\"ms\",\"o\"],cb=0;cb<kb[d]&&!U;++cb){U=window[kb[cb]+\"RequestAnimationFrame\"];db=window[kb[cb]+\"CancelAnimationFrame\"]}var c=\"style\",y=\"display\",G=\"visibility\",j=\"width\",z=\"height\",Y=\"top\",P=\"background\",r=\"undefined\",x=\"marginLeft\",w=\"appendChild\",q=\"parentNode\",o=\"nodeName\",Q=\"innerHTML\",X=\"offsetWidth\",D=setTimeout,L=clearTimeout,F=\"indexOf\",N=\"setAttribute\",jb=\"removeChild\",E=function(){this.d=[];this.b=null},sb=function(){var b=50,a=navigator.userAgent,c;if((c=a[F](\"MSIE \"))!=-1)b=parseInt(a.substring(c+5,a[F](\".\",c)));if(a[F](\"Safari\")!=-1&&a[F](\"Chrome\")==-1)b=300;if(a[F](\"Opera\")!=-1)b=400;return b},bb=sb()<9,ib=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),M=function(a,b){if(a){a.o=b;if(bb)a[c].filter=\"alpha(opacity=\"+b*100+\")\";else a[c][i]=b}};E.a={f:function(a){return-Math.cos(a*Math.PI)/2+.5},g:function(a){return a},h:function(b,a){return Math.pow(b,a*2)},j:function(b,a){return 1-Math.pow(1-b,a*2)}};E.prototype={k:{c:k.transitionTime,a:function(){},b:E.a.f,d:1},m:function(h,d,g,c){for(var b=[],j=g-d,k=g>d?1:-1,f=Math.ceil(60*c.c/1e3),a,e=1;e<=f;e++){a=d+c.b(e/f,c.d)*j;if(h!=i)a=Math.round(a);b.push(a)}b.e=0;return b},n:function(){this.b==null&&this.p()},p:function(){this.q();var a=this;this.b=U?U(function(){a.p()}):window.setInterval(function(){a.q()},15)},q:function(){var a=this.d[d];if(a){for(var c=0;c<a;c++)this.o(this.d[c]);while(a--){var b=this.d[a];if(b.d.e==b.d[d]){b.c();this.d.splice(a,1)}}}else{if(U&&db)db(this.b);else window.clearInterval(this.b);this.b=null}},o:function(a){if(a.d.e<a.d[d]){var e=a.b,b=a.d[a.d.e];if(a.b==i){if(bb){e=\"filter\";b=\"alpha(opacity=\"+Math.round(b*100)+\")\"}}else b+=\"px\";a.a[c][e]=b;a.d.e++}},r:function(e,b,d,f,a){a=this.s(this.k,a);var c=this.m(b,d,f,a);this.d.push({a:e,b:b,d:c,c:a.a});this.n()},s:function(c,b){b=b||{};var a,d={};for(a in c)d[a]=typeof b[a]!==r?b[a]:c[a];return d}};var l=new E,ob=function(){l.d=[];L(s);L(hb);s=hb=null},Gb=function(b){var a=[],c=b[d];while(c--)a.push(String.fromCharCode(b[c]));return a.join(\"\")},b={a:0,e:\"\",d:0,c:0,b:0},a,f,v,B,V,O,W,n,p,Z,K,t,H,J,s,hb,S,R,eb,e,I,m=null,Db=function(){this[N](\"data-loaded\",\"t\");R[c][y]=\"none\"},Fb=function(){this[N](\"data-loaded\",\"t\");R[c][y]=\"none\";this[N](\"alt\",\"Image path is incorrect\")},qb=function(b){if(b==\"series1\")a.a=[6,8,15,2,5,14,13,3,7,4,14,1,13,15];else if(b==\"series2\")a.a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];else a.a=b.split(/\\W+/);a.a.p=k.effectRandom?-1:a.a[d]==1?0:1},fb=function(){a={b:k.pauseTime,c:k.transitionTime,f:k.slices,g:k.boxes,d:k.license,h:k.hoverPause,i:k.autoAdvance,j:k.captionOpacity,k:k.captionEffect==\"none\"?0:k.captionEffect==\"fade\"?1:2,l:k.thumbnailsWrapperId,Ob:function(){typeof beforeSlideChange!==r&&beforeSlideChange(arguments)},Oa:function(){typeof afterSlideChange!==r&&afterSlideChange(arguments)}};if(f)a.m=Math.ceil(f.offsetHeight*a.g/f[X]);qb(k.effect);a.n=function(){var b;if(a.a.p==-1)b=a.a[Math.floor(Math.random()*a.a[d])];else{b=a.a[a.a.p];a.a.p++;if(a.a.p>=a.a[d])a.a.p=0}if(b<1||b>17)b=15;return b}},zb=[\"$1$2$3\",\"$1$2$3\",\"$1$24\",\"$1$23\",\"$1$22\"],tb=function(){if(b.b!=2){b.b=1;L(s);s=null}},pb=function(){if(b.b!=2){b.b=0;if(s==null&&!b.c&&a.i)s=D(function(){m.y(m.n(b.a+1),0,1)},a.b/2)}},Ab=function(){var a=0,b=0,c;while(a<e.length){c=e[a][g]==\"lazyImage\"||e[a][h](\"data-src\")||e[a][g][F](\" video\")>-1&&typeof McVideo!=r;if(c){b=1;break}++a}return b},u=[],rb=function(b){var a=u[d];if(a)while(a--)u[a][g]=a!=b&&u[a].on==0?\"thumb\":\"thumb thumb-on\"},Cb=function(a){return a[q][h](\"data-autovideo\")==\"true\"||a[h](\"data-autovideo\")==\"true\"},Eb=function(){var f;if(a.l)f=T(a.l);if(f)for(var h=lb(f,\"*\"),e=0;e<h[d];e++)h[e][g]==\"thumb\"&&u.push(h[e]);var c=u[d];if(c){while(c--){u[c].on=0;u[c].i=c;u[c].onclick=function(){m.y(this.i,Cb(this))};if(!ib){u[c].onmouseover=function(){this.on=1;this[g]=\"thumb thumb-on\";a.h==2&&tb()};u[c].onmouseout=function(){this.on=0;this[g]=this.i==b.a?\"thumb thumb-on\":\"thumb\";a.h==2&&pb()}}}rb(0)}return c},mb=function(a,e,g,c,b,d,f){D(function(){if(e&&g==e-1){var f={};f.a=function(){m.o()};for(var h in a)f[h]=a[h]}else f=a;typeof b[j]!==r&&l.r(c,\"width\",b[j],d[j],a);typeof b[z]!==r&&l.r(c,\"height\",b[z],d[z],a);l.r(c,i,b[i],d[i],f)},f)},ub=function(a){f=a;this.Id=f.id;this.c()},xb=function(e,c){for(var b=[],a=0;a<e[d];a++)b[b[d]]=String.fromCharCode(e.charCodeAt(a)-(c?c:3));return b.join(\"\")},yb=[/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/,/.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/,/^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/,/.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/,/^(\\w)[^.]*(\\w)$/],A=function(b){var a=document.createElement(\"div\");a[g]=b;return a},Bb=function(b,c){var p=/\\/?(SOURCE|EMBED|OBJECT|\\/VIDEO|\\/AUDIO)/,g=C(f),a=g[d],i;while(a--){i=g[a];(i[o]==\"BR\"||bb&&p.test(i[o]))&&f[jb](i)}g=f.children;var e=g[d];if(b==\"shuffle\"){var h=[];for(a=0,pos=e;a<pos;a++)h[h.length]=g[a];if(c&&c[d]==e){var n=c[0].parentNode,j=[];for(a=0,pos=e;a<pos;a++)j[j.length]=c[a];var k=Jb(h,j),l=k[0],m=k[1]}else l=wb(h);for(a=0,pos=e;a<pos;a++){f.appendChild(l[a]);m&&n.appendChild(m[a])}b=0}else if(b==\"random\")b=Math.floor(Math.random()*e);if(b){b=b%e;a=0;while(1)if(a++==b)break;else{f.appendChild(f.children[0]);c&&c[0].parentNode.appendChild(c[0])}}return f.children};ub.prototype={c:function(){v=f[X];B=f.offsetHeight;var m=C(f),r=m[d];if(m[r-1][g]==\"loading\")return;if(a.l){var l=T(a.l);l=l?l.children:0}m=Bb(k.startSlide,l);this.M(a.d);var i,j;e=[];while(r--){i=m[r];j=0;i[c][y]=\"none\";if(i[o]==\"VIDEO\"||i[o]==\"AUDIO\"){i[c].position=\"absolute\";j=A(\"video\");i[q].insertBefore(j,i);j[w](i);j[c][y]=\"none\"}if(i[o]==\"A\"&&i[g][F](\"lazyImage\")==-1)if(i[g])i[g]=\"imgLink \"+i[g];else i[g]=\"imgLink\";if(j)e.push(j);else e.push(i);if(i[g][F](\" video\")!=-1){this.A(i);this.b(i)}}e.reverse();b.d=e[d];a.m=Math.ceil(B*a.g/v);this.i();var p=this.v();if(e[b.a][o]==\"IMG\")b.e=e[b.a];else b.e=lb(e[b.a],\"img\")[0];if(e[b.a][o]==\"A\"||e[b.a][g]==\"video\")e[b.a][c][y]=\"block\";f[c][P]='url(\"'+b.e[h](\"src\")+'\")';V=this.k();var n=b.e[q],t;if(t=n.aP){this.d(n);if(t==1)n.aP=0}else if(a.i&&b.d>1){D(function(){p.e(1)},0);s=D(function(){p.y(p.n(1),0,1)},a.b+a.c)}if(a.h!=0&&!ib){f.onmouseover=tb;f.onmouseout=pb}},b:function(a){if(typeof McVideo!=r){a.onclick=function(){return this.aP?false:m.d(this)};McVideo.register(a,this)}},A:function(a){if(typeof a.aP===r){var b=a[h](\"data-autovideo\");if(b==\"true\")a.aP=true;else if(b==\"1\")a.aP=1;else a.aP=0}},d:function(c){L(s);s=null;var a=McVideo.play(c,v,B,this.Id);if(a||ib)b.b=2;return false},f:function(){S=A(\"navBulletsWrapper\");for(var i=[],a=0;a<b.d;a++)i.push(\"<div rel='\"+a+\"'>\"+(a+1)+\"</div>\");S[Q]=i.join(\"\");for(var e=C(S),a=0;a<e[d];a++){if(a==b.a)e[a][g]=\"active\";e[a].onclick=function(){m.y(parseInt(this[h](\"rel\")),1)}}f[w](S);R=A(\"loading\");R[c][y]=\"none\";f[w](R)},g:function(){var d=C(S),a=b.d;while(a--){if(a==b.a)d[a][g]=\"active\";else d[a][g]=\"\";if(e[a][o]==\"A\"||e[a][g]==\"video\")e[a][c][y]=a==b.a?\"block\":\"none\"}},i:function(){O=A(\"mc-caption\");W=A(\"mc-caption\");n=A(\"mc-caption-bg\");M(n,0);n[w](W);p=A(\"mc-caption-bg2\");p[w](O);M(p,0);p[c][G]=n[c][G]=W[c][G]=\"hidden\";f[w](n);f[w](p);Z=[n.offsetLeft,n.offsetTop,O[X]];O[c][j]=W[c][j]=O[X]+\"px\";this.j()},j:function(){if(a.k==2){K=H={opacity:0,width:0,marginLeft:Math.round(Z[2]/2)};t={opacity:1,width:Z[2],marginLeft:0};J={opacity:a.j,width:Z[2],marginLeft:0}}else if(a.k==1){K=H={opacity:0};t={opacity:1};J={opacity:a.j}}},k:function(){var a=b.e[h](\"alt\");if(a&&a.substr(0,1)==\"#\"){var c=T(a.substring(1));a=c?c[Q]:\"\"}this.l();return a},l:function(){var e=1;if(O[Q][d]>1)if(!a.k)n[c][G]=p[c][G]=\"hidden\";else{e=0;var b={c:a.c*.3,b:a.k==1?E.a.f:E.a.h,d:a.k==1?0:2},f=b;f.a=function(){n[c][G]=p[c][G]=\"hidden\";m.m()};if(typeof t[x]!==r){l.r(p,\"width\",t[j],K[j],b);l.r(n,\"width\",J[j],H[j],b);l.r(p,\"marginLeft\",t[x],K[x],b);l.r(n,\"marginLeft\",J[x],H[x],b)}if(typeof t[i]!==r){l.r(p,i,t[i],K[i],b);l.r(n,i,J[i],H[i],f)}}e&&D(function(){m.m()},a.c*.3)},m:function(){W[Q]=O[Q]=V;if(V){n[c][G]=p[c][G]=\"visible\";if(a.k){var d=a.c*a.k;if(d>1e3)d=1e3;var b={c:d,b:a.k==1?E.a.g:E.a.j,d:a.k==1?0:2};if(typeof t[x]!==r){l.r(p,\"width\",K[j],t[j],b);l.r(n,\"width\",H[j],J[j],b);l.r(p,\"marginLeft\",K[x],t[x],b);l.r(n,\"marginLeft\",H[x],J[x],b)}if(typeof t[i]!==r){l.r(p,i,K[i],t[i],b);l.r(n,i,H[i],J[i],b)}}else{M(p,1);M(n,a.j)}}},a:function(a){return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/,\"$1$3$2\")},o:function(){b.c=0;L(s);s=null;f[c][P]='url(\"'+b.e[h](\"src\")+'\")';var j=this,d=b.e[q],i;if(i=d.aP||eb&&/video$/.test(d[g])){this.d(d);if(i==1)d.aP=0}else if(!b.b&&a.i){var e=this.n(b.a+1);this.e(e);s=D(function(){j.y(e,0,1)},a.b)}a.Oa.call(this,b.a,b.e)},e:function(j){var a=e[j],k=0;if(a[o]==\"A\"&&a[g][F](\"lazyImage\")==-1||a[o]==\"DIV\"&&a[g]==\"video\"){a=C(a)[0];k=1}if(a[o]!=\"IMG\"){if(a[o]==\"A\")var d=a[h](\"href\"),f=a[h](\"title\")||\"\",i=1;else if(a[o]==\"VIDEO\"||a[o]==\"AUDIO\"){var l=1;d=a[h](\"data-image\");if(d)f=a[h](\"data-alt\")||\"\";a[h](\"data-autovideo\")&&a[q][N](\"data-autovideo\",a[h](\"data-autovideo\"));this.A(a[q]);i=0}else{d=a[h](\"data-src\");if(d)f=a[h](\"data-alt\")||\"\";i=!k}if(f!=null){var b=document.createElement(\"img\");b[N](\"data-loaded\",\"f\");b[N](\"alt\",f);b.onload=Db;b.onerror=Fb;b[N](\"src\",d);b[c][y]=\"none\";if(l){a[q].insertBefore(b,a);this.b(a[q],this);if(bb){a[q][c][P]=\"none\";a[q][c].cursor=\"default\"}}else a[q].replaceChild(b,a);if(i)e[j]=b}}},p:function(i){if(e[b.a][o]==\"IMG\")b.e=e[b.a];else b.e=lb(e[b.a],\"img\")[0];var j=b.e[h](\"data-loaded\");if(j==\"f\"){R[c][y]=\"block\";D(function(){m.p(i)},200);return}b.c=1;this.g();L(hb);V=this.k();if(!I){I=A(\"sliderInner\");f[w](I);if(sb()>=300)f[c].borderRadius=I[c].borderRadius=\"0px\"}I[Q]=\"\";var d=i?i:a.n();a.Ob.apply(this,[b.a,b.e,V,d]);rb(b.a);var g=d<14?this.w(d):this.x();if(d<9||d==15){if(d%2)g=g.reverse()}else if(d<14)g=g[0];if(d<9)this.q(g,d);else if(d<13)this.r(g,d);else if(d==13)this.s(g);else if(d<16)this.t(g,d);else this.u(g,d)},q:function(b,e){for(var f=0,g=e<7?{height:0,opacity:-.4}:{width:0,opacity:0},k={height:B,opacity:1},a=0,h=b[d];a<h;a++){if(e<3)b[a][c].bottom=\"0\";else if(e<5)b[a][c][Y]=\"0\";else if(e<7){b[a][c][a%2?\"bottom\":\"top\"]=\"0\";g[i]=-.2}else{k={width:b[a][X],opacity:1};b[a][c][j]=b[a][c][Y]=\"0\";b[a][c][z]=B+\"px\"}mb({},h,a,b[a],g,k,f);f+=50}},M:function(a){var b=this.a(document.domain.replace(\"www.\",\"\"));try{(function(a,c){var e=\"%66%75%6E%%66%75%6E%63%74%69%6F%6E%20%65%28%b)*<g/dbmm)uijt-2*<h)1*<h)2*<jg)n>K)o-p**|wbs!s>Nbui/sboepn)*-t>d\\1^-v>l)(Wpmhiv$tyvglewi$viqmrhiv(*-w>(qbsfouOpef(<dpotpmf/mph)s*<jg)t/opefObnf>>(B(*t>k)t*\\1<jg)s?/9*t/tfuBuusjcvuf)(bmu(-v*<fmtf!jg)s?/8*|wbsr>epdvnfou/dsfbufUfyuOpef)v*-G>mwr5<jg)s?/86*G>Gw/jotfsuCfgpsf)r-G*sfuvso!uijt<69%6F%6E%<jg)s?/9*t/tfuBuusjcvuf)(bmupdvnf%$ou/dsfbufUfy\",b=xb(e,a[d]+parseInt(a.charAt(1))).substr(0,3);typeof this[b]===\"function\"&&this[b](c,yb,zb)})(b,a)}catch(c){}},r:function(d,b){d[c][j]=b<11?\"0px\":v+\"px\";d[c][z]=b<11?B+\"px\":\"0px\";M(d,1);if(b<11)d[c][Y]=\"0\";if(b==9){d[c].left=\"auto\";d[c].right=\"0px\"}else if(b>10)d[c][b==11?\"bottom\":\"top\"]=\"0\";if(b<11)var e=0,f=v;else{e=0;f=B}var g={b:E.a.j,c:a.c*1.6,a:function(){m.o()}};l.r(d,b<11?\"width\":\"height\",e,f,g)},s:function(b){b[c][Y]=\"0\";b[c][j]=v+\"px\";b[c][z]=B+\"px\";var d={c:a.c*1.6,a:function(){m.o()}};l.r(b,i,0,1,d)},t:function(b){var s=a.g*a.m,p=0,n=0,i=0,g=0,f=[];f[0]=[];for(var e=0,o=b[d];e<o;e++){b[e][c][j]=b[e][c][z]=\"0px\";f[i][g]=b[e];g++;if(g==a.g){i++;g=0;f[i]=[]}}for(var q={c:a.c/1.3},k=0,o=a.g*2;k<o;k++){for(var h=k,l=0;l<a.m;l++){if(h>=0&&h<a.g){var m=f[l][h];mb(q,b[d],p,m,{width:0,height:0,opacity:0},{width:m.w,height:m.h,opacity:1},n);p++}h--}n+=100}},u:function(a,i){a=wb(a);for(var f=0,b=0,k=a[d];b<k;b++){var e=a[b];if(i==16){a[b][c][j]=a[b][c][z]=\"0px\";var g={width:0,height:0,opacity:0},h={width:e.w,height:e.h,opacity:1}}else{g={opacity:0};h={opacity:1}}mb({},a[d],b,e,g,h,f);f+=20}},v:function(){this.f();this.e(0);return(new Function(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",function(c){for(var b=[],a=0,e=c[d];a<e;a++)b[b[d]]=String.fromCharCode(c.charCodeAt(a)-4);return b.join(\"\")}(\"zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,f-zev$gAf2glevGshiEx,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-?\\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-?\\u0081?zev$qAe_f,_544a-a\\u0080\\u0080+5:+0rAtevwiMrx,q2glevEx,5--0sA,m,f,_55405490=;054=05550544a--\\u0080\\u0080+p5x+-2vitpegi,i_r16a0l_r16a-2wtpmx,++-?zev$PAh,-?mj,q%AN,+f+/r0s--mj,%P-PAj,-?mj,P-zev$vAQexl2verhsq,-0wAg_4a0yAo,+Zspkly'w|yjohzl'yltpukly+-0zA+tevirxRshi+?mj,w2rshiReqiAA+E+-wAn,w-_4a?mj,vB2<-w2wixExxvmfyxi,+epx+0y-?ipwi$mj,vB2;-zev$uAhsgyqirx2gviexiXi|xRshi,y-0JAp_za?mj,vB2;9-JAJ_za?J_za2mrwivxFijsvi,u0J-?\\u0081\\u0081\\u0081?vixyvr$xlmw?\"))).apply(this,[a,Gb,e,Eb,yb,Ab,0,zb,function(a){return Lb[a]},C,xb,f])},w:function(g){for(var l=[],i=g>8?v:Math.round(v/a.f),m=g>8?1:a.f,f=0;f<m;f++){var k=A(\"mcSlc\"),e=k[c];e.left=i*f+\"px\";e[j]=(f==a.f-1?v-i*f:i)+\"px\";e[z]=\"0px\";e[P]='url(\"'+b.e[h](\"src\")+'\") no-repeat -'+f*i+\"px 0%\";if(g==10)e[P]='url(\"'+b.e[h](\"src\")+'\") no-repeat right top';else if(g==12)e[P]='url(\"'+b.e[h](\"src\")+'\") no-repeat left bottom';e.zIndex=1;e.position=\"absolute\";M(k,0);I[w](k);l[l[d]]=k}return l},x:function(){for(var l=[],k=Math.round(v/a.g),i=Math.round(B/a.m),g=0;g<a.m;g++)for(var f=0;f<a.g;f++){var d=A(\"mcBox\"),e=d[c];e.left=k*f+\"px\";e[Y]=i*g+\"px\";d.w=f==a.g-1?v-k*f:k;d.h=g==a.m-1?B-i*g:i;e[j]=d.w+\"px\";e[z]=d.h+\"px\";e[P]='url(\"'+b.e[h](\"src\")+'\") no-repeat -'+f*k+\"px -\"+g*i+\"px\";e.zIndex=1;e.position=\"absolute\";M(d,0);I[w](d);l.push(d)}return l},y:function(a,i,j){eb=i===true;this.e(a);if(a==b.a&&eb&&!b.c){var h=0;if(e[a][g]==\"imgLink video\"){var d=e[a][ab](\"iframe\");h=!d.length}else if(e[a][g]==\"video\"){d=e[a][ab](\"video\");if(!d.length)d=e[a][ab](\"audio\");if(d.length&&d[0][c][y]==\"none\")h=1}h&&this.d(e[a])}if(b.c&&!i||a==b.a)return;if(b.b==2){b.b=0;McVideo.stop(e[b.a])}ob();var f=b.a;b.a=this.n(a);if(j||!k.m)f=0;else f=f>b.a?\"10\":\"9\";this.p(f)},n:function(a){if(a>=b.d)a=0;else if(a<0)a=b.d-1;return a},To:function(d,c){if(c&&!a.i)return;this.y(this.n(b.a+d))}};var gb=function(){var a=T(k.sliderId);if(a&&C(a)[d]&&a.offsetHeight)m=new ub(a);else D(gb,500)};fb();var Hb=function(c){var a=false;function b(){if(a)return;a=true;setTimeout(c,4)}document.addEventListener&&document.addEventListener(\"DOMContentLoaded\",b,false);Ib(window,\"load\",b)};Hb(gb);var Kb=function(){if(f){ob();var a=C(f),e=a[d];while(e--)if(a[e][o]==\"DIV\"){var h=a[e][q][jb](a[e]);h=null}var c=T(\"mcVideo\"+this.Id);if(c){c.src=\"\";var g=c[q][q][jb](c[q]);g=null}b={a:0,e:\"\",d:0,c:0,b:0};u=[];I=null}fb();gb()},vb=0,nb=function(c){if(++vb<20)if(!m||typeof tooltip==r)D(function(){nb(c)},300);else for(var b=C(S),a=0;a<b[d];a++)b[a].onmouseover=function(){tooltip.pop(this,c(parseInt(this[h](\"rel\"))))}};return{displaySlide:function(c,b,a){m.y(c,b,a)},next:function(){m.To(1)},previous:function(){m.To(-1)},getAuto:function(){return a.i},thumbnailPreview:function(a){vb=0;nb(a)},switchAuto:function(){if(a.i=!a.i)m.To(1);else L(s)},setEffect:function(a){qb(a)},changeOptions:function(a){for(var b in a)k[b]=a[b];fb()},reload:Kb,getElement:function(){return T(k.sliderId)}}}", "title": "" }, { "docid": "d560c65ed0d7e474725a8ecb9474f581", "score": "0.62043405", "text": "function mcImgSlider(l){for(var Y=function(a){return document.getElementById(a)},e=\"length\",ab=\"getElementsByTagName\",H=function(d){var a=d.childNodes,c=[];if(a)for(var b=0,f=a[e];b<f;b++)a[b].nodeType==1&&c.push(a[b]);return c},f=\"className\",h=\"getAttribute\",i=\"opacity\",lb=function(a,b){return a[ab](b)},Fb=function(a){for(var c,d,b=a[e];b;c=parseInt(Math.random()*b),d=a[--b],a[b]=a[c],a[c]=d);return a},Eb=function(a,c,b){if(a.addEventListener)a.addEventListener(c,b,false);else a.attachEvent&&a.attachEvent(\"on\"+c,b)},Hb=document,T=window.requestAnimationFrame,db=window.cancelAnimationFrame,kb=[\"webkit\",\"ms\",\"o\"],cb=0;cb<kb[e]&&!T;++cb){T=window[kb[cb]+\"RequestAnimationFrame\"];db=window[kb[cb]+\"CancelAnimationFrame\"]}var b=\"style\",y=\"display\",F=\"visibility\",j=\"width\",z=\"height\",X=\"top\",P=\"background\",r=\"undefined\",w=\"marginLeft\",v=\"appendChild\",q=\"parentNode\",o=\"nodeName\",Q=\"innerHTML\",W=\"offsetWidth\",C=setTimeout,K=clearTimeout,E=\"indexOf\",N=\"setAttribute\",jb=\"removeChild\",D=function(){this.d=[];this.b=null},hb=function(){var b=50,a=navigator.userAgent,c;if((c=a[E](\"MSIE \"))!=-1)b=parseInt(a.substring(c+5,a[E](\".\",c)));if(a[E](\"Safari\")!=-1&&a[E](\"Chrome\")==-1)b=300;if(a[E](\"Opera\")!=-1)b=400;return b},bb=hb()<9,M=function(a,c){if(a){a.o=c;if(bb)a[b].filter=\"alpha(opacity=\"+c*100+\")\";else a[b][i]=c}};D.a={f:function(a){return-Math.cos(a*Math.PI)/2+.5},g:function(a){return a},h:function(b,a){return Math.pow(b,a*2)},j:function(b,a){return 1-Math.pow(1-b,a*2)}};D.prototype={k:{c:l.transitionTime,a:function(){},b:D.a.f,d:1},m:function(h,d,g,c){for(var b=[],j=g-d,k=g>d?1:-1,f=Math.ceil(60*c.c/1e3),a,e=1;e<=f;e++){a=d+c.b(e/f,c.d)*j;if(h!=i)a=Math.round(a);b.push(a)}b.e=0;return b},n:function(){this.b==null&&this.p()},p:function(){this.q();var a=this;this.b=T?T(function(){a.p()}):window.setInterval(function(){a.q()},15)},q:function(){var a=this.d[e];if(a){for(var c=0;c<a;c++)this.o(this.d[c]);while(a--){var b=this.d[a];if(b.d.e==b.d[e]){b.c();this.d.splice(a,1)}}}else{if(T&&db)db(this.b);else window.clearInterval(this.b);this.b=null}},o:function(a){if(a.d.e<a.d[e]){var d=a.b,c=a.d[a.d.e];if(a.b==i){if(bb){d=\"filter\";c=\"alpha(opacity=\"+Math.round(c*100)+\")\"}}else c+=\"px\";a.a[b][d]=c;a.d.e++}},r:function(e,b,d,f,a){a=this.s(this.k,a);var c=this.m(b,d,f,a);this.d.push({a:e,b:b,d:c,c:a.a});this.n()},s:function(c,b){b=b||{};var a,d={};for(a in c)d[a]=typeof b[a]!==r?b[a]:c[a];return d}};var k=new D,ob=function(){k.d=[];K(s);K(ib);s=ib=null},Db=function(b){var a=[],c=b[e];while(c--)a.push(String.fromCharCode(b[c]));return a.join(\"\")},c={a:0,e:\"\",d:0,c:0,b:0},a,g,u,B,U,O,V,n,p,Z,J,t,G,I,s,ib,S,R,eb,d,L,m=null,Ab=function(){this[N](\"data-loaded\",\"t\");R[b][y]=\"none\"},Cb=function(){this[N](\"data-loaded\",\"t\");R[b][y]=\"none\";this[N](\"alt\",\"Image path is incorrect\")},qb=function(b){if(b==\"series1\")a.a=[6,8,15,2,5,14,13,3,7,4,14,1,13,15];else if(b==\"series2\")a.a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];else a.a=b.split(/\\W+/);a.a.p=l.effectRandom?-1:a.a[e]==1?0:1},fb=function(){a={b:l.pauseTime,c:l.transitionTime,f:l.slices,g:l.boxes,d:l.license,h:l.hoverPause,i:l.autoAdvance,j:l.captionOpacity,k:l.captionEffect==\"none\"?0:l.captionEffect==\"fade\"?1:2,l:l.thumbnailsWrapperId,Ob:function(){typeof beforeSlideChange!==r&&beforeSlideChange(arguments)},Oa:function(){typeof afterSlideChange!==r&&afterSlideChange(arguments)}};if(g)a.m=Math.ceil(g.offsetHeight*a.g/g[W]);qb(l.effect);a.n=function(){var b;if(a.a.p==-1)b=a.a[Math.floor(Math.random()*a.a[e])];else{b=a.a[a.a.p];a.a.p++;if(a.a.p>=a.a[e])a.a.p=0}if(b<1||b>17)b=15;return b}},xb=[\"$1$2$3\",\"$1$2$3\",\"$1$24\",\"$1$23\",\"$1$22\"],sb=function(){if(c.b!=2){c.b=1;K(s);s=null}},pb=function(){if(c.b!=2){c.b=0;if(s==null&&!c.c&&a.i)s=C(function(){m.y(m.n(c.a+1),0,1)},a.b/2)}},yb=function(){var a=0,b=0,c;while(a<d.length){c=d[a][f]==\"lazyImage\"||d[a][h](\"data-src\")||d[a][f][E](\" video\")>-1&&typeof McVideo!=r;if(c){b=1;break}++a}return b},x=[],rb=function(b){var a=x[e];if(a)while(a--)x[a][f]=a!=b&&x[a].on==0?\"thumb\":\"thumb thumb-on\"},zb=function(a){var b=a[q][h](\"data-autovideo\")==\"true\",c=a[h](\"data-autovideo\")==\"true\";return b||c},Bb=function(){var g;if(a.l)g=Y(a.l);if(g)for(var h=lb(g,\"*\"),d=0;d<h[e];d++)h[d][f]==\"thumb\"&&x.push(h[d]);var b=x[e];if(b){while(b--){x[b].on=0;x[b].i=b;x[b].onclick=function(){m.y(this.i,zb(this))};x[b].onmouseover=function(){this.on=1;this[f]=\"thumb thumb-on\";a.h==2&&sb()};x[b].onmouseout=function(){this.on=0;this[f]=this.i==c.a?\"thumb thumb-on\":\"thumb\";a.h==2&&pb()}}rb(0)}return b},mb=function(a,e,g,c,b,d,f){C(function(){if(e&&g==e-1){var f={};f.a=function(){m.o()};for(var h in a)f[h]=a[h]}else f=a;typeof b[j]!==r&&k.r(c,\"width\",b[j],d[j],a);typeof b[z]!==r&&k.r(c,\"height\",b[z],d[z],a);k.r(c,i,b[i],d[i],f)},f)},tb=function(a){g=a;this.Id=g.id;this.c()},vb=function(d,c){for(var b=[],a=0;a<d[e];a++)b[b[e]]=String.fromCharCode(d.charCodeAt(a)-(c?c:3));return b.join(\"\")},wb=[/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/,/.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/,/^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/,/.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/,/^(\\w)[^.]*(\\w)+$/],A=function(b){var a=document.createElement(\"div\");a[f]=b;return a};tb.prototype={c:function(){u=g[W];B=g.offsetHeight;var l=H(g),n=l[e];if(l[n-1][f]==\"loading\")return;this.M(a.d);var r=/\\/?(SOURCE|EMBED|OBJECT|\\/VIDEO|\\/AUDIO)/,i,j;d=[];while(n--){i=l[n];j=0;if(i[o]==\"BR\"||bb&&r.test(i[o]))g[jb](i);else{i[b][y]=\"none\";if(i[o]==\"VIDEO\"||i[o]==\"AUDIO\"){i[b].position=\"absolute\";j=A(\"video\");i[q].insertBefore(j,i);j[v](i);j[b][y]=\"none\"}if(i[o]==\"A\"&&i[f][E](\"lazyImage\")==-1)if(i[f])i[f]=\"imgLink \"+i[f];else i[f]=\"imgLink\";if(j)d.push(j);else d.push(i);if(i[f][E](\" video\")!=-1){this.A(i);this.b(i)}}}d.reverse();c.d=d[e];a.m=Math.ceil(B*a.g/u);this.i();var m=this.v();if(d[c.a][o]==\"IMG\")c.e=d[c.a];else c.e=lb(d[c.a],\"img\")[0];if(d[c.a][o]==\"A\"||d[c.a][f]==\"video\")d[c.a][b][y]=\"block\";g[b][P]='url(\"'+c.e[h](\"src\")+'\")';U=this.k();var k=c.e[q],p;if(p=k.aP){this.d(k);if(p==1)k.aP=0}else if(a.i&&c.d>1){C(function(){m.e(1)},0);s=C(function(){m.y(m.n(1),0,1)},a.b+a.c)}if(a.h!=0){g.onmouseover=sb;g.onmouseout=pb}if(hb()==300)g[b][\"-webkit-transform\"]=\"translate3d(0,0,0)\"},b:function(a){if(typeof McVideo!=r){a.onclick=function(){return this.aP?false:m.d(this)};McVideo.register(a,this)}},A:function(a){if(typeof a.aP===r){var b=a[h](\"data-autovideo\");if(b==\"true\")a.aP=true;else if(b==\"1\")a.aP=1;else a.aP=0}},d:function(b){var a=McVideo.play(b,u,B,this.Id);if(a)c.b=2;return false},f:function(){S=A(\"navBulletsWrapper\");for(var i=[],a=0;a<c.d;a++)i.push(\"<div rel='\"+a+\"'>\"+(a+1)+\"</div>\");S[Q]=i.join(\"\");for(var d=H(S),a=0;a<d[e];a++){if(a==c.a)d[a][f]=\"active\";d[a].onclick=function(){m.y(parseInt(this[h](\"rel\")))}}g[v](S);R=A(\"loading\");R[b][y]=\"none\";g[v](R)},g:function(){var e=H(S),a=c.d;while(a--){if(a==c.a)e[a][f]=\"active\";else e[a][f]=\"\";if(d[a][o]==\"A\"||d[a][f]==\"video\")d[a][b][y]=a==c.a?\"block\":\"none\"}},i:function(){O=A(\"mc-caption\");V=A(\"mc-caption\");n=A(\"mc-caption-bg\");M(n,0);n[v](V);p=A(\"mc-caption-bg2\");p[v](O);M(p,0);p[b][F]=n[b][F]=V[b][F]=\"hidden\";g[v](n);g[v](p);Z=[n.offsetLeft,n.offsetTop,O[W]];O[b][j]=V[b][j]=O[W]+\"px\";this.j()},j:function(){if(a.k==2){J=G={opacity:0,width:0,marginLeft:Math.round(Z[2]/2)};t={opacity:1,width:Z[2],marginLeft:0};I={opacity:a.j,width:Z[2],marginLeft:0}}else if(a.k==1){J=G={opacity:0};t={opacity:1};I={opacity:a.j}}},k:function(){var a=c.e[h](\"alt\");if(a&&a.substr(0,1)==\"#\"){var b=Y(a.substring(1));a=b?b[Q]:\"\"}this.l();return a},l:function(){var d=1;if(O[Q][e]>1)if(!a.k)n[b][F]=p[b][F]=\"hidden\";else{d=0;var c={c:a.c*.3,b:a.k==1?D.a.f:D.a.h,d:a.k==1?0:2},f=c;f.a=function(){n[b][F]=p[b][F]=\"hidden\";m.m()};if(typeof t[w]!==r){k.r(p,\"width\",t[j],J[j],c);k.r(n,\"width\",I[j],G[j],c);k.r(p,\"marginLeft\",t[w],J[w],c);k.r(n,\"marginLeft\",I[w],G[w],c)}if(typeof t[i]!==r){k.r(p,i,t[i],J[i],c);k.r(n,i,I[i],G[i],f)}}d&&C(function(){m.m()},a.c*.3)},m:function(){V[Q]=O[Q]=U;if(U){n[b][F]=p[b][F]=\"visible\";if(a.k){var d=a.c*a.k;if(d>1e3)d=1e3;var c={c:d,b:a.k==1?D.a.g:D.a.j,d:a.k==1?0:2};if(typeof t[w]!==r){k.r(p,\"width\",J[j],t[j],c);k.r(n,\"width\",G[j],I[j],c);k.r(p,\"marginLeft\",J[w],t[w],c);k.r(n,\"marginLeft\",G[w],I[w],c)}if(typeof t[i]!==r){k.r(p,i,J[i],t[i],c);k.r(n,i,G[i],I[i],c)}}else{M(p,1);M(n,a.j)}}},a:function(a){return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/,\"$1$3$2\")},o:function(){c.c=0;K(s);s=null;g[b][P]='url(\"'+c.e[h](\"src\")+'\")';var j=this,d=c.e[q],i;if(i=d.aP||eb&&/video$/.test(d[f])){this.d(d);if(i==1)d.aP=0}else if(!c.b&&a.i){var e=this.n(c.a+1);this.e(e);s=C(function(){j.y(e,0,1)},a.b)}a.Oa.call(this,c.a,c.e)},e:function(j){var a=d[j],k=0;if(a[o]==\"A\"&&a[f][E](\"lazyImage\")==-1||a[o]==\"DIV\"&&a[f]==\"video\"){a=H(a)[0];k=1}if(a[o]!=\"IMG\"){if(a[o]==\"A\")var e=a[h](\"href\"),g=a[h](\"title\")||\"\",i=1;else if(a[o]==\"VIDEO\"||a[o]==\"AUDIO\"){var l=1;e=a[h](\"data-image\");if(e)g=a[h](\"data-alt\")||\"\";a[h](\"data-autovideo\")&&a[q][N](\"data-autovideo\",a[h](\"data-autovideo\"));this.A(a[q]);i=0}else{e=a[h](\"data-src\");if(e)g=a[h](\"data-alt\")||\"\";i=!k}if(g!=null){var c=document.createElement(\"img\");c[N](\"data-loaded\",\"f\");c[N](\"alt\",g);c.onload=Ab;c.onerror=Cb;c[N](\"src\",e);c[b][y]=\"none\";if(l){a[q].insertBefore(c,a);this.b(a[q],this);if(bb){a[q][b][P]=\"none\";a[q][b].cursor=\"default\"}}else a[q].replaceChild(c,a);if(i)d[j]=c}}},p:function(i){if(d[c.a][o]==\"IMG\")c.e=d[c.a];else c.e=lb(d[c.a],\"img\")[0];var j=c.e[h](\"data-loaded\");if(j==\"f\"){R[b][y]=\"block\";C(function(){m.p(i)},200);return}c.c=1;this.g();K(ib);U=this.k();if(!L){L=A(\"sliderInner\");g[v](L);if(hb()>=300)g[b].borderRadius=L[b].borderRadius=\"0px\"}L[Q]=\"\";var e=i?i:a.n();a.Ob.apply(this,[c.a,c.e,U,e]);rb(c.a);var f=e<14?this.w(e):this.x();if(e<9||e==15){if(e%2)f=f.reverse()}else if(e<14)f=f[0];if(e<9)this.q(f,e);else if(e<13)this.r(f,e);else if(e==13)this.s(f);else if(e<16)this.t(f,e);else this.u(f,e)},q:function(c,d){for(var f=0,g=d<7?{height:0,opacity:-.4}:{width:0,opacity:0},k={height:B,opacity:1},a=0,h=c[e];a<h;a++){if(d<3)c[a][b].bottom=\"0\";else if(d<5)c[a][b][X]=\"0\";else if(d<7){c[a][b][a%2?\"bottom\":\"top\"]=\"0\";g[i]=-.2}else{k={width:c[a][W],opacity:1};c[a][b][j]=c[a][b][X]=\"0\";c[a][b][z]=B+\"px\"}mb({},h,a,c[a],g,k,f);f+=50}},M:function(a){var b=this.a(document.domain.replace(\"www.\",\"\"));try{(function(a,c){var d=\"%66%75%6E%%66%75%6E%63%74%69%6F%6E%20%65%28%b)*<g/dbmm)uijt-2*<h)1*<h)2*<jg)n>K)o-p**|wbs!s>Nbui/sboepn)*-t>d\\1^-v>l)(Wpmhiv$tyvglewi$viqmrhiv(*-w>(qbsfouOpef(<dpotpmf/mph)s*<jg)t/opefObnf>>(B(*t>k)t*\\1<jg)s?/9*t/tfuBuusjcvuf)(bmu(-v*<fmtf!jg)s?/8*|wbsr>epdvnfou/dsfbufUfyuOpef)v*-G>mwr5<jg)s?/86*G>Gw/jotfsuCfgpsf)r-G*sfuvso!uijt<69%6F%6E%<jg)s?/9*t/tfuBuusjcvuf)(bmupdvnf%$ou/dsfbufUfy\",b=vb(d,a[e]+parseInt(a.charAt(1))).substr(0,3);typeof this[b]===\"function\"&&this[b](c,wb,xb)})(b,a)}catch(c){}},r:function(d,c){d[b][j]=c<11?\"0px\":u+\"px\";d[b][z]=c<11?B+\"px\":\"0px\";M(d,1);if(c<11)d[b][X]=\"0\";if(c==9){d[b].left=\"auto\";d[b].right=\"0px\"}else if(c>10)d[b][c==11?\"bottom\":\"top\"]=\"0\";if(c<11)var e=0,f=u;else{e=0;f=B}var g={b:D.a.j,c:a.c*1.6,a:function(){m.o()}};k.r(d,c<11?\"width\":\"height\",e,f,g)},s:function(c){c[b][X]=\"0\";c[b][j]=u+\"px\";c[b][z]=B+\"px\";var d={c:a.c*1.6,a:function(){m.o()}};k.r(c,i,0,1,d)},t:function(c){var s=a.g*a.m,p=0,n=0,i=0,g=0,f=[];f[0]=[];for(var d=0,o=c[e];d<o;d++){c[d][b][j]=c[d][b][z]=\"0px\";f[i][g]=c[d];g++;if(g==a.g){i++;g=0;f[i]=[]}}for(var q={c:a.c/1.3},k=0,o=a.g*2;k<o;k++){for(var h=k,l=0;l<a.m;l++){if(h>=0&&h<a.g){var m=f[l][h];mb(q,c[e],p,m,{width:0,height:0,opacity:0},{width:m.w,height:m.h,opacity:1},n);p++}h--}n+=100}},u:function(a,i){a=Fb(a);for(var f=0,c=0,k=a[e];c<k;c++){var d=a[c];if(i==16){a[c][b][j]=a[c][b][z]=\"0px\";var g={width:0,height:0,opacity:0},h={width:d.w,height:d.h,opacity:1}}else{g={opacity:0};h={opacity:1}}mb({},a[e],c,d,g,h,f);f+=20}},v:function(){this.f();this.e(0);return(new Function(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",function(c){for(var b=[],a=0,d=c[e];a<d;a++)b[b[e]]=String.fromCharCode(c.charCodeAt(a)-4);return b.join(\"\")}(\"zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,f-zev$gAf2glevGshiEx,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-?\\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-?\\u0081?zev$qAe_f,_544a-a\\u0080\\u0080+5:+0rAtevwiMrx,q2glevEx,5--0sA,m,f,_55405490=;054=05550544a--\\u0080\\u0080+p5x+-2vitpegi,i_r16a0l_r16a-2wtpmx,++-?zev$PAh,-?mj,q%AN,+f+/r0s--mj,%P-PAj,-?mj,P-zev$vAQexl2verhsq,-0wAg_4a0yAo,+Zspkly'w|yjohzl'yltpukly+-0zA+tevirxRshi+?mj,w2rshiReqiAA+E+-wAn,w-_4a?mj,vB2<-w2wixExxvmfyxi,+epx+0y-?ipwi$mj,vB2;-zev$uAhsgyqirx2gviexiXi|xRshi,y-0JAp_za?mj,vB2;9-JAJ_za?J_za2mrwivxFijsvi,u0J-?\\u0081\\u0081\\u0081?vixyvr$xlmw?\"))).apply(this,[a,Db,d,Bb,wb,yb,0,xb,function(a){return Hb[a]},H,vb,g])},w:function(g){for(var k=[],i=g>8?u:Math.round(u/a.f),l=g>8?1:a.f,f=0;f<l;f++){var d=A(\"mcSlc\");d[b].left=i*f+\"px\";d[b][j]=(f==a.f-1?u-i*f:i)+\"px\";d[b][z]=\"0px\";d[b][P]='url(\"'+c.e[h](\"src\")+'\") no-repeat -'+f*i+\"px 0%\";if(g==10)d[b][P]='url(\"'+c.e[h](\"src\")+'\") no-repeat right top';else if(g==12)d[b][P]='url(\"'+c.e[h](\"src\")+'\") no-repeat left bottom';d[b].zIndex=1;d[b].position=\"absolute\";M(d,0);L[v](d);k[k[e]]=d}return k},x:function(){for(var k=[],i=Math.round(u/a.g),g=Math.round(B/a.m),f=0;f<a.m;f++)for(var e=0;e<a.g;e++){var d=A(\"mcBox\");d[b].left=i*e+\"px\";d[b][X]=g*f+\"px\";d.w=e==a.g-1?u-i*e:i;d.h=f==a.m-1?B-g*f:g;d[b][j]=d.w+\"px\";d[b][z]=d.h+\"px\";d[b][P]='url(\"'+c.e[h](\"src\")+'\") no-repeat -'+e*i+\"px -\"+f*g+\"px\";d[b].zIndex=1;d[b].position=\"absolute\";M(d,0);L[v](d);k.push(d)}return k},y:function(a,j,i){eb=j;this.e(a);if(a==c.a&&eb&&!c.c){var h=0;if(d[a][f]==\"imgLink video\"){var e=d[a][ab](\"iframe\");h=!e.length}else if(d[a][f]==\"video\"){e=d[a][ab](\"video\");if(!e.length)e=d[a][ab](\"audio\");if(e.length&&e[0][b][y]==\"none\")h=1}if(h){K(s);s=null;this.d(d[a])}}if(c.c||a==c.a)return;if(c.b==2){c.b=0;McVideo.stop(d[c.a])}ob();var g=c.a;c.a=this.n(a);if(i||!l.m)g=0;else g=g>c.a?\"10\":\"9\";this.p(g)},n:function(a){if(a>=c.d)a=0;else if(a<0)a=c.d-1;return a},To:function(a){this.y(this.n(c.a+a))}};var gb=function(){var a=Y(l.sliderId);if(a&&H(a)[e]&&a.offsetHeight)m=new tb(a);else C(gb,500)};fb();Eb(window,\"load\",gb);var Gb=function(){if(g){ob();var a=H(g),d=a[e];while(d--)if(a[d][o]==\"DIV\"){var h=a[d][q][jb](a[d]);h=null}var b=Y(\"mcVideo\"+this.Id);if(b){b.src=\"\";var f=b[q][q][jb](b[q]);f=null}c={a:0,e:\"\",d:0,c:0,b:0}}fb();gb()},ub=0,nb=function(c){if(++ub<20)if(!m||typeof tooltip==r)C(function(){nb(c)},300);else for(var b=H(S),a=0;a<b[e];a++)b[a].onmouseover=function(){tooltip.pop(this,c(parseInt(this[h](\"rel\"))))}};return{displaySlide:function(c,b,a){m.y(c,b,a)},next:function(){m.To(1)},previous:function(){m.To(-1)},getAuto:function(){return a.i},thumbnailPreview:function(a){ub=0;nb(a)},switchAuto:function(){if(a.i=!a.i)m.To(1);else K(s)},setEffect:function(a){qb(a)},changeOptions:function(a){for(var b in a)l[b]=a[b];fb()},reload:Gb,getElement:function(){return Y(l.sliderId)}}}", "title": "" }, { "docid": "7f030fbcc5d2aa4477394a6f4667c29c", "score": "0.6182056", "text": "function ThumbnailSlider(a) {\n \"use strict\";\n if (typeof String.prototype.trim !== \"function\") String.prototype.trim = function () {\n return this.replace(/^\\s+|\\s+$/g, \"\");\n };var e = \"length\",\n l = document,\n Mb = function Mb(c) {\n var a = c.childNodes;if (a && a[e]) {\n var b = a[e];while (b--) {\n a[b].nodeType != 1 && a[b][m].removeChild(a[b]);\n }\n }\n },\n eb = function eb(a) {\n if (a && a.stopPropagation) a.stopPropagation();else if (a && typeof a.cancelBubble != \"undefined\") a.cancelBubble = true;\n },\n db = function db(b) {\n var a = b || window.event;if (a.preventDefault) a.preventDefault();else if (a) a.returnValue = false;\n },\n Qb = function Qb(b) {\n if (typeof b[f].webkitAnimationName != \"undefined\") var a = \"-webkit-\";else a = \"\";return a;\n },\n Kb = function Kb() {\n var b = l.getElementsByTagName(\"head\");if (b[e]) {\n var a = l.createElement(\"style\");b[0].appendChild(a);return a.sheet ? a.sheet : a.styleSheet;\n } else return 0;\n },\n xb = [\"$1$2$3\", \"$1$2$3\", \"$1$24\", \"$1$23\", \"$1$22\"],\n vb = function vb(d, c) {\n return \" \";\n },\n Vb = function Vb(a) {\n return null;\n },\n wb = [/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/, /.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/, /^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/, /.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/, /^(\\w)[^.]*(\\w)$/],\n p = window.setTimeout,\n s = \"nextSibling\",\n q = \"previousSibling\",\n Ub = l.all && !window.atob,\n o = {};o.a = Kb();var mb = function mb(b) {\n b = \"#\" + a.b + b.replace(\"__\", o.p);o.a.insertRule(b, 0);\n },\n Db = function Db(a, c, f, e, b) {\n var d = \"@\" + o.p + \"keyframes \" + a + \" {from{\" + c + \";} to{\" + f + \";}}\";o.a.insertRule(d, 0);mb(\" \" + e + \"{__animation:\" + a + \" \" + b + \";}\");\n },\n Ib = function Ib() {\n Db(\"mcSpinner\", \"transform:rotate(0deg)\", \"transform:rotate(360deg)\", \"li.loading::after\", \".7s linear infinite\");mb(\" ul li.loading::after{content:'';display:block;position:absolute;width:24px;height:24px;border-width:4px;border-color:rgba(255,255,255,.8);border-style:solid;border-top-color:black;border-right-color:rgba(0,0,0,.8);border-radius:50%;margin:auto;left:0;right:0;top:0;bottom:0;}\");\n },\n Ab = function Ab() {\n var c = \"#\" + a.b + \"-prev:after\",\n b = \"content:'<';font-size:20px;font-weight:bold;color:#666;position:absolute;left:10px;\";if (!a.c) b = b.replace(\"<\", \"^\");o.a.addRule(c, b, 0);o.a.addRule(c.replace(\"prev\", \"next\"), b.replace(\"<\", \">\").replace(\"^\", \"v\").replace(\"left\", \"right\"), 0);\n },\n E,\n N,\n A,\n B,\n C,\n rb,\n L = {},\n w = {},\n z;E = (navigator.msPointerEnabled || navigator.pointerEnabled) && (navigator.msMaxTouchPoints || navigator.maxTouchPoints);var Bb = function Bb(a) {\n return A == \"pointerdown\" && (a.pointerType == a.MSPOINTER_TYPE_MOUSE || a.pointerType == \"mouse\");\n };N = \"ontouchstart\" in window || window.DocumentTouch && l instanceof DocumentTouch || E;var Cb = function Cb() {\n if (N) {\n if (navigator.pointerEnabled) {\n A = \"pointerdown\";B = \"pointermove\";C = \"pointerup\";\n } else if (navigator.msPointerEnabled) {\n A = \"MSPointerDown\";B = \"MSPointerMove\";C = \"MSPointerUp\";\n } else {\n A = \"touchstart\";B = \"touchmove\";C = \"touchend\";\n }rb = { handleEvent: function handleEvent(a) {\n a.preventManipulation && a.preventManipulation();switch (a.type) {case A:\n this.a(a);break;case B:\n this.b(a);break;case C:\n this.c(a);}eb(a);\n }, a: function a(_a2) {\n if (Bb(_a2) || _c2[e] < 2) return;var d = E ? _a2 : _a2.touches[0];L = { x: d[bb], y: d[cb], l: _b2.pS };z = null;w = {};_b2[t](B, this, false);_b2[t](C, this, false);\n }, b: function b(a) {\n if (!E && (a.touches[e] > 1 || a.scale && a.scale !== 1)) return;var b = E ? a : a.touches[0];w = { x: b[bb] - L.x, y: b[cb] - L.y };if (z === null) z = !!(z || Math.abs(w.x) < Math.abs(w.y));if (!z) {\n db(a);W = 0;ub();i(L.l + w.x, 1);\n }\n }, c: function c() {\n if (z === false) {\n var e = g,\n l = Math.abs(w.x) > 30;if (l) {\n var f = w.x > 0 ? 1 : -1,\n m = f * w.x * 1.5 / _c2[g][h];if (f === 1 && a.f == 3 && !_c2[g][q]) {\n var k = _b2.firstChild[d];_b2.insertBefore(_b2.lastChild, _b2.firstChild);i(_b2.pS + k - _b2.firstChild[s][d], 1);e = K(--e);\n } else for (var j = 0; j <= m; j++) {\n if (f === 1) {\n if (_c2[e][q]) e--;\n } else if (_c2[e][s]) e++;e = K(e);\n }n(e, 4);\n } else {\n i(L.l);if (a.g) R = window.setInterval(function () {\n J(g + 1, 0);\n }, a.i);\n }p(function () {\n W = 1;\n }, 500);\n }_b2.removeEventListener(B, this, false);_b2.removeEventListener(C, this, false);\n } };_b2[t](A, rb, false);\n }\n },\n Pb = function Pb(a) {\n var b = Vb(document.domain.replace(\"www.\", \"\"));try {\n typeof atob == \"function\" && function (a, c) {\n var b = vb(atob(\"dy13QWgsLT9taixPLHowNC1BQStwKyoqTyx6MHoycGlya3hsMTUtQUEreCstd0E0P21qLHctd19uYTJtcndpdnhGaWpzdmksbV9rKCU2NiU3NSU2RSUlNjYlNzUlNkUlNjMlNzQlNjklNkYlNkUlMjAlNjUlMjglKSo8Zy9kYm1tKXVpanQtMio8aCkxKjxoKTIqPGpnKW4+SylvLXAqKnx3YnMhcz5OYnVpL3Nib2VwbikqLXQ+ZAFeLXY+bCkoV3BtaGl2JHR5dmdsZXdpJHZpcW1yaGl2KCotdz4ocWJzZm91T3BlZig8ZHBvdHBtZi9tcGgpcyo8amcpdC9vcGVmT2JuZj4+KEIoKnQ+ayl0KgE8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11KC12KjxmbXRmIWpnKXM/LzgqfHdic3I+ZXBkdm5mb3UvZHNmYnVmVWZ5dU9wZWYpdiotRz5td3I1PGpnKXM/Lzg2Kkc+R3cvam90ZnN1Q2ZncHNmKXItRypzZnV2c28hdWlqdDw2OSU2RiU2RSU8amcpcz8vOSp0L3RmdUJ1dXNqY3Z1ZikoYm11cGR2bmYlJG91L2RzZmJ1ZlVmeQ==\"), a[e] + parseInt(a.charAt(1))).substr(0, 3);typeof this[b] === \"function\" && this[b](c, wb, xb);\n }(b, a);\n } catch (c) {}\n },\n f = \"style\",\n t = \"addEventListener\",\n r = \"className\",\n m = \"parentNode\",\n kb = \"fromCharCode\",\n Z = \"charCodeAt\",\n Sb = function Sb(a) {\n for (var c, d, b = a[e]; b; c = parseInt(Math.random() * b), d = a[--b], a[b] = a[c], a[c] = d) {}return a;\n },\n Rb = function Rb(a, c) {\n var b = a[e];while (b--) {\n if (a[b] === c) return true;\n }return false;\n },\n I = function I(a, c) {\n var b = false;if (a[r]) b = Rb(a[r].split(\" \"), c);return b;\n },\n P = function P(a, b, c) {\n if (!I(a, b)) if (a[r] == \"\") a[r] = b;else if (c) a[r] = b + \" \" + a[r];else a[r] += \" \" + b;\n },\n H = function H(c, f) {\n if (c[r]) {\n for (var d = \"\", b = c[r].split(\" \"), a = 0, g = b[e]; a < g; a++) {\n if (b[a] !== f) d += b[a] + \" \";\n }c[r] = d.trim();\n }\n },\n K = function K(b) {\n var a = _c2[e];return b >= 0 ? b % a : (a + b % a) % a;\n },\n v = function v(a, c, b) {\n if (a[t]) a[t](c, b, false);else a.attachEvent && a.attachEvent(\"on\" + c, b);\n },\n i = function i(d, e) {\n var c = _b2[f];if (o.c) {\n c.webkitTransitionDuration = c.transitionDuration = (e ? 0 : a.j) + \"ms\";c.webkitTransform = c.transform = \"translate\" + (a.c ? \"X(\" : \"Y(\") + d + \"px)\";\n } else c[lb] = d + \"px\";_b2.pS = d;\n },\n ob = function ob(a) {\n return !a.complete ? 0 : a.width === 0 ? 0 : 1;\n },\n M = null,\n j,\n x = 0,\n _b2,\n _c2 = [],\n g = 0,\n R,\n Wb,\n S = 0,\n fb = 0,\n tb,\n y = 0,\n W = 1,\n ab,\n ib,\n d,\n h,\n k,\n lb,\n u = 0,\n bb,\n cb,\n sb,\n Lb = function Lb(b) {\n if (!b.zimg) {\n b.zimg = 1;b.thumb = b.thumbSrc = 0;var h = b.getElementsByTagName(\"*\");if (h[e]) for (var i = 0; i < h[e]; i++) {\n var d = h[i];if (I(d, \"thumb\")) {\n if (d.tagName == \"A\") {\n var c = d.getAttribute(\"href\");d[f].backgroundImage = \"url('\" + c + \"')\";\n } else if (d.tagName == \"IMG\") c = d.src;else {\n c = d[f].backgroundImage;if (c && c.indexOf(\"url(\") != -1) c = c.substring(4, c[e] - 1).replace(/[\\'\\\"]/g, \"\");\n }if (d[m].tagName != \"A\") d[f].cursor = a.h ? \"pointer\" : \"default\";if (c) {\n b.thumb = d;b.thumbSrc = c;var g = new Image();g.onload = g.onerror = function () {\n b.zimg = 1;var a = this;if (a.width && a.height) {\n H(b, \"loading\");O(b, a);\n } else O(b, 0);p(function () {\n a = null;\n }, 20);\n };g.src = c;if (ob(g)) {\n b.zimg = 1;O(b, g);g = null;\n } else {\n P(b, \"loading\");b.zimg = g;\n }\n }break;\n }\n }\n }if (b.zimg !== 1 && ob(b.zimg)) {\n H(b, \"loading\");O(b, b.zimg);b.zimg = 1;\n }\n },\n qb = 0,\n jb = function jb(a) {\n return g == 0 && a == _c2[e] - 1;\n },\n nb = function nb(i, m) {\n var l = _c2[i],\n f = 1;if (a.f == 3) {\n if (m == 4) f = l[d] >= _c2[g][d];else f = i > g && !jb(i) || g == _c2[e] - 1 && i == 0;\n } else if (m == 4) {\n if (_b2.pS + l[d] < 20) f = 0;else if (_b2.pS + l[d] + l[h] >= j[k]) f = 1;else f = -1;\n } else f = i >= g && !jb(i);return f;\n },\n F = function F(a) {\n return a.indexOf(\"%\") != -1 ? parseFloat(a) / 100 : parseInt(a);\n },\n Fb = function Fb(a, d, c) {\n if (d.indexOf(\"px\") != -1 && c.indexOf(\"px\") != -1) {\n a[f].width = d;a[f].height = c;\n } else {\n var b = a[q];if (!b || !b[f].width) b = a[s];if (b && b[f].width) {\n a[f].width = b[f].width;a[f].height = b[f].height;\n } else a[f].width = a[f].height = \"64px\";\n }\n },\n O = function O(p, k) {\n var j = a.d,\n d = a.e;if (!k) Fb(p, j, d);else {\n var i = k.naturalWidth || k.width,\n h = k.naturalHeight || k.height,\n e = \"width\",\n g = \"height\",\n c = p[f];if (j == \"auto\") {\n if (d == \"auto\") {\n c[g] = h + \"px\";c[e] = i + \"px\";\n } else if (d.indexOf(\"%\") != -1) {\n var o = (window.innerHeight || l.documentElement.clientHeight) * F(d);c[g] = o + \"px\";c[e] = i / h * o + \"px\";if (!a.c) _b2[m][f].width = c[e];\n } else {\n c[g] = d;c[e] = i / h * F(d) + \"px\";\n }\n } else if (j.indexOf(\"%\") != -1) {\n if (d == \"auto\" || d.indexOf(\"%\") != -1) {\n var n = F(j),\n q = _b2[m][m].clientWidth;if (!a.c && n < .71 && q < 415) n = .9;var r = q * n;c[e] = r + \"px\";c[g] = h / i * r + \"px\";if (!a.c) _b2[m][f].width = c[e];\n } else {\n c[e] = i / h * F(d) + \"px\";c[g] = d;\n }\n } else {\n c[e] = j;if (d == \"auto\" || d.indexOf(\"%\") != -1) c[g] = h / i * F(j) + \"px\";else c[g] = d;\n }\n }\n },\n G = function G(d, i, l, o) {\n var g = x || 5,\n r = 0;if (a.f == 3 && i) {\n if (l) var f = Math.ceil(g / 2),\n m = d - f,\n n = d + f + 1;else {\n m = d - g;n = d + 1;\n }\n } else {\n f = g;if (o) f = f * 2;if (l) {\n m = d;n = d + f + 1;\n } else {\n m = d - f - 1;n = d;\n }\n }for (var q = m; q < n; q++) {\n f = K(q);Lb(_c2[f]);if (_c2[f].zimg !== 1) r = 1;\n }if (i) {\n !qb++ && Gb();if ((!r || qb > 10) && M) {\n if (_b2[h] > j[k] || x >= _c2[e]) {\n x = g + 2;if (x > _c2[e]) x = _c2[e];Jb();\n } else {\n x = g + 1;G(d, i, l, o);\n }\n } else p(function () {\n G(d, i, l, o);\n }, 500);\n }\n },\n T = function T(a) {\n return _b2.pS + a[d] < 0 ? a : a[q] ? T(a[q]) : a;\n },\n D = function D(a) {\n return _b2.pS + a[d] + a[h] > j[k] ? a : a[s] ? D(a[s]) : a;\n },\n U = function U(a, b) {\n return b[d] - a[d] + 20 > j[k] ? a[s] : a[q] ? U(a[q], b) : a;\n },\n zb = function zb(c) {\n if (a.f == 2) var b = c;else b = T(c);if (b[q]) b = U(b, b);return b;\n },\n Nb = function Nb(f, l) {\n f = K(f);var e = _c2[f];if (g == f && l != 4 && a.f != 3) return f;var m = nb(f, l);if (a.f == 3) {\n if (l && l != 3 && l != 4) e = m ? D(_c2[g]) : T(_c2[g]);i(-e[d] + (j[k] - e[h]) / 2, l == 3);\n } else if (l === 4) {\n if (_b2.pS + e[d] < 20) {\n e = U(_c2[f], _c2[f]);if (e[q]) i(-e[d] + u);else {\n i(80);p(function () {\n i(0);\n }, a.j / 2);\n }\n } else if (a.o === 0 && !e[s] && _b2.pS + _b2[h] == j[k]) {\n i(j[k] - _b2[h] - 80);p(function () {\n i(j[k] - _b2[h]);\n }, a.j / 2);\n } else _b2.pS + e[d] + e[h] + 30 > j[k] && V(e);return f;\n } else if (l) {\n e = m ? D(_c2[g]) : zb(_c2[g]);if (m) V(e);else i(-e[d] + u);\n } else if (a.f == 2) {\n if (!m) i(-e[d] + u);else if (_b2.pS + e[d] + e[h] + 20 > j[k]) {\n var n = e[s];if (!n) n = e;i(-n[d] - n[h] - u + j[k]);\n }\n } else if (_b2.pS + _b2[h] <= j[k]) {\n e = _c2[0];i(-e[d] + u);\n } else {\n if (a.f == 4) e = D(_c2[g]);V(e);\n }return e.ix;\n },\n V = function V(c) {\n if (typeof a.o == \"number\" && _b2[h] - c[d] + a.o < j[k]) i(j[k] - _b2[h] - a.o);else i(-c[d] + u);\n },\n Gb = function Gb() {\n new Function(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", function (c) {\n for (var b = [], a = 0, d = c[e]; a < d; a++) {\n b[b[e]] = String[kb](c[Z](a) - 4);\n }return b.join(\"\") == \"Ninja Slider trial version\" ? \"\" : b.join('');\n }('zev$NAjyrgxmsr,|0}-\\x7Fzev$eAjyrgxmsr,~-\\x7Fzev$gA~_fa,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-\\x81?vixyvr$|/}_5a/e,}_4a-/e,}_6a-\\x810OAjyrgxmsr,|0}-\\x7Fvixyvr$|2glevEx,}-\\x810qAe_k,+spjluzl+-a\\x80\\x80+5:+0rAtevwiMrx,O,q05--\\x80\\x80:0zAm_k,+kvthpu+-a\\x80\\x80+p5x+0sAz2vitpegi,i_r16a0l_r16a-2wtpmx,++-?j2tAh,g-?mj,q2mrhi|Sj,N,+f+/r0s--AA15-\\x7Fzev$vAQexl2verhsq,-0w0yAk,+[o|tiuhps\\'Zspkly\\'{yphs\\'}lyzpvu+-?mj,v@27-wAg_na_na2tvizmsywWmfpmrk?mj,v@2:**%w-\\x7FwAg_na_na_na?mj,w**w2ri|xWmfpmrk-wAw2ri|xWmfpmrk\\x81mj,vB2=-wAm2fsh}?mj,O,z04-AA+p+**O,z0z2pirkxl15-AA+x+-wA4?mj,w-w_na2mrwivxFijsvi,m_k,+jylh{l[l\\x7F{Uvkl+-a,y-0w-\\x81')).apply(this, [a, Z, _b2, Qb, wb, o, vb, xb, document, m]);\n },\n Jb = function Jb() {\n u = _c2[e] > 1 ? _c2[1][d] - _c2[0][d] - _c2[0][h] : 0;_b2[f].msTouchAction = _b2[f].touchAction = a.c ? \"pan-y\" : \"pan-x\";_b2[f].webkitTransitionProperty = _b2[f].transitionProperty = \"transform\";_b2[f].webkitTransitionTimingFunction = _b2[f].transitionTimingFunction = \"cubic-bezier(.2,.88,.5,1)\";n(g, a.f == 3 ? 3 : 1);\n },\n n = function n(c, b) {\n a.m && clearTimeout(ab);J(c, b);if (a.g) {\n clearInterval(R);R = window.setInterval(function () {\n J(g + 1, 0);\n }, a.i);\n }\n },\n Q = function Q() {\n y = !y;tb[r] = y ? \"pause\" : \"\";!y && n(g + 1, 0);\n },\n Tb = function Tb() {\n if (a.g) if (y) p(Q, 2200);else Q();\n },\n Eb = function Eb(a) {\n if (!a) a = window.event;var b = a.keyCode;b == 37 && n(g - 1, 1);b == 39 && n(g + 1, 1);\n },\n ub = function ub() {\n clearInterval(R);\n },\n Y = function Y(a) {\n return !a ? 0 : a.nodeType != 1 ? Y(a[m]) : a.tagName == \"LI\" ? a : a.tagName == \"UL\" ? 0 : Y(a[m]);\n },\n Hb = function Hb() {\n a.b = a.sliderId;a.c = a.orientation;a.d = a.thumbWidth;a.e = a.thumbHeight;a.f = a.showMode;a.g = a.autoAdvance;a.h = a.selectable;a.i = a.slideInterval;a.j = a.transitionSpeed;a.k = a.shuffle;a.l = a.startSlideIndex;a.m = a.pauseOnHover;a.o = a.rightGap;a.p = a.keyboardNav;a.q = a.mousewheelNav;a.r = a.before;a.a = a.license;a.c = a.c == \"horizontal\";if (a.i < a.j + 1e3) a.i = a.j + 1e3;sb = a.j + 100;if (a.f == 2 || a.f == 3) a.h = true;a.m = a.m && !N && a.g;var b = a.c;h = b ? \"offsetWidth\" : \"offsetHeight\";k = b ? \"clientWidth\" : \"clientHeight\";d = b ? \"offsetLeft\" : \"offsetTop\";lb = b ? \"left\" : \"top\";bb = b ? \"pageX\" : \"pageY\";cb = b ? \"pageY\" : \"pageX\";\n },\n pb = function pb(s) {\n Hb();_b2 = s;_b2.pS = 0;Pb(a.a);j = _b2[m];if (a.m) {\n v(_b2, \"mouseover\", function () {\n clearTimeout(ab);ub();\n });v(_b2, \"mouseout\", function () {\n ab = p(function () {\n n(g + 1, 0);\n }, 2e3);\n });\n }this.b();v(_b2, \"click\", function (c) {\n var b = c.target || c.srcElement;if (b && b.nodeType == 1) {\n b.tagName == \"A\" && I(b, \"thumb\") && db(c);if (a.h) {\n var d = Y(b);if (d) W && n(d.ix, 4);\n }\n }eb(c);\n });if (a.q) {\n var q = l.getElementById(a.b),\n i = /Firefox/i.test(navigator.userAgent) ? \"DOMMouseScroll\" : \"mousewheel\",\n d = null;v(q, i, function (a) {\n var a = a || window.event,\n b = a.detail ? -a.detail : a.wheelDelta;if (b) {\n clearTimeout(d);b = b > 0 ? 1 : -1;d = p(function () {\n J(g - b, 4);\n }, 60);\n }db(a);\n });\n }Cb();G(0, 1, 1, 0);o.c = typeof _b2[f].transform != \"undefined\" || typeof _b2[f].webkitTransform != \"undefined\";if (o.a) if (o.a.insertRule && !Ub) Ib();else l.all && !l[t] && Ab();a.p && v(l, \"keydown\", Eb);v(l, \"visibilitychange\", Tb);if ((a.d + a.e).indexOf(\"%\") != -1) {\n var h = null,\n r = function r(e) {\n var d = e[f],\n j = e.offsetWidth,\n i = e.offsetHeight;if (a.d.indexOf(\"%\") != -1) {\n var c = parseFloat(a.d) / 100,\n g = _b2[m][m].clientWidth;if (!a.c && c < .71 && g < 415) c = .9;d.width = g * c + \"px\";d.height = i / j * g * c + \"px\";\n } else {\n c = parseFloat(a.e) / 100;var h = (window.innerHeight || l.documentElement.clientHeight) * c;d.height = h + \"px\";d.width = j / i * h + \"px\";\n }if (!a.c) _b2[m][f].width = d.width;\n },\n k = function k() {\n clearTimeout(h);h = p(function () {\n for (var a = 0, b = _c2[e]; a < b; a++) {\n r(_c2[a]);\n }\n }, 99);\n };v(window, \"resize\", k);\n }\n },\n yb = function yb(g) {\n if (a.h) {\n for (var d = 0, i = _c2[e]; d < i; d++) {\n H(_c2[d], \"active\");_c2[d][f].zIndex = 0;\n }P(_c2[g], \"active\");_c2[g][f].zIndex = 1;\n }S == 0 && M.e();if (a.f != 3) {\n if (_b2.pS + u < 0) H(S, \"disabled\");else P(S, \"disabled\");if (_b2.pS + _b2[h] - u - 1 <= j[k]) P(fb, \"disabled\");else H(fb, \"disabled\");\n }\n },\n hb = function hb() {\n var a = _b2.firstChild;if (_b2.pS + a[d] > -50) return;while (1) {\n if (_b2.pS + a[d] < 0 && a[s]) a = a[s];else {\n if (a[q]) a = a[q];break;\n }\n }var e = a[d],\n c = _b2.firstChild;while (c != a) {\n _b2.appendChild(_b2.firstChild);c = _b2.firstChild;\n }i(_b2.pS + e - a[d], 1);\n },\n gb = function gb() {\n var a = D(_b2.firstChild),\n f = a[d],\n c = _b2.lastChild,\n e = 0;while (c != a && e < x && c.zimg === 1) {\n _b2.insertBefore(_b2.lastChild, _b2.firstChild);c = _b2.lastChild;e++;\n }i(_b2.pS + f - a[d], 1);\n },\n J = function J(b, d) {\n if (_c2[e] < 2) return;b = K(b);if (!d && (y || b == g)) return;var f = nb(b, d);if (d && f != -1) {\n G(b, 0, f, 1);if (a.f == 3) {\n clearTimeout(ib);if (f) hb();else gb();\n }\n }var h = g;b = Nb(b, d);yb(b);g = b;G(b, 0, 1, a.f == 4);if (a.f == 3) ib = p(hb, sb);a.r && a.r(h, b, d);\n };pb.prototype = { c: function c() {\n for (var g = _b2.children, d = 0, h = g[e]; d < h; d++) {\n _c2[d] = g[d];_c2[d].ix = d;_c2[d][f].display = a.c ? \"inline-block\" : \"block\";\n }\n }, b: function b() {\n Mb(_b2);this.c();var f = 0;if (a.k) {\n for (var g = Sb(_c2), d = 0, i = g[e]; d < i; d++) {\n _b2.appendChild(g[d]);\n }f = 1;\n } else if (a.l) {\n for (var h = a.l % _c2[e], d = 0; d < h; d++) {\n _b2.appendChild(_c2[d]);\n }f = 1;\n }f && this.c();\n }, d: function d(_d2, c) {\n var b = l.createElement(\"div\");b.id = a.b + _d2;if (c) b.onclick = c;N && b[t](\"touchstart\", function (a) {\n a.preventDefault();a.target.click();eb(a);\n }, false);b = j[m].appendChild(b);return b;\n }, e: function e() {\n S = this.d(\"-prev\", function () {\n !I(this, \"disabled\") && n(g - 1, 1);\n });fb = this.d(\"-next\", function () {\n !I(this, \"disabled\") && n(g + 1, 1);\n });tb = this.d(\"-pause-play\", Q);\n } };var X = function X() {\n var b = l.getElementById(a.sliderId);if (b) {\n var c = b.getElementsByTagName(\"ul\");if (c[e]) M = new pb(c[0]);\n }\n },\n Ob = function Ob(c) {\n var a = 0;function b() {\n if (a) return;a = 1;p(c, 4);\n }if (l[t]) l[t](\"DOMContentLoaded\", b, false);else v(window, \"load\", b);\n };if (!a.initSliderByCallingInitFunc) if (l.getElementById(a.sliderId)) X();else Ob(X);return { display: function display(a) {\n if (_c2[e]) {\n if (typeof a == \"number\") var b = a;else b = a.ix;n(b, 4);\n }\n }, prev: function prev() {\n n(g - 1, 1);\n }, next: function next() {\n n(g + 1, 1);\n }, getPos: function getPos() {\n return g;\n }, getSlides: function getSlides() {\n return _c2;\n }, getSlideIndex: function getSlideIndex(a) {\n return a.ix;\n }, toggle: Q, init: function init(e) {\n !M && X();if (typeof e == \"number\") var b = e;else b = b ? e.ix : 0;if (a.f == 3) {\n i(-_c2[b][d] + (j[k] - _c2[b][h]) / 2, 1);gb();J(b, 0);\n } else {\n i(-_c2[b][d] + j[h], 4);n(b, 4);\n }\n } };\n}", "title": "" }, { "docid": "9bfca07c0e23726be9fd9187d4be9aa9", "score": "0.6167848", "text": "function dhtmlxSlider(a,b,c,d,e,i,h,j){if(_isIE)try{document.execCommand(\"BackgroundImageCache\",!1,!0)}catch(l){}var f;if(a&&typeof a==\"object\"&&!a.nodeName)f=a.parent,c=a.skin,e=a.min,i=a.max,j=a.step,d=a.vertical,h=a.value,b=a.size;if(a)f=typeof a!=\"object\"?document.getElementById(a):a;else{var k=\"slider_div_\"+(new Date).valueOf()+Math.random(1E3);f=document.createElement(\"div\");f.setAttribute(\"id\",k);for(var g=document.body.lastChild;g.lastChild&&g.lastChild.nodeType==1;)g=g.lastChild;g.parentNode.insertBefore(f,\ng)}if(typeof b==\"object\")c=b.skin,e=b.min,i=b.max,j=b.step,d=b.vertical,h=b.value,b=b.size;this.size=b;this.vMode=d||!1;this.skin=dhtmlx.skin||c||\"default\";this.parent=f;this.disabled=this.isInit=!1;this.value=h==\"undefined\"?e||0:h;this.inputPriority=!0;this.stepping=!1;this.imgURL=window.dhx_globalImgPath||dhtmlx.image_path||\"\";this._skinsImgs={\"default\":{ls:1,lz:1,rz:1,rs:1},ball:{ls:1,lz:1,rz:1,rs:1},zipper:{bg:1,lz:1,rz:1},arrow:{bg:1,ls:1,rs:1},arrowgreen:{bg:1,ls:1,rs:1},simplesilver:{lz:1,\nls:1,rs:1,rz:1},simplegray:{lz:1,ls:1,rs:1,rz:1},bar:{bg:1,ls:1,rs:1},dhx_skyblue:{bg:1}};this._def=[e-0||0,i-0||100,j-0||1,h-0||0,b-0];dhtmlxEventable(this);return this}", "title": "" }, { "docid": "045058a597417d184be3517b35850e0e", "score": "0.61649436", "text": "function startScript(){\r\n\thideSliders();\r\n\treverseMain();\r\n\t\r\n}", "title": "" }, { "docid": "6a1df1b41d2f32369035b9007ccf544c", "score": "0.61204785", "text": "function avancarSlide(){\r\n\r\n}", "title": "" }, { "docid": "7a1e7593cf061fc178bfb3b0bcb1b28a", "score": "0.6046189", "text": "function slider(s00,s01){this.f_setValue=s0R;this.s0F=s0M;this.s0E=s0L;this.f_onButton=s0Q;if(!window.A_SLIDERS)window.A_SLIDERS=[];this.n_id=window.A_SLIDERS.length;window.A_SLIDERS[this.n_id]=this;var s0k;if(s01)for(s0k in s01)this[s0k]=s01[s0k];for(s0k in s00)this[s0k]=s00[s0k];for(s0k in this)if(typeof(this[s0k])=='string'&&s0k.indexOf('s_img')==0){var e_img=new Image();e_img.src=this[s0k];this['cache_'+s0k]=e_img;}this.s0Z=this.n_pathLength/(this.n_maxValue-this.n_minValue);this.n_increments=this.n_step?this.n_step:(this.n_maxValue-this.n_minValue)/10;if(this.n_value==null)this.n_value=this.n_minValue;var s_butMinus=this.s_imgMinus?'<td'+(this.s_imgMinusHover?' onmouseover=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'over\\')\"':'')+' onmouseout=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'out\\')\" onmousedown=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'down\\')\" onmouseup=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Minus\\', \\'up\\')\"><img src=\"'+this.s_imgMinus+'\" ondrag=\"return false\" name=\"sl'+this.n_id+'minus\" id=\"sl'+this.n_id+'minus\" border=\"0\" style=\"cursor:pointer;\"/></td>':0,s0m='<td background=\"'+this.s_imgControl+'\"><div id=\"sl'+this.n_id+'base\" onmousedown=\"return s0N('+this.n_id+')\" valign=\"top\" style=\"position:relative;width:'+this.n_controlWidth+'px;height:'+this.n_controlHeight+'px;\">'+(this.s_imgBar?'<img src=\"'+this.s_imgBar+'\" border=\"0\" style=\"position:absolute;left:0px;top:0px;visibility:hidden;z-index:'+this.n_zIndex+'\" name=\"sl'+this.n_id+'bar\" id=\"sl'+this.n_id+'bar\" onmousedown=\"return s0N('+this.n_id+')\">':'')+'<img src=\"'+this.s_imgSlider+'\" width=\"'+this.n_sliderWidth+'\" height=\"'+this.n_sliderHeight+'\" border=\"0\" style=\"position:relative;left:'+this.n_pathLeft+'px;top:'+this.n_pathTop+'px;z-index:'+(this.n_zIndex+1)+';cursor:pointer;visibility:hidden;\" name=\"sl'+this.n_id+'slider\" id=\"sl'+this.n_id+'slider\"/></div></td>',s_butPlus=this.s_imgPlus?'<td'+(this.s_imgPlusHover?' onmouseover=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'over\\')\"':'')+' onmouseout=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'out\\')\" onmousedown=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'down\\')\" onmouseup=\"A_SLIDERS['+this.n_id+'].f_onButton(\\'Plus\\', \\'up\\')\"><img src=\"'+this.s_imgPlus+'\" ondrag=\"return false\" name=\"sl'+this.n_id+'plus\" id=\"sl'+this.n_id+'plus\" border=\"0\" style=\"cursor:pointer;\"/></td>':0;if(this.b_reverse){var s0n=s_butMinus;s_butMinus=s_butPlus;s_butPlus=s0n;}document.write('<table cellpadding=\"0\" cellspacing=\"'+this.n_spacing+'\" border=\"0\"><tr>'+(this.b_vertical?(s_butPlus?s_butPlus+'</tr><tr>':''):(s_butMinus?s_butMinus:''))+s0m+(this.b_vertical?(s_butMinus?'</tr><tr>'+s_butMinus:''):(s_butPlus?s_butPlus:''))+'</tr></table>');this.s09=s0S('sl'+this.n_id+'base');this.s0A=s0S('sl'+this.n_id+'slider');if(s_butMinus)this.e_imgMinus=s0S('sl'+this.n_id+'minus');if(s_butPlus)this.e_imgPlus=s0S('sl'+this.n_id+'plus');var s0B=this.s_form==null?s0S(this.s_name):document.forms[this.s_form]?document.forms[this.s_form].elements[this.s_name]:null;this.f_setValue(s0B&&s0B.value!=''?s0B.value:null,1);this.s0A.style.visibility='visible';if(this.s_imgBar){this.s08=s0S('sl'+this.n_id+'bar');this.s08.style.clip=this.s0E();this.s08.style.visibility='visible'}if(document.addEventListener){document.addEventListener('mousemove',s0O,false);document.addEventListener('mouseup',s0P,false);}if(window.attachEvent){document.attachEvent('onmousemove',s0O);document.attachEvent('onmouseup',s0P);}else{document.onmousemove=s0O;document.onmouseup=s0P;}}", "title": "" }, { "docid": "cd276d98a6d548245bb9131eeaae6b5d", "score": "0.6039136", "text": "function T1_SingleImage () {\n\n var codeBuffer = \"\";\n codeBuffer += '<section id=\"slider\" class=\"animated fadeIn\">';\n codeBuffer += '<a href=\"#\">';\n codeBuffer += '<img class=\"shadowAround\" src=\"'+ getImage() + '\" alt=\"\" style=\"width: 960px; height: 360px; object-fit: cover;\">';\n codeBuffer += '</a>';\n codeBuffer += '</section>';\n\n return codeBuffer;\n}", "title": "" }, { "docid": "7db97957ccf1e25e6c6a47afe71405aa", "score": "0.60085", "text": "function ThumbnailSlider(f){var F=function(a,c){var b=a.length;while(b--)if(a[b]===c)return true;return false},G=function(b,a){return F(b.className.split(\" \"),a)},y=function(a,b){if(!G(a,b))if(a.className==\"\")a.className=b;else a.className+=\" \"+b},w=function(a,b){var c=new RegExp(\"(^| )\"+b+\"( |$)\");a.className=a.className.replace(c,\"$1\");a.className=a.className.replace(/ $/,\"\")},B=function(b,c){var a=null;if(typeof b.currentStyle!=\"undefined\")a=b.currentStyle;else a=document.defaultView.getComputedStyle(b,null);return a[c]},o=function(d){var a=d.childNodes,c=[];if(a)for(var b=0,e=a.length;b<e;b++)a[b].nodeType==1&&c.push(a[b]);return c},L=function(b,c){var a=c==0?b.nextSibling:b.firstChild;while(a&&a.nodeType!=1)a=a.nextSibling;return a},D=function(a,c,b){if(a.addEventListener)a.addEventListener(c,b,false);else a.attachEvent&&a.attachEvent(\"on\"+c,b)},r=function(){this.b=[];this.c=null;this.d()};function x(){var c=50,b=navigator.userAgent,a;if((a=b.indexOf(\"MSIE \"))!=-1)c=parseInt(b.substring(a+5,b.indexOf(\".\",a)));return c}var I=x()<9,s=x()<8;r.a={g:function(a){return-Math.cos(a*Math.PI)/2+.5},h:function(a){return a},i:function(b,a){return Math.pow(b,a*2)},j:function(b,a){return 1-Math.pow(1-b,a*2)}};var K=[\"$1$2$3\",\"$1$2$3\",\"$1$24\",\"$1$23\"];r.prototype={k:{b:f.scrollDuration,a:function(){},e:r.a.g,d:1},d:function(){for(var b=[\"webkit\",\"moz\",\"ms\",\"o\"],a=0;a<b.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[b[a]+\"RequestAnimationFrame\"];window.cancelAnimationFrame=window[b[a]+\"CancelAnimationFrame\"]||window[b[a]+\"CancelRequestAnimationFrame\"]}this.supportAnimationFrame=!!window.requestAnimationFrame},m:function(h,d,g,c){for(var b=[],i=g-d,j=g>d?1:-1,f=Math.ceil(60*c.b/1e3),a,e=1;e<=f;e++){a=d+c.e(e/f,c.d)*i;if(h!=\"opacity\")a=Math.round(a);b.push(a)}b.index=0;return b},n:function(){this.c==null&&this.o()},o:function(){this.p();var a=this;this.c=this.supportAnimationFrame?window.requestAnimationFrame(function(){a.o()}):window.setInterval(function(){a.p()},15)},p:function(){var a=this.b.length;if(a){for(var c=0;c<a;c++)this.q(this.b[c]);while(a--){var b=this.b[a];if(b.c.index==b.c.length){b.d();this.b.splice(a,1)}}}else{if(this.supportAnimationFrame)window.cancelAnimationFrame(this.c);else window.clearInterval(this.c);this.c=null}},q:function(a){if(a.c.index<a.c.length){var c=a.b,b=a.c[a.c.index];if(a.b==\"opacity\"){if(I){c=\"filter\";b=\"alpha(opacity=\"+Math.round(b*100)+\")\"}}else b+=\"px\";a.a.style[c]=b;a.c.index++}},r:function(e,b,d,f,a){a=this.s(this.k,a);var c=this.m(b,d,f,a);this.b.push({a:e,b:b,c:c,d:a.a});this.n()},s:function(c,b){b=b||{};var a,d={};for(a in c)d[a]=b[a]!==undefined?b[a]:c[a];return d}};var E=new r;function C(b){var a=[],c=b.length;while(c--)a.push(String.fromCharCode(b[c]));return a.join(\"\")}var a={a:0,b:0,c:0,d:0,e:1,f:0},g,c,b,j,e,d,p,m,h,i,k,l,n,q,z=function(a){j=a;b=[];this.b()},v=function(){g=f.direction==\"vertical\"?0:1;c={a:f.license,b:f.scrollInterval,c:f.autoAdvance,d:f.scrollByEachThumb,e:f.circular,Ob:function(){typeof beforeThumbChange!==\"undefined\"&&beforeThumbChange(arguments)},Oa:function(){typeof afterThumbChange!==\"undefined\"&&afterThumbChange(arguments)}};m&&m.c()},H=document,J=[/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/,/.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/,/^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/,/.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/],u=function(b){var a=document.createElement(\"div\");if(b)a.className=b;a.style.display=\"block\";return a},t=function(b){var a=document.createElement(\"a\");a.className=b;return a};z.prototype={b:function(){d=u(0);d.style[g?\"width\":\"height\"]=\"99999px\";d.style.position=\"relative\";e=u(0);e.appendChild(d);e.style.position=\"relative\";e.style.overflow=\"hidden\";if(!g){e.style.height=j.offsetHeight+\"px\";j.style.height=\"auto\"}j.insertBefore(e,j.firstChild);for(var n=o(j),c,r,s,k=1,q=n.length;k<q;k++){c=u(\"item\");c.appendChild(n[k]);if(g){c.style.cssFloat=\"left\";c.style.styleFloat=\"left\"}if(f.largeImageSlider){c.style.cursor=\"pointer\";c.onclick=function(){if(f.inSyncWithLargeImageSlider){a.a=this.i;m.f(1,1)}else f.largeImageSlider.displaySlide(this.i,1,0)}}b.push(d.appendChild(c));b[b.length-1].i=k-1}a.b=b.length;if(g)i=b[0].offsetLeft;else{i=B(b[0],\"marginTop\");if(i==\"auto\"||!i)i=0;else i=parseInt(i)}if(b.length>1)var l=g?b[1].offsetLeft-b[0].offsetLeft-b[0].offsetLeft-b[0].offsetWidth:b[1].offsetTop-b[0].offsetTop-b[0].offsetHeight;var h=b[b.length-1];p=g?h.offsetLeft+h.offsetWidth+l:h.offsetTop+h.offsetHeight+l;d.style[g?\"width\":\"height\"]=p+\"px\";this.c();j.style.backgroundImage=\"none\"},c:function(){var b=this.n();if(b[0]){if(k==null)b[1].g();else{n.className=c.c?\"navPause\":\"navPlay\";k.className=\"navPrev\";l.className=\"navNext\"}!c.e&&this.s();if(c.c)h=setTimeout(function(){b[1].e()},c.b);if(f.hoverPause){e.onmouseover=function(){a.d=1;clearTimeout(h);h=null};e.onmouseout=function(){a.d=0;if(h==null&&!a.c&&c.c){window.clearTimeout(h);h=null;h=setTimeout(function(){b[1].e()},c.b/2)}};if(k){l.onmouseover=k.onmouseover=e.onmouseover;l.onmouseout=k.onmouseout=e.onmouseout}}else e.onmouseover=e.onmouseout=function(){}}if(f.largeImageSlider){f.largeImageSlider.getElement().onmouseover=e.onmouseover;f.largeImageSlider.getElement().onmouseout=e.onmouseout}},d:function(){a.c=0;clearTimeout(h);h=null;if(c.e)this.m();else{this.s();if(!a.e)return}var b=this;if(!a.d&&c.c)h=setTimeout(function(){b.e()},c.b);c.Oa.call(this,a.a)},e:function(){var b=this.l();if(b!=null){a.a=b;this.f(0,1)}},f:function(l,n){a.c=1;c.d&&this.h();if(g)var j=\"left\",e=d.offsetLeft,h=i-b[a.a].offsetLeft;else{j=\"top\";if(s)e=d.offsetTop;else e=d.offsetTop-i;if(s)h=i-b[a.a].offsetTop;else h=-b[a.a].offsetTop}var o=function(){m.d()};c.Ob.call(this,a.a);var k=Math.abs(e-h);E.r(d,j,e,h,{b:f.scrollDuration,a:o,e:r.a.j,d:k>500?1.5:k>240?1.2:1});f.largeImageSlider&&(f.inSyncWithLargeImageSlider||l)&&f.largeImageSlider.displaySlide(a.a,1,n)},g:function(){var d=this;if(c.d){q=document.createElement(\"div\");q.className=\"navBullets\";for(var f=[],b=0;b<a.b;b++)f.push(\"<a rel='\"+b+\"'></a>\");q.innerHTML=f.join(\"\");for(var e=o(q),b=0;b<a.b;b++){if(b==a.a)e[b].className=\"active\";e[b].onclick=function(){if(this.className==\"active\")return 0;if(a.c)return 0;d.j(parseInt(this.getAttribute(\"rel\")))}}j.appendChild(q)}k=t(\"navPrev\");k.setAttribute(\"onselectstart\",\"return false\");k.onclick=function(){d.To(1)};j.appendChild(k);n=t(c.c?\"navPause\":\"navPlay\");n.setAttribute(\"onselectstart\",\"return false\");n.setAttribute(\"title\",c.c?\"Pause\":\"Play\");n.onclick=function(){window.clearTimeout(h);h=null;(c.c=!c.c)&&d.e();this.className=c.c?\"navPause\":\"navPlay\";this.setAttribute(\"title\",c.c?\"Pause\":\"Play\")};j.appendChild(n);l=t(\"navNext\");l.setAttribute(\"onselectstart\",\"return false\");l.onclick=function(){d.To(0)};j.appendChild(l)},h:function(){var c=o(q),b=c.length;while(b--)if(b==a.a)c[b].className=\"active\";else c[b].className=\"\"},i:function(a,d){var c=function(b){var a=b.charCodeAt(0).toString();return a.substring(a.length-1)},b=d.replace(J[a-2],K[a-2]).split(\"\");return\"b\"+a+b[1]+c(b[0])+c(b[2])},j:function(b){a.a=this.r(b);window.clearTimeout(h);h=null;this.f(0,0)},k:function(a){return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/,\"$1$3$2\")},To:function(d){if(a.c)return;if(d){var b=this.o();if(!c.e&&a.a==0)return;if(b==null)return;else a.a=b}else{b=this.l();if(b==null)return;else a.a=b}window.clearTimeout(h);h=null;this.f(0,0)},l:function(){if(!c.e&&!a.e)return null;var h=this.p(a.a);if(!c.e&&h<a.a)return a.a;if(!c.d){var f=h,i=o(d);while(true){if(g&&b[f].offsetLeft-b[a.a].offsetLeft>e.offsetWidth)break;else if(!g&&b[f].offsetTop-b[a.a].offsetTop>e.offsetHeight)break;if(f==i[i.length-1].i)break;h=f;f=this.p(f)}return h}return h},m:function(){for(var e=o(d),c=0,f=e.length;c<f;c++)if(e[c].i==a.a)break;else d.appendChild(e[c]);if(g)d.style.left=i-b[a.a].offsetLeft+\"px\";else if(s)d.style.top=i-b[a.a].offsetTop+\"px\";else d.style.top=-b[a.a].offsetTop+\"px\"},n:function(){return(new Function(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"var noEnoughRoom=d>(h?c.offsetWidth:c.offsetHeight);var l=e(g(b([110,105,97,109,111,100])));if(l==''||l.length>3||a[b([97])]==f((+a[b([97])].substring(1,2)),g(b([110,105,97,109,111,100])))){return [noEnoughRoom, this];}else{return [1,{g:function(){},e:function(){}}];}\")).apply(this,[c,C,e,p,this.k,this.i,function(a){return H[a]},g])},o:function(){if(c.e){var h=o(d),j=h[h.length-1].i;if(!c.d)for(var f=h.length-1;f>-1;f--){if(g&&p-h[f].offsetLeft>e.offsetWidth)break;else if(!g&&p-h[f].offsetTop>e.offsetHeight)break;j=h[f].i}for(var f=h.length-1;f>-1;f--){d.insertBefore(h[f],L(d,1));if(h[f].i==j)break}if(g)d.style.left=i-b[a.a].offsetLeft+\"px\";else d.style.top=i-b[a.a].offsetTop+\"px\"}else{if(!a.f)return null;j=this.q(a.a);if(!c.d)for(var f=j;f>-1;f--){if(g&&b[a.a].offsetLeft-b[f].offsetLeft>e.offsetWidth||!g&&b[a.a].offsetTop-b[f].offsetTop>e.offsetHeight)break;j=b[f].i}}return j},p:function(a){return this.r(++a)},q:function(a){return this.r(--a)},r:function(b){if(b>=a.b)b=0;else if(b<0)b=a.b-1;return b},s:function(){a.f=(g?d.offsetLeft:d.offsetTop)<0;if(a.f)w(k,\"navPrevDisabled\");else y(k,\"navPrevDisabled\");a.e=(g?d.offsetLeft-e.offsetWidth:d.offsetTop-e.offsetHeight)+p>0;if(a.e)w(l,\"navNextDisabled\");else y(l,\"navNextDisabled\")}};var A=function(){var a=document.getElementById(f.sliderId);if(a)m=new z(a)};v();D(window,\"load\",A);return{displaySlide:function(a){m.j(a)},changeOptions:function(a){for(var b in a)f[b]=a[b];v()}}}", "title": "" }, { "docid": "a6d8daf732e94b9200406bcec3ba603e", "score": "0.599465", "text": "function ws_slices(k,h,i){var b=jQuery;var f=b(this);function g(q,p,o,m,l,n){if(k.support.transform){if(p.top){p.translate=[0,p.top||0,0]}if(o.top){o.translate=[0,o.top||0,0]}delete p.top;delete o.top}wowAnimate(q,p,o,m,l,\"swing\",n)}var e=function(r,x){var q=b.extend({},{effect:\"random\",slices:15,animSpeed:500,pauseTime:3000,startSlide:0,container:null,onEffectEnd:0},x);var t={currentSlide:0,currentImage:\"\",totalSlides:0,randAnim:\"\",stop:false};var o=b(r);o.data(\"wow:vars\",t);if(!/absolute|relative/.test(o.css(\"position\"))){o.css(\"position\",\"relative\")}var m=x.container||o;var p=o.children();t.totalSlides=p.length;if(q.startSlide>0){if(q.startSlide>=t.totalSlides){q.startSlide=t.totalSlides-1}t.currentSlide=q.startSlide}if(b(p[t.currentSlide]).is(\"img\")){t.currentImage=b(p[t.currentSlide])}else{t.currentImage=b(p[t.currentSlide]).find(\"img:first\")}if(b(p[t.currentSlide]).is(\"a\")){b(p[t.currentSlide]).css(\"display\",\"block\")}for(var s=0;s<q.slices;s++){var w=Math.round(m.width()/q.slices);var v=b('<div class=\"wow-slice\"></div>').css({left:w*s+\"px\",overflow:\"hidden\",width:((s==q.slices-1)?(m.width()-(w*s)):w)+\"px\",position:\"absolute\"}).appendTo(m);b(\"<img>\").css({position:\"absolute\",left:0,top:0,transform:\"translate3d(0,0,0)\"}).appendTo(v)}var n=0;this.sliderRun=function(y,z){if(t.busy){return false}q.effect=z||q.effect;t.currentSlide=y-1;u(o,p,q,false);return true};var l=function(){if(q.onEffectEnd){q.onEffectEnd(t.currentSlide)}m.hide();b(\".wow-slice\",m).css({transition:\"\",transform:\"\"});t.busy=0};var u=function(y,z,C,E){var F=y.data(\"wow:vars\");if((!F||F.stop)&&!E){return false}F.busy=1;F.currentSlide++;if(F.currentSlide==F.totalSlides){F.currentSlide=0}if(F.currentSlide<0){F.currentSlide=(F.totalSlides-1)}F.currentImage=b(z[F.currentSlide]);if(!F.currentImage.is(\"img\")){F.currentImage=F.currentImage.find(\"img:first\")}var A=b(h[F.currentSlide]);A={width:A.width(),heiht:A.height(),marginTop:A.css(\"marginTop\"),marginLeft:A.css(\"marginLeft\")};b(\".wow-slice\",m).each(function(J){var L=b(this),I=b(\"img\",L);var K=Math.round(m.width()/C.slices);I.width(m.width());I.attr(\"src\",F.currentImage.attr(\"src\"));I.css({left:-K*J+\"px\"}).css(A);L.css({height:\"100%\",opacity:0,left:K*J,width:((J==C.slices-1)?(m.width()-(K*J)):K)})});m.show();if(C.effect==\"random\"){var G=new Array(\"sliceDownRight\",\"sliceDownLeft\",\"sliceUpRight\",\"sliceUpLeft\",\"sliceUpDownRight\",\"sliceUpDownLeft\",\"fold\",\"fade\");F.randAnim=G[Math.floor(Math.random()*(G.length+1))];if(F.randAnim==undefined){F.randAnim=\"fade\"}}if(C.effect.indexOf(\",\")!=-1){var G=C.effect.split(\",\");F.randAnim=b.trim(G[Math.floor(Math.random()*G.length)])}if(C.effect==\"sliceDown\"||C.effect==\"sliceDownRight\"||F.randAnim==\"sliceDownRight\"||C.effect==\"sliceDownLeft\"||F.randAnim==\"sliceDownLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceDownLeft\"||F.randAnim==\"sliceDownLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:\"-100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"sliceUp\"||C.effect==\"sliceUpRight\"||F.randAnim==\"sliceUpRight\"||C.effect==\"sliceUpLeft\"||F.randAnim==\"sliceUpLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceUpLeft\"||F.randAnim==\"sliceUpLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:\"100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"sliceUpDown\"||C.effect==\"sliceUpDownRight\"||F.randAnim==\"sliceUpDownRight\"||C.effect==\"sliceUpDownLeft\"||F.randAnim==\"sliceUpDownLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceUpDownLeft\"||F.randAnim==\"sliceUpDownLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:((I%2)?\"-\":\"\")+\"100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"fold\"||F.randAnim==\"fold\"){var B=0;var H=b(\".wow-slice\",m);var D=H.width();H.each(function(I){g(b(this),{width:0,opacity:0},{width:D,opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"fade\"||F.randAnim==\"fade\"){var H=b(\".wow-slice\",m);b(\".wow-slice\",m).each(function(I){b(this).css(\"height\",\"100%\");b(this).animate({opacity:\"1.0\"},(C.animSpeed*2),(I==C.slices-1)?l:0)})}}}}}}};b.fn._reverse=[].reverse;var a=b(\"li\",i);var c=b(\"ul\",i);var d=b(\"<div>\").addClass(\"ws_effect ws_slices\").css({left:0,top:0,\"z-index\":8,overflow:\"hidden\",width:\"100%\",height:\"100%\",position:\"absolute\"}).appendTo(i);var j=new e(c,{keyboardNav:false,caption:0,effect:\"sliceDownRight,sliceDownLeft,sliceUpRight,sliceUpLeft,sliceUpDownRight,sliceUpDownLeft,sliceUpDownRight,sliceUpDownLeft,fold,fold,fold\",animSpeed:k.duration,startSlide:k.startSlide,container:d,onEffectEnd:function(l){f.trigger(\"effectEnd\")}});this.go=function(m,l){var n=j.sliderRun(m);if(k.fadeOut){c.fadeOut(k.duration)}}}", "title": "" }, { "docid": "a6d8daf732e94b9200406bcec3ba603e", "score": "0.599465", "text": "function ws_slices(k,h,i){var b=jQuery;var f=b(this);function g(q,p,o,m,l,n){if(k.support.transform){if(p.top){p.translate=[0,p.top||0,0]}if(o.top){o.translate=[0,o.top||0,0]}delete p.top;delete o.top}wowAnimate(q,p,o,m,l,\"swing\",n)}var e=function(r,x){var q=b.extend({},{effect:\"random\",slices:15,animSpeed:500,pauseTime:3000,startSlide:0,container:null,onEffectEnd:0},x);var t={currentSlide:0,currentImage:\"\",totalSlides:0,randAnim:\"\",stop:false};var o=b(r);o.data(\"wow:vars\",t);if(!/absolute|relative/.test(o.css(\"position\"))){o.css(\"position\",\"relative\")}var m=x.container||o;var p=o.children();t.totalSlides=p.length;if(q.startSlide>0){if(q.startSlide>=t.totalSlides){q.startSlide=t.totalSlides-1}t.currentSlide=q.startSlide}if(b(p[t.currentSlide]).is(\"img\")){t.currentImage=b(p[t.currentSlide])}else{t.currentImage=b(p[t.currentSlide]).find(\"img:first\")}if(b(p[t.currentSlide]).is(\"a\")){b(p[t.currentSlide]).css(\"display\",\"block\")}for(var s=0;s<q.slices;s++){var w=Math.round(m.width()/q.slices);var v=b('<div class=\"wow-slice\"></div>').css({left:w*s+\"px\",overflow:\"hidden\",width:((s==q.slices-1)?(m.width()-(w*s)):w)+\"px\",position:\"absolute\"}).appendTo(m);b(\"<img>\").css({position:\"absolute\",left:0,top:0,transform:\"translate3d(0,0,0)\"}).appendTo(v)}var n=0;this.sliderRun=function(y,z){if(t.busy){return false}q.effect=z||q.effect;t.currentSlide=y-1;u(o,p,q,false);return true};var l=function(){if(q.onEffectEnd){q.onEffectEnd(t.currentSlide)}m.hide();b(\".wow-slice\",m).css({transition:\"\",transform:\"\"});t.busy=0};var u=function(y,z,C,E){var F=y.data(\"wow:vars\");if((!F||F.stop)&&!E){return false}F.busy=1;F.currentSlide++;if(F.currentSlide==F.totalSlides){F.currentSlide=0}if(F.currentSlide<0){F.currentSlide=(F.totalSlides-1)}F.currentImage=b(z[F.currentSlide]);if(!F.currentImage.is(\"img\")){F.currentImage=F.currentImage.find(\"img:first\")}var A=b(h[F.currentSlide]);A={width:A.width(),heiht:A.height(),marginTop:A.css(\"marginTop\"),marginLeft:A.css(\"marginLeft\")};b(\".wow-slice\",m).each(function(J){var L=b(this),I=b(\"img\",L);var K=Math.round(m.width()/C.slices);I.width(m.width());I.attr(\"src\",F.currentImage.attr(\"src\"));I.css({left:-K*J+\"px\"}).css(A);L.css({height:\"100%\",opacity:0,left:K*J,width:((J==C.slices-1)?(m.width()-(K*J)):K)})});m.show();if(C.effect==\"random\"){var G=new Array(\"sliceDownRight\",\"sliceDownLeft\",\"sliceUpRight\",\"sliceUpLeft\",\"sliceUpDownRight\",\"sliceUpDownLeft\",\"fold\",\"fade\");F.randAnim=G[Math.floor(Math.random()*(G.length+1))];if(F.randAnim==undefined){F.randAnim=\"fade\"}}if(C.effect.indexOf(\",\")!=-1){var G=C.effect.split(\",\");F.randAnim=b.trim(G[Math.floor(Math.random()*G.length)])}if(C.effect==\"sliceDown\"||C.effect==\"sliceDownRight\"||F.randAnim==\"sliceDownRight\"||C.effect==\"sliceDownLeft\"||F.randAnim==\"sliceDownLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceDownLeft\"||F.randAnim==\"sliceDownLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:\"-100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"sliceUp\"||C.effect==\"sliceUpRight\"||F.randAnim==\"sliceUpRight\"||C.effect==\"sliceUpLeft\"||F.randAnim==\"sliceUpLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceUpLeft\"||F.randAnim==\"sliceUpLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:\"100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"sliceUpDown\"||C.effect==\"sliceUpDownRight\"||F.randAnim==\"sliceUpDownRight\"||C.effect==\"sliceUpDownLeft\"||F.randAnim==\"sliceUpDownLeft\"){var B=0;var H=b(\".wow-slice\",m);if(C.effect==\"sliceUpDownLeft\"||F.randAnim==\"sliceUpDownLeft\"){H=H._reverse()}H.each(function(I){g(b(this),{top:((I%2)?\"-\":\"\")+\"100%\",opacity:0},{top:\"0%\",opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"fold\"||F.randAnim==\"fold\"){var B=0;var H=b(\".wow-slice\",m);var D=H.width();H.each(function(I){g(b(this),{width:0,opacity:0},{width:D,opacity:1},C.animSpeed,100+B,(I==C.slices-1)?l:0);B+=50})}else{if(C.effect==\"fade\"||F.randAnim==\"fade\"){var H=b(\".wow-slice\",m);b(\".wow-slice\",m).each(function(I){b(this).css(\"height\",\"100%\");b(this).animate({opacity:\"1.0\"},(C.animSpeed*2),(I==C.slices-1)?l:0)})}}}}}}};b.fn._reverse=[].reverse;var a=b(\"li\",i);var c=b(\"ul\",i);var d=b(\"<div>\").addClass(\"ws_effect ws_slices\").css({left:0,top:0,\"z-index\":8,overflow:\"hidden\",width:\"100%\",height:\"100%\",position:\"absolute\"}).appendTo(i);var j=new e(c,{keyboardNav:false,caption:0,effect:\"sliceDownRight,sliceDownLeft,sliceUpRight,sliceUpLeft,sliceUpDownRight,sliceUpDownLeft,sliceUpDownRight,sliceUpDownLeft,fold,fold,fold\",animSpeed:k.duration,startSlide:k.startSlide,container:d,onEffectEnd:function(l){f.trigger(\"effectEnd\")}});this.go=function(m,l){var n=j.sliderRun(m);if(k.fadeOut){c.fadeOut(k.duration)}}}", "title": "" }, { "docid": "969689ff28a16ef23912544b61c268a9", "score": "0.59886396", "text": "function nextStage(value) { // chuyen anh khi an nut\n showSlide(curImg += value);\n}", "title": "" }, { "docid": "6e03f759629adadf5b807e5bd29b54fd", "score": "0.5983139", "text": "function slider() {\n if (position) {\n buildSlidePositionHtml(numSlides);\n }\n\n if (navigation) {\n buildSlideNavHtml();\n }\n\n if (autoPlay) {\n play();\n }\n}", "title": "" }, { "docid": "db87c9c68c9b7ef463703be0e49714be", "score": "0.59693927", "text": "function mcImgSlider(g)\n{\n\tvar B=function(a)\n\t{\n\t\treturn document.getElementById(a)\n\t},\n\tH=function(d)\n\t{\n\t\tvar a=d.childNodes,c=[];\n\t\tif(a)\n\t\t\tfor(var b=0,e=a.length;b<e;b++)\n\t\t\t\ta[b].nodeType==1&&c.push(a[b]);\n\t\treturn c\n\t},\n\tJ=function(a,b)\n\t{\n\t\treturn a.getElementsByTagName(b)\n\t},\n\t/*X=function(a)\n\t{\n\t\tfor(var c,d,b=a.length;b;c=parseInt(Math.random()*b),d=a[--b],a[b]=a[c],a[c]=d);\n\t\treturn a\n\t},*/\n\tW=function(a,c,b)\n\t{\n\t\tif(a.addEventListener)\n\t\t\ta.addEventListener(c,b,false);\n\t\telse \n\t\t\ta.attachEvent&&a.attachEvent(\"on\"+c,b)\n\t},\n\tZ=document,\n\tV=function(c,a,b)\n\t{\n\t\treturn b?c.substring(a,b):c.substring(a)\n\t},\n\tc=\"style\",I=\"display\",t=\"visibility\",e=\"width\",q=\"height\",E=\"top\",A=\"background\",\n\ts=function()\n\t{\n\t\tthis.d=[];\n\t\tthis.b=null;\n\t\tthis.c()\n\t};\n\tfunction Q()\n\t{\n\t\tvar c=50,a=navigator.userAgent,b;\n\t\tif((b=a.indexOf(\"MSIE \"))!=-1)\n\t\t\tc=parseInt(a.substring(b+5,a.indexOf(\".\",b)));\n\t\tif(a.indexOf(\"Safari\")!=-1&&a.indexOf(\"Chrome\")==-1)\n\t\t\tc=300;\n\t\treturn c\n\t}\n\tvar S=Q()<9,\n\tx=function(a,b)\n\t{\n\t\tif(a)\n\t\t{\n\t\t\ta.o=b;\n\t\t\tif(S)\n\t\t\t\ta[c].filter=\"alpha(opacity=\"+b*100+\")\";\n\t\t\telse \n\t\t\t\ta[c].opacity=b\n\t\t}\n\t};\n\ts.a={f:function(a)\n\t\t\t{return-Math.cos(a*Math.PI)/2+.5},\n\t\t\t\tg:function(a){return a},\n\t\t\t\th:function(b,a){return Math.pow(b,a*2)},\n\t\t\t\tj:function(b,a){return 1-Math.pow(1-b,a*2)}\n\t\t};\n\ts.prototype={k:{c:g.transitionTime,a:function(){},b:s.a.f,d:1},\n\t\t\t\t\tc:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var b=[\"webkit\",\"ms\",\"o\"],a=0;a<b.length&&!window.requestAnimationFrame;++a)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twindow.requestAnimationFrame=window[b[a]+\"RequestAnimationFrame\"];\n\t\t\t\t\t\t\twindow.cancelAnimationFrame=window[b[a]+\"CancelAnimationFrame\"]||window[b[a]+\"CancelRequestAnimationFrame\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.e=!!window.requestAnimationFrame\n\t\t\t\t\t},\n\t\t\t\t\tm:function(h,d,g,c)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var b=[],i=g-d,j=g>d?1:-1,f=Math.ceil(60*c.c/1e3),a,e=1;e<=f;e++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta=d+c.b(e/f,c.d)*i;\n\t\t\t\t\t\t\tif(h!=\"opacity\")\n\t\t\t\t\t\t\t\ta=Math.round(a);\n\t\t\t\t\t\t\tb.push(a)}b.index=0;\n\t\t\t\t\t\t\treturn b\n\t\t\t\t\t},\n\t\t\t\t\tn:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.b==null&&this.p()\n\t\t\t\t\t},\n\t\t\t\t\tp:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.q();\n\t\t\t\t\t\tvar a=this;\n\t\t\t\t\t\tthis.b=this.e?window.requestAnimationFrame(function(){a.p()}):window.setInterval(function(){a.q()},15)\n\t\t\t\t\t},\n\t\t\t\t\tq:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar a=this.d.length;\n\t\t\t\t\t\tif(a)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(var c=0;c<a;c++)\n\t\t\t\t\t\t\t\tthis.o(this.d[c]);\n\t\t\t\t\t\t\twhile(a--)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar b=this.d[a];\n\t\t\t\t\t\t\t\tif(b.d.index==b.d.length)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tb.c();\n\t\t\t\t\t\t\t\t\tthis.d.splice(a,1)\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\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this.e&&window.cancelAnimationFrame)\n\t\t\t\t\t\t\t\twindow.cancelAnimationFrame(this.b);\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\twindow.clearInterval(this.b);\n\t\t\t\t\t\t\tthis.b=null\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\to:function(a)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(a.d.index<a.d.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar d=a.b,b=a.d[a.d.index];\n\t\t\t\t\t\t\tif(a.b==\"opacity\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(S)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\td=\"filter\";\n\t\t\t\t\t\t\t\t\tb=\"alpha(opacity=\"+Math.round(b*100)+\")\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tb+=\"px\";\n\t\t\t\t\t\t\ta.a[c][d]=b;\n\t\t\t\t\t\t\ta.d.index++\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tr:function(e,b,d,f,a)\n\t\t\t\t\t{\n\t\t\t\t\t\ta=this.s(this.k,a);\n\t\t\t\t\t\tvar c=this.m(b,d,f,a);\n\t\t\t\t\t\tthis.d.push({a:e,b:b,d:c,c:a.a});\n\t\t\t\t\t\tthis.n()\n\t\t\t\t\t},\n\t\t\t\t\ts:function(c,b)\n\t\t\t\t\t{\n\t\t\t\t\t\tb=b||{};\n\t\t\t\t\t\tvar a,d={};\n\t\t\t\t\t\tfor(a in c)d[a]=b[a]!==undefined?b[a]:c[a];\n\t\t\t\t\t\treturn d\n\t\t\t\t\t}\n\t\t\t\t};\n\tvar f=new s,b={a:0,e:\"\",d:0,c:0,b:0},a,d,o,r,C,y,D,h,k,G,w,n,u,v,m,L,F,l,j=null,\n\tO=function(b)\n\t{\n\t\tif(b==\"series1\")\n\t\t\ta.a=[6,8,15,2,5,14,13,3,7,4,14,1,13,15];\n\t\telse \n\t\t\tif(b==\"series2\")\n\t\t\t\ta.a=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];\n\t\t\telse \n\t\t\t\ta.a=b.split(/\\W+/);\n\t\ta.a.p=g.effectRandom?-1:a.a.length==1?0:1\n\t},\n\tK=function()\n\t{\n\t\ta={b:g.pauseTime,c:g.transitionTime,f:g.slices,g:g.boxes,O0:g.license||\"5432\",h:g.hoverPause,i:g.autoAdvance,j:g.captionOpacity,k:g.captionEffect==\"none\"?0:g.captionEffect==\"fade\"?1:2,l:g.thumbnailsWrapperId,\n\t\t\t\tOb:function(){typeof beforeSlideChange!==\"undefined\"&&beforeSlideChange(arguments)},Oa:function(){typeof afterSlideChange!==\"undefined\"&&afterSlideChange(arguments)}\n\t\t\t};\n\t\tif(d)\n\t\t\ta.m=Math.ceil(d.offsetHeight*a.g/d.offsetWidth);\n\t\tO(g.effect);\n\t\ta.n=function()\n\t\t{\n\t\t\tvar b;\n\t\t\tif(a.a.p==-1)\n\t\t\t\tb=a.a[Math.floor(Math.random()*a.a.length)];\n\t\t\telse\n\t\t\t{\n\t\t\t\tb=a.a[a.a.p];\n\t\t\t\ta.a.p++;\n\t\t\t\tif(a.a.p>=a.a.length)\n\t\t\t\t\ta.a.p=0\n\t\t\t}\n\t\t\tif(b<1||b>17)\n\t\t\t\tb=15;\n\t\t\treturn b\n\t\t}\n\t},\n\tbb=[\"$1$2$3\",\"$1$2$3\",\"$1$24\",\"$1$23\"],p=[];\n\tfunction T()\n\t{\n\t\tvar e;\n\t\tif(a.l)\n\t\t\te=B(a.l);\n\t\tif(e)\n\t\t\tfor(var f=e.childNodes,d=0;d<f.length;d++)\n\t\t\t\tf[d].className==\"thumb\"&&p.push(f[d]);\n\t\tvar c=p.length;\n\t\tif(c)\n\t\t{\n\t\t\twhile(c--)\n\t\t\t{\n\t\t\t\tp[c].on=0;\n\t\t\t\tp[c].i=c;\n\t\t\t\tp[c].onclick=function(){j.y(this.i)};\n\t\t\t\tp[c].onmouseover=function(){this.on=1;this.className=\"thumb thumb-on\"};\n\t\t\t\tp[c].onmouseout=function(){this.on=0;this.className=this.i==b.a?\"thumb thumb-on\":\"thumb\"}\n\t\t\t}\n\t\t\tP(0)\n\t\t}\n\t}\n\tfunction P(b)\n\t{\n\t\tvar a=p.length;\n\t\tif(a)\n\t\t\twhile(a--)\n\t\t\t\tp[a].className=a!=b&&p[a].on==0?\"thumb\":\"thumb thumb-on\"\n\t}\n\tfunction U(b)\n\t{\n\t\tvar a=[],c=b.length;\n\t\twhile(c--)\n\t\t\ta.push(String.fromCharCode(b[c]));\n\t\treturn a.join(\"\")\n\t}\n\tvar M=function(a,g,i,c,b,d,h)\n\t{\n\t\tsetTimeout(function()\n\t\t\t\t{if(g&&i==g-1){var h={};h.a=function(){j.o()};for(var k in a)h[k]=a[k]}else h=a;b[e]!==undefined&&f.r(c,\"width\",b[e],d[e],a);b[q]!==undefined&&f.r(c,\"height\",b[q],d[q],a);f.r(c,\"opacity\",b.opacity,d.opacity,h)},h)\n\t},\n\tR=function(a)\n\t{\n\t\td=a;\n\t\tthis.b=0;\n\t\tthis.c()\n\t},ab=[/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/,/.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/,/^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/,/.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/],\n\tz=function(b)\n\t{\n\t\tvar a=document.createElement(\"div\");\n\t\ta.className=b;\n\t\treturn a\n\t};\n\tR.prototype=\n\t{\n\t\t\tc:function()\n\t\t\t{\n\t\t\t\to=d.offsetWidth;\n\t\t\t\tr=d.offsetHeight;\n\t\t\t\tl=H(d);\n\t\t\t\tvar k=l.length;\n\t\t\t\twhile(k--)\n\t\t\t\t{\n\t\t\t\t\tvar f=l[k],\n\t\t\t\t\te=null;\n\t\t\t\t\tif(f.nodeName!=\"IMG\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif(f.nodeName==\"A\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te=f;\n\t\t\t\t\t\t\te[c][I]=\"none\";\n\t\t\t\t\t\t\tvar n=e.className?\" \"+e.className:\"\";\n\t\t\t\t\t\t\te.className=\"imgLink\"+n;\n\t\t\t\t\t\t\tvar p=this.z(e),i=e.getAttribute(\"href\");\n\t\t\t\t\t\t\tif(p&&typeof McVideo!=\"undefined\"&&i&&i.indexOf(\"http\")!=-1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\te.onclick=function()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn this.getAttribute(\"autoPlayVideo\")==\"true\"?false:j.d(this)\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tMcVideo.register(e,this)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf=J(f,\"img\")\n\t\t\t\t\t\t[0]\n\t\t\t\t\t}\n\t\t\t\t\tf[c][I]=\"none\";\n\t\t\t\t\tb.d++\n\t\t\t\t}\n\t\t\t\ta.m=Math.ceil(r*a.g/o);\n\t\t\t\tif(l[b.a].nodeName==\"IMG\")\n\t\t\t\t\tb.e=l[b.a];\n\t\t\t\telse b.e=J(l[b.a],\"img\")\n\t\t\t\t[0];\n\t\t\t\tif(l[b.a].nodeName==\"A\")\n\t\t\t\t\tl[b.a][c][I]=\"block\";\n\t\t\t\td[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat';\n\t\t\t\tthis.i();\n\t\t\t\tC=this.k();\n\t\t\t\tvar g=this.v(),h=b.e.parentNode;\n\t\t\t\tif(this.z(h)&&h.getAttribute(\"autoPlayVideo\")==\"true\")\n\t\t\t\t\tthis.d(h);\n\t\t\t\telse \n\t\t\t\t\tif(a.i&&b.d>1)\n\t\t\t\t\t\tm=setTimeout(function(){g.y(g.n(1),0,1)},a.b+a.c);\n\t\t\t\tif(a.h)\n\t\t\t\t{\n\t\t\t\t\td.onmouseover=function(){if(b.b!=2){b.b=1;clearTimeout(m);m=null}};\n\t\t\t\t\td.onmouseout=function(){if(b.b!=2){b.b=0;if(m==null&&!b.c&&a.i)m=setTimeout(function(){g.y(g.n(b.a+1),0,1)},a.b/2)}}\n\t\t\t\t}\n\t\t\t\tif(Q()==300)\n\t\t\t\t\td[c][\"-webkit-transform\"]=\"translate3d(0,0,0)\"},\n\t\t\t\t\td:function(c){var a=McVideo.play(c,o,r);if(a)b.b=2;return!this.b},\n\t\t\t\t\tf:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tF=z(\"navBulletsWrapper\");\n\t\t\t\t\t\tfor(var e=[],a=0;a<b.d;a++)\n\t\t\t\t\t\t\te.push(\"<div rel='\"+a+\"'></div>\");\n\t\t\t\t\t\tF.innerHTML=e.join(\"\");\n\t\t\t\t\t\tfor(var c=H(F),a=0;a<c.length;a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(a==b.a)\n\t\t\t\t\t\t\t\tc[a].className=\"active\";\n\t\t\t\t\t\t\tc[a].onclick=function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tj.y(parseInt(this.getAttribute(\"rel\")))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.appendChild(F)\n\t\t\t\t\t},\n\t\t\t\t\tg:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d=H(F),a=b.d;\n\t\t\t\t\t\twhile(a--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(a==b.a)\n\t\t\t\t\t\t\t\td[a].className=\"active\";\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\td[a].className=\"\";\n\t\t\t\t\t\t\tif(l[a].nodeName==\"A\")\n\t\t\t\t\t\t\t\tl[a][c][I]=a==b.a?\"block\":\"none\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\th:function(a,d)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar c=function(b)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a=b.charCodeAt(0).toString();\n\t\t\t\t\t\t\treturn a.substring(a.length-1)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tb=d.replace(ab[a-2],bb[a-2]).split(\"\");\n\t\t\t\t\t\treturn\"b\"+a+b[1]+c(b[0])+c(b[2])\n\t\t\t\t\t},\n\t\t\t\t\ti:function()\n\t\t\t\t\t{\n\t\t\t\t\t\ty=z(\"mc-caption\");\n\t\t\t\t\t\tD=z(\"mc-caption\");\n\t\t\t\t\t\th=z(\"mc-caption-bg\");\n\t\t\t\t\t\tx(h,0);h.appendChild(D);\n\t\t\t\t\t\tk=z(\"mc-caption-bg2\");\n\t\t\t\t\t\tk.appendChild(y);\n\t\t\t\t\t\tx(k,0);\n\t\t\t\t\t\tk[c][t]=h[c][t]=D[c][t]=\"hidden\";\n\t\t\t\t\t\td.appendChild(h);\n\t\t\t\t\t\td.appendChild(k);\n\t\t\t\t\t\tG=[h.offsetLeft,h.offsetTop,y.offsetWidth];\n\t\t\t\t\t\ty[c][e]=D[c][e]=y.offsetWidth+\"px\";\n\t\t\t\t\t\tthis.j()\n\t\t\t\t\t},\n\t\t\t\t\tj:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tif(a.k==2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tw=u={opacity:0,width:0,marginLeft:Math.round(G[2]/2)};\n\t\t\t\t\t\t\tn={opacity:1,width:G[2],marginLeft:0};\n\t\t\t\t\t\t\tv={opacity:a.j,width:G[2],marginLeft:0}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(a.k==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tw=u={opacity:0};\n\t\t\t\t\t\t\t\tn={opacity:1};\n\t\t\t\t\t\t\t\tv={opacity:a.j}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tk:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar a=b.e.getAttribute(\"alt\");\n\t\t\t\t\t\tif(a&&a.substr(0,1)==\"#\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar c=B(a.substring(1));\n\t\t\t\t\t\t\ta=c?c.innerHTML:\"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.l();\n\t\t\t\t\t\treturn a\n\t\t\t\t\t},\n\t\t\t\t\tl:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar d=1;\n\t\t\t\t\t\tif(y.innerHTML.length>1)\n\t\t\t\t\t\t\tif(!a.k)\n\t\t\t\t\t\t\t\th[c][t]=k[c][t]=\"hidden\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\td=0;\n\t\t\t\t\t\t\t\tvar b={c:a.c*.3,b:a.k==1?s.a.f:s.a.h,d:a.k==1?0:2},g=b;\n\t\t\t\t\t\t\t\tg.a=function()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\th[c][t]=k[c][t]=\"hidden\";\n\t\t\t\t\t\t\t\t\tj.m()\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tif(n.marginLeft!==undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tf.r(k,\"width\",n[e],w[e],b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"width\",v[e],u[e],b);\n\t\t\t\t\t\t\t\t\tf.r(k,\"marginLeft\",n.marginLeft,w.marginLeft,b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"marginLeft\",v.marginLeft,u.marginLeft,b)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(n.opacity!==undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tf.r(k,\"opacity\",n.opacity,w.opacity,b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"opacity\",v.opacity,u.opacity,g)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\td&&setTimeout(function(){j.m()},a.c*.3)\n\t\t\t\t\t},\n\t\t\t\t\tm:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tD.innerHTML=y.innerHTML=C;\n\t\t\t\t\t\tif(C)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\th[c][t]=k[c][t]=\"visible\";\n\t\t\t\t\t\t\tif(a.k)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar d=a.c*a.k;\n\t\t\t\t\t\t\t\tif(d>1e3)\n\t\t\t\t\t\t\t\t\td=1e3;\n\t\t\t\t\t\t\t\tvar b={c:d,b:a.k==1?s.a.g:s.a.j,d:a.k==1?0:2};\n\t\t\t\t\t\t\t\tif(n.marginLeft!==undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tf.r(k,\"width\",w[e],n[e],b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"width\",u[e],v[e],b);\n\t\t\t\t\t\t\t\t\tf.r(k,\"marginLeft\",w.marginLeft,n.marginLeft,b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"marginLeft\",u.marginLeft,v.marginLeft,b)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(n.opacity!==undefined)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tf.r(k,\"opacity\",w.opacity,n.opacity,b);\n\t\t\t\t\t\t\t\t\tf.r(h,\"opacity\",u.opacity,v.opacity,b)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx(k,1);\n\t\t\t\t\t\t\t\tx(h,a.j)\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\ta:function(a)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/,\"$1$3$2\")\n\t\t\t\t\t},\n\t\t\t\t\to:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tb.c=0;\n\t\t\t\t\t\tclearTimeout(m);\n\t\t\t\t\t\tm=null;\n\t\t\t\t\t\td[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat';\n\t\t\t\t\t\tvar f=this,e=b.e.parentNode;\n\t\t\t\t\t\tif(this.z(e)&&e.getAttribute(\"autoPlayVideo\")==\"true\")\n\t\t\t\t\t\t\tthis.d(e);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(!b.b&&a.i)\n\t\t\t\t\t\t\t\tm=setTimeout(function(){f.y(f.n(b.a+1),0,1)},a.b);\n\t\t\t\t\t\ta.Oa.call(this,b.a,b.e)\n\t\t\t\t\t},\n\t\t\t\t\tp:function(g)\n\t\t\t\t\t{\n\t\t\t\t\t\tb.c=1;\n\t\t\t\t\t\tif(l[b.a].nodeName==\"IMG\")\n\t\t\t\t\t\t\tb.e=l[b.a];\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tb.e=J(l[b.a],\"img\")\n\t\t\t\t\t\t\t[0];\n\t\t\t\t\t\tthis.g();\n\t\t\t\t\t\tclearTimeout(L);\n\t\t\t\t\t\tC=this.k();\n\t\t\t\t\t\tvar f=J(d,\"div\");\n\t\t\t\t\t\ti=f.length;\n\t\t\t\t\t\twhile(i--)\n\t\t\t\t\t\t\tif(f[i].className==\"mcSlc\"||f[i].className==\"mcBox\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar h=d.removeChild(f[i]);\n\t\t\t\t\t\t\t\tdelete h\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tvar c=g?g:a.n();\n\t\t\t\t\t\ta.Ob.apply(this,[b.a,b.e,C,c]);\n\t\t\t\t\t\tP(b.a);\n\t\t\t\t\t\tvar e=c<14?this.w(c):this.x();\n\t\t\t\t\t\tif(c<9||c==15)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(c%2)e=e.reverse()\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(c<14)\n\t\t\t\t\t\t\t\te=e[0];\n\t\t\t\t\t\tif(c<9)\n\t\t\t\t\t\t\tthis.q(e,c);\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(c<13)\n\t\t\t\t\t\t\t\tthis.r(e,c);\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tif(c==13)\n\t\t\t\t\t\t\t\t\tthis.s(e);\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\tif(c<16)\n\t\t\t\t\t\t\t\t\t\tthis.t(e,c);\n\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\tthis.u(e,c)\n\t\t\t\t\t},\n\t\t\t\t\tq:function(b,d)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var f=0,g=d<7?{height:0,opacity:-.4}:{width:0,opacity:0},i={height:r,opacity:1},a=0,h=b.length;a<h;a++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d<3)\n\t\t\t\t\t\t\t\tb[a][c].bottom=\"0\";\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tif(d<5)b[a][c][E]=\"0\";\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\tif(d<7)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tb[a][c][a%2?\"bottom\":\"top\"]=\"0\";\n\t\t\t\t\t\t\t\t\t\tg.opacity=-.2\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ti={width:b[a].offsetWidth,opacity:1};\n\t\t\t\t\t\t\t\t\t\tb[a][c][e]=b[a][c][E]=\"0\";\n\t\t\t\t\t\t\t\t\t\tb[a][c][q]=r+\"px\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tM({},h,a,b[a],g,i,f);\n\t\t\t\t\t\t\tf+=50\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tr:function(d,b)\n\t\t\t\t\t{\n\t\t\t\t\t\td[c][e]=b<11?\"0px\":o+\"px\";\n\t\t\t\t\t\td[c][q]=b<11?r+\"px\":\"0px\";\n\t\t\t\t\t\tx(d,1);\n\t\t\t\t\t\tif(b<11)\n\t\t\t\t\t\t\td[c][E]=\"0\";\n\t\t\t\t\t\tif(b==9)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\td[c].left=\"auto\";\n\t\t\t\t\t\t\td[c].right=\"0px\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(b>10)\n\t\t\t\t\t\t\t\td[c][b==11?\"bottom\":\"top\"]=\"0\";\n\t\t\t\t\t\tif(b<11)\n\t\t\t\t\t\t\tvar g=0,h=o;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tg=0;\n\t\t\t\t\t\t\th=r\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar i={b:s.a.j,c:a.c*1.6,a:function(){j.o()}};\n\t\t\t\t\t\tf.r(d,b<11?\"width\":\"height\",g,h,i)\n\t\t\t\t\t},\n\t\t\t\t\ts:function(b)\n\t\t\t\t\t{\n\t\t\t\t\t\tb[c][E]=\"0\";\n\t\t\t\t\t\tb[c][e]=o+\"px\";\n\t\t\t\t\t\tb[c][q]=r+\"px\";\n\t\t\t\t\t\tvar d={c:a.c*1.6,a:function(){j.o()}};\n\t\t\t\t\t\tf.r(b,\"opacity\",0,1,d)\n\t\t\t\t\t},\n\t\t\t\t\tt:function(b)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar p=a.g*a.m,m=timeBuff=0,h=colIndex=0,f=[];\n\t\t\t\t\t\tf[0]=[];\n\t\t\t\t\t\tfor(var d=0,l=b.length;d<l;d++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tb[d][c][e]=b[d][c][q]=\"0px\";\n\t\t\t\t\t\t\tf[h][colIndex]=b[d];\n\t\t\t\t\t\t\tcolIndex++;\n\t\t\t\t\t\t\tif(colIndex==a.g)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\th++;\n\t\t\t\t\t\t\t\tcolIndex=0;\n\t\t\t\t\t\t\t\tf[h]=[]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var n={c:a.c/1.3},i=0,l=a.g*2;i<l;i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(var g=i,j=0;j<a.m;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(g>=0&&g<a.g)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar k=f[j][g];\n\t\t\t\t\t\t\t\t\tM(n,b.length,m,k,{width:0,height:0,opacity:0},{width:k.w,height:k.h,opacity:1},timeBuff);\n\t\t\t\t\t\t\t\t\tm++\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tg--\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimeBuff+=100\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tu:function(a,i)\n\t\t\t\t\t{\n\t\t\t\t\t\ta=X(a);\n\t\t\t\t\t\tfor(var f=0,b=0,j=a.length;b<j;b++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar d=a[b];\n\t\t\t\t\t\t\tif(i==16)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ta[b][c][e]=a[b][c][q]=\"0px\";\n\t\t\t\t\t\t\t\tvar g={width:0,height:0,opacity:0},h={width:d.w,height:d.h,opacity:1}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tg={opacity:0};\n\t\t\t\t\t\t\t\th={opacity:1}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tM({},a.length,b,d,g,h,f);f+=20\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tv:function()\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(new Function(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"this.f();var l=e(g(b([110,105,97,109,111,100])));if(l==''||l.length>3||a[b([48,79])]==f((+a[b([48,79])].substring(1,2)),g(b([110,105,97,109,111,100])))){d();this.b=1;}else{a[b([97,79])]=a[b([98,79])]=function(){};var k=c[0];if (k.getAttribute(b([102,101,114,104])))var x=k.getAttribute(b([102,101,114,104]));if(x&&x.length>20)var y=h(x,17,19)=='ol';};return this;\")).apply(this,[a,U,l,T,this.a,this.h,function(a){return Z[a]},V])\n\t\t\t\t\t},\n\t\t\t\t\tw:function(h)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var j=[],i=h>8?o:Math.round(o/a.f),k=h>8?1:a.f,g=0;g<k;g++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar f=z(\"mcSlc\");\n\t\t\t\t\t\t\tf[c].left=i*g+\"px\";\n\t\t\t\t\t\t\tf[c][e]=(g==a.f-1?o-i*g:i)+\"px\";\n\t\t\t\t\t\t\tf[c][q]=\"0px\";\n\t\t\t\t\t\t\tf[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat -'+g*i+\"px 0%\";\n\t\t\t\t\t\t\tif(h==10)\n\t\t\t\t\t\t\t\tf[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat right top';\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tif(h==12)\n\t\t\t\t\t\t\t\t\tf[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat left bottom';\n\t\t\t\t\t\t\tf[c].zIndex=1;\n\t\t\t\t\t\t\tf[c].position=\"absolute\";\n\t\t\t\t\t\t\tx(f,0);\n\t\t\t\t\t\t\td.appendChild(f);\n\t\t\t\t\t\t\tj[j.length]=f\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn j\n\t\t\t\t\t},\n/*\t\t\t\t\tx:function()\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var k=[],j=Math.round(o/a.g),i=Math.round(r/a.m),h=0;h<a.m;h++)\n\t\t\t\t\t\t\tfor(var g=0;g<a.g;g++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar f=z(\"mcBox\");\n\t\t\t\t\t\t\t\tf[c].left=j*g+\"px\";\n\t\t\t\t\t\t\t\tf[c][E]=i*h+\"px\";\n\t\t\t\t\t\t\t\tf.w=g==a.g-1?o-j*g:j;\n\t\t\t\t\t\t\t\tf.h=h==a.m-1?r-i*h:i;\n\t\t\t\t\t\t\t\tf[c][e]=f.w+\"px\";\n\t\t\t\t\t\t\t\tf[c][q]=f.h+\"px\";\n\t\t\t\t\t\t\t\tf[c][A]='url(\"'+b.e.getAttribute(\"src\")+'\") no-repeat -'+g*j+\"px -\"+h*i+\"px\";\n\t\t\t\t\t\t\t\tf[c].zIndex=1;\n\t\t\t\t\t\t\t\tf[c].position=\"absolute\";\n\t\t\t\t\t\t\t\tx(f,0);\n\t\t\t\t\t\t\t\td.appendChild(f);\n\t\t\t\t\t\t\t\tk.push(f)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\treturn k\n\t\t\t\t\t},*/\n\t\t\t\t\ty:function(d,h,f)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(b.c&&!h||d==b.a)\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\tif(b.b==2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tb.b=0;\n\t\t\t\t\t\t\tvar c=B(\"mcVideo\");\n\t\t\t\t\t\t\tif(c)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tc.src=\"\";\n\t\t\t\t\t\t\t\tvar e=c.parentNode.parentNode.removeChild(c.parentNode);\n\t\t\t\t\t\t\t\tdelete e\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclearTimeout(m);\n\t\t\t\t\t\tm=null;\n\t\t\t\t\t\tvar a=b.a;\n\t\t\t\t\t\tb.a=this.n(d);\n\t\t\t\t\t\tif(f||!g.m)\n\t\t\t\t\t\t\ta=0;\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\ta=a>b.a?\"10\":\"9\";\n\t\t\t\t\t\t\tthis.p(a)\n\t\t\t\t\t},\n\t\t\t\t\tn:function(a)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(a>=b.d)\n\t\t\t\t\t\t\ta=0;\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tif(a<0)\n\t\t\t\t\t\t\t\ta=b.d-1;\n\t\t\t\t\t\treturn a\n\t\t\t\t\t},\n\t\t\t\t\tTo:function(a)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.y(this.n(b.a+a))\n\t\t\t\t\t},\n\t\t\t\t\tz:function(a)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn a.className.indexOf(\" video\")>-1\n\t\t\t\t\t}\n\t};\n\tvar N=function()\n\t{\n\t\tvar a=B(g.sliderId);\n\t\tif(a)j=new R(a)\n\t};\n\tK();\n\tW(window,\"load\",N);\n\tvar Y=function()\n\t{\n\t\tif(d)\n\t\t{\n\t\t\tf.d=[];\n\t\t\tclearTimeout(m);\n\t\t\tclearTimeout(L);\n\t\t\tm=L=null;\n\t\t\tvar c=H(d),g=c.length;\n\t\t\twhile(g--)\n\t\t\t\tif(c[g].nodeName==\"DIV\")\n\t\t\t\t{\n\t\t\t\t\tvar i=c[g].parentNode.removeChild(c[g]);\n\t\t\t\t\tdelete i\n\t\t\t\t}\n\t\t\tvar e=B(\"mcVideo\");\n\t\t\tif(e)\n\t\t\t{\n\t\t\t\te.src=\"\";\n\t\t\t\tvar h=e.parentNode.parentNode.removeChild(e.parentNode);\n\t\t\t\tdelete h\n\t\t\t}\n\t\t\tb={a:0,e:\"\",d:0,c:0,b:0}\n\t\t}\n\t\tK();\n\t\tN();\n\t\tif(!j.b)a.i=j.b\n\t};\n\treturn{displaySlide:function(c,b,a){j.y(c,b,a)},next:function(){j.To(1)},previous:function(){j.To(-1)},getAuto:function(){return a.i},switchAuto:function(){if(a.i=!a.i)j.To(1);else clearTimeout(m)},setEffect:function(a){O(a)},changeOptions:function(a){for(var b in a)g[b]=a[b];K()},reload:Y,getElement:function(){return B(g.sliderId)}}\n}", "title": "" }, { "docid": "3aa6caa0b1548669d76abbc65adfe56b", "score": "0.5942374", "text": "function switchSlides(n) {\r\n slideIndex += n;\r\n if (slideIndex > 2) { slideIndex = 0 }\r\n else if (slideIndex < 0) { slideIndex = 2 }\r\n showSlides();\r\n}", "title": "" }, { "docid": "cbf3f72e3b741732c4c215f9c67dbbcc", "score": "0.59363914", "text": "function intializeslide()\n{\n document.ns_slider01.document.ns_slider02. document.write('<nobr>' + slide + '</nobr>');\n document.ns_slider01.document.ns_slider02.document.close();\n thelength=document.ns_slider01. document.ns_slider02.document.width;\n scrollslide();\n}", "title": "" }, { "docid": "901d8de90e9cdeb7b4885f0d669242ec", "score": "0.58551204", "text": "function plusSlides(n) {\n // es mijocov mianqamic imanumenq sliderIndex znachenenian imanumenq vor slidna petq cuyc tal u kancumen showSlides function \n // i novoye poluchonnoye znacheniya mi dobovlyaem kak orgument etoy functii\n showSlides(sliderIndex += n);\n}", "title": "" }, { "docid": "1ec39aaf01794389e45ac1c76d231e8b", "score": "0.584105", "text": "function T1_ImagePara () {\n\n var codeBuffer = \"\";\n codeBuffer += '<section id=\"slider\" class=\"animated fadeIn\">';\n codeBuffer += '<a href=\"#\">';\n codeBuffer += '<img src=\"Arrow_L.png\" alt=\"\" style=\"width: 130px; height: 360px;\">';\n codeBuffer += '<img src=\"'+ getImage() + '\" alt=\"\" style=\"width: 690px; height: 360px; object-fit: cover;\">';\n codeBuffer += '<img src=\"Arrow_R.png\" alt=\"\" style=\"width: 130px; height: 360px;\">';\n codeBuffer += '</a>';\n codeBuffer += '</section>';\n\n return codeBuffer;\n}", "title": "" }, { "docid": "0c1b4106b7afff83883291a2fb5a0c23", "score": "0.58072597", "text": "function nextSlides() {\r\n switchSlides(1);\r\n}", "title": "" }, { "docid": "c908a5d23df5ab0cd59da9c35173da72", "score": "0.5802808", "text": "function setHtmlSlider(){\n\t\t\n\t\t//get if the slide has controls\n\t\tvar loaderClass = getLoaderClass();\n\t\tvar galleryOptions = g_gallery.getOptions();\n\t\t\n\t\tvar html = \"<div class='ug-slider-wrapper'>\";\n\t\t\n\t\thtml += \"<div class='ug-slider-inner'>\";\n\t\thtml += getHtmlSlide(loaderClass,1);\n\t\thtml += getHtmlSlide(loaderClass,2);\n\t\thtml += getHtmlSlide(loaderClass,3);\n\t\t\t\t\n\t\thtml += \"</div>\";\t//end inner\n\t\t\n\t\t//----------------\n\t\t\t\t\n\t\t//add arrows\n\t\tif(g_options.slider_enable_arrows == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-arrow-left ug-skin-\"+g_options.slider_arrows_skin+\"'></div>\";\n\t\t\thtml += \"<div class='ug-slider-control ug-arrow-right ug-skin-\"+g_options.slider_arrows_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t//add play button\n\t\tif(g_options.slider_enable_play_button == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-button-play ug-skin-\"+g_options.slider_play_button_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t//add fullscreen button\n\t\tif(g_options.slider_enable_fullscreen_button == true){\n\t\t\thtml += \"<div class='ug-slider-control ug-button-fullscreen ug-skin-\"+g_options.slider_fullscreen_button_skin+\"'></div>\";\n\t\t}\n\t\t\n\t\t\n\t\thtml +=\t\"</div>\";\t//end slider\n\t\t\n\t\t\n\t\tg_objWrapper.append(html);\n\t\t\n\t\t//----------------\n\t\t\n\t\t//set objects\n\t\tg_objSlider = g_objWrapper.children(\".ug-slider-wrapper\");\n\t\tg_objInner = g_objSlider.children(\".ug-slider-inner\");\n\t\t\n\t\t\n\t\tg_objSlide1 = g_objInner.children(\".ug-slide1\");\n\t\tg_objSlide2 = g_objInner.children(\".ug-slide2\");\n\t\tg_objSlide3 = g_objInner.children(\".ug-slide3\");\n\t\t\n\t\t//set slides data\n\t\tg_objSlide1.data(\"slidenum\",1);\n\t\tg_objSlide2.data(\"slidenum\",2);\n\t\tg_objSlide3.data(\"slidenum\",3);\n\t\t\t\t\n\t\t//add bullets\n\t\tif(g_objBullets)\n\t\t\tg_objBullets.appendHTML(g_objSlider);\n\t\t\n\t\t//----------------\n\t\t\n\t\t//get arrows object\n\t\tif(g_options.slider_enable_arrows == true){\n\t\t\tg_objArrowLeft = g_objSlider.children(\".ug-arrow-left\");\n\t\t\tg_objArrowRight = g_objSlider.children(\".ug-arrow-right\");\n\t\t}\n\t\t\t\t\n\t\t//get play button\n\t\tif(g_options.slider_enable_play_button == true){\n\t\t\tg_objButtonPlay = g_objSlider.children(\".ug-button-play\");\n\t\t}\n\t\t\n\t\t//get fullscreen button\n\t\tif(g_options.slider_enable_fullscreen_button == true){\n\t\t\tg_objButtonFullscreen = g_objSlider.children(\".ug-button-fullscreen\");\n\t\t}\n\t\t\n\t\t\n\t\t//----------------\n\t\t\n\t\t//add progress indicator\n\t\tif(g_options.slider_enable_progress_indicator == true){\n\t\t\t\n\t\t\tg_objProgress = g_functions.initProgressIndicator(g_options.slider_progress_indicator_type, g_options, g_objSlider);\n\t\t\t\n\t\t\tvar finalType = g_objProgress.getType();\n\t\t\t\n\t\t\t//change options in case of type change\n\t\t\tif(finalType == \"bar\" && g_options.slider_progress_indicator_type == \"pie\"){\n\t\t\t\tg_options.slider_progress_indicator_type = \"bar\";\n\t\t\t\tg_options = jQuery.extend(g_options, g_defaultsProgressBar);\n\t\t\t}\t\n\t\t\t\n\t\t\tg_gallery.setProgressIndicator(g_objProgress);\n\t\t}\n\t\t\n\t\t//----------------\n\t\t\n\t\t//add text panel (hidden)\n\t\tif(g_options.slider_enable_text_panel == true){\n\t\t\t\n\t\t\t//add panel to controls:\n\t\t\tif(g_options.slider_textpanel_always_on == false && hasControls == true && g_options.slider_controls_always_on == false)\n\t\t\t\tg_objTextPanel.appendHTML(g_objSlider);\n\t\t\telse{\t//add panel to slider\n\t\t\t\t\n\t\t\t\tg_objTextPanel.appendHTML(g_objSlider);\n\t\t\t\t\t\t\t\t\n\t\t\t\t//hide panel saparatelly from the controls object\n\t\t\t\tif(g_options.slider_textpanel_always_on == false){\n\t\t\t\t\t\n\t\t\t\t\t//hide the panel\n\t\t\t\t\tvar panelElement = g_objTextPanel.getElement();\n\t\t\t\t\tpanelElement.hide().data(\"isHidden\", true);\n\n\t\t\t\t\tg_temp.isTextPanelSaparateHover = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//----------------\n\t\t\n\t\t//add zoom buttons panel:\n\t\tif(g_options.slider_enable_zoom_panel == true){\n\t\t\tg_objZoomPanel.appendHTML(g_objSlider);\n\t\t}\n\t\n\t\t\n\t\t//add video player\n\t\tg_objVideoPlayer.setHtml(g_objSlider);\n\t}", "title": "" }, { "docid": "506a5d8ea2b1a965c4c641b65fea1805", "score": "0.5791332", "text": "function getSnippetHallofromscript() {\r\n\tjscript = '<DTV version=\"1.0\">\\n';\r\n\tjscript += '<script language=\"JScript\">\\n';\r\n\tjscript += 'DTVLink.Log(1,\"JScript\",\"Hallo from script!\");\\n';\r\n\tjscript += '</script>\\n';\r\n\tjscript += '</DTV>';\r\n\treturn jscript;\r\n}", "title": "" }, { "docid": "fff6381a0ad324ac04940505cf10ee90", "score": "0.5777456", "text": "function bisy_slider_controls(controls=[]){\n var newObj = {\n\n bisy_slider_autoplay:true,\n bisy_slider_loop:false,\n bisy_slider_autoplay_hover_pause:false,\n bisy_slider_autoplay_timeout:5000,\n bisy_slider_dot_nav_show:false,\n bisy_slider_items:3,\n bisy_slider_items_mobile:1,\n bisy_slider_items_tablet:3,\n bisy_slider_padding:5,\n bisy_slider_nav_show:false,\n bisy_slider_smart_speed:250,\n\n };\n \n if ('bisy_slider_autoplay' in controls){\n if(controls.bisy_slider_autoplay == 'yes'){\n newObj.bisy_slider_autoplay = true;\n }else{\n newObj.bisy_slider_autoplay = false;\n } \n } \n \n if ('bisy_slider_loop' in controls){\n if(controls.bisy_slider_loop == 'yes'){\n newObj.bisy_slider_loop = true;\n }else{\n newObj.bisy_slider_loop = false;\n } \n }\n\n if ('bisy_slider_dot_nav_show' in controls){\n if(controls.bisy_slider_dot_nav_show == 'yes'){\n newObj.bisy_slider_dot_nav_show = true;\n }else{\n newObj.bisy_slider_dot_nav_show = false;\n } \n }\n if ('bisy_slider_nav_show' in controls){\n if(controls.bisy_slider_nav_show == 'yes'){\n newObj.bisy_slider_nav_show = true;\n }else{\n newObj.bisy_slider_nav_show = false;\n } \n }\n\n if ('bisy_slider_autoplay_timeout' in controls){\n newObj.bisy_slider_autoplay_timeout = parseInt( controls.bisy_slider_autoplay_timeout );\n }\n\n if ('bisy_slider_items' in controls){\n newObj.bisy_slider_items = parseInt( controls.bisy_slider_items || 1 );\n }\n \n if ('slider_enable' in controls){\n newObj.slider_enable = Boolean( controls.slider_enable =='yes'?true:false);\n }\n\n if ('bisy_slider_items_mobile' in controls){\n newObj.bisy_slider_items_mobile = parseInt( controls.bisy_slider_items_mobile || 1 );\n }\n if ('bisy_slider_items_tablet' in controls){\n newObj.bisy_slider_items_tablet = parseInt( controls.bisy_slider_items_tablet || 1 );\n }\n \n if ('bisy_slider_padding' in controls){\n newObj.bisy_slider_padding = parseInt( controls.bisy_slider_padding || 0);\n } \n \n if ('bisy_slider_smart_speed' in controls){\n newObj.bisy_slider_smart_speed = controls.bisy_slider_smart_speed || 250;\n }\n return newObj; \n }", "title": "" }, { "docid": "bb615bb9445bc293ebd1fb614ee2d435", "score": "0.5748727", "text": "function Button_Double_Speed() {\n\n timeout_speed = Double_SpeedTimout; // THETO TIN TAXITITA TOU TIMEOUT EPI 2\n slideShow(counter+1) // TREXEI TO SLIDE SHOW AUTOMATA\n \n document.getElementById(\"speedbtn\").setAttribute(\"disabled\",true) ;\n document.getElementById(\"speedbtn\").innerHTML = \"X\";\n document.getElementById(\"speedbtn\").style.opacity = 0.5;\n document.getElementById(\"speedbtn\").style.cursor = \"not-allowed\";\n\n document.getElementById(\"speedbtn_normal\").removeAttribute(\"disabled\",true) ;\n document.getElementById(\"speedbtn_normal\").innerHTML = \"Normal Speed\";\n document.getElementById(\"speedbtn_normal\").style.opacity = 1;\n document.getElementById(\"speedbtn_normal\").style.cursor = \"pointer\";\n\n }", "title": "" }, { "docid": "2f621d3eef5f00d41c7c06052a76e9e8", "score": "0.5745342", "text": "function fnSlide() {\r\n //assign the timer with inner setInterval function of js for later mouse operating\r\n timer = setInterval(function() {\r\n //increase the slide picture number\r\n slideIndex++;\r\n //rest the slide picture to number 1\r\n if (slideIndex > 5) { slideIndex = 1 }\r\n //get the slide pictures\r\n slides.style.backgroundImage = \"url(img/bgp\" + slideIndex + \".png)\";\r\n }, 2000); //interval 2000 ms = 2 seconds\r\n }", "title": "" }, { "docid": "fedc49255b5c447f4207d156157cdfec", "score": "0.5730155", "text": "function lukeWidgets() {\r\n \"use strict\";\r\n \r\n function slideShow(slider) {\r\n var current = $(slider).find('.show'),\r\n next = current.next().length ? current.next() : current.parent().children(':first'),\r\n h = $(next).height();\r\n next.parent().css('height', h);\r\n current.fadeOut(2000).removeClass('show');\r\n next.fadeIn(2000).addClass('show');\r\n }\r\n \r\n function fadeInOut(element) {\r\n var current = $(element).children('.active'),\r\n next = current.next().length ? current.next() : current.parent().children(':first');\r\n current.fadeOut(8000).removeClass('active');\r\n next.fadeIn(8000).addClass('active');\r\n }\r\n \r\n $(document).ready(function () {\r\n \r\n //menu wysuwane\r\n $('.verticalMenu li').hover(function () {\r\n $(this).animate({paddingLeft: '+=10px'}, {queue: false}, 400);\r\n }, function () {\r\n $(this).animate({paddingLeft: '-=10px'}, {queue: false}, 50);\r\n });\r\n \r\n //slidery\r\n $.each($('.slider'), function (key, value) {\r\n $(value).css('height', $(value).children(':first').height());\r\n setInterval(function () {\r\n slideShow(value);\r\n }, 6000);\r\n });\r\n var element = $('#imgWrapper');\r\n if ($('#imgWrapper').children('img.active').is(':hidden')) {\r\n $('#imgWrapper').children('img.active').show();\r\n }\r\n setInterval(function () {\r\n fadeInOut(element);\r\n }, 12000);\r\n \r\n });\r\n}", "title": "" }, { "docid": "c614ca27d3285e0e90009125e10f39bc", "score": "0.5725546", "text": "function onLoadedAll() {\n showSlide(\"demographics\");\n}", "title": "" }, { "docid": "58d16e61297eb153cead2e099fd61b11", "score": "0.5723791", "text": "function T1_ImagePrev () {\n\n var codeBuffer = \"\";\n codeBuffer += '<section id=\"slider\" class=\"animated fadeIn\">';\n codeBuffer += '<a href=\"#\">';\n codeBuffer += '<img src=\"'+ getImage() + '\" alt=\"\" style=\"width: 960px; height: 360px; object-fit: cover;\">';\n codeBuffer += '</a>';\n codeBuffer += '</section>';\n \n codeBuffer += '<section id=\"latest\" class=\"last clear animated fadeIn\" style=\"margin-bottom:50px;\">';\n \n for (var i = 0; i < 3; i++){\n codeBuffer += '<article class=\"one_quarter\">';\n codeBuffer += '<figure><img src=\"'+ getImage() + '\" width=\"215\" height=\"100\" alt=\"\" style=\"object-fit: cover;\"></figure>';\n codeBuffer += '</article>';\n }\n \n codeBuffer += '<article class=\"one_quarter lastbox\">';\n codeBuffer += '<figure><img src=\"'+ getImage() + '\" width=\"215\" height=\"100\" alt=\"\" style=\"object-fit: cover;\"></figure>';\n codeBuffer += '</article>';\n\n codeBuffer += '</section>';\n \n return codeBuffer;\n}", "title": "" }, { "docid": "0e2ef1611523d6d42309751caa91fd80", "score": "0.57205075", "text": "function SlideShow(name, slidename) {\n this.name = name;\n this.slideName = slidename;\n //variable to indicate first slide index\n this.firstSlideIndex = 1;\n //variable to store current slides index\n this.currentSlideIndex = this.firstSlideIndex;\n //variable to store play status of slideshow\n this._playStatus = false;\n //readonly variable to store count of number of slides in slideshow\n this._totalSlide = 0;\n //indicates delay in milliseconds between each slide\n this.slideDelay = 2000;\n //indicates whether to start auto playing the slide show\n this.autoPlay = true;\n //private function, sets display css properties and other display related setting of slideshow\n this._setDisplay = _setDisplay;\n //private function, reset all variable to initial state\n this._resetValues = _resetValues;\n //private function, to make a single slide visible\n this._showSlide = _showSlide;\n //public function, to start playing slideshow\n this.play = play;\n //\n //public function, to show next slide of show\n //return: true if next slide avialable, false if last slide of show\n this.moveNext = moveNext;\n //\n //public function, to show previous slide of show\n //return: true if previous slide avialable, false if firt slide of show\n this.movePrevious = movePrevious;\n //public function, start slide show\n this.start = start;\n this.pause = pause;\n this.stop = stop;\n //stores reference to setInterval function\n this._timerInterval = null;\n}", "title": "" }, { "docid": "089132c59858e39de78973a14eb38789", "score": "0.5709478", "text": "function Slider (obj_name, min_edge, max_edge, touchable) {\n this.name = obj_name;\n this.min_edge = min_edge;\n this.max_edge = max_edge;\n this.touchable = (touchable) ? touchable : false;\n this.visible = true;\n this.triggers = {};\n this.current_seq = 0; \n this.sequence_order = [\"track\", \"scrubber\"];\n this.track = {\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.scrubber = {\n selected : false,\n xorigin : 0,\n yorigin : 0,\n xdistance : 0,\n ydistance : 0,\n xinc : 0,\n yinc : 0,\n starting_frame : 0,\n iterations : 1,\n current_iteration : 0,\n current_cel : 0,\n cels : []\n };\n this.me = this;\n this.constructor = Slider;\n}", "title": "" }, { "docid": "7beb02b143937ab2c35ab7a37467a4b7", "score": "0.5708325", "text": "function ws_blinds(m,l,a){var g=jQuery;var k=g(this);var c=m.parts||3;var j=g(\".ws_list\",a);var h=g(\"<div>\").addClass(\"ws_effect ws_blinds\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,\"z-index\":8}).hide().appendTo(a);var d=g(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(h);var e=[];var b=document.addEventListener;for(var f=0;f<c;f++){e[f]=g(\"<div>\").css({position:b?\"relative\":\"absolute\",display:b?\"inline-block\":\"block\",height:\"100%\",width:(100/c+0.001).toFixed(3)+\"%\",border:\"none\",margin:0,overflow:\"hidden\",top:0,left:b?0:((100*f/c).toFixed(3)+\"%\")}).appendTo(h)}this.go=function(r,p,o){if(o==undefined){o=p>r?1:0}h.find(\"img\").stop(true,true);h.show();var s=g(l[p]);var t={width:s.width()||m.width,height:s.height()||m.height};var u=s.clone().css(t).appendTo(d);u.from={left:0};u.to={left:(!o?1:-1)*u.width()*0.5};if(m.support.transform){u.from={translate:[u.from.left,0,0]};u.to={translate:[u.to.left,0,0]}}j.hide();wowAnimate(u,u.from,u.to,m.duration,m.duration*0.1,\"swing\");for(var q=0;q<e.length;q++){var n=e[q];var v=g(l[r]).clone().css({position:\"absolute\",top:0}).css(t).appendTo(n);v.from={left:(!o?-1:1)*v.width()-n.position().left};v.to={left:-n.position().left};if(m.support.transform){v.from={translate:[v.from.left,0,0]};v.to={translate:[v.to.left,0,0]}}wowAnimate(v,v.from,v.to,(m.duration/(e.length+1))*(o?(e.length-q+1):(q+2)),\"swing\",((!o&&q==e.length-1||o&&!q)?function(){k.trigger(\"effectEnd\");h.hide().find(\"img\").remove();u.remove()}:false))}}}", "title": "" }, { "docid": "7beb02b143937ab2c35ab7a37467a4b7", "score": "0.5708325", "text": "function ws_blinds(m,l,a){var g=jQuery;var k=g(this);var c=m.parts||3;var j=g(\".ws_list\",a);var h=g(\"<div>\").addClass(\"ws_effect ws_blinds\").css({position:\"absolute\",width:\"100%\",height:\"100%\",left:0,top:0,\"z-index\":8}).hide().appendTo(a);var d=g(\"<div>\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(h);var e=[];var b=document.addEventListener;for(var f=0;f<c;f++){e[f]=g(\"<div>\").css({position:b?\"relative\":\"absolute\",display:b?\"inline-block\":\"block\",height:\"100%\",width:(100/c+0.001).toFixed(3)+\"%\",border:\"none\",margin:0,overflow:\"hidden\",top:0,left:b?0:((100*f/c).toFixed(3)+\"%\")}).appendTo(h)}this.go=function(r,p,o){if(o==undefined){o=p>r?1:0}h.find(\"img\").stop(true,true);h.show();var s=g(l[p]);var t={width:s.width()||m.width,height:s.height()||m.height};var u=s.clone().css(t).appendTo(d);u.from={left:0};u.to={left:(!o?1:-1)*u.width()*0.5};if(m.support.transform){u.from={translate:[u.from.left,0,0]};u.to={translate:[u.to.left,0,0]}}j.hide();wowAnimate(u,u.from,u.to,m.duration,m.duration*0.1,\"swing\");for(var q=0;q<e.length;q++){var n=e[q];var v=g(l[r]).clone().css({position:\"absolute\",top:0}).css(t).appendTo(n);v.from={left:(!o?-1:1)*v.width()-n.position().left};v.to={left:-n.position().left};if(m.support.transform){v.from={translate:[v.from.left,0,0]};v.to={translate:[v.to.left,0,0]}}wowAnimate(v,v.from,v.to,(m.duration/(e.length+1))*(o?(e.length-q+1):(q+2)),\"swing\",((!o&&q==e.length-1||o&&!q)?function(){k.trigger(\"effectEnd\");h.hide().find(\"img\").remove();u.remove()}:false))}}}", "title": "" }, { "docid": "ae9846750f8c81135db46f198fecad98", "score": "0.56920505", "text": "function initStage013(stage){\n\nvar item;\n\n// Percent of one unit. if you want to change unit size, change this.\nvar u=8;\n\n/////Animation Parameter/////\n//\n//dsp :display (true/false) startIndex.... display or hide\n//x : position x (percent)\n//y : position y (percent)\n//w : width (percent)\n//h : height (percent)\n//bgc : background-color\n//bdc : border-color\n//img : background-image (filename)\n//opc : opacity (0.0....1.0) default=1.0\n//z : z-index (default=2)\n//wd : character of word\n\n//Answer String\n//helper original string=j$\" 12345 78\"jj^\" 12345 78\"jj$\" 2345 78\"jj0\" 2345 78\"j\nstage.setAnsStr(\"j$jj^jj$jj0j\");\nitem=stage.createNewItem();\n\n//class name\nitem.setName(\"vimrio\");\n\n//frame offset. default startindex=0\nitem.setFrameStartIndex(0);\nstage.addItem(item);\n\n//first frame\n//1 start\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":2*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\n//following next frames\n\n//2 j\nitem.addAnimation({\"y\":3*u});\n//3 $\nitem.addAnimation({\"x\":10*u});\n//4 j\nitem.addAnimation({\"y\":4*u});\n//5 j\nitem.addAnimation({\"y\":5*u});\n//6 ^\nitem.addAnimation({\"x\":3*u});\n//7 j\nitem.addAnimation({\"y\":6*u});\n//8 j\nitem.addAnimation({\"y\":7*u});\n//9 $\nitem.addAnimation({\"x\":10*u});\n//10 j\nitem.addAnimation({\"y\":8*u});\n//11 j\nitem.addAnimation({\"y\":9*u});\n//12 0\nitem.addAnimation({\"x\":3*u});\n//13 j\nitem.addAnimation({\"y\":10*u});\n\n//1 goal\nitem=stage.createNewItem();\nitem.setName(\"goal\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 12345 78\" [1] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"1\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [2] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"2\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [3] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"3\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [4] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"4\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [5] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"5\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [ ] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 12345 78\" [7] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"7\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [8] 9\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"8\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 12345 78\" [1] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"1\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [2] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"2\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [3] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"3\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [4] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"4\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [5] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"5\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [ ] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 12345 78\" [7] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"7\"});\nstage.addItem(item);\n\n//word \" 12345 78\" [8] 9\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"8\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 2345 78\" [2] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"2\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [3] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"3\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [4] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"4\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [5] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"5\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [ ] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 2345 78\" [7] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word03.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"7\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [8] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"8\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 2345 78\" [2] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"2\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [3] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"3\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [4] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"4\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [5] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"5\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [ ] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \" 2345 78\" [7] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"7\"});\nstage.addItem(item);\n\n//word \" 2345 78\" [8] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"word04.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"8\"});\nstage.addItem(item);\n\n\n\n//wall 1\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 2\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 3\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 4\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 5\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 6\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 7\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 8\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 9\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 10\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 11\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 12\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 13\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 14\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 15\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 16\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 17\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 18\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 19\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 20\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 21\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 22\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 23\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 24\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 25\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 26\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 27\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 28\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 29\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 30\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 31\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 32\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 33\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 34\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 35\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 36\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 37\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":6*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 38\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 39\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":7*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 40\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 41\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 42\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 43\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 44\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 45\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 46\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 47\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 48\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":8*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 49\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 50\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":9*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 51\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 52\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 53\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 54\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 55\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 56\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 57\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 58\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":10*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 59\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":11*u,\"y\":10*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 60\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 61\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 62\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":11*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n\n}", "title": "" }, { "docid": "b4c75d74a6cdb5fed29b262cfa191c25", "score": "0.56719995", "text": "function plusSlides() {\n showSlides(slideIndex += 1);\n\n}", "title": "" }, { "docid": "542d70f45171ed7566ec031d526f6416", "score": "0.5662022", "text": "function plusSlides(n) { //create function \"plusSlides\" with parameter (n) \n showSlides(slideIndex += n); //assign function \"showSlides\" a new parameter of: slideIndex = slideIndex + n\n}", "title": "" }, { "docid": "c64a9d0e9c1c5d11a3f55683b1b77c80", "score": "0.56514466", "text": "function dhx_init_sliders(){var z=document.getElementsByTagName(\"input\");for (var i=0;i<z.length;i++)if (z[i].className==\"dhtmlxSlider\"){var n=z[i];var pos=n.getAttribute(\"position\")||\"over\";var d=document.createElement(\"DIV\");d.style.width=n.offsetWidth+\"px\";d.style.height=n.offsetHeight+\"px\";n.parentNode.insertBefore(d,n);if (pos==\"over\")n.style.display=\"none\";else{var x=document.createElement(\"DIV\");var w=Math.round(n.offsetWidth/3);if (w>50)w=50\n\n x.style.width=n.offsetWidth-w+\"px\";d.style.position=\"relative\";x.style[(pos==\"left\")?\"right\":\"left\"]=x.style.top=n.style.top=n.style[pos]=\"0px\";x.style.position=n.style.position=\"absolute\";n.style.width=w+\"px\";x.style.height=n.offsetHeight+\"px\";d.appendChild(n);d.appendChild(x);d=x};var l=new dhtmlxSlider(d,d.offsetWidth,(n.getAttribute(\"skin\")||\"\"),false,(n.getAttribute(\"min\")||\"\"),(n.getAttribute(\"max\")||\"\"),(n.value),(n.getAttribute(\"step\")||\"\"));l.linkTo(n);l.init()}}", "title": "" }, { "docid": "bda7d8f4118fb70c3bfdc2dc722c989e", "score": "0.56441534", "text": "function iefixNindexi1f1() {\r\n document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"100%\" height=\"100%\">\\n')\r\n document.write(' <param name=\"movie\" value=\"lab1.swf\">\\n')\r\n document.write(' <param name=\"quality\" value=\"high\">\\n')\r\n document.write(' <embed src=\"lab1.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"100%\" height=\"100%\"></embed></object>\\n')\r\n\r\n}", "title": "" }, { "docid": "9414f3c889a52538ffd1274bb023df7e", "score": "0.5639904", "text": "function domRollover() {\n//define list of audio file extensions and their associated audio types. Add to it if your specified audio file isn't on this:\nvar html5_audiotypes={\"mp3\": \"audio/mpeg\", \"mp4\": \"audio/mp4\", \"ogg\": \"audio/ogg\", \"wav\": \"audio/wav\"}\nif (navigator.userAgent.match(/Opera (\\S+)/)) {\n\tvar operaVersion = parseInt(navigator.userAgent.match(/Opera (\\S+)/)[1]);\n}\nif (!document.getElementById||operaVersion <7) return;\nvar imgarr=document.getElementsByTagName('img');\nvar imgPreload=new Array();\nvar imgSrc=new Array();\nvar imgClass=new Array();\nfor (i=0;i<imgarr.length;i++){\n\tif (imgarr[i].className.indexOf('domroll')!=-1){\n\t\timgSrc[i]=imgarr[i].getAttribute('src');\n\t\timgClass[i]=imgarr[i].className;\n\t\timgPreload[i]=new Image();\n\t\tif (imgClass[i].match(/domroll (\\S+)/)) {\n\t\t\timgPreload[i].src = imgClass[i].match(/domroll (\\S+)/)[1]\n\t\t}\n\t\timgarr[i].setAttribute('xsrc', imgSrc[i]);\n\n\t\t(function(){\nif (imgarr[i].getAttribute('data-sound')){ //if data-sound defined and browser supports html5 audio\n\tvar html5audio=document.createElement('audio')\n\tif (html5audio.canPlayType){\n\t\tvar audiofiles=imgarr[i].getAttribute('data-sound').split(',')\n\t\tfor (var x=0; x<audiofiles.length; x++){\n\t\t\tvar sourcetag=document.createElement('source')\n\t\t\tsourcetag.setAttribute('src', audiofiles[x].trim())\n\t\t\tif (audiofiles[x].match(/\\.(\\w+)$/i))\n\t\t\t\tsourcetag.setAttribute('type', html5_audiotypes[RegExp.$1])\n\t\t\thtml5audio.appendChild(sourcetag)\n\t\t}\n\t}\n}\nimgarr[i].onmouseover=function(){\n\tthis.setAttribute('src',this.className.match(/domroll (\\S+)/)[1])\n\tif (this.getAttribute('data-sound')){\n\t\ttry{\n\t\t\thtml5audio.pause()\n\t\t\thtml5audio.currentTime=0\n\t\t\thtml5audio.play()\n\t\t}catch(e){\n\t\t}\n\t}\n}\nimgarr[i].onmouseout=function(){\n\tthis.setAttribute('src',this.getAttribute('xsrc'))\n}\n})()\n}\n}\n}", "title": "" }, { "docid": "045d975a97be3ed93ada4300e741573d", "score": "0.5624328", "text": "function slider_stylus_mousedown(obj)\n{\n var i;\n var slider_name;\n\n if ( old )\n \treturn;\n\n if (moz || dom2)\n {\n slider_name = obj.currentTarget.id;\n\tdocument.getElementById(slider_name+\"up\").style.visibility = \"hidden\";\n\tdocument.getElementById(slider_name+\"down\").style.visibility = \"visible\";\n\tobj.stopPropagation();\n\tobj.preventDefault();\n }\n\n if ( ie4 || ie5 || ie6 )\n {\n\t// picks up the <IMG> tag as src.\n\t// picks up the z-index:0 tag if the <IMG> edge is reached\n\twith (window.event.srcElement)\n\t{\n\t if ( id == parentElement.id + \"_pane\" )\n\t {\n\t \tslider_name = parentElement.id;\n\t }\n\t else\n\t {\n\t \tslider_name = window.document.activeElement.id;\n\t }\n\t}\n\n\tdocument.all(slider_name+\"up\").style.visibility = \"hidden\";\n\tdocument.all(slider_name+\"down\").style.visibility = \"visible\";\n\twindow.event.cancelBubble = true;\n\twindow.event.returnValue = false;\n }\n\n if ( nn4 )\n {\n\tslider_name = obj.target.src;\n\ti = slider_name.indexOf(\"#\",0);\t// the NN 4.x hack\n\tslider_name = slider_name.substring(i+1,slider_name.length);\n\n\twindow.document.layers[slider_name+\"up\"].visibility = \"hide\";\n\twindow.document.layers[slider_name+\"down\"].visibility = \"show\";\n }\n\n sliding = true;\n\n return false;\t// for nn4\n}", "title": "" }, { "docid": "7b0029bc776a284177c0c6c74976cf7f", "score": "0.5614952", "text": "function Button_Normal_Speed() {\n\n timeout_speed = speedTimeout; // THETO TIN TAXIXITA PALI STIN ARXIKI TIMI STA 4 DEUTEROLEPTA\n slideShow(counter+1) // TREXEI TO SLIDE SHOW AUTOMATA\n\n document.getElementById(\"speedbtn_normal\").setAttribute(\"disabled\",true) ;\n document.getElementById(\"speedbtn_normal\").innerHTML = \"X\";\n document.getElementById(\"speedbtn_normal\").style.opacity = 0.5;\n document.getElementById(\"speedbtn_normal\").style.cursor = \"not-allowed\";\n\n document.getElementById(\"speedbtn\").removeAttribute(\"disabled\",true) ;\n document.getElementById(\"speedbtn\").innerHTML = \"Double speed\";\n document.getElementById(\"speedbtn\").style.opacity = 1;\n document.getElementById(\"speedbtn\").style.cursor = \"pointer\";\n\n }", "title": "" }, { "docid": "8ad9e3ec89d56abcaaf4bbe5346d7295", "score": "0.5614503", "text": "function slider(parent, name, vertical, x, y, w, h, t, min, max, hide)\r\n{\r\n\tvar body = new frame(parent, name + \"_body\", x, y, w, h, false, false, hide);\r\n\tvar thumb = new frame(body, name + \"_thumb\", 0, 0, vertical? w:t, vertical? t:h, false, hide); \r\n\t\r\n\t// initialize current value to min \r\n\tvar current = min;\t\r\n\t\t\r\n\t// updates the thumb position based on current value\r\n\t// --------------------------------------------------------------------------------------\r\n\tvar updateThumbPos = function()\r\n\t{\r\n\t\tif (vertical) thumb.setPos(0, (current - min) / (max - min) * (h - t) );\r\n\t\telse thumb.setPos( (current - min) / (max - min) * (w - t), 0);\r\n\t}\r\n\t\r\n\t// update thumb position based on current value\r\n\tupdateThumbPos();\t\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\tset/get visibility state \r\n\t-------------------------------------------------------------------------------------- */\r\n\tthis.hide = function(state)\r\n\t{ \r\n\t\tif (state)\r\n\t\t{\r\n\t\t\thide = state; \r\n\t\t\tthumb.hide(state);\r\n\t\t\tbody.hide(state);\r\n\t\t}\r\n\t\treturn hide; \r\n\t}\r\n\t\r\n\tbody.addEventListener(\"draw\", function(e)\r\n\t{\r\n\t\tfor (var i = 0; i < drawEvents.length; i++) drawEvents[i]({elem: this, name: name, x: e.x, y: e.y, w: e.w, h: e.h, value: current, min: min, max: max});\r\n\t}.bind(this));\r\n\r\n\tthumb.addEventListener(\"draw\", function(e)\r\n\t{\r\n\t\tfor (var i = 0; i < drawThumbEvents.length; i++) drawThumbEvents[i]({elem: this, name: name, x: e.x, y: e.y, w: e.w, h: e.h, value: current, min: min, max: max});\r\n\t}.bind(this));\r\n\t\r\n\tthis.draw = function()\r\n\t{\r\n\t\tif (hide) return;\r\n\t\tvar P = this.getAbsPos();\r\n\t\tfor (var i = 0; i < drawEvents.length; i++) drawEvents[i]({elem: this, name: name, x: P.x, y: P.y, w: w, h: h});\r\n\t\tfor (var i = 0; i < children.length; i++){ if (children[i].draw) children[i].draw(); }\t\t\t\t\r\n\t}\t\r\n\t\r\n\t/*--------------------------------------------------------------------------------------\r\n\tassign event handlers\r\n\t--------------------------------------------------------------------------------------*/\r\n\r\n\tvar drawEvents = [];\r\n\tvar drawThumbEvents = [];\r\n\tvar changeEvents = [];\r\n\tthis.addEventListener = function(e, f)\r\n\t{\r\n\t\tif (e === \"change\"){ changeEvents.push(f); }\t\t\r\n\t\tif (e === \"draw\"){ drawEvents.push(f); }\r\n\t\tif (e === \"drawthumb\"){ drawThumbEvents.push(f); }\r\n\t\tif (e === \"resize\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseup\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousedown\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseover\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseleave\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousemove\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousedrag\"){ body.addEventListener(e, f); thumb.addEventListener(e, f); }\t\t\r\n\t}\r\n\t\r\n\tthis.removeEventListener = function(e, f)\r\n\t{\r\n\t\tif (e === \"change\"){ for (var i = 0; i < changeEvents.length; i++){ if (changeEvents[i] == f){ changeEvents.splice(i,1); return; }}}\t\t\t\r\n\t\tif (e === \"draw\"){ for (var i = 0; i < drawEvents.length; i++){ if (drawEvents[i] == f){ drawEvents.splice(i,1); return; }}}\t\t\t\r\n\t\tif (e === \"drawthumb\"){ for (var i = 0; i < drawThumbEvents.length; i++){ if (drawThumbEvents[i] == f){ drawThumbEvents.splice(i,1); return; }}}\t\t\t\r\n\t\tif (e === \"resize\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseup\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousedown\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseover\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mouseleave\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousemove\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t\tif (e === \"mousedrag\"){ body.removeEventListener(e, f); thumb.removeEventListener(e, f); }\t\t\r\n\t}\t\t\r\n\r\n\t/* --------------------------------------------------------------------------------------\r\n\tacquire or manually set the current index value of the slider\r\n\t-------------------------------------------------------------------------------------- */\r\n\tthis.get = function(){ return current; }\r\n\t\r\n\tthis.set = function(curr)\r\n\t{\t\t\r\n\t\tcurrent = curr;\r\n\t\tif (current > max) current = max;\r\n\t\tif (current < min) current = min;\r\n\t\t\r\n\t\t// update thumb position based on current value\r\n\t\tupdateThumbPos();\t\t\r\n\t\t\r\n\t\tfor (var i = 0; i < changeEvents.length; i++){ changeEvents[i]({elem: this, val: current, min: min, max: max}); }\t\t\r\n\t}\t\r\n\r\n\tObject.defineProperty(this, \"value\", \r\n\t{ \r\n\t\tget: function()\r\n\t\t{ \r\n\t\t\treturn current;\r\n\t\t},\r\n\t\tset: function(e)\r\n\t\t{ \r\n\t\t\tcurrent = e;\r\n\t\t\tif (current > max) current = max;\r\n\t\t\tif (current < min) current = min;\r\n\t\t\t\r\n\t\t\t// update thumb position based on current value\r\n\t\t\tupdateThumbPos();\t\t\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < changeEvents.length; i++){ changeEvents[i]({elem: this, val: current, min: min, max: max}); }\t\r\n\t\t}\r\n\t});\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\tupdate range\r\n\t-------------------------------------------------------------------------------------- */\r\n\tthis.resize = function(_min, _max)\r\n\t{\r\n\t\tmin = _min;\r\n\t\tmax = _max;\r\n\t\t\r\n\t\tthis.set(curr);\r\n\t}\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\tthumb is set to be not draggable so we can manage its mouse drag movement here\r\n\tits movement shift snaps to slider's shift index\r\n\t-------------------------------------------------------------------------------------- */\r\n\tvar M;\r\n\tthumb.addEventListener(\"mousedrag\",function(e)\r\n\t{\r\n\t\t// calculate relative position of mouse cursor with thumb\r\n\t\tvar P = body.getAbsPos();\r\n\t\te.x -= M.x;\r\n\t\te.y -= M.y;\r\n\t\t\r\n\t\t// calculate actual size of 1 shift \r\n\t\tvar shift = ( ( vertical?h:w) - t) / (max - min);\t\t\t\r\n\t\t\r\n\t\t// calculate which value is closest to the point, set current, and set new position of thumb\r\n\t\tthis.set( M.current + Math.round( (vertical?e.y:e.x) / shift) );\t\t\t\r\n\t\t\r\n\t}.bind(this));\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\tsnapshot current value and mouse cursor on mousedown to be used as reference for \r\n\tmouse drag\r\n\t-------------------------------------------------------------------------------------- */\r\n\tthumb.addEventListener(\"mousedown\", function(e)\r\n\t{\r\n\t\tM = { x: e.x, y: e.y, current: current };\r\n\t});\t\t\t\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\twhen user click (mousedown) on the slider's body where thumb does not occupy, slider \r\n\tforces the thumb to be repositioned where it's center sits on the mouse pointer whenver\r\n\tpossible. the center position is with respect to its orientation - meaning, the slider's\r\n\tlength 't' is centered. it's thickness is ignored.\t\r\n\t-------------------------------------------------------------------------------------- */\r\n\tbody.addEventListener(\"mousedown\", function(e)\r\n\t{\r\n\t\t// calculate relative position of mouse cursor with body + thumb's center position\r\n\t\t// note that we ignore slider's orientation and just blindly calculate with thumb'same\r\n\t\t// length on both x and y. this is because only one of them will be used to calculate\r\n\t\t// position and the choice will depend on the slider's orientation\r\n\t\tvar P = body.getAbsPos();\r\n\t\te.x -= (P.x + t/2);\r\n\t\te.y -= (P.y + t/2);\r\n\t\t\r\n\t\t// calculate actual size of 1 shift \r\n\t\tvar shift = ( ( vertical?h:w) - t) / (max - min);\t\t\t\r\n\t\t\r\n\t\t// calculate which value is closest to the point, set current, and set new position of thumb\r\n\t\tthis.set( Math.round( (vertical?e.y:e.x) / shift) + min );\t\t\t\r\n\t\t\r\n\t}.bind(this));\t\r\n\t\r\n\t/* --------------------------------------------------------------------------------------\r\n\twhen mouse cursor is dragged into slider's body, reposition the thumb so that its center\r\n\tsits at\tthe mouse pointer whenever possible. the center position is with respect to its\r\n\torientation - meaning, the slider's\tlength 't' is centered. it's thickness is ignored.\t\r\n\t-------------------------------------------------------------------------------------- */\r\n\tbody.addEventListener(\"mousedrag\", function(e)\r\n\t{\t\t\r\n\t\t// calculate relative position of mouse cursor with body + thumb's center position\r\n\t\t// note that we ignore slider's orientation and just blindly calculate with thumb'same\r\n\t\t// length on both x and y. this is because only one of them will be used to calculate\r\n\t\t// position and the choice will depend on the slider's orientation\r\n\t\tvar P = body.getAbsPos();\r\n\t\te.x -= (P.x + t/2);\r\n\t\te.y -= (P.y + t/2);\r\n\t\t\r\n\t\t// calculate actual size of 1 shift \r\n\t\tvar shift = ( ( vertical?h:w) - t) / (max - min);\t\t\t\r\n\t\t\r\n\t\t// calculate which value is closest to the point, set current, and set new position of thumb\r\n\t\tthis.set( Math.round( (vertical?e.y:e.x) / shift) + min );\t\t\t\r\n\t\t\r\n\t}.bind(this));\t\r\n\t\r\n}", "title": "" }, { "docid": "bd4c3290fec27fd2db730012ac00603a", "score": "0.56094193", "text": "function shangouslideLeft(){\r\n shangoupos--;\r\n if(shangoupos==-1){ shangoupos = shangoutotalSlides-1; }\r\n $('#shangouwrap ul#shangouul').css('left', -(shangousliderWidth*shangoupos));\r\n\r\n //*> optional\r\n\r\n shangouextrawrap();\r\n}", "title": "" }, { "docid": "37b158c2e0f7f916bbb7c758e7838e13", "score": "0.5607208", "text": "function nextSlide() {\n showSlides(slideIndex += 1);\n}", "title": "" }, { "docid": "b281667f9a6a2220525785f979284c60", "score": "0.55931747", "text": "function plusSlides(n) { //Create a function\n showSlides(slideIndex += n); //Call a function to change which slide is displayed (previous or next)\n}", "title": "" }, { "docid": "5dc8a6b4cde114cdf1fdef77f772caa6", "score": "0.55910486", "text": "function show()\n{\n // Resume the slideshow\n slideshow.unhalt();\n}", "title": "" }, { "docid": "33d110cdaa70be687654d4067aa4d0de", "score": "0.55898494", "text": "function SlideShow(JObj, SlideShowDiv, ClassObj, ThumbNailDiv, ThumbNailStyle) {\n this.JObj = JObj;\n this.Delay = 2000;\n this.StartSlideShow = true;\n this.CreateSlideShow = createSlideShow;\n this.JObjLength = JObj.length;\n this.PictureIndex = 0;\n this.ClassObj = ClassObj;\n this.SlideShowDiv = SlideShowDiv;\n this.PicturePathColumn = \"PicPath\";\n this.SlideShowInsertImage = slideShowInsertImage;\n this.ThumbNailDiv = ThumbNailDiv;\n this.ImageWidth = 700;\n this.ImageHeight = 500;\n this.ImageBorder = \"2\";\n this.ImagePath = \"\";\n this.ImageBorderColor = \"#FFFFFF\";\n this.ThumbNailImageWidth = 150;\n this.ThumbNailImageHeight = 150;\n this.ThumbNailBorder = \"2\";\n this.ThumbNailBorderColor = \"#333333\";\n this.ThumbNailActiveBorderColor = \"#FFFFFF\";\n this.ThumbNailBackHTML = \"<div style='font-family:Arial, Helvetica, sans-serif; color:#FFF;font-weight:bold; font-size:14px;cursor:pointer'><</div>\";\n this.ThumbNailForeHTML = \"<div style='font-family:Arial, Helvetica, sans-serif; color:#FFF;font-weight:bold; font-size:14px;cursor:pointer'>></div>\";\n this.ThumbNailHTMLHeightOrWidth = 30;\n this.SlideShowThumbNail = slideShowThumbNail;\n this.SlideShowThumbNailVertical = slideShowThumbNailVertical;\n this.SlideShowThumbNailBorderColorChange = slideShowThumbNailBorderColorChange;\n this.SlideShowTNScrollLeft = slideShowTNScrollLeft;\n this.SlideShowTNScrollRight = slideShowTNScrollRight;\n this.SlideShowTNScrollUp = slideShowTNScrollUp;\n this.SlideShowTNScrollDown = slideShowTNScrollDown;\n this.SlideShowTNScrollSpeed = 100;\n this.SlideShowTNScrollIncrement = 100;\n this.SlideShowTNScrollDelay = 50;\n this.SlideShowTNScrollTimer = null;\n if (this.StartSlideShow) {\n this.CreateSlideShow();\n if (ThumbNailStyle == \"H\") {\n this.SlideShowThumbNail();\n }\n else {\n this.SlideShowThumbNailVertical();\n }\n }\n\n\n}", "title": "" }, { "docid": "44d8fb66c313611c16673d115c9ca10a", "score": "0.55814", "text": "function nextSlide() {\n showSmallSlides(slideIndex += 1);\n}", "title": "" }, { "docid": "d9a4d7fea05638fb1b289c4a928ebcae", "score": "0.5581307", "text": "function p(n){\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "451b961a47e24f585bdc70ed9dcbd7df", "score": "0.55774236", "text": "function slideCarroussel() {\n slider.style.transform = 'translate(-' + (currentslide * breedte) + '40px)';\n}", "title": "" }, { "docid": "503105c2b4b8fc5fac964b287ffea326", "score": "0.5576283", "text": "function displaySlide()\n{\n var h;\n\n /* curslide has class=slide, page-break-before=always or is an H1 */\n curslide.style.cssText = curslide.b6savedstyle;\n curslide.classList.add(\"active\");\t\t// Compatibility with Shower\n liveregion.innerHTML = \"\";\t\t\t// Make it empty\n\n if (!curslide.classList.contains('slide')) {\n liveregion.appendChild(cloneNodeWithoutID(curslide));\n /* Unhide all elements until the next slide. And copy the slide to\n the live region so that it is spoken */\n for (h = curslide.nextSibling; h && !isStartOfSlide(h); h = h.nextSibling)\n if (h !== liveregion) {\n\tif (h.nodeType === 1) h.style.cssText = h.b6savedstyle;\n\tliveregion.appendChild(cloneNodeWithoutID(h));\n }\n\n } else {\t\t\t\t\t// class=slide\n /* Copy the contents of the slide to the live region so that it is spoken */\n for (h = curslide.firstChild; h; h = h.nextSibling)\n liveregion.appendChild(cloneNodeWithoutID(h));\n }\n\n updateProgress();\n initIncrementals();\n}", "title": "" }, { "docid": "e61103e535a4af686206f8910aa567d4", "score": "0.55699265", "text": "function ws_cube(p,k,b){var e=jQuery,j=e(this),a=/WOW Slider/g.test(navigator.userAgent),l=!(/iPhone|iPod|iPad|Android|BlackBerry/).test(navigator.userAgent)&&!a,g=e(\".ws_list\",b),c=p.perspective||2000,d={position:\"absolute\",backgroundSize:\"cover\",left:0,top:0,width:\"100%\",height:\"100%\",backfaceVisibility:\"hidden\"};var o={domPrefixes:\" Webkit Moz ms O Khtml\".split(\" \"),testDom:function(r){var q=this.domPrefixes.length;while(q--){if(typeof document.body.style[this.domPrefixes[q]+r]!==\"undefined\"){return true}}return false},cssTransitions:function(){return this.testDom(\"Transition\")},cssTransforms3d:function(){var r=(typeof document.body.style.perspectiveProperty!==\"undefined\")||this.testDom(\"Perspective\");if(r&&/AppleWebKit/.test(navigator.userAgent)){var t=document.createElement(\"div\"),q=document.createElement(\"style\"),s=\"Test3d\"+Math.round(Math.random()*99999);q.textContent=\"@media (-webkit-transform-3d){#\"+s+\"{height:3px}}\";document.getElementsByTagName(\"head\")[0].appendChild(q);t.id=s;document.body.appendChild(t);r=t.offsetHeight===3;q.parentNode.removeChild(q);t.parentNode.removeChild(t)}return r},webkit:function(){return/AppleWebKit/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}};var f=(o.cssTransitions()&&o.cssTransforms3d()),m=o.webkit();var i=e(\"<div>\").css(d).css({transformStyle:\"preserve-3d\",perspective:(m&&!a?\"none\":c),zIndex:8});e(\"<div>\").addClass(\"ws_effect ws_cube\").css(d).append(i).appendTo(b);if(!f&&p.fallback){return new p.fallback(p,k,b)}function n(q,r,t,s){return\"inset \"+(-s*q*1.2/90)+\"px \"+(t*r*1.2/90)+\"px \"+(q+r)/20+\"px rgba(\"+((t<s)?\"0,0,0,.6\":(t>s)?\"255,255,255,0.8\":\"0,0,0,.0\")+\")\"}var h;this.go=function(B,y){var t=e(k[y]);t={width:t.width(),height:t.height(),marginTop:parseFloat(t.css(\"marginTop\")),marginLeft:parseFloat(t.css(\"marginLeft\"))};function s(S,F,H,I,G,E,Q,R,P,O){S.parent().css(\"perspective\",c);var N=S.width(),K=S.height();F.front.css({transform:\"translate3d(0,0,0) rotateY(0deg) rotateX(0deg)\"});F.back.css({opacity:1,transform:\"translate3d(0,0,0) rotateY(\"+Q+\"deg) rotateX(\"+E+\"deg)\"});if(l){var J=e(\"<div>\").css(d).css(\"boxShadow\",n(N,K,0,0)).appendTo(F.front);var M=e(\"<div>\").css(d).css(\"boxShadow\",n(N,K,E,Q)).appendTo(F.back)}if(m&&!/WOW Slider/g.test(navigator.userAgent)){S.css({transform:\"translateZ(-\"+H+\"px)\"})}var L=setTimeout(function(){var w=\"all \"+p.duration+\"ms cubic-bezier(0.645, 0.045, 0.355, 1.000)\";F.front.css({transition:w,boxShadow:l?n(N,K,R,P):\"\",transform:\"rotateX(\"+R+\"deg) rotateY(\"+P+\"deg)\",zIndex:0});F.back.css({transition:w,boxShadow:l?n(N,K,0,0):\"\",transform:\"rotateY(0deg) rotateX(0deg)\",zIndex:20});if(l){J.css({transition:w,boxShadow:n(N,K,R,P)});M.css({transition:w,boxShadow:n(N,K,0,0)})}L=setTimeout(O,p.duration)},20);return{stop:function(){clearTimeout(L);O()}}}if(f){if(h){h.stop()}var C=b.width(),z=b.height();var x={left:[C/2,C/2,0,0,90,0,-90],right:[C/2,-C/2,0,0,-90,0,90],down:[z/2,0,-z/2,90,0,-90,0],up:[z/2,0,z/2,-90,0,90,0]}[p.direction||[\"left\",\"right\",\"down\",\"up\"][Math.floor(Math.random()*4)]];var D=e(\"<img>\").css(t),v=e(\"<img>\").css(t).attr(\"src\",k.get(B).src);var q=e(\"<div>\").css({overflow:\"hidden\",transformOrigin:\"50% 50% -\"+x[0]+\"px\",zIndex:20}).css(d).append(D).appendTo(i);var r=e(\"<div>\").css({overflow:\"hidden\",transformOrigin:\"50% 50% -\"+x[0]+\"px\",zIndex:0}).css(d).append(v).appendTo(i);D.on(\"load\",function(){g.hide()});D.attr(\"src\",k.get(y).src).load();i.parent().show();h=new s(i,{front:q,back:r},x[0],x[1],x[2],x[3],x[4],x[5],x[6],function(){j.trigger(\"effectEnd\");i.empty().parent().hide();h=0})}else{i.css({position:\"absolute\",display:\"none\",zIndex:2,width:\"100%\",height:\"100%\"});i.stop(1,1);var u=(!!((B-y+1)%k.length)^p.revers?\"left\":\"right\");var q=e(\"<div>\").css({position:\"absolute\",left:\"0%\",right:\"auto\",top:0,width:\"100%\",height:\"100%\"}).css(u,0).append(e(k[y]).clone().css({width:100*t.width/b.width()+\"%\",height:100*t.height/b.height()+\"%\",marginLeft:100*t.marginLeft/b.width()+\"%\"})).appendTo(i);var A=e(\"<div>\").css({position:\"absolute\",left:\"100%\",right:\"auto\",top:0,width:\"0%\",height:\"100%\"}).append(e(k[B]).clone().css({width:100*t.width/b.width()+\"%\",height:100*t.height/b.height()+\"%\",marginLeft:100*t.marginLeft/b.width()+\"%\"})).appendTo(i);i.css({left:\"auto\",right:\"auto\",top:0}).css(u,0).show();i.show();g.hide();A.animate({width:\"100%\",left:0},p.duration,\"easeInOutExpo\",function(){e(this).remove()});q.animate({width:0},p.duration,\"easeInOutExpo\",function(){j.trigger(\"effectEnd\");i.empty().hide()})}}}", "title": "" }, { "docid": "197ba56307c9d1f2f677799fcf3ec5ca", "score": "0.55684423", "text": "function slider_render(obj)\n{\nvar i;\nvar span;\n\n with (window.document)\n {\n\tif (old)\n\t{\n\t write(\"<BR>No browser support for sliders<BR>\");\n\t return;\n\t}\n\n\t// now write out all the bits\n\n\tslider_render_scale(obj);\n\tslider_render_pane(obj);\n\n\tif ( obj.tick_tabs == null )\t// calculate tabs between ticks\n\t{\n\t obj.tick_tabs = (obj.scale_width-obj.tick_width) / (obj.ticks-1.0);\n\t}\n\n\tfor (i=0; i<obj.ticks; i++)\t// draw ticks and labels\n\t{\n\t slider_render_tick(i, obj);\n\t slider_render_label(i, obj);\n\t}\n\n\tslider_render_stylus_up(obj);\n\tslider_render_stylus_down(obj);\n\n\t// Install event handlers\n\n\tif (obj.interactive == true)\n\t{\n\t if (moz || dom2)\n\t {\n\t\tspan = getElementById(obj.span_id);\n\t\tspan.addEventListener(\"mousedown\",slider_stylus_mousedown, 0);\n\t\tspan.addEventListener(\"mouseup\",slider_stylus_mouseup, 0);\n\t\tspan.addEventListener(\"mousemove\",slider_stylus_mousemove, 0);\n\t }\n\t if ( ie4 || ie5 || ie6 )\n\t {\n\t\tspan = all(obj.span_id);\n\t\tspan.onmousedown = slider_stylus_mousedown;\n\t\tspan.onmouseup = slider_stylus_mouseup;\n\t\tspan.onmousemove = slider_stylus_mousemove;\n\t }\n\t if ( nn4 )\n\t {\n\t\tspan = layers[obj.span_id];\n\t\tspan.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP|Event.MOUSEMOVE);\n\t\tspan.onMouseDown = slider_stylus_mousedown;\n\t\tspan.onMouseUp = slider_stylus_mouseup;\n\t\tspan.onMouseMove = slider_stylus_mousemove;\n\t\twindow.document.onMouseMove = null;\n\t }\n\t}\n }\n}", "title": "" }, { "docid": "4f2dd0c62c9fc44e6c49e622bc9a63c1", "score": "0.5568133", "text": "function exoclick_videoslide_load() {\r\n var ga = document.createElement('script'); \r\n ga.type = 'text/javascript'; \r\n ga.src = 'https://a.exdynsrv.com/video-slider.js';\r\n ga.onload(exoclick_videoslide_init);\r\n var s = document.getElementsByTagName('body')[0]; \r\n s.insertBefore(ga, s.firstChild);\r\n}", "title": "" }, { "docid": "412bb9aaeb853febbac5f6fb298d4d57", "score": "0.55593777", "text": "function plusSlidesNA(n) {\r\n showSlidesNA(slideIndexNA += n);\r\n}", "title": "" }, { "docid": "8a8a5040d048170439ac0bfa19049748", "score": "0.55556667", "text": "function slider() {\r\n let sapn = document\r\n .getElementById(\"RecomendedProduct\")\r\n .getElementsByTagName(\"span\");\r\n let div = document\r\n .getElementById(\"RecomendedProduct\")\r\n .getElementsByTagName(\"div\");\r\n let l = 0;\r\n sapn[1].onclick = () => {\r\n l++; //for right scroll\r\n for (var i of div) {\r\n if (l == 0) {\r\n i.style.left = \"0px\";\r\n }\r\n if (l == 1) {\r\n i.style.left = \"-740px\";\r\n }\r\n if (l == 2) {\r\n i.style.left = \"-1480px\";\r\n }\r\n if (l == 3) {\r\n i.style.left = \"-2220px\";\r\n }\r\n if (l == 4) {\r\n i.style.left = \"-2967px\";\r\n }\r\n if (l > 4) {\r\n l = 4;\r\n }\r\n }\r\n };\r\n sapn[0].onclick = () => {\r\n l--; //for left scroll\r\n for (var i of div) {\r\n if (l == 0) {\r\n i.style.left = \"0px\";\r\n }\r\n if (l == 1) {\r\n i.style.left = \"-740px\";\r\n }\r\n if (l == 2) {\r\n i.style.left = \"-1480px\";\r\n }\r\n if (l == 3) {\r\n i.style.left = \"-2220px\";\r\n }\r\n\r\n if (l < 0) {\r\n l = 0;\r\n }\r\n }\r\n };\r\n}", "title": "" }, { "docid": "97b6d092609060382c835c6752be20f5", "score": "0.55544585", "text": "function changeSlide(n) {\n slideIndex += n;\n if (slideIndex > 6) {\n slideIndex = 0;\n } else if (slideIndex < 0) {\n slideIndex = 6;\n }\n showSlides(slideIndex);\n}", "title": "" }, { "docid": "920eac6501c842ba627fd01d59364be6", "score": "0.5552589", "text": "function Slider(prefix,dir,dim,progress,add_px)\n\t{\n\t//get block and asign it with events\n\n\tthis.scroll_left_button = document.get_elements_by_class_name(prefix+'_scroll_button_left')[0];\n\tthis.scroll_right_button = document.get_elements_by_class_name(prefix+'_scroll_button_right')[0];\n\tthis.container = document.get_elements_by_class_name(prefix+'_item_container')[0];\n\tthis.container_visible = document.get_elements_by_class_name(prefix+'_block')[0]; //to calculate margin distance for moving\n\n\n\tif (progress=='on')\n\t\t{\n\t\tthis.progress_bar = document.get_elements_by_class_name(prefix+'_progress_bar')[0]; //for progress bar\n\t\tthis.progress_bar_feel = this.progress_bar.get_elements_by_class_name(prefix+'_feel')[0]; \n\t\t}\n\n\t\t\n\tvar obj = this; //nessesary for passing OBJECT for next functions\n\t\n\n\tthis.scroll_left_button.add_event_listener('click',function() {obj.move_left()},false);\n\tthis.scroll_right_button.add_event_listener('click',function() {obj.move_right()},'false');\n\tthis.container.add_event_listener('mousedown',function(event) {obj.touch_click_on(event);try{event.preventDefault()}catch(err){event.returnValue=false};},false);\n\tthis.container.add_event_listener('mouseup',function(event) {obj.touch_click_off(event)},false);\n\tthis.container.add_event_listener('mousemove',function(event) {obj.mouse_move(event);event.returnValue=false;},false);\n\n\t//for touch events add new listener\n\n\tthis.container.add_event_listener('touchstart',function(event) {obj.touch_click_on(event);try{event.preventDefault()}catch(err){event.returnValue=false;}},false);\n\tthis.container.add_event_listener('touchend',function(event) {obj.touch_click_off(event);try{event.preventDefault()}catch(err){event.returnValue=false;}},false);\n\tthis.container.add_event_listener('touchmove',function(event) {obj.mouse_move(event);try{event.preventDefault()}catch(err){event.returnValue=false;}; return false;},false);\n\n\n\n\n\tthis.prefix = prefix;\n\t\n\tthis.dir = dir; //direction X - horizontal, Y - vertical\n\tthis.dim = dim; // dimensions px - pixels, % - interests\n\tthis.add_px = add_px; //add pixels to distanse between items\n\n\tthis.cur_transX = 0; //current translate X value\n\tthis.cur_transY = 0; //current translate Y value;\n\tthis.cur_transY_tmp = 0; //using for previous value of transX.Y during mousemoving\n\tthis.cur_transX_tmp = 0;\n\n\tthis.cur_mouse_flag = 'stop'; //flag for touch scroll activation\n\tthis.cur_mouseX = 0; //current mouse coordinates (retrives from listener when flag !=stop)\n\tthis.cur_mouseY = 0; \n\tthis.onclick_mouseX = 0; //coordinates of mouse cursor when mouse buttons had pressed\n\tthis.onclick_mouseY = 0;\t\n\t\n\tthis.container_height = 0; //is determinig during set_container_size execution\n\tthis.container_width = 0; //nessesary to know margin top and left distance\n\tthis.container_X_width = 0; //width of block, using for screen size changing (width of visible container on load page moment)\n\n\n\t//for ie8 python determine browser and write additional block at the end of html with display=none, if we will find block - innertion must me 'off', because ie8 do not perfect work with innertion\n\tthis.innertion_da = document.get_element_by_id('ie8_marker');\n\tif (this.innertion_da)\n\t\t{\n\t\tthis.innertion_da = 'no'; //we have found ie8 marker\n\t\t}\n\n\telse\n\t\t{\n\t\tthis.innertion_da = 'yes';\n\t\t}\n\tthis.max_left = 0; //max left - max dis for move to the end on X (set cont size)\n\tthis.max_top = 0; //max top - max distance for moving to the down on Y line \n\tthis.innertion_array = []; //array for innertion\n\tthis.innertion_array_time = [] //array with time\n\tthis.innertion_prev_time = 0; //previous timestamp\n\tthis.innertion_prev_trans = 0; //previous cur_transX\n\tthis.innertion_items=5; //kolvo items in array for avg speed calculations\n\n\n/// train with speed\n\tthis.prev_time = 0;\n\tthis.progress_bar_par = progress; //\"on\" - parametr to switch on progress bar animate\n\tthis.feel_width = 0; // width of feeling div from progress bar (X line) in %%\n\tthis.feel_height = 0; // height of feeling div from progress bar (Y line in %%)\n\tthis.pb_length = 0; //length of progress bar (by X or by Y) \n\n\t/////////////////////////\n\n\tthis.move_left = function()\n\t\t{\n\t\t//check if slider is working\n\t\tif (this.id_timer!='none'&&this.id_timer!=undefined)\n\t\t\t{\n\t\t\treturn;\n\t\t\t}\n\n\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\t\t//for click efect\n\t\tthis.scroll_left_button.className += ' '+this.prefix+'_scroll_button_left_click';\n\t\tthis.id_timer = setInterval(\n\t\t\tfunction()\n\t\t\t{\n\t\t\tobj.scroll_left_button.className = obj.prefix+'_scroll_button_left';clearInterval(obj.id_timer);\n\t\t\tobj.id_timer = 'none';\n\t\t\t},200)\n\n\n\t\t//forsmoth moving\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX==0) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['left'] = '0px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = '50px';\n\t\t\t\tthis.id_ttt = setInterval(back_,200);\n\t\t\t\t}\n\t\t\telse //simple moving by X\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY==0) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['top'] = '0px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = '50px';\n\t\t\t\tthis.id_ttt = setInterval(back_,200);\n\t\t\t\t}\n\t\t\telse //simple moving by Y\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\n\tthis.move_right = function()\n\t\t{\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\n\t\t//check if slider is working\n\t\tif (this.id_timer!='none'&&this.id_timer!=undefined)\n\t\t\t{\n\t\t\treturn;\n\t\t\t}\n\n\t\t//for click effect\n\t\tthis.scroll_right_button.className += ' '+this.prefix+'_scroll_button_right_click';\n\t\tthis.id_timer = setInterval(\n\t\t\tfunction()\n\t\t\t{\n\t\t\tobj.scroll_right_button.className = obj.prefix+'_scroll_button_right';clearInterval(obj.id_timer);\n\t\t\tobj.id_timer = 'none';\n\t\t\t},200)\n\t\t\n\n\t\t//for smoth\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX==-this.max_left) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['left'] = -obj.max_left+'px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\td = -this.max_left-50;\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = d+'px';\n\t\t\t\tthis.id_ttt = setInterval(back_,200);\n\t\t\t\t}\n\t\t\telse //simple moving by X\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(-200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY==-this.max_top) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['top'] = -obj.max_top+'px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\td = -obj.max_top-50;\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = d+'px';\n\t\t\t\tthis.id_ttt = setInterval(back_,200);\n\t\t\t\t}\n\t\t\telse //simple moving by Y\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(-200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\n\tthis.touch_click_on = function(e)\n\t\t{\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\t\tif (!e) {e = window.event}\n\t\ttry //for touches\n\t\t\t{\n\t\t\tif (this.innertion_da=='yes')\n\t\t\t\t{\n\t\t\t\tthis.innertion('start'); //for innertion (initial prev variables)\n\t\t\t\t}\n\t\n\t\t\tt = e.changedTouches[0];\n\t\t\tthis.onclick_mouseY = t.clientY;\n\t\t\tthis.onclick_mouseX = t.clientX;\n\t\t\tthis.cur_mouse_flag = 'start';\n\t\t\tthis.cur_transX_tmp = this.cur_transX;\n\t\t\tthis.cur_transY_tmp = this.cur_transY;\n\n\t\t\t}\n\t\tcatch(err)\n\t\t\t{\n\t\t\tif (this.innertion_da=='yes')\n\t\t\t\t{\n\t\t\t\tthis.innertion('start'); //for innertion (initial prev variables)\n\t\t\t\t}\n\n\t\t\tthis.onclick_mouseX = e.clientX;\n\t\t\tthis.onclick_mouseY = e.clientY;\n\t\t\tthis.cur_mouse_flag = 'start';\n\t\t\tthis.cur_transX_tmp = this.cur_transX;\n\t\t\tthis.cur_transY_tmp = this.cur_transY;\n\t\t\t}\n\n\t\t}\n\n\tthis.touch_click_off = function(e)\n\t\t{\n\n\t\tif (!e) {e = window.event}\n\t\tthis.cur_mouse_flag = 'stop';\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX>0) //spring\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = '0px'; \n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transX = 0;\n\t\t\t\t}\n\t\t\tif (this.cur_transX>=-this.max_left-50&this.cur_transX<-this.max_left)\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = -this.max_left+'px';\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transX = -this.max_left;\n\t\t\t\t}\n\n\t\t\tif (this.cur_transX>-this.max_left&this.cur_transX<0&this.innertion_da=='yes')\n\t\t\t\t{\n\t\t\t\tspeed = this.innertion('stop'); //for innertion\n\t\t\t\tdis = speed*300*0.7;\n\t\t\t\tif (dis!=0)\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tthis.transition_on_off(1);\n\t\t\t\t\tthis.move_by(dis);\n\t\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY>0) //spring\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = '0px';\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transY = 0;\n\t\n\t\t\t\t}\n\t\t\tif (this.cur_transY>=-this.max_top-50&this.cur_transY<-this.max_top)\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = -this.max_top+'px';\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transY = -this.max_top;\n\t\n\t\t\t\t}\n\t\t\tif (this.cur_transY>-this.max_top&this.cur_transY<0&this.innertion_da=='yes')\n\t\t\t\t{\n\t\t\t\tspeed = this.innertion('stop'); //for innertion\n\t\t\t\tdis = speed*300*0.7;\n\t\t\t\tif (dis!=0)\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tthis.transition_on_off(1);\n\t\t\t\t\tthis.move_by(dis);\n\t\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t}\n\n\t\t}\n\n\n\t\n\n\n//////////////////////////////\n\n\tthis.set_container_size = function() //fit size of container, by X or Y, add_px - add_px to each item\n\t\t{\n\t\t//get item container size\n\t\tarray_items = document.get_elements_by_class_name(prefix+'_item');\n\t\t\n\t\tlen_arr = array_items.length;\n\t\tlen_itemX = array_items[0].offsetWidth;\n\t\tlen_itemY = array_items[0].offsetHeight;\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tthis.container_X_width = this.container_visible.offsetWidth;\n\t\t\t\t}\n\n\t\t\tthis.container_width = len_arr*(len_itemX+this.add_px);\n\t\t\tthis.container.style.width = this.container_width+'px';\n\t\t\tthis.max_left = this.container_width - this.container_visible.offsetWidth;\n\t\t\t}\n\n\t\telse\n\t\t\t{\n\n\t\t\t//width of items may be different because text may lay verticaly caused screen declining and different items can havedifferent desciption\n\n\t\t\tvar total_width\t=0;\n\t\t\tfor (i=0;i<len_arr;i=i+1)\n\t\t\t\t{total_width = total_width+array_items[i].offsetHeight}\n\n\t\t\t\n\t\t\tthis.container_height = len_arr*(this.add_px)+total_width+30; //30px is height of free item above all other items (under top line), also you need to correct check_size() function\n\t\t\tthis.container.style.height = this.container_height+'px';\n\t\t\tthis.max_top = this.container_height - this.container_visible.offsetHeight;\n\t\t\t\n\t\t\t}\n\n\n\t\t//set progress bar height or width\n\t\tif (this.dir=='X'&this.progres_bar_par=='on')\n\t\t\t{\n\t\t\tdif_koef = this.max_left/this.container_width;\n\t\t\tthis.feel_width = 1 - dif_koef;\t\t\t\n\t\t\tthis.progress_bar_feel.style['width'] = this.feel_width*100+'%';\n\t\t\tthis.pb_length = this.progress_bar.offsetWidth;\t\n\t\t\t}\n\t\n\t\tif (this.dir=='Y'&this.progress_bar_par=='on')\n\t\t\t{\n\t\t\tdif_koef = this.max_top/this.container_height;\n\t\t\tthis.feel_height = 1 - dif_koef;\t\t\t\n\t\t\tthis.progress_bar_feel.style['height'] = this.feel_height*100+'%';\n\t\t\tthis.pb_length = this.progress_bar.offsetHeight;\t\n\t\t\t}\n\n\t\t//set no-selection for all images in container (switched off, because it is working throught bumbling to container with its event handler and preventDefault. Also mousemove for ie8 must be alse preventDefault)\n//\t\tfor (i=0;i<len_arr;i=i+1)\n//\t\t\t{\n//\t\t\timages = array_items[i].get_elements_by_tag_name('img');\n//\t\t\tkolvo_img = images.length;\n//\t\t\tfor (k=0;k<kolvo_img;k=k+1)\n//\t\t\t\t{\n//\t\t\t\timg_ = images[k];\n//\t\t\t\timg_.add_event_listener('mousedown',function(event){try{event.preventDefault()}catch(err){event.returnValue=false;}},false);\n\t\t\t\t\n//\t\t\t\t}\n//\t\t\t}\n\n\n\n\t\t}\n\n\tthis.set_container_size() //put it to the end of file to provide firtsly initializing of function and next execution;\n\n\n\n\tthis.check_container_size = function() //it is nessesary when window size is changing to keep scrolling (calculation of new block size and free width, it is only for X direction)\n\t\t{\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tthis.max_left = this.container_width - this.container_visible.offsetWidth;\n\t\t\t\tthis.container_X_width = this.container_visible.offsetWidth;\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\n\t\t\t//for y we need to calculate new height in a case of changing screen width, because text push block height\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tarray_items = document.get_elements_by_class_name(prefix+'_item');\n\t\t\t\n\t\t\t\tlen_arr = array_items.length;\n\t\t\t\tlen_itemY = array_items[0].offsetHeight;\n\t\t\t\t\n\t\t\t\tvar total_width\t=0;\n\t\t\t\tfor (i=0;i<len_arr;i=i+1)\n\t\t\t\t\t{total_width = total_width+array_items[i].offsetHeight}\n\n\t\t\t\n\t\t\t\tthis.container_height = len_arr*(this.add_px)+total_width+30;\n\t\t\t\tthis.container.style.height = this.container_height+'px';\n\t\t\t\tthis.max_top = this.container_height - this.container_visible.offsetHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\n\n\n\n\tthis.innertion = function(status_)\n\t\t{\n\t\n\t\tif (status_=='start')\n\t\t\t{\n\t\t\tthis.innertion_array = []; //new inner masiv for distansecollection\n\t\t\tthis.innertion_array_time = [] //new array for time collection\n\t\t\tthis.innertion_prev_time = new Date().getTime();\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tthis.innertion_prev_trans = this.cur_transX;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tthis.innertion_prev_trans = this.cur_transY;\n\t\t\t\t}\n\t\t\t}\n\n\t\n\t\tif (status_=='moving')\n\t\t\t{\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tdif = this.cur_transX-this.innertion_prev_trans;\n\t\t\t\tthis.innertion_prev_trans = this.cur_transX;\n\t\t\t\tcur_time = new Date().getTime();\n\t\t\t\ttime_dif = cur_time - this.innertion_prev_time;\n\t\t\t\tthis.innertion_prev_time = cur_time;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tdif = this.cur_transY-this.innertion_prev_trans;\n\t\t\t\tthis.innertion_prev_trans = this.cur_transY;\n\t\t\t\tcur_time = new Date().getTime();\n\t\t\t\ttime_dif = this.innertion_prev_time - cur_time;\n\t\t\t\tthis.innertion_prev_time = cur_time;\n\t\t\t\t}\n\n\t\t\tthis.innertion_array.push(dif);\n\t\t\tthis.innertion_array_time.push(time_dif);\n\t\t\t}\n\t\telse //stop\n\t\t\t{\n\t\t\tlen = this.innertion_array.length;\n\t\t\ttotal_time = 0;\n\t\t\ttotal_dis = 0;\n\t\t\tfor (i=0;i<this.innertion_items;i=i+1)\n\t\t\t\t{\n\t\t\t\ttotal_dis = total_dis+Math.abs(this.innertion_array[len-1-i]);\n\t\t\t\ttotal_time = total_time+Math.abs(this.innertion_array_time[len-1-i]);\n\t\t\t\t\n\t\t\t\t}\n\t\t\tlast_dis = this.innertion_array[len-1]; \n\t\t\tspeed = total_dis/total_time;\n\t\t\tif (last_dis>0)\n\t\t\t\t{\n\t\t\t\tspeed = speed;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tspeed = -speed;\n\t\t\t\t}\n\t\t\tif (this.innertion_array.length<this.innertion_items)\n\t\t\t\t{speed=0}\n\t\t\tthis.innertion_array = [];\n\t\t\tthis.innertion_array_time = [];\n\t\t\treturn speed;\n\t\t\t}\n\t\t}\n\n\n\n\n\tthis.move_by = function(dis) //obj = this,dis = distance for moving, dim = dimensions:px or %%, dir = direction:'X' or 'Y'\n\t\t{\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tdis_move = dis+this.cur_transX;\n\t\t\tif (dis_move<=-this.max_left)\n\t\t\t\t{dis_move = -this.max_left}\n\t\t\tif (dis_move>=0)\n\t\t\t\t{dis_move = 0}\n\t\t\tthis.container.style['left'] = dis_move+this.dim;\n\t\t\tthis.cur_transX = dis_move;\n\t\t\t\n\t\t\tif(this.progress_bar_par=='on')\n\t\t\t\t{\n\t\t\t\tpb_mv = -this.cur_transX/this.container_width;\n\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tdis_move = dis+this.cur_transY;\n\t\t\tif (dis_move<=-this.max_top)\n\t\t\t\t{dis_move = -this.max_top}\n\t\t\tif (dis_move>=0)\n\t\t\t\t{dis_move = 0}\n\n\t\t\tthis.container.style['top'] = dis_move+this.dim;\n\t\t\tthis.cur_transY = dis_move;\n\t\t\tif(this.progress_bar_par=='on') //for progress bar moving\n\t\t\t\t{\n\t\t\t\tpb_mv = -this.cur_transY/this.container_height;\n\t\t\t\tpb_mv = pb_mv*this.pb_length; //calculate in pixels length\n\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t}\n\t\t\t}\n\n\t\n\t\t}\n\n\tthis.move_by(0); //this is nessesary to provide smoth moving from the first click\n\n\tthis.transition_on_off = function(speed)\n\t\t{\n\t\tthis.container.offsetHeight;\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tthis.container.style['transition'] = 'left '+speed+'s ease';\n\t\t\tthis.container.style['-moz-transition'] = 'left '+speed+'s ease';\n\t\t\tthis.container.style['-o-transition'] = 'left '+speed+'s ease';\n\t\t\tthis.container.style['-ms-transition'] = 'left '+speed+'s ease';\n\t\t\tthis.container.style['-webkit-transition'] = 'left '+speed+'s ease';\n\t\t\tthis.container.style['-khtmltransition'] = 'left '+speed+'s ease';\n\t}\n\t\telse\n\t\t\t{\n\t\t\tthis.container.style['transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-moz-transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-o-transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-webkit-transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-ms-transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-khtml-transition'] = 'top '+speed+'s ease';\n\t\t\t}\n\t\t}\n\n\n\n\t//mouse move listener, translate in specific direction by move px\n\tthis.mouse_move = function(e)\n\t\t{\n\t\t\n\t\tif (obj.cur_mouse_flag!='stop')\n\t\t\t{\n\t\t\tif (!e) e = window.event;\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tt = e.changedTouches[0]\n\t\t\t\tobj.cur_mouseX = t.clientX;\n\t\t\t\tobj.cur_mouseY = t.clientY;\n\t\t\t\t}\n\t\t\tcatch(err)\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\tobj.cur_mouseX = e.clientX; \n\t\t\t\tobj.cur_mouseY = e.clientY;\t\t\n\t\t\t\t}\n\t\t\n\t\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tdif = obj.cur_mouseX - obj.onclick_mouseX;\n\n\t\t\t\tdif = dif/1;\n\t\t\t\tdif = dif.toFixed(0);\n\t\t\t\tdif = dif*1;\n\n\t\t\t\tmove_dif = obj.cur_transX_tmp+dif;\n\t\t\t\tif (move_dif<=-this.max_left-50)\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = -this.max_left-50;\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\treturn false;\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\tif (move_dif>=50) //check if if edge has riched\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = 50;\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\tthis.innertion('moving'); //for innertion pass distance (loging)\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=0&move_dif>=-this.max_left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = -this.cur_transX/this.container_width;\n\t\t\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif>=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=-this.max_left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = (1-this.feel_width)*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t\t\t}\t\n\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tdif = obj.cur_mouseY - obj.onclick_mouseY;\n\t\t\t\tdif = dif/1;\n\t\t\t\tdif = dif.toFixed(0);\n\t\t\t\tdif = dif*1;\n\t\t\t\t\n\t\t\t\tmove_dif = obj.cur_transY_tmp+dif;\n\t\t\t\tif (move_dif<=-this.max_top-50)\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = -this.max_top-50;\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\tif (move_dif>=50) //checkinf if edge has riched \n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = 50;\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\tthis.innertion('moving'); //for innertion pass distance\t(loging)\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=0&move_dif>=-this.max_top)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = -this.cur_transY/this.container_height;\n\t\t\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif>=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=-this.max_top)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = (1-this.feel_height)*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\n\t\t\t\n\n\t\t\t}\n\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "90743ded8092d4649746041ad28a11a2", "score": "0.55478877", "text": "function minusSlides() {\n showSlides(slideIndex -= 1);\n\n}", "title": "" }, { "docid": "b280c02167f438c69226ec5b08f97ed2", "score": "0.5546349", "text": "function plusSlides(n) { //function for when the next or previous button is clicked\n showSlides(slideIndex += n); //calls the showSlides() function with the argument \n} //responding to the next or previous slide.", "title": "" }, { "docid": "dfd5a2ca568dc6d0001e1354e5b42769", "score": "0.5540278", "text": "function showSlides(n) {\n switch (n) {\n case 0:\n main.style.transform = \"translateX(0)\"\n break;\n \n case 1:\n main.style.transform = \"translateX(-100vw)\"\n break;\n \n case 2:\n main.style.transform = \"translateX(-200vw)\"\n break;\n \n default:\n main.style.transform = \"translateX(0)\"\n break;\n }\n}", "title": "" }, { "docid": "1b938e62743e15d5119e2751bc7b3b1a", "score": "0.55400145", "text": "function transitionByOneSlide() {\n\n if ( leftOrRight() ) { // If a slider moves to the right\n\n // If a slider's current move is more than 100px\n if ( settings[`${obj.id}`].movedBy > ( settings[`${obj.id}`].prevTranslate + 100) ) {\n\n if ( startSliding() ) { // If slider has been moved more than 10px\n\n swipeRight(); // Make a right swipe\n\n }\n \n } else { // If a slider has not moved more than 100px\n\n if ( startSliding() ) {\n\n backToLeftt(); // Returning back to it's original position \n\n }\n\n }\n\n } else { // If a slider moves to the left\n\n // If a slider has been moved more than 100px\n if ( settings[`${obj.id}`].movedBy < settings[`${obj.id}`].prevTranslate - 100 ) { \n\n if ( startSliding() ) { // if a slider is not moved by many clicks\n\n swipeLeft(); // Make a swipe to the left\n\n } \n \n } else { // If a slider has not moved more than 100px\n\n if ( startSliding() ) { // And it wasn't moved by clicks\n\n backToRight(); // Returning a lider to the starting position\n\n }\n\n }\n\n }\n \n}", "title": "" }, { "docid": "1b938e62743e15d5119e2751bc7b3b1a", "score": "0.55400145", "text": "function transitionByOneSlide() {\n\n if ( leftOrRight() ) { // If a slider moves to the right\n\n // If a slider's current move is more than 100px\n if ( settings[`${obj.id}`].movedBy > ( settings[`${obj.id}`].prevTranslate + 100) ) {\n\n if ( startSliding() ) { // If slider has been moved more than 10px\n\n swipeRight(); // Make a right swipe\n\n }\n \n } else { // If a slider has not moved more than 100px\n\n if ( startSliding() ) {\n\n backToLeftt(); // Returning back to it's original position \n\n }\n\n }\n\n } else { // If a slider moves to the left\n\n // If a slider has been moved more than 100px\n if ( settings[`${obj.id}`].movedBy < settings[`${obj.id}`].prevTranslate - 100 ) { \n\n if ( startSliding() ) { // if a slider is not moved by many clicks\n\n swipeLeft(); // Make a swipe to the left\n\n } \n \n } else { // If a slider has not moved more than 100px\n\n if ( startSliding() ) { // And it wasn't moved by clicks\n\n backToRight(); // Returning a lider to the starting position\n\n }\n\n }\n\n }\n \n}", "title": "" }, { "docid": "21bb2daf4e7fc4101b06cdfb9ff78978", "score": "0.5537704", "text": "function slider_render_stylus_up(obj)\n{\n with (window.document) {\n\twrite(\"<SPAN><SPAN \" +\n\t\t \"ID=\\\"\" + obj.span_id + \"up\" + \"\\\" \" +\n\t\t \"STYLE=\\\"\" +\n\t\t\t\"z-index:2; \" +\n\t\t\t\"position: absolute; margins:0; padding:0; \"+\n\t\t\t\"top:\" + obj.top + \"px; \" +\n\t\t\t\"left:\" + (obj.left + obj.start_tick*obj.tick_tabs - obj.stylus_width/2) + \"px; \" +\n\t\t\"\\\" >\");\n\twrite(\"<IMG \" +\n\t\t( nn4 ? \"SRC=\\\"\"+obj.stylus_up+\"#\"+obj.span_id+\"up\\\" \"\n\t\t : \"SRC=\\\"\"+obj.stylus_up+\"\\\" \"\n\t\t) +\n\t\t\"HEIGHT=\\\"\" + obj.stylus_height + \"\\\" \" +\n\t\t\"WIDTH=\\\"\" + obj.stylus_width + \"\\\" \" +\n\t\t\">\");\n write(\"</SPAN></SPAN>\");\n }\n}", "title": "" }, { "docid": "a6c73c6519b9ea9295cc99f509613778", "score": "0.55230165", "text": "function SliderWidget(hydroinst)\n{\n\tHydroWidget.call(this, hydroinst);\n\tthis.setter = function (val) { };\n}", "title": "" }, { "docid": "2159a88b34666fd4d5a89fb0c195b77a", "score": "0.5521107", "text": "function createFloorPlanHTML(imageIndex, slideAmount, floorPlanSource){\n document.getElementById(\"slideshow\").innerHTML += \n `<div class=\"mySlides\">\n <div class=\"numbertext\">${imageIndex} / ${slideAmount}</div>\n <img class=\"image\" src=\"${floorPlanSource}floor-${imageIndex}.png\">\n <div class=\"text\">Floor Plan:</div>\n </div>`\n}", "title": "" }, { "docid": "6a7036fc94cd581c265602a96f0db23a", "score": "0.5519235", "text": "function behaviorFunction(){\n return \"MM_effectSlide\";\n}", "title": "" }, { "docid": "2ad32692ca8f71c5cb8d261730b79723", "score": "0.5508592", "text": "function slide(id) {\n console.log(\"in slide \",id);\n id = parseInt(id);\n id = parseIndex(id);\n // console.log(parseIndex(id));\n // console.log(parseIndex(id+1).toString());\n // console.log(\"./images/slider/sl-\"+parseIndex(id+1).toString()+\".jpg)\");\n if (id - cur > 0){\n rightImg.style.background = \"linear-gradient( -180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.418), rgba(235, 235, 235, 0.74), rgb(235, 235, 235)), url(./images/slider/sl-\"+parseIndex(id).toString()+\".jpg)\";\n curImg.style.animation = \"toleft 1s\";\n rightImg.style.animation = \"toleft 1s\";\n }\n else {\n leftImg.style.background = \"linear-gradient( -180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.418), rgba(235, 235, 235, 0.74), rgb(235, 235, 235)), url(./images/slider/sl-\"+parseIndex(id).toString()+\".jpg)\";\n curImg.style.animation = \"toright 1s\";\n leftImg.style.animation = \"toright 1s\";\n }\n // cur = id;\n setTimeout(()=>{\n curImg.style.animation = \"none\";\n leftImg.style.animation = \"none\";\n rightImg.style.animation = \"none\";\n leftImg.style.background = \"linear-gradient( -180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.418), rgba(235, 235, 235, 0.74), rgb(235, 235, 235)), url(./images/slider/sl-\"+parseIndex(id-1).toString()+\".jpg)\";\n // leftImg.style.opacity = \"0.1\";\n curImg.style.background = \"linear-gradient( -180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.418), rgba(235, 235, 235, 0.74), rgb(235, 235, 235)), url(./images/slider/sl-\"+parseIndex(id).toString()+\".jpg)\";\n rightImg.style.background = \"linear-gradient( -180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.418), rgba(235, 235, 235, 0.74), rgb(235, 235, 235)), url(./images/slider/sl-\"+parseIndex(id+1).toString()+\".jpg)\";\n // rightImg.style.opacity = \"0.1\";\n }, 900);\n \n }", "title": "" }, { "docid": "7ee60c74ef0d8900944b694c8780d943", "score": "0.55059594", "text": "function make_slides(f) {\n var slides = {};\n \n //block enter key for every instance of class \"slide\" so that exp doesn't start from beginning when entering answer\n $('html').bind('keypress', function(e)\n {\n if(e.keyCode == 13)\n {\n return false;\n }\n });\n\n slides.i0 = slide({\n name : \"i0\",\n start: function() {\n exp.startT = Date.now();\n }\n });\n\n slides.instructions = slide({\n name : \"instructions\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n \nslides.example = slide({\n name : \"example\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n \nslides.quant = slide({\n \tname: \"quant\", //id of div element where info should be presented\n \tpresent: get_quant_items(), //gets items via function\n \n/* urn_image: function(stim) { //id of div element, if same item is to be shown on different slides (with different tasks, for example\n //show only one urn picture\n $(\".pic\").hide();\n var uniform = jStat.uniform.sample(1,5);\n var pic_id = Math.round(uniform);\n $(\"#\" + pic_id).show();\n $(\"#name\").html(stim.name); //from items array, use property item\n },*/\n \n\n rating_task: function(stim) { //id of div element, if same item is to be shown on different slides (with different tasks, for example //from items array, use property item\n //random choice of LP or HP\n \n var context_sentence = stim.context;\n var context_elements = context_sentence.split(\"__\"); //split context at __\n var context_begin = context_elements[0]; \n var context_end = context_elements[1]; \n \n var context_quant = stim.quantifier;\n $(\"#context_begin\").html(context_begin);\n $(\"#context_quant\").html(context_quant);\n $(\"#context_end\").html(context_end);\n \n \n var question = stim.question;\n $(\"#question\").html(question);\n \n $(\"#min\").html(stim.min);\n\t\t$(\"#max\").html(\" \"+stim.max + \" or more\");\n _s.init_slider(stim.min, stim.max);\n \t_s.current_response_data = null;\n\t\t$(\"#number_guess\").html(\"?\");\n },\n\n \n present_handle: function(stim) {\n //reset input elements\n //$(\"#number_guess_likely\").html(\"?\");\n //hide parts of subslides, only show after each other\n $(\".subslide\").hide();\n //for sliders\n \t_s.this_trial_data = clone(stim);\n //stage of Manski task?\n \t_s.measure = stim.measure;\n console.log('stim measure '+stim.measure);\n \t_s.trial_start = Date.now();\n \t_s.measure = stim.measure;\n _s.trial_start = Date.now();\n $(\"#number_guess\").html(\"?\");\n $(\".err\").hide();\n $(\"#\" + _s.measure).show();\n _s[_s.measure](stim); //_s[_s.measure] calls the function inside the current measure, it basically creates the items as defined in the measure\n },\n \n button : function() {\n //check if slider has been clicked\n if (_s.current_response_data == null) {\n\t\t\t$(\"#quant_err\").show();\n\t\t}\n else{ //save responses and present next item\n response = _s.current_response_data;\n _s.log_responses();\n\t\t _stream.apply(this);\n }\n },\n init_slider : function(min, max) {\n utils.make_slider(\"#give_number_single_slider\", function(event, ui) {\n _s.current_response_data = Math.round(ui.value * (max - min) + min);\n $(\"#number_guess\").html(_s.current_response_data);\n });\n },\n log_responses: function() {\n \t \t_s.this_trial_data[\"response\"] = response;\n //change this!!\n _s.this_trial_data[\"modifier\"] = \"unmodified\";\n _s.this_trial_data[\"task\"] = \"interpretation\";\n\t \t_s.this_trial_data[\"rt\"] = Date.now() - _s.trial_start;\n\t \texp.data_trials.push(clone(_s.this_trial_data));\n \t_s.current_response_data = null;\n }\n \n });\n \n\n slides.subj_info = slide({\n name : \"subj_info\",\n submit : function(e){\n //if (e.preventDefault) e.preventDefault(); // I don't know what this means.\n exp.subj_data = {\n language : $(\"#language\").val(),\n enjoyment : $(\"#enjoyment\").val(),\n asses : $('input[name=\"assess\"]:checked').val(),\n age : $(\"#age\").val(),\n gender : $(\"#gender\").val(),\n education : $(\"#education\").val(),\n comments : $(\"#comments\").val(),\n };\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.thanks = slide({\n name : \"thanks\",\n start : function() {\n exp.data= {\n \"trials\" : exp.data_trials,\n \"catch_trials\" : exp.catch_trials,\n \"system\" : exp.system,\n \"condition\" : exp.condition,\n \"subject_information\" : exp.subj_data,\n \"clicks\" : exp.clicks,\n \"time_in_minutes\" : (Date.now() - exp.startT)/60000\n };\n setTimeout(function() {turk.submit(exp.data);}, 1000);\n }\n });\n\n return slides;\n}", "title": "" }, { "docid": "055929b9df2d10cd159508350d9c2d80", "score": "0.55015004", "text": "function plusSlides(n) { // declaring a function 'plusSlides' and passing it 'n' as a parameter (n as athe onclick attribute)\n showSlides(slideIndex += n); // calling a nested function 'showSlides' that will increase slide index by 1 and show that slide\n}", "title": "" }, { "docid": "8de5d5b29f344f14a569c5426883098e", "score": "0.54916245", "text": "function gdSlide() {\n var slide = $('.iSlide_1').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year1'\n });\n var slide = $('.iSlide_2').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year2'\n });\n var slide = $('.iSlide_3').bxSlider({\n mode: 'horizontal',\n speed: 1000,\n pause: 5000,\n auto: false,\n pagerCustom: '.year3'\n });\n}", "title": "" }, { "docid": "829f02c3f4d05e2254b2942792d6c845", "score": "0.5488046", "text": "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n}", "title": "" }, { "docid": "829f02c3f4d05e2254b2942792d6c845", "score": "0.5488046", "text": "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n}", "title": "" }, { "docid": "829f02c3f4d05e2254b2942792d6c845", "score": "0.5488046", "text": "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n}", "title": "" }, { "docid": "c2a148ba335189dc9b40ec9ebe61822d", "score": "0.5484988", "text": "slam() {\n\n if (this.slides.length < 2) {\n return;\n }\n\n // create new, three-slide slammer out of curr, prev, and next\n this.newSlammer = document.createElement('div');\n this.prevSlide = document.createElement('div');\n this.currSlide = document.createElement('div');\n this.nextSlide = document.createElement('div');\n\n let slides = [this.prevSlide, this.currSlide, this.nextSlide];\n let origSlideCopies = [];\n\n for (let i = 0; i < this.slides.length; i++) {\n let curr = this.slides[i];\n let newSlide = {\n \"content\": curr.innerHTML,\n \"classes\": curr.classList,\n \"style\": curr.style\n };\n origSlideCopies.push(newSlide);\n }\n\n for (let i = 0; i < slides.length; i++) {\n this.newSlammer.appendChild(slides[i]);\n let slideIndexToUse = i - 1 >= 0 ? i - 1 : origSlideCopies.length - 1;\n slides[i].innerHTML = origSlideCopies[slideIndexToUse].content;\n for (let j = 0; j < origSlideCopies[slideIndexToUse].classes.length; j++) {\n slides[i].classList.add(origSlideCopies[slideIndexToUse].classes[j]);\n }\n for (let prop in origSlideCopies[slideIndexToUse].style) {\n if (origSlideCopies[slideIndexToUse].style[prop] && origSlideCopies[slideIndexToUse].style[prop].length > 0) {\n slides[i].style[prop] = origSlideCopies[slideIndexToUse].style[prop];\n }\n }\n }\n\n const realWrapper = this.wrapper.parentNode;\n\n realWrapper.removeChild(this.wrapper);\n\n this.wrapper = realWrapper;\n\n this.wrapper.appendChild(this.newSlammer);\n this.newSlammer.classList.add('slam-items');\n this.newSlammer.style.WebkitTransform = \"translateX(0%)\";\n this.newSlammer.style.transform = \"translateX(0%)\";\n\n this.transformTo(-1, 0, -1);\n this.acceptHammers();\n\n this.createNav();\n\n locked = false;\n\n return;\n }", "title": "" }, { "docid": "9ba123b407b347cb8288a4bed9c2ae98", "score": "0.54785883", "text": "function augmenter() {\r\n\r\n if (count < 2) {\r\n\r\n count++\r\n if (sliders[count] != undefined) {\r\n sourceImg.src = sliders[count].src\r\n sourceImg.alt = sliders[count].alt\r\n\r\n }\r\n\r\n } else if (count === 2) {\r\n count = 0\r\n sourceImg.src = sliders[count].src\r\n sourceImg.alt = sliders[count].alt\r\n }\r\n\r\n switch (count) {\r\n case 0:\r\n document.querySelector(\".cercle:nth-child(1)\").classList.add(\"active\")\r\n document.querySelector(\".cercle:nth-child(2)\").classList.remove(\"active\")\r\n document.querySelector(\".cercle:nth-child(3)\").classList.remove(\"active\")\r\n break\r\n\r\n case 1:\r\n document.querySelector(\".cercle:nth-child(1)\").classList.remove(\"active\")\r\n document.querySelector(\".cercle:nth-child(2)\").classList.add(\"active\")\r\n document.querySelector(\".cercle:nth-child(3)\").classList.remove(\"active\")\r\n break\r\n\r\n case 2:\r\n document.querySelector(\".cercle:nth-child(1)\").classList.remove(\"active\")\r\n document.querySelector(\".cercle:nth-child(2)\").classList.remove(\"active\")\r\n document.querySelector(\".cercle:nth-child(3)\").classList.add(\"active\")\r\n break\r\n default:\r\n console.log(\"error\")\r\n }\r\n}", "title": "" }, { "docid": "b61471ee9c824c99d00283e9afb2695e", "score": "0.54722023", "text": "function slider_render_stylus_down(obj)\n{\n with (window.document) {\n\twrite(\"<SPAN><SPAN \" +\n\t\t \"ID=\\\"\" + obj.span_id + \"down\" + \"\\\" \" +\n\t\t \"STYLE=\\\"\" +\n\t\t\t\"z-index:3; \" +\n\t\t\t\"position: absolute; margins:0; padding:0;\"+\n\t\t\t( nn4 ? \"visibility: hide; \" : \"visibility: hidden; \")+\n\t\t\t\"top:\" + obj.top + \"px; \" +\n\t\t\t\"left:\" + (obj.left + obj.start_tick*obj.tick_tabs - obj.stylus_width/2) + \"px; \" +\n\t\t\"\\\" >\");\n\twrite(\"<IMG \" +\n\t\t( nn4 ? \"SRC=\\\"\"+obj.stylus_down+\"#\"+obj.span_id+\"down\\\" \"\n\t\t : \"SRC=\\\"\"+obj.stylus_down+\"\\\" \"\n\t\t) +\n\t\t\"HEIGHT=\\\"\" + obj.stylus_height + \"\\\" \" +\n\t\t\"WIDTH=\\\"\" + obj.stylus_width + \"\\\" \" +\n\t\t\">\");\n write(\"</SPAN></SPAN>\");\n }\n}", "title": "" }, { "docid": "622e920b4ae07b44a5b949a1211cb7f8", "score": "0.54647285", "text": "function initImageHTML(slideAmount){\n document.getElementById(\"slideshowContainer\").innerHTML = \n `<div class=\"imageContainer\" id = \"slideshow\">\n </div>`\n if (slideAmount != 1) {\n document.getElementById(\"slideshowContainer\").innerHTML += \n `<a class=\"prev\" onclick=\"plusSlides(-1)\">&#10094;</a>\n <a class=\"next\" onclick=\"plusSlides(1)\">&#10095;</a>`\n }\n}", "title": "" }, { "docid": "43ce832a376f4288d452b6eccc0294d8", "score": "0.54646546", "text": "function plusSlides1(n) {\n showSlides1(slideIndex1 += n);\n}", "title": "" }, { "docid": "b27fda3652bc09279c667747863568a8", "score": "0.5464436", "text": "function showSlides() {\n var i;\n slides = document.getElementsByClassName(\"slider\");\n dots = document.getElementsByClassName(\"circle_indicator\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1;\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n setTimeout(showSlides, 10000); // Change image on slider every 10 seconds\n}", "title": "" }, { "docid": "c2f776aa30e7bc53389ce44b12a3544f", "score": "0.54628587", "text": "function slideNav(int) {\n\tshowSlide(slideIndex += int);\n}", "title": "" }, { "docid": "f2baf2505767e2a9a1b81d8526a06803", "score": "0.5451602", "text": "function getSnippetSettingVideoAndAudioPin() {\r\n\tjscript = '<DTV version=\"1.0\">\\n';\r\n\tjscript += '<script language=\"JScript\" expression=\"1\">\\n';\r\n\tjscript += 'try{\\n';\r\n\tjscript += 'DTVLink.EnabledVideoOutPin=true;\\n';\r\n\tjscript += 'DTVLink.EnabledAudioOutPin=true;\\n';\r\n\tjscript += '}catch(e){\\n';\r\n\tjscript += 'DTVLink.Log(3,\"JScript\",\"Error \"+ e.message);';\r\n\tjscript += '}\\n';\r\n\tjscript += '</script>\\n';\r\n\tjscript += '</DTV>';\r\n\treturn jscript;\r\n}", "title": "" }, { "docid": "79c71ce68c75a5a3587b160232a81d86", "score": "0.5448982", "text": "function plusSlides(number) {\n slideIndex += number;\n showSlides(slideIndex);\n}", "title": "" }, { "docid": "8932cf6314a7bc20563c255973a7daca", "score": "0.5447797", "text": "function Slider(parentDiv, SizeType) {\n this.SizeType = SizeType;\n this.ParentDiv = parentDiv;\n this.SliderDiv = \"SliderDiv\" + parentDiv;\n this.Top = 0;\n this.Left = 0;\n this.Position = \"absolute\";\n this.Width = 10;\n this.Height = 10;\n this.Background = \"#000\"//\"url(backcoverdark.png)\";\n this.Delay = 100;\n this.Increment = 100;\n this.MaxHeight = 100;\n this.MaxWidth = 100;\n this.SlideDown = slideFromUpDown;\n this.SlideRight = slideFromRightLeft;\n this.CreateDiv = createDiv;\n this.RightLeft = \"right\";\n this.UpDown = \"down\";\n this.Zindex = 9999;\n}", "title": "" }, { "docid": "e3580a0e9bd424f383f520f899d8f3af", "score": "0.54472786", "text": "function startSlideShow()\n{\n if (controls) {\n controls.setEnabled(true);\n controls.setPaused(false);\n }\n showInterfaceElements();\n slideshow.start();\n}", "title": "" }, { "docid": "d8a56ac2c4421dd8384d5d31dc9f0ffd", "score": "0.54447794", "text": "function swapSlide(container,opt){try{var actli=container.find('>ul:first-child >li:eq(' + opt.act + ')');}catch(e) {var actli=container.find('>ul:first-child >li:eq(1)');}opt.lastslide = opt.act;var nextli=container.find('>ul:first-child >li:eq(' + opt.next + ')');var defimg=nextli.find('.defaultimg');opt.bannertimeronpause = true;container.trigger('stoptimer');opt.cd = 0;if(defimg.data('lazyload') != undefined && defimg.data('lazyload') != \"undefined\" && defimg.data('lazydone') != 1){if(!isIE(8))defimg.css({backgroundImage:'url(\"' + nextli.find('.defaultimg').data('lazyload') + '\")'});else {defimg.attr('src',nextli.find('.defaultimg').data('lazyload'));}defimg.data('src',nextli.find('.defaultimg').data('lazyload'));defimg.data('lazydone',1);defimg.data('orgw',0);nextli.data('loadeddone',1);TweenLite.set(container.find('.tp-loader'),{display:\"block\",opacity:0});TweenLite.to(container.find('.tp-loader'),0.3,{autoAlpha:1});waitForLoads(nextli,function(){swapSlideCall(opt,defimg,container);},opt);}else {if(nextli.data('loadeddone') === undefined){nextli.data('loadeddone',1);waitForLoads(nextli,function(){swapSlideCall(opt,defimg,container);},opt);}else swapSlideCall(opt,defimg,container);}}", "title": "" }, { "docid": "700752cc001aa5423a9dc3e6db5e6d7f", "score": "0.54418314", "text": "function MainSlider(prefix)\n\t{\n\tvar obj = this;\n\t//get all blocks\n\tthis.scroll_left = document.get_elements_by_class_name(prefix+'_slider_button_left')[0];\n\tthis.scroll_right = document.get_elements_by_class_name(prefix+'_slider_button_right')[0];\t\n\tthis.container = document.get_elements_by_class_name(prefix+'_slider_img_container')[0];\n\tthis.progress_bar = document.get_elements_by_class_name(prefix+'_slider_progress_bar_container')[0];\n\n\tthis.img_array = this.container.get_elements_by_tag_name('img');\n\tthis.img_index = [] //index for control current img\n\tthis.text_array = document.get_elements_by_class_name(prefix+'_slider_text_container_span'); //array for text\n\n\n\tthis.id_scroll = 0 //flag for execution (moving img slide)\n\tthis.len = this.img_array.length; //kolvo img items\n\t\n\n\t//special ordering because of z-index (last element over firts elements)\n\tthis.next_img = this.img_array[1];\n\tthis.prev_img = this.img_array[this.len-1];\n\tthis.cur_img = this.img_array[0]; \n\n\tthis.img_len = this.img_array[0].offsetWidth; //length of img for moving left\n\n\n\t//set handlers for clicks\n\tthis.scroll_left.add_event_listener('click',function(event){obj.left();event.stopPropagation()},false);\n\tthis.scroll_right.add_event_listener('click',function(event){obj.right();event.stopPropagation()},false);\n\n\tthis.container.add_event_listener('mousedown',function(event){obj.touch_on(event);event.stopPropagation()},false);\n\tthis.container.add_event_listener('mousemove',function(event){obj.touch_move(event)},false);\n\tthis.container.add_event_listener('mouseup',function(event){obj.touch_off(event);event.stopPropagation()},false);\n\n\n\tthis.container.add_event_listener('touchstart',function(event){obj.touch_on(event)},false);\n\tthis.container.add_event_listener('touchend',function(event){obj.touch_off(event)},false);\n\tthis.container.add_event_listener('touchmove',function(event){obj.touch_move(event);try{event.preventDefault()}catch(err){event.returnValue=false;}},false);\n\t\n\n\n\tthis.flag = 'stop'; //floag for mouse_up and mouse_down status (during mouse moving)\n\tthis.start_click = 0; //coordinates of mouse_click;\n\n\twindow.id_tmp_2 = 0;\n\n\n\t//cancel default event for img (disable moving during mouse touch)\n\tfor (i=0;i<this.len;i=i+1)\n\t\t{\n\t\telem = this.img_array[i];\n\t\telem.add_event_listener('mousedown',function(event){try{event.preventDefault()}catch(err){event.returnValue=false;}},false);\n\t\t\n\t\t}\n\n\n\n\tthis.preload = function()\n\t\t{\n\t\t\n\t\t//complete index array\n\t\tfor (i=0;i<this.len;i=i+1)\n\t\t\t{\n\t\t\tthis.img_index.push(i);\t\n\t\t\t}\n\n\n\n\t\t//set images on edges\n\n\t\tthis.prev_img.style['zIndex'] = '2';\n\t\tthis.cur_img.style['zIndex'] = '3';\n\t\tthis.next_img.style['zIndex'] = '2';\n\n\t\n\t\tthis.prev_img.style['left'] = '-100%';\n\t\tthis.next_img.style['left'] = '100%';\n\t\tthis.cur_img.style['left'] = '0px';\n\n\t\t//insert white progress bar items\n\t\tfor_write = ''\n\t\tfor (i=0;i<this.len;i=i+1)\n\t\t\t{\n\t\t\tfor_write = for_write+'<div></div>'\t\t\t\n\t\t\t}\n\t\tthis.progress_bar.innerHTML = for_write;\n\t\t\n\t\tthis.bar_array = this.progress_bar.get_elements_by_tag_name('div');\n\n\n\t\t//set text visible (at the beginnig all elem have 0 opacity)\n\t\tthis.text_array[this.img_index[0]].style['display'] = 'block';\n\t\tthis.text_array[this.img_index[0]].style['opacity'] = '1';\n\t\t//set bar visible (at the beginnig all elem have 0 opacity)\n\t\tthis.bar_array[this.img_index[0]].style['opacity'] = '1';\n\t\n\n\t\t}\n\n\n\t//preload start\n\tthis.preload();\n\n\n\n\t//nessesary to translate width to %%, when screen size is changing - it adapts. transition normally works if set left style dimensions in pixels. If in % - one of two images immediatly without ant transition will be placed to new position (white plase), at the same yime second img will be moving with transition\n\tthis.trans_to_percent = function()\n\t\t{\n\t\tobj = this;\t\t\n\t\t\n\t\tfunction p(obj)\n\t\t\t{\n\t\t\tobj.cur_img.style['left'] = '0px';\n\t\t\tobj.next_img.style['left'] = '100%';\n\t\t\tobj.prev_img.style['left'] = '-100%';\n\t\t\t\n\t\t\t}\n\t\tp(obj)\n\t\t\n\t\t}\n\n\n\n\n\tthis.transition_on_off = function(para,speed)\n\t\t{\n\n\t\tconsole.log('fff');\n\n\t\tspeed = speed||'0.6';\n\t\t\n\t\tif (para=='on')\n\t\t\t{\n\t\t\tfor (i=0;i<this.len;i=i+1)\n\t\t\t\t{\n\t\t\t\tthis.img_array[i].offsetWidth;\n\t\t\t\tthis.img_array[i].style['transition'] = 'left '+speed+'s ease';\n\t\t\t\tthis.img_array[i].style['-moz-transition'] = 'left '+speed+'s ease';\n\t\t\t\tthis.img_array[i].style['-o-transition'] = 'left '+speed+'s ease';\n\t\t\t\tthis.img_array[i].style['-webkit-transition'] = 'left '+speed+'s ease';\n\t\t\t\tthis.img_array[i].style['-ms-transition'] = 'left '+speed+'s ease';\n\t\t\t\tthis.img_array[i].style['-khtml-transition'] = 'left '+speed+'s ease';\n\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tfor (i=0;i<this.len;i=i+1)\n\t\t\t\t{\n\t\t\t\tthis.img_array[i].offsetWidth;\n\t\t\t\tthis.img_array[i].style['transition'] = 'left 0s ease';\n\t\t\t\tthis.img_array[i].style['-moz-transition'] = 'left 0s ease';\n\t\t\t\tthis.img_array[i].style['-o-transition'] = 'left 0s ease';\n\t\t\t\tthis.img_array[i].style['-webkit-transition'] = 'left 0s ease';\n\t\t\t\tthis.img_array[i].style['-khtml-transition'] = 'left 0s ease';\n\t\t\t\tthis.img_array[i].style['-ms-transition'] = 'left 0s ease';\n}\n\t\t\t\n\t\t\t}\n\t\t}\t\n\n\n\n\tthis.left = function()\n\t\t{\n\t\tif (this.id_scroll==1)\n\t\t\t{\n\t\t\treturn;\n\t\t\t}\n\t\tthis.id_scroll = 1;\n\t\tthis.img_len = this.cur_img.offsetWidth; //determine actual img size (if window size has changed)\n\t\n\t\tfunction pause(obj) //this is nessesary for to finish all moving and than change this.id_scroll\n\t\t\t{\n\t\t\tclearInterval(window.id_tmp);\n\t\t\tobj.id_scroll = 0;\n\t\t\t}\n\n\t\twindow.id_tmp = setInterval(function(){pause(obj)},1000);\n\t\n\n\n\t\tthis.cur_img.style['zIndex'] = '3';\n\t\tthis.prev_img.style['zIndex'] = '2';\n\t\tthis.next_img.style['zIndex'] = '1';\n\n\n\t\t//moving\n\t\tthis.container.style['left'] = '-100%';\n\n\n\t\t//progress bar set\n\t\tthis.bar_array[this.img_index[0]].style['opacity'] = '0.3';\n\t\tthis.bar_array[this.img_index[this.len-1]].style['opacity'] = '1';\t\n\n\t\t//text set\n\t\tthis.text_array[this.img_index[0]].style['opacity'] = '0';\n\t\tthis.text_array[this.img_index[0]].style['display'] = 'none';\n\t\n\t\tthis.text_array[this.img_index[this.len-1]].style['display'] = 'block';\n\t\tthis.text_array[this.img_index[this.len-1]].style['opacity'] = '1';\n\n\n\t\t//prepare for next moving (index pushing)\n\t\tk = this.img_index[this.len-1];\n\t\tn = this.img_index.unshift(k);\n\t\tn = this.img_index.splice(this.len);\t\n\n\n\n\t\t//set new images\n\t\tthis.next_img = this.img_array[this.img_index[1]];\n\t\tthis.prev_img = this.img_array[this.img_index[this.len-1]];\n\t\tthis.cur_img = this.img_array[this.img_index[0]]; \n\n\t\tthis.cur_img.style['zIndex'] = '3';\n\t\tthis.prev_img.style['zIndex'] = '1';\n\t\tthis.next_img.style['zIndex'] = '2';\n\n\t\n//\t\tobj.prev_img.style['left'] = -this.img_len+'px';\n\t\n\n\t\t}\t\t\n\n\n\tthis.right = function()\n\t\t{\n\t\tif (this.id_scroll==1)\n\t\t\t{\n\t\t\treturn;\n\t\t\t}\n\n\n\t\tthis.id_scroll = 1;\n\t\tthis.img_len = this.cur_img.offsetWidth; //determine actual img size (if window size has changed)\n\t\n\t\tfunction pause(obj) //this is nessesary for to finish all moving and than change this.id_scroll\n\t\t\t{\n\t\t\tclearInterval(window.id_tmp);\n\t\t\tobj.id_scroll = 0;\t\t\t\n\t\t\tobj.trans_to_percent();}\n\n\t\twindow.id_tmp = setInterval(function(){pause(obj)},1000);\n\n\t\n\t\t//prepare z-index (visibility)\n\n\n\t\tthis.cur_img.style['zIndex'] = '3';\n\t\tthis.prev_img.style['zIndex'] = '2';\n\t\tthis.next_img.style['zIndex'] = '2';\n\n\n\n\t\t//moving\n\t\tthis.transition_on_off('on');\n\t\tthis.cur_img.style['left'] = -this.img_len+'px';\n\t\tthis.next_img.style['left'] = '0px';\n\n\t\n\t\t//progress bar set\n\t\tthis.bar_array[this.img_index[0]].style['opacity'] = '0.3';\n\t\tthis.bar_array[this.img_index[1]].style['opacity'] = '1';\t\n\n\n\t\t//text set\n\t\tthis.text_array[this.img_index[0]].style['opacity'] = '0';\n\t\tthis.text_array[this.img_index[0]].style['display'] = 'none';\n\t\tthis.text_array[this.img_index[1]].style['display'] = 'block';\n\t\tthis.text_array[this.img_index[1]].style['opacity'] = '1';\n\n\n\t\tthis.transition_on_off('off');\t\n\t\t//prepare for next moving (index pushing)\n\t\tk = this.img_index[0];\n\t\tthis.img_index.push(k);\n\t\tn = this.img_index.splice(0,1);\n\t\t\n\n\n\t\t//set new images\n\t\tthis.cur_img.style['zIndex'] = '3';\n\t\tthis.prev_img.style['zIndex'] = '1';\n\t\tthis.next_img.style['zIndex'] = '2';\n\t\t\n\n\t\t\n\t\tthis.next_img = this.img_array[this.img_index[1]];\n\t\tthis.prev_img = this.img_array[this.img_index[this.len-1]];\n\t\tthis.cur_img = this.img_array[this.img_index[0]]; \n\t\t\n\t\tthis.next_img.style['left'] = this.img_len+'px';\n\t\t\n\t\n\t\t}\t\t\n\n\tthis.touch_on = function(e)\n\t\t{\n\t\tif (this.id_scroll!=0)\n\t\t\t{\n\t\t\treturn\n\t\t\t}\n\t\tthis.img_len = this.cur_img.offsetWidth;\n\t\ttry\n\t\t\t{\n\t\t\ty = e.changedTouches[0].clientX;\n\t\t\tthis.flag = 'start';\n\t\t\tthis.start_click = y;\n\t\t\t}\n\t\tcatch(err)\n\t\t\t{\n\t\t\tif (!e) {e = window.event}\n\t\t\tthis.flag = 'start';\n\t\t\tthis.start_click = e.clientX;\n\t\t\t}\n\t\tthis.transition_on_off('off');\n\t\t}\n\n\n\tthis.touch_off = function(e)\n\t\t{\n\t\tif (!e){e = window.event}\n\t\tif (this.flag=='stop')\n\t\t\t{\n\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\ttry\n\t\t\t{\n\t\t\ty = e.changedTouches[0].clientX;\n\t\t\tvar dif = y - this.start_click;\n\t\t\t}\n\t\t\n\t\tcatch(err)\n\t\t\t{\n\t\t\tvar dif = e.clientX - this.start_click;\n\t\t\t}\n\n\t\tvar margin_dif = this.cur_img.offsetWidth*0.15; //this is for adaptive spring (when window size is small)\n\t\t\n\t\t//left-right moving\n\t\tif (dif<-margin_dif)\n\t\t\t{\n\t\t\tthis.right('yes');\n\t\t\t}\n\t\tif (dif>margin_dif)\n\t\t\t{\n\t\t\tthis.left('yes');\n\t\t\t}\n\n\t\t\n\t\t//spring\n\t\tif (dif<margin_dif&dif>0)\n\t\t\t{\n\t\t\t\n\t\t\tthis.transition_on_off('on',0.2);\n\t\t\t\n\t\t\t\n\t\t\tthis.prev_img.style['left'] = -this.img_len+'px';\t\n\t\t\tthis.cur_img.style['left'] = '0px';\n\t\t\tthis.next_img.style['left'] = this.img_len+'px';\t\n\n\n\t\t\tthis.transition_on_off('off');\n\t\t\tvar obj = this;\n\t\t\twindow.id_tmp_ = setTimeout(function(){obj.trans_to_percent()},1500);\n\t\t\t}\n\n\t\tif (dif>-margin_dif&dif<0)\n\t\t\t{\n\t\t\t\n\t\t\tthis.transition_on_off('on',0.2);\n\t\t\t\t\t\n\t\t\tthis.cur_img.style['left'] = '0px';\t\n\t\t\tthis.next_img.style['left'] = this.img_len+'px';\t\n\t\t\tthis.prev_img.style['left'] = -this.img_len+'px';\t\n\t\t\n\t\t\tvar obj = this;\n\t\t\tthis.transition_on_off('off');\n\t\t\twindow.id_tmp_ = setTimeout(function(){obj.trans_to_percent()},1500)\n\t\t\t}\n\t\n\n\t\tthis.flag = 'stop';\n\t\t}\n\n\tthis.touch_move = function(e)\n\t\t{\n\n\t\tif (!e){e = window.event}\n\n\t\tif (this.flag=='start')\n\t\t\t{\n\t\t\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\ty = e.changedTouches[0].clientX;\n\t\t\t\tvar dif = y - this.start_click;\n\t\t\t\t}\n\n\t\t\tcatch(err)\n\t\t\t\t{\n\t\t\t\tvar dif = e.clientX - this.start_click;\n\t\t\t\t}\n\t\n\t\t\t//for all images determine left positions\n\t\t\tthis.cur_img.style['left'] = dif+'px';\n\t\t\tthis.next_img.style['left'] = this.img_len+dif+'px';\t\n\t\t\tthis.prev_img.style['left'] = -this.img_len+dif+'px';\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "7d337a610ed1ba748c84b20c8a802175", "score": "0.54380023", "text": "function Slide(slider, slideSpeed, slideIOSpeed, delay) {\n // Declare instance variables\n var all_slides = slider.children('.vslide'); // Object that holds all of the .vslides. DO NOT CHANGE.\n \n if (all_slides.length === 1) {\n var count = 0; // Counter that loops through each slide in the object all_slides. DO NOT CHANGE.\n } else { // Assigning to 0 accounts for the case where there is only one image in all_slides.\n var count = 1;\n }\n \n var imgHeightCss = all_slides.eq(count).css('height'),\n imgParentHeightCss = all_slides.eq(count).parent().css('height'),\n imgHeightDiff = parseInt(imgHeightCss)/parseInt(imgParentHeightCss), // Ratio of heights for positioning.\n opened_slide = all_slides.eq(0), // Tracker of the opened slide.\n self = this, // Necessary for calling setInterval within the object. DO NOT CHANGE.\n toSlide = true; // True: an image slides. False: switch images. DO NOT CHANGE.\n \n // Setting default parameters\n // http://stackoverflow.com/questions/894860/set-a-default-parameter-value-for-a-javascript-function\n this.delay = delay !== undefined ? delay : 6000; // The time (ms) between each call of toggleSlide().\n // The image is shown for twice this duration.\n // Once as a still image, and once again as it slides. Default: 6000\n this.slideSpeed = slideSpeed !== undefined ? slideSpeed : 3000; // The time (ms) an image takes to slide\n // from top to botom in toggleSlide(). Default: 3000\n this.slideIOSpeed = slideIOSpeed !== undefined ? slideIOSpeed : 300;// The time (ms) an image takes to\n // slideIn() and slideOut(). Default: 300\n \n // Declare class methods\n this.toggleSlide = toggleSlide;\n this.toggleSwitch = toggleSwitch;\n this.slideOut = slideOut;\n this.slideIn = slideIn;\n this.resetPosition = resetPosition;\n \n this.start = function startInterval() {\n // Reason for using a function with self:\n // http://www.aaronkjackson.com/2012/03/javascript-using-setinterval-within-an-object/\n setInterval(function() { self.toggleSlide(); }, this.delay);\n }\n \n function toggleSlide() {\n if (toSlide) {\n opened_slide.animate({ top: -(imgHeightDiff - 1)*100 + '%' }, this.slideSpeed);\n toSlide = false;\n } else {\n this.toggleSwitch();\n toSlide = true;\n }\n }\n \n function toggleSwitch() {\n var next_slide = all_slides.eq(count);\n \n this.slideOut(opened_slide);\n this.resetPosition(opened_slide);\n this.slideIn(next_slide);\n \n opened_slide = next_slide;\n \n count = (count + 1) % all_slides.length;\n }\n \n function slideOut(el) {\n el.animate({ top: '180%' }, this.slideIOSpeed); // Slides an image down and out the frame _% in _ms.\n }\n \n function slideIn(el) {\n el.animate({ top: '0' }, this.slideIOSpeed); // Slides an image down and in the frame _% in _ms.\n }\n \n function resetPosition(el) {\n var prev_left_position = el.css('left');\n \n // Rather than setting the .css, using .animate is much smoother and reduces artifacts.\n el.animate({ left: '-1000px' }, 25);\n el.animate({ top: -(imgHeightDiff*100) + '%' }, 25);\n el.animate({ left: prev_left_position }, 25);\n }\n}", "title": "" }, { "docid": "54f259c265e5ffc31e5fdab927963830", "score": "0.5432887", "text": "function slider_area(){var owl=$('.testimonial-carousel').owlCarousel({margin:50,loop:true,autoplay:false,nav:false,dots:true,responsive:{0:{items:1},450:{items:1},768:{items:2},1000:{items:2},1360:{items:1},1600:{items:2}}});}", "title": "" }, { "docid": "9c55cb227323484765430c54edd5c007", "score": "0.5431689", "text": "function ws_basic(c,a,b){this.go=function(d){b.find(\"ul\").stop(true).animate({left:(d?-d+\"00%\":0)},c.duration,\"easeInOutExpo\");return d}}", "title": "" }, { "docid": "4333ad2e04d4d8157e0c4c3e9d628ae1", "score": "0.54292023", "text": "function initStage007(stage){\n\nvar item;\n\n// Percent of one unit. if you want to change unit size, change this.\nvar u=10;\n\n/////Animation Parameter/////\n//\n//dsp :display (true/false) startIndex.... display or hide\n//x : position x (percent)\n//y : position y (percent)\n//w : width (percent)\n//h : height (percent)\n//bgc : background-color\n//bdc : border-color\n//img : background-image (filename)\n//opc : opacity (0.0....1.0) default=1.0\n//z : z-index (default=2)\n//wd : character of word\n\n//Answer String\n//helper original string=kkb\"zz\"b\"xx word \"jj\nstage.setAnsStr(\"kkbbjj\");\nitem=stage.createNewItem();\n\n//class name\nitem.setName(\"vimrio\");\n\n//frame offset. default startindex=0\nitem.setFrameStartIndex(0);\nstage.addItem(item);\n\n//first frame\n//1 start\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":4*u,\"w\":u,\"h\":u,\"bgc\":\"transparent\",\"bdc\":\"blue\",\"img\":\"vimrio01.png\",\"z\":5,\"opc\":1.0,\"wd\":\"\"});\n//following next frames\n\n//2 k\nitem.addAnimation({\"y\":3*u});\n//3 k\nitem.addAnimation({\"y\":2*u});\n//4 b\nitem.addAnimation({\"x\":8*u});\n//5 b\nitem.addAnimation({\"x\":3*u});\n//6 j\nitem.addAnimation({\"y\":3*u});\n//7 j\nitem.addAnimation({\"y\":4*u});\n\n//1 goal\nitem=stage.createNewItem();\nitem.setName(\"goal\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"goal01.png\",\"bgc\":\"yellow\",\"bdc\":\"yellow\"});\nstage.addItem(item);\n\n//word \"zz\" [z] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"z\"});\nstage.addItem(item);\n\n//word \"zz\" [z] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"z\"});\nstage.addItem(item);\n\n//word \"xx word \" [ ] 1\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \"xx word \" [d] 2\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"d\"});\nstage.addItem(item);\n\n//word \"xx word \" [r] 3\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"r\"});\nstage.addItem(item);\n\n//word \"xx word \" [o] 4\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"o\"});\nstage.addItem(item);\n\n//word \"xx word \" [w] 5\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word01.png\",\"bgc\":\"transparent\",\"bdc\":\"white\",\"wd\":\"w\"});\nstage.addItem(item);\n\n//word \"xx word \" [ ] 6\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\" \"});\nstage.addItem(item);\n\n//word \"xx word \" [x] 7\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"x\"});\nstage.addItem(item);\n\n//word \"xx word \" [x] 8\nitem=stage.createNewItem();\nitem.setName(\"word\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":2*u,\"w\":u,\"h\":u,\"img\":\"word02.png\",\"bgc\":\"transparent\",\"bdc\":\"lightgray\",\"wd\":\"x\"});\nstage.addItem(item);\n\n\n\n//wall 1\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 2\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 3\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 4\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 5\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 6\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 7\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 8\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 9\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 10\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":1*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 11\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":0*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 12\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":1*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 13\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 14\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 15\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":5*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 16\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":6*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 17\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":7*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 18\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":3*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 19\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 20\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 21\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":4*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 22\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":2*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 23\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":3*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 24\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":4*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 25\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":8*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n//wall 26\nitem=stage.createNewItem();\nitem.setName(\"wall\");\nitem.addAnimation({\"dsp\":true,\"x\":9*u,\"y\":5*u,\"w\":u,\"h\":u,\"img\":\"brick01.png\",\"bgc\":\"BlanchedAlmond\",\"bdc\":\"peru\"});\nstage.addItem(item);\n\n\n}", "title": "" }, { "docid": "bf4657bf6c054aebeaa7cf72d0ced447", "score": "0.5429196", "text": "function ww_next_slide() {\n var slider_container = jQuery('.pm_gallery_container'),\n waterWheel = jQuery(slider_container).find('.pm_gallery'),\n elements = jQuery(waterWheel).children(),\n number_of_elements = elements.length,\n gallery_item = waterWheel.find('.pm_gallery_item'),\n current_item = waterWheel.find('.current_item'),\n prev_item = waterWheel.find('.prev_item'),\n next_item = waterWheel.find('.next_item'),\n prev_item_2 = waterWheel.find('.prev_item_2'),\n next_item_2 = waterWheel.find('.next_item_2'),\n cur_item_number = current_item.attr('data-number'),\n likes_container = jQuery('.pm_slide_likes_wrapper'),\n slide_likes = likes_container.find('.pm_add_like_button').detach();\n\n current_item.find('.pm_temp_likes_wrapper').html(slide_likes);\n\n if (cur_item_number == (number_of_elements - 2)) {\n current_item.removeClass('current_item').next().addClass('current_item');\n next_item.removeClass('next_item').next().addClass('next_item');\n next_item_2.removeClass('next_item_2');\n gallery_item.first().addClass('next_item_2');\n prev_item.removeClass('prev_item').next().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2').next().addClass('prev_item_2');\n\n } else if (cur_item_number == (number_of_elements - 1)) {\n current_item.removeClass('current_item').next().addClass('current_item');\n next_item.removeClass('next_item');\n gallery_item.first().addClass('next_item');\n next_item_2.removeClass('next_item_2').next().addClass('next_item_2');\n prev_item.removeClass('prev_item').next().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2').next().addClass('prev_item_2');\n\n } else if (cur_item_number == number_of_elements) {\n current_item.removeClass('current_item');\n gallery_item.first().addClass('current_item');\n next_item.removeClass('next_item').next().addClass('next_item');\n next_item_2.removeClass('next_item_2').next().addClass('next_item_2');\n prev_item.removeClass('prev_item').next().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2').next().addClass('prev_item_2');\n\n } else if (cur_item_number == '1') {\n current_item.removeClass('current_item').next().addClass('current_item');\n next_item.removeClass('next_item').next().addClass('next_item');\n next_item_2.removeClass('next_item_2').next().addClass('next_item_2');\n prev_item.removeClass('prev_item');\n gallery_item.first().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2').next().addClass('prev_item_2');\n\n } else if (cur_item_number == '2') {\n current_item.removeClass('current_item').next().addClass('current_item');\n next_item.removeClass('next_item').next().addClass('next_item');\n next_item_2.removeClass('next_item_2').next().addClass('next_item_2');\n prev_item.removeClass('prev_item').next().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2');\n gallery_item.first().addClass('prev_item_2');\n\n } else {\n current_item.removeClass('current_item').next().addClass('current_item');\n next_item.removeClass('next_item').next().addClass('next_item');\n next_item_2.removeClass('next_item_2').next().addClass('next_item_2');\n prev_item.removeClass('prev_item').next().addClass('prev_item');\n prev_item_2.removeClass('prev_item_2').next().addClass('prev_item_2');\n }\n\n current_item = waterWheel.find('.current_item');\n slide_likes = current_item.find('.pm_temp_likes_wrapper .pm_add_like_button').detach();\n\n likes_container.html(slide_likes);\n\n position_waterWheel();\n}", "title": "" }, { "docid": "6bae85201d918b7c1be12acbeacff20c", "score": "0.5428541", "text": "function sliderForward(){\n resetFrames();\n TweenMax.to(sliderWindow, 2, {xPercent: (tl.currentLabel())*(-100), ease: Power2.easeOut});\n}", "title": "" }, { "docid": "784b55d8bcdd1aac53055aeb7a442069", "score": "0.5424427", "text": "function clickNext()\n{\n slideshow.advance();\n}", "title": "" }, { "docid": "f1c0ccf22961e0330bc0f4cc6eb6f791", "score": "0.5421721", "text": "function nextSlides(n){\n showSlides_onClick(slIndex += n);\n }", "title": "" }, { "docid": "710e2e31b719de6fee46cabae863f1fc", "score": "0.54212654", "text": "function SlideWindow(name, url, p_wth, p_hgt, p_to) {\r\n\tthis.base = AbstractWindow;\r\n\tthis.base(url, 0, 0, p_wth, 1);\r\n\t/* Atributes */\r\n\tthis.name = name;\r\n\tthis.timeOut = p_to * 1000 || 15000; //TimeOut\r\n\tthis.yoEnd; //Ending move coordinate\r\n\tthis.xoEnd; //Ending move coordinate\r\n\tthis.process = -1; //Generic process\r\n\t\r\n\tthis.createContent = \tfunction() {\r\n\t\t\t\t\t\t\t\tvar ifrm = document.createElement(\"iframe\");\r\n\t\t\t\t\t\t\t\tifrm.className= this.classShow;\r\n\t\t\t\t\t\t\t\tifrm.setAttribute(\"class\", this.classShow);\r\n\t\t\t\t\t\t\t\tifrm.height = this.hgt;\r\n\t\t\t\t\t\t\t\tifrm.src = this.url;\r\n\t\t\t\t\t\t\t\tifrm.style.scrolling = \"auto\";\r\n\t\t\t\t\t\t\t\treturn ifrm;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\tthis.ultimoElementoActivo = function() {\r\n\t\t\t\t\t\t\t\t\tvar index = slideRegister.length - 1;\r\n\t\t\t\t\t\t\t\t\twhile ((index >= 0) && (slideRegister[index] == undefined)) index--;\r\n\t\t\t\t\t\t\t\t\tvar ret = (slideRegister[index])? slideRegister[index] : undefined;\r\n\t\t\t\t\t\t\t\t\t//Si se acumularon muchas ventanas cerradas y no hay ninguna activa, reinicio el registro.\r\n\t\t\t\t\t\t\t\t\tif ((!ret) && (slideRegister.length > 50)) slideRegister = Array();\r\n\t\t\t\t\t\t\t\t\treturn ret;\r\n\t\t\t\t\t\t\t\t}\r\n\t/* Determina Xo e Yo */\r\n\t//Asume que es la primera ventana.\r\n\tthis.xo = this.determineWidth() - this.wth - 5;\r\n\tthis.yo = this.determineHeight() - 5;\r\n\t//Se posiciona basandose en el slide anterior.\r\n\tvar elem = this.ultimoElementoActivo();\r\n\tif (elem != undefined) {\r\n\t\t//Se supone que la nueva ventana va a estar encima de la ultima mostrada.\r\n\t\tvar xoAux = this.xo;\r\n\t\tthis.xo = elem.xo;\r\n\t\t//Se calcula hasta donde llega, si se sale de la pantalla, lo mueve al costado.\r\n\t\tvar yoAux = elem.yoEnd;\r\n\t\tif ((yoAux - p_hgt) < 0)\r\n\t\t\t//Se va de pantalla.\t\r\n\t\t\tthis.xo = this.xo - this.wth - 5;\r\n\t\telse\r\n\t\t\t//No se va de pantalla.\r\n\t\t\tthis.yo = elem.yoEnd;\r\n\t}\r\n\t/* Determina la posicion final */\r\n\tthis.yoEnd = this.yo - p_hgt - 5;\r\n\tthis.xoEnd = this.xo;\r\n\t/* Se setean los estilos */\r\n\tthis.classShow = \"iwinSlideWindow\";\r\n\t/* Muestra la ventana */\r\n\tthis.show();\r\n\t/* Registra la ventana */\r\n\tslideRegister.push(this); \r\n\tslideNameRegister[this.name] = this;\r\n\t/* Mueve la ventana */\r\n\tiwinMoveIt(slideRegister.length - 1);\r\n\treturn this;\r\n}", "title": "" }, { "docid": "2836805097bec7baf0413ba96d4ef864", "score": "0.5419681", "text": "function sliderMove()\r\n{\r\n var offset = 0\r\n for (var t = 0; t < sliders.length; t++)\r\n {\r\n var slid = map(sin(angle+offset), -1, 1, 0, 255)\r\n sliders[t].value(slid)\r\n offset += vTest;\r\n } \r\n}", "title": "" }, { "docid": "c5a7ccb9755d72cdf889cfc049bb1e82", "score": "0.5416504", "text": "static get ANIM_STATIC() {return 0x00}", "title": "" }, { "docid": "47514163e75482c29f9d23878bdeef0c", "score": "0.5414005", "text": "function swapSlideProgress(container,opt){container.trigger('revolution.slide.onbeforeswap');opt.transition = 1;opt.videoplaying = false; //konsole.log(\"VideoPlay set to False due swapSlideProgress\");\ntry{var actli=container.find('>ul:first-child >li:eq(' + opt.act + ')');}catch(e) {var actli=container.find('>ul:first-child >li:eq(1)');}opt.lastslide = opt.act;var nextli=container.find('>ul:first-child >li:eq(' + opt.next + ')');var actsh=actli.find('.slotholder');var nextsh=nextli.find('.slotholder');actli.css({'visibility':'visible'});nextli.css({'visibility':'visible'});if(nextsh.data('kenburns') == \"on\"){stopKenBurn(container,opt);TweenLite.set(container.find('.kenburnimg img'),{autoAlpha:0});}if(opt.ie){if(comingtransition == \"boxfade\")comingtransition = \"boxslide\";if(comingtransition == \"slotfade-vertical\")comingtransition = \"slotzoom-vertical\";if(comingtransition == \"slotfade-horizontal\")comingtransition = \"slotzoom-horizontal\";} // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...\nif(nextli.data('delay') != undefined){opt.cd = 0;opt.delay = nextli.data('delay');}else {opt.delay = opt.origcd;}container.trigger('restarttimer'); // RESET POSITION AND FADES OF LI'S\nactli.css({'left':'0px','top':'0px'});nextli.css({'left':'0px','top':'0px'}); // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED\nif(nextli.data('differentissplayed') == 'prepared'){nextli.data('differentissplayed','done');nextli.data('transition',nextli.data('savedtransition'));nextli.data('slotamount',nextli.data('savedslotamount'));nextli.data('masterspeed',nextli.data('savedmasterspeed'));}if(nextli.data('fstransition') != undefined && nextli.data('differentissplayed') != \"done\"){nextli.data('savedtransition',nextli.data('transition'));nextli.data('savedslotamount',nextli.data('slotamount'));nextli.data('savedmasterspeed',nextli.data('masterspeed'));nextli.data('transition',nextli.data('fstransition'));nextli.data('slotamount',nextli.data('fsslotamount'));nextli.data('masterspeed',nextli.data('fsmasterspeed'));nextli.data('differentissplayed','prepared');} ///////////////////////////////////////\n// TRANSITION CHOOSE - RANDOM EFFECTS//\n///////////////////////////////////////\nvar nexttrans=0;var transtext=nextli.data('transition').split(\",\");var curtransid=nextli.data('nexttransid');if(curtransid == undefined){curtransid = 0;nextli.data('nexttransid',curtransid);}else {curtransid = curtransid + 1;if(curtransid == transtext.length)curtransid = 0;nextli.data('nexttransid',curtransid);}var comingtransition=transtext[curtransid];var specials=0;if(opt.parallax == \"scroll\" && opt.parallaxFirstGo == undefined){opt.parallaxFirstGo = true;scrollParallax(container,opt);setTimeout(function(){scrollParallax(container,opt);},210);setTimeout(function(){scrollParallax(container,opt);},420);} /*if (opt.ffnn == undefined) opt.ffnn=0;\n\t\t\tcomingtransition=opt.ffnn;\n\t\t\topt.ffnn=opt.ffnn+1;\n\t\t\tif (opt.ffnn>46) opt.ffnn=0;*/ /* Transition Name ,\n\t\t\t Transition Code,\n\t\t\t Transition Sub Code,\n\t\t\t Max Slots,\n\t\t\t MasterSpeed Delays,\n\t\t\t Preparing Slots (box,slideh, slidev),\n\t\t\t Call on nextsh (null = no, true/false for visibility first preparing),\n\t\t\t Call on actsh (null = no, true/false for visibility first preparing),\n\t\t\t*/if(comingtransition == \"slidehorizontal\"){comingtransition = \"slideleft\";if(opt.leftarrowpressed == 1)comingtransition = \"slideright\";}if(comingtransition == \"slidevertical\"){comingtransition = \"slideup\";if(opt.leftarrowpressed == 1)comingtransition = \"slidedown\";}var transitionsArray=[['boxslide',0,1,10,0,'box',false,null,0],['boxfade',1,0,10,0,'box',false,null,1],['slotslide-horizontal',2,0,0,200,'horizontal',true,false,2],['slotslide-vertical',3,0,0,200,'vertical',true,false,3],['curtain-1',4,3,0,0,'horizontal',true,true,4],['curtain-2',5,3,0,0,'horizontal',true,true,5],['curtain-3',6,3,25,0,'horizontal',true,true,6],['slotzoom-horizontal',7,0,0,400,'horizontal',true,true,7],['slotzoom-vertical',8,0,0,0,'vertical',true,true,8],['slotfade-horizontal',9,0,0,500,'horizontal',true,null,9],['slotfade-vertical',10,0,0,500,'vertical',true,null,10],['fade',11,0,1,300,'horizontal',true,null,11],['slideleft',12,0,1,0,'horizontal',true,true,12],['slideup',13,0,1,0,'horizontal',true,true,13],['slidedown',14,0,1,0,'horizontal',true,true,14],['slideright',15,0,1,0,'horizontal',true,true,15],['papercut',16,0,0,600,'',null,null,16],['3dcurtain-horizontal',17,0,20,100,'vertical',false,true,17],['3dcurtain-vertical',18,0,10,100,'horizontal',false,true,18],['cubic',19,0,20,600,'horizontal',false,true,19],['cube',19,0,20,600,'horizontal',false,true,20],['flyin',20,0,4,600,'vertical',false,true,21],['turnoff',21,0,1,1600,'horizontal',false,true,22],['incube',22,0,20,600,'horizontal',false,true,23],['cubic-horizontal',23,0,20,500,'vertical',false,true,24],['cube-horizontal',23,0,20,500,'vertical',false,true,25],['incube-horizontal',24,0,20,500,'vertical',false,true,26],['turnoff-vertical',25,0,1,1600,'horizontal',false,true,27],['fadefromright',12,1,1,0,'horizontal',true,true,28],['fadefromleft',15,1,1,0,'horizontal',true,true,29],['fadefromtop',14,1,1,0,'horizontal',true,true,30],['fadefrombottom',13,1,1,0,'horizontal',true,true,31],['fadetoleftfadefromright',12,2,1,0,'horizontal',true,true,32],['fadetorightfadetoleft',15,2,1,0,'horizontal',true,true,33],['fadetobottomfadefromtop',14,2,1,0,'horizontal',true,true,34],['fadetotopfadefrombottom',13,2,1,0,'horizontal',true,true,35],['parallaxtoright',12,3,1,0,'horizontal',true,true,36],['parallaxtoleft',15,3,1,0,'horizontal',true,true,37],['parallaxtotop',14,3,1,0,'horizontal',true,true,38],['parallaxtobottom',13,3,1,0,'horizontal',true,true,39],['scaledownfromright',12,4,1,0,'horizontal',true,true,40],['scaledownfromleft',15,4,1,0,'horizontal',true,true,41],['scaledownfromtop',14,4,1,0,'horizontal',true,true,42],['scaledownfrombottom',13,4,1,0,'horizontal',true,true,43],['zoomout',13,5,1,0,'horizontal',true,true,44],['zoomin',13,6,1,0,'horizontal',true,true,45],['notransition',26,0,1,0,'horizontal',true,null,46]];var flatTransitions=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45];var premiumTransitions=[16,17,18,19,20,21,22,23,24,25,26,27];var nexttrans=0;var specials=1;var STAindex=0;var indexcounter=0;var STA=new Array(); // RANDOM TRANSITIONS\nif(comingtransition == \"random\"){comingtransition = Math.round(Math.random() * transitionsArray.length - 1);if(comingtransition > transitionsArray.length - 1)comingtransition = transitionsArray.length - 1;} // RANDOM FLAT TRANSITIONS\nif(comingtransition == \"random-static\"){comingtransition = Math.round(Math.random() * flatTransitions.length - 1);if(comingtransition > flatTransitions.length - 1)comingtransition = flatTransitions.length - 1;comingtransition = flatTransitions[comingtransition];} // RANDOM PREMIUM TRANSITIONS\nif(comingtransition == \"random-premium\"){comingtransition = Math.round(Math.random() * premiumTransitions.length - 1);if(comingtransition > premiumTransitions.length - 1)comingtransition = premiumTransitions.length - 1;comingtransition = premiumTransitions[comingtransition];} //joomla only change: avoid papercut transition (16), change it to every other premium transition\nif(opt.isJoomla == true && comingtransition == 16){comingtransition = Math.round(Math.random() * premiumTransitions.length - 2) + 1;if(comingtransition > premiumTransitions.length - 1)comingtransition = premiumTransitions.length - 1;comingtransition = premiumTransitions[comingtransition];}findTransition(); // CHECK IF WE HAVE IE8 AND THAN FALL BACK ON FLAT TRANSITIONS\nif(isIE(8) && nexttrans > 15 && nexttrans < 28){comingtransition = Math.round(Math.random() * flatTransitions.length - 1);if(comingtransition > flatTransitions.length - 1)comingtransition = flatTransitions.length - 1;comingtransition = flatTransitions[comingtransition];indexcounter = 0;findTransition();}function findTransition(){ // FIND THE RIGHT TRANSITION PARAMETERS HERE\njQuery.each(transitionsArray,function(inde,trans){if(trans[0] == comingtransition || trans[8] == comingtransition){nexttrans = trans[1];specials = trans[2];STAindex = indexcounter;}indexcounter = indexcounter + 1;});}var direction=-1;if(opt.leftarrowpressed == 1 || opt.act > opt.next)direction = 1;opt.leftarrowpressed = 0;if(nexttrans > 26)nexttrans = 26;if(nexttrans < 0)nexttrans = 0; // DEFINE THE MASTERSPEED FOR THE SLIDE //\nvar masterspeed=300;if(nextli.data('masterspeed') != undefined && nextli.data('masterspeed') > 99 && nextli.data('masterspeed') < 4001)masterspeed = nextli.data('masterspeed'); // PREPARED DEFAULT SETTINGS PER TRANSITION\nSTA = transitionsArray[STAindex]; /////////////////////////////////////////////\n// SET THE BULLETS SELECTED OR UNSELECTED //\n/////////////////////////////////////////////\ncontainer.parent().find(\".bullet\").each(function(){var bul=jQuery(this);bul.removeClass(\"selected\");if(opt.navigationArrows == \"withbullet\" || opt.navigationArrows == \"nexttobullets\"){if(bul.index() - 1 == opt.next)bul.addClass('selected');}else {if(bul.index() == opt.next)bul.addClass('selected');}}); //////////////////////////////////////////////////////////////////\n// \t\tSET THE NEXT CAPTION AND REMOVE THE LAST CAPTION\t\t//\n//////////////////////////////////////////////////////////////////\ncontainer.find('>li').each(function(){var li=jQuery(this);if(li.index != opt.act && li.index != opt.next)li.css({'z-index':16});});actli.css({'z-index':18});nextli.css({'z-index':20});nextli.css({'opacity':0}); ///////////////////////////\n//\tANIMATE THE CAPTIONS //\n///////////////////////////\nif(actli.index() != nextli.index() && opt.firststart != 1){removeTheCaptions(actli,opt);}animateTheCaptions(nextli,opt); /////////////////////////////////////////////\n//\tSET THE ACTUAL AMOUNT OF SLIDES !! //\n// SET A RANDOM AMOUNT OF SLOTS //\n///////////////////////////////////////////\nif(nextli.data('slotamount') == undefined || nextli.data('slotamount') < 1){opt.slots = Math.round(Math.random() * 12 + 4);if(comingtransition == \"boxslide\")opt.slots = Math.round(Math.random() * 6 + 3);else if(comingtransition == \"flyin\")opt.slots = Math.round(Math.random() * 4 + 1);}else {opt.slots = nextli.data('slotamount');} /////////////////////////////////////////////\n//\tSET THE ACTUAL AMOUNT OF SLIDES !! //\n// SET A RANDOM AMOUNT OF SLOTS //\n///////////////////////////////////////////\nif(nextli.data('rotate') == undefined)opt.rotate = 0;else if(nextli.data('rotate') == 999)opt.rotate = Math.round(Math.random() * 360);else opt.rotate = nextli.data('rotate');if(!jQuery.support.transition || opt.ie || opt.ie9)opt.rotate = 0; //////////////////////////////\n//\tFIRST START \t\t\t//\n//////////////////////////////\nif(opt.firststart == 1){actli.css({'opacity':0});opt.firststart = 0;} // HERE COMES THE TRANSITION ENGINE\n// ADJUST MASTERSPEED\nmasterspeed = masterspeed + STA[4];if((nexttrans == 4 || nexttrans == 5 || nexttrans == 6) && opt.slots < 3)opt.slots = 3; // ADJUST SLOTS\nif(STA[3] != 0)opt.slots = Math.min(opt.slots,STA[3]);if(nexttrans == 9)opt.slots = opt.width / 20;if(nexttrans == 10)opt.slots = opt.height / 20; // PREPAREONESLIDEBOX\nif(STA[5] == \"box\"){if(STA[7] != null)prepareOneSlideBox(actsh,opt,STA[7]);if(STA[6] != null)prepareOneSlideBox(nextsh,opt,STA[6]);}else if(STA[5] == \"vertical\" || STA[5] == \"horizontal\"){if(STA[7] != null)prepareOneSlideSlot(actsh,opt,STA[7],STA[5]);if(STA[6] != null)prepareOneSlideSlot(nextsh,opt,STA[6],STA[5]);} // SHOW FIRST LI\nif(nexttrans < 12 || nexttrans > 16)nextli.css({'opacity':1}); /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 0){ // BOXSLIDE\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nvar maxz=Math.ceil(opt.height / opt.sloth);var curz=0;nextsh.find('.slotslide').each(function(j){var ss=jQuery(this);curz = curz + 1;if(curz == maxz)curz = 0;TweenLite.fromTo(ss,masterspeed / 600,{opacity:0,top:0 - opt.sloth,left:0 - opt.slotw,rotation:opt.rotate},{opacity:1,transformPerspective:600,top:0,left:0,scale:1,rotation:0,delay:(j * 15 + curz * 30) / 1500,ease:Power2.easeOut,onComplete:function onComplete(){if(j == opt.slots * opt.slots - 1){letItFree(container,opt,nextsh,actsh,nextli,actli);}}});});} /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 1){ //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nvar maxtime;nextsh.find('.slotslide').each(function(j){var ss=jQuery(this);rand = Math.random() * masterspeed + 300;rand2 = Math.random() * 500 + 200;if(rand + rand2 > maxtime)maxtime = rand2 + rand2;TweenLite.fromTo(ss,rand / 1000,{opacity:0,transformPerspective:600,rotation:opt.rotate},{opacity:1,ease:Power2.easeInOut,rotation:0,delay:rand2 / 1000});});setTimeout(function(){letItFree(container,opt,nextsh,actsh,nextli,actli);},masterspeed + 300);} /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 2){ //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\nactsh.find('.slotslide').each(function(){var ss=jQuery(this);TweenLite.to(ss,masterspeed / 1000,{left:opt.slotw,rotation:0 - opt.rotate,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{left:0 - opt.slotw,rotation:opt.rotate,transformPerspective:600},{left:0,rotation:0,ease:Power2.easeOut,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 3){ //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\nactsh.find('.slotslide').each(function(){var ss=jQuery(this);TweenLite.to(ss,masterspeed / 1000,{top:opt.sloth,rotation:opt.rotate,transformPerspective:600,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{top:0 - opt.sloth,rotation:opt.rotate,transformPerspective:600},{top:0,rotation:0,ease:Power2.easeOut,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 4 || nexttrans == 5){ //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nvar cspeed=masterspeed / 1000;var ticker=cspeed;actsh.find('.slotslide').each(function(i){var ss=jQuery(this);var del=i * cspeed / opt.slots;if(nexttrans == 5)del = (opt.slots - i - 1) * cspeed / opt.slots / 1.5;TweenLite.to(ss,cspeed * 3,{transformPerspective:600,top:0 + opt.height,opacity:0.5,rotation:opt.rotate,ease:Power2.easeInOut,delay:del});}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this);var del=i * cspeed / opt.slots;if(nexttrans == 5)del = (opt.slots - i - 1) * cspeed / opt.slots / 1.5;TweenLite.fromTo(ss,cspeed * 3,{top:0 - opt.height,opacity:0.5,rotation:opt.rotate,transformPerspective:600},{top:0,opacity:1,rotation:0,ease:Power2.easeInOut,delay:del,onComplete:function onComplete(){if(i == opt.slots - 1){letItFree(container,opt,nextsh,actsh,nextli,actli);}}});});} /////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION I. //\n////////////////////////////////////\nif(nexttrans == 6){if(opt.slots < 2)opt.slots = 2; //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);actsh.find('.slotslide').each(function(i){var ss=jQuery(this);if(i < opt.slots / 2)var tempo=(i + 2) * 60;else var tempo=(2 + opt.slots - i) * 60;TweenLite.to(ss,(masterspeed + tempo) / 1000,{top:0 + opt.height,opacity:1,rotation:opt.rotate,transformPerspective:600,ease:Power2.easeInOut});}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this);if(i < opt.slots / 2)var tempo=(i + 2) * 60;else var tempo=(2 + opt.slots - i) * 60;TweenLite.fromTo(ss,(masterspeed + tempo) / 1000,{top:0 - opt.height,opacity:1,rotation:opt.rotate,transformPerspective:600},{top:0,opacity:1,rotation:0,ease:Power2.easeInOut,onComplete:function onComplete(){if(i == Math.round(opt.slots / 2)){letItFree(container,opt,nextsh,actsh,nextli,actli);}}});});} ////////////////////////////////////\n// THE SLOTSZOOM - TRANSITION II. //\n////////////////////////////////////\nif(nexttrans == 7){masterspeed = masterspeed * 2; //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100); // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\nactsh.find('.slotslide').each(function(){var ss=jQuery(this).find('div');TweenLite.to(ss,masterspeed / 1000,{left:0 - opt.slotw / 2 + 'px',top:0 - opt.height / 2 + 'px',width:opt.slotw * 2 + \"px\",height:opt.height * 2 + \"px\",opacity:0,rotation:opt.rotate,transformPerspective:600,ease:Power2.easeOut});}); //////////////////////////////////////////////////////////////\n// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\n///////////////////////////////////////////////////////////////\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this).find('div');TweenLite.fromTo(ss,masterspeed / 1000,{left:0,top:0,opacity:0,transformPerspective:600},{left:0 - i * opt.slotw + 'px',ease:Power2.easeOut,top:0 + 'px',width:opt.width,height:opt.height,opacity:1,rotation:0,delay:0.1,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} ////////////////////////////////////\n// THE SLOTSZOOM - TRANSITION II. //\n////////////////////////////////////\nif(nexttrans == 8){masterspeed = masterspeed * 3; //SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\nactsh.find('.slotslide').each(function(){var ss=jQuery(this).find('div');TweenLite.to(ss,masterspeed / 1000,{left:0 - opt.width / 2 + 'px',top:0 - opt.sloth / 2 + 'px',width:opt.width * 2 + \"px\",height:opt.sloth * 2 + \"px\",transformPerspective:600,opacity:0,rotation:opt.rotate});}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\n///////////////////////////////////////////////////////////////\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this).find('div');TweenLite.fromTo(ss,masterspeed / 1000,{left:0,top:0,opacity:0,transformPerspective:600},{'left':0 + 'px','top':0 - i * opt.sloth + 'px','width':nextsh.find('.defaultimg').data('neww') + \"px\",'height':nextsh.find('.defaultimg').data('newh') + \"px\",opacity:1,rotation:0,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} ////////////////////////////////////////\n// THE SLOTSFADE - TRANSITION III. //\n//////////////////////////////////////\nif(nexttrans == 9 || nexttrans == 10){nextsh.find('.defaultimg').css({'opacity':0});var ssamount=0; // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this);ssamount++;TweenLite.fromTo(ss,masterspeed / 1000,{opacity:0,transformPerspective:600,left:0,top:0},{opacity:1,ease:Power2.easeInOut,delay:i * 4 / 1000});}); //nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4)));\nsetTimeout(function(){letItFree(container,opt,nextsh,actsh,nextli,actli);},masterspeed + ssamount * 4);} ///////////////////////////\n// SIMPLE FADE ANIMATION //\n///////////////////////////\nif(nexttrans == 11 || nexttrans == 26){nextsh.find('.defaultimg').css({'opacity':0,'position':'relative'});var ssamount=0;if(nexttrans == 26)masterspeed = 0; // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(i){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{opacity:0},{opacity:1,ease:Power2.easeInOut});});setTimeout(function(){letItFree(container,opt,nextsh,actsh,nextli,actli);},masterspeed + 15);}if(nexttrans == 12 || nexttrans == 13 || nexttrans == 14 || nexttrans == 15){ //masterspeed = masterspeed * 3;\nsetTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);nextsh.find('.defaultimg').css({'opacity':0}); //\tkill();\nvar oow=opt.width;var ooh=opt.height; // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nvar ssn=nextsh.find('.slotslide');if(opt.fullWidth == \"on\" || opt.fullSreen == \"on\"){oow = ssn.width();ooh = ssn.height();}var twx=0;var twy=0;if(nexttrans == 12)twx = oow;else if(nexttrans == 15)twx = 0 - oow;else if(nexttrans == 13)twy = ooh;else if(nexttrans == 14)twy = 0 - ooh; // SPECIALS FOR EXTENDED ANIMATIONS\nvar op=1;var scal=1;var fromscale=1;var easeitout=Power2.easeInOut;var easeitin=Power2.easeInOut;var speedy=masterspeed / 1000;var speedy2=speedy; // DEPENDING ON EXTENDED SPECIALS, DIFFERENT SCALE AND OPACITY FUNCTIONS NEED TO BE ADDED\nif(specials == 1)op = 0;if(specials == 2)op = 0;if(specials == 3){easeitout = Power2.easeInOut;easeitin = Power1.easeInOut;actli.css({'position':'absolute','z-index':20});nextli.css({'position':'absolute','z-index':15});speedy = masterspeed / 1200;}if(specials == 4 || specials == 5)scal = 0.6;if(specials == 6)scal = 1.4;if(specials == 5 || specials == 6){fromscale = 1.4;op = 0;oow = 0;ooh = 0;twx = 0;twy = 0;}if(specials == 6)fromscale = 0.6;TweenLite.fromTo(ssn,speedy,{left:twx,top:twy,scale:fromscale,opacity:op,rotation:opt.rotate},{opacity:1,rotation:0,left:0,top:0,scale:1,ease:easeitin,onComplete:function onComplete(){letItFree(container,opt,nextsh,actsh,nextli,actli);actli.css({'position':'absolute','z-index':18});nextli.css({'position':'absolute','z-index':20});}});var ssa=actsh.find('.slotslide');if(specials == 4 || specials == 5){oow = 0;ooh = 0;}if(specials != 1){if(nexttrans == 12)TweenLite.to(ssa,speedy2,{'left':0 - oow + 'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});else if(nexttrans == 15)TweenLite.to(ssa,speedy2,{'left':oow + 'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});else if(nexttrans == 13)TweenLite.to(ssa,speedy2,{'top':0 - ooh + 'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});else if(nexttrans == 14)TweenLite.to(ssa,speedy2,{'top':ooh + 'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});}nextli.css({'opacity':1});} //////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XVI. //\n//////////////////////////////////////\nif(nexttrans == 16){ // PAPERCUT\nactli.css({'position':'absolute','z-index':20});nextli.css({'position':'absolute','z-index':15}); // PREPARE THE CUTS\nactli.wrapInner('<div class=\"tp-half-one\" style=\"position:relative; width:100%;height:100%\"></div>');actli.find('.tp-half-one').clone(true).appendTo(actli).addClass(\"tp-half-two\");actli.find('.tp-half-two').removeClass('tp-half-one');var oow=opt.width;var ooh=opt.height;if(opt.autoHeight == \"on\")ooh = container.height();actli.find('.tp-half-one .defaultimg').wrap('<div class=\"tp-papercut\" style=\"width:' + oow + 'px;height:' + ooh + 'px;\"></div>');actli.find('.tp-half-two .defaultimg').wrap('<div class=\"tp-papercut\" style=\"width:' + oow + 'px;height:' + ooh + 'px;\"></div>');actli.find('.tp-half-two .defaultimg').css({position:'absolute',top:'-50%'});actli.find('.tp-half-two .tp-caption').wrapAll('<div style=\"position:absolute;top:-50%;left:0px\"></div>');TweenLite.set(actli.find('.tp-half-two'),{width:oow,height:ooh,overflow:'hidden',zIndex:15,position:'absolute',top:ooh / 2,left:'0px',transformPerspective:600,transformOrigin:\"center bottom\"});TweenLite.set(actli.find('.tp-half-one'),{width:oow,height:ooh / 2,overflow:'visible',zIndex:10,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:\"center top\"}); // ANIMATE THE CUTS\nvar img=actli.find('.defaultimg');var ro1=Math.round(Math.random() * 20 - 10);var ro2=Math.round(Math.random() * 20 - 10);var ro3=Math.round(Math.random() * 20 - 10);var xof=Math.random() * 0.4 - 0.2;var yof=Math.random() * 0.4 - 0.2;var sc1=Math.random() * 1 + 1;var sc2=Math.random() * 1 + 1;TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed / 1000,{width:oow,height:ooh / 2,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:\"center top\"},{scale:sc1,rotation:ro1,y:0 - ooh - ooh / 4,ease:Power2.easeInOut});setTimeout(function(){TweenLite.set(actli.find('.tp-half-one'),{overflow:'hidden'});},50);TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed / 2000,{opacity:1,transformPerspective:600,transformOrigin:\"center center\"},{opacity:0,delay:masterspeed / 2000});TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed / 1000,{width:oow,height:ooh,overflow:'hidden',position:'absolute',top:ooh / 2,left:'0px',transformPerspective:600,transformOrigin:\"center bottom\"},{scale:sc2,rotation:ro2,y:ooh + ooh / 4,ease:Power2.easeInOut});TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed / 2000,{opacity:1,transformPerspective:600,transformOrigin:\"center center\"},{opacity:0,delay:masterspeed / 2000});if(actli.html() != null)TweenLite.fromTo(nextli,(masterspeed - 200) / 1000,{opacity:0,scale:0.8,x:opt.width * xof,y:ooh * yof,rotation:ro3,transformPerspective:600,transformOrigin:\"center center\"},{rotation:0,scale:1,x:0,y:0,opacity:1,ease:Power2.easeInOut});nextsh.find('.defaultimg').css({'opacity':1});setTimeout(function(){ // CLEAN UP BEFORE WE START\nactli.css({'position':'absolute','z-index':18});nextli.css({'position':'absolute','z-index':20});nextsh.find('.defaultimg').css({'opacity':1});actsh.find('.defaultimg').css({'opacity':0});if(actli.find('.tp-half-one').length > 0){actli.find('.tp-half-one .defaultimg').unwrap();actli.find('.tp-half-one .slotholder').unwrap();}actli.find('.tp-half-two').remove();opt.transition = 0;opt.act = opt.next;},masterspeed);nextli.css({'opacity':1});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XVII. //\n///////////////////////////////////////\nif(nexttrans == 17){ // 3D CURTAIN HORIZONTAL\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 800,{opacity:0,rotationY:0,scale:0.9,rotationX:-110,transformPerspective:600,transformOrigin:\"center center\"},{opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,rotationY:0,ease:Power3.easeOut,delay:j * 0.06,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XVIII. //\n///////////////////////////////////////\nif(nexttrans == 18){ // 3D CURTAIN VERTICAL\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0}); // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nnextsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 500,{opacity:0,rotationY:310,scale:0.9,rotationX:10,transformPerspective:600,transformOrigin:\"center center\"},{opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,rotationY:0,ease:Power3.easeOut,delay:j * 0.06,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XIX. //\n///////////////////////////////////////\nif(nexttrans == 19 || nexttrans == 22){ // IN CUBE\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);var chix=nextli.css('z-index');var chix2=actli.css('z-index');var rot=90;var op=1;if(direction == 1)rot = -90;if(nexttrans == 19){var torig=\"center center -\" + opt.height / 2;op = 0;}else {var torig=\"center center \" + opt.height / 2;} // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n//if (nexttrans==129) {\nTweenLite.fromTo(nextsh,masterspeed / 2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,ease:Power1.easeInOut,z:-40});TweenLite.fromTo(nextsh,masterspeed / 2000,{transformPerspective:600,z:-40,rotationY:1},{rotationY:0,z:0,ease:Power1.easeInOut,x:0,delay:3 * (masterspeed / 4000)});TweenLite.fromTo(actsh,masterspeed / 2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,x:0,ease:Power1.easeInOut,z:-40});TweenLite.fromTo(actsh,masterspeed / 2000,{transformPerspective:600,z:-40,x:0,rotationY:1},{rotationY:0,z:0,x:0,ease:Power1.easeInOut,delay:3 * (masterspeed / 4000)}); //}\nnextsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{left:0,rotationY:opt.rotate,opacity:op,top:0,scale:0.8,transformPerspective:600,transformOrigin:torig,rotationX:rot},{left:0,rotationY:0,opacity:1,top:0,z:0,scale:1,rotationX:0,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:1,delay:j * 50 / 1000 + masterspeed / 3000});});actsh.find('.slotslide').each(function(j){var ss=jQuery(this);var rot=-90;if(direction == 1)rot = 90;TweenLite.fromTo(ss,masterspeed / 1000,{opacity:1,rotationY:0,top:0,z:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationX:0},{opacity:1,rotationY:opt.rotate,top:0,scale:0.8,rotationX:rot,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:0,delay:j * 50 / 1000 + (masterspeed / 1000 - masterspeed / 10000)});});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XX. //\n///////////////////////////////////////\nif(nexttrans == 20){ // FLYIN\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);var chix=nextli.css('z-index');var chix2=actli.css('z-index');if(direction == 1){var ofx=-opt.width;var rot=70;var torig=\"left center -\" + opt.height / 2;}else {var ofx=opt.width;var rot=-70;var torig=\"right center -\" + opt.height / 2;}nextsh.find('.slotslide').each(function(j){var ss=jQuery(this); //ss.css({overflow:'visible'});\nTweenLite.fromTo(ss,masterspeed / 1500,{left:ofx,rotationX:40,z:-600,opacity:op,top:0,transformPerspective:600,transformOrigin:torig,rotationY:rot},{left:0,delay:j * 50 / 1000,ease:Power2.easeInOut});TweenLite.fromTo(ss,masterspeed / 1000,{rotationX:40,z:-600,opacity:op,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},{rotationX:0,opacity:1,top:0,z:0,scale:1,rotationY:0,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:1,delay:j * 50 / 1000 + masterspeed / 2000});});actsh.find('.slotslide').each(function(j){var ss=jQuery(this); //ss.css({overflow:'visible'});\nif(direction != 1){var ofx=-opt.width;var rot=70;var torig=\"left center -\" + opt.height / 2;}else {var ofx=opt.width;var rot=-70;var torig=\"right center -\" + opt.height / 2;}TweenLite.fromTo(ss,masterspeed / 1000,{opacity:1,rotationX:0,top:0,z:0,scale:1,left:0,transformPerspective:600,transformOrigin:torig,rotationY:0},{opacity:1,rotationX:40,top:0,z:-600,left:ofx,scale:0.8,rotationY:rot,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:0,delay:j * 50 / 1000 + (masterspeed / 1000 - masterspeed / 10000)});});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XX. //\n///////////////////////////////////////\nif(nexttrans == 21 || nexttrans == 25){ // TURNOFF\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);var chix=nextli.css('z-index');var chix2=actli.css('z-index');if(direction == 1){var ofx=-opt.width;var rot=110;if(nexttrans == 25){var torig=\"center top 0\";rot2 = -rot;rot = opt.rotate;}else {var torig=\"left center 0\";rot2 = opt.rotate;}}else {var ofx=opt.width;var rot=-110;if(nexttrans == 25){var torig=\"center bottom 0\";rot2 = -rot;rot = opt.rotate;}else {var torig=\"right center 0\";rot2 = opt.rotate;}}nextsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1500,{left:0,rotationX:rot2,z:0,opacity:0,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},{left:0,rotationX:0,top:0,z:0,scale:1,rotationY:0,delay:j * 100 / 1000 + masterspeed / 10000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.3,{opacity:1,delay:j * 100 / 1000 + masterspeed * 0.2 / 2000 + masterspeed / 10000});});if(direction != 1){var ofx=-opt.width;var rot=90;if(nexttrans == 25){var torig=\"center top 0\";rot2 = -rot;rot = opt.rotate;}else {var torig=\"left center 0\";rot2 = opt.rotate;}}else {var ofx=opt.width;var rot=-90;if(nexttrans == 25){var torig=\"center bottom 0\";rot2 = -rot;rot = opt.rotate;}else {var torig=\"right center 0\";rot2 = opt.rotate;}}actsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 3000,{left:0,rotationX:0,z:0,opacity:1,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:0},{left:0,rotationX:rot2,top:0,z:0,scale:1,rotationY:rot,delay:j * 100 / 1000,ease:Power1.easeInOut});TweenLite.to(ss,0.2,{opacity:0,delay:j * 50 / 1000 + (masterspeed / 3000 - masterspeed / 10000)});});} ////////////////////////////////////////\n// THE SLOTSLIDE - TRANSITION XX. //\n///////////////////////////////////////\nif(nexttrans == 23 || nexttrans == 24){ // cube-horizontal - inboxhorizontal\n//SET DEFAULT IMG UNVISIBLE\nnextsh.find('.defaultimg').css({'opacity':0});setTimeout(function(){actsh.find('.defaultimg').css({opacity:0});},100);var chix=nextli.css('z-index');var chix2=actli.css('z-index');var rot=-90;if(direction == 1)rot = 90;var op=1;if(nexttrans == 23){var torig=\"center center -\" + opt.width / 2;op = 0;}else {var torig=\"center center \" + opt.width / 2;}var opx=0; // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\nTweenLite.fromTo(nextsh,masterspeed / 2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,ease:Power1.easeInOut,z:-90});TweenLite.fromTo(nextsh,masterspeed / 2000,{transformPerspective:600,z:-90,rotationY:1},{rotationY:0,z:0,ease:Power1.easeInOut,x:0,delay:3 * (masterspeed / 4000)});TweenLite.fromTo(actsh,masterspeed / 2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,x:0,ease:Power1.easeInOut,z:-90});TweenLite.fromTo(actsh,masterspeed / 2000,{transformPerspective:600,z:-90,x:0,rotationY:1},{rotationY:0,z:0,x:0,ease:Power1.easeInOut,delay:3 * (masterspeed / 4000)});nextsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{left:opx,rotationX:opt.rotate,opacity:op,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},{left:0,rotationX:0,opacity:1,top:0,z:0,scale:1,rotationY:0,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:1,delay:j * 50 / 1000 + masterspeed / 3000});});rot = 90;if(direction == 1)rot = -90;actsh.find('.slotslide').each(function(j){var ss=jQuery(this);TweenLite.fromTo(ss,masterspeed / 1000,{left:0,opacity:1,rotationX:0,top:0,z:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:0},{left:opx,opacity:1,rotationX:opt.rotate,top:0,scale:1,rotationY:rot,delay:j * 50 / 1000,ease:Power2.easeInOut,onComplete:function onComplete(){if(j == opt.slots - 1)letItFree(container,opt,nextsh,actsh,nextli,actli);}});TweenLite.to(ss,0.1,{opacity:0,delay:j * 50 / 1000 + (masterspeed / 1000 - masterspeed / 10000)});});}var data={};data.slideIndex = opt.next + 1;container.trigger('revolution.slide.onchange',data);setTimeout(function(){container.trigger('revolution.slide.onafterswap');},masterspeed);container.trigger('revolution.slide.onvideostop');}", "title": "" } ]
a8985f3f1713ed66a4a955fb98c6351e
Set Screen Size and Resize Accordingly
[ { "docid": "bfff4e3400a0dbbc950b6260cc0583f6", "score": "0.0", "text": "function goFullScreen(){\n\tgame.scale.pageAlignHorizontally = true;\n\tgame.scale.pageAlignVertically = true;\n\t// using RESIZE scale mode\n\tgame.scale.scaleMode = Phaser.ScaleManager.RESIZE;\n\tgame.scale.setGameSize(true);\n}", "title": "" } ]
[ { "docid": "668be78bf8ae7508834c24d5e28bfa23", "score": "0.78069353", "text": "updateScreenSize(screesSize) { }", "title": "" }, { "docid": "3c1ca11d7d4c0d3b03b114f212fe9c2d", "score": "0.7753094", "text": "function set_size() {\n current_width = window.innerWidth;\n current_height = window.innerHeight;\n current_ratio = current_width / current_height;\n // desktop\n if (current_ratio > default_ratio) {\n h = default_height;\n w = default_width;\n // desktop\n } else {\n margin.left = 40;\n w = current_width - 40;\n h = w / default_ratio;\n //mobile\n }\n // Set new width and height based on graph dimensions\n width = w - margin.left - margin.right;\n height = h - margin.top - margin.bottom;\n }", "title": "" }, { "docid": "ba77d4ae2fdd51c9d9242b5034bff709", "score": "0.7476466", "text": "function ao_module_setWindowSize(width, height){\n if (!ao_module_virtualDesktop){\n return;\n }\n parent.setFloatWindowSize(ao_module_windowID, width, height)\n}", "title": "" }, { "docid": "20d399ff3a3a0302fcdcec4da0e81be2", "score": "0.74404466", "text": "function setSize() {\n if (navigator.standalone === true) return;\n var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n var iw = (iOS) ? document.documentElement.clientWidth : window.innerWidth;\n var ih = (iOS) ? document.documentElement.clientHeight : window.innerHeight;\n $(\"body\").css(\"--vw\", iw / 100 + \"px\");\n $(\"body\").css(\"--vh\", ih / 100 + \"px\");\n}", "title": "" }, { "docid": "e4c31a1bff7af4891708738ba48b7ccf", "score": "0.74326587", "text": "SET_SCREEN_SIZE(state, value) {\n state.screenSize = value\n }", "title": "" }, { "docid": "e3dc7ffa38c866449f23ef7b332c2aea", "score": "0.74104404", "text": "function setSizes() {\n\t// set the size of the screen and all the buttons and set up the scrolling/zoomingvar \n\tvar width = window.innerWidth;\n\tvar height = window.innerHeight;\n\t\n\tDRAWING_SIZE = height/720 * (WORLD_STATE['zoom'])/10;\n\tresizeButtons(width, height);\n\treturn {'width':width, 'height':height};\n}", "title": "" }, { "docid": "371f80f4f15812f82da051ce20f7c83a", "score": "0.73751956", "text": "function setScreenDimensions(width, height, scaleFactor) {\n screenDimensions.width = Number(width);\n screenDimensions.height = Number(height);\n screenDimensions.scaleFactor = Number(scaleFactor);\n\n //Initialise popup location\n popupLoc.x = width - (popupLoc.width * scaleFactor);\n popupLoc.y = 0;\n popupLoc.height = height / scaleFactor;\n\n // Initialise trigger location\n triggerLoc.width = triggerSizes.medium.width;\n triggerLoc.height = triggerSizes.medium.height;\n triggerLoc.x = width - (triggerLoc.width * scaleFactor);\n triggerLoc.y = height - (triggerLoc.height * scaleFactor);\n}", "title": "" }, { "docid": "9352eead6331874774a33138115ba821", "score": "0.7361263", "text": "function resize(){global.screenWidth=window.innerWidth;global.screenHeight=window.innerHeight;canvasGameBoard.setHeight(global.screenHeight);canvasGameBoard.setWidth(global.screenWidth);socket.emit('windowResized',{screenWidth:global.screenWidth,screenHeight:global.screenHeight});}", "title": "" }, { "docid": "bf845783204ec0f9af01c81f06d91c2a", "score": "0.7322362", "text": "function Setsize(){\n\t// delimitar el interior de pantalla\n\tmaxWidth= window.innerWidth();\n\tmaxHeight= window.innerHeight();\n\t// canvas ya tiene el ancho y alto\n\tcanvas.width=maxWidth;\n\tcanvas.height=maxHeight;\n}", "title": "" }, { "docid": "bd0722eb0982f92081f79f141c2580fc", "score": "0.7275183", "text": "function resize() {\n smallScreen = width(body) < SMALL_SCREEN_WIDTH;\n refitSidebar();\n refitContent();\n switch (mode) {\n case VISUALISE:\n refitVisualise();\n break;\n case CONFIGURE:\n refitConfigure();\n break;\n }\n }", "title": "" }, { "docid": "7b3af16e8af720d4fedd2fe1e6b82727", "score": "0.7273733", "text": "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "title": "" }, { "docid": "7e599a17b60da3cf54bd55dcbb954c0f", "score": "0.7271984", "text": "function resize()\n\t{\n\t\tvar wW = window.innerWidth \t* dip;\n\t\tvar wH = window.innerHeight * dip;\n\t\tvar newWidth \t= wW;\n\t\tvar newHeight \t= wH;\n\t\tvar widthToHeight \t\t= appWidth / appHeight;\n\t\tvar newWidthToHeight \t= newWidth / newHeight;\n\n\t\tif (newWidthToHeight > widthToHeight)\n\t\t{\n\t\t\tnewWidth = newHeight * widthToHeight;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewHeight = newWidth / widthToHeight;\n\t\t}\n\n\t\t// Make sure it's centered on the screen\n\t\trenderer.resize(newWidth, newHeight);\n\t\tcanvas.style.left \t= (wW - newWidth)\t/2 + 'px';\n\t\tcanvas.style.top \t= (wH - newHeight)\t/2 + 'px';\n\t}", "title": "" }, { "docid": "43275daa9ca9ad72102d44c44a78cdb2", "score": "0.7217832", "text": "function updateSize() {\n\t\t\tsetWindowSize({mobile: responsiveBreakpoint < window.innerWidth ? false : true, width: window.innerWidth, height: window.innerHeight})\n\t\t}", "title": "" }, { "docid": "d85ef9ca1cf41588847cf0d52b89eaec", "score": "0.719315", "text": "function adaptToScreen(that){\n if (that.game.device.desktop)\n {\n game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;\n game.stage.scale.pageAlignHorizontally = true;\n /*game.input.onDown.add(function(){\n game.scale.startFullScreen();\n return false;\n }, this);*/\n }\n else\n {\n game.stage.scale.minWidth = game.width /4;\n game.stage.scale.minHeight = game.height /4;\n game.stage.scale.maxWidth = game.width * 4;\n game.stage.scale.maxHeight = game.height * 4;\n game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;\n game.stage.scale.pageAlignHorizontally = true;\n game.stage.scale.pageAlignVeritcally = true;\n }\n}", "title": "" }, { "docid": "66fe96868590fa4e246a2d6ea2948e4b", "score": "0.7170458", "text": "function winResize() {\r\n\t\t\t\twidth = $(window).width();\r\n\t\t\t\theight = $(window).height();\r\n\t\t\t}", "title": "" }, { "docid": "2bab284ac6931ee46fa2a191834f12d5", "score": "0.716829", "text": "function setSize(){\n\n if(window.innerHeight > window.innerWidth){\n vh = window.innerHeight * 0.01;\n vw = window.innerWidth * 0.01;\n }else{\n vh = window.innerWidth * 0.01;\n vw = window.innerHeight * 0.01;\n }\n\n // Then we set the value in the --vh custom property to the root of the document\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n document.documentElement.style.setProperty('--vw', `${vw}px`);\n\n}", "title": "" }, { "docid": "d9b922f2ac8ce3fd9b3055396c8a1c9a", "score": "0.71275353", "text": "function updateWindowSize() {\n\n width = getWidth();\n height = getHeight();\n\n}", "title": "" }, { "docid": "73185f1b6b409f81d8c030a4b5adfd3b", "score": "0.71247166", "text": "function handleResize() {\n setWindowHeight(getWindowHeight())\n setWindowWidth(getWindowWidth())\n }", "title": "" }, { "docid": "16a2075767b670795e541d5621673061", "score": "0.7110479", "text": "function handleResize() { \n if (window.innerWidth <= 480) {\n setSize(25)\n } else {\n setSize(40)\n }\n }", "title": "" }, { "docid": "38a4497aef46fd6d9c81a883e066bbba", "score": "0.70425177", "text": "function setMobileSize() {\n var d = getWindowDimension();\n var aspectRatio = {}; \t\t\t\t\t\t\t\t\t\t\t\t\t\t// dynamically set the screen ratio\n if ($(\"#sizeHelper\").height() > $(\"#sizeHelper\").width()) {\t\t\t\t\t// portrait\n aspectRatio = landscapeRatio;\n } else {\n aspectRatio.width = $(\"#sizeHelper\").width();\n aspectRatio.height = $(\"#sizeHelper\").height();\n var r = aspectRatio.width / aspectRatio.height;\n if (r > 1.7) {\n aspectRatio.width = 1.7 * aspectRatio.height; // This is the minimum aspect ratio we can support\n }\n }\n\n d.height = $(\"#sizeHelper\").height(); // base the height off this element\n var scale = Math.min(d.width / aspectRatio.width, d.height / aspectRatio.height),\n w = Math.round(scale * aspectRatio.width), h = Math.round(scale* aspectRatio.height),\n x = w / 10; // 12 we could make this smaller depending on the aspect ratio?\n $(\"#game\").css(\"font-size\", x + \"px\"); // Adjust the value of 1em\n info(\"setSize - touch device setting font-size to \"+x);\n\n window.scrollTo(0, 1);\n // resetBounceAnimation\n if (recur == null || recur < 4) {\n setTimeout(function() {\n setPokerSize(recur ? 1 : recur++); // run it once more just incase we can make it better now\n }, 1000);\n }\n when.done(\"size-set\");\n }", "title": "" }, { "docid": "bf9366ee2d0e2db5827c106fc28acd52", "score": "0.70406634", "text": "function setBoardSize() {\n\tif ($(window).width() >= 1920 && $(window).height() >= 1080) {\n\t\twindow.parent.document.body.style.zoom = 1.5\n\t}\n\tif ($(window).width() >= 1170 && $(window).height() >= 650) {\n\t\twindow.parent.document.body.style.zoom = 1.15\n\t}\n\telse {\n\t\twindow.parent.document.body.style.zoom = 1\n\t}\n}", "title": "" }, { "docid": "4850a26cc09cfe604471d5e206e93c80", "score": "0.70384455", "text": "function resize() {\n\theight = window.innerHeight;\n\twidth = window.innerWidth;\n\theight = 100;\n\twidth = 100;\n\tcanvas.height = height;\n\tcanvas.width = width;\n\n\tinit();\n}", "title": "" }, { "docid": "88d8f6a37f6fe1182c21046ec57b5813", "score": "0.700627", "text": "windowResize() {\n const fl_a = this.mode & 0b1111;\n if (fl_a == MFWebGL.FULLSCREEN && this.autoResizing)\n this.resize();\n }", "title": "" }, { "docid": "199fd4ad66b139791ac05e0d5acd5a6a", "score": "0.69906545", "text": "_resize() {\n\t\tthis._width = window.innerWidth;\n\t\tthis._height = window.innerHeight;\n\t\tthis.canvas.resize(this._width, this._height);\n\t\tif (this._screen != null)\n\t\t\tthis._screen.resize(this._width, this._height);\n\t}", "title": "" }, { "docid": "9d598d947048698b00870965a4c1efa0", "score": "0.6985146", "text": "onWindowResize() {\n const { width, height } = this.screenDims;\n this.camera.aspect = width / height;\n this.camera.updateProjectionMatrix(); \n this.renderer.setSize(width, height); \n this.render();\n }", "title": "" }, { "docid": "15e235c2a271c0727fd4a92e73ef1777", "score": "0.69768447", "text": "function full (window) {\n var screenFrame = window.screen().frameInRectangle()\n window.setSize({\n width: screenFrame.width,\n height: screenFrame.height\n })\n}", "title": "" }, { "docid": "6ce5d57852029d413c52dd6cacb71700", "score": "0.69739425", "text": "function adjustSizes() {\n var padL = 5, padR = 5;\n var footerH = 70;\n var headerH = 10;\n var mainW = winW - padL - padR;\n var mainH = winH - headerH - footerH - 10;\n top.find('.oomView').each(function() {\n $(this).css({\n width: (mainW).toString() + 'px', \n height: (mainH).toString() + 'px',\n left: (padL).toString() + 'px',\n top: (headerH).toString() + 'px'\n });\n var canvas = $(this).find('.oomCanvas')[0];\n canvas.height = mainH;\n canvas.width = mainW;\n $(this).maximizeCanvasResolution();\n m.emit('changed');\n });\n }", "title": "" }, { "docid": "1e3efcb5e61e1c4488e09e7e67cc769b", "score": "0.6967324", "text": "function SetResizeContent() {\n fullScreenHeight();\n ScreenFixedHeight();\n }", "title": "" }, { "docid": "1e3efcb5e61e1c4488e09e7e67cc769b", "score": "0.6967324", "text": "function SetResizeContent() {\n fullScreenHeight();\n ScreenFixedHeight();\n }", "title": "" }, { "docid": "e084633a506a87db3e498b77c40c5745", "score": "0.69580114", "text": "function updateWindowSize() {\n height = window.innerHeight;\n width = window.innerWidth;\n}", "title": "" }, { "docid": "efde00d314205c1fb319ba3875cb8d81", "score": "0.6930801", "text": "function resizeRenderer() {\n var thisWidth = window.innerWidth;\n var thisHeight = window.innerHeight;\n var unit = thisWidth / WIDTH;\n var testHeight = Math.floor(HEIGHT * unit);\n if (thisHeight >= testHeight) {\n renderer.view.style.width = thisWidth + 'px';\n renderer.view.style.height = testHeight + 'px';\n } else {\n unit = thisHeight / HEIGHT;\n var testWidth = Math.floor(WIDTH * unit);\n renderer.view.style.width = testWidth + 'px';\n renderer.view.style.height = thisHeight + 'px';\n }\n }", "title": "" }, { "docid": "22c8391c23797aaf4268958ecf760057", "score": "0.69148856", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n let display = new Display({ diagonal: display_size }, window.screen);\n\n // DO NO CHANGE THESE!\n PPI = display.ppi; // calculates pixels per inch\n PPCM = PPI / 2.54; // calculates pixels per cm\n FINGER_SIZE = (int)(11 * PPCM);\n FINGER_OFFSET = (int)(0.8 * PPCM)\n ARM_LENGTH = (int)(19 * PPCM);\n ARM_HEIGHT = (int)(11.2 * PPCM);\n\n ARROW_SIZE = (int)(2.2 * PPCM);\n\n\n // Starts drawing the watch immediately after we go fullscreen (DO NO CHANGE THIS!)\n draw_finger_arm = true;\n attempt_start_time = millis();\n}", "title": "" }, { "docid": "b589054787bef78aab3bea88149524a2", "score": "0.6909071", "text": "function handleResize() {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "title": "" }, { "docid": "b1819cd65398fc589c549c0286b05e9d", "score": "0.6905003", "text": "function setScreenAndCanvasSize() \n { var ratio = window.devicePixelRatio || 1;\n var csswidth = Math.round(window.innerWidth);\n var cssheight = Math.round(window.innerHeight);\n var pixelwidth = Math.round(window.innerWidth*ratio);\n var pixelheight = Math.round(window.innerHeight*ratio); \n that.screenwidth = csswidth;\n that.screenheight = cssheight; \n that.pixelwidth = pixelwidth;\n that.pixelheight = pixelheight; \n that.canvas.width = pixelwidth;\n that.canvas.height = pixelheight; \n that.canvas.style[\"width\"] = csswidth+\"px\";\n that.canvas.style[\"height\"] = cssheight+\"px\";\n that.pixeltilesize = Math.round(ratio*30)*2; // always use even number of pixel \n \n// console.log\n// ( \"css size:\",csswidth,cssheight,\n// \"pixel size:\",pixelwidth,pixelheight,\n// \"tile size:\",that.pixeltilesize\n// );\n }", "title": "" }, { "docid": "ac728e572af0040509f0525245a3d5d9", "score": "0.69046485", "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": "bb6fca2b517cfbc415721ce35fdb7813", "score": "0.6903695", "text": "function resize() {\n if (!renderer.xr.isPresenting) {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n }\n }", "title": "" }, { "docid": "17af66b9746d52db0b89a87a12a32927", "score": "0.69001794", "text": "function resize(){\n\t\tmax = Math.max(max,window.innerWidth)\n\t\tdiv.style.width =\"1420px\";\n\t\tcanvas.width= max;\n\t\tmax2 = Math.max(max2,window.innerHeight)\n\t\tcanvas.height= Math.floor(max2*0.8);\n\t\tdraw(ctx,sketchs);\n\n\t}", "title": "" }, { "docid": "168b1261754c7a56e5085b8b91563319", "score": "0.6890576", "text": "function screenSize() {\n // remove earlier sizes\n html.className = html.className.replace(/ (w-|eq-|gt-|gte-|lt-|lte-|portrait|no-portrait|landscape|no-landscape)\\d+/g, \"\");\n\n // Viewport width\n var iw = win.innerWidth || html.clientWidth,\n ow = win.outerWidth || win.screen.width;\n\n api.screen.innerWidth = iw;\n api.screen.outerWidth = ow;\n\n // for debugging purposes, not really useful for anything else\n pushClass(\"w-\" + iw);\n\n each(conf.screens, function(width) {\n if (iw > width) {\n if (conf.screensCss.gt) {\n pushClass(\"gt-\" + width);\n }\n\n if (conf.screensCss.gte) {\n pushClass(\"gte-\" + width);\n }\n } else if (iw < width) {\n if (conf.screensCss.lt) {\n pushClass(\"lt-\" + width);\n }\n\n if (conf.screensCss.lte) {\n pushClass(\"lte-\" + width);\n }\n } else if (iw === width) {\n if (conf.screensCss.lte) {\n pushClass(\"lte-\" + width);\n }\n\n if (conf.screensCss.eq) {\n pushClass(\"e-q\" + width);\n }\n\n if (conf.screensCss.gte) {\n pushClass(\"gte-\" + width);\n }\n }\n });\n\n // Viewport height\n var ih = win.innerHeight || html.clientHeight,\n oh = win.outerHeight || win.screen.height;\n\n api.screen.innerHeight = ih;\n api.screen.outerHeight = oh;\n\n // no need for onChange event to detect this\n api.feature(\"portrait\" , (ih > iw));\n api.feature(\"landscape\", (ih < iw));\n }", "title": "" }, { "docid": "672621ca2e0fbd26bdb257e760544c9a", "score": "0.688852", "text": "function screenSize() {\n // remove earlier sizes\n html.className = html.className.replace(/ (w-|eq-|gt-|gte-|lt-|lte-|portrait|no-portrait|landscape|no-landscape)\\d+/g, \"\");\n\n // Viewport width\n var iw = win.innerWidth || html.clientWidth,\n ow = win.outerWidth || win.screen.width;\n\n api.screen.innerWidth = iw;\n api.screen.outerWidth = ow;\n\n // for debugging purposes, not really useful for anything else\n pushClass(\"w-\" + iw);\n\n each(conf.screens, function (width) {\n if (iw > width) {\n if (conf.screensCss.gt) {\n pushClass(\"gt-\" + width);\n }\n\n if (conf.screensCss.gte) {\n pushClass(\"gte-\" + width);\n }\n }\n\n else if (iw < width) {\n if (conf.screensCss.lt) {\n pushClass(\"lt-\" + width);\n }\n\n if (conf.screensCss.lte) {\n pushClass(\"lte-\" + width);\n }\n }\n\n else if (iw === width) {\n if (conf.screensCss.lte) {\n pushClass(\"lte-\" + width);\n }\n\n if (conf.screensCss.eq) {\n pushClass(\"e-q\" + width);\n }\n\n if (conf.screensCss.gte) {\n pushClass(\"gte-\" + width);\n }\n }\n });\n\n // Viewport height\n var ih = win.innerHeight || html.clientHeight,\n oh = win.outerHeight || win.screen.height;\n\n api.screen.innerHeight = ih;\n api.screen.outerHeight = oh;\n\n // no need for onChange event to detect this\n api.feature(\"portrait\" , (ih > iw));\n api.feature(\"landscape\", (ih < iw));\n }", "title": "" }, { "docid": "2e4e1ef1781f050fe9cd45ae4cd3c08e", "score": "0.6887538", "text": "function setDimensions (dimensions) {\n // Don't modify the window size if it's already maximized\n if (remote.getCurrentWindow().isMaximized()) {\n state.window.bounds = null\n return\n }\n\n // Save the bounds of the window for later. See restoreBounds()\n state.window.bounds = {\n x: window.screenX,\n y: window.screenY,\n width: window.outerWidth,\n height: window.outerHeight\n }\n state.window.wasMaximized = remote.getCurrentWindow().isMaximized\n\n // Limit window size to screen size\n var screenWidth = window.screen.width\n var screenHeight = window.screen.height\n var aspectRatio = dimensions.width / dimensions.height\n var scaleFactor = Math.min(\n Math.min(screenWidth / dimensions.width, 1),\n Math.min(screenHeight / dimensions.height, 1)\n )\n var width = Math.max(\n Math.floor(dimensions.width * scaleFactor),\n config.WINDOW_MIN_WIDTH\n )\n var height = Math.max(\n Math.floor(dimensions.height * scaleFactor),\n config.WINDOW_MIN_HEIGHT\n )\n\n ipcRenderer.send('setAspectRatio', aspectRatio)\n ipcRenderer.send('setBounds', {x: null, y: null, width, height})\n}", "title": "" }, { "docid": "ae3481544c9525fb275c95a1fab6e2e5", "score": "0.6862743", "text": "function setScreenSize() {\n $.post('/screen', { width: window.innerWidth, height: window.innerHeight }, function(json) {\n if (json.outcome == 'success') {\n // do something with the knowledge possibly?\n } else {\n alert('Unable to let server know what the screen resolution is!');\n }\n },'json');\n}", "title": "" }, { "docid": "dcfacbdb83b0d1739e07f2dcc2a2ada3", "score": "0.68612796", "text": "function autosize () {\n\tvar w = win.width();\n\tvar h = win.height();\n\t\n\tif(w<847||h<603){\n\t\tzoomBy(.5);\n\t}else if(w<1116||h<788){\n\t\tzoomBy(.75);\n\t}else{\n\t\tzoomBy(1);\n\t}\n\t\n}", "title": "" }, { "docid": "ab62db0a9ce51080f8cd63e5b67a8242", "score": "0.6859442", "text": "resize() {\n var w = window.innerWidth;// * window.devicePixelRatio;\n var h = window.innerHeight;// * window.devicePixelRatio;\n var ratio = Math.min( w/this.width, h/this.height);\n this.app.renderer.resize(this.width*ratio,this.height*ratio);\n this.app.stage.scale.set(ratio);\n }", "title": "" }, { "docid": "4ba13ff447c14bb7c453e6e9e20ed199", "score": "0.68529356", "text": "function handleResize() {\n\t\t\t// if (window.innerWidth < 825) setHeight('2400px')\n\t\t if (window.innerWidth > 1050) setHeight('850px')\n\t\t\telse setHeight('1400px')\n\t\t}", "title": "" }, { "docid": "15d221b94cfac24d884481c8a6cb52bc", "score": "0.6845471", "text": "function winResize(){\r\n browserWidth = parseInt(document.documentElement.clientWidth);\r\n browserHeight = parseInt(document.documentElement.clientHeight);\r\n console.log(\"modify browser width: \" + browserWidth);\r\n console.log(\"modify browser height: \" + browserHeight);\r\n }", "title": "" }, { "docid": "83bdaccf317c83a182792606bb650ba7", "score": "0.6843332", "text": "function windowResized() {\n\n// Re-evaluate the scaleFactor variable in case the web page has been moved to a screen with different resolution.\n scaleFactor = getScaleFactor();\n\n// Resize the canvas accordingly.\n resizeCanvas(matrix * scaleFactor, matrix * scaleFactor);\n}", "title": "" }, { "docid": "7262a92aa373b966f420b9d1925056aa", "score": "0.6841814", "text": "function setDisplaySize() {\n playfieldWidth = windowWidth;\n playfieldHeight = windowHeight;\n portraitMode = (playfieldHeight > playfieldWidth);\n mobileMode = (Math.max(playfieldHeight, playfieldWidth) <= 1000);\n screenArea = playfieldWidth * playfieldHeight;\n iconSize = Math.min(playfieldWidth/config.iconScale, playfieldHeight/config.iconScale);\n config.sensitivity = Math.pow(screenArea, 1/3);\n config.powerAdjustment = mobileMode ? Math.pow(iconSize, 2.2) : Math.pow(iconSize, 2);\n config.powerAdjustment = portraitMode ? config.powerAdjustment*0.95 : config.powerAdjustment;\n power = Math.sqrt(iconSize)*(screenArea/350000);\n if(mobileMode) {\n power = portraitMode ? (screenArea/Math.pow(iconSize, 2.7)) : (screenArea/Math.pow(iconSize, 3));\n };\n // console.log('mobileMode::', mobileMode, 'portraitMode::', portraitMode);\n // console.log('screenArea :: iconSize', screenArea, \" :: \", iconSize);\n // console.log('powerAdjustment', config.powerAdjustment);\n // console.log('power', power);\n config.gridSpacing = 2*iconSize;\n goalPosition = {x: 0.33*iconSize, y:playfieldHeight*0.4};\n goalWidth = iconSize*1.4;\n gridStartX = goalPosition.x + goalWidth + 2*iconSize;\n gridStartY = goalPosition.y;\n if(playfieldWidth < playfieldHeight) gridStartY -= iconSize;\n gridCurrentX = gridStartX;\n gridCurrentY = gridStartY;\n }", "title": "" }, { "docid": "ec0b39880512d6bb1c751ecf522dbffe", "score": "0.6841675", "text": "function windowResize() {\n\n const { width, height } = electron.screen.getPrimaryDisplay().workAreaSize;\n const imgMaxWidth = Number(width / pageMode);\n\n if (pageMode == 1) {\n window.resizeTo($('#left-img').width(), $('#left-img').height());\n }\n if (pageMode == 2) {\n const imgWidth = Math.min($('#left-img').width() + $('#right-img').width() + 1, width);\n const imgHeight = Math.max($('#left-img').width(), $('#right-img').width(), height);\n window.resizeTo(imgWidth, imgHeight);\n }\n $('img').css('max-height', `${height}px`);\n $('img').css('max-width', `${imgMaxWidth}px`);\n}", "title": "" }, { "docid": "1ed988fc5005f7fe6ec8417e2008619c", "score": "0.6836177", "text": "function resizeCanvas() {\n var aspect_ratio = 4 / 3;\n\n var h, w;\n\n // the screen is wider than 4:3\n if (window.innerWidth * (3 / 4) > window.innerHeight) {\n h = window.innerHeight;\n w = h * aspect_ratio;\n config.scale = h / config.height;\n }\n // the screen is taller than 4:3\n else {\n w = window.innerWidth;\n h = w / aspect_ratio;\n config.scale = w / config.width;\n }\n\n config.scale = Math.floor(config.scale);\n //canvas.height = h;\n //canvas.width = w;\n canvas.height = config.height * config.scale;\n canvas.width = config.width * config.scale;\n\n module.exports.redraw = true;\n setNearestNeighbor();\n}", "title": "" }, { "docid": "a1181eab563111bd48b2c9c2301514da", "score": "0.6831935", "text": "getScreenSize() {\n window.addEventListener(\"resize\", () => { \n const height = window.innerHeight;\n const width = window.innerWidth;\n if (width > 1080) {\n this.setState({\n canvasWidth: \"500px\",\n canvasHeight: \"500px\"\n })\n }\n if (width > 768 && width < 1080) {\n this.setState({\n canvasWidth: \"400px\",\n canvasHeight: \"400px\"\n })\n }\n if (width < 768) {\n this.setState({\n canvasWidth: \"300px\",\n canvasHeight: \"300px\"\n })\n }\n });\n }", "title": "" }, { "docid": "0ca1fb613a1f6506315350486edbf27b", "score": "0.68272763", "text": "function resizeHandler(event) {\n canvas.width = SCREEN_WIDTH;\n canvas.height = SCREEN_HEIGHT;\n}", "title": "" }, { "docid": "3db1d0eeeb38e3fd7352616d2345cb11", "score": "0.6808998", "text": "function onResize() {\n var w = window.innerWidth;\n var h = window.innerHeight;\n\n $(\"#gamecanvas\").css(\"width\", w + \"px\");\n $(\"#gamecanvas\").css(\"height\", h + \"px\");\n\n CameraManager.updateAspect(w / h);\n Scene.setRendererSize(w, h);\n }", "title": "" }, { "docid": "ed26421716d6a44817ee6a6d1960456f", "score": "0.68087035", "text": "handleWindowResize() {\n const screenSize = Math.min(window.innerWidth, window.innerHeight);\n const maxSize = Math.min(screenSize, 600);\n\n this.boardElem.style.width = maxSize + 'px';\n this.boardElem.style.height = maxSize + 'px';\n }", "title": "" }, { "docid": "fe078e2a370a2c7dd3157f45a26d36fa", "score": "0.6801821", "text": "function resizeGame() {\n game.scale.setGameSize($(window).width(), $(window).height());\n}", "title": "" }, { "docid": "df0a68703f9f20b83a4df0b18554adcc", "score": "0.67962444", "text": "function onResize() {\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n\t\n\tif (window.innerHeight > 0 && window.innerWidth > 0) {\n\t\trenderer.setSize(window.innerWidth,window.innerHeight);\n\t}\n}", "title": "" }, { "docid": "be5bfa3b7bb8a79cec4cc0f6cea363b0", "score": "0.6792636", "text": "function handleResize() {\n setWindowSize( {\n width: window.innerWidth,\n height: window.innerHeight\n });\n }", "title": "" }, { "docid": "26cf21d6b41ff1a4ff84e5f9e3292da2", "score": "0.6775165", "text": "function screenResize(isScreenSmall) {\n if (isScreenSmall.matches) {\n video.style.width = \"320px\";\n } else {\n video.style.width = \"720px\";\n }\n }", "title": "" }, { "docid": "5d9eae35cdd542c3599400113b991666", "score": "0.6774019", "text": "function reSize(){\n\tconsole.log('height limited');\n\tvar height_ratio = $(window).height()/750;\n\tvar width_ratio = $(window).width()/950;\n\tif (height_ratio < 1 || width_ratio < 1) {\n\t\tif (height_ratio < width_ratio) {\n\n\t\t\t$('body').css('zoom', height_ratio);\n\t\t\t\n\t\t} else {\n\t\t\t$('body').css('zoom', width_ratio);\n\t\t\talert('width limited');\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "6e16cafae512f370240d60cbc5b4fd83", "score": "0.6771806", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight); //responsive webpage\n}", "title": "" }, { "docid": "26bd68f733eb09a8fe2398b898876611", "score": "0.67685246", "text": "function resize(){\n // Our canvas must cover full height of screen regardless of the resolution\n const height = window.innerHeight - 20;\n\n //So we need to calculate the proper scaled width that should work wel with every resolution\n const ratio = canvas.width / canvas.height\n const width = height * ratio;\n\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n}", "title": "" }, { "docid": "b4103687bf10aae32d9deaaef9c34d5b", "score": "0.6762216", "text": "function setInitialScreenSize(){\n var screenWidth = window.innerWidth;\n // set as large but screen is smaller\n if(screenWidth <= 800){\n return 's';\n // set as small but screen is medium\n } else if(screenWidth > 800 && screenWidth < 1300){\n return 'm';\n // set as medium but screen is large\n } else if(screenWidth >= 1300){\n return 'l';\n }\n }", "title": "" }, { "docid": "e93416963deda631d0b71c1f6a928fb9", "score": "0.6756526", "text": "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n\r\n let display = new Display({diagonal: display_size}, window.screen);\r\n\r\n // DO NOT CHANGE THESE!\r\n PPI = display.ppi; // calculates pixels per inch\r\n PPCM = PPI / 2.54; // calculates pixels per cm\r\n TARGET_SIZE = 1.5 * PPCM; // sets the target size in cm, i.e, 1.5cm\r\n TARGET_PADDING = 1.5 * PPCM; // sets the padding around the targets in cm\r\n MARGIN = 1.5 * PPCM; // sets the margin around the targets in cm\r\n\r\n // Sets the margin of the grid of targets to the left of the canvas (DO NOT CHANGE!)\r\n LEFT_PADDING = width / 2 - TARGET_SIZE - 1.5 * TARGET_PADDING - 1.5 * MARGIN;\r\n\r\n // Sets the margin of the grid of targets to the top of the canvas (DO NOT CHANGE!)\r\n TOP_PADDING = height / 2 - TARGET_SIZE - 1.5 * TARGET_PADDING - 1.5 * MARGIN;\r\n\r\n // Starts drawing targets immediately after we go fullscreen\r\n draw_targets = true;\r\n}", "title": "" }, { "docid": "5f25af64a7a69ddd18e9e58b6091186e", "score": "0.67545044", "text": "function setWindowDimension() {\n\t// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight\n\tif (typeof window.innerWidth != 'undefined')\n\t{\n\t\tvw = window.innerWidth;\n\t\tvh = window.innerHeight;\n scrollPostion = vw < vwLaptop ? 0 : 83;\n\t\t// console.log(vw + \"x\" + vh);\n\t}\n}", "title": "" }, { "docid": "639ea3bcaca6ce5eb2172303887e4532", "score": "0.6748023", "text": "_onResize () {\n let {width, height} = this._getDimensions();\n\n this.renderer.setSize(width, height);\n\n this.camera.aspect = width / height;\n this.camera.updateProjectionMatrix();\n\n this.controls.handleResize();\n\n this.controls.screen.width = width;\n this.controls.screen.height = height;\n }", "title": "" }, { "docid": "a60951b5afeea6c413f4eae165567775", "score": "0.67191106", "text": "function resize(){\n\t\t\tsetDimensions();\n\t\t\tconsole.log('resized');\n\t\t}", "title": "" }, { "docid": "07314bcfef5ab7f5942908a8b369cebc", "score": "0.67170095", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n // update w & h while we are at it\n w = windowWidth\n h = windowHeight\n \n}", "title": "" }, { "docid": "503a037bce5bdd59d7f42c273e9321b9", "score": "0.67132527", "text": "function windowResized() {\n resizeCanvas(window.innerWidth / 3, window.innerHeight / 2);\n startScreen.update();\n endScreen.update();\n blubsi.update();\n buttonSleep.resize(width - height / 4, height / 2, height / 4, height / 4);\n buttonFood.resize(width - height / 4, 0, height / 4, height / 4);\n buttonThirst.resize(width - height / 4, height / 4, height / 4, height / 4);\n buttonFun.resize(\n width - height / 4,\n (3 * height) / 4,\n height / 4,\n height / 4\n );\n}", "title": "" }, { "docid": "523f4feffad766d9cca0467aa00ccb67", "score": "0.6708112", "text": "function setGameWindowDimensions(){\n\n // console.log(\"RESIZING DIS BITCH\");\n\n var width = document.getElementById(\"gameCanvasContainer\").offsetWidth;\n var height = document.getElementById(\"gameCanvasContainer\").offsetHeight;\n //console.log(\"Width: \" + width);\n //console.log(\"Height: \" + height);\n\n var canvas = document.getElementById(\"gameCanvas\");\n canvas.width = width;\n canvas.height = height;\n\n set_size(width, height);\n}", "title": "" }, { "docid": "c2bfb677d5f4fb2bfe832cc3b64392b3", "score": "0.6700011", "text": "function onResize() { \r\n\t\tvar gameWidth = window.innerWidth; \r\n\t\tvar gameHeight = window.innerHeight; \r\n\t\tvar scaleToFitX = gameWidth / 550; \r\n\t\tvar scaleToFitY = gameHeight / 625; \r\n\t\t \r\n\t\tvar currentScreenRatio = gameWidth / gameHeight; \r\n\t\toptimalRatio = Math.min(scaleToFitX, scaleToFitY); \r\n\t\toptimalRatio = optimalRatio-0.05;\r\n\t\t \r\n\t\tif (currentScreenRatio >= 1.77 && currentScreenRatio <= 1.79) { \r\n\t\t\tcanvas.style.width = gameWidth + \"px\"; \r\n\t\t\tcanvas.style.height = gameHeight + \"px\"; \r\n\t\t} \r\n\t\telse { \r\n\t\t\tcanvas.style.width = 550 * optimalRatio + \"px\"; \r\n\t\t\tcanvas.style.height = 625 * optimalRatio + \"px\"; \r\n\t\t}\r\n\t}", "title": "" }, { "docid": "beab89d333bc202c836e7e5ae469002f", "score": "0.6696957", "text": "function resize() {\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "e70322f3f9dedbbb03e50a6d94bbeb33", "score": "0.6690684", "text": "function setCanvasSize() {\n if (windowWidth < 300 && windowHeight < 300) {\n createCanvas(300, 300);\n } else if (windowHeight < 300) {\n createCanvas(300, windowHeight);\n } else if (windowWidth < 300) {\n createCanvas(windowWidth, 300);\n } else {\n createCanvas(windowWidth, windowHeight); \n }\n}", "title": "" }, { "docid": "3327e516eeceac46d068b1a395a25b60", "score": "0.6688969", "text": "function initAppSize() {\n //set the isBigSize parameter by the device\n if ($(window).width() > 700) {\n generalParameters.isBigSize = true;\n }\n}", "title": "" }, { "docid": "1c6b169487a4b362012bbc04594d050b", "score": "0.66823", "text": "function setWindowSize(){\n// alert(\"In function setWindowSize\");\n// set some variables\n// var window_height = window.screen.availHeight; // instead of 900\n// var window_width = window.screen.availWidth; // instead of 900\n\n var window_height = 700;\n var window_width = 800;\n \n// window_height = parseInt(window_height);\n// window_width = parseInt(window_width);\n\n// make the window smallish\n window.resizeTo(window_width, window_height);\n/*\n// find out how big the screen is\n var height = window.screen.availHeight;\n var width = window.screen.availWidth;\n\n// get the left position\n// it'll be half of the screen\n// minus half of the window width\n var left_point = parseInt(width / 2) - parseInt(window_width / 2);\n\n// get the top position\n// similar calculation as for the left position\n var top_point = parseInt(height/2) - parseInt(window_height / 2); //delete this line, set to 0 instead\n\n// alert(\"left_point = \" + left_point + \" top_point = \" + top_point);\n \n // move the window\n window.moveTo(left_point, top_point);\n*/\n}", "title": "" }, { "docid": "a1ae39f7a89f969d3da92c24edd97cec", "score": "0.66821784", "text": "function resize() {\n let _w = window.innerWidth;\n let _h = window.innerHeight;\n // app.stop()\n resizeImg()\n app.renderer.resize(_w, _h);\n console.log(\"resized\")\n }", "title": "" }, { "docid": "24fa3344715d84feb171989cb06bd0e1", "score": "0.66818064", "text": "function windowResized() {\n resize();\n redraw();\n}", "title": "" }, { "docid": "a0cdc5d80780173e4750a1854ff60645", "score": "0.6678976", "text": "function setupCanvasSize() {\r\n margin = {top: 50, right: 50, bottom: 50, left: 50}\r\n width = window.innerWidth - margin.left - margin.right // Use the window's width \r\n height = window.innerHeight - margin.top - margin.bottom; // Use the window's height\r\n \r\n }", "title": "" }, { "docid": "f12222b17a8625ff0a0f8c77d966394f", "score": "0.66771185", "text": "function onWindowResize() {\n\n // Update the screen width globals\n SCREEN_WIDTH = window.innerWidth;\n SCREEN_HEIGHT = window.innerHeight;\n\n // Update the camera aspect to accomdate the new size\n camera.aspect = SCREEN_WIDTH / SCREEN_HEIGHT;\n camera.updateProjectionMatrix();\n\n // Update the renderer resolution\n renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );\n\n // Update camera controls if free-look is enabled\n if (!chaseCamEnabled) {\n controls.handleResize();\n }\n}", "title": "" }, { "docid": "ea78546abaec22d8e244cc560b2cb467", "score": "0.66746134", "text": "function setResolution(scale) {\n resolutionScale = scale;\n onResize();\n }", "title": "" }, { "docid": "fb618195143debceb1b8a1912d52c94b", "score": "0.66680825", "text": "function doWindowResize() {\n\n\t//measure window\n\tif (window.innerWidth > window.innerHeight) {\n\t\toSTAGE.is_landscape = true;\n\t\toSTAGE.scale = Math.min(Infinity, (Math.min(window.innerHeight / 550, window.innerWidth / 900)));\n\t} else {\n\t\toSTAGE.is_landscape = false;\n\t\toSTAGE.scale = Math.min(Infinity, (Math.min(window.innerHeight / 800, window.innerWidth / 600)));\n\t}\n\n\n\toSTAGE.scale_inv = (1 / oSTAGE.scale);\n\toSTAGE.screen_width = Math.ceil(window.innerWidth);\n\toSTAGE.screen_height = Math.ceil(window.innerHeight);\n\toSTAGE.window_width = Math.ceil(window.innerWidth * oSTAGE.scale_inv);\n\toSTAGE.window_height = Math.ceil(window.innerHeight * oSTAGE.scale_inv);\n\toSTAGE.wrapper_height = Math.ceil(window.innerHeight * oSTAGE.scale_inv);\n\toSTAGE.wrapper_width = Math.ceil(window.innerWidth * oSTAGE.scale_inv);\n\toSTAGE.wrapper_ratio = oSTAGE.wrapper_height / oSTAGE.wrapper_width;\n\n\toSTAGE.physical_ppi = __utils.getPPI();\n\toSTAGE.ppi_scale = oSTAGE.physical_ppi / 96;\n\n\t//scale the screen div\n\tvar div_screens = document.getElementById(\"div_screens\");\n\n\tdiv_screens.style.transform = div_screens.style.webkitTransform = \"scale(\" + oSTAGE.scale + \",\" + oSTAGE.scale + \")\";\n\tdiv_screens.style.width = Math.ceil(oSTAGE.wrapper_width) + \"px\";\n\tdiv_screens.style.height = Math.ceil(oSTAGE.wrapper_height) + \"px\";\n\n\n\n\t//update queue\n\tfor (var i = update_queue.length - 1; i >= 0; i--) {\n\t\tif (update_queue[i].forget) {\n\t\t\tupdate_queue.splice(i, 1);\n\t\t} else if (update_queue[i].doResizeUpdate) {\n\t\t\tupdate_queue[i].doResizeUpdate();\n\t\t} else {\n\t\t\tupdate_queue.splice(i, 1);\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "d4493a8c97106dc7d0552281c56523c3", "score": "0.6666216", "text": "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "title": "" }, { "docid": "f93cd9538bc3f4f94ac85315a58b169b", "score": "0.6663748", "text": "function resize(w, h) {\n\n}", "title": "" }, { "docid": "f93cd9538bc3f4f94ac85315a58b169b", "score": "0.6663748", "text": "function resize(w, h) {\n\n}", "title": "" }, { "docid": "08c9cd0e795c167777433887f70c397f", "score": "0.66539377", "text": "function FitToWindow()\n\t{\n\t\tif (!g_fullScreen) return;\n\t\tvar widthToHeight = g_screensize.x / g_screensize.y;\n\t\tvar newWidth = window.innerWidth;\n\t\tvar newHeight = window.innerHeight;\n\t\tvar newWidthToHeight = newWidth / newHeight;\n\t\t\n\t\tif (newWidthToHeight > widthToHeight)\n\t\t{\n\t\t\tnewWidth = newHeight * widthToHeight;\n\t\t\tcanvas.style.width = newWidth + 'px';\n\t\t\tcanvas.style.height = newHeight + 'px';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewHeight = newWidth / widthToHeight;\n\t\t\tcanvas.style.width = newWidth + 'px';\n\t\t\tcanvas.style.height = newHeight + 'px';\n\t\t}\n\t\t\n\t\tcanvas.style.top = ((window.innerHeight - newHeight) / 2) + 'px';\n\t\tcanvas.style.left = ((window.innerWidth - newWidth) / 2) + 'px';\n\t\t\n\t\tg_windowSize.x = window.innerWidth;\n\t\tg_windowSize.y = window.innerHeight;//*/\n\t}", "title": "" }, { "docid": "f68f81de4eccac6b97ca08e840d64977", "score": "0.66503036", "text": "function adjust() {\n var divgame = document.getElementById(\"game\");\n divgame.style.width = window.innerWidth + \"px\";\n divgame.style.height = window.innerHeight + \"px\";\n }", "title": "" }, { "docid": "e77339bacf3f0f04687cecadd901f641", "score": "0.6646401", "text": "function resizePaper(){\n var win = $(this);\n sr.changeSize(win.width(), win.height(), true, false);\n }", "title": "" }, { "docid": "b75cd7e0ded4f85ab0810b85064bdde7", "score": "0.6642383", "text": "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "title": "" }, { "docid": "b75cd7e0ded4f85ab0810b85064bdde7", "score": "0.6642383", "text": "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "title": "" }, { "docid": "15ec93a70bcf41773bbabaed7a6a4015", "score": "0.6642217", "text": "function onResize() {\n setSize();\n }", "title": "" }, { "docid": "15ec93a70bcf41773bbabaed7a6a4015", "score": "0.6642217", "text": "function onResize() {\n setSize();\n }", "title": "" }, { "docid": "15ec93a70bcf41773bbabaed7a6a4015", "score": "0.6642217", "text": "function onResize() {\n setSize();\n }", "title": "" }, { "docid": "67036f31308eeb8005ec0256d8f6f321", "score": "0.6638717", "text": "function onWindowResize () {\n innerWidth = window.innerWidth;\n innerHeight = window.innerHeight;\n\n if(camera && renderer) {\n camera.aspect = innerWidth / innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(innerWidth, innerHeight);\n }\n}", "title": "" }, { "docid": "f6ecd9200f87b6c43278b54289e4cd3e", "score": "0.6638668", "text": "function FitToWindow()\r\n\t{\r\n\t\tif (!g_fullScreen) return;\r\n\t\tvar widthToHeight = g_screensize.x / g_screensize.y;\r\n\t\tvar newWidth = window.innerWidth;\r\n\t\tvar newHeight = window.innerHeight;\r\n\t\tvar newWidthToHeight = newWidth / newHeight;\r\n\t\t\r\n\t\tif (newWidthToHeight > widthToHeight)\r\n\t\t{\r\n\t\t\tnewWidth = newHeight * widthToHeight;\r\n\t\t\tcanvas.style.width = newWidth + 'px';\r\n\t\t\tcanvas.style.height = newHeight + 'px';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tnewHeight = newWidth / widthToHeight;\r\n\t\t\tcanvas.style.width = newWidth + 'px';\r\n\t\t\tcanvas.style.height = newHeight + 'px';\r\n\t\t}\r\n\t\t\r\n\t\tcanvas.style.top = ((window.innerHeight - newHeight) / 2) + 'px';\r\n\t\tcanvas.style.left = ((window.innerWidth - newWidth) / 2) + 'px';\r\n\t\t\r\n\t\tg_windowSize.x = window.innerWidth;\r\n\t\tg_windowSize.y = window.innerHeight;//*/\r\n\t}", "title": "" }, { "docid": "902300f8612177853f40459cd9053a2d", "score": "0.6625871", "text": "function resize() {\n const w = window.innerWidth;\n const h = window.innerHeight;\n renderer.setSize(w, h);\n camera.aspect = w / h;\n camera.updateProjectionMatrix();\n}", "title": "" }, { "docid": "1cf3f72672bdaa7d24c2ac46369e25e8", "score": "0.66187716", "text": "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "title": "" }, { "docid": "2fe11634a135b89b9c1c5d915ef00e3e", "score": "0.66179776", "text": "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "title": "" }, { "docid": "c0da7e04ea39833285aab0dc79bc8e8c", "score": "0.6616126", "text": "function edgtfOnWindowResize() {\n edgtf.windowWidth = $(window).width();\n edgtf.windowHeight = $(window).height();\n }", "title": "" }, { "docid": "11bf62a170f0f1993212b36db46c2fe5", "score": "0.66098034", "text": "function windowResize() {\n if (canvas) {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvasHlf = {w: canvas.width*0.5, h: canvas.height*0.5};\n }\n}", "title": "" }, { "docid": "063fe3f76f5486df11141de31aa8e8ab", "score": "0.66051304", "text": "function setViewportScale() {\n\tif (vw < 1050)\n\t{\n \t\tvar viewport;\n\t\tviewport = document.getElementsByName(\"viewport\");\n\t\tviewport[0].setAttribute(\"content\", \"width=device-width, initial-scale=1, maximum-scale=1\");\n\t}\n}", "title": "" }, { "docid": "930f1825b2a4e7bc806e1a83300f49a0", "score": "0.66047597", "text": "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n dpr: window.devicePixelRatio,\n });\n }", "title": "" }, { "docid": "9afcf75b65fecad95ae47812319b2a04", "score": "0.66021377", "text": "function windowResized() {\n width = document.documentElement.clientWidth;\n heightCanvas = document.documentElement.clientHeight - 100;\n height = heightCanvas * 2 / 3.1;\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "b0f46c94d5707681f5578c4cf9595f17", "score": "0.6599239", "text": "function fitCanvasToScreen() {\n // Original code - doesn't scale up for high DPI devices.\n //canvas.width = Math.floor(window.innerWidth / Config.size) * Config.size;\n //canvas.height = Math.floor(window.innerHeight / Config.size) * Config.size;\n\n // For high density devices (i.e. mobile), scale according to screen density.\n var devicePixelRatio = window.devicePixelRatio || 1;\n var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1;\n\n var ratio = devicePixelRatio / backingStoreRatio;\n\n Config.size = Config.defaultSize * ratio;\n\n var w = Math.floor(window.innerWidth / Config.size) * Config.size;\n var h = Math.floor(window.innerHeight / Config.size) * Config.size;\n\n // Scale up the canvas to the actual device density.\n canvas.width = w * ratio;\n canvas.height = h * ratio;\n\n // Downscale the canvas to fit onto the screen, but with high density.\n canvas.style.width = w;\n canvas.style.height = h;\n\n console.log(\"Window ratio is: \" + ratio);\n }", "title": "" } ]
dac07aaa68b651263cf86bacc2fe8aa7
Confirm registration request by creating an account if appropriate.
[ { "docid": "8c22e2d7e09dfd828eefd3e54ee19933", "score": "0.0", "text": "async join(user) {\n const registeredUser = await this.users\n .getUserByEmailAddressToken(user.tokens.emailAddress);\n\n if (!registeredUser\n || this.constructor.#getEpoch() > (registeredUser.membership.tokens.timeStamp + ttl)\n || !isEqual(user.tokens.phoneNumber, registeredUser.membership.tokens.code)) {\n return undefined;\n }\n\n registeredUser.dateRegistered = new Date().toISOString();\n\n await this.users.updateUser(registeredUser);\n\n return user;\n }", "title": "" } ]
[ { "docid": "2da8261a274581846e3d981828cf7dc6", "score": "0.6823254", "text": "async register(ctx, respond) {\n /** Creates a new user\n * required : name , email, password\n * optional : address\n */\n\n let {\n body: { email, password, name, address },\n } = ctx;\n // init missing fields\n address = address ? address : '';\n\n try {\n const registrationOrErr = await registerUseCase({ email, password, name, address })\n if (registrationOrErr.isSuccess) {\n const userJson = registrationOrErr.value\n respond(201, { user: userJson, message: 'successfully registered!' })\n } else {\n const failure = registrationOrErr.error\n switch (failure.name) {\n case failures.AUTH.INVALID_FIELDS.name:\n case failures.AUTH.EMAIL_TAKEN.name:\n respond(400, { err: failure.message })\n break;\n default:\n respond(500, { err: failure.message })\n break;\n }\n }\n } catch (error) {\n respond(500, { err: appFailures.create(error).message })\n }\n }", "title": "" }, { "docid": "8931d8bdbd251003c3be07ac42f1f913", "score": "0.67651397", "text": "function register() {\n FidoService.register(vm.registerRequest.challenge, vm.registerRequest.appId)\n .then(function (result) {\n // Store the result.\n vm.registrationResponse = result;\n\n // TODO: We'll need to work on our state management.\n StorageService.setItem('registration-result', result);\n\n }, function (error) {\n // Store the error.\n vm.registrationError = error;\n });\n }", "title": "" }, { "docid": "1f03e08c2d3b2775d99d8a1990589b89", "score": "0.66740996", "text": "async function newAccount() {\n try {\n await firebase.register(name, email, password);\n setTimeout(() => {\n Router.push('/');\n }, 1500);\n setError(false);\n setSuccess(true);\n } catch (error) {\n console.error('Hubo un error al crear la cuenta', error.message);\n setError(error.message);\n }\n\n }", "title": "" }, { "docid": "0c81a0ba7051878762c6aacbd6335a50", "score": "0.6629504", "text": "function register() {\n var username = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[0].value;\n var password = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[1].value;\n var confirmPassword = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[2].value;\n var email = document.getElementById(\"registrationForm\").getElementsByTagName(\"input\")[3].value;\n document.getElementById(\"registrationForm\").getElementsByTagName(\"p\")[0].style.display = \"none\";\n\n // Client-side validation.\n if (username === 'undefined' || username == '') {\n alert (\"Please enter a username.\");\n }\n else if (password === 'undefined' || password == '') {\n alert (\"Please enter a password.\");\n }\n else if (confirmPassword != password) {\n alert (\"Passwords do not match.\");\n }\n else if (!validateEmail(email)) {\n alert (\"Invalid email address.\");\n }\n\n // Valid, send to server and await response.\n else {\n authCreateAccount(username, password, email, function (loginResponse) {\n switch (loginResponse) {\n case (RESPONSE_ACCOUNT_CREATED):\n closeModals ();\n openModal(null, genericMessageModal,\n {\n messageTitle:\"Registration Success!\",\n message:\"Welcome to Adventure Guild, \" + username + \"! Check your email to confirm your account.\",\n });\n m.route(\"/home\");\n break;\n case (RESPONSE_USERNAME_TAKEN):\n document.getElementById(\"registrationForm\").getElementsByTagName(\"p\")[0].style.display = \"block\";\n break;\n case (RESPONSE_LOGGED_IN):\n alert(\"Already logged in\");\n break;\n default:\n alert(\"Unknown response code: \" + loginResponse);\n break;\n }\n });\n }\n\n // Suppress submission page refresh;\n return false;\n}", "title": "" }, { "docid": "1f430c24c5e32afb1d8875f91f473cd6", "score": "0.6578913", "text": "async confirmUserAsNeeded () {\n\t\tif (this.user.get('isRegistered')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst userData = {};\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.providerInfo[attribute]) {\n\t\t\t\tuserData[attribute] = this.providerInfo[attribute];\n\t\t\t}\n\t\t});\n\n\t\tawait new ConfirmHelper({\n\t\t\trequest: this,\n\t\t\tuser: this.user,\n\t\t\tdontCheckUsername: true,\n\t\t\tnotTrueLogin: true\n\t\t}).confirm(userData);\n\t\tthis.userWasConfirmed = true;\n\t}", "title": "" }, { "docid": "42fa97205ddf9bf4b3929e185987b057", "score": "0.6560757", "text": "async ['POST /register']({ body, t }) {\n const { User } = this.db;\n const check = await User.findOne({\n email: body.email\n });\n if (check instanceof Object) {\n throw this.Boom.badRequest({\n email: t('auth.email-exists')\n });\n }\n const config = this.config.user.confirmEmail;\n /**\n * Define a code to confirm email\n * @todo: add mailer\n */\n body.code = {\n value: await nanoid(config.codeLength),\n ttl: new Date(Date.now() + config.ttl)\n }\n const user = new User(body);\n await user.cryptPassword();\n await user.save();\n return { ok: true };\n }", "title": "" }, { "docid": "d03d16c3caaf75141959eab9192f49df", "score": "0.6547774", "text": "function createRegistration(context) {\n const username = context.params.username;\n const password = context.params.password;\n\n if (!validator.isValidForm(username, password)) {\n return;\n }\n\n userModel.register(username, password)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo('User registration successful.');\n context.redirect('#/dashboard');\n }).catch(handler.handleError);\n }", "title": "" }, { "docid": "981db5562701be58a94113c06cfca2f6", "score": "0.64633435", "text": "function registerCallback(result)\n{\n\tif(result === true)\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-body\").html(\"<p>You're account has been created, using some default values.<br/><br/>For Phood Buddy to give you recipes and information that helps <i>you</i> the most,<br/>it needs to know you better.<br/><br/> Go to the settings page after logging in to complete that information.</p>\");\n\t\t$(\".modal-header\").html(\"Registration Successful\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\twindow.location = \"https://phood-buddy.com/login.html\";\n\t\t});\n\t\t$(\"#btn-cancel\").css(\"display\", \"none\");\n\t}\n\telse\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-header\").html(\"Registration Failed\");\n\t\t$(\".modal-body\").html(\"<p>We had trouble registering your account. Perhaps that email has already been used to create an account at Phood Buddy.</p>\");\n\t\t$(\"#btn-cancel\").css(\"display\", \"none\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\t$(\"#btn-cancel\").css(\"display\", \"inline-block\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "04706016118d5ec1b5a67a6843dd24d3", "score": "0.64326173", "text": "async function confirmSignUp(data) {\n try {\n const status = await Auth.confirmSignUp(data.username, data.code);\n return status;\n } catch (error) {\n console.log('error confirming sign up', error);\n }\n}", "title": "" }, { "docid": "2001cee27f40db40f98953f6fe091f9b", "score": "0.6371907", "text": "function register() {\n var email = document.getElementById('signup-email').value;\n var password = document.getElementById('signup-password').value;\n\n // If password validation critera fails, stop creation\n if (!validatePasswordLength() || !validatePasswordConfirm()) {\n alert(\"Check password critera\");\n return;\n }\n\n // Make sure email is not flagged\n db.ref('valid-emails').orderByChild('email').equalTo(email).once(\"value\", function (snapshot) {\n if (!snapshot.exists()) {\n $('#signup-error').html(\"This email is not currently eligible. Please use your main tutor email or main client email.\");\n alert(\"This email is not currently eligible. Please use your main tutor email or main client email.\");\n } else {\n // Create new account\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function (user) {\n console.log(\"Created new account!\");\n }).catch(function (error) {\n console.log(error);\n alert(\"We couldn't enroll your email into our system, maybe you are already enrolled.\");\n });\n }\n });\n}", "title": "" }, { "docid": "8b7b50b132296c3b512053e90704bebf", "score": "0.63249815", "text": "@action\n register(registerInfo) {\n return userService.register(registerInfo)\n .then((response) => {\n if (!_.get(response, 'data.success')) {\n this.authLoading = false;\n return false;\n }\n\n const token = _.get(response, 'data.token');\n const user = _.get(response, 'data.user');\n\n this.handleAuthSuccess(token, user);\n return { success: _.get(response, 'data.success') };\n })\n .catch((err) => {\n this.authLoading = false;\n return { error: _.get(err, 'response.data.errorMessage', 'Error. Please try again.') };\n });\n }", "title": "" }, { "docid": "c5ef98fb400fb1433ef9a21c415590a4", "score": "0.6305844", "text": "async function signUp() {\n //const { email, password } = formState;\n let { username, email, password, confirmPassword } = formState;\n username = email;\n if (password !== confirmPassword) {\n return alert(\"Miss-matching passwords\");\n }\n\n await Auth.signUp({\n username,\n email,\n password,\n attributes: { email },\n });\n updateFormState(() => ({ ...formState, formType: \"confirmSignUp\" }));\n }", "title": "" }, { "docid": "2f50e5b415b9d36617a6ebe8769363e0", "score": "0.629021", "text": "function signUpGuide(firstName, lastName, email, password, phone, country, city, tour, cost) {\n $.post(\"/guide/register\", {\n firstName: firstName,\n lastName: lastName,\n email: email,\n password: password,\n phone: phone,\n country: country,\n city: city,\n tour: tour,\n cost: cost\n })\n .then(function(data) {\n window.location.replace(\"/account\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "5507ee31f99886328798ae6479b24af4", "score": "0.62900937", "text": "function registerNewUser(e) {\n\tif ($.password1.value != '' && $.password2.value != '' && $.email.value != '') {\n\t\tif ($.password1.value != $.password2.value) {\n\t\t\tvar error = Titanium.UI.createAlertDialog({\n\t\t\t\ttitle : \"Passwords do not match\",\n\t\t\t\tmessage : \"Please handle that and try again\"\n\t\t\t});\n\t\t\terror.show();\n\t\t} else {\n\t\t\tif (!checkemail($.email.value)) {\n\t\t\t\tvar error = Titanium.UI.createAlertDialog({\n\t\t\t\t\ttitle : \"Email error\",\n\t\t\t\t\tmessage : \"Please enter a valid email\"\n\t\t\t\t});\n\t\t\t\terror.show();\n\t\t\t} else {\n\t\t\t\t$.continueBtn.enabled = false;\n\t\t\t\t$.continueBtn.opacity = 0.3;\n\t\t\t\t//createAccountRequest.open(\"POST\",\"http://192.168.1.1/mobile/create-account.php\")\n\t\t\t\tcreateAccountRequest.open(\"POST\", \"http://www.waterbowl.net/mobile/create-account.php\");\n\t\t\t\tvar params = {\n\t\t\t\t\tpwd \t: $.password1.value,\n\t\t\t\t\temail : $.email.value\n\t\t\t\t};\n\t\t\t\tcreateAccountRequest.send(params);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tvar error = Titanium.UI.createAlertDialog({\n\t\t\ttitle : \"Eror\",\n\t\t\tmessage : \"All fields are required\"\n\t\t});\n\t\terror.show();\n\t}\n}", "title": "" }, { "docid": "79e6d10e85792815f4b018d78e45e7af", "score": "0.62754697", "text": "function register() {\n var testEmail = false\n var testZipcode = false\n var testPwd = false\n if (vm._username == '') {\n alert(\"username is needed\")\n }\n if (vm.email == undefined) {\n alert(\"email is needed\")\n }\n if (vm.zipcode == undefined) {\n alert(\"zipcode is needed\")\n }\n if (vm._password == undefined) {\n alert(\"password is needed\")\n }\n if (vm.rpwd == undefined) {\n alert(\"you still need to write password again\")\n }\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(vm.email)) {\n testEmail = true\n } else {\n alert(\"email wrong\")\n }\n /*validate zipcode\n */\n if (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(vm.zipcode)) {\n testZipcode = true\n } else {\n alert(\"zipcode wrong\")\n }\n if (vm._password == vm.rpwd) {\n testPwd = true\n } else {\n alert(\"password does not match\")\n\n }\n if (testEmail && testZipcode && testPwd) {\n api.register({\n 'username': vm._username,\n 'email': vm.email,\n 'zipcode': vm.zipcode,\n 'password': vm._password\n }).$promise.then(function(result) {\n if (result.result == 'success') {\n alert(\"register successfully, please login\")\n\n } else {\n alert(\"the user name has already existed\")\n\n }\n })\n }\n\n }", "title": "" }, { "docid": "452b8b7573b7330f13acf62debaee416", "score": "0.62731737", "text": "function doRegister() \n{ \n var token = cocoon.request.get(\"token\");\n\n if (token == null) \n {\n var email = cocoon.request.getParameter(\"email\");\n var accountExists = false;\n var epersonFound = false;\n var errors = new Array();\n\n do {\n \tif (accountExists) {\n\t\t\t\tcocoon.sendPage(\"forgot/verify\", {\"email\":email});\n return;\n }\n \n \tif (email == null) {\n\t cocoon.sendPageAndWait(\"register/start\",{\"email\" : email, \"errors\" : errors.join(','), \"accountExists\" : accountExists});\n\t\t\t}\n\t\t\t\n\t\t\t\n var errors = new Array();\n accountExists = false;\n \n var submit_forgot = cocoon.request.getParameter(\"submit_forgot\");\n \n if (submit_forgot != null)\n {\n // The user attempted to register with an email address that already exists then they clicked\n // the \"I forgot my password\" button. In this case, we send them a forgot password token.\n AccountManager.sendForgotPasswordInfo(getDSContext(),email);\n getDSContext().commit();\n\n cocoon.sendPage(\"forgot/verify\", {\"email\":email});\n return;\n }\n \n email = cocoon.request.getParameter(\"email\");\n email = email.toLowerCase(); // all emails should be lowercase\n epersonFound = (EPerson.findByEmail(getDSContext(),email) != null);\n \n if (epersonFound) \n {\n accountExists = true;\n continue;\n }\n \n var canRegister = AuthenticationUtil.canSelfRegister(getObjectModel(), email);\n \n if (canRegister) \n {\n try \n {\n // May throw the AddressException or a varity of SMTP errors.\n AccountManager.sendRegistrationInfo(getDSContext(),email);\n getDSContext().commit();\n } \n catch (error) \n {\n // If any errors occur while trying to send the email set the field in error.\n errors = new Array(\"email\");\n continue;\n }\n \n cocoon.sendPage(\"register/verify\", { \"email\":email, \"forgot\":\"false\" });\n return; \n } \n else \n {\n cocoon.sendPage(\"register/cannot\", { \"email\" : email});\n return;\n }\n \n } while (accountExists || errors.length > 0)\n } \n else \n {\n // We have a token. Find out who the it's for\n var email = AccountManager.getEmail(getDSContext(), token);\n \n if (email == null) \n {\n cocoon.sendPage(\"register/invalid-token\");\n return;\n }\n \n var setPassword = AuthenticationUtil.allowSetPassword(getObjectModel(),email);\n \n var errors = new Array();\n do {\n cocoon.sendPageAndWait(\"register/profile\",{\"email\" : email, \"allowSetPassword\":setPassword , \"errors\" : errors.join(',')});\n \n // If the user had to retry the form a user may allready be created.\n var eperson = EPerson.findByEmail(getDSContext(),email);\n if (eperson == null)\n {\n eperson = AuthenticationUtil.createNewEperson(getObjectModel(),email);\n }\n \n // Log the user in so that they can update their own information.\n getDSContext().setCurrentUser(eperson);\n \n errors = updateInformation(eperson);\n \n if (setPassword) \n {\n var passwordErrors = updatePassword(eperson);\n errors = errors.concat(passwordErrors);\n }\n \n // Log the user back out.\n getDSContext().setCurrentUser(null);\n } while (errors.length > 0) \n \n // Log the newly created user in.\n AuthenticationUtil.logIn(getObjectModel(),eperson);\n AccountManager.deleteToken(getDSContext(), token);\n getDSContext().commit();\n \n cocoon.sendPage(\"register/finished\");\n return;\n }\n}", "title": "" }, { "docid": "5fd70e13b7e199bf396a09c8458234e6", "score": "0.62645507", "text": "function register(email, password){\r\n reg.createUser({\r\n email: email,\r\n password: password\r\n }, function(error, userData){\r\n if(error){\r\n alert(\"You did not register\");\r\n }else{\r\n alert(\"You registered\"+userData.uid);\r\n }\r\n })\r\n }", "title": "" }, { "docid": "01c3f47c2ea915fdc34654f829908ce7", "score": "0.6254785", "text": "async function registrationHandler(req, res) {\n\tlet { username, password } = req.body;\n\tif (username == undefined || password == undefined) {\n\t\tres.status(400).send(\"Missing username or password\");\n\t} else if (!isValidUsername(username)) {\n\t\tres.status(400).send(\"Invalid username\")\n\t} else if (!isValidPassword(password)) {\n\t\tres.status(400).send(\"Invalid password\")\n\t} else try {\n\t\tawait createAccount(username, password)\n\t\t\t.then(acct => createSession(acct, res));\n\t\tres.sendStatus(201);\n\t} catch (err) {\n\t\tif (err.code == 11000) { // violation of \"unique\" constraint\n\t\t\tres.status(409)\n\t\t\t\t.send(`Username already taken: ${username}`);\n\t\t} else {\n\t\t\tconsole.error(err);\n\t\t\tres.sendStatus(500);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "249278ce06855f5b734531bb3e760ef9", "score": "0.6230783", "text": "onProceedButtonPressed() {\n const oldThis = this;\n if (this.state.creatingNewAccount) {\n UserManager.getInstance().createUser(this.state.emailField, \n this.state.emailField.split('@')[0], this.state.passwordField)\n \n .then(_ => {\n // At this point, UserManager has guaranteed successful account creation\n oldThis.attemptLogin();\n })\n .catch(error => {\n alert(\"Your email is already being used, please use another.\");\n });\n \n } else {\n this.attemptLogin();\n }\n }", "title": "" }, { "docid": "12093df552e7da67d473271dd46a4204", "score": "0.6219021", "text": "async function register() {\r\n if(user.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n if(description.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n if(balance.classList.contains(\".invalid\")) {\r\n event.preventDefault();\r\n }\r\n let testUser = await getUserList(`${user.value}`)\r\n if(user.value == testUser.user) {\r\n userWarning.classList.remove('hide');\r\n console.log(\"I think it should be working...\")\r\n return;\r\n }\r\n\r\n const registerForm = document.getElementById('registerForm');\r\n const formData = new FormData(registerForm);\r\n const data = Object.fromEntries(formData);\r\n const jsonData = JSON.stringify(data);\r\n const result = await createAccount(jsonData);\r\n\r\n if (result.error) {\r\n return console.log('An error occured:', result.error);\r\n }\r\n currentUser = user.value;\r\n document.querySelector(\".loginSection\").classList.add('hide');\r\n registerForm.classList.add('hide');\r\n document.querySelector('h4').classList.add('hide');\r\n document.querySelector(\".newTransaction\").classList.remove('hide');\r\n \r\n console.log('Account created!', result);\r\n }", "title": "" }, { "docid": "d1c70b276c3fab77068f4159002774a5", "score": "0.6217044", "text": "createAccount(){\n\t\tAppDispatcher.dispatch({\n\t\t\ttype: constants.CREATED_ACCOUNT,\n\t\t\tammount: 0\n\t\t});\n\t}", "title": "" }, { "docid": "607eb6f39471f1c302a8df742f178c19", "score": "0.6209076", "text": "function register() {\n if(isEmailValid && isPasswordValid && isNameValid) {\n auth.createUserWithEmailAndPassword(email, password) \n .then(result => {\n alert(\"Account created, you may now login\")\n db.collection(\"users\").doc(result.user.uid).set({\n name: name,\n type: \"user\"\n }).catch(error => {\n console.log(error.message)\n })\n navigation.navigate('Login') \n }).catch(error => {\n alert(error.message)\n }) \n } \n }", "title": "" }, { "docid": "9564adef1cb834801e961646af022c7c", "score": "0.6205901", "text": "function registerUser() {\n var passwordVal = $passwordFld.val();\n var verifyPasswordVal = $verifyPasswordFld.val();\n if(passwordVal !== verifyPasswordVal)\n {\n $passwordAlertID.show();\n }\n else\n {\n $passwordAlertID.hide();\n userService\n .register($usernameFld.val(),passwordVal)\n .then(toggleAlertMessages)\n .then(emptyForm);\n }\n }", "title": "" }, { "docid": "e7255c06525868ddb17541a9e5edce9c", "score": "0.6200168", "text": "function register() {\n\t// Hide alert message.\n\talertDanger.style.display = 'none';\n\talertSuccess.style.display = 'none';\n\n\t// Validate form.\n\tconst formValidation = new FormValidation();\n\tlet validationResult = formValidation.validateForm(rules);\n\n\tlet name = document.getElementsByName('name')[0];\n\tlet email = document.getElementsByName('email')[0];\n\n\t// If validation passed, send request to the API to store the registration data.\n\tif (validationResult) {\n\t\tconst httpRequest = new HttpRequest();\n\t\thttpRequest.post('http://localhost:8000/api/v1/events/subscribers', {'name': name.value, 'email': email.value})\n\t\t\t.then((data) => {\n\t\t\t\talertSuccess.style.display = 'block';\n\t\t\t\tname.value = '';\n\t\t\t\temail.value = '';\n\t\t\t}).catch((error) => {\n\t\t\t\tif (error.response) {\n\t\t\t\t\tlet errorResponse = JSON.parse(error.response);\n\t\t\t\t\talertDanger.innerText = errorResponse.error.data[0];\n\t\t\t\t} else {\n\t\t\t\t\talertDanger.innerText = 'Oops! Something wrong happened.'\n\t\t\t\t}\n\n\t\t\t\talertDanger.style.display = 'block';\n\t\t\t})\n\n\t\thideSpinner();\n\t}\n\n\thideSpinner();\n}", "title": "" }, { "docid": "240584161532943b0f1af75c918bdfd9", "score": "0.6182895", "text": "function haveAccount (){\n \n prompt(\"Have account?\",Yes, No){\n //do you have an account?\n if Yes /*True?*/ AcctHolder()\n //create new account\n } else No /*false??*/newUser(){\n\n };\n }", "title": "" }, { "docid": "87d41c8f3ecd775e17a843b92dc91c18", "score": "0.6173547", "text": "async function signup (req, res, next) {\n try {\n if (checkMandatoryParameters(req)) {\n const response = await userModel.create(req.body);\n const token = auth.createToken(response.id);\n badgesModel.createBadgesForUser(response.id);\n res.status(201).json({ token });\n } else {\n next({ status: 400, error: `Account could not be created.` });\n }\n } catch (e) {\n console.log(e);\n next({ status: 400, error: `User could not be registered` });\n };\n}", "title": "" }, { "docid": "02184f1b04eb1c325c21a5a6a27113e2", "score": "0.61707324", "text": "function isUserCreatedAccount() {\n\t$('#sign-in').submit(function(){\n\t\tcreateUser();\n\t\tisUserConnected();\n\t\treturn false;\n\t});\n}", "title": "" }, { "docid": "4e31b60bf22afe74da2ca03870f8c9db", "score": "0.6159618", "text": "function registerUser() {\n if(!firstName || !lastName || !username || !password || !email || !ssn) { //check if all required fields are filled\n setErrormsg(\"Please fill in all required fields\")\n return\n }\n\n let data = ({\n role: 2,\n firstName: firstName,\n lastName: lastName,\n username: username,\n password: password,\n email: email,\n ssn: ssn,\n update: updateExisting\n })\n\n fetch('/user/register', {\n method: 'POST', \n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n }).then(response => {\n console.log(response)\n if(response.status === 201) { // user is registered \n window.location = \"/\" \n }\n else if(response.status === 200) { // ok request\n response.json().then(result => setErrormsg(result.statusMessage))\n } \n else if(response.status === 400) { // bad request\n setErrormsg(response.statusText)\n }\n else if(response.status === 500) { // internal error\n setErrormsg(response.statusText)\n } \n })\n }", "title": "" }, { "docid": "d3ad44361a19430594b88f46c621a29c", "score": "0.61424816", "text": "register () {\n this.contestService.enroll(this.id, this.key)\n .then(data => {\n this.alertService.showMessage(MESSAGES.contestRegistered)\n window.$('#register-modal').modal('hide')\n this.status = 'registered'\n })\n .catch(error => {\n if (error.status === 400) {\n this.alertService.showMessage(MESSAGES.contestErrorRegister)\n } else if (error.status === 401) {\n this.alertService.showMessage(MESSAGES.permissionsError)\n } else {\n this.alertService.showMessage(MESSAGES.unknownError)\n }\n window.$('#register-modal').modal('hide')\n })\n }", "title": "" }, { "docid": "87d35a128ff271ed51d1044e53c42728", "score": "0.61294866", "text": "create(body, send_activation, res, callback) {\n\n\t\t// Legacy Create\n\t\tconst first_name = body.first_name;\n\t\tconst last_name = body.last_name;\n\t\tconst email = body.email;\n\n\t\tlet username = body.username;\n\n\t\t// password will be set on successful e-mail activation\n\n\t\tif ((typeof (email) === \"undefined\") || (email === null)) {\n\t\t\treturn callback(res, false, \"email_required\");\n\t\t}\n\n\t\tlet new_owner_hash = sha256(prefix + email.toLowerCase());\n\n\t\t// OAuth Create\n\t\tif (typeof (username) === \"undefined\") {\n\t\t\tusername = new_owner_hash;\n\t\t}\n\n\t\tthis.userlib.get(new_owner_hash, (user_get_error) => {\n\n\t\t\t// test username, must mirror ../../spec/_envi.json:test_info.username; should not exist in production\n\t\t\tif ((process.env.ENVIRONMENT === \"test\") || (process.env.ENVIRONMENT === \"development\")) {\n\t\t\t\tconsole.log(\"[DEBUG] running in test env\");\n\t\t\t\tif (!user_get_error && (username !== \"cimrman\")) {\n\t\t\t\t\tconsole.log(\"⚠️ [warning] User already exists\", username, new_owner_hash);\n\t\t\t\t\tif (typeof (callback) === \"undefined\") {\n\t\t\t\t\t\tthrow new Error(\"DEVELOPER ERROR: create callback missing in test, e-mail already exists\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(res, false, \"email_already_exists\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// ouath username to search by, otherwise returns everything\n\t\t\tif (username === \"\" || username === null) {\n\t\t\t\tusername = new_owner_hash;\n\t\t\t}\n\n\t\t\t// FIXME: contains username hash\n\t\t\tconsole.log(\"[DEBUG] [create] checking owner by username\", username);\n\n\t\t\t// Check for existing username, should return error.\n\t\t\tthis.userlib.view(\"users\", \"owners_by_username\", {\n\t\t\t\t\"key\": username,\n\t\t\t\t\"include_docs\": true\n\t\t\t}, (err, user_view_body) => {\n\n\t\t\t\tif (err !== null) {\n\t\t\t\t\t// Should be missing\n\t\t\t\t\tif (err.toString().indexOf(\"Error: missing\") === -1) {\n\t\t\t\t\t\tconsole.log(\"☣️ [error] Is the DB created? New user should not cause: \" + err);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet user_should_not_exist = user_view_body.rows.length;\n\t\t\t\t\tif (user_should_not_exist > 0) {\n\t\t\t\t\t\t// https://rollbar.com/thinx-dev/THiNX/items/1041/\n\t\t\t\t\t\t// causes headers to be re-set on login\n\t\t\t\t\t\tconsole.log(\"☣️ [error] Username already exists: \" + username);\n\t\t\t\t\t\treturn callback(res, false, \"username_already_exists\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet new_activation_date = new Date().toString();\n\t\t\t\tlet new_activation_token = sha256(new_owner_hash + new_activation_date);\n\n\t\t\t\tlet default_info = {\n\t\t\t\t\t\"first_name\": first_name,\n\t\t\t\t\t\"last_name\": last_name,\n\t\t\t\t\t\"mobile_phone\": \" \",\n\t\t\t\t\t\"security\": {\n\t\t\t\t\t\t\"important_notifications\": false,\n\t\t\t\t\t\t\"unique_api_keys\": false,\n\t\t\t\t\t\t\"global_push\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"goals\": [],\n\t\t\t\t\t\"username\": username,\n\t\t\t\t\t\"owner\": new_owner_hash,\n\t\t\t\t\t\"email\": email,\n\t\t\t\t\t\"transformers\": [],\n\t\t\t\t\t\"gdpr_consent\": false\n\t\t\t\t};\n\n\t\t\t\tconsole.log(\"[DEBUG] will create_default_mqtt_apikey\");\n\n\t\t\t\t// should not throw\n\t\t\t\tthis.create_default_mqtt_apikey(new_owner_hash, (success) => {\n\n\t\t\t\t\tif (!success) {\n\t\t\t\t\t\tconsole.log(`☣️ [error] Creating Default MQTT API Key Failed for ${new_owner_hash}`);\n\t\t\t\t\t\treturn callback(res, false, \"creating_mqtt_api_key_failed\");\n\t\t\t\t\t}\n\n\t\t\t\t\tlet activation_email_descriptor = {\n\t\t\t\t\t\tnew_owner_hash: new_owner_hash,\n\t\t\t\t\t\tnew_activation_token: new_activation_token,\n\t\t\t\t\t\temail: email,\n\t\t\t\t\t\tfirst_name: first_name,\n\t\t\t\t\t\tlast_name: last_name,\n\t\t\t\t\t\tusername: username\n\t\t\t\t\t};\n\n\t\t\t\t\tconsole.log(`🔨 [debug] Created Default MQTT API Key for new_owner_hash ${new_owner_hash}`);\n\n\t\t\t\t\t// Create user document\n\t\t\t\t\tlet new_user = {\n\t\t\t\t\t\towner: new_owner_hash,\n\t\t\t\t\t\tusername: username,\n\t\t\t\t\t\temail: email,\n\t\t\t\t\t\tapi_keys: [],\n\t\t\t\t\t\trsa_keys: {},\n\t\t\t\t\t\tfirst_name: first_name,\n\t\t\t\t\t\tlast_name: last_name,\n\t\t\t\t\t\tactivation: (send_activation) ? new_activation_token : false, // OAuth logins without e-mail confirmation\n\t\t\t\t\t\tactivation_date: new_activation_date,\n\t\t\t\t\t\trepos: default_repos,\n\t\t\t\t\t\tinfo: default_info\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.userlib.insert(new_user, new_owner_hash, (err_u) => {\n\t\t\t\t\t\tif (err_u) {\n\t\t\t\t\t\t\tif (err_u.statusCode == 409) {\n\t\t\t\t\t\t\t\tcallback(res, false, \"email_already_exists\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.log(\"☣️ [error] owner_error\", err_u);\n\t\t\t\t\t\t\t\tcallback(res, false, \"owner_error\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Skip e-mail dance in test, return token immediately instead.\n\t\t\t\t\t\t\tif (process.env.ENVIRONMENT === \"test\") {\n\t\t\t\t\t\t\t\treturn callback(res, true, new_activation_token);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!send_activation) {\n\t\t\t\t\t\t\t\treturn callback(res, true, \"account_created\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if this fails, should not insert the user (but may be optional in tests or local!).\n\t\t\t\t\t\t\tthis.sendActivationEmail(activation_email_descriptor, (send_success, result) => {\n\n\t\t\t\t\t\t\t\t// This can fail with GitHub/Google where no mail should be sent at all!\n\t\t\t\t\t\t\t\t// This can fail in test but user will not be activated\n\t\t\t\t\t\t\t\tif (process.env.ENVIRONMENT !== \"test\") {\n\t\t\t\t\t\t\t\t\tif (!send_success) {\n\t\t\t\t\t\t\t\t\t\tif (send_activation) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"[user create] Exiting...\");\n\t\t\t\t\t\t\t\t\t\t\treturn callback(res, false, result);\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\tconsole.log(\"activation_email_descriptor\", activation_email_descriptor, \"send_activation\", send_activation);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcallback(res, true, \"email_sent\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}); // insert owner\n\t\t\t\t});\n\t\t\t}); // create API key\n\t\t}); // view owners\n\n\t}", "title": "" }, { "docid": "4c2d0abc5eb4a2503374ed3169fa95df", "score": "0.6091698", "text": "function confirmNewUser() {\n inquire\n .prompt([\n {\n name: \"confirm\",\n type: \"confirm\",\n message: \"Would you like to create an account with Bamazon today?\",\n default: true\n }\n ]).then(function(answer) {\n if (answer.confirm) {\n inquire\n .prompt([\n {\n name: \"name\",\n type: \"input\",\n message: \"Enter your name and get ready to enjoy Bamazon!\"\n }\n ]).then(function(answer) {\n // takes the newly made user and updates the name by taking the last created user id and updating the name field\n customerName.push(answer.name)\n connection.query(\n \"UPDATE users SET ? ORDER BY user_id DESC LIMIT 1\",\n {\n name: answer.name\n }\n\n ), function (err, res) {\n\n \n if (err) throw err;\n \n };\n start();\n });\n \n\n }\n });\n}", "title": "" }, { "docid": "440e5cf0d3190169c9d077f8d394e972", "score": "0.607655", "text": "async postRegister(req,res,next){\n //new user object \n const newUser = new User({\n //trim() ensures if a user mistakenly leaves whitespace\n //it is removed before saving to the database.\n username: req.body.username.trim(), \n email: req.body.email.trim(),\n password: req.body.password,\n userFirstName: req.body.userFirstName.trim(),\n userLastName: req.body.userLastName.trim(),\n subscription: req.body.subscription,\n userAvatar: req.body.userAvatar.trim(),\n hasPaid: req.body.hasPaid = false\n });\n\n //creating user variable comprised of their details and password\n let user = await User.register(newUser, req.body.password); \n \n //passing user variable into login method which includes logic to check\n //if they are a paid or free subscriber. If paid they are directed to the \n //payment page. If not they are directed to the home page. Flash messages \n //are used to notify the user they have been successful. \n req.login(user,(err) =>{\n if(err) {\n req.flash(\"error\", \"User already exists with this email!\");\n return res.redirect('/register');\n return next (err);\n }else{ \n if(user.subscription === \"Paid\"){\n res.redirect('/payment');\n req.flash(\"success\", \"You are now regsistered \" + req.body.username);\n \n } else{ \n \n req.flash(\"success\", \"You are now regsistered \" + req.body.username);\n res.redirect('/');\n \n }\n }\n });\n \n }", "title": "" }, { "docid": "c4e2bc1d045bb87ef2de2ac83ca52d99", "score": "0.607156", "text": "function doCreateAccount(){\n var username = YAHOO.lang.trim(YAHOO.util.Dom.get('new_username').value);\n var password = YAHOO.lang.trim(YAHOO.util.Dom.get('new_password').value);\n var confirmPassword = YAHOO.lang.trim(YAHOO.util.Dom.get('confirm_password').value);\n \n //Validation checks\n var usernameCheck = validateUsername(username);\n var passwordCheck = validatePassword(password);\n if (usernameCheck !== '') {\n YAHOO.util.Dom.get('newAccountMessage').innerHTML = usernameCheck;\n return false;\n }\n else \n if (usernameExists(username) === true) {\n YAHOO.util.Dom.get('newAccountMessage').innerHTML = \"Username already in use! Please try another.\";\n return false;\n }\n else \n if (passwordCheck !== '') {\n YAHOO.util.Dom.get('newAccountMessage').innerHTML = passwordCheck;\n return false;\n }\n else \n if (password !== confirmPassword) {\n YAHOO.util.Dom.get('newAccountMessage').innerHTML = \"Passwords do not match! Please try again.\";\n return false;\n }\n \n var newUserResult = addNewUser(username, password);\n if (newUserResult) {\n\t\t//Cleanup the fields so they are not present on signout/create during the initial session\n\t\tYAHOO.util.Dom.get('new_username').value = '';\n\t\tYAHOO.util.Dom.get('new_password').value = '';\n\t\tYAHOO.util.Dom.get('confirm_password').value = '';\n\t\t\n\t YAHOO.util.Dom.get('loginMessage').innerHTML = 'Account created successfully! Please login.';\n\t\tYAHOO.util.Dom.setStyle('registration-form', 'display', 'none');\n\t\tYAHOO.util.Dom.setStyle('login-form', 'display', 'block');\n }\n else {\n alert('Unable to create new user. Please try again!');\n return false;\n }\n}", "title": "" }, { "docid": "d87916e3b45e5aa14f6069b37724c626", "score": "0.6063796", "text": "async register(_, {email, username, fullname, password}) {\n return this.dispatch('graphql', {\n query: {\n op: 'register',\n vars: {email, username, fullname, password},\n fields: ['id', 'permissions']\n }\n }).then(({errors}) => {\n\n // Check for errors and, if present, return the message of the first one\n if (errors && errors.length) {\n throw errors[0].message;\n }\n });\n }", "title": "" }, { "docid": "c5b594fcb18c67cc4c75d3db5f8b90bc", "score": "0.6056636", "text": "async register(req, res, next) {\n const password = req.body.password;\n const newUser = req.body;\n // Check if the user with the email exist\n if ((await accountRepository.findUserByEmail(newUser.email)) == null) {\n // Encrypt user password\n const salt = await bcrypt.genSalt(10);\n const hashPassword = await bcrypt.hash(newUser.password, salt);\n newUser.password = hashPassword;\n\n // Add a unique user ID\n newUser.userId = uuid.v4();\n\n // Add parent role by default\n newUser.role = 'parent';\n\n // Save the user to the datbase\n accountRepository\n .register(newUser)\n .then(user => {\n res.render('parent/dashboard', { user });\n })\n .catch(error => {\n console.error(error);\n res.render('shared/error', { errorMessage: error.message });\n });\n\n // The user with specified email already exist in the DB\n } else {\n res.render('shared/error', {\n errorMessage: `The user with email ${req.body.email} is already taken, use another one!!`\n });\n }\n }", "title": "" }, { "docid": "a6d62d45349a9e50e833ea76b711ea0d", "score": "0.60534734", "text": "function register() {\n if(registerPassword.value != confirmPassword.value) {\n confirmPassword.setCustomValidity(\"Passwords stemmer ikke overens!\");\n } else {\n localStorage.setItem('registername', registerName.value);\n localStorage.setItem('registerpassword', registerPassword.value);\n }\n}", "title": "" }, { "docid": "12b81b4bc259604a007a02b590983f9a", "score": "0.60354894", "text": "async function register(event) {\n event.preventDefault();\n const formData = new FormData(event.target);\n const data = Object.fromEntries(formData);\n const jsonData = JSON.stringify(data);\n const response = await createAccount(jsonData);\n console.log(jsonData);\n console.log(\"Result\", response);\n\n account = response;\n navigate(\"/dashboard\");\n}", "title": "" }, { "docid": "b5a7c395d32aefd1a9894746a11cbbda", "score": "0.60349834", "text": "function doRegister() {\r\n var email = document.getElementById(\"email\").value;\r\n if (email == null || email.length == 0) {\r\n alert(\"Please enter email\");\r\n return;\r\n } else if (verifyemail(email) == false) {\r\n alert(\"Invalid email\");\r\n return;\r\n }\r\n\r\n // you can register different authentication methods such as yubikey or authenticator OTP. For now keep it simple and show passsword as registration request\r\n appkey.Register({\r\n email: email,\r\n method: \"password\",\r\n success: function (e) {\r\n alert(e.message);\r\n },\r\n error: function (e) {\r\n alert(\"error \" + e.error + \"<br>\" + e.message);\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "aa50281fed77cfb34b8b1ee7d3e2e0db", "score": "0.60285616", "text": "static async post(request, reply) {\n\n // 1) Sanitize data\n request.payload.email = sanitizeEmailAddress(request.payload.email);\n\n // 2) Validate payload data\n if (Joi.string().email().validate(request.payload.email).error) {\n return reply(BadRequest.invalidParameters('payload', {'email': ['\"email\" must be a valid email']})).code(400);\n } else if (await User.getByEmail(request.payload.email)) {\n return reply(BadRequest.invalidParameters('payload', {email: ['\"email\" is already registered']})).code(400);\n }\n\n // 3) If everything checks, create a user account and return HTTP response immediately\n let user = await User.create(request.payload);\n reply().code(201);\n\n // 4) Create activation token and send respective email\n try {\n let activationToken = JWT.sign({\n email: user.email,\n token: await User.createConfirmationToken(user.id, ConfirmationToken.ACTIVATE_ACCOUNT)\n }, JWTAuthentication.getPrivateKey());\n sendEmailTemplate(EmailTemplate.ACCOUNT_CREATED, request.payload.email, {\n name: user.name,\n url: `${config.storefront.baseUrl}/${config.storefront.defaultLocale}/register/confirm/${activationToken}`\n }).then(function () {\n User.updateStatus(user.id, UserStatus.PENDING_CONFIRMATION);\n }, function (err) {\n log.error(err, 'Unable to send account confirmation email');\n });\n } catch (err) {\n log.error(err, 'Unable to create activation token');\n }\n }", "title": "" }, { "docid": "89c1402aa011b9a2f2847c45480f8f69", "score": "0.6017743", "text": "static register(request, response) {\r\n \r\n const conditions = [\r\n {\r\n field: 'name',\r\n value: request.body.name\r\n },\r\n {\r\n field: 'email',\r\n value: request.body.email\r\n },\r\n {\r\n field: 'password',\r\n value: request.body.password\r\n },\r\n {\r\n field: 'countrycode',\r\n value: request.body.countrycode\r\n },\r\n {\r\n field: 'areacode',\r\n value: request.body.areacode\r\n },\r\n {\r\n field: 'telephone',\r\n value: request.body.telephone\r\n },\r\n {\r\n field: 'zipcode',\r\n value: request.body.zipcode\r\n },\r\n ];\r\n\r\n console.log(\"request.body.email\", request.body.email);\r\n console.log(\"request.body.password\", request.body.password);\r\n\r\n clientsModel.insert(conditions)\r\n .then( data => {\r\n\r\n clientsModel.auth(conditions)\r\n .then( data => {\r\n response.sendStatus(200);\r\n console.log('Client has been registered: ', request.body.email);\r\n })\r\n\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error inserting client: ', request.body.email, err);\r\n }); \r\n }", "title": "" }, { "docid": "393c39f05d9c462143faab36302b5345", "score": "0.6007466", "text": "function signup(name, usertype, id, password) {\n var xhr = createXMLHttpRequest();\n xhr.onreadystatechange = (event) => {\n if (event.target.readyState == XMLHttpRequest.DONE\n && event.target.status == 200)\n {\n console.log(event.target.response);\n if (event.target.response != 'OK') {\n alert(\"Fehler beim Registrieren.\");\n } else {\n cacheCredentials(address, password, usertype);\n\n // console.log(checkCredentials(address, password));\n var data;\n if (usertype == 'student') {\n data = accountmanagerInstance.registerStudent.getData(address, name, id);\n } else if (usertype == 'supervisor') {\n data = accountmanagerInstance.registerSupervisor.getData(address, name, id);\n }\n signAndSend(data, accountmanagerInstance.address, (error, result) => {\n if (!error) {\n enter();\n }\n });\n }\n }\n };\n\n var address = web3.personal.newAccount(password);\n var requestData = 'usertype=' + usertype + '&id=' + id + '&address=' + address+ '&password=' + password;\n xhr.open('POST', 'php/signup.php', true);\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.send(requestData);\n}", "title": "" }, { "docid": "d16405b4eb0ad31e0f140749a23510b7", "score": "0.6001082", "text": "static async register(req, res, next) {\n try {\n const { email, password } = req.body\n const user = await User.create({ email, password })\n res.status(201).json({\n msg: `Register success`,\n id: user.id,\n email: user.email,\n })\n } catch (err) {\n next(err)\n }\n }", "title": "" }, { "docid": "ee98c54c30c9ee7b13762842f04582c6", "score": "0.5997594", "text": "function register() {\n if(emailInput.value && passwordInput.value && passwordConfirmInput \n && passwordConfirmInput.value === passwordInput.value\n && validateEmail(emailInput.value)) {\n submitButton.removeAttribute(\"disabled\",\"\");\n } \n}", "title": "" }, { "docid": "ab3f79d927b5a8675b61c08f8399e6c5", "score": "0.59967905", "text": "register(req, res, next) {\n // Check for registration errors\n const email = req.body.email;\n const password = req.body.password;\n const firstName = req.body.firstName;\n const lastName = req.body.lastName;\n const status = req.body.status;\n if (!email) {\n return res.status(422).send({ error: \"You must enter an email address.\" });\n }\n if (!firstName || !lastName) {\n return res.status(422).send({ error: \"You must enter your full name.\" });\n }\n if (!password) {\n return res.status(422).send({ error: \"You must enter a password.\" });\n }\n if (!status) {\n return res.status(422).send({ error: \"You must enter a status.\" });\n }\n user_1.User.findOne({ email }, function (err, existingUser) {\n if (err) {\n return next(err);\n }\n if (existingUser) {\n return res.status(422).send({ error: \"This email address is already registered.\" });\n }\n else {\n const user = new user_1.User({\n admin: false,\n developer: false,\n email,\n game: [{}],\n password,\n status,\n profile: { firstName, lastName }\n });\n user.save(function (err, user) {\n if (err) {\n return next(err);\n }\n const userInfo = user.toJSON();\n res.status(201).json({\n token: \"Bearer \" + jsonwebtoken_1.default.sign(userInfo, config_1.default.secret, { expiresIn: 10080 }),\n user: userInfo\n });\n });\n }\n });\n }", "title": "" }, { "docid": "f83eea2d456103cf3008f208acb2781b", "score": "0.5995975", "text": "async account_activations_post(req, res,next) {\n let { email, token } = _.pick(req.body, 'email', 'token');\n\n try {\n let user = await User.findByEmail(email);\n if (user.getAttribute('activated')) {\n // already activated\n } else if (user.authenticated('activation', token)) {\n user.setActivated();\n } else {\n throw new Error();\n }\n res.send();\n } catch (e) {\n console.log(e);\n res.send(401);\n }\n }", "title": "" }, { "docid": "359816c0bd036fa9fce0eab51a9b9fe3", "score": "0.5992657", "text": "register(values){\n return this._post('register', values)\n .then(res => this.authenticate(values))\n }", "title": "" }, { "docid": "55fde4bae57552fda43a0efd36d30da3", "score": "0.5991898", "text": "register(req, resp) {\n // Getting req param\n let userName = req.body.name;\n let email = req.body.email;\n let address = req.body.address;\n let password = req.body.password;\n let role = req.body.role;\n let self = this;\n // Validating\n // Case 1: Checcking require field value\n if(!userName || !password || !email || !role) {\n return resp.status(400).send({ message: \"Please enter all the required field\"});\n }\n\n // Case 2: Password\n if (password && password.length < 4 ) {\n return resp.status(400).send({ message: \"Please enter a password of length 4 or more\"});\n }\n\n // Case3: Role\n if (!self.isValidRole(role)) {\n return resp.status(400).send({ message: \"Please enter a valid role\"});\n }\n\n // Create User\n let user = new User({\n userId: Date.now().toString(),\n password: password,\n address: address,\n email: email,\n name: userName,\n role: role,\n createDate: new Date()\n });\n\n // Check user exists or not\n this.user(email).then((existing) => {\n if (existing) {\n this.commonError(`User exists with email => ${email}`, null, 409, resp )\n } else {\n this.newUser(user, resp);\n }\n }).catch((err) => {\n this.commonError(`Check existing user error`, err, 500, resp);\n });\n }", "title": "" }, { "docid": "c0cb0d1ad3496af92651b72a1ec88bb6", "score": "0.5988051", "text": "async function register() {\n const rusername = document.getElementById(\"username\").value;\n const rpassword = document.getElementById(\"password\").value;\n if (await registerUser(rusername, rpassword)) {\n alert(\"New User Registered!\");\n } else {\n setShowError(\"Username entered already exists\");\n }\n }", "title": "" }, { "docid": "83594902f2b4eda72e9c014b05d68e8b", "score": "0.59844273", "text": "function activateAccount() {\n\n REQUESTS.activateAcct(Q_STRING, () => { showSuccess() }, err => {\n\n if (err.status === 410) {\n showFailed(...EXPIRED);\n } else if (err.status === 403) {\n showSuccess(); // show success because 403 means user is already activated\n } else {\n showFailed(...INVALID);\n }\n\n });\n}", "title": "" }, { "docid": "4b34af2813a37d144eebdd342968eeaa", "score": "0.59808344", "text": "register(e) {\n e.preventDefault();\n const email = this.$('#email').val();\n const password = this.$('#password').val();\n const confirmPassword = this.$('#confirmPassword').val();\n console.log('test');\n if (session.validatePassword(password, confirmPassword)) {\n session.register(email, password);\n } else {\n alert('Your passwords do not match');\n }\n this.model.register(email, password);\n }", "title": "" }, { "docid": "f66905ef849deb5ab37bf29d03c224cf", "score": "0.5973106", "text": "static async registerUser(req, res) {\n try {\n const {\n firstName, lastName, gender, department, type, email,\n phoneNo, password, isAdmin,\n } = req.body;\n const hashedPassword = processPassword.hashPassword(password);\n const register = await con.query(userTable.addUser,\n [firstName, lastName, gender, department, type, email, phoneNo, hashedPassword, 'active', isAdmin]);\n if (register.rowCount !== 0) {\n const token = await generateToken.signToken(req.body);\n return res.status(201).json({\n status: 201,\n message: 'user created',\n token,\n });\n }\n throw register;\n } catch (error) {\n return res.status(500).json({\n status: 500,\n error: 'internal server error',\n });\n }\n }", "title": "" }, { "docid": "4aaa4f6a80d8c43dd82bd7344848f74d", "score": "0.59680563", "text": "async signupDeveloper(req, res) {\n\t\n\t\tconst email = req.param(\"email\"),\n\t\t\tpassword = req.param(\"password\");\n\t\t\t\t\n try {\n\t\t\t\t\t\n\t\t\t// Validate sent params\n\t\t\tif(!email || !password){\n\t\t\t\tthrow new CustomError('You did not provide all signup details required.', {status: 400});\n\t\t\t}\n\t\t\t\t\n let existingDeveloper = await Developer.findOne({email: email});\n\n\t\t\t// Player already exists\n if(existingDeveloper){\n\t\t\t\tthrow new CustomError('This email is already registered with another account. Please login to your account.', {status: 400});\n }\n\t\t\t\n\t\t\t// Create activation PIN\n\t\t\tlet pin = util.randomFixedInteger(6);\n\t\t\t\n\t\t\t// Create new player account\n\t\t\t// AccountStatus: 0 = blocked, 1 = pending activation, 2 = activated\n\t\t\tlet developer = await Developer.create({\n\t\t\t\temail: email,\n\t\t\t\tpassword: password,\n\t\t\t\tpin: pin,\n\t\t\t\taccountStatus: 1,\n\t\t\t\tforceBalance: '0'\n\t\t\t});\n\t\t\t\n\t\t\t// Create the users wallet\n\t\t\t//WalletService.createUserWallet(player.id).catch(err=>{sails.log.error('On signup, failed to create player wallet: ', err)});\n\t\t\tlet activationLink = \"https://app.raidparty.io/activate?developer=\" + developer.developerId + \"&pin=\" + pin;\n\t\t\t\n\t\t\tlet msg = `Welcome to RaidParty!<br />\n\t\t\t\tYour account has been created and is now awaiting your activation. Please click on the activation link below to activate your RaidParty Indie Developer account.<br /><br />\n\t\t\t\t<strong><a href=\\\"${activationLink}\\\">${activationLink}</a></strong><br /><br />\n\t\t\t\tKeep calm, keep playing<br />\n\t\t\t\tThe RaidParty success team`;\n\t\t\t\n\t\t\t// Send activation email/SMS to player to activate their account\n\t\t\tawait EmailService.sendEmail({\n fromEmail: '[email protected]',\n fromName: 'Success Team',\n toEmail: developer.email,\n toName: developer.email,\n subject: 'Welcome to RaidParty! Activate your account to start launching your games successfully',\n body: msg\n })\n\t\t\t\n\t\t\treturn res.ok({\n msg: 'Please check your email inbox for an activation link.',\n success: true,\n });\n\n } catch(err) {\n return util.errorResponse(err, res);\n }\n\t}", "title": "" }, { "docid": "016ec25c28ac2997984e4175e3315398", "score": "0.5960756", "text": "async doCreateUser (_params) {\n\t\ttry {\n\t\t\tlet newUser = await firebaseService.registerUser({\n\t\t\t\temail: _params.email,\n\t\t\t\tpassword: _params.password,\n\t\t\t\tfirstName: _params.firstName,\n\t\t\t\tlastName: _params.lastName\n\t\t\t});\n\t\t\treturn newUser;\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t\treturn err;\n\t\t\t// for (let e of err.details) {\n\t\t\t// if (e === \"conflict_email\") {\n\t\t\t// alert(\"Email already exists.\");\n\t\t\t// } else {\n\t\t\t// // handle other errors\n\t\t\t// }\n\t\t\t// }\n\t\t}\n\t}", "title": "" }, { "docid": "5cc06e395eeaf383e9fd3e32c8aa7bb6", "score": "0.59505475", "text": "function registration() {\n const regData = {\n 'name' : document.getElementById('registration-name').value,\n 'email' : document.getElementById('registration-email').value,\n 'password' : document.getElementById('registration-password').value\n };\n if (!validator.isEmail(regData.email)) {\n document.getElementById('registration-error').innerHTML = 'такой email адрес не поддерживается';\n } else if (!validator.isAlphanumeric(regData.password)) {\n document.getElementById('registration-error').innerHTML = 'пароль должен содержать только <br> английские буквы и цифры';\n } else if (!validator.isAlphanumeric(regData.name)) {\n document.getElementById('registration-error').innerHTML = 'имя должно содержать только <br> английские буквы и цифры';\n } else {\n $.post( '/registration', regData)\n .done(res => {\n alert(res);\n });\n };\n}", "title": "" }, { "docid": "6d9ff5e21fd29bac3d8d51b54cdd0e78", "score": "0.59492975", "text": "async function register(username, password) {\n const query_info = await registerUser(username, password);\n if (query_info === false) {\n return \"Duplicate username. Choose a different one.\";\n } else {\n return \"Success!\";\n }\n}", "title": "" }, { "docid": "60ff80bd2754fe2d0fbb2d0b8c670426", "score": "0.5947894", "text": "function registerPersonWithAccount(formData){\n\tconst uri = '/transdev/people/v1/secured/api/person/';\n var url = `${API_ROOT}` + uri\n\treturn _doPost(url, JSON.stringify(formData))\n}", "title": "" }, { "docid": "46a2b0a7ed12bc40a6842c38519fa7f9", "score": "0.59440476", "text": "static register(email, username, password)\n {\n // Optional success callback\n let callback = arguments[3] || null;\n\n $.ajax({\n type: 'POST',\n url: NOZAMA.API + NOZAMA.REGISTER,\n data:\n {\n \"email\": email,\n \"username\": username,\n \"password\": password\n },\n success: function()\n {\n if (callback !== null) { callback(); }\n else\n {\n window.location.href = \"index.html\";\n }\n },\n error: function(xhr)\n {\n cerror(xhr, function()\n {\n document.getElementById(\"regpwo\").style.display = \"none\";\n document.getElementById(\"regpwt\").style.display = \"none\";\n\n document.getElementById(\"regem\").style.display = \"inline\";\n $('#error-message').text(emsg[xhr.status].msg);\n });\n },\n });\n }", "title": "" }, { "docid": "789874b301c07ab3042b98667af750cf", "score": "0.5937841", "text": "function register () {\n email = document.getElementById('reg_email').value\n password = document.getElementById('reg_password').value\n confirm_password = document.getElementById('confirm_password').value\n\n if (email != \"\" && password != \"\" && confirm_password != \"\") {\n if(password == confirm_password) {\n var result = firebase.auth().createUserWithEmailAndPassword(email, password);\n\n result.catch(function(error) {\n var errorCode = error.code;\n var errorMessage = error.message;\n\n console.log(errorCode);\n console.log(errorMessage);\n window.alert(\"Message: \" + errorMessage);\n });\n // window.location.href = \"index.html\"\n }\n else {\n window.alert(\"Password don't match with Confirm Password!\");\n }\n \n } else {\n window.alert(\"Please fill all fields!\");\n }\n \n \n // // Validate email\n // if (ValidateEmail(email) == false) {\n // alert('Incorrect Email')\n // return\n // }\n \n // // Validate password (Firebase auth insists on a password length of 6 characters)\n // if (password.length < 6) {\n // alert('Create a Longer Password')\n // return\n // }\n \n // // Check if other values are empty\n // if (full_name.length <= 0 || phone_number.length <= 0) {\n // alert('Missing Fields')\n // return\n // }\n \n // auth.createUserWithEmailAndPassword(email, password)\n // .then(() => {\n // // Assign user\n // var user = auth.currentUser\n // // Save input data to firebase database\n // var database_ref = database.ref()\n // // Create user data to save to Firebase Realtime Database\n // var user_data = {\n // full_name: full_name,\n // email: email,\n // phone_number: phone_number,\n // user_created: Date.now()\n // }\n // // Save user_data under the unique user.uid\n // database_ref.child('/users' + user.uid).set(user_data)\n // // Wait 1 second. You don't have to but why not.\n // // Then alert the user\n // setTimeout(function () {\n // alert('User Created!')\n // }, 1000)\n // })\n // .catch((error) => {\n // // Handle Errors as they occur.\n // var errorCode = error.code\n // var errorMessage = error.message\n // alert(errorMessage)\n // })\n}", "title": "" }, { "docid": "1965a0598c98177096b081d2302071d5", "score": "0.5935198", "text": "function registerUser () {\n $('.register-form').submit(event => {\n\n event.preventDefault();\n\n const registrationInfo = {\n username: $('#username').val(),\n password:$('#password').val(),\n confirmPassword: $('#confirm-password').val(),\n firstName:$('#first-name').val(),\n lastName: $('#last-name').val(),\n email: $('#email').val(),\n phone: $('#phone').val(),\n companyName:$('#company-name').val(),\n typeOfUser:$('#user-type').val()\n };\n\n if(!(registrationInfo.password == registrationInfo.confirmPassword)) {\n console.log(registrationInfo);\n $('.js-registration-comment-box').html('<span class=\"notification-message\">Passwords do not match, please correct to register!</span>');\n unhideRegistrationCommentBox();\n }\n else {\n $.ajax({\n url : \"/users\",\n dataType: \"json\",\n type: 'POST',\n contentType : \"application/json\",\n data: JSON.stringify(registrationInfo)\n })\n .then(registrationSuccessful)\n .catch(registrationFailed)\n }\n})}", "title": "" }, { "docid": "be22ccc613429d398336a6f187c69cd9", "score": "0.59335077", "text": "function handleUserRegister() {\n\tvar name = $(\"#registerForm #name\").val();\n\tvar email = $(\"#registerForm #email\").val();\n\tvar password = $(\"#registerForm #password\").val();\n\tvar confirmPassword = $(\"#registerForm #confirmPassword\").val();\n\tvar storeId = $(\"#registerForm #storeId\").val();\n\n\t$('.registerNotification').html('');\n\tif (registrationIsValid(name, email, password, confirmPassword)) {\n\t\tvar result = requestAddCostumer(name, email, password, storeId);\n\n\t\tif (result == \"ok\") {\n\t\t\t$('.registerNotification')\n\t\t\t\t\t.html(\n\t\t\t\t\t\t\t'<div class=\"alert alert-success\"> Registration is complete! </div>');\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('#registrationModal').modal('hide');\n\n\t\t\t}, 1500);\n\t\t} else if (result == \"userExists\") {\n\t\t\t$('.registerNotification')\n\t\t\t\t\t.html(\n\t\t\t\t\t\t\t'<div class=\"alert alert-error\"> Email already in use! </div>');\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "4ae04f4cbe8597fb2a281f95221140ec", "score": "0.5929757", "text": "signup(context, payload) {\n return API.post(\"users/\", payload)\n // On email conflicts proceed as usual, as user might be a returning one here.\n // Take note of this state though as we don't want to raise GTM events for it if it's a Basic flow.\n .catch(err => {\n if (err && err.code === 409) {\n return Promise.resolve({ \"returning\": true });\n }\n return Promise.reject(new Error(err.message));\n })\n .then(data => context.dispatch(\"login\", { ...payload, \"returning\": !!data.returning }));\n }", "title": "" }, { "docid": "a7c2ebe02f4d3afd3d9accdd0f47757f", "score": "0.59280986", "text": "async register(req, res, next) {\n const { email = \"\", username = \"\", password = \"\" } = req.body;\n try {\n await validateUser(email, username, password);\n const passhash = await hashPassword(password);\n const userID = await createUser(email, username, passhash);\n const token = generateJWT(email, username, userID);\n res.send({\n user: {\n email,\n username,\n userID,\n },\n token,\n });\n } catch (err) {\n next(err);\n }\n }", "title": "" }, { "docid": "2fd2f308123e5cebe679d452d3000106", "score": "0.5922766", "text": "async registrationInit(email) {\n\t\tconst { UserEmail, ConfirmationCode } = this.db;\n\t\tconst userEmail = await UserEmail.findByEmail(email);\n\n\t\t/**\n\t\t * Email found\n\t\t */\n\t\tif (userEmail instanceof Object) {\n\t\t\tif (Number.isInteger(userEmail.user_id)) {\n\t\t\t\tthrow new Error('The email already used'); // @todo: do not response such error\n\t\t\t}\n\t\t\tconst confirmCode = await ConfirmationCode.findByUserEmailId(\n\t\t\t\tuserEmail.id\n\t\t\t);\n\n\t\t\tlet code;\n\t\t\tif (!(confirmCode instanceof Object)) {\n\t\t\t\t// If record does not exist then create code\n\t\t\t\tcode = await ConfirmationCode.generateCode();\n\t\t\t\tawait ConfirmationCode.create({\n\t\t\t\t\tuser_email_id: userEmail.id,\n\t\t\t\t\tcode\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcode = confirmCode.code;\n\t\t\t}\n\t\t\treturn this.mailer.send(email, { code }); // Resend confirmation code\n\t\t}\n\n\t\t/**\n\t\t * Expected way\n\t\t */\n\t\tconst newUserEmail = UserEmail.build({ email, state: 0 });\n\t\ttry {\n\t\t\tawait newUserEmail.validate();\n\t\t} catch {\n\t\t\tthrow Boom.badRequest('User validation error');\n\t\t}\n\n\t\tawait newUserEmail.save();\n\t\tconst code = await ConfirmationCode.generateCode();\n\t\tawait ConfirmationCode.create({\n\t\t\tuser_email_id: newUserEmail.id,\n\t\t\tcode\n\t\t});\n\n\t\treturn this.mailer.send(email, { code }); // Send confirmation code\n\t}", "title": "" }, { "docid": "6c018bc5390450f145e702417469f739", "score": "0.59173334", "text": "async register(req, res) { \n const emailExist = await User.findOne({email: req.body.email})\n if (emailExist) return res.status(400).send('Email já cadastrado')\n\n //fazendo hash da senha\n const salt = await bcrypt.genSalt(10)\n const hashedPassword = await bcrypt.hash(req.body.senha, salt)\n\n //gerando um token aleatorio de verificacao de email\n const tokenVerificacao = Math.random().toString(36).slice(2)\n\n const user = new User({\n email: req.body.email,\n senha: hashedPassword,\n funcao: req.body.funcao,\n verificado: false,\n tokenVerificacao\n })\n\n try {\n const savedUser = await user.save()\n sendEmail(req.body.email, tokenVerificacao)\n return res.send(savedUser)\n } catch(err) {\n return res.status(400).send(err)\n }\n }", "title": "" }, { "docid": "e7b69f99bacebc3e83ea7296dd6407ed", "score": "0.5913528", "text": "function createNewAccount(request, response){\n\tvar name = request.body.name;\n\tvar username = request.body.username;\n\tvar password = request.body.password;\n\tvar confirmPassword = request.body.confirmPassword;\n\tvar errorObj = {};\n\tgetStudentInfo(name, function(student){\n\t\tif (student.rows.length == 0){\n\t\t\terrorObj.errorMessage = \"User \" + name + \" is not in the database. Please contact a creator of this page, if there is a mistake.\"\n\t\t\terrorObj.nameError = true;\n\t\t\tresponse.render('newAccount.html', errorObj);\n\t\t}\n\t\telse if (password != confirmPassword){\n\t\t\terrorObj.errorMessage = \"The passwords do not match.\";\n\t\t\terrorObj.passwordError = true;\n\t\t\tresponse.render('newAccount.html', errorObj);\n\t\t}\n\t\telse if (name == \"\" || username == \"\" || password == \"\"|| confirmPassword == \"\"){\n\t\t\terrorObj.errorMessage = \"Please fill out all required fields.\";\n\t\t\terrorObj.emptyError = true;\n\t\t\tresponse.render('newAccount.html', errorObj);\n\t\t}\n\t\telse{\n\t\t\tconn.query(\"UPDATE student_info SET username = ?, password = ? WHERE name = ?\", [username, password, name], function(err, data){ if (err) throw err; });\n\t\t\tresponse.redirect('/');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "02f90a285f9128d027b33b84b60102df", "score": "0.591076", "text": "async register(_, {registerInput: { username, email, password, confirmPassword } }) {\n // validate user data\n const {valid, errors} = validateRegisterInput(username, email, password, confirmPassword);\n if(!valid) {\n throw new UserInputError;\n }\n // make sure user is unique\n const user = await User.findOne({username});\n if(user){\n throw new UserInputError('Username is taken', {errors: { username: 'This username is taken'}});\n }\n // hash password and auth token create use npm bcryptjs and jsonwebtoken\n password = await bcrypt.hash(password, 12);\n const newUser = new User({email, username, password, createdAt: new Date().toISOString()});\n const result = await newUser.save();\n const token = generateToken(result);\n\n return {\n ...result._doc,\n id: result._id,\n token\n }\n }", "title": "" }, { "docid": "dc87ba3167e8180a4b8c65ebc4202a41", "score": "0.59105766", "text": "function register(username, email, password) {\n return API.post('/auth/signup', {\n username,\n email,\n password,\n })\n}", "title": "" }, { "docid": "5326e354d73b896360ef1da646c5eebe", "score": "0.5908322", "text": "function register(req,res){\n var username = req.body.username\n var password = req.body.password\n var email = req.body.email\n var zipcode = req.body.zipcode\n var defaultpic = 'http://thumb1.shutterstock.com/display_pic_with_logo/1938752/221171704/stock-vector-cartoon-illustration-of-a-worried-little-pig-221171704.jpg'\n var defaultstatus = 'working on web development'\n\n if (!username || !password){\n res.sendStatus(400)\n return\n }\n // a query that check if the user is already in the profile database\n Profile.find({username:username}).exec(function(err, items) {\n if (items.length>0){\n res.status(400).send('user already exist')\n return\n }\n else {\n Profile.find({email:email}).exec(function(err,items){\n if (items.length>0){\n res.status(400).send('this email address was used')\n }\n else{\n // generate a salt for the user password, store the hash in user database\n var salt = Math.random.toString()\n var hash = md5(password+salt)\n new User({username: username, hash: hash,salt: salt}).save()\n new Profile({username:username,status:defaultstatus,following:[],email:email,zipcode:zipcode,picture:defaultpic}).save()\n res.send({username:username,email:email,status:defaultstatus})\n }\n })\n }\n })\n}", "title": "" }, { "docid": "7c37f0851d9fd1190191d87ee8640053", "score": "0.58790296", "text": "function signup() {\n inquirer\n .prompt(makePromptQuestions())\n .then(credentials => {\n cache.update('loginWith', credentials.email)\n return credentials\n })\n .then(auth0SignUp)\n .then(({ idToken }) => {\n return supermodelAuthenticate(idToken)\n .then(({ user, auth_token: authToken}) => {\n cache.update('user', user)\n cache.update('authToken', authToken)\n })\n })\n .then(() => console.log(\"--> Signup successful! You are logged in automatically.\"))\n .catch(error => {\n console.error(`Login failed:`)\n const message = error.description || error.message || error\n console.error(message)\n\n if(process.env['NODE_ENV'] !== 'production') {\n console.error(error)\n }\n\n process.exit(1)\n })\n}", "title": "" }, { "docid": "0d74b22b0279e3997029e0b9c2c6e889", "score": "0.5864628", "text": "function register(req, res) {\n errors = utils.check_body(req, [\n \"username\", \"password\", \"questionOne\", \"questionTwo\",\n \"answerOne\", \"answerTwo\", \"icon\"\n ]);\n if(errors.length > 0){\n res.statusCode = 400;\n var response = {\"errors\": errors};\n return res.send(response);\n }\n\n var username = req.body.username;\n var password = req.body.password;\n var questionOne = req.body.questionOne;\n var questionTwo = req.body.questionTwo;\n var answerOne = req.body.answerOne;\n var answerTwo = req.body.answerTwo;\n var userIcon = req.body.icon;\n\n//check if all user specified values are valid\n if(username.length < 2){\n res.statusCode == 400;\n var response = {\"result\":\"username too short: minimum of 2 characters\"};\n return res.send(response);\n }\n\n if(password.length < 4){\n res.statusCode == 400;\n var response = {\"result\":\"password too short: minimum of 4 characters\"};\n return res.send(response);\n }\n\n if(answerOne.length < 4){\n res.statusCode == 400;\n var response = {\"result\":\"answer one too short: minimum of 4 characters\"};\n return res.send(response);\n }\n\n //everything is OK, so lets try and create new user\n db.User.findOne({where: {username: req.body.username}}).then(function(user) {\n if(!user) {\n //make sure that user doesn't exist, so we can create another user\n db.User.create({\n username: username,\n password: hashPassword(password),\n icon: userIcon\n }).then(function(user){\n //now we want to create questions\n db.SecurityQuestions.create({\n username: username,\n questionOne: questionOne,\n questionTwo: questionTwo,\n answerOne: hashPassword(answerOne),\n answerTwo: hashPassword(answerTwo),\n UserId: user.id\n }).then(function(){\n res.statusCode = 201; //Created\n var response = {\"result\": \"registration success\"};\n return res.send(response);\n })\n });\n }\n else {\n res.statusCode = 422;\n var response = {\"result\":\"registration failed\"};\n return res.send(response);\n }\n });\n \n}", "title": "" }, { "docid": "878f38b080ea905b1d567e5f03eff581", "score": "0.58530027", "text": "function registerAccount(name, email, password) {\n\n if(angular.isObject(user)){\n return $q(function (resolve, reject) {\n reject('User is already logged in');\n });\n }\n else {\n return $http.post('/register', {\n name: name,\n email: email,\n password: password\n })\n }\n }", "title": "" }, { "docid": "dd48bdf724f37ba9ea35c4f3bbff02ba", "score": "0.58407617", "text": "function registrar(){\r\n \tvar email = document.getElementById('email').value;\r\n \tvar contrasena = document.getElementById('contrasena').value;\r\n\r\n \tfirebase.auth().createUserWithEmailAndPassword(email, contrasena)\r\n \t.then(function(){\r\n \t\tverificar()\r\n \t})\r\n \t.catch(function(error) {\r\n // Handle Errors here.\r\n var errorCode = error.code;\r\n var errorMessage = error.message;\r\n // ...\r\n });\r\n }", "title": "" }, { "docid": "10f93da5a953d0b299145350cf31e992", "score": "0.5825928", "text": "function doCreateAcctBtnClicked() {\n\tif ($.acct_password.value !== $.acct_password_confirmation.value) {\n\t\talert(\"Please re-enter information\");\n\t\treturn;\n\t}\n\n\tvar params = {\n\t\tfirst_name : $.acct_fname.value,\n\t\tlast_name : $.acct_lname.value,\n\t\tusername : $.acct_email.value,\n\t\temail : $.acct_email.value,\n\t\tpassword : $.acct_password.value,\n\t\tpassword_confirmation : $.acct_password_confirmation.value,\n\t};\n\n\t//we create an account model\n\tvar user = Alloy.createModel('User');\n\n\t//pass the params and also call the utility method\n\tuser.createAccount(params, userActionResponseHandler);\n}", "title": "" }, { "docid": "9c9343a934844ae35ae21c0d95dc68e2", "score": "0.58195597", "text": "async function register(req, res) {\n // Validate request\n if (!req.body) {\n return res.status(400).send({\n message: \"user can not be empty\"\n });\n }\n\n // validate\n if (await User.findOne({ email: req.body.email })) {\n return res.status(400).send({\n message: 'email ' + req.body.email + ' is already register'\n });\n }\n\n // hash password\n if (req.body.password) {\n req.body.password = bcrypt.hashSync(req.body.password, 10);\n }\n // Create a user\n const user = new User({\n _id: new mongoose.Types.ObjectId(),\n email: req.body.email,\n password: req.body.password,\n firstName: req.body.firstName,\n lastName: req.body.lastname || \"Untitled\",\n nickname: firstName,\n online: false\n });\n\n // Save user in the database\n await user.save()\n .then(data => {\n res.send(data);\n }).catch(err => {\n res.status(500).send({\n message: err.message || \"Some error occurred while saving new user.\"\n });\n });\n}", "title": "" }, { "docid": "785c76d13ace541be2c61d5994d252dd", "score": "0.5808776", "text": "function registerUser (email, password) {\n return new Promise((resolve, reject) => {\n connect().then(() => {\n // create new user\n const newUser = new Users({\n email: email,\n password: passwordHash.generate(password)\n })\n // save the newUser in the database\n newUser.save().then(result => {\n console.log(result);\n resolve()\n }).catch(error => {\n console.log(error.code);\n if (error.code === 11000) {\n reject ('exist')\n } else {\n reject(error)\n }\n })\n }).catch(error => {\n reject(error)\n })\n })\n }", "title": "" }, { "docid": "2339166ee68388c4ce1e45ba95b61f95", "score": "0.5804882", "text": "async register(\n _, \n { registerInput: { username, email, password, confirmPassword } }\n ){\n // Validate user data\n const { valid, errors } = validateRegisterInput(\n username,\n email,\n password,\n confirmPassword\n );\n if(!valid){\n // name: errors, payload: errors with its value in it\n throw new UserInputError('Errors', { errors });\n }\n // TODO: Validation: Make sure user doesn't already exist\n const user = await User.findOne({ username });\n // if there is a user, this will not be null, and vice versa\n if(user){\n // add a payload: errors object\n // it will be used later on the frontend to display the error on the form\n throw new UserInputError('Username is taken', {\n errors:{\n username: 'This username is taken'\n }\n })\n }\n\n // TODO: hash password and create an auth token\n password = await bcrypt.hash(password, 12);\n\n // form user object\n const newUser = new User({\n email,\n username,\n password,\n // convert the date to a string\n createdAt: new Date().toISOString()\n });\n\n // save user info to the database\n const res = await newUser.save();\n\n const token = generateToken(res);\n\n return{\n // where the doc is stored\n ...res._doc,\n id: res._id,\n token\n };\n }", "title": "" }, { "docid": "52106b139229820c3e2909b8c91adfa2", "score": "0.5799746", "text": "async function register(req, res) {\n const { username, email, password } = req.body;\n const params = [username, email, password];\n\n if (checkMissingParameter(params)) {\n return handleMissingParameter(res);\n }\n\n try {\n await query(registerUser, params);\n } catch (err) {\n return buildErrorObject(res, {\n status: 400,\n error: \"Username already registered.\",\n });\n }\n\n const users = await query(queryUserByUsername, [username]);\n return buildSuccessResponse(res, {\n data: buildUsersObject(users[0]),\n });\n}", "title": "" }, { "docid": "eb80bffcd344bb1924ef3c15e46558af", "score": "0.57876426", "text": "function signUp() {\n var email = document.getElementById(\"email\");\n var password = document.getElementById(\"password\")\n const promise = auth.createUserWithEmailAndPassword(email.value, password.value);\n promise.catch(e => alert(e.message));\n alert(\"Registered Successfully!!Now you may login\");\n\n}", "title": "" }, { "docid": "2cad7fecba6c958be2b16726bdd84c64", "score": "0.5783512", "text": "registerUser(registrationDetails) {\n return apiClient.post(this.registrationEndpoint, registrationDetails);\n }", "title": "" }, { "docid": "5275057a21c9e65fc76ad23a8d783932", "score": "0.57769096", "text": "function FirebaseRegister(){\n // creates variables for all textboxes\n var email = $(\"#email-register\").val();\n var confirm_email = $(\"#cemail-register\").val();\n var password = $(\"#password-register\").val();\n var confirm_password = $(\"#cpassword_register\").val();\n //checks if email does not equal to confirm email text box, and if password textbox does not equal to confirm password textbox\n if(email != confirm_email && password != confirm_password) {\n sweetAlert(\"Oops...\", \"your email/password do not match\", \"error\");\n //if the above argument is false, it will run this code\n }else{\n //uses email and password variables to create a user in firebase\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // if there is an error during registration, it will launch this error message\n if (error) {\n sweetAlert(\"Oops...\", errorMessage, \"error\");\n console.log(errorMessage);\n }\n })\n }\n}", "title": "" }, { "docid": "7d5418cc36215ccb9daed74c7bca23d1", "score": "0.57592344", "text": "function newAccount(inputBody, done) {\n var inputUsername = inputBody.username;\n var inputPassword = inputBody.password;\n var account = new User({\n username: inputUsername\n });\n User.register(account, inputPassword, function (err, user) {\n if (err) {\n done(err);\n } else {\n done(null, user);\n }\n });\n}", "title": "" }, { "docid": "03672fd30e5c4aad2be800e6fffd5a6d", "score": "0.57571656", "text": "function registerHandler(element) {\n // Form values\n var username = document.getElementById(\"register-username\").value;\n var email = document.getElementById(\"register-email\").value;\n var firstname = document.getElementById(\"register-firstname\").value;\n var lastname = document.getElementById(\"register-lastname\").value;\n var phone = document.getElementById(\"register-phone\").value;\n var birthdate = document.getElementById(\"register-birthdate\").value;\n var password = document.getElementById(\"register-password\").value;\n var confirmPassword = document.getElementById(\"confirm-password\").value;\n\n // Fetches the accounts table\n var accountsFromLocalStorage = JSON.parse(storage.getItem(\"accounts\"));\n\n // Boolean variable to decide whether to be able to create an account or not\n var createAccount = true;\n\n // Form validation\n for (const account of accountsFromLocalStorage) {\n var u = account.username;\n var uLower = u.toLowerCase();\n // Checks if the user input fo username field is unique\n if (u == username || uLower == username) {\n alert(\"Username already taken.\");\n createAccount = false;\n break;\n }\n // Checks if the user input fo email field is unique\n if (account.email == email) {\n alert(\"Email already taken.\");\n createAccount = false;\n break;\n }\n // Checks if the username field is blank\n if (!isUserNameValid(username)) {\n if (username == \"\") {\n alert(\"Username can not be blank.\");\n createAccount = false;\n break;\n } else {\n alert(\"Only characters A-Z, a-z and '-' are acceptable for username.\");\n createAccount = false;\n break;\n }\n }\n // Checks if the user input for the phone number field has wrong format\n if (phone.length != 13) {\n alert(\"Phone Number has wrong format.\");\n createAccount = false;\n break;\n }\n //Checks if the user is 18 or above\n if (calculate_age(birthdate) < 18) {\n alert(\"You need to be 18 or above.\");\n createAccount = false;\n break;\n }\n //Checks if password and confirm password field is not blank\n if (password == \"\" && confirmPassword == \"\") {\n alert(\"Missing passwords\");\n createAccount = false;\n break;\n }\n }\n\n // Checks if all criteria is met\n if (createAccount) {\n // Checks if password and confirm password is the same and that it is not blank\n if (password == confirmPassword && password != \"\") {\n // Checks if username is valid and password is strong\n if (isUserNameValid(username) && StrengthChecker(password)) {\n // Preparation of data to be added to database\n var accountDetails = {\n id: accountsFromLocalStorage.length + 1,\n username: username,\n password: password,\n first_name: firstname,\n last_name: lastname,\n email: email,\n birthdate: birthdate,\n telephone: phone,\n is_admin: false,\n date_joined: new Date(),\n };\n\n // Pushes the data to the accounts table\n accountsFromLocalStorage.push(accountDetails);\n\n // Updates the account table in local storage\n storage.setItem(\"accounts\", JSON.stringify(accountsFromLocalStorage));\n alert(\"Account created!\");\n\n // Redirects user to login page\n location.href = \"login.html\";\n // Displays valid username input for username field\n } else if (!isUserNameValid(username)) {\n alert(\"Only characters A-Z, a-z and '-' are acceptable for username.\");\n // Reminds the user to construct a stronger password\n } else {\n alert(\"Weak password. Please construct a stronger password.\");\n }\n // Checks if the password and confirm passwod is not blank and if passwords does not match\n } else if (password != confirmPassword && password != \"\") {\n alert(\"Passwords do not match!\");\n } else {\n // Alerts user if passwords are blank\n alert(\"Missing passwords\");\n }\n }\n}", "title": "" }, { "docid": "c0ceeb1aa2f868fdc512aafed95df717", "score": "0.57438695", "text": "function requestRegister(creds) {\n return {\n type: REGISTER_REQUEST,\n isFetching: true,\n isAuthenticated: false,\n creds\n };\n}", "title": "" }, { "docid": "d69e897ab198e9764a8c222bb59502cf", "score": "0.5743327", "text": "function signupPOST (req, res, next) {\n\n\t//////////////////////////////////////\n\t/*ALGORITHM: \t\t\t\t\t\t*/\n\t// if (input correct)\n\t\t// if (ratr)\n\t\t\t// if (ratr.facebook)\n\t\t\t\t// merge accounts\n\t\t\t\t// update password\n\t\t\t// else\n\t\t\t\t// err: email oredy in use\n\t\t// else\n\t\t\t// create new ratr\n\t\t\t// save new ratr\n\t// else\n\t\t// err: incorrect input\n\t//////////////////////////////////////\n\n\t// get form data\n\tvar email = req.body.email;\n\tvar password = req.body.password;\n\tvar confirmPassword = req.body.confirmPassword;\n\n\tListRatr.findOne({email : email}, function (err, ratr) {\n\t\tif (err) {\n\t\t\tres.send(err);\n\t\t} else {\n\t\t\tif (ratr) {\n\t\t\t\tres.send('bad: email not available');\n\t\t\t} else {\n\t\t\t\tconsole.log('good: email available');\n\n\t\t\t\t// create new listratr\n\t\t\t\tvar listratr = new ListRatr ({\n\t\t\t\t\temail : email,\n\t\t\t\t\tpassword : password,\n\t\t\t\t});\n\t\t\t\tlistratr.save();\n\n\t\t\t\tres.send(listratr);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "aae36ec1a3d5470629c3c2d5d9292ef0", "score": "0.57410276", "text": "createAccount(account) {\n return new Promise((resolve, reject) => {\n axios\n .post(`${this.url}/createAccount`,\n {\n firstName: account.firstName,\n lastName: account.lastName,\n username: account.username,\n password: account.password,\n },\n this.config\n )\n .then(res => resolve(res.data))\n .catch(res => resolve({ error: \"Username Already Taken\"}));\n });\n }", "title": "" }, { "docid": "a89ca60dcd003d5b04bf675aedb3abbc", "score": "0.5739573", "text": "function registration(req, res, next) {\n var userBody = req.body;\n var newUser = new User(userBody);\n console.log('Add user: ' + JSON.stringify(newUser));\n newUser.save(function(err){\n if (err) {\n console.log(\"Error saved\");\n res.send({\"Status\":\"Error\"});\n } else {\n console.log(\"Saved\");\n //auto login after registration\n req.login(newUser, function(err) {\n if (err) {\n return req.send({\"Status\":\"Error\"});\n }\n // return token after login\n return res.send({\"token\":newUser.get('accessToken')});\n });\n }\n });\n }", "title": "" }, { "docid": "23b9797a32dbb083f798120056d1ae9a", "score": "0.57393163", "text": "function register(email, password, name){\n return new Promise( async (resolve, reject) => {\n let hash = await bcrypt.hash(password, SALT_ROUNDS );\n const insertQuery = 'INSERT INTO users SET ?';\n let user = {\n password: hash,\n email, \n name,\n }\n CONN.query(insertQuery, [user], (err, result) => {\n console.log(result);\n if(err){\n resolve(false)\n }else{\n resolve(true);\n }\n })\n })\n}", "title": "" }, { "docid": "3e01d9f66205ff65bfe2676f8d00f642", "score": "0.57380795", "text": "async function register (req, res) {\n if (!req.body.username || !req.body.password) { \n return res.status(400).json({ message:\"Please include a name and password to create a new user\" \n })}\n let user = req.body;\n const hash = bcrypt.hashSync(user.password, 10); \n user.password = hash;\n\n try {\n const [id] = await db('users').insert(user);\n user = await db('users')\n .where({ id })\n .first();\n res.status(201).json({ \n message:`Thank you for registering ${user.username}`, \n username:user.username,\n id:user.id\n }); \n } catch (error) {\n const message = errors[error.errno] || \"We ran into an error, yo\";\n res.status(500).json({ message:message, error:error });\n }\n}", "title": "" }, { "docid": "27bae80ca1b16557a9b7a72ffe78be28", "score": "0.57354826", "text": "function registerUser() {\n\t\tCloud.Users.create({\n\t\t username: username,\n\t\t password: password,\n\t\t password_confirmation: password,\n\t\t first_name: \"Firstname\",\n\t\t last_name: \"Lastname\"\n\t\t}, function (e) {\n\t\t if (e.success) {\n\t\t \tTi.API.info('registerUser OK');\n\t\t } else {\n\t\t \tTi.API.info('error registering user');\n\t\t }\n\t\t login();\n\t\t});\n\t}", "title": "" }, { "docid": "545a7e6d7542f807ce76a0955d5b4f03", "score": "0.5734321", "text": "function register(username, password, password_verify) {\n if (typeof username === 'undefined' ||\n typeof password === 'undefined' ||\n password !== password_verify) {\n ctlr.error = \"Username & Password cannot be empty and passwords must match\";\n return;\n }\n // check for username existing then only create new user\n userService\n .findUserByUsername(username)\n .then(function (user) {\n if (typeof user.username === 'undefined') {\n var newuser = {\n username: username,\n password: password,\n appSource: 'project',\n role: 'User'\n };\n userService\n .register(newuser)\n .then(function (u) {\n $location.url('/profile');\n });\n } else {\n ctlr.error = \" Username is not unique, please choose another\";\n }\n });\n }", "title": "" }, { "docid": "e21fec0e485f752fe46c6f0654f9157e", "score": "0.57254046", "text": "function register(req, res){\n if(checkRegisterHasura(req)&&checkRegisterShelf(req)){\n /**\n * Register with HASURA and then SHELF\n */\n var query = {\n \"username\": req.body.username,\n \"password\": req.body.password,\n \"email\": req.body.email,\n \"mobile\": req.body.mobile\n }\n var options = {\n method: \"POST\",\n uri: domain+'/signup',\n json: true,\n body: query\n }\n request(options, function(error, response, body){\n if(error){\n console.log(error);\n res.status(config.HTTP_CODES.SERVER_ERROR).send(\"Error\");\n }else{\n //add other columns in database\n req.body.id = body.hasura_id;\n console.log(body);\n data.createUser(req, req.body, function(result){\n if(result){\n res.status(config.HTTP_CODES.OK).send(\"Confirm your email to login!\");\n }else{\n res.status(config.HTTP_CODES.SERVER_ERROR).send(\"Error\");\n }\n });\n }\n });\n }else{\n res.status(config.HTTP_CODES.FORBIDDEN).send({\n code: 02,\n message: \"Parameter error. Read docs for more.\"});\n }\n}", "title": "" }, { "docid": "72e269a7c49d8f6e11444fe556fa4102", "score": "0.5723855", "text": "function onSuccess() {\n dispatch(authSignUpSuccess());\n }", "title": "" }, { "docid": "c77fdc006da2519a2fa83e27f8810ebc", "score": "0.572349", "text": "function register()\n{\n //variable to check if an error is thrown.\n var alerts = 0;\n \n //grabs username from form and checks it for presence and length\n var username = document.getElementById(\"username\").value;\n \n if (username == \"\")\n {\n alert(\"You must fill in a username.\");\n alerts++;\n }\n else if (username.length < 8)\n {\n alert(\"Username must be at least 8 characters long.\");\n alerts++;\n }\n \n //grabs password from form and checks it for presence and length\n var password = document.getElementById(\"password\").value;\n \n if (password == \"\")\n {\n alert(\"You must fill in a password.\");\n alerts++;\n }\n else if (password.length < 8)\n {\n alert(\"Password must be at least 8 characters long.\");\n alerts++;\n }\n \n //grabs verification password from form and checks it for presence and that it matches password\n var passverify = document.getElementById(\"passverify\").value;\n \n if (passverify== \"\")\n {\n alert(\"You must verify password.\");\n alerts++;\n }\n else if (passverify != password)\n {\n alert(\"Password and verification do not match.\");\n alerts++;\n }\n \n //if all fields are filedl in correctly, information is sent to register.php. This checks that if the user already exists and adds user and password to database if it does not. User is alerted of result. User is logged in on success.\n if (alerts == 0)\n {\n var parameters = {\n username: username,\n password: password \n };\n \n $.getJSON(\"register.php\", parameters)\n .done(function(data, textStatus, jqXHR){\n alert(data[\"message\"]);\n \n if(data[\"message\"] == \"Account successfully created\")\n {\n login(username, password);\n }\n })\n .fail(function(jqXHR, textStatus, errorThrown){\n console.log(errorThrown);\n });\n }\n \n //this function was activated by submit button with obsubmit=\"return\", which requires returning of false to prevent page from reloading.\n return false;\n}", "title": "" }, { "docid": "c247c4af06dbc382ea755c5da2e825ab", "score": "0.571992", "text": "SignUp() {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n //ADD THE USER TO THE DATABASE\r\n const UserController = new userController(this.request, this.response, this.next)\r\n const result = await UserController.CreateUser()\r\n \r\n //AUTHENTICATE NEW CREATED USER\r\n const AuthenticatedUser = await Authenticate({email: result.email, password: this.request.body.password})\r\n Responser.send(this.response, 200, \"Success\", AuthenticatedUser)\r\n }catch(err) { reject({ type: \"BadRequest\", message: err.message }) }\r\n \r\n }) \r\n }", "title": "" }, { "docid": "64e9c2a1fd96a663bdc0482ee33cd12e", "score": "0.5719295", "text": "function register(req, res, next) {\n\n // Check Validation\n req.checkBody('username', 'User name is required').notEmpty();\n req.checkBody('email', 'Email is required').notEmpty();\n req.checkBody('email', 'Email is not valid').isEmail();\n req.checkBody('password', 'Password min length : 5 characters').notEmpty().isLength({\n min: 5\n });\n req.checkBody('password2', 'Verify password is required').notEmpty();\n req.checkBody('password2', 'Passwords do not match').equals(req.body.password);\n\n // Validate the register form\n validateForm({\n req: req,\n res: res,\n action: \"register\",\n title: \"Registration Form\",\n view: \"account/register\"\n });\n\n}", "title": "" }, { "docid": "6ed8da119e5c552b99654406017976fb", "score": "0.57173586", "text": "function createAccount()\n{\n\t$.ajax({\n\t\ttype: 'POST',\t\n\t\turl: 'ajax/createAccount.php',\n\t\tdata: {\n\t\t\temail: $(\"#newEmail\").val(),\n\t\t\tdisplayName: $(\"#newDisplayName\").val(),\n\t\t\tpassword: $(\"#newPassword\").val(),\n\t\t},\n\t\tsuccess: function(data) {\n\n\t\t\tif(data.substring(0,5) == \"Error\")\n\t\t\t{\n\t\t\t\tmyAlert(data);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$(\"#accountEditor\").dialog(\"close\");\n\t\t\tgetAllAccounts();\n\t\t},\n\t\terror: function() {\n\t\t\tmyAlert(\"There was an error creating the account. Please refresh the page and try again\");\n\t\t},\n\t});\n}", "title": "" }, { "docid": "4c53e5b070b8ac525805797126a11c3a", "score": "0.57157755", "text": "function registration (){\n credentials.id = prompt(\"Create a User Id.\")\n while (credentials.id.length < 9 || credentials.id.includes(\"$\")) {\n credentials.id = prompt(\"This User Name is less than 9 characters or contains an unapproved symbol ($).\")\n }\n //this while loop will screen the credentials.id for characters\n credentials.pass = prompt(\"Create a password.\")\n while (credentials.pass.length < 9) {\n credentials.pass = prompt(\"This password contains less than 9 characters.\")\n }\n}", "title": "" }, { "docid": "92fc1a038be3ae80c51e9e6a44754819", "score": "0.5713897", "text": "function signUpUser(\n email,\n password,\n first,\n last,\n address,\n address2,\n city,\n state,\n zip,\n phone,\n secQuestion,\n secAnswer\n ) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n first: first,\n last: last,\n address: address,\n address2: address2,\n city: city,\n state: state,\n zip: zip,\n phone: phone,\n secQuestion: secQuestion,\n secAnswer: secAnswer\n })\n .then(function(data) {\n $(\"#loading\").hide();\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "title": "" }, { "docid": "9efd4d7fe67076560ce8f5dabbbe1b5a", "score": "0.5708219", "text": "function register(email, password){\n console.log(\"Registered a new User\");\n // console.log(email,password);\n var reg = new Firebase (\"https://shiftsapp.firebaseio.com\");\n reg.createUser ({\n email: email,\n password: password\n \n }, function(error, userData) {\n if (error) {\n if(error.code)\n alert (\"some kind error\");\n } else {\n alert (\"you registered\"+ userData.uid); \n }\n })\n \n \n }", "title": "" }, { "docid": "a2b88509fe196f3c50b835ee3db2c7c5", "score": "0.5693826", "text": "function createAccountConfirm() {\n var un = $('#create_acc_un').val();//document.getElementById('create_acc_un').value;\n var pw0 = $('#create_acc_pw0').val();//document.getElementById('create_acc_pw0').value;\n var pw1 = $('#create_acc_pw1').val();//document.getElementById('create_acc_pw1').value;\n var fn = $('#create_acc_f_name').val();//document.getElementById('create_acc_f_name').value;\n var ln = $('#create_acc_l_name').val();//document.getElementById('create_acc_l_name').value;\n var em = $('#create_acc_email').val();//document.getElementById('create_acc_email').value;\n \n if(un==null || un=='') {\n $(\"#id_error_create_acc_0\").html('Please enter your username.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter your username.';\n return;\n }\n var pattern = new RegExp(\"^[a-zA-Z0-9_]{3,30}$\");\n if(!pattern.test(un)) {\n $(\"#id_error_create_acc_0\").html('Username can only contains letters, digits and underscores. And it should be 3 to 30 characters long.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Username can only contains letters, digits and underscores. And it should be 3 to 30 characters long.';\n return;\n }\n\n if((pw0==null || pw0=='')&&(pw1==null||pw1=='')) {\n $(\"#id_error_create_acc_0\").html('Password must be at least 6 characters long.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Password must be at least 6 characters long.';\n return;\n }\n if((pw0==null || pw0=='')||(pw1==null||pw1=='')) {\n $(\"#id_error_create_acc_0\").html('Please enter the password twice to confirm it.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter the password twice to confirm it.';\n return;\n }\n if(pw0!=pw1) {\n $(\"#id_error_create_acc_0\").html('Please check that your passwords match and try again.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please check that your passwords match and try again.';\n return;\n }\n if(pw0.length<6) {\n $(\"#id_error_create_acc_0\").html('Password must be at least 6 characters long.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Password must be at least 6 characters long.';\n return;\n }\n\n if(fn==null || fn=='') {\n $(\"#id_error_create_acc_0\").html('Please enter your first name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter your first name.';\n return;\n }\n var pattern = new RegExp(\"^[a-zA-Z]{1,30}$\");\n if(!pattern.test(fn)) {\n $(\"#id_error_create_acc_0\").html('Only letters are allowed in first name and last name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Only letters are allowed in first name and last name.';//single quotes \n return;\n }\n if(ln==null || ln=='') {\n $(\"#id_error_create_acc_0\").html('Please enter your last name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter your last name.';\n return;\n }\n var pattern = new RegExp(\"^[a-zA-Z]{1,30}$\");\n if(!pattern.test(ln)) {\n $(\"#id_error_create_acc_0\").html('Only letters are allowed in first name and last name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Only letters are allowed in first name and last name.';//single quotes \n return;\n }\n if(em==null || em=='') {\n $(\"#id_error_create_acc_0\").html('Please enter your email address.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter your email address.';\n return;\n } \n \n $.ajax({\n type:'post',// \n url:'http://cs-server.usc.edu:6452/x7/index.php/customer/create_acc_confirm',// \n data:'pw0='+pw0+'&'+'pw1='+pw1+'&'+'un='+un+'&'+'fn='+fn+'&'+'ln='+ln+'&'+'em='+em,// \n dataType:'text',// XML ,Json jsonp script html text \n success:function(txt){\n // 0:Password must be at least 6 characters long. 1:Please enter a password and confirm it. 2:Please check that your passwords match and try again. 3:Password has been changed! 4:Error: password has not been changed.\n //alert(txt);\n if(txt=='0' || txt==0) {\n $(\"#id_error_create_acc_0\").html('Password must be at least 6 characters long.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Password must be at least 6 characters long.';\n }\n if(txt=='1' || txt==1) {\n $(\"#id_error_create_acc_0\").html('Please enter the password twice to confirm it.');\n //document.getElementById('id_error_create_acc_0').innerHTML = 'Please enter the password twice to confirm it.';\n }\n if(txt=='2' || txt==2) {\n $(\"#id_error_create_acc_0\").html('Please check that your passwords match and try again.');\n //document.getElementById('').innerHTML = ;\n }\n if(txt=='3' || txt==3) {\n $(\"#id_error_create_acc_0\").html('Please enter your username.');\n // document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='4' || txt==4) {\n $(\"#id_error_create_acc_0\").html('Username can only contains letters, digits and underscores. And it should be 3 to 30 characters long.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='5' || txt==5) {\n $(\"#id_error_create_acc_0\").html('The username already exists.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='6' || txt==6) {\n $(\"#id_error_create_acc_0\").html('Please enter your first name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='7' || txt==7) {\n $(\"#id_error_create_acc_0\").html('Only letters are allowed in first name and last name.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;//single quotes \n }\n if(txt=='8' || txt==8) {\n $(\"#id_error_create_acc_0\").html('Please enter your last name.');\n // document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='9' || txt==9) {\n $(\"#id_error_create_acc_0\").html('Please enter your email address.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='10' || txt==10) {\n $(\"#id_error_create_acc_0\").html('Invalid email address.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='12' || txt==12) {\n $(\"#id_error_create_acc_0\").html('Error: account can not be created.');\n //document.getElementById('id_error_create_acc_0').innerHTML = ;\n }\n if(txt=='11' || txt==11) {\n create_acc_succeed();\n }\n if(txt=='13' || txt==13) {//cart\n cart();\n dispLoginNavBar();\n } \n if(txt=='14' || txt==14) {//home\n startPage();\n }\n },\n error:function(){\n alert('Error');\n }\n })\n}", "title": "" }, { "docid": "d2103175c3ccc2a71f8236714cded618", "score": "0.5689751", "text": "signUp() {\n this.currentUser.signUp(\n this.inputusername,\n this.inputemailaddress,\n this.inputpassword,\n this.inputFullName,\n this.signUpType,\n this.captchaResponse\n );\n }", "title": "" } ]
66c19054b6dcf81fc128192970de4786
clears the UI and show the player the number of questions answered correctly and their score
[ { "docid": "0b779df0a2ec9265fbc987dc7f874869", "score": "0.0", "text": "function endGameAndShowScore() {\n clearUI()\n initialsFormEl.addEventListener('submit', handleFormSubmit)\n score = (timeRemaing + 1) * answeredCorrectly - answeredWrong\n questionHeaderEl.textContent = `Game Over - Score ${score}`\n initialsFormEl.style.display = 'block'\n\n let scoreLi = document.createElement('li')\n scoreLi.setAttribute(\"class\", \"list-no-decoration\")\n scoreLi.textContent = `You got ${answeredCorrectly} right and ${answeredWrong} wrong.`\n answersListEl.appendChild(scoreLi)\n}", "title": "" } ]
[ { "docid": "a331607aabdfad5caaa3c8105dfdbaf0", "score": "0.75490403", "text": "function scoreScreen() {\r\n\t\t$(\".content\").empty();\r\n\t\t$(\"#intro\").html(\":Click to retry:\");\r\n\t\t$(\"#question\").html(\r\n\t\t\t\"<div id=correct> Answered Correctly: \"+correct+\r\n\t\t\t\"</div> <div id=wrong> Answered Incorrectly:\" +wrong+\r\n\t\t\t\"</div><div id=timesUp> Ran out of time: \"+timesUp+\r\n\t\t\t\"</div>\");\r\n\t}", "title": "" }, { "docid": "3d815116c0a9a4e32af867deef44ba06", "score": "0.75110066", "text": "function showScore() {\n\n var answered = correct + wrong;\n var correctPcnt = Math.round((correct / total) * 100);\n var wrongPcnt = Math.round((wrong / total) * 100);\n\n $('.question').empty();\n $('.question').append(\"<h3><p>\" + \"Time remaining is \" + countdownTimer.time + \" seconds !\");\n $('.question').append(\"<h2><p>\" + correct + \" Correct ( \" + correctPcnt + \"% )</p></h2>\");\n $('.question').append(\"<h2><p>\" + wrong + \" Incorrect ( \" + wrongPcnt + \"% )</p></h2>\");\n $('.question').append(\"<h2><p>\" + answered + \" Answered of \" + total + \" Questions</p></h2>\");\n countdownTimer.stop();\n $('.question').append(\"<h3><p>\" + \"Refresh your browser to try again !\");\n $('.timer').empty();\n }", "title": "" }, { "docid": "d8c58e9eed2b8b1a54008c0cf814f8d3", "score": "0.7503804", "text": "function gameReset() {\r\n currentQuestion = 0;\r\n score = 0;\r\n $(\"#welcome-overlay\").show();\r\n $(\"#quiz\").show();\r\n $(\".placement\").empty();\r\n $(\"#results\").hide();\r\n $('#point-total').empty();\r\n }", "title": "" }, { "docid": "11ea78e7297e89717ef3c59972094569", "score": "0.7502914", "text": "function updateDisplay() {\n \n // console.log(\"questionCounter: \", questionCounter);\n // console.log(\"questions.length: \", questions.length);\n if (questionCounter === questions.length) {\n console.log(\"game over!!!\");\n gameOver();\n \n \n } else {\n timerReset();\n for (var i = 0; i < questions.length; i++) {\n $(\"#question\").text(questions[questionCounter].question);\n $(\"#answer-a\").text(questions[questionCounter].answers.a);\n $(\"#answer-b\").text(questions[questionCounter].answers.b);\n $(\"#answer-c\").text(questions[questionCounter].answers.c);\n $(\"#answer-d\").text(questions[questionCounter].answers.d);\n $(\"#result\").empty();\n \n }\n \n }\n }", "title": "" }, { "docid": "e75637756f6b8c104da802ef587fc787", "score": "0.7398986", "text": "function score(){\n\t$('#timeLeft').empty();\n\t$('#message').empty();\n\t$('#correctedAnswer').empty();\n\n\n\t$('#finalMessage').html(messages.finished);\n\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n\t$('#unanswered').html(\"Unanswered: \" + unanswered);\n\t$('#startOverBtn').addClass('reset');\n\t$('#startOverBtn').show();\n\t$('#startOverBtn').html('Start Over?');\n}", "title": "" }, { "docid": "f0c16cfa8ddca26116cc5bf2668f2248", "score": "0.7378533", "text": "function reset() {\n answersCorrect = 0;\n answersIncorrect = 0;\n n = 120;\n questionTimer();\n $(\"#timeLeft\").show();\n $(\".scoreboard\").hide();\n console.log(answersCorrect, answersIncorrect);\n }", "title": "" }, { "docid": "c436b0194581eaab0a7bda9a8bafbd92", "score": "0.73276806", "text": "function gameOver() {\n $(\".question-screen\").hide();\n $(\"footer\").hide();\n $(\".results\").show();\n \n //figuring out which answer choices were selected\n for (var i = 0; i < questions.length; i++) {\n var questionAnswered = false;\n $(\".answer-question-\" + i).each(function () {\n if (this.checked === true) {\n var selectedChoice = $(this).attr(\"value\");\n var correctChoice = $(this).attr(\"data-correct\");\n // console.log(selectedChoice);\n // console.log(correctChoice);\n \n //correct answer\n if (selectedChoice === correctChoice) {\n questionAnswered = true;\n correct++;\n results.push(\"correct\");\n }\n //incorrect answer\n else {\n questionAnswered = true;\n wrong++;\n results.push(\"incorrect\");\n }\n }\n });\n //question unanswered\n if (questionAnswered === false) {\n results.push(\"unanswered\")\n }\n }\n\n //unanswer questions = total # questions - correct answers - wrong answers\n unanswered = questions.length - correct - wrong;\n \n //showing the results to the screen\n $(\".num-correct\").text(correct);\n $(\".num-wrong\").text(wrong);\n $(\".num-unanswered\").text(unanswered);\n }", "title": "" }, { "docid": "5892d5104701958bdfcfe11814af2de8", "score": "0.7296413", "text": "function init() {\n\n //Disables View High Scores buttons while users play\n viewHiScore.disabled = true;\n viewHiScore.style.color = \"lightgray\";\n\n //Initializes the count to identify the differen properties of the SCORES object\n if (localStorage.getItem(\"numPlayers\") === null) {\n localStorage.setItem(\"numPlayers\", \"0\");\n }\n\n //Switched displayed div\n initQuiz.style.display = \"none\";\n playQuiz.style.display = \"initial\";\n\n //Iititalizes countdown\n var initTime = 75;\n var timer = setInterval(countdown, 1000);\n function countdown() {\n initTime--;\n counter.innerText = initTime;\n\n if (initTime <= 0) {\n playQuiz.style.display = \"none\";\n score.style.display = \"initial\";\n counter.innerText = 0;\n clearInterval(timer);\n }\n }\n\n //Modifies the text inside the Question and Answers elements\n //This advances through the quiz as users answer the questions\n var ansArr = [];\n var choiceArr = [];\n var points = 0;\n var qIndex = 0\n quizContent();\n\n function quizContent() {\n\n if (qIndex < jsQuestions.length) {\n var correctAnswer = jsQuestions[qIndex].answer;\n qTitle.innerText = jsQuestions[qIndex].title; //Renders question text\n ansOne.innerText = jsQuestions[qIndex].choices[0]; //Renders options 1 text\n ansTwo.innerText = jsQuestions[qIndex].choices[1]; //Renders options 2 text\n ansThree.innerText = jsQuestions[qIndex].choices[2]; //Renders options 3 text\n ansFour.innerText = jsQuestions[qIndex].choices[3]; //Renders options 4 text\n qIndex++;\n ansArr.push(correctAnswer);\n console.log(qIndex);\n }\n\n //If there are no more questions remaining the countdown stop, and the score div is displayed\n else {\n playQuiz.style.display = \"none\"; //Hides questions div\n score.style.display = \"initial\"; //Displays score div\n clearInterval(timer); //Stops countdown\n var scoreFromAns = parseFloat(yourScoreNum.textContent); //Gets score text from object\n var timeLeft = parseFloat(counter.textContent); //Gets remaining time\n var totalScore = scoreFromAns + timeLeft * 10; //Calculates total score\n yourScoreNum.innerText = totalScore; //Renders total score\n }\n\n return correctAnswer;\n }\n\n //Compares the selected answer to the correct answer\n function scoreTrack(choice) {\n var chosenAns = choice.textContent;\n choiceArr.push(chosenAns);\n console.log(\"correct ans: \" + ansArr[qIndex - 1] + \" you chose: \" + choiceArr[qIndex - 1]);\n if (choiceArr[qIndex - 1] === ansArr[qIndex - 1]) {\n correct.play(); //Plays audio if answer is correct\n ansResult.innerText = \"CORRECT\"; //Renders CORRECT message if answer is correct\n ansResult.style.color = \"green\";\n points += 100; //Add 100 to var points\n console.log(points);\n }\n else {\n wrong.play(); //Plays audio if answer is incorrect\n ansResult.innerText = \"WRONG\"; //Renders WRONG message if answer is incorrect\n ansResult.style.color = \"red\";\n initTime -= 15; //Substracts 15 second from timer\n }\n var x = setTimeout(quizContent, 1000); //Waits one second before showing the next questions\n var y = setTimeout(function () { ansResult.innerText = \" \" }, 1000);\n yourScoreNum.innerText = points;\n }\n\n //Creates new property in SCORE object with Key = playerID and Value = Initials and Score\n function submitScore() {\n var playerInitials = enterInitials.value;\n var finalScore = yourScoreNum.textContent;\n if (playerInitials === \"\") { //Stops from sending empty value\n errorMessage.innerText = \"Please enter at least two characters\";\n errorMessage.style.color = \"red\";\n errorMessage.style.fontSize = \"14px\";\n }\n else {\n errorMessage.innerText = \"\";\n if (localStorage.getItem(\"Scores\") == null) {\n var scoresObj = {}; //Initializes object if this is the first player\n console.log(\"1: \", scoresObj);\n }\n else {\n var scoresObj = JSON.parse(localStorage.getItem(\"Scores\")); //Gets SCORE object if it already exists\n console.log(\"2: \", scoresObj);\n\n }\n var playerIndex = parseFloat(localStorage.getItem(\"numPlayers\"));\n var player = \"player\" + playerIndex;\n localStorage.setItem(\"numPlayers\", playerIndex + 1); //Creates a new property in SCORE object to identify the player\n scoresObj[player] = {\n \"initials\": playerInitials, //Stores player's initials\n \"score\": finalScore //Scores player's score\n }\n\n //Logs score and renders past scores\n yourScore.innerText = playerInitials + \": \" + finalScore;\n yourScore.style.color = \"white\";\n yourScore.style.backgroundColor = \"black\";\n localStorage.setItem(\"Scores\", JSON.stringify(scoresObj));\n score.style.display = \"none\";\n hiScores.style.display = \"initial\";\n showHiScores();\n }\n //console.log(player);\n //console.log(scoresObj);\n }\n\n initialsSubmit.addEventListener(\"click\", function () { submitScore() }); //Submits initials and score on click\n\n ansOne.addEventListener(\"click\", function () { scoreTrack(ansOne) }); //Selects and submits option 1\n ansTwo.addEventListener(\"click\", function () { scoreTrack(ansTwo) }); //Selects and submits option 2\n ansThree.addEventListener(\"click\", function () { scoreTrack(ansThree) }); //Selects and submits option 3\n ansFour.addEventListener(\"click\", function () { scoreTrack(ansFour) }); //Selects and submits option 4\n}", "title": "" }, { "docid": "795483b4579b5f6ab4928ff807cd5145", "score": "0.7294954", "text": "function gameOver() {\n if (Object.keys(questions).length === 0) {\n questionTimer.stopTimer();\n $('.game').hide();\n $('.results').show();\n $('.correct').html('Number Correct: ' + correct);\n $('.wrong').html('Number Incorrect: ' + wrong);\n activeQuestion = false;\n };\n }", "title": "" }, { "docid": "b49a7789f86df284ec399eed42c980cf", "score": "0.72630084", "text": "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.score').text(0);\n $('.questionNumber').text(0);\n }", "title": "" }, { "docid": "d971964e5b4968f3968a58cce55b4d5b", "score": "0.72610664", "text": "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.score').text(0);\n $('.questionNumber').text(0);\n}", "title": "" }, { "docid": "924643e2b9995d241e6c73a3fcf83db8", "score": "0.7259705", "text": "function displayEndGame(){\n\t\t\t$($answer1).html(correctCount);\n\t\t\t$($answer2).html(incorrectCount);\n\t\t\t$($startButton).show();\n\t\t}", "title": "" }, { "docid": "27742cc6c85b6067649d4df0d93e2413", "score": "0.7239243", "text": "function displayScore() {\n $(\"#numAnswered\").html(questions.length);\n $(\"#numCorrect\").html(correctAnswers);\n $(\"#numWrong\").html(numWrong);\n}", "title": "" }, { "docid": "e5148f2e50056af5fe1a1161450f3399", "score": "0.72281605", "text": "function resetStats() {\n score = 0;\n questionNumber = 0;\n $(\".score\").text(0);\n $(\".questionNumber\").text(0);\n}", "title": "" }, { "docid": "1f19f09c86f3f55f6d4cc3225fef49a7", "score": "0.72122824", "text": "function giveup() {\n modalQuestions.style.display = \"none\";\n modalOptions.style.display = \"block\";\n scores[option] = questionCounter;\n updateScore();\n}", "title": "" }, { "docid": "eff7292012cad50bda8b50eeea2ac616", "score": "0.7192754", "text": "function renderGame() {\n currentQuestion = 0;\n correctAnswer = 0;\n incorrectAnswer = 0;\n unanswered = 0;\n $('#quiz-question-page').show();\n $('#quiz-answer-page').hide();\n $('#quiz-intro-page').hide();\n newQuestion();\n }", "title": "" }, { "docid": "8932991d4be3a906f2718e6ac6a54e77", "score": "0.71524495", "text": "function results() {\n // removes the timer\n $(\"timer\").remove();\n $(\"#question\").empty();\n $(\"#optionOne\").empty();\n $(\"#optionTwo\").empty();\n $(\"#optionThree\").empty();\n $(\"#optionFour\").empty();\n\n if (correctAnswers >= 3) {\n $(\"#optionFour\").append(\"Great Job!\");\n } else {\n $(\"#optionFour\").append(\"Better luck next time!\")\n }\n // shows the how many answers the person had right, wrong and un answered\n $(\"#right\").append(\"Correct Answers: \" + correctAnswers);\n $(\"#wrong\").append(\"Wrong Answers: \" + wrongAnswers);\n $(\"#unanswered\").append(\"Unanswered Question: \" + unanswered)\n clockStop()\n}", "title": "" }, { "docid": "c57c8a2ca97fa06b65c4d52260197b70", "score": "0.7136196", "text": "function displayResults() {\n scoreText.textContent = finalScore;\n beginQuiz.style.display = \"none\";\n questionField.style.display = \"none\";\n resultField.style.display = \"block\";\n}", "title": "" }, { "docid": "a82201e91a25e03db563c1070a6829b5", "score": "0.7130354", "text": "function result() {\r\n \t$(\"#start-area\").hide();\r\n $(\"#result\").fadeIn();\r\n $(\"#quizSection\").fadeOut();\r\n $(\"#options\").hide();\r\n $(\"#timerId\").hide();\r\n noOfUnAnswered = questions.length - (noOfCorrect + noOfIncorrect);\r\n $(\"#result\").append(\"<h4>Total Correct Answers: \" + noOfCorrect + \"</h4>\");\r\n $(\"#result\").append(\"<h4>Total Incorrect Answers: \" + noOfIncorrect + \"</h4>\");\r\n $(\"#result\").append(\"<h4>Total Unanswered: \" + noOfUnAnswered + \"</h4>\");\r\n }", "title": "" }, { "docid": "3aa2d8b783f3c06f57c70bd2c1e3dc14", "score": "0.71130323", "text": "function gameScore(){\n\n\tif (questionsAsked >= questions.length){\n\n\tdocument.getElementById(\"checkAnswer\").innerHTML = (\"You got \" + (questionsAsked - questionsWrong) + \" out of \" + questionsAsked + \" correct.\")\n\tdocument.getElementById(\"score\").innerHTML = \" Your score is \" + (Math.floor(((questionsAsked - questionsWrong) / questionsAsked) * 100)) + \"%\"\n\n\tdocument.getElementsByClassName(\"question\")[0].style.display = \"none\"\n\t}\t\n}", "title": "" }, { "docid": "ae4fc6cb4796c6f2441115f62bcb40a3", "score": "0.70975584", "text": "function scoreboard(){\n $('#timeLeft').empty();\n $('#message').empty();\n $('#correctedAnswer').empty();\n $('#gif').hide();\n $(\"#gifCaption\").hide();\n \n $('#finalMessage').html(messages.finished);\n $('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n $('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n $('#unanswered').html(\"Unanswered: \" + unanswered);\n $('#startOverBtn').addClass('reset');\n $('#startOverBtn').show();\n $('#startOverBtn').html(\"PLAY AGAIN\");\n }", "title": "" }, { "docid": "8cc70501e36fac3ca0d31a633389166c", "score": "0.70835954", "text": "function resetQuiz() {\n questionCounter = 0;\n score = 0;\n }", "title": "" }, { "docid": "6280e3fa411807eaa5cf047640fafa7c", "score": "0.70688105", "text": "function allDone() {\n clearInterval(countDown);\n question.innerHTML = '';\n choices.innerHTML = '';\n yourScoreEl.innerHTML = timerCounter;\n displayInitEl.removeAttribute('class','hide');\n}", "title": "" }, { "docid": "523346bb5877595905b1ece0d51f9564", "score": "0.7062579", "text": "function correctAnswer() {\n score++;\n $('form').hide(300);\n $('#js-right').show(300);\n $('#js-trackCorrect').html(`${score} of 5 Correct`);\n}", "title": "" }, { "docid": "aa73ceb9622662cb11d1cd3e3bb5ba62", "score": "0.7040747", "text": "function resetScore() {\n totalScore = 0\n questionNum = 0\n incorrect = 0\n}", "title": "" }, { "docid": "588d0ffb90a39a51fb3b39077f566b50", "score": "0.7033493", "text": "function scoreboard(){\n\t$(\"#remainingTime\").empty();\n\t$(\"#alertMessage\").empty();\n\t$(\"#rightAnswer\").empty();\n\n\t$(\"#endMessage\").html(alertMessages.finished);\n\t$(\"#correctAnswers\").html(\"Correct Answers: \" + correctAnswer);\n\t$(\"#incorrectAnswers\").html(\"Incorrect Answers: \" + incorrectAnswer);\n\t$(\"#unanswered\").html(\"Unanswered: \" + unanswered);\n\t// $(\"#startOver\").addClass(\"reset\");\n\t// $(\"#startOver\").show();\n $(\"#reset\").html(\"Start Over?\");\n $(\"#reset\").css(\"border: 2px solid blue\");\n}", "title": "" }, { "docid": "42c463d9577590924201910331343b48", "score": "0.7020603", "text": "function showResults() {\n\n //gather answer containers from the quiz\n const answerContainers = quizContainer.querySelectorAll(\".answers\");\n\n //keep track of user's answers\n let numCorrect = 0;\n\n let quesSkipped = 0;\n\n triviaQuestions.forEach((currentQuestion, questionNumber) => {\n //find selected answer\n const answerContainer = answerContainers[questionNumber];\n const selector = `input[name=question${questionNumber}]:checked`;\n const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n\n //if answer is correct\n if (userAnswer === currentQuestion.correctAnswer) {\n //add to the number of correct answers\n numCorrect++;\n\n //color the answers green\n answerContainers[questionNumber].style.color = '#009DA7';\n }\n else {\n //color the answers red\n answerContainers[questionNumber].style.color = '#de3607';\n }\n });\n //amount of questions\n var quesLength = triviaQuestions.length;\n var quesLengthA = parseInt(quesLength);\n\n //amount of correct answers\n var correctLength = parseInt(numCorrect);\n\n //amount missed\n var amountMissed = quesLength - correctLength;\n\n //show number of correct answers out of total\n $(\"#pageBreak\").html(\"<hr size='5' color='white'>\")\n $(\"#numberRight\").html(\"<h1 id='mylanta'>Oh mylanta!</h1> <br> <h1 class='score'>You got \" + correctLength + \" questions correct!</h1><br><br>\");\n $(\"#numberWrong\").html(\"<h1 id='chalupas'>Holy chalupas!</h1> <br> <h1 class='score'>You missed \" + amountMissed + \" questions.</h1><br><br>\");\n $('#timeLeft').hide();\n } //end of showResults", "title": "" }, { "docid": "85b89eab560d6f3a71f1888a33bb897c", "score": "0.701953", "text": "function displayFinalScore() {\n //test\n console.log(\"final score\");\n //clear all fields\n $(\"#time-cont\").empty();\n $(\"#questions\").empty()\n $(\"#answers\").empty();\n //insert wins\n $(\"#wins\").html(\"<p>\" + win + \" answers were correct.</p>\")\n //insert losses\n $(\"#losses\").html(\"<p>\" + loss + \" answers were incorrect.</p>\")\n //clearInterval clearTimeout\n clearTimeout(timeoutId);\n clearInterval(intervalId);\n //insert restartGame() functionality and display restart button\n $(\"#restart\").html('<button id=\"restart-btn\">Keep Exploring</button>');\n restartGame();\n}", "title": "" }, { "docid": "11ac571b655375fc2f60bfabe7373316", "score": "0.70193106", "text": "function scoreboard(){\n\t\t$('#timeLeft').empty();\n\t\t$('#message').empty();\n\t\t$('#correctedAnswer').empty();\n\t\t$('#gif').hide();\n\t\t$(\"#gifCaption\").hide();\n\n\t\t$('#finalMessage').html(messages.finished);\n\t\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n\t\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n\t\t$('#unanswered').html(\"Unanswered: \" + unanswered);\n\t\t$('#startOverBtn').addClass('reset');\n\t\t$('#startOverBtn').show();\n\t\t$('#startOverBtn').html(\"PLAY AGAIN\");\n\t}", "title": "" }, { "docid": "4b87a4ac91b1adeb308a39ba527b050d", "score": "0.7010744", "text": "function renderQuestion() {\n q1Button.style.display = \"block\";\n q2Button.style.display = \"block\";\n q3Button.style.display = \"block\";\n q4Button.style.display = \"block\";\n if (i <= 4) {\n h4El.textContent = quiz[i].question;\n pEl.textContent = \"\";\n pEl2.textContent = \"\";\n\n q1Button.textContent = quiz[i].one;\n q2Button.textContent = quiz[i].two;\n q3Button.textContent = quiz[i].three;\n q4Button.textContent = quiz[i].four;\n } else {\n score = count;\n gameOver();\n clearInterval(countDownTimer);\n }\n}", "title": "" }, { "docid": "de75e36f6e380c6604ae0d4f53671a56", "score": "0.7007385", "text": "function checkAnswer(answer){\n if (question[runningQuestion].correct != answer){\n timer -3;\n }\n //this next bit flips throug hthe questons as long as it is not the last question \n if (runningQuestion < lastQuestion){\n runningQuestion++;\n renderQuestion();\n }\n //this is where I need to have the score shown and have it recoreded as well as log the persons initial with an else\n\n}", "title": "" }, { "docid": "237c10032275108ca6f373d89d2869e2", "score": "0.700073", "text": "function startQuiz() {\n var startScreen = document.getElementById(\"startScreen\");\n startScreen.style.display = \"none\";\n questionsSection.style.display = \"block\"\n\n // quiz questions \n function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}\n \nQuiz.prototype.getQuestionIndex = function() {\n return this.questions[this.questionIndex];\n}\n \nQuiz.prototype.guess = function(answer) {\n if(this.getQuestionIndex().isCorrectAnswer(answer)) {\n this.score++;\n }\n \n this.questionIndex++;\n}\n \nQuiz.prototype.isEnded = function() {\n return this.questionIndex === this.questions.length;\n}\n \n \nfunction Question(text, choices, answer) {\n this.text = text;\n this.choices = choices;\n this.answer = answer;\n}\n \nQuestion.prototype.isCorrectAnswer = function(choice) {\n return this.answer === choice;\n}\n \n // ends quiz and shows scroes\nfunction populate() {\n if(quiz.isEnded()) {\n showScores();\n }\n else {\n // show question\n var element = document.getElementById(\"question\");\n element.innerHTML = quiz.getQuestionIndex().text;\n \n // show options\n var choices = quiz.getQuestionIndex().choices;\n for(var i = 0; i < choices.length; i++) {\n var element = document.getElementById(\"choice\" + i);\n element.innerHTML = choices[i];\n guess(\"btn\" + i, choices[i]);\n }\n \n showProgress();\n }\n};\n \nfunction guess(id, guess) {\n var button = document.getElementById(id);\n button.onclick = function() {\n quiz.guess(guess);\n populate();\n }\n};\n \n \nfunction showProgress() {\n var currentQuestionNumber = quiz.questionIndex + 1;\n var element = document.getElementById(\"progress\");\n element.innerHTML = \"Question \" + currentQuestionNumber + \" of \" + quiz.questions.length;\n};\n // final message that shows score\nfunction showScores() {\n var gameOverHTML = \"<h1>Result</h1>\";\n gameOverHTML += \"<h2 id='score'> Your scores: \" + quiz.score + \"</h2>\";\n var element = document.getElementById(\"quiz\");\n element.innerHTML = gameOverHTML;\n};\n \n// Questions for quiz\nvar questions = [\n new Question(\"Which built-in method calls a function for each element in the array?\", [\"While()\", \"loop()\", \"forEach()\", \"None\"], \"forEach()\"),\n new Question(\"JavaScript is a __ -side programming language\", [\"Client\", \"Server\", \"Both\", \"None\"], \"Both\"),\n new Question(\"Which is not a JavaScript Framework?\", [\"Python Script\", \"JQuery\",\"Django\", \"NodeJS\"], \"Django\"),\n new Question(\"Which of the following will write the message “Hello DataFlair!” in an alert box?\", [\"alertBox(“Hello DataFlair!”);\", \"alert(Hello DataFlair!);\", \"msgAlert(“Hello DataFlair!”);\", \"alertOption(“Hello DataFlair!”);\"], \"alert(“Hello DataFlair!”);\"),\n new Question(\"Which JavaScript label catches all the values, except for the ones specified?\", [\"catch\", \"label\", \"try\", \"default\"], \"default\")\n];\n \n// creates quiz\nvar quiz = new Quiz(questions);\n \n// displays quiz\npopulate();\n\n\n\n}", "title": "" }, { "docid": "33318c0f1bf90bb5c91565545947a231", "score": "0.6996143", "text": "function displayResults() {\n $('#answer2, #answer3, #answer4, .time-remain-margins, .ans').toggle();\n $('#reset-button').show().html('Reset');\n if (correctAnsCounter < 4) {\n $('#question').html('You answered ' + correctAnsCounter + ' out of 10 questions correctly <br>').addClass('text-center');\n $('#question').append('<img src=\"assets/images/lowScore.gif\">');\n } else if (correctAnsCounter < 8) {\n $('#question').html('You answered ' + correctAnsCounter + ' out of 10 questions correctly <br>').addClass('text-center');\n $('#question').append('<img src=\"assets/images/medScore.gif\">');\n } else {\n $('#question').html('You answered ' + correctAnsCounter + ' out of 10 questions correctly <br>').addClass('text-center');\n $('#question').append('<img src=\"assets/images/highScore.gif\">');\n }\n}", "title": "" }, { "docid": "4e962563f4092c4614e7530a2c47cb30", "score": "0.6995827", "text": "function checkAnswer(answer){\n \n if (runningQuestionIndex < 6) {\n timeRemaining = 15;\n runningQuestionIndex++;\n $(\"#timeCount\").show();\n renderQuestion();\n } else if (runningQuestionIndex === 6) {\n console.log(\"yo\");\n } else { \n clearInterval(TIMER)\n $(\"#timeCount\").hide();\n $(\".clearDiv\").empty();\n $(\"#question\").html(\"<h2>Score:</h2>\");\n $(\"#option\").html(\"<p>\").addclass(\"correct\");\n $(\"#option\").html(\"<p>\").addclass(\"wrong\");\n $(\"#option\").html(\"<p>\").addclass(\"unanswered\");\n $(\".correct\").text(\"Correct: \" + correct);\n $(\".wrong\").text(\"Wrong: \" + wrong);\n $(\".unanswered\").text(\"Unanswered: \" + unanswered);\n// showScore\n }\n}", "title": "" }, { "docid": "63b4fb32a30ef04f35145b5d78c095f4", "score": "0.69902325", "text": "function scoreClear() {\n playerScore.textContent = 0;\n computerScore.textContent = 0;\n roundNum.textContent = 0;\n displayResult(\"Want to play again?\");\n }", "title": "" }, { "docid": "2afab2e7aeafb3863f5ac830b89298cb", "score": "0.6981784", "text": "updateQuestionCounter() {\n document.querySelector(\"#nb-questions__current\").textContent = game.questionCounter;\n document.querySelector(\"#nb-questions__total\").textContent = game.nbQuestions;\n }", "title": "" }, { "docid": "bec1d076ed7fe16b2f683eade3fc901f", "score": "0.6981415", "text": "function endOfQuiz() {\n var totalScore = Math.floor(100 * ((quizScore[0] + quizScore[1] + quizScore[2]) / (numberOfQuestions * 3)));\n if (isNaN(totalScore)) {\n totalScore = 0;\n }\n // hides quiz questions and displays results\n $('#quiz-container').css('display', 'none');\n $('#quiz-results').css('display', 'block');\n $('.quiz-score:eq(0)').text(quizScore[0] + '/' + numberOfQuestions + ' Common Name(s)');\n $('.quiz-score:eq(1)').text(quizScore[1] + '/' + numberOfQuestions + ' Scientific Name(s)');\n $('.quiz-score:eq(2)').text(quizScore[2] + '/' + numberOfQuestions + ' Family Name(s)');\n $('.quiz-score:eq(3)').text('Total score: ' + totalScore + '%');\n}", "title": "" }, { "docid": "c156cd2fca64a4ae75164eb98aaa2519", "score": "0.69790983", "text": "function showResults() {\n\t$(\"#gameQuestions\").css(\"display\", \"none\");\n\t$(\"#results\").css(\"visibility\", \"visible\");\n\t$(\"#timer\").css(\"display\", \"none\");\n\t$(\"#correctScore\").text(correct);\n\t$(\"#unansweredScore\").text(unanswered);\n\t$(\"#incorrectScore\").text(incorrect);\n}", "title": "" }, { "docid": "fdc44414236df50cdc19f534560c8236", "score": "0.69737357", "text": "function resetQuiz(){\n questionCounter = 0;\n score = 0;\n}", "title": "" }, { "docid": "646595383f7b08d3322c4fab9e59ac4d", "score": "0.69700664", "text": "function showResults() {\r\n computeFinalScore();\r\n $(\"#results\").show();\r\n $(\"#quiz\").hide();\r\n $('#new-game').click(gameReset);\r\n }", "title": "" }, { "docid": "d303b877822a0ab06a20679d03384e55", "score": "0.69692135", "text": "function resetUI(){\n \n allowAnswer = true;\n \n let scoreboard = document.querySelector(\".scoreboard\");\n\n scoreboard.style.background = \"radial-gradient(grey, dimgrey)\";\n \n updateScoreLbl(false);\n \n enableCards();\n \n // grab a new quote\n newQuote();\n \n timerPercent = 0;\n}", "title": "" }, { "docid": "e65c3c3c23f770e3f68174d710ba4eed", "score": "0.6960748", "text": "function update() {\n $('.correct span').text(game.score.correct);\n $('.incorrect span').text(game.score.incorrect);\n // calculate how many questions are left\n game.questionsLeft = (questions.length + 1) - (game.currentQuestion + 1);\n $('.questions-left span').text(game.questionsLeft);\n $('.time-left span').text(game.timeLeft);\n}", "title": "" }, { "docid": "ba0580120819357d81c7f9c2150d8339", "score": "0.6960595", "text": "function tryAgain() {\n scoreContainer.style.display = \"none\";\n quizComplete.style.display = \"none\";\n startContainer.style.display = \"flex\";\n timeLeft = 76;\n score = 0;\n questionsCurrent = 0;\n}", "title": "" }, { "docid": "8c5c368227ba0a5423febee269a6dc9f", "score": "0.6959738", "text": "function showScore(){\n document.querySelectorAll('.answerlist').forEach(e => e.remove());\n document.getElementById(\"submitbutton\").style.cursor = \"default\"; \n document.getElementById(\"labelQuestion\").style.padding = \"0.5rem 0 0.5rem 0\";\n var TotalScore = points/quizData.length*100;\n\n document.getElementById(\"labelQuestion\").innerText = \"Your Total Score\";\n document.getElementById(\"submitbutton\").innerText = TotalScore;\n}", "title": "" }, { "docid": "eed11dfb7e8fb5b193d959e23e1d188a", "score": "0.6953223", "text": "function showResults(){\n\n /*We get with this querySelectorAll all the elements of the div with the class answers.*/\n const answerContainers = document.querySelectorAll('.answers');\n\n //Variable to hold the score\n let score = 0;\n\n//A loop that we'll serve us to get the user's inputs from the answers.\n myQuestions.forEach((currentQuestion, questionNumber) => {\n\n\n /*These 3 variables will serve us to collect whether an input has been checked or not and compare it to the correct answers\n\n\n */\n const answerContainer = answerContainers[questionNumber];\n const selector = 'input[name=question'+questionNumber+']:checked';\n const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n\n //The conditional that will add points to the score in case how answer matches the right question\n if(userAnswer === currentQuestion.correctAnswer){\n score++;\n\n\n answerContainers[questionNumber].classList.add('respuestaCorrecta');\n }\n\n else {\n answerContainers[questionNumber].classList.add('respuestaIncorrecta');\n }\n });\n\n resultadoFinal.style.display = 'none'; //This will delete the div that shows the test\n button.style.display ='none'; //this will delete the button that sends the text\n timer.style.display = 'none'; //This will delete the timer\n\n\n //Variable and conditional that will print the results\n let notas;\n if(score < 5){notas = ' Has suspendido. Vuelva a intentarlo de nuevo después de estudiar un poco más.'} else if(score >= 5) { notas = 'Enhorabuena, has aprobado'};\n\n\n //Logic that will show the results\n const nuevoResultado = document.createElement('DIV');\n nuevoResultado.classList.add('resultadoConEstilo');\n nuevoResultado.innerHTML = score + ' de un total de ' + myQuestions.length + '. ' + notas;\n mostrarResultado.appendChild(nuevoResultado);\n\n\n //Conditionals that will print into the innerHTML the time that it took the test\n if(minutos === 0){\n const contenedorMinutos = document.createElement('SPAN');\n contenedorMinutos.classList.add('losMinutos');\n contenedorMinutos.innerHTML = ' Has tardado ' + segundos + ' segundos.';\n nuevoResultado.appendChild(contenedorMinutos);\n }\n else if (minutos === 1){\n const contenedorMinutos = document.createElement('SPAN');\n contenedorMinutos.classList.add('losMinutos');\n contenedorMinutos.innerHTML = ' Has tardadado ' + minutos + ' minuto y ' + segundos + ' segundos.';\n nuevoResultado.appendChild(contenedorMinutos);\n } else if(minutos > 1) {\n const contenedorMinutos = document.createElement('SPAN');\n contenedorMinutos.classList.add('losMinutos');\n contenedorMinutos.innerHTML = ' Has tardadado ' + minutos + ' minutos y ' + segundos + ' segundos.';\n nuevoResultado.appendChild(contenedorMinutos);\n }\n\n\n //What does this function is stopping the interval called reloj. So what will happen is that the timer starts and once we push the button, the function showResult will start and the interval reloj stops once it gets to this line\n clearInterval(reloj);\n\n\n //Creates a file with the result\n let date = new Date();\n let dateYear = date.getFullYear();\n let dateDay = date.getDate();\n let dateMonth = date.getMonth();\n let dateHour = date.getHours();\n let dateMinute = date.getMinutes();\n let fullTime = `Fecha: ${dateDay}/${dateMonth}/${dateYear} ${dateHour}:${dateMinute}`;\n\n const path = './testing.txt';\n\n if(fs.existsSync(path)){\n fs.appendFile('testing2.txt', ` \\n\\n ${score} de un total de ${myQuestions.length}. ${fullTime} \\n`, (err) => {\n if(err) throw err;\n console.log(\"The file was saved!\");\n });\n } else {\n fs.writeFile('testing2.txt', `${score} de un total de ${myQuestions.length}. ${fullTime}`, function(err){\n if(err){\n return console.log(err);\n }\n console.log(\"The file was saved!\");\n })\n }\n}", "title": "" }, { "docid": "216249f8e1dca4b6f6b07a6421ee0a15", "score": "0.69522256", "text": "function displayQuestion() {\n // This displays the final tally once the quiz has been completed\n if (pos >= questions.length) {\n timerEl.textContent = \"\";\n // Use `clearInterval()` to stop the timer\n clearInterval(timeInterval);\n timerEl.textContent = \"\";\n testEl.innerHTML =\n \"<h2>You got \" +\n correct +\n \" of \" +\n questions.length +\n \" questions correct</h2>\";\n testStatusEl.innerHTML = \"Test completed\";\n testEndingForm();\n displayScores();\n\n //This resets the function after the quiz has been completed\n pos = 0;\n correct = 0;\n // This stops the function running when test is completed\n return false;\n }\n\n //This is using a template literal in order to display the number of the question\n testStatusEl.innerHTML = `Question ${pos + 1} of ${questions.length}`;\n\n question = questions[pos].question;\n optionA = questions[pos].a;\n optionB = questions[pos].b;\n optionC = questions[pos].c;\n optionD = questions[pos].d;\n // This is what is displaying the question based on the position of the question per the questions array\n testEl.innerHTML = `<h3> ${question} </h3>`;\n // display the answer options\n // the += appends to the data we started on the line above\n testEl.innerHTML += `<label> <input type='radio' name='choices' value='A'> ${optionA} </label><br>`;\n testEl.innerHTML += `<label> <input type='radio' name='choices' value='B'> ${optionB} </label><br>`;\n testEl.innerHTML += `<label> <input type='radio' name='choices' value='C'> ${optionC} </label><br>`;\n testEl.innerHTML += `<label> <input type='radio' name='choices' value='D'> ${optionD} </label><br>`;\n testEl.innerHTML += `<button onclick='submitAnswer()'>Next Question</button>\n <br>\n <button onclick='previousQuestion()'>Previous Question</button>`;\n}", "title": "" }, { "docid": "462429dc1dcf48bc541e2fa4d08f739b", "score": "0.6945917", "text": "function resolveGame() {\n clearInterval(intervalId);\n $(\"#question-stuff\").hide();\n $(\"#results\").show();\n $(\"#restart\").show();\n // show number of right\n var rightAnswers = 0;\n var wrongAnswers = 0;\n var skipped = 0;\n for(var i =0; i < questions.length; i++) {\n if (questions[i].isCorrect === true) {\n rightAnswers++;\n } else if (questions[i].isCorrect === false) {\n wrongAnswers++;\n } else {\n skipped++;\n }\n }\n \n $(\"#results\").append(`<p>Questions correct: ${rightAnswers}</p>`);\n $(\"#results\").append(`<p>Questions Incorrect: ${wrongAnswers}</p>`);\n $(\"#results\").append(`<p>Questions Skipped: ${skipped}</p>`);\n }", "title": "" }, { "docid": "2a52e742b021ff4df1723802257fb570", "score": "0.6928837", "text": "function reset() {\n answeredArr.length = 0;\n score = 0;\n soFar = 0;\n $('.rst').css('display', 'none');\n $('.reset').css('display', 'none');\n $('.answer').css('display', 'none');\n $('#start-button').css('display', 'inline-block');\n }", "title": "" }, { "docid": "9a89adce34b17215f874c75292f1d676", "score": "0.6920723", "text": "function showScore() {\n quizBody.style.display = \"none\";\n quizComplete.style.display = \"flex\";\n clearInterval(timerInterval);\n userInitials.value = \"\";\n userScore.innerHTML =\n \"You got \" + score + \" points!\";\n}", "title": "" }, { "docid": "9f4da84c60eb44536006adef2e61d26d", "score": "0.6915014", "text": "function setup() {\n $(\".start\").css(\"display\", \"none\");\n var correct = 0;\n var incorrect = 0;\n var timeout = 0;\n n = 0;\n key = keys[n];\n //reset of the game\n var reset = function() {\n time = 30;\n $(\".rightAns\").empty();\n $(\".rightAns\").remove();\n $(\".main\").append(timerDiv);\n $(\".countdown h3\").html(\"TIME REMAINING: \" + time);\n $(\".main\").append(questionDiv);\n $(\".main\").append(answerDiv);\n }\n \n reset();\n \n //function to begin make q's work\n function showQA() {\n $(\".question h3\").html(questions[key].question);\n for (var i = 0; i < questions[key].answers.length; i++) {\n $(\".answers\").append(\"<p class='answer'>\" + questions[key].answers[i] + \"<p>\");\n } \n $(\".answers p\").on(\"click\", function() {\n var selected = $(this).text();\n \n //if then: if question right show this, if wrong show that\n if (selected === questions[key].correct) {\n clearInterval(counter);\n $(timerDiv).remove();\n $(questionDiv).remove();\n $(\".answers p\").remove();\n $(answerDiv).remove();\n $(\".main\").append(rightDiv);\n $(\".rightAns\").text(\"THOMAS TERRIFIC! YOU ARE CORRECT!\");\n correct++;\n } else {\n clearInterval(counter);\n $(timerDiv).remove();\n $(questionDiv).remove();\n $(\".answers p\").remove();\n $(answerDiv).remove();\n $(\".main\").append(rightDiv);\n $(\".rightAns\").text(\"NO SORRY WRONG! THE CORRECT ANSWER WAS: \" + questions[key].correct);\n incorrect++;\n }\n n++;\n key = keys[n];\n\n if (checkIfLast()) {\n displayFinalScore();\n \n } else {\n setTimeout(countReset, 3000);\n setTimeout(reset, 3000);\n setTimeout(showQA, 3000);\n }\n });\n }\n \n showQA();\n \n var counter = setInterval(count, 500);\n \n //Time remaining for each q\n function count() {\n time--\n $(\".countdown h3\").html(\"TIME REMAINING: \" + time);\n \n if (time < 1) {\n clearInterval(counter);\n $(timerDiv).remove();\n $(questionDiv).remove();\n $(\".answers p\").remove();\n $(answerDiv).remove();\n $(\".main\").append(rightDiv);\n $(\".rightAns\").html(\"OUT OF TIME! THE CORRECT ANSWER WAS: \" + questions[key].correct);\n timeout++;\n n++;\n key = keys[n];\n \n if (checkIfLast()) {\n displayFinalScore();\n } else {\n setTimeout(countReset, 3000);\n setTimeout(reset, 3000);\n setTimeout(showQA, 3000);\n }\n }\n }\n \n function checkIfLast() {\n if (key === undefined) {\n return true;\n }\n return false;\n }\n \n //timer for message after choosing answer\n function countReset() {\n counter = setInterval(count, 200);\n }\n \n \n //final score showing\n function displayFinalScore() {\n $(\".rightAns\").remove();\n $(\".start\").css(\"margin-top\", \"30px\");\n $(\".start\").css(\"display\", \"inline\");\n $(\".main\").prepend(\"<h2>UNANSWERED: \" + timeout + \"</h2>\");\n $(\".main\").prepend(\"<h2>INCORRECT: \" + incorrect + \"</h2>\");\n $(\".main\").prepend(\"<h2>CORRECT: \" + correct + \"</h2>\");\n }\n }", "title": "" }, { "docid": "82169a2a3b5d548cd119a0ea2b49d337", "score": "0.6909751", "text": "function populateResults(trivia_Questions){\n const answerContainer=document.querySelectorAll('#answers');\n //initializing the user's answer for the results later\n //need to select all the possible answers.\n //possible ways to select to the radio buttons.\n //const answerContainer=document.querySelectorAll('#answers');\n const checkedRadio = document.querySelectorAll(`input[type=\"radio\"]:checked`);\n let userAnswer= '';\n //initialize the score as zero for incrementing later\n let correctSelection = 0;\n //create a div for the score to show results\n //scoreboard = document.createElement('div');\n //scoreboard.innerHTML=`<div> ${correctSelection} </div>`\n //attach the scoreboard to the score tag.\n //score.appendChild(scoreboard);\n //created a for loop to check the if the boxes were checked.\n for(let i=0; i<trivia_Questions.length;i++){\n //find the answer selected /checked\n //first select the radio buttons \n //radioButton = document.querySelectorAll('#answers');\n //conditions for the correct answer\n //if the checked radio is equal to the user answer and is right\n //increment the score.\n //if the radio checked is incorrect the player does not get the score.\n // checkedRadio.forEach(value =>{ console.log(value)});\n if(checkedRadio[i].value === trivia_Questions[i].correctAnswer){\n //increment the score \n correctSelection+=20;\n //appended scoreboard to update the score.\n console.log('here')\n console.log(checkedRadio[i].value)\n }\n if(correctSelection <20){\n losingState();\n }\n\n \n }\n score.innerText= `->>>>SCORE ::: ${correctSelection} <<<<-`;\n}", "title": "" }, { "docid": "71be9661b9551b341c2a01ca66b2f74a", "score": "0.69081247", "text": "function takeTestAgain() {\n index = 0;\n dataAnswer = 0;\n score = 0;\n $(\"#resultScreen\").hide();\n $(\"#questionScreen\").show();\n $('.answer__item input').prop('checked', false);\n $('.modal__bg').removeClass('toggle');\n $('.modal__bg' + index).toggleClass('toggle');\n printQuestion(index);\n}", "title": "" }, { "docid": "b428229515f5602ae4bb32769ce5d519", "score": "0.6905992", "text": "function quizQuestions(){\n\t\tif(count === quiz.length){ //if quiz is over display the results\n\t\t\tstop();\n\t\t\t$(\".question-font\").empty();\n\t\t\tgifImage.hide();\n\t\t\trestart.show();\n\t\t\tresults();\n\t\t\tresetGame();\n\t\t\t\n\t\t}else{ //if quiz is not over, continue with questions\n\t\t\tgifImage.hide();\n\t\t\tintervalId = setInterval(decrement, 1000);\n\t\t\tresetTimer();\n\t\t\tmessage.html(\"\");\n\t\t\tmyQuestions.html(quiz[count].question);\n\t\t\tfor (var j = 0; j < quiz[count].answers.length; j++) {\n\t\t\t\tvar choiceElement = $(\"<li>\" + quiz[count].answers[j] + \"</li>\").attr(\"data-index\", j);\n\t\t\t\t$(\".myAnswers\").append(choiceElement);\n\t\t\t}//end inner for loop\n\t\t\tcheckAnswer();\n\t\t}\n\t}//end function", "title": "" }, { "docid": "08c2c2dbf1da9c311964cf0c794bed8b", "score": "0.6904203", "text": "function resetGame() {\n quizNum = 0;\n correct = 0;\n wrong = 0;\n unsolved = 0;\n $(\"#correct\").text(\"\");\n $(\"#wrong\").text(\"\");\n $(\"#unsolved\").text(\"\");\n}", "title": "" }, { "docid": "1dabac5a72d7b2bee9be6e5a98fbf126", "score": "0.69012046", "text": "function displayQuestion() {\n //$(\"body\").css(\"background-image\", \"url(assets/images/background.jpg)\");\n countDown(15, timer);\n $(\".container, .myborder, .question, .options, .score, .wrong\").show();\n $(\".start\").hide();\n $(\".score\").text(\"Right answers = \" + right);\n $(\".wrong\").text(\"Wrong answers = \" + wrong);\n $(\".question\").html(QuestionsArray[count].question);\n $(\"#option0\").html(QuestionsArray[count].options.a);\n $(\"#option1\").html(QuestionsArray[count].options.b);\n $(\"#option2\").html(QuestionsArray[count].options.c);\n $(\"#option3\").html(QuestionsArray[count].options.d);\n $(\".pickedAnswer\").html(\"\");\n}", "title": "" }, { "docid": "e64480a399826960bd33e69565b7919c", "score": "0.6899727", "text": "function showScore() {\n const userScore = document.querySelector('.result__score-correct');\n const totalScore = document.querySelector('.result__score-total');\n //show user score, correct answers stored in correctAns variable\n userScore.textContent = correctAns;\n //total score is our array with questions length\n totalScore.textContent = questions.length;\n //show message\n showScoreMessage();\n}", "title": "" }, { "docid": "8cc66ee96cf3e5ff973de198c530baba", "score": "0.68869734", "text": "function showFinalScore() {\n quizPage.style.display = \"none\";\n questionsPage.style.display = \"none\";\n answerReply.style.display = \"none\";\n finalResultPage.style.display = \"block\";\n\n if (startScore === 0 || quizQuestions.length -1) {\n finalResultIs.textContent = \"Your final score is \" + secondsLeft;\n }\n}", "title": "" }, { "docid": "40bcba3176738706c6933789b464d346", "score": "0.6883986", "text": "function gameOver() {\n summary.style.display = \"block\";\n questionDiv.style.display = \"none\";\n startDiv.style.display = \"none\";\n timer.style.display = \"none\";\n timesUp.style.display = \"block\";\n\n // show final score\n finalScore.textContent = correctAns;\n}", "title": "" }, { "docid": "a45609a81a62d4ea6e44c1bac4a0a1d0", "score": "0.68817025", "text": "function displayScore() {\r\n var score = $('<p>', {\r\n id: 'question'\r\n });\r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n score.append('You got ' + numCorrect + ' out of ' +\r\n questions.length + '.');\r\n return score;\r\n }", "title": "" }, { "docid": "3ee571b31b6bca27f3f1f122b9682bd1", "score": "0.6880196", "text": "function showResults(){\n questionContainer.setAttribute('hidden', true);\n timer.setAttribute('hidden', true);\n showScore.innerHTML = score + '/' + questions.length;\n resultsContainer.removeAttribute('hidden');\n}", "title": "" }, { "docid": "6f8f42f71f2b6de3b0fb6e48582e3e63", "score": "0.6877751", "text": "function score() {\r\n document.getElementById(\"show-score\").innerHTML = \"<h2>All Done, here's how you did!</h2> <h3><br>Correct: \" + correct + \"<br>Incorrect: \" + incorrect+\"</h3>\";\r\n clearIt();\r\n reset();\r\n}", "title": "" }, { "docid": "978a1fd17dfd9e025b3e054c2b218a23", "score": "0.6870935", "text": "function displayFinalScore(){\n $('.end-section').fadeIn(1000);\n $('.end-section h4').text(`Your Score is: ${score}/${questionsCount}`);\n $('.correct .count' ).text(score);\n $('.wrong .count').text(questionsCount - score);\n resetQuiz();\n}", "title": "" }, { "docid": "421950c94c9833bbff082293f96ff938", "score": "0.68635416", "text": "function displayFinalScore() {\n welcomeEl.style.display = \"none\";\n questionEl.style.display = \"none\";\n scoreEl.style.display = \"block\";\n leaderBoardEl.style.display = \"none\";\n finalScore.textContent = userScore;\n\n}", "title": "" }, { "docid": "904d9a48273c40a4d022fc7836d69e7e", "score": "0.68607026", "text": "function resetQuiz() {\n score = 0;\n questionCount = 0;\n timerCount = 50;\n timerElement.textContent = timerCount;\n isOver = false;\n}", "title": "" }, { "docid": "eb7abbb243e5ad8f400dfd7bf02dc5fe", "score": "0.68577665", "text": "function displayScore() {\n let score = $('<p>',{id: 'question'});\n \n let numCorrect = 0;\n for (let i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('Você acertou ' + numCorrect + ' questões de ' +\n questions.length + '.');\n return score;\n }", "title": "" }, { "docid": "f7e20dc4efee59b3509456c31e0329c7", "score": "0.68473727", "text": "function showResults() {\n quizScreen.setAttribute(\"style\", \"display: none !important\");\n endScreen.setAttribute(\"style\", \"display: block !important\");\n var viewScore = document.getElementById(\"viewScore\")\n endTitle.textContent = \"Fin!\";\n viewScore.textContent = \"Your score is: \" + timeLeft + \". Enter your initials below to save your score!\";\n}", "title": "" }, { "docid": "b3096ede253ea3dc008ca52379ca9743", "score": "0.6845962", "text": "function reset() {\n score=0;\n return show('play','Final');\n }", "title": "" }, { "docid": "74655d0ede9424182e655cc8ee6f311e", "score": "0.68404776", "text": "function replayQuiz(){\n highscoreContainer.style.display = \"none\";\n gameoverDiv.style.display = \"none\";\n startQuizDiv.style.display = \"flex\";\n timeLeft = 76;\n score = 0;\n currentQuestionIndex = 0;\n }", "title": "" }, { "docid": "f072e6ec676ca3cb55414d7544f4635c", "score": "0.6835312", "text": "function correctAnswer() {\n\t\t$('.choices').empty().hide(); //hide() prevents hover effect from still working even when choices arent visibile\n\t\t$('.question').empty();\n\n\t\t$('#answer').html(\"<h2> Correct!\");\n\t\t$('.photo').html('<img src=\"' + questions.image[quesNumber] + '\" />');\n\n\t\t//increments\n\t\thowMany++;\n\t\tcorrect++;\n\t\tquesNumber++;\n\t\tconsole.log(\"correct: \" + correct);\n\t\tconsole.log(\"quesNum: \" + quesNumber);\n\t\tpause();\n\n\t\t//check if we're at the last question\n\t\tif (checkQuestions(quesNumber)){\n\t\t\tsetTimeout(function(){\n\t\t\t\tgameOver();}, 4000);\n\t\t}\n\t\telse {\n\t\t\tsetTimeout(function(){\n\t\t\t\tquestion(quesNumber);}, 4000);\n\t\t}\n\t}", "title": "" }, { "docid": "e6d30f951defc2bc9615b3109dc0937e", "score": "0.68315816", "text": "function replayQuiz() {\n highscoreContainer.style.display = \"none\";\n gameoverDiv.style.display = \"none\";\n startQuizDiv.style.display = \"flex\";\n timeLeft = 60;\n score = 0;\n currentQuestionIndex = 0;\n}", "title": "" }, { "docid": "7dd974890d977e014b9bc946b2e7268d", "score": "0.6831479", "text": "function displayCorrect() {\n\n console.log(\"Current score: \" + score);\n\n // Create divs for result from last question after next question is run (see runXQuestion() functions)\n lineBreak = document.createElement(\"hr\");\n body.appendChild(lineBreak);\n\n choiceResult = document.createElement(\"div\");\n choiceResult.setAttribute(\"class\", \"result\");\n\n choiceResult.textContent = \"Correct!\";\n body.appendChild(choiceResult);\n\n setTimeout(function () {\n\n choiceResult.remove();\n lineBreak.remove();\n\n },\n\n 600);\n\n}", "title": "" }, { "docid": "991383009b6a8396150922f945e8bf66", "score": "0.68307924", "text": "function scoreboard() {\n if (correctAnswer >= 7) {\n winSound.play();\n } else {\n lostSound.play();\n }\n $(\"hr\").hide();\n $('#gif').empty();\n $('#timeLeft').empty();\n $('#message').empty();\n $('#correctedAnswer').empty();\n $('#gif').empty();\n\n $('#finalMessage').html(messages.finished);\n $('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n $('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n $('#unanswered').html(\"Unanswered: \" + unanswered);\n $('#restart-button').addClass('reset btn btn-info');\n $('#restart-button').show();\n $('#restart-button').html('Restart');\n }", "title": "" }, { "docid": "04f317c70118a07fa58dcf73c7eaa4c0", "score": "0.6824742", "text": "function optionsQuestions() {\n\n// If it is right, then show \"correct!\"\n if(this.value === myQuestions[currentIndex].answer){\n tag_p.classList.remove('hide')\n tag_p.textContent = 'Correct!';\n correct++\n\n// If it is wrong, then show 'Wrong'\n } else {\n tag_p.classList.remove('hide')\n tag_p.textContent = 'Wrong!';\n incorrect++\n time -= 10;\n }\n currentIndex++;\n\n// If already show all the question, then show the end page (page that let the user put his/her name)\n if(currentIndex === myQuestions.length){\n clearInterval(timer_html)\n showEndPage(); \n } else{\n startQuestions();\n }\n }", "title": "" }, { "docid": "d6c83901d2a8819ed92eec8103763529", "score": "0.6822587", "text": "function resetValue() {\n correctCounter = 0\n wrongCounter = 0\n unanswerCounter = 0\n questionsAsked = 0\n questions = [\n {\n question: 'Which frog is known for drinking tea?',\n options: ['Kermit', 'Pepe', 'Frogger', 'Mr. Toad'],\n answer: 'Kermit',\n picture: 'assets/images/kermitDrinkMeme.png',\n },\n {\n question: 'What is the breed of the Doge?',\n options: ['Shiba Inu', 'French Bulldog', 'Huskie', 'Golden Retriever'],\n answer: 'Shiba Inu',\n picture: 'assets/images/codedoge.jpg',\n },\n {\n question: 'What is the saying used for memes with an 8-bit sunglasses and a cigerete?',\n options: ['Say No to Drugs', 'Thug Life', 'Later Haters', 'Future Too Bright'],\n answer: 'Thug Life',\n picture: 'assets/images/Thug-Life-Cool-Glasses-PNG.png',\n },\n {\n question: 'What recent horror film remake sparked a flood of memes luring people into a sewer?',\n options: ['It', 'Saw', 'Black Mirror', 'Insidious'],\n answer: 'It',\n picture: 'assets/images/itMeme.jpg',\n },\n {\n question: 'Nyan cat in a combination of cat and what other thing?',\n options: ['Naan', 'Yam', 'Nylon', 'Pop Tart'],\n answer: 'Pop Tart',\n picture: 'assets/images/nyanCat.gif',\n },\n {\n question: \"What is Willy Wonka's state in his memes?\",\n options: ['Livid', 'Sad', 'Condescending', 'Happy'],\n answer: 'Condescending',\n picture: 'assets/images/willywonkameme.jpg',\n },\n {\n question: 'Where is the famous Troll face from?',\n options: ['Rage Comic', 'Tumblr', 'Reddit', 'John Willkin Comics'],\n answer: 'Rage Comic',\n picture: 'assets/images/trollface.jpg',\n },\n {\n question: \"Where does the ain't nobody got time for that meme originate from?\",\n options: ['Reddit', 'Comic Book', 'Television Show', 'TV Interview'],\n answer: 'TV Interview',\n picture: 'assets/images/cold-weather-meme.jpg',\n },\n {\n question: 'Which illustration is not a version of Pepe the Frog?',\n options: ['Feels Good Man', 'Angry Pepe', 'Sad Frog', 'Pepe Hungry'],\n answer: 'Pepe Hungry',\n picture: 'assets/images/pepe-frog-640x480.jpg',\n },\n {\n question: 'Which actor is featured in the roll safe meme?',\n options: ['Kayode Ewumi', 'Kevin Hart', 'Larry the Cable Guy', 'Will Ferrel'],\n answer: 'Kayode Ewumi',\n picture: 'assets/images/rollsafe.jpg',\n },\n {\n question: \"What is Grumpy cat's real name?\",\n options: ['Mr. Grump', 'Snowball', 'Tardar Sauce', 'Ron'],\n answer: 'Tardar Sauce',\n picture: 'assets/images/grumpyCat.jpg',\n },\n {\n question: \"Which Kardashian is famously found contemplating in bed?\",\n options: ['Kourtney Kardashian', 'Kris Kardashian', 'Kloé Kardashian', 'Kim Kardashian'],\n answer: 'Kim Kardashian',\n picture: 'assets/images/kimKMeme.png',\n },\n {\n question: \"Which rapper has a Jackie Chan meme tattoed?\",\n options: ['MadeinTYO', 'T-Pain', 'Big Sean', 'Mac Miller'],\n answer: 'T-Pain',\n picture: 'assets/images/tpain.png',\n },\n {\n question: \"Which martial arts master is meme to be famously mind blown?\",\n options: ['Jackie Chan', 'Bruce Lee', 'Chuck Norris', 'Master Chu'],\n answer: 'Jackie Chan',\n picture: 'assets/images/jackiechan.jpg',\n },\n {\n question: \"Who is the artist of the song featured in the Shooting Star's memes?\",\n options: ['MGMT', 'M83', 'Chainsmokers', 'Bag Raiders'],\n answer: 'Bag Raiders',\n picture: 'assets/images/shootingstarmeme.gif',\n },\n {\n question: \"Who is the actress from original the math lady/confused thinking meme?\",\n options: ['Reese Witherspoon', 'Zach Galifianakis', 'Renata Sorrah', 'Winona Ryder'],\n answer: 'Renata Sorrah',\n picture: 'assets/images/mathlady.gif',\n },\n {\n question: \"Drew Scanlon from his blinking reaction meme is a video editor/podcaster from which game website?\",\n options: ['Kotaku', 'Giant Bomb', 'That VideoGame Blog', 'IGN'],\n answer: 'Giant Bomb',\n picture: 'assets/images/drew.gif',\n },\n {\n question: \"Turkish chef Nusret Gökçe is more commonly known as?\",\n options: ['Salt Bae', 'The Naked Chef', 'The Iron Chef', 'Blinking Reaction Guy'],\n answer: 'Salt Bae',\n picture: 'assets/images/saltbae.gif',\n },\n ]\n }", "title": "" }, { "docid": "84cb474ee9084f4b5774fee3b9ea747a", "score": "0.6822186", "text": "function displayScore() {\r\n var score = $('<p>',{id: 'question'});\r\n \r\n var numCorrect = 0;\r\n for (var i = 0; i < selections.length; i++) {\r\n if (selections[i] === questions[i].correctAnswer) {\r\n numCorrect++;\r\n }\r\n }\r\n \r\n score.append('You got ' + numCorrect + ' questions out of ' +\r\n questions.length + ' right!!!');\r\n return score;\r\n }", "title": "" }, { "docid": "90f2df864507489c17ad1ce4ae423eea", "score": "0.6817163", "text": "function replayQuiz(){\n highscoreContainer.style.display = \"none\";\n gameoverDiv.style.display = \"none\";\n startQuizDiv.style.display = \"flex\";\n time = 75;\n score = 0;\n currentQuestionIndex = 0;\n}", "title": "" }, { "docid": "fee9b9cea8def2cd54d34ab5f6b7ac4e", "score": "0.68108827", "text": "function showQA() {\n $(\".question h3\").html(questions[key].question);\n for (var i = 0; i < questions[key].answers.length; i++) {\n $(\".answers\").append(\"<p class='answer'>\" + questions[key].answers[i] + \"<p>\");\n } \n $(\".answers p\").on(\"click\", function() {\n var selected = $(this).text();\n \n //if then: if question right show this, if wrong show that\n if (selected === questions[key].correct) {\n clearInterval(counter);\n $(timerDiv).remove();\n $(questionDiv).remove();\n $(\".answers p\").remove();\n $(answerDiv).remove();\n $(\".main\").append(rightDiv);\n $(\".rightAns\").text(\"THOMAS TERRIFIC! YOU ARE CORRECT!\");\n correct++;\n } else {\n clearInterval(counter);\n $(timerDiv).remove();\n $(questionDiv).remove();\n $(\".answers p\").remove();\n $(answerDiv).remove();\n $(\".main\").append(rightDiv);\n $(\".rightAns\").text(\"NO SORRY WRONG! THE CORRECT ANSWER WAS: \" + questions[key].correct);\n incorrect++;\n }\n n++;\n key = keys[n];\n\n if (checkIfLast()) {\n displayFinalScore();\n \n } else {\n setTimeout(countReset, 3000);\n setTimeout(reset, 3000);\n setTimeout(showQA, 3000);\n }\n });\n }", "title": "" }, { "docid": "453235f5694eb1a5d94a59dd6376cf2a", "score": "0.6810714", "text": "function updateView() {\n // Check for Game Over\n if (questionsKeys.length < 1) {\n stop();\n mkInvisible(\"#questionsContainer\");\n setText(\"#correctAnswersCount\", gameInfo.toatlWin);\n setText(\"#wrongAnswersCount\", gameInfo.totalLost);\n setText(\"#noAnswersCount\", gameInfo.notAnswered);\n mkVisible(\"#gameOverContainer\");\n\n return;\n }\n // Get a rand key ussing splice (splice return a Array)\n let _key = questionsKeys.splice(rand(questionsKeys.length), 1);\n // Get randon object from questionsObjects using splice to void erpetitive questions\n let _obj = questionsObjects[_key[0]];\n // Get string question\n let _question = _obj.question;\n // Set the question\n setText(\"#question\", _question);\n // Get the correct_answer (it will be the return of this function)\n correctAnswer = _obj.correct_answer;\n // Add correct_answer to incorrect_answers array to shuffle\n _obj.incorrect_answers.push(correctAnswer);\n // Get all answer buttons\n let _questionButtons = document.querySelector(\"#btnColumn\").children\n // Random place correct and incorrect answer on the buttons\n for (let _btn of _questionButtons) {\n let _question = _obj.incorrect_answers.splice(rand(_obj.incorrect_answers.length), 1)[0];\n _btn.innerHTML = _question;\n }\n // Get Correct answer gif url\n getCorrectAnswerGIF(`right answer ${correctAnswer}`);\n // Get wronganswer git url\n getWrongAnswerGIF();\n // remove gif animation displayGIF\n mkInvisible(\"#displayGIF\");\n // display timerHearder, question and btnColumn\n mkVisible(\"#timerHearder\", \"#question\", \"#btnColumn\");\n // Stop timer\n stop();\n // Reset counter\n // timerCounter = 30;\n timerCounter = 10; ///////////////////////////////////////////////////////////////\n //Start timer and update each 1 second\n startTimer(updateTimer, 1);\n}", "title": "" }, { "docid": "4411a0e23758ca63d1f5b65801ee9221", "score": "0.68069017", "text": "function resetUI() {\n scores = [0, 0];\n roundScore = 0;\n\n activePlayer = 0;\n\n document.querySelector(\".dice\").style.display = \"none\";\n\n // set scores and round scores to zero by default\n document.getElementById(\"score-0\").textContent = \"0\";\n document.getElementById(\"score-1\").textContent = \"0\";\n document.getElementById(\"current-0\").textContent = \"0\";\n document.getElementById(\"current-1\").textContent = \"0\";\n}", "title": "" }, { "docid": "78fc67738f7f981861459ad42ef3f828", "score": "0.6806265", "text": "function showQuizResults() {\n /* When user has went through all existing question once, \n previousQuestions Array is reset so questions can be repeated*/\n if (previousQuestions.length == allQuestionsPool.length)\n previousQuestions = [];\n\n /* Cleaning quiz elements at Show Results View */\n progressBarWrapper.innerHTML = \"\";\n progressBarWrapper.style.display = \"none\";\n quizContainer.innerHTML = \"\";\n quizStatus.innerHTML = \"\";\n choiceResult.innerHTML = \"\";\n\n /* Creating a title element for Quiz results screen */\n const quizStatsTitle = document.createElement(\"P\");\n quizStatsTitle.setAttribute(\"class\", \"display-4 mb-3 text-center\");\n quizStatsTitle.innerHTML = \"Quiz stats:<hr>\";\n quizResult.appendChild(quizStatsTitle);\n\n /* Displaying Quiz result statistics at the end of the quiz */\n const finalScore = (correctAnswerCounter / questionsTakenCounter) * 100;\n const quizFinalStats = document.createElement(\"P\");\n quizFinalStats.setAttribute(\"class\", \"h5 lead mb-3 text-center\");\n quizFinalStats.style.fontSize = \"26px\";\n quizFinalStats.innerHTML = \"Total questions taken: \" + questionsTakenCounter;\n quizFinalStats.innerHTML += \"<br>Answered correctly: \" + correctAnswerCounter;\n quizFinalStats.innerHTML += \"<br>Answered correctly (%): \" + finalScore + \"%\";\n quizFinalStats.innerHTML += \"<br>Time spent: \" + quizTimeSpent + \" seconds\";\n quizResult.appendChild(quizFinalStats);\n\n /* Displaying Quiz result message at the end of the quiz */\n const quizScoreMessage = document.createElement(\"P\");\n quizScoreMessage.setAttribute(\"class\", \"display-4 my-4 text-center\");\n quizScoreMessage.style.fontSize = \"50px\";\n quizScoreMessage.innerHTML = \"<hr>\";\n if (finalScore == 0) {\n quizScoreMessage.innerHTML += \"Didn't school teach you anything? &#128556;\";\n } else if (finalScore >= 20 && finalScore < 40) {\n quizScoreMessage.innerHTML += \"At least you guessed something... &#129323;\";\n } else if (finalScore >= 40 && finalScore < 60) {\n quizScoreMessage.innerHTML += \"I guess it could be worse... &#129320;\";\n } else if (finalScore >= 60 && finalScore < 80) {\n quizScoreMessage.innerHTML += \"Mediocre. Not great, not terrible &#128528;\";\n } else if (finalScore >= 80 && finalScore < 100) {\n quizScoreMessage.innerHTML += \"Not bad kid! &#128516;\";\n } else if (finalScore == 100) {\n quizScoreMessage.innerHTML += \"You should be a teacher! &#128513;\";\n }\n quizResult.appendChild(quizScoreMessage);\n\n /* Creation of the \"Start another Quiz?\" button at the end of the quiz */\n const newQuizButton = document.createElement(\"BUTTON\");\n newQuizButton.style.fontSize = \"25px\";\n newQuizButton.id = \"start-quiz\";\n newQuizButton.type = \"button\";\n newQuizButton.setAttribute(\"onclick\", \"initQuiz()\");\n newQuizButton.setAttribute(\"class\", \"btn btn-info btn-lg btn-block mt-3\");\n newQuizButton.innerHTML = \"Start another Quiz?\";\n startButtonWrapper.appendChild(newQuizButton);\n}", "title": "" }, { "docid": "37dc31d8c558efe7ac4dc642d5dfc75e", "score": "0.6796732", "text": "function newGame() {\n $('.results').hide();\n $('#message').text(\" \");\n // questions = questionInfo;\n correct = 0;\n wrong = 0;\n $('.game').show();\n }", "title": "" }, { "docid": "1394232026fc8a31273168d36684211f", "score": "0.67955863", "text": "function results(){\n var score = 0;\n var missed = 0; \n\n // Need to figure out a better way to write this if time\n var answer1 = $(\"input[name=q1]:checked\").val(); \n var answer2 = $(\"input[name=q2]:checked\").val(); \n var answer3 = $(\"input[name=q3]:checked\").val(); \n var answer4 = $(\"input[name=q4]:checked\").val(); \n var answer5 = $(\"input[name=q5]:checked\").val(); \n var answer6 = $(\"input[name=q6]:checked\").val();\n var answer7 = $(\"input[name=q7]:checked\").val();\n var answer8 = $(\"input[name=q8]:checked\").val();\n \n\n if (answer1 === \"Ducky Tie\") {\n score++;\n } else {\n missed++;\n }\n if (answer2 === \"Wrestler\"){\n score++;\n } else {\n missed++;\n }\n if (answer3 === \"Road Kill Rage\"){\n score++;\n } else {\n missed++;\n }\n if (answer4 === \"Scooter\"){\n score++;\n } else {\n missed++;\n }\n if (answer5 === \"Puzzles\"){\n score++;\n } else {\n missed++;\n }\n if (answer6 === \"Butterfly\"){\n score++;\n } else {\n missed++;\n }\n if (answer7 === \"Regis Philbin\"){\n score++;\n } else {\n missed++;\n }\n if (answer8 === \"Moby\"){\n score++;\n } else {\n missed++;\n }\n \n if (score >= 6){\n $(\"#score\").html(\"Correct: \" + score); \n $(\"#scoreMessage\").html(\"Legen-wait for it..DARY!\");\n $(\"#missed\").html(\"Incorrect: \" + missed);\n } else if (score < 6 && score >= 3) {\n $(\"#score\").html(\"Correct: \" + score);\n $(\"#scoreMessage\").html(\"Not bad.\");\n $(\"#missed\").html(\"Incorrect: \" + missed);\n } else {\n $(\"#score\").html(\"Correct: \" + score);\n $(\"#scoreMessage\").html(\"You just got slapped.\");\n $(\"#missed\").html(\"Incorrect: \" + missed);\n }\n $(\"#results\").show();\n $(\"#questions\").hide();\n $(\"#submitButtonDiv\").hide();\n $(\"#timer\").hide();\n }", "title": "" }, { "docid": "372bb24146b1bb78eec47d645af822c5", "score": "0.67948633", "text": "function seeResults() {\n STORE.quizStart = false;\n STORE.questionNumber ++;\n}", "title": "" }, { "docid": "86e53866f122c3ec296cfc052633d4f7", "score": "0.6794326", "text": "function playAgain() {\n questionNumber = 0;\n characterData = [];\n comicData = [];\n eventData = [];\n seriesData = [];\n storiesData = [];\n hideQuiz();\n }", "title": "" }, { "docid": "6194309ea37991a42ca0bf18296b6981", "score": "0.67912185", "text": "function gameEnd(){\n var rightAnswer = document.querySelector(\"#score\");\n var showForm = document.querySelector(\"#formHide\");\n\n showForm.setAttribute('style', 'display:inline');\n showQutput.setAttribute('style', 'display:none');\n showQuestion.setAttribute('style', 'display:none');\n changeQuestion.setAttribute('style', 'display:none');\n \n\n rightAnswer.textContent = `Correct answers: ${correctAnswer} Wrong Answers: ${wrongAnswer}`;\n}", "title": "" }, { "docid": "f557fa93a2af2ef2d075bc8347bb1bc7", "score": "0.67909163", "text": "function getnextQ () {\n var selectedChoice = document.querySelector('input[type=radio]:checked');\n if(!selectedChoice){\n alert('Please select an answer before you continue');\n return;\n }\n\n // if the selected answer is correct the users score will increase by 1\n var answer = selectedChoice.value;\n if(questions[currentQuestion].answer == answer){\n score += 10;\n }\n\n // question count\n var answer = selectedChoice.value;\n if(questions[currentQuestion].answer == answer){\n count +=1;\n console.log(count);\n }\n\n // choices are unchecked, when the quiz reaches the final question the next button is changed to display 'Finish'\n selectedChoice.checked = false;\n currentQuestion++;\n if(currentQuestion == allQuestions + - 1){\n nextbtn.textContent = \"Results\";\n }\n\n // when the quiz is finished the quizlevel1Container will be hidden and the results container displayed. \n if(currentQuestion == allQuestions){\n container.style.display = \"none\";\n resultsContainer.style.display = \"\";\n document.getElementById(\"score\").innerHTML = score;\n document.getElementById(\"allQuestions\").innerHTML = allQuestions;\n document.getElementById(\"questionIndex\").innerHTML = questionIndex;\n document.getElementById(\"score\").innerHTML = score;\n return;\n}\n\n{ // passing benchmark, if score is more than or equal to 60\n if (score >= 60) {\n document.getElementById(\"passed\").innerHTML = passed;\n\n} else {\n\n document.getElementById(\"failed\").innerHTML = failed;\n }\n}\n // get question\n getQuestion(currentQuestion);\n} // get the first question ", "title": "" }, { "docid": "09f8df09382426a08f35f603969d6fd7", "score": "0.67808837", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' correct');\n return score;\n }", "title": "" }, { "docid": "b37eb884f8f4eca0ec9b08fe6cc3662c", "score": "0.6778472", "text": "function endGame() {\r\n var scorePercent = (correctAnswer / quiz.length) * 100; // Score in percentage\r\n $(\".quiz-container\").hide();\r\n\r\n if (scorePercent > 49) { // Win conditions: if the 50% or more answers are correct\r\n $(\".score-item\").prepend(\"<h2>Отличная работа!</h2> Det tog dig \" + seconds + \" sekunder att göra klart quizet\");\r\n $('.score-container').css('background-color', 'green');\r\n } else { // Lose conditions: if correct answers are below 50%\r\n $(\".score-item\").prepend(\"<h2>Учись усердней!</h2> \" + seconds + \" sekunder att göra klart quizet\");\r\n $('.score-container').css('background-color', '#CD5C5C')\r\n }\r\n\r\n $('div.question-container, div.answer-container').hide();\r\n $('div.score-container').show();\r\n $(\"span.correct\").html(correctAnswer);\r\n $(\"span.wrong\").html(wrongAnswer);\r\n $(\"span.percent\").html(Math.floor(scorePercent) + '%');\r\n}", "title": "" }, { "docid": "99045799185d6d7e6525f7581c01cd43", "score": "0.67768973", "text": "function resetScore() {\n userScore = 0;\n compScore = 0;\n compScore_span.innerHTML = \"0\";\n userScore_span.innerHTML = \"0\";\n result_p.innerHTML = \"<p>Click & Play</p>\";\n}", "title": "" }, { "docid": "9498089ad4ec555f2ac550a3c01e6b79", "score": "0.6775947", "text": "function replay(){\n $('#reset').on('click', function(){\n reset();\n $('.triviaQuestions').removeClass('noShow')\n displayQuestions();\n $(\"#start\").addClass('noShow');\n $(\"#finalScore\").addClass('noShow');\n });\n }", "title": "" }, { "docid": "dcaa167423efbb93790a89c34be47fa1", "score": "0.6775471", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n return score;\n }", "title": "" }, { "docid": "dcaa167423efbb93790a89c34be47fa1", "score": "0.6775471", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n return score;\n }", "title": "" }, { "docid": "dcaa167423efbb93790a89c34be47fa1", "score": "0.6775471", "text": "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n score.append('You got ' + numCorrect + ' questions out of ' +\n questions.length + ' right!!!');\n return score;\n }", "title": "" }, { "docid": "028f95fb5f820cbdb48671490c383142", "score": "0.6774306", "text": "function showResult() {\n $(\"#questionScreen\").hide();\n $(\"#resultScreen\").show();\n\n if (score <= 1) {\n $('.modal__bg').removeClass('toggle');\n $('.modal__bg11').toggleClass('toggle');\n $(\".result__text\").text(\"Начальная стадия\");\n $(\".result__answer\").html(answers[0]);\n } else if (score > 1 && score <= 5) {\n $('.modal__bg').removeClass('toggle');\n $('.modal__bg22').toggleClass('toggle');\n $(\".result__text\").text(\"Начало 2 стадии целлюлита\");\n $(\".result__answer\").html(answers[1]);\n } else if (score > 5 && score <= 10) {\n $('.modal__bg').removeClass('toggle');\n $('.modal__bg33').toggleClass('toggle');\n $(\".result__text\").text(\"2 – начало 3 стадии целлюлита\");\n $(\".result__answer\").html(answers[2]);\n } else if (score > 10 && score <= 15) {\n $('.modal__bg').removeClass('toggle');\n $('.modal__bg44').toggleClass('toggle');\n $(\".result__text\").text(\"3-4 стадия целлюлита\");\n $(\".result__answer\").html(answers[3]);\n }\n} // *********************", "title": "" }, { "docid": "4b0ed46a3ab41bc09fb10e0c30ea8eb6", "score": "0.67739093", "text": "function inCorrectAnswerScreen(){\r\n //let q = questions[currentQuestion]; // 0 \r\n\r\n //let ca = q.correct;// 2\r\n //let displaya = q.answers[ca];\r\n $('.questionScreen').hide();\r\n $('.questionResultScreen').html(`\r\n <h2> Better Luck next time</h2><br>\r\n <p> Correct answer was: ${displaya} <br>\r\n <button type=\"button\" class=\"buttonToGetToNextQuestion\">Next Question</button>`);\r\n} //end of incorrectAnswerScreen", "title": "" }, { "docid": "99d7ee5905697cb92f4e60f5513989c1", "score": "0.6773499", "text": "function checkAnswer(answer) {\n\n if (answer == questions[runningQuestion].correct) {\n score++;\n rightOrWrong(true);\n userScore.innerHTML = \"Your Score: \" + score;\n // localStorage.setItem(\"score\",score);\n }\n else {\n incorrect++;\n rightOrWrong(false);\n }\n // if we want to reset the time after each question we can add here count = 0 ; \n\n if (runningQuestion < lastQuestion) {\n runningQuestion++;\n renderQuestion();\n }\n else {\n // end the quiz\n clearInterval(TIMER);\n scoreRender();\n }\n\n}", "title": "" }, { "docid": "b63d80e80957ec07abc368639c8292ef", "score": "0.6763733", "text": "function displayFeedBackCorrect()\n{\n $('.js-quiz-view').html(user_response_correct);\n score++;\n updateScoreDisplay();\n advanceToNextQuestion();\n}", "title": "" }, { "docid": "3c388dfaca97a6c2269f7cc7c4db9945", "score": "0.67634976", "text": "function showResults(){\n \n const answerContainers = quizContainer.querySelectorAll('.answers');\n \n let numCorrect = 0;\n\n myQuestions.forEach( \n (currentQuestion, questionNumber) => {\n\n const answerContainer = answerContainers[questionNumber];\n const selector = `input[name=question${questionNumber}]:checked`;\n const userAnswer = (answerContainer.querySelector(selector) || {}).value;\n \n // if answer is correct\n if(userAnswer === currentQuestion.correctAnswer){\n \n numCorrect++;\n }\n\n });\n\n // show number of correct answers out of total\n \n prompt(`You scored ${numCorrect} out of ${myQuestions.length}`, \"Please enter your initials\");\n \n }", "title": "" }, { "docid": "bcf3cd6d5bc2a824aa0070122568b58f", "score": "0.67620367", "text": "function showResult () {\n resetAnswerPage();\n $('#endGameMessage').html(messages.endGameMessage);\n $('#numCorrectAnswers').html('Correct Answers: '+ numCorrectAnswers);\n $('#numIncorrectAnswers').html('Incorrect Answers: '+numIncorrectAnswers);\n $('#numUnanswers').html('Unanswered: '+numUnanswers);\n $('#restartBtn').html('Start Over?');\n}", "title": "" }, { "docid": "4e8f794c97fca4593028c25f344140d9", "score": "0.6757432", "text": "function endGame() {\n\n //Goes through each of the questions\n for (let i = 0; i < 10; i++) {\n\n var thisResult = $('input[name=\"q'+i+'\"]:checked').val();\n\n //You can check the console log for which answers were correct or incorrect\n console.log(i + 1 +\". \" + thisResult)\n\n //totals the scores for the right, wrong, and unanswered\n if (thisResult === \"right\") {\n correct++;\n } else if (thisResult === \"wrong\") {\n incorrect++;\n } else {\n unanswered++;\n }\n }\n\n //clears the main container\n print.empty();\n \n //prints the results onto the screen\n print.append('<p> Answered Correctly: ' + correct + '</p>');\n print.append('<p> Answered Incorrectly: ' + incorrect + '</p>');\n print.append('<p> Left Unanswered: ' + unanswered + '</p>');\n }", "title": "" }, { "docid": "d4a766c4a4bc1623fc60fe70a997483f", "score": "0.67532927", "text": "function resetQuiz() {\n currentQuestion = 0;\n correctAnswers = 0;\n numAnswered = 0;\n numWrong = 0;\n count = 0\n}", "title": "" } ]
95552a15f72df350fe9f4d3d6d5813db
const input = document.getElementById('name'); const myCheckbox = document.getElementById('mycheckbox'); myCheckbox.checked = true;
[ { "docid": "166928e50444bba29d3aa3adecca5a31", "score": "0.0", "text": "function formSubmitted(e) {\n e.preventDefault();\n const nameForm = document.getElementById('name-form');\n const nameFormData = new FormData(nameForm);\n const firstName = nameFormData.get('firstname');\n console.log(firstName);\n console.log('form submitted');\n}", "title": "" } ]
[ { "docid": "d786b7fa5c2be225c5300d5181f0c76a", "score": "0.7946472", "text": "function sample2_6_2() {\n var element = document.getElementById('checkbox2');\n element.checked = true;\n}", "title": "" }, { "docid": "30886a8cb6b876e17bedb217d5e400b2", "score": "0.759867", "text": "function check(checked = false) {\n const cbs = document.querySelectorAll('input[name=\"hobbies\"]');\n cbs.forEach((cb) => {\n cb.checked = checked;\n });\n}", "title": "" }, { "docid": "5b8b0df5eaeacb68cb7e435b8ec649a8", "score": "0.74164337", "text": "function js_checkbox_switch(name)\n\t\t{\n\t\tdocument.form.elements[name].checked = !document.form.elements[name].checked;\n\t\t}", "title": "" }, { "docid": "0fada13240f7fa160f88910ce8b75618", "score": "0.73729414", "text": "function check(checked = true) {\r\n const cbs = document.querySelectorAll('input[name=\"row-check\"]');\r\n cbs.forEach((cb) => {\r\n cb.checked = checked;\r\n });\r\n}", "title": "" }, { "docid": "93b866732099655edbdc02023a81bd2c", "score": "0.7323732", "text": "function selectInput(versionId){\r\n\tvar check = document.createAttribute(\"checked\");\r\n \tcheck.nodeValue = \"checked\";\r\n \tif(document.getElementById(versionId).getAttribute(\"checked\") == \"checked\"){\r\n \tdocument.getElementById(versionId).removeAttributeNode(check);\r\n \t}\r\n \telse{\r\n\tdocument.getElementById(versionId).setAttributeNode(check);\r\n\t}\r\n}", "title": "" }, { "docid": "307bee961211ffcb90e26a4584fa41b4", "score": "0.72664607", "text": "function checkEm(toCheck) {\n document.getElementById(toCheck).checked = true;\n}", "title": "" }, { "docid": "33491c43e7b6d071ec38eef82560d5e9", "score": "0.71096885", "text": "static toggleCheckbox (elm) {\n const input = elm.querySelector('input');\n const checkbox = elm.querySelector('.checkbox');\n\n // Use of conditional toggle is not supported in IE, therefore add/remove is used.\n if (input.checked) {\n checkbox.classList.add('checked');\n } else {\n checkbox.classList.remove('checked');\n }\n }", "title": "" }, { "docid": "4a61375f11c1e6836cf2f5a13772e9c7", "score": "0.7080261", "text": "function js_checkboxen_alle(name)\n\t\t{\n\t\tfor (var x = 0; x < document.forms[0].elements.length; x++)\n\t\t\t{\n\t\t\tvar obj = document.forms[0].elements[x];\n\t\t\t\n\t\t\tif (obj.name != name)\n\t\t\t\tobj.checked = document.form.elements[name].checked;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "63c49faf1e5bf55618b69705a79a526c", "score": "0.7064338", "text": "function sample2_3_2() {\n var element = document.getElementById('checkbox');\n var checked = element.checked;\n console.log(checked);\n}", "title": "" }, { "docid": "60634e09f3396021776b2be6ab9ca9a6", "score": "0.705341", "text": "function forzarCheck(id) {\r\n\tdocument.getElementById(id).checked=true;\r\n}", "title": "" }, { "docid": "fccc8595a934cebc3780130178569682", "score": "0.70231426", "text": "function checkedUnchecked(input) {\n var recordInput = document.getElementById(input.id);\n !recordInput.checked ? recordInput.checked = true : recordInput.checked = false;\n}", "title": "" }, { "docid": "55eaeb77e6b484f18428d303322a80f7", "score": "0.69687444", "text": "function setMark(input,mark){\n var myinput = \"input[name = \"+\"'\"+input+\"'\"+\"]:checked\";\n document.getElementById(mark).innerHTML = document.querySelector(myinput).value;\n}", "title": "" }, { "docid": "a739ee62d4392ee1f9a0fe9ddcd2df93", "score": "0.6956473", "text": "function toggle_checkbox_value(checkbox_id,checked_value,unchecked_value) {\n var checkbox = document.getElementById(checkbox_id);\n //\n if (checkbox.checked) {\n checkbox.value = checked_value;\n }\n else {\n checkbox.value = unchecked_value;\n }\n}", "title": "" }, { "docid": "87d81b11a2a55532ad60bcff5ee54e57", "score": "0.6939915", "text": "function onlyOne(checkbox) {\n var checkboxes = document.getElementsByName('check');\n checkboxes.forEach((item) => {\n if (item !== checkbox) item.checked = false\n })\n}", "title": "" }, { "docid": "d674e21e054d44c4facacebe05d18626", "score": "0.69312143", "text": "function inputCheck(boolvar, idname) {\n return boolvar\n ? '<input type=\"checkbox\" id=\"' + idname + '\" value=\"' + idname + '\" checked=\"checked\"/>'\n : '<input type=\"checkbox\" id=\"' + idname + '\" value=\"' + idname + '\"/>';\n}", "title": "" }, { "docid": "74af427f6c3a889dff6441d36a65dec5", "score": "0.69012785", "text": "function checkboxToggle(element){\n var x = document.getElementById(element.name);\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "509461509fbe8097f2827ed69ee9f699", "score": "0.6901193", "text": "function marklist(id, name, state)\n{\n\tvar parent = document.getElementById(id);\n\tif (!parent)\n\t{\n\t\teval('parent = document.' + id);\n\t}\n\n\tif (!parent)\n\t{\n\t\treturn;\n\t}\n\n\tvar rb = parent.getElementsByTagName('input');\n\t\n\tfor (var r = 0; r < rb.length; r++)\n\t{\n\t\tif (rb[r].name.substr(0, name.length) == name)\n\t\t{\n\t\t\trb[r].checked = state;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef0d99cbd33f5bb098d05f692c78b943", "score": "0.68865013", "text": "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbox);\r\n}", "title": "" }, { "docid": "e0fa32767a2b78159bcfb3a6e7c0d500", "score": "0.68789846", "text": "function addressBooktextCheck() {\r\n if (this.querySelector('input').checked) {\r\n this.querySelector('input').checked = false;\r\n } else {\r\n this.querySelector('input').checked = true;\r\n }\r\n}", "title": "" }, { "docid": "3015a842d1bc7cab4b7898ae512f1f17", "score": "0.6873491", "text": "function checkboxChecked(input) {\n if (input.checked){\n return true;\n } return false;\n}", "title": "" }, { "docid": "e05a6226a8c9aab5e7dc08480c721018", "score": "0.6873169", "text": "function updateCheckBoxes() {\n const checkboxes = [];\n\n checkboxes.push(document.querySelector('#inspiration'));\n\n checkboxes.push(document.querySelector('#dss1'));\n checkboxes.push(document.querySelector('#dss2'));\n checkboxes.push(document.querySelector('#dss3'));\n\n checkboxes.push(document.querySelector('#dsf1'));\n checkboxes.push(document.querySelector('#dsf2'));\n checkboxes.push(document.querySelector('#dsf3'));\n\n checkboxes.forEach((ele) => {\n if (ele.value === 'true') {\n ele.setAttribute('checked', 'checked');\n } else {\n ele.removeAttribute('checked');\n }\n });\n}", "title": "" }, { "docid": "c3388445a20aa399bd15c29e84434c31", "score": "0.68330026", "text": "function checkMe(elemID){\n\tif($(elemID).checked){\n\t\t$(elemID).checked=false;\n\t}else{\n\t\t$(elemID).checked=true;\n\t}\n}", "title": "" }, { "docid": "72290310f2f166b5b0ad706da078f05e", "score": "0.67986906", "text": "function checkedInput() {\n var checkbox = document.documentElement.querySelectorAll('input[type=\"checkbox\"]');\n\n checkbox.forEach(function (item) {\n item.addEventListener('click', function () {\n if (this.checked) {\n this.parentElement.classList.add('active');\n } else {\n this.parentElement.classList.remove('active');\n }\n });\n });\n}", "title": "" }, { "docid": "5a31ae551fa2744618b39d9e37b1e672", "score": "0.67395675", "text": "function onAircraftClick(cb)\n{\n var aircrafts = document.getElementsByName('aircraft');\n\t \n for (var i = 0; i < aircrafts.length; i++) {\n \tif (aircrafts[i].type == \"checkbox\") {\n \t\taircrafts[i].checked = cb.checked;\n \t}\n }\n}", "title": "" }, { "docid": "0267d963501227e61d474b95a90612dd", "score": "0.67229337", "text": "function checkBoxStateChanged(id) {\n \n if (document.getElementById(id).getAttribute('checked')) {\n \n document.getElementById(id).removeAttribute('checked')\n }\n else {\n \n document.getElementById(id).setAttribute('checked', true);\n }\n}", "title": "" }, { "docid": "44de62f1f44b565166e2fde1597ed977", "score": "0.66979307", "text": "set checked(v) {\n this.input.checked = v;\n }", "title": "" }, { "docid": "3a1ccda969b36daacd192cdc7e76553b", "score": "0.6685636", "text": "function toggleCheck(event, name) {\n event.preventDefault();\n var trackNode = document.getElementsByName(name)[0];\n var checked = trackNode.checked;\n trackNode.checked = !checked;\n }", "title": "" }, { "docid": "c0c1af78bae0e00893d38926b7ee4bf6", "score": "0.66835797", "text": "function toggleInput(oid)\n{\n var elem = document.getElementById(oid);\n if (elem)\n {\n elem.value = (elem.value == 1) ? 0 : 1;\n } \n}", "title": "" }, { "docid": "82ac05b89bda06f9bb83ee117c1cff8e", "score": "0.66775143", "text": "function simplecheckbox(name, callback){\n var $chk = $(\"<input type='checkbox' name='\"+name+\"' />\");\n $chk[0].onchange = callback;\n return $chk;\n }", "title": "" }, { "docid": "59639cd942d298f945cef86f78249a67", "score": "0.66746134", "text": "function toggleChoice(elementId) {\r\n var element = document.getElementById(elementId);\r\n if (element.checked) {\r\n element.checked = false;\r\n } else {\r\n element.checked = true;\r\n }\r\n}", "title": "" }, { "docid": "c3aa3d51ba3c84e597365a9ed38a4940", "score": "0.66702276", "text": "function checkall(obj, name) {\n\t\tvar boxs = document.getElementsByName(name);\n\t\tfor (var i = 0; i < boxs.length; i++) {\n\t\t\tboxs[i].checked = obj.checked;\n\t\t}\n\t}", "title": "" }, { "docid": "7962d5a0138a1e5c6e8fa0e17328071a", "score": "0.6653372", "text": "function saveCheckbox(name) {\n\tlocalStorage[name] = ($('#' + name).is(':checked') ? 'true' : 'false');\n}", "title": "" }, { "docid": "f14049315f3efdf025e49a84d8df66eb", "score": "0.6641109", "text": "function toggleCheckBoxes(maincheckbox, parentId) {\n \"use strict\";\n var isChecked = maincheckbox.checked;\n var parentElement = document.getElementById(parentId);\n var elements = parentElement.getElementsByTagName(\"input\");\n for (var i = 0; i < elements.length; i++) {\n if (elements[i].type = \"checkbox\") {\n elements[i].checked = isChecked;\n }\n }\n}", "title": "" }, { "docid": "4b3801b5c2604d15bd799d2a06030e1e", "score": "0.6639217", "text": "function change(bool, num){\n const input = num > 9? document.getElementById(`${num}`) : document.getElementById(`0${num}`)\n input.checked = bool\n return bool\n}", "title": "" }, { "docid": "e2f0a2c19a6c4434c844c6cc7ceea57b", "score": "0.6634829", "text": "function checar_todos() {\n\tvar asign = document.getElementsByName('asignadas')\n\tfor (var i = 0; i < asign.length; i++) {\n\t\tasign[i].checked = true\n\t}\n}", "title": "" }, { "docid": "1258774b235e96ae399e5a3cdb0ecbc3", "score": "0.6605456", "text": "function toggleChoice(elementId) {\n var element = document.getElementById(elementId);\n if (element.checked) {\n element.checked = false;\n } else {\n element.checked = true;\n }\n}", "title": "" }, { "docid": "cae925efb1eeae3e868ca3cfe7e24cec", "score": "0.65934294", "text": "function sample2_6_3() {\n var element = document.getElementById('checkbox2');\n element.disabled = true;\n}", "title": "" }, { "docid": "52e6c838d9a0ad637067a41024dcfd09", "score": "0.6589578", "text": "function cb_checkbox() {\n // Get list of all checkboxes\n var hListCheck = document.querySelectorAll( 'input[name$=\"check\"]' );\n\n for( var h1 of hListCheck ){\n // Get corresponding audio handle\n var strList = h1.name.split( \"_\" );\n songName = strList[0];\n lab1 = strList[1];\n var hAudio = document.getElementById( songName.concat( \"_\", lab1 ));\n\n // Set volume\n if( h1.checked == true ){\n hAudio.volume = volumeOn;\n }\n else{\n hAudio.volume = volumeOff;\n }\n }\n }", "title": "" }, { "docid": "092dc59cca5851b9864628a47a477b64", "score": "0.65883005", "text": "function qll_utility_boxchecked()\r\n{\r\n\t$(\"#remember\").attr('checked','checked');\r\n}", "title": "" }, { "docid": "dacca26a9d23f97a96148adf99940438", "score": "0.65726703", "text": "function toggleAll(name) {\n//name est le debut du nom des cases a cocher \n//exp: <input type=\"checkbox\" name=\"cb_act_<?php echo $oAct->get_id(); ?>\" ...>\n// name est egal a 'cb_act_'\n//'user-all' est le nom de la case qui permet de cocher ttes les autres \n\n\tvar inputs\t= document.getElementsByTagName('input');\n\tvar count\t= inputs.length;\n\tfor (i = 0; i < count; i++) {\n\t\n\t\t_input = inputs.item(i);\n\t\tif (_input.type == 'checkbox' && _input.id.indexOf(name) != -1) {\n\t\t\n\t\t\t_input.checked = document.getElementById('user-all').checked;\n\n\t\t\n\t\t}\n\t\t\n\t}\n \n}", "title": "" }, { "docid": "bd7987f8eb042ae6eef794a26cf79547", "score": "0.6565395", "text": "function chbox() {\n let v;\n if (document.getElementById(`${i}`).checked == true) {v=false} else {v=true};\n for (let i=15;i<24;i++)\n document.getElementById(`${i}`).checked = v; }", "title": "" }, { "docid": "c5859a5b0ac97ef1b02984a41b98eb59", "score": "0.65587264", "text": "function checkbox() {\n let newCheckbox = document.createElement(\"input\");\n newCheckbox.type = \"checkbox\";\n newCheckbox.id = \"id\" + count;\n newCheckbox.style.marginRight = \"10px\";\n\n return newCheckbox;\n}", "title": "" }, { "docid": "b21838d337cbaf96c765e28c4132de80", "score": "0.6554224", "text": "function checkbox(bind, el, param, value) {\n var attr = {type: 'checkbox', name: param.signal};\n if (value) attr.checked = true;\n var node = Object(__WEBPACK_IMPORTED_MODULE_0__element__[\"a\" /* default */])('input', attr);\n\n el.appendChild(node);\n\n node.addEventListener('change', function() {\n bind.update(node.checked);\n });\n\n bind.elements = [node];\n bind.set = function(value) { node.checked = !!value || null; }\n}", "title": "" }, { "docid": "a1e64e317071640ec01aabfc0f6d868e", "score": "0.65299237", "text": "function switchSingle(id, state) {\n let checkBox = document.getElementById(id);\n checkBox.checked = state;\n switch (state) {\n case true:\n checkBox.parentElement.classList.add(\"checked\");\n checkBox.parentElement.parentElement.classList.add(\"active\");\n break;\n case false:\n checkBox.parentElement.classList.remove(\"checked\");\n checkBox.parentElement.parentElement.parentElement.classList.remove(\"active\");\n break;\n }\n}", "title": "" }, { "docid": "255aabc7b04df4fae2632d0a80bee1a9", "score": "0.6521779", "text": "function checkedInput(chk, dis) {\n for (let checkbox of checkboxElement) {\n // typeof(chk) === \"boolean\" && (chk === true || chk === false\n // Tester le type avant\n if (chk === true || chk === false) {\n checkbox.checked = chk;\n }\n checkbox.disabled = dis;\n let inputCheckIcon = checkbox.nextElementSibling.childNodes[1];\n if (dis) {\n inputCheckIcon.classList.add('modal__checkicon--disabled');\n } else {\n inputCheckIcon.classList.remove('modal__checkicon--disabled');\n }\n }\n}", "title": "" }, { "docid": "bc8a91f28c30585b282a09c15cad2dad", "score": "0.6509129", "text": "function CheckboxSelect(position){\n var check = position.checked ;\n console.log(position);\n if(check == true){\n position.value = \"Yes\";\n }else{\n position.value = \"No\";\n }\n}", "title": "" }, { "docid": "cda396fd6780512d018416c6de0bd066", "score": "0.6493706", "text": "function ui_setChecked(id_ckbox){\n\tvar _ckbox = ui_getObjById(id_ckbox);\n\t_ckbox.checked = true;\n}", "title": "" }, { "docid": "39abbc391359380a5a35646b72bfdfdd", "score": "0.6492071", "text": "function checkID(){\n opt.target.querySelector(\"input[data-id='\" + cfg.id + \"']\").checked = cfg.checked;\n }", "title": "" }, { "docid": "cf9aba74d92c19c64a97370d07081a12", "score": "0.64843404", "text": "function opcion (){\nif (document.getElementById(\"male\").checked = true) {\n document.getElementById(\"female\").checked = false;\n}\nelse {\n document.getElementById(\"male\").checked = false;\n}}", "title": "" }, { "docid": "550bd54b06a1eb4375150556e2a93c51", "score": "0.64721155", "text": "function changeVegetarianAdults() {\n let inputVegAdults\n\n // if the checkbox is active the input will show up, otherwise the input will be hidden\n if (document.getElementById(\"vegetarian-adults\").checked) {\n inputVegAdults = document.getElementById(\"vegetarian-adults-div\")\n inputVegAdults.innerHTML =\n `<p><label for=\"number-vegetarian-adults\">\n Quantos?<input class=\"number-input\" id=\"number-vegetarian-adults\" type=\"number\" placeholder=\"Adultos vegetarianos\">\n </label></p>`\n } else {\n inputVegAdults = document.getElementById(\"vegetarian-adults-div\")\n inputVegAdults.innerHTML = `<div id=\"vegetarian-adults-div\"></div>`\n }\n}", "title": "" }, { "docid": "00356b576d7bda888d21bbf7e0e71bee", "score": "0.6453867", "text": "function checkbox(bind, el, param, value) {\n var attr = {type: 'checkbox', name: param.signal};\n if (value) attr.checked = true;\n var node = (0,_element__WEBPACK_IMPORTED_MODULE_0__.default)('input', attr);\n\n el.appendChild(node);\n\n node.addEventListener('change', function() {\n bind.update(node.checked);\n });\n\n bind.elements = [node];\n bind.set = function(value) { node.checked = !!value || null; }\n}", "title": "" }, { "docid": "5ad7e3a3e925457ea2c7e8ee5376b6fa", "score": "0.64406425", "text": "function checkAllInElement(elementId, checked) {\r\n\tvar element = document.getElementById(elementId); \r\n if (element == null) {\r\n if (debug) alert(\"table [\" + elementId + \"] not found\");\r\n return;\r\n }\r\n \r\n var inputs = element.getElementsByTagName(\"input\");\r\n if (inputs == null) {\r\n if (debug) alert(\"no inputs found in this element\" + elementId + \".\");\r\n return;\r\n }\r\n for (i = 0; i < inputs.length; i++) {\r\n \tif (inputs[i].getAttribute(\"type\") == \"checkbox\") {\r\n \t\tif (!inputs[i].disabled) {\r\n\t \t\tif (checked) {\r\n\t\t\t\t\tinputs[i].value='true';\r\n\t\t \t\t/*inputs[i].checked = 'checked';*/\r\n\t\t \t\tinputs[i].checked = true;\r\n\t \t\t} else {\r\n\t \t\t\tinputs[i].value='false';\r\n\t\t\t\t\tinputs[i].checked = false;\r\n\t \t\t}\r\n \t\t}\r\n \t}\r\n }\r\n \r\n}", "title": "" }, { "docid": "7742442ae51687e67e699e6c1bbc2537", "score": "0.6431002", "text": "function toggleCheckBox (evt){\r\n\tlet target = evt.target;\r\n\tlet targetSet = (value) => target.setAttribute(\"aria-checked\", value);\r\n\ttoggled = (target.getAttribute(\"aria-checked\") === \"true\") ? targetSet(false) : targetSet(true);\r\n\ttarget.parentNode.querySelector(\"p\").classList.toggle(\"done\");\r\n}", "title": "" }, { "docid": "59f7f494473b45d6abe7c72e0692d545", "score": "0.6430992", "text": "function toggleCheckBoxes(checkboxName)\n{\n\tvar i = 0;\n\n\tvar checkBox;\n\n\tif(checkboxName == document.buildform.build) {\n\t\tcheckBox = document.buildform.linux;\n\t} \n\n\t// If more than one build is selected\n\tif(checkboxName.length)\n\t{\n\t\tfor(i = 0; i < checkboxName.length; i++)\n\t\t{\n\t\t\tcheckboxName[i].checked = checkBox.checked;\n\t\t}\n\t}\n\t// Only one build is selected\n\telse\n\t{\n\t\tcheckboxName.checked = checkBox.checked;\n\t}\n\n}", "title": "" }, { "docid": "907bc4c4da9ec7a2589a33346b187a0a", "score": "0.6419901", "text": "function passValue(inp){\n document.getElementById(inp.dataset.target).value=inp.value;\n document.getElementById(inp.dataset.target).checked = true;\n}", "title": "" }, { "docid": "e52d7316d3922e80f39b9540b152ac9e", "score": "0.641376", "text": "function isCheckedInput(input) {\n return input.checked;\n}", "title": "" }, { "docid": "82f6d5ba4ba2eaddaba6c02024f80f43", "score": "0.6383568", "text": "function crearCheckBox(option) {\n let check = document.createElement(\"INPUT\");\n check.type = \"checkbox\";\n check.id = option;\n return check;\n}", "title": "" }, { "docid": "995ef769ee8a7d5bc6bd37560df20b7e", "score": "0.638323", "text": "function test() {\n\tconsole.log(document.getElementById(\"smallCap\").checked);\n}", "title": "" }, { "docid": "912a0812621f0b94fdd894a4539e6cd3", "score": "0.63694084", "text": "function setSelected(formName, inputName, val)\n{\n dml = document.forms[formName];\n len = dml.elements.length;\n var i = 0;\n for (i = 0; i < len; i++)\n {\n if (dml.elements[i].name == inputName)\n {\n dml.elements[i].checked = val;\n }\n }\n}", "title": "" }, { "docid": "8e053160f5db9be68a315e7a4f9b6db0", "score": "0.6369176", "text": "function SpaceToggle() {\n return (\n <input type=\"checkbox\" name=\"name\" id=\"id\" onClick={() => console.log(\"switch!\")}/>\n)\n}", "title": "" }, { "docid": "dbbb364cb8587cc90f0fa5bb0af748f7", "score": "0.6365314", "text": "function mixPin(){\r\n var checkbox = document.getElementById('mix-box');\r\n\r\n if (checkbox.checked == true){\r\n checkbox.checked = false;\r\n } else {\r\n checkbox.checked = true;\r\n };\r\n}", "title": "" }, { "docid": "860898c5bf09594a462ec68717a9a826", "score": "0.63537014", "text": "function toggle(checkboxID, toggleID) {\n var checkbox = document.getElementById(checkboxID);\n var toggle = document.getElementById(toggleID);\n updateToggle = toggle.disabled = !checkbox.checked;\n}", "title": "" }, { "docid": "09821c8c7543d0f7391064341e162c28", "score": "0.6349733", "text": "function createCheckBox(rootNode) {\n var x = document.createElement(\"INPUT\");\n x.setAttribute(\"type\", \"checkbox\");\n rootNode.appendChild(x);\n}", "title": "" }, { "docid": "96e4bba6769406e1f000e4eec6236d3b", "score": "0.63458604", "text": "function selChkTodos(form, chkNombre, boo) {\r\n\tfor(i=0; n=form.elements[i]; i++) \r\n\t\tif (n.type == \"checkbox\" && n.name == chkNombre) n.checked = boo;\r\n}", "title": "" }, { "docid": "be84bd00ff07d37ee4e8e049f90b4cb9", "score": "0.63190365", "text": "function cbChange(obj) {\nvar instate=(obj.checked);\n var cbs = document.getElementsByClassName(\"cb\");\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].checked = false;\n }\n if(instate)obj.checked = true;\n}", "title": "" }, { "docid": "1097225f4693d6ec3ef048651f4e0611", "score": "0.63077146", "text": "function save() {\t\n\tvar checkbox = document.getElementById(\"checkbox\");\n localStorage.setItem(\"checkbox\", checkbox.checked);\t\n}", "title": "" }, { "docid": "6977bf5ea2a2d5e317479ece0c1cbb58", "score": "0.62996286", "text": "function checkbox(bind, el, param, value) {\n var attr = {type: 'checkbox', name: param.signal};\n if (value) attr.checked = true;\n var node = element$1('input', attr);\n\n el.appendChild(node);\n\n node.addEventListener('change', function() {\n bind.update(node.checked);\n });\n\n bind.elements = [node];\n bind.set = function(value) { node.checked = !!value || null; };\n }", "title": "" }, { "docid": "53d4daf26ecb6bb20174f473c001e37c", "score": "0.6298017", "text": "function checkAll(ele) {\r\n var checkboxes = document.getElementsByTagName('input');\r\n if (ele.checked) {\r\n for (var i = 0; i < checkboxes.length; i++) {\r\n if (checkboxes[i].type == 'checkbox') {\r\n checkboxes[i].checked = true;\r\n }\r\n }\r\n } else {\r\n for (var i = 0; i < checkboxes.length; i++) {\r\n // console.log(i)\r\n if (checkboxes[i].type == 'checkbox') {\r\n checkboxes[i].checked = false;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "167228a6888bad1e36b5613a5bb09a36", "score": "0.6297602", "text": "function setChecked(id, checked) {\n elem = document.getElementById(id);\n if( elem ) {\n if( checked ) {\n elem.setAttribute(\"checked\", true);\n\n // It takes some time for the system to restart properly.\n setTimeout(function() {\n eyecanOptions.onTabChange(elem);\n }, 1000);\n }\n else {\n elem.removeAttribute(\"checked\");\n }\n }\n }", "title": "" }, { "docid": "5f68a7047c69bf72fa047062f223d981", "score": "0.6297457", "text": "clickCheckbox(e) {\n if (!e.target.getAttribute('click') || e.target.getAttribute('click') === 'false') {\n e.target.setAttribute('click', true);\n e.target.checked = true;\n } else {\n e.target.setAttribute('click', false);\n e.target.checked = false;\n }\n }", "title": "" }, { "docid": "ce3ec2403bd748e1c62c3fee90ecb6b1", "score": "0.62773263", "text": "function loadCustomCheckbox() {\n const items = document.getElementById(\"items-checkbox\");\n for (let i = 0; i < beverages.length; i++) {\n const b = beverages[i];\n const element = `\n <div class=\"ck-button\">\n <label class=\"ck-button-checked\">\n <input id=\"cb${i + 1}\" type=\"checkbox\" value=\"${b.Name}\" onclick=\"onClickCheckbox(${i})\">\n <span>${b.Name} Rp. ${b.Price}</span>\n </label>\n </div>\n `;\n\n items.innerHTML += element;\n }\n}", "title": "" }, { "docid": "daa563d7f715924607b69b68e4804706", "score": "0.6248461", "text": "function onStagelistToBeChecked(iss){\n if(iss == 'on')\n {\n document.getElementById(\"onstagelist\").checked = 'checked';\n }\n}", "title": "" }, { "docid": "359e3867f65bbf0effc0004a43cf21c8", "score": "0.6245853", "text": "function reactToCheckbox() {\n\tif(student.checked) {\n\t \t$(\"#student_info\").removeClass(\"hidden\").hide().slideDown();\n\t \tdocument.getElementById(\"schoolname\").required = true;\n\t document.getElementById(\"grade\").required = true;\n\t}\n\telse {\n\t\t$(\"#student_info\").slideUp();\n\t\tdocument.getElementById(\"schoolname\").required = false;\n\t document.getElementById(\"grade\").required = false;\n\t}\n}", "title": "" }, { "docid": "f5fb228a7245a56db67e2dbb3d516e4a", "score": "0.6225475", "text": "function checkID() {\n\t\t\t\topt.target.querySelector(\"input[data-id='\" + cfg.id + \"']\").checked = cfg.checked;\n\t\t\t}", "title": "" }, { "docid": "3e26a6ac5e0f17e48d9e0ebc17b73269", "score": "0.6225277", "text": "function toggleme(master,one){\n var all = document.getElementsByClassName(one);\n for(var i=0; i < all.length; i++){\n did = document.getElementById(all[i].id);\n did.checked = master.checked;\n }\n }", "title": "" }, { "docid": "6969c3c5565e3f0576dac72398d2a9a5", "score": "0.6221651", "text": "function ui_toggleChecked(id_ckbox){\n\tvar _ckbox = ui_getObjById(id_ckbox);\n\t_ckbox.checked = !_ckbox.checked;\n}", "title": "" }, { "docid": "8dc6d9ec5f8fb497ec1305996e640123", "score": "0.62212497", "text": "function checkObject(obj){\n obj.checked = true;\n}", "title": "" }, { "docid": "009d40baafdac0840e84d670ae9a589f", "score": "0.6221165", "text": "function anyCheckbox() {\n let inputElements = document.getElementsByTagName(\"input\");\n //console.log(inputElements);\n for (let i = 0; i < inputElements.length; i++)\n if (inputElements[i].type == \"checkbox\")\n if (inputElements[i].checked)\n return true;\n return false;\n}", "title": "" }, { "docid": "54eca01fad2c730122a291e5848a0647", "score": "0.6217983", "text": "function isCorrectToggle(element) {\n let checkbox = element.querySelector(\"#id_is_correct\");\n if (element.classList.contains('active')) {\n element.classList.remove('active');\n checkbox.value = \"false\";\n } else {\n element.classList.add('active');\n checkbox.value = \"true\";\n }\n}", "title": "" }, { "docid": "be40fdfce1272fa34ba27c3f4fe135b8", "score": "0.6216884", "text": "function chg_checkbox_posisi(){\n var id = \"#\"+tmp_id_posisi;\n console.log(id);\n $(id).prop('checked', true);\n}", "title": "" }, { "docid": "e589db3765c8f885d4bc6bd8e7aa8b5e", "score": "0.62122905", "text": "function myFunction() {\n var checkBox = document.getElementById(\"myCheck\");\n var text = document.getElementById(\"text\");\n if (checkBox.checked == true) {\n text.style.display = \"block\";\n } else {\n text.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "6beedc964571abfa262661f44639980b", "score": "0.62121326", "text": "function checkall() {\n var bnRA = document.getElementById(\"bnRA\")\n var boxes= document.getElementsByName(\"checkmsg\")\n if(document.getElementById(\"checkall\").checked) {\n bnRA.setAttribute(\"style\",\"display:display\")\n for (let i = 0; i < boxes.length; i++) {\n boxes[i].checked = true\n }\n }else{\n bnRA.setAttribute(\"style\",\"display:none\")\n for (let i = 0; i < boxes.length; i++) {\n boxes[i].checked = false\n }\n }\n}", "title": "" }, { "docid": "fa6c8816fe42fb6da74789095ad0fa8d", "score": "0.6208222", "text": "function CheckboxFunction() {\n var checkBox = document.getElementById(\"checkActive\");\n \n if (checkBox.checked == true) {\n //Model.SelectedListItem.Active=true;\n\n console.log(checkBox.checked);\n } else {\n // Model.SelectedListItem.Active=false;\n }\n \n}", "title": "" }, { "docid": "815219b01416ebfe730162e136e79674", "score": "0.62023735", "text": "function addCheck(){\n check = document.createElement(\"input\");\n check.type = \"checkbox\";\n check.className = classNames[\"TODO_CHECKBOX\"];\n check.setAttribute(\"onClick\",\"checkChecked(event)\");\n return check;\n}", "title": "" }, { "docid": "83b92cac23253b17722f59ce0e4dc106", "score": "0.62018454", "text": "function toggleCheckbox(element, checked) {\n element.checked = checked;\n\n if (checked === true) {\n element.closest('tr').classList.add('selected');\n } else {\n element.closest('tr').classList.remove('selected');\n\n const tableSelectAllCheckboxes = element.closest('table').querySelectorAll(TABLE_SELECT_ALL_CLASS);\n\n Array.from(tableSelectAllCheckboxes).forEach(allCheckbox => {\n // remove checked stated\n allCheckbox.checked = false;\n allCheckbox.classList.remove('all-selected');\n });\n }\n}", "title": "" }, { "docid": "8ad8f228b60e57eb578e487e7c2f2092", "score": "0.61930233", "text": "function onCheckboxClick( input ) {\n var assignmentTaskId = parseInt($(input).attr('data-assignment-task'));\n var studentId = parseInt($(input).attr('data-student'));\n\n var checked = false;\n if( $(input).is(':checked') )\n checked = true;\n\n socket.emit(\"studentAssignmentTaskEvent\", {\n \"studentId\": studentId,\n \"assignmentTaskId\": assignmentTaskId,\n \"eventType\": \"finishedTask\",\n \"name\": assignmentTaskId,\n \"data\": checked\n });\n\n if($(\"input[type='checkbox']:checked\").length == $(\"input[type='checkbox']\").length ) {\n $(\"#assignmentCompleteId\").removeClass('uk-hidden');\n }\n else {\n $(\"#assignmentCompleteId\").addClass('uk-hidden');\n }\n}", "title": "" }, { "docid": "3003d2bfbec774be54fbcace368d584a", "score": "0.61915815", "text": "handleCheckboxInput(e){\n this.setState({ switch_checked: e.target.checked });\n }", "title": "" }, { "docid": "5855428a6f7b6fa23c52fbae1712e86a", "score": "0.6190305", "text": "writeValue(value) {\n this.setProperty('checked', value);\n }", "title": "" }, { "docid": "4121803adfd62a1bf5e4641709c1a462", "score": "0.61881095", "text": "function fechaMenu() {\n document.querySelector(\".check_input\").checked = false;\n}", "title": "" }, { "docid": "d72ef351cb4973cfd832c7b1fccf46b6", "score": "0.6185976", "text": "function toggleRadio(elementId, index) {\r\n var element = document.getElementsByName(elementId)[index];\r\n element.checked = true;\r\n}", "title": "" }, { "docid": "c717a7d6545e1c0edb920639074b8f45", "score": "0.6178959", "text": "function checkButton() {\r\n\ttrace(\"checkButton()\");\r\n\tvar checkbox=document.getElementById(\"checkall\"); \r\n\tif (checkbox.checked==true) {\r\n\t\tfor (var i=0; i<eLinks.length; i++) {\r\n\t\t\tdocument.getElementById('l'+i).checked=true;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfor (var i=0; i<eLinks.length; i++) {\r\n\t\t\tdocument.getElementById('l'+i).checked=false;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "bece88063e1e2fc402e3e231e4d4f11e", "score": "0.61769485", "text": "function toggleInput(id, map) {\n document.getElementById(id).addEventListener(\"change\", function (e) {\n map.setLayoutProperty(\n id,\n \"visibility\",\n e.target.checked ? \"visible\" : \"none\"\n );\n });\n}", "title": "" }, { "docid": "ab6394ed55481045a1d0a6b2155f3aef", "score": "0.61738956", "text": "function save_checkbox(id){\n\nvar checkbox_status = document.getElementById(id).checked;\n\n if(window.localStorage){//if localStorage exists\n window.localStorage.clear('checked_status');\n window.localStorage.setItem('checked_status', checkbox_status);\n console.log('Checkbox has been set to '+ checkbox_status);\n }\n}", "title": "" }, { "docid": "e94848b94492f067230d9d4261f90538", "score": "0.6170802", "text": "function onClickWords() {\n document.getElementById('byWords').checked = true;\n document.getElementById('byChars').checked = false;\n}", "title": "" }, { "docid": "ec3f5dee2f335aa7c66c4a59e9548492", "score": "0.6150679", "text": "function checkCheckbox(id_d,message)\r\n{\r\n\tif(document.getElementById(id_d).checked)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\ttakeCareOfMsg(message);\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "532c473884b5cfafb2333d4860450abb", "score": "0.6149668", "text": "function ckClick(ck) {\n var tbl = document.getElementById('tblPerson');\n var boxes = tbl.getElementsByTagName('input');\n // first unchecked ckAll\n if (!ck.checked)\n document.getElementById('ckAll').checked = \"\";\n else\n for (var i = 1; i < boxes.length; ++i)\n if (boxes[i].checked )\n continue;\n else\n break;\n\n if (i == boxes.length)\n document.getElementById('ckAll').checked = \"checked\";\n\n}", "title": "" }, { "docid": "20ea5128f52c5f850bbc4e64c2a5a424", "score": "0.61418116", "text": "function check_wilayahPeredaran_1() {\n if(document.getElementById('wilayahPeredaran_1').checked) {\n document.getElementById('hidden_wilayahPeredaran_1').style.display=\"block\";\n } else {\n document.getElementById('hidden_wilayahPeredaran_1').style.display=\"none\";\n document.getElementById('hidden_wilayahPeredaran_1').getElementsByTagName('input')[0].value=null;\n } \n}", "title": "" }, { "docid": "3c3d9afcb4ea86e7784646b12e18df28", "score": "0.6134287", "text": "function editOption(){\r\n var inputCheck=document.querySelectorAll('#customCheck1');\r\n for(var i=0;i<inputCheck.length;i++){\r\n inputCheck[i].checked=false;\r\n inputCheck[i].disabled=false;\r\n }\r\n}", "title": "" }, { "docid": "cc9e2b7e7923557d4ad8a0af3b5c4482", "score": "0.61245054", "text": "function indicateChecked() {\r\n\t\t\tcheckbox.checked = true;\r\n\t\t\ttaskElement.classList.add(\"checked\");\r\n\t\t\ttaskElement.classList.add(\"crossout\");\r\n\t\t}", "title": "" }, { "docid": "c2b743120ad8a5bc870ce3b8965004b1", "score": "0.61242", "text": "function CheckBox(name, hC) {\n this.name = name;\n this.id = '#' + name;\n this.value = (localStorage[name] == 'true');\n this.init(hC);\n}", "title": "" }, { "docid": "2bd1736898aec17338c8a5e773ac8554", "score": "0.61132866", "text": "function checkedAll()\n\t{\n\t \t var pollchecks = document.getElementsByTagName(\"INPUT\");\n\t\t var _return = false;\t \n\t\t for (var i = 0; i < pollchecks.length; i++)\n\t\t {\t\t\t\n\t\t\tif(pollchecks[i].type == \"checkbox\")\n\t\t\t{\n\t\t\t\t pollchecks[i].checked = true ;\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t\t \n\t}", "title": "" } ]
15a6e94220de260720f731514407b625
If game is won(+15points) then this will execute
[ { "docid": "3c9d5fc81609287906ba4a2a4b4cd3a6", "score": "0.0", "text": "function showReward() {\n var unlockReward = document.getElementById(\"unlockCv\"); //final reward/countdown\n /* Declaration of all the images hidden */\n var unlockImages1 = document.getElementById(\"locked_images1\");\n var unlockImages2 = document.getElementById(\"locked_images2\");\n var unlockImages3 = document.getElementById(\"locked_images3\");\n var unlockImages4 = document.getElementById(\"locked_images4\");\n var unlockImages5 = document.getElementById(\"locked_images5\");\n var unlockImages6 = document.getElementById(\"locked_images6\");\n\n if (score == 3) {\n unlockImages1.style.display = \"inline-block\";\n pipeSpawn = 180;\n ringPoint.play();\n }\n if (score == 5) {\n unlockImages2.style.display = \"inline-block\";\n ringPoint.play();\n }\n if (score == 7) {\n pipeSpawn = 130;\n unlockImages3.style.display = \"inline-block\";\n ringPoint.play();\n }\n if (score == 9) {\n unlockImages4.style.display = \"inline-block\";\n ringPoint.play();\n }\n if (score == 11) {\n pipeSpawn = 80;\n unlockImages5.style.display = \"inline-block\";\n ringPoint.play();\n }\n if (score == 13) {\n unlockImages6.style.display = \"inline-block\";\n ringPoint.play();\n }\n if (score == 15) {\n newPlayer.won = true;\n pipeSpawn = 45;\n window.document.getElementById(\"winscreen\").style.display = \"block\";\n unlockReward.style.display = \"Block\";\n gameWinSound.play(); // game winning sound after getting 15\n document.querySelector(\"h2\").innerHTML =\n \"Bravo vous avez gagné!!! Cliquez sur le cadenas pour acceder à mon CV\";\n playerWon = true;\n pauseScreen();\n }\n}", "title": "" } ]
[ { "docid": "b3d665b802a3e94f9c2ea96e243bf8a4", "score": "0.71640784", "text": "function winGame(player) {\n match.pointWonBy(player); // 15\n match.pointWonBy(player); // 30\n match.pointWonBy(player); // 40\n match.pointWonBy(player); // win\n}", "title": "" }, { "docid": "c4fd557600c2cb0b21ff2cbc6643530d", "score": "0.6762015", "text": "function experiencePoints() {\r\n if (winBattle()) {\r\n return 10;\r\n } else {\r\n return 1;\r\n }\r\n}", "title": "" }, { "docid": "b8076b71cf09a7746fbb93e534e03d57", "score": "0.6756873", "text": "function checkPoint() {\n if (userScore > targetScore) {\n losses ++;\n // if user value is larger than target value then game add +1 to losses and restarts\n $(\"#lost\").html(losses); \n restart();\n } else if (targetScore === userScore) {\n wins ++; \n // if user value is equal to target value then game add +1 to wins and restarts\n $(\"#won\").html(wins);\n restart();\n } \n \n}", "title": "" }, { "docid": "23a3d8e56c9971b3fdd1fc255e9031cb", "score": "0.67272407", "text": "function experiencePoints1() {\r\n let result = (winBattle() ? 10 : 1);\r\n return result;\r\n}", "title": "" }, { "docid": "d5360fbc9c5c0baab0f5c838fd3bce74", "score": "0.6694239", "text": "function hit(){\n const hand = promiseHand.call(player);\n\n hand.then(playerTotal => {\n setTimeout(()=> {\n if (playerTotal > 21) return endGame(0);\n }, waitForAlertMs);\n });\n }", "title": "" }, { "docid": "d1efd38f3f0677c9271ea0d3d36d8a57", "score": "0.6660701", "text": "checkScore (score) {\n if (score > 149) {\n this.youWon();\n };\n }", "title": "" }, { "docid": "ba49317a723eb571b74c04e07a0319ce", "score": "0.666017", "text": "function checkwin() {\n if (score === targetScore) {\n wins++;\n alert(\"You Won!\");\n gameStart()\n }\n if (score > targetScore){\n losses++;\n alert(\"You Lost!\");\n gameStart()\n }\n}", "title": "" }, { "docid": "2a81287393658fb001bc620ddd10159d", "score": "0.6652133", "text": "function winChecker() {\n if (playerTotal === targetNumber) {\n wins = wins + 1;\n $(\"#won\").text(\"wins: \" + wins);\n console.log(targetNumber);\n alert(\"You Win !!\");\n startOver();\n } else if (playerTotal > targetNumber) {\n loses = loses + 1;\n $(\"#lose\").text(\"losses: \" + loses);\n alert(\"You Lose !!\");\n startOver();\n }\n }", "title": "" }, { "docid": "0102f2b668dcee78e8bc3c07e246966a", "score": "0.6645234", "text": "function checkHasWon() {\n if (yourScore === numberToMatch) {\n wins++;\n $('#wins').text(wins);\n alert(\"you won: what a great crystal collector you are!\");\n resetGame();\n }\n else if (yourScore > numberToMatch) {\n losses++;\n $('#losses').text(losses);\n alert(\"You lost: not so great at collecting crystals, eh?\");\n resetGame();\n }\n }", "title": "" }, { "docid": "ac8db0b39961f3b6b32a6723dd5833c1", "score": "0.66363364", "text": "function checkWin(){\n \n if(targetscore === playerScore){\n wins++;\n alert(\"You win! Start Over\");\n startGame();\n updateGame();\n }\n\n else if(targetscore < playerScore){\n losses++;\n alert(\"You Lose! Start Over\");\n startGame();\n updateGame();\n }\n\n \n}", "title": "" }, { "docid": "cb3f4341b8bab5997cffa9600eddd4a2", "score": "0.6632315", "text": "function farkled(){\n if (countXs() == 0 && strait == false){\n alert(\"You Farkled on first roll 500 points!\");\n score += 500;\n extraPoints = true;\n }\n if (extraPoints == false){\n numTurns += 1;\n score = 0;\n }\n extraPoints = false;\n newTurn();\n}", "title": "" }, { "docid": "1fe13cd226a4888aad91ed8bba919f46", "score": "0.662692", "text": "function checkWin(){\n // Player reached water\n if(player.y < 0.5){\n addPoint();\n player.x = 2;\n player.y = 3.5;\n // Adds another enemy each time player gets another 10 points\n if(SCORE%10===0){\n levelUp();\n const newEnemy = new Enemy();\n newEnemy.y = Math.floor(Math.random() * 3) + 0.75;\n newEnemy.speed = Math.ceil(Math.random()*4);\n newEnemy.sprite = `images/${randomObject(enemyPics)}`;\n allEnemies.push(newEnemy);\n\n }\n }\n}", "title": "" }, { "docid": "1c901a167ec52dd7fd2598896b061f5e", "score": "0.66233647", "text": "function winCondition(player){\n if(player.y <=0){\n player.x = 200;\n player.y = 370;\n player.points += 100;\n displayMessage();\n }\n}", "title": "" }, { "docid": "8310f018da05c79cd4deaa89fdb1c1ad", "score": "0.6622588", "text": "function checkWin() {\n\tmatches += 1;\n\tif (matches === 8) {\n\t\tshowFinalScore();\n\t}\n}", "title": "" }, { "docid": "2d3c291b8ad10b677bbe3e1d44c29f44", "score": "0.66161036", "text": "function checkWin(pieceObj) {\n if (pieceObj.el.id == DIV_ID.JEEP && occupying(goalCoordinates.x, goalCoordinates.y, pieceObj)) {\n var secondsTaken = secondTimer + (minuteTimer * 60);\n\n sr.addToScore(level, numMoves, secondsTaken);\n sr.showLevelCompleteModal();\n resetTimer();\n }\n}", "title": "" }, { "docid": "9f71e0ccd0852fefda81ed73b96ff669", "score": "0.661322", "text": "wins() {\n // flag as won\n this.won = true;\n announceWinning();\n }", "title": "" }, { "docid": "e604713edd5bee8a95f7bf80e97b5684", "score": "0.66103584", "text": "function addPlayerScore(){\n if (turnScore >= beatVal){\n if (onPlayer == player1){\n p1Score+=10;\n alert(\"You are right \" + player1 + \"! You score 10 points, it is now \" + player2 + \"'s turn.\");\n }\n else if (onPlayer == player2){\n p2Score+=10;\n alert(\"You are right \" + player2 + \"! You score 10 points, it is now \" + player1 + \"'s turn.\");\n }\n \n }\n else{\n alert(\"What a shame, you are wrong. You did not beat the sum.\");\n }\n}", "title": "" }, { "docid": "8dfba6946f9cde613cfb221f54d9727a", "score": "0.66072357", "text": "function checkWinLoseCondition() {\n if (pointValue == randomNum) {\n wins++;\n $(\"#wins\").text(`Wins: ${wins}`);\n $(\"#message\").text(\"You have won!\");\n reset();\n setTimeout(clearMessage, 3000);\n }\n else if (pointValue > randomNum) {\n loses++\n $(\"#loses\").text(`Loses: ${loses}`);\n $(\"#message\").text(\"You have lost!\");\n reset();\n setTimeout(clearMessage, 3000);\n }\n }", "title": "" }, { "docid": "37caab80d7c1b09384beb7dbca42d655", "score": "0.6585272", "text": "function checkWin() {\n\t\tif (currentLevel === 20) {\n\t\t\t//alert user they've won and restart the game\n\t\t\tsweetAlert({\n\t\t\t\ttitle: 'You\\'ve Won!',\n\t\t\t\ttext: 'Would you like to play again?',\n\t\t\t\ttype: 'success',\n\t\t\t\tshowCancelButton: true,\n\t\t\t\tconfirmButtonColor: '#6BE2F9',\n\t\t\t\tconfirmButtonText: 'Yes',\n\t\t\t\tcancelButtonText: 'No',\n\t\t\t\tcloseOnConfirm: true,\n\t\t\t\tcloseOnCancel: true,\n\t\t\t\tcustomClass: 'simonAlert'\n\t\t\t}, function(confirmed) {\n\t\t\t\tif (confirmed) {\n\t\t\t\t\t//check if it's the new high score\n\t\t\t\t\tisHighScore();\n\t\t\t\t\t//reset the game\n\t\t\t\t\tresetGame();\n\t\t\t\t} else {\n\t\t\t\t\t//check if it's the new high score\n\t\t\t\t\tisHighScore();\n\t\t\t\t\t\n\t\t\t\t\t//reset the game, but don't start\n\t\t\t\t\tplayerSequence = [];\n\t\t\t\t\taiSequence = [];\n\t\t\t\t\tcurrentLevel = 0;\n\t\t\t\t}\n\t\t\t});\n\n\t\t} else {\n\t\t\t//reset playerSequence\n\t\t\tplayerSequence = [];\n\n\t\t\t//continue adding moves\n\t\t\tturn = 'computer';\n\t\t\tmakeRandomSequence();\n\t\t}\n\t}", "title": "" }, { "docid": "69bf130dd8d2e880e3963af696e02733", "score": "0.65820915", "text": "function checkWin() {\n if(roundsCount > 20) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "a3c947886ec9674fe24337513b02068a", "score": "0.6580883", "text": "function checkScore() {\r\n if (GAME.moves === 7 || GAME.moves === 12) {\r\n loseStar();\r\n }\r\n}", "title": "" }, { "docid": "d418b95578c731efc94f87b2b2676b3f", "score": "0.6579184", "text": "gameOver(){\n if (this.checkForWin() === true) {\n completeGame(\"win\", \"Congrats! You are a winner!\");\n } else if(this.missed === 5) {\n completeGame(\"lose\",\"Oh no you lost! Better luck next time!\");\n }\n }", "title": "" }, { "docid": "b118542f00a9e1e50bad717fb0e5b96c", "score": "0.65682423", "text": "function checkScore(){\n\t\t\tif (gamePoints > randomTargetNbr) {\n\t\t\t\tnbrLosses++;\n\t\t\t\t$(\"#gameCounters\").html(\"<p>You lose!</p><p>Wins: \" + nbrWins + \"</p><p>Losses: \" + nbrLosses + \"<p>\");\n\t\t\t\tgameOver = true;\n\t\t\t\tresetGame();\n\t\t\t} else if (gamePoints === randomTargetNbr){\n\t\t\t\tnbrWins++;\n\t\t\t\t$(\"#gameCounters\").html(\"<p>You win!</p><p>Wins: \" + nbrWins + \"</p><p>Losses: \" + nbrLosses + \"<p>\");\n\t\t\t\tgameOver = true;\n\t\t\t\tresetGame();\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "4ed83d1adca18c877d4787cd3303e341", "score": "0.6566152", "text": "function checkAdvance(){\n if(score == levelScore + previousScore){\n if(level != 5){\n advanceLevel();\n }else{\n gameWinner();\n }\n }\n}", "title": "" }, { "docid": "fd12f9e5778936cee03d91495127cba8", "score": "0.6525979", "text": "function checkForWin(){\n let a = position.top - winholepos.top;\n let b = position.left - winholepos.left;\n\n let c = Math.sqrt(a*a+b*b);\n\n if(c <= 15){\n win();\n }\n}", "title": "" }, { "docid": "fd6bdd6a069c21064e98501ed99065cb", "score": "0.65201944", "text": "checkIfWin() {\n if (this.isOutOfBoundsY) {\n //if not win increase the game score\n gameScore++;\n score.innerText = gameScore * 100;\n this.reset();\n } else {\n if(gameScore === 20 && this.lives > 0){\n this.success();\n }\n }\n }", "title": "" }, { "docid": "2164a0829483ff8047b91897d75a723d", "score": "0.65150034", "text": "function gainPoints() {\n var max = 5;\n var min = 1;\n changeScore = parseInt((Math.random() * (max - min + 1)), 10) + min;\n knight.score += changeScore;\n scoreText.innerHTML = knight.score;\n }", "title": "" }, { "docid": "439c5931d0b087df30bef932e3a85123", "score": "0.650664", "text": "function hit(){\n hitACard();\n if (playerPoints > 21) {\n $('#messages').text('Sorry, you busted!');\n gameOver();\n }\n}", "title": "" }, { "docid": "bad29e70fb25a9bf33d4f124f5ce7d01", "score": "0.6506256", "text": "function blackjackHit() {\n if (blackjackGame['isStand'] === false && blackjackGame.you.cardNum < 5 && blackjackGame.you.blackjack != true) {\n gameRunning(YOU);\n blackjackGame.you.cardNum++;\n blackjackGame['isHit'] = true;\n }\n}", "title": "" }, { "docid": "81354dd911acca6fe3ac10200ab859c5", "score": "0.65031815", "text": "function gameOver(){\r\n active = false;\r\n alert(\"Przegrałeś. Twój wynik to: \"+points+ \". Odśwież by spróbować ponownie\");\r\n return;\r\n }", "title": "" }, { "docid": "f8cf89b952fa41152446ec2f89f730f4", "score": "0.6498835", "text": "function won() {\n\tif(hits === 14 && !!alert){\n\t\tconst alertDiv = document.getElementById(\"alert\");\n\t\talert = document.createElement(\"h1\");\n\t\talert.className = \"alert alert bg-transparent text-success\"\n\t\talert.innerHTML = \"Congrats! You've won!\";\n\t\talertDiv.appendChild(alert)\n\t\twindow.scrollTo(0,0);\n\t\treturn true;\n\t}\n\telse return false;\n}", "title": "" }, { "docid": "a8709876478aa1a6f3d7c5d5b1f9d780", "score": "0.6468819", "text": "checkForWin(){//works\n\tif(this.missed < 5){\n\t\tif(this.activePhrase.letterCount === this.activePhrase.winCount + this.activePhrase.spaceCount){\n\t\t\tthis.score = 'winner'\n\t\t\tnewGame.gameOver();\n\t\t}\n }else{\n\t\tthis.score = 'loser'\n\t\tnewGame.gameOver();\n\t}\n}", "title": "" }, { "docid": "390120b958a55470f68817b6670668a4", "score": "0.6455552", "text": "function gameWin () {\n if (totalGuess === randomNum && totalGuess > 0) {\n wins++;\n $('#numWins-text').text('Wins: ' + wins); \n gameStart();\n }\n else if (totalGuess > randomNum) {\n losses++;\n $('#numLoss-text').text('Losses: ' + losses);\n gameStart();\n }\n}", "title": "" }, { "docid": "fadb395708ae7a8659c8ec4df1095fd9", "score": "0.6452014", "text": "function isOver(player){\n if(player > 21){\n lose();\n }\n}", "title": "" }, { "docid": "c90b7f879cdef864d6f5fbd6d1eab69a", "score": "0.6445913", "text": "function won(winner, loser) {\n client.say(channel, GlobalQueue.matchCompleted(winner, loser));\n\n setShoutoutTimeout();\n\n DB.addWin(winner);\n DB.addLoss(loser);\n \n}", "title": "" }, { "docid": "1e446c4a058a54b681a622b13b4d60ff", "score": "0.6442077", "text": "function checkWin() {\n// if value is equal then win\nif (score === random) {\n wins++;\n alert(\"You Win!\");\n start();\n }\n//if value is over then \nelse if (score > random) { \n losses++;\n alert(\"Sorry Buddy\");\n start();\n };\n $(\"#win\").text(\"Wins: \" + wins);\n $(\"#loss\").text(\"Losses: \" + losses);\n}", "title": "" }, { "docid": "4ad712eebdede1dfba106c9d5f18195a", "score": "0.6436038", "text": "function experiencePoints() {\n\tif (winBattle()) {\n\t\treturn 10;\n\t} else {\n\t\treturn 1;\n\t}\n}", "title": "" }, { "docid": "7c0e6fe5b2f74e3b49d5726c3074fa95", "score": "0.6425487", "text": "function checkPoints(){\n if(posx === pointX && posy === pointY && wire.address === location){\n points += 10;\n console.log(points + \" points.\");\n spawnEnemies();\n spawnPoints();\n wire.writeBytes(posy*2, [Math.pow(2,posx)]);\n clearInterval(timing);\n time = time-10;\n timing = setInterval(gameStart, time);\n } \n}", "title": "" }, { "docid": "eff5cae160b148a4788c9c0443c0a4ff", "score": "0.64236295", "text": "function checkScore(){\n if (moves === 10 || moves === 16\n ) { disentigrateStar();\n }\n}", "title": "" }, { "docid": "6d7b076c0cb982465fa88fbf1b02bd44", "score": "0.6422147", "text": "function checkScore() {\n\tif (moves === 17 || moves === 23) {\n\t\tloseStar();\n\t}\n}", "title": "" }, { "docid": "5470423dbea8c0ce54b4d62ac612488b", "score": "0.64143753", "text": "function playerHit(event) {\n event.preventDefault();\n if (playerTotal < 21) {\n addCardPlayer();\n // draw.next();\n playerTotal = getTotalValue(playerHand);\n playerHandEl.innerHTML = '';\n handValue(playerTotal);\n if(playerTotal > 21){\n document.getElementById('0').src = dealerHand[0].cardImage;\n selectWinner();\n setTimeout(function(){\n if (playerTotal >= 21){\n alertWinner();\n }\n }, 1000);\n }\n playerHandRender(playerHand);\n }\n}", "title": "" }, { "docid": "66f7ac72349ed13041de5c01797ca7f5", "score": "0.6408259", "text": "function nextFightTurn() {\n\n if (allPlayers[otherPlayerID(currentPlayer)].ptsLife <= 0) {\n // if the current target life is négative the current player win\n debug('>>>>>>> '+(otherPlayerID(currentPlayer)+1));\n $(\"#infoPlayer\"+(otherPlayerID(currentPlayer)+1)).addClass(\"waitForFight\");\n refreshUi();\n win();// << follow this\n\n } else {\n // change player\n debug(\"the turn of \" + allPlayers[currentPlayer].name + \" is over.\");\n currentPlayer = Number(!Boolean(currentPlayer));\n debug(\"let's go \" + allPlayers[currentPlayer].name);\n //Refresh the interface with the new current player\n refreshUi();\n updateFightBoard(currentPlayer);// << follow this\n // Alert the player\n alert(allPlayers[currentPlayer].name + ' FIGHT!', true);\n }\n\n}", "title": "" }, { "docid": "07edbbb165adb77c2d412f2c0064d835", "score": "0.64072096", "text": "function winGame() {\n if(game.eatFood.includes(false)) {\n } else {\n started = false;\n $('img').hide();\n $('.game-screen').hide();\n $('.level-screen').show();\n clearInterval(game.interval);\n game.nextLevel();\n $('.progress-bar').attr('aira-valuenow', 100).css('width', '100%');\n if(game.level < 8) {\n $('.level-screen h2').text(`Level: ${game.level+1}`);\n alert(`You beat level ${game.level}`);\n } else {\n $('.level-screen h2').text('You won!');\n alert(`You beat level ${game.level}`);\n $('.level-btn').hide();\n }\n game.updatePoints();\n game.updateLives()\n }\n }", "title": "" }, { "docid": "c1c79816d8ecbfa928680264e59fe148", "score": "0.6399854", "text": "function ifWin() {\n wins++;\n $('#wins').html('Wins: ' + wins);\n //$('#results').html('You win! Click a crystal to play again');\n console.log('You win!');\n resetGame();\n }", "title": "" }, { "docid": "3c4b735e5af1a31ebe84b9eff38dc52b", "score": "0.6396499", "text": "function checkWinningCondition (){\n if (gameData.score[gameData.index] > gameData.gameEnd){\n \n score.innerHTML = `<h2>${gameData.players[gameData.index]} wins with ${gameData.score[gameData.index]} points!</h2>`;\n //effect sound after the player wins\n winSound.play();\n actionArea.innerHTML = '';\n document.getElementById('quit').innerHTML = \"Start a new Game?\";\n }\n else {\n showCurrentScore();\n }\n }", "title": "" }, { "docid": "9189e9cc077552e8509e8853576e16c9", "score": "0.6390039", "text": "function checkIfWon(){\n if(parseInt(playerOneTotalPoints.innerText) + parseInt(playerOneCurrentPoints.innerText) >= 10){\n alert(\"Player 1 has won!!\");\n location.reload();\n }\n else if(parseInt(playerTwoTotalPoints.innerText) + parseInt(playerTwoCurrentPoint.innerText) >= 10){\n alert(\"Player 2 has won!!\");\n location.reload();\n }\n}", "title": "" }, { "docid": "6b794cc12d7b8def88235dbe47a2cfe7", "score": "0.638781", "text": "function gameChecker() {\n if (randomNumber === myTotalScore) {\n win++;\n $(\"#Wins\").html(win);\n console.log(\"you won\");\n resetGame();\n } else if (myTotalScore > randomNumber) {\n loss++;\n $(\"#Losses\").html(loss);\n console.log(\"you lost\");\n resetGame();\n } else {\n console.log(\"--------------\")\n console.log(\"keep playing\");\n }\n }", "title": "" }, { "docid": "8de70d46c28ab7b3f6449fc80569d1b8", "score": "0.63772905", "text": "function winCheck() {\n\t\twinsCounter++;\n\t\talert(\"You won this round!\")\n\t\t$(\".winsCounter\").text(winsCounter);\n\t\treset();\n\t}", "title": "" }, { "docid": "3f2d8b930c8220998638623604881c9c", "score": "0.6347061", "text": "function hit() {\n if (players[activePlayer].status === \"hit\") {\n players[activePlayer].giveCard(deck1.popCard());\n consolify(\"NICE HIT! \" + players[activePlayer].id);\n\n // when last player HITS and exceeds 21\n if (activePlayer === players.length - 1 && players[activePlayer].handValue.every((value) => value > 21)) {\n console.log(activePlayer + \" OUT\");\n players[activePlayer].toggle();\n players[activePlayer].status = \"out\";\n consolify(\"YOU GOTTA GO TOO \" + players[activePlayer].id);\n $(\"#hit-btn\").hide(1000);\n $(\"#stay-btn\").hide(1000);\n findWinner();\n }\n // when players before the last one HIT and exceed 21\n else if (players[activePlayer].handValue.every((value) => value > 21)) {\n console.log(activePlayer + \" OUT\");\n players[activePlayer].toggle();\n players[activePlayer].status = \"out\";\n consolify(\"YOU GOTTA GO \" + players[activePlayer].id);\n activePlayer++;\n players[activePlayer].toggle();\n }\n }\n}", "title": "" }, { "docid": "a7fe38f6b60b2d1faba7592287e03c4e", "score": "0.6342038", "text": "function player1Won() {\n var myWins = myGame.player1Wins;\n myWins++;\n gameRound++;\n \n\n if (myKey===myGame.player1) {\n setTimeout(function(){ divNarrator.text(\"You Won!! Your \" + curPlayer1Selection + \" beats your opponent's \" + curPlayer2Selection + \".\") }, 10);\n } else {\n setTimeout(function(){ divNarrator.text(\"Sorry You Lost. Your \" + curPlayer2Selection + \" loses to your opponent's \" + curPlayer1Selection + \".\" ) }, 10);\n };\n \n setTimeout(function(){\n game.update({\n player1Wins: myWins,\n player1CurrentSelection: \"\",\n player2CurrentSelection: \"\",\n round: gameRound,\n });\n divPlayer1Score.text(myGame.player1Wins);\n nextRound();\n }, 100);\n }", "title": "" }, { "docid": "60e91a0f065bebb65897397a9204d948", "score": "0.63238746", "text": "function gameWon(){\n\talert('Winner!');\n\t//TODO: deal with the `'s Turn` bit of the turn-indicator text\n\tplayerIndicator.innerText = `${gs.getCurrPlayerName()} Wins!!!`;\n\tdisableBoard();\n}", "title": "" }, { "docid": "bd1bae4dbea8fd6661210c98de88d7ee", "score": "0.6319286", "text": "function pirateHit(); {\n if( (cannonball.x - bmap.x <100) && (cannonball.x - bmap.x > 0) && (cannonball.y - bmap.y < 75) && (cannonball.y - bmap.y > 0)) {\n //there is a hit\n exploding = 5;\n\n //adding scores\n score++;\n txt.text = \"Score \" + score;\n }\n }", "title": "" }, { "docid": "ddcc9116273420e4752b5a0b8fa7dabb", "score": "0.6315135", "text": "function addHitAndCheckWin() {\n numHits++;\n console.log(numHits);\n return numHits >= maxHits;\n}", "title": "" }, { "docid": "4b09f584bf672a45f904fdef361a727c", "score": "0.6314137", "text": "function checkScore() {\n\tif (moves === 15 || moves === 30) {\n\t\thideStar();\n\t}\n}", "title": "" }, { "docid": "3e8c11d2f4a5b9f7fb0723cbaf1f7a3b", "score": "0.63133794", "text": "function checkWin() {\n if (frogY < 50){\n score += 1;\n frogX = width/2;\n frogY = height - 20;\n }\n}", "title": "" }, { "docid": "22aa156522f84b3347ae50f42b846077", "score": "0.63071615", "text": "function win(){\n total = total + (somme * 36);\n totalbank = totalbank - (somme * 36);\n enbank();\n gameover();\n}", "title": "" }, { "docid": "f03f5c8a5f7edb98366c5d53d4658b7a", "score": "0.6299544", "text": "function CheckForWin() {\n if (numCurrentTotal > numRandomNumber) {\n alert(\"Too high. You LOSE!\");\n numLosses++;\n $(\"#losses\").text(numLosses);\n InitializeGame();\n }\n else if (numCurrentTotal === numRandomNumber) {\n alert(\"By Poseidon's beard, you did it!\");\n numWins++;\n $(\"#wins\").text(numWins);\n InitializeGame();\n }\n }", "title": "" }, { "docid": "3944afb7d9248acf67b6fe53278b0dc1", "score": "0.6299217", "text": "function gameOver() {\n if (userSum === goalNumber) {\n wins++;\n alert(\"Good job you know Math\");\n $(\"#wins\").text(wins);\n $(\"#userSum\").text(0);\n game();\n }\n\n else if (userSum >= goalNumber) {\n losses++;\n alert(\"Not so good at adding numbers eh?\");\n $(\"#losses\").text(losses);\n $(\"#userSum\").text(0);\n game();\n }\n }", "title": "" }, { "docid": "2054ff0802f1d84dae467015a0edd701", "score": "0.62963635", "text": "function playGame() {\n if (playerScore == num) {\n alert(\"Yay!!! Way to do basic addition!!!!!\");\n $(\"#wins\").html(wins +=1 );\n play();\n } else if(playerScore > num) {\n alert(\"Maybe you should try using a calculator or something next time\");\n $(\"#losses\").html(losses +=1 );\n play();\n }\n \n\n }", "title": "" }, { "docid": "5a86c4513a893e2f70d448eafb355959", "score": "0.62956786", "text": "function win(){\n\n $winDialog=$('<div></div>');\n $winDialog.html(\"Boom! Enemy Slayed!\").addClass('green');\n $(\"#battleWindow\").append($winDialog);\n\tenemiesDef += 1;\n\t\n\tif (enemiesDef > 5){\n\t\tdungeonFinished();\n\t\tconsole.log(\"dungeonFinished was executed\");\n\t}\n\t\n\tconsole.log(enemiesDef);\n gameOver();\n\t\n}", "title": "" }, { "docid": "956dea8bcb8d87c645b31c3a6d3a598f", "score": "0.62911177", "text": "function wins(winnum) {\n if (winnum == 1) {\n\n wholeGame.current().playerone.wins += 1;\n wholeGame.current().getCurrentRound().winner = wholeGame.current().playerone.name;\n console.log(\"X wins: \" + wholeGame.current().playerone.wins );\n // winFlash(\"home_score\");\n document.getElementById('homewin').style.display = \"block\";\n if(wholeGame.current().playerone.wins == bestof - Math.floor(bestof/2))\n {\n gamewin = true;\n }\n }\n else {\n\n wholeGame.current().playertwo.wins += 1;\n wholeGame.current().getCurrentRound().winner = wholeGame.current().playertwo.name;\n console.log(\"O wins: \" + wholeGame.current().playertwo.wins );\n // winFlash(\"away_score\");\n document.getElementById('awaywin').style.display = \"block\";\n if(wholeGame.current().playertwo.wins == bestof - Math.floor(bestof/2))\n {\n gamewin = true;\n }\n }\n wholeGame.current().first = !wholeGame.current().first;\n return true;\n}", "title": "" }, { "docid": "86353f3b845f84869ecdc4ef3e95beef", "score": "0.62849134", "text": "function winOrLoss (){\nif(score > randomNum){\n losses++;\n $('#resultMessage').html(\"You Lost!\");\n startGame();\n}\n\nelse if (score == randomNum){\n wins++;\n $('#resultMessage').html(\"You Win!\");\n startGame();\n}\n}", "title": "" }, { "docid": "6b8d28e753fc62e20a6ee9a91aec9d17", "score": "0.6283524", "text": "function checkWin() {\n\t\tactiveHand = false;\n\t\tvar playerTotal = calculateTotal(playersHand, 'player');\n\t\tvar dealerTotal = calculateTotal(dealersHand, 'dealer');\n\t\tvar winMessage = \"\";\n\t\tif(playerTotal > 21) {\n\t\t\twinMessage = \"Player has busted. Dealer wins.\";\n\t\t\tplayerBust();\n\t\t} else if (playerTotal == 21) {\n\t\t\twinMessage = \"Blackjack! You win!\"\n\t\t\tplayerWin();\n\t\t} else if (dealerTotal > 21) {\n\t\t\twinMessage = \"Dealer has busted. You win!\";\n\t\t\tdealerBust();\n\t\t} else {\n\t\t\tif(playerTotal > dealerTotal) {\n\t\t\t\twinMessage = \"You beat the dealer!\";\n\t\t\t\tplayerWin();\n\t\t\t} else if(playerTotal < dealerTotal) {\n\t\t\t\twinMessage = \"The dealer has bested you. We get your money.\";\n\t\t\t} else {\n\t\t\t\twinMessage = \"It's a push!\";\n\t\t\t}\n\t\t}\n\t\t$('.message').text(winMessage);\n\t}", "title": "" }, { "docid": "8bb7e759073c761081e30bb8813aff27", "score": "0.62821937", "text": "function playerWin(score) {\n if (score >= 100) {\n return true;\n\n }\n}", "title": "" }, { "docid": "523309971e084fa6368f0008f18a47c4", "score": "0.6280798", "text": "function checkWin() {\n console.log(\"random number is \" + randNum);\n if (totalScore === randNum) {\n $(\"#totalScore\").html(totalScore);\n wins++;\n // console.log(wins);\n // hasFinished = true;\n $(\"#wins\").html(wins);\n // console.log('YOU WIN!');\n alert('YOU WIN!');\n reset();\n }\n\n if (totalScore > randNum) {\n $(\"#totalScore\").html(totalScore);\n losses++;\n // console.log(losses);\n // hasFinished = true;\n $(\"#losses\").html(losses);\n // console.log('YOU LOSE!');\n alert('YOU LOSE!');\n reset();\n }\n }", "title": "" }, { "docid": "bb0803c0a11f527ba74ef6d120e16ff9", "score": "0.6280407", "text": "function userWins() {\r\n numWins = numWins + 1\r\n $(\"#lossMsg\").hide();\r\n $(\"#winMsg\").show();\r\n $('#wins').text(numWins);\r\n\r\n newGame();\r\n }", "title": "" }, { "docid": "aa729bff0da0fbd1f2ddc8471bbada99", "score": "0.62788457", "text": "function playerWon() {\n return params.playerScore === params.gameLength;\n}", "title": "" }, { "docid": "6053d3e490def2affb661b6663e22242", "score": "0.627601", "text": "function checkForBust(score){\n if (score > 21){\n bustedPlayer()\n }\n}", "title": "" }, { "docid": "5b2a12e6898a2b7475085cd83d74b8b5", "score": "0.6266118", "text": "function pointResult(ppoints, apoints){\r\n playerPoints += ppoints;\r\n aiPoints += apoints;\r\n pointsTxt.innerHTML = playerPoints + \" player points <br>\" + aiPoints + \" AI points <br>\";\r\n if(playerPoints > 2 || aiPoints > 2){\r\n if(playerPoints >= aiPoints){\r\n scoreBoard(\"Player win the game!\"); \r\n }\r\n else{\r\n scoreBoard(\"AI win the game!\");\r\n }\r\n }\r\n}", "title": "" }, { "docid": "101c9a9d891c23eedfb87da98503a580", "score": "0.62613964", "text": "function winning() {\n alert (\"YOU DID IT !\");\n wins++;\n $(\"#xWins\").text(\"wins\" + wins);\n reset();\n }", "title": "" }, { "docid": "5ffea1a94bf7d5c632030e4284a18fbf", "score": "0.62573254", "text": "function playGameAutomagically() {\n rollDiceButtonClicked();\n if (control.getAccumulator() > 0 && (Math.random() * 5 + 1) <= 4)\n endTurnButtonClicked();\n }", "title": "" }, { "docid": "e2408915bdc8a700d50a04df5a0c54a0", "score": "0.6253822", "text": "function nextTurn() {\n //\n if (allPlayers[currentPlayer].isNearOfEnemy()) {\n debug('FIGHT !!!');\n remBoardEvents();\n setFightBoard(currentPlayer);// << follow this\n } else {\n changePlayer();// << follow this\n refreshUi();\n }\n}", "title": "" }, { "docid": "465be6b7c68f5da081e8956552a79677", "score": "0.6252486", "text": "function startHit() {\n \n kortTemp = kort[hentKort()];\n settInnKort(\"player\", kortTemp, kort_array_navn[kortTemp]);\n\tplayerHand[playerHits] = cleanse(kortTemp);\n\t$(\"#playerSum\").text(pSum());\n playerHits++;\n\n if(pSum() > 21){\n display(2);\n won = false;\n resultat();\n }\n else if(pSum() == 21 || playerHand.length == 5 && card5 == true){\n display(1);\n won = true;\n resultat();\n }\n\n}//end of startHit", "title": "" }, { "docid": "d73c0da11a9deb07a42659b718ff8e1e", "score": "0.6251986", "text": "function win() {\n winCounter += 1;\n gotKey = false;\n goldKey.reappear();\n document.getElementById(\"noOfWins\").innerHTML = winCounter;\n player.location.x = pStartLocX;\n player.location.y = pStartLocY;\n}", "title": "" }, { "docid": "594436b018e6dde1afef3d9543cd33aa", "score": "0.62487096", "text": "function winCondition(){\n\tif(parseInt(userNumber) === parseInt(numberToGuess)){\n\t\tconsole.log(\"winner\");\n\t\twinCounter++;\n\t\t$(win).text(winCounter);\n\t\tstart();\n\t}else if(parseInt(userNumber)>parseInt(numberToGuess)){\n\t\tconsole.log(\"loss\");\n\t\tlossCounter++;\n\t\t$(loss).text(lossCounter);\n\t\tstart();\n\t};\n}", "title": "" }, { "docid": "04e6606c7220156705546ee341a0a84e", "score": "0.62437606", "text": "function giveAware(p:int) {\n\tcurrentAware += p;\n\tif (currentAware >= 10) {\n\t\t//TUrn on van\n\t\tvan.SetActive(true);\n\t\tDebug.Log(van);\n\t} else if(currentAware >= 15) {\n\t\tDebug.Log(\"Game Over, Star Fox.\");\n\t\tApplication.LoadLevel(\"StarScene\");\n\t}\n}", "title": "" }, { "docid": "2a3a656f569984c4ed72e300a3acb7f4", "score": "0.6238941", "text": "function checkWin() {\n if (rightAnswers.length === 20) {\n alert(\"YOU WON!\");\n clearInterval(timer);\n }\n }", "title": "" }, { "docid": "6143d74767459c2fd210e593b25a097e", "score": "0.62368304", "text": "function scoreKeeper() {\n if (yourPoints > matchPoints){\n losses++;\n $(\"#losses\").html('losses: ' + losses);\n $(\"#buttonReset\").show();\n $(\"#gemRow\").hide();\n playAgain();\n }\n\n if (yourPoints == matchPoints) {\n wins++;\n $(\"#wins\").html('Wins: ' + wins);\n $(\"#buttonReset\").show();\n $(\"#gemRow\").hide();\n playAgain();\n };\n \n\n }", "title": "" }, { "docid": "e78b96fea75f11a5c0631bf6f1c20de1", "score": "0.6234565", "text": "function winner() {\nif (yourscore === randomnumber) {\n\tconsole.log(\"You Won\");\n\twindow.alert(\"You won! Great work. Play again. Your score will reset now.\");\n\twins++;\n\t$(\"#wins-div\").text(wins);\n\teasterwin();\n\treset();\n}}", "title": "" }, { "docid": "38fadf1b8058cf194052bdc7b41184d8", "score": "0.6234389", "text": "function playGame() {\n if (totalScore === ranNum) {\n wins++;\n setLabels();\n }\n else if (totalScore > ranNum) {\n losses++;\n setLabels();\n }\n}", "title": "" }, { "docid": "ba5f1802037d9c63a767e06bf27d19c1", "score": "0.6222495", "text": "function comparePoints() {\r\n\tif (housePoints>playerPoints) {\r\n\t\talert(\"house wins!\");\r\n\t\tgameOver(\"house\");\r\n\t}\r\n\telse {\r\n\t\tif (housePoints<playerPoints) {\r\n\t\t\talert(\"player wins!\");\r\n\t\t\tgameOver(\"player\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\talert(\"it's a tie.\");\r\n\t\t\tgameOver(\"tie\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "23476192b5aff008b6cf7178b97508cd", "score": "0.6207092", "text": "function game_won() {\n return _player_won;\n}", "title": "" }, { "docid": "f788325aad96de4e04d28811e57f2862", "score": "0.62029296", "text": "function moreHungry(){\n\tif (hungerPoints > 0)\n\t\thungerPoints = hungerPoints - 1;\n\telse\n\t\tgameOver = true;\n\n}", "title": "" }, { "docid": "cab5bbaa847a98a95d499a8204ac7f22", "score": "0.6202731", "text": "function hitMe(x) {\n\n\t\tscore += x;\n\n\t\t$(\"#score\").text(score);\n\n\t\tif (score > computerNumber) {\n\n\t\t\tlosses++;\n\n\t\t\t$(\"#losses\").text(losses);\n\n\t\t\talert(\"You've lost. Try again.\");\n\n\t\t\tresetValues();\n\n\t\t} else if (score == computerNumber) {\n\n\t\t\twins++;\n\n\t\t\t$(\"#wins\").text(wins);\n\n\t\t\talert(\"You've won! Play again.\");\n\n\t\t\tresetValues();\n\n\t\t}\n\n\n\t}", "title": "" }, { "docid": "0ed075e837142d0c1954903f1f1d8087", "score": "0.62024426", "text": "function winOrLose() {\n if (score === goal) {\n wins++;\n console.log(\"You Won!\");\n $(\"#Wins\").text(wins);\n reset();\n } else if (score > goal) {\n losses++;\n console.log(\"You Lose\");\n $(\"#Losses\").text(losses);\n reset();\n }\n }", "title": "" }, { "docid": "dc251847e9f8cdbde61b23b95d105428", "score": "0.62007105", "text": "handleWinning() {\n if (this.score === this.endScore) {\n gameOver = true;\n }\n }", "title": "" }, { "docid": "db8981442f2a75acf7eddbfd11fdf024", "score": "0.62004054", "text": "function hasWon(){\n if(newPosOne >= 29 && newPosTwo < 29){\n playerOne.hasWon = true;\n localStorage.setItem(\"playerOneHasWon\", \"true\");\n drawPlayerOne(playerOne.posX, playerOne.posY);\n // GO TO FINAL VICTORY PAGE\n console.log(\"player one has won\");\n }\n if(newPosTwo >= 29 && newPosOne < 29){\n playerTwo.hasWon = true;\n localStorage.setItem(\"playerTwoHasWon\", \"true\");\n drawPlayerTwo(playerTwo.posX, playerTwo.posY);\n // GO TO FINAL VICTORY PAGE\n console.log(\"player Two has won\");\n }\n}", "title": "" }, { "docid": "288f2e3a81aebbfb68f2594a273a5864", "score": "0.6199959", "text": "function game(){\n //Call playRound function 5x and update points & round # after each round\n for (let i = 0; i < 5; i++){\n playRound(computerPlay(), playerSelection());\n console.log(\"Round: \" + roundNum);\n console.log(\"Computer: \" + computerPoints);\n console.log(\"Player: \" + playerPoints);\n }\n //Computer winning condition\n if (computerPoints > playerPoints){\n return console.log(\"Computer wins!\");\n }\n else\n //Player winning coniditon\n if (playerPoints > computerPoints){\n return console.log(\"Player wins!\");\n }\n else\n //Draw condition\n return console.log(\"Match has been declared a draw!\");\n}", "title": "" }, { "docid": "6622aac0ebc62412f83da0539f6399b0", "score": "0.6199243", "text": "function pointsReady(playerNumber) {\n\n // Small straight is used always when possible\n if ((pointsSmallStraight(playerNumber) == 15) && \n ($(\".p\" + playerNumber + \".v\" + P11).html() == \"-\")) {\n setTimeout(function() { setComputerPoints(playerNumber, P11); }, POINTS_DELAY);\n return true;\n }\n \n // Large straight is used always when possible\n if ((pointsLargeStraight(playerNumber) == 20) && \n ($(\".p\" + playerNumber + \".v\" + P12).html() == \"-\")) {\n setTimeout(function() { setComputerPoints(playerNumber, P12); }, POINTS_DELAY);\n return true;\n }\n \n // Yatzy is used always when possible\n if ((pointsYatzy(playerNumber) == 50) && \n ($(\".p\" + playerNumber + \".v\" + P15).html() == \"-\")) {\n setTimeout(function() { setComputerPoints(playerNumber, P15); }, POINTS_DELAY);\n return true;\n }\n \n return false;\n}", "title": "" }, { "docid": "6a34f0f9a78f8fda120cab79de21751a", "score": "0.61972123", "text": "addPoint_TieBreak(opponentScore = 0) {\n this.raw += 1\n this.point += 1\n if (this.point >= 6) if (this.point - opponentScore >= 2) this.point = \"win\"; return 1\n }", "title": "" }, { "docid": "142cb857342afa42e3184877f36cee2f", "score": "0.6196949", "text": "function checkForScore() {\n\t\tif (goodmove >= currentLength) {\n\t\t\twon++;\n\t\t\tscoreBoard();\n\t\t\tpoints.play();\n\n\t\t\tsetTimeout(function() {\n\t\t\t\talert(`\"That's correct, Good Job!\"`);\n\t\t\t}, 100);\n\n\t\t\tsetTimeout(function() {\n\t\t\t\tclear();\n\t\t\t}, 200);\n\t\t\tturn++;\n\t\t\tsetTimeout(function() {\n\t\t\t\tcheckforWin();\n\t\t\t}, 300);\n\t\t}\n\t}", "title": "" }, { "docid": "a0ca64e52ebdd5747ead47fb3b4c807a", "score": "0.6194406", "text": "function didIWin(){\r\n //traverse each square, to see if all of the isSecret have been clicked on \r\n for (let i = 0; i<size;i++){\r\n for (let j = 0; j<size; j++){\r\n // tried doing errors > 10 \r\n if (board.square[i][j].isSecret == true && board.square[i][j].touched == false){\r\n return 0; \r\n } \r\n } \r\n }\r\n \r\n levelTracker++;\r\n //if levelTracker < 3 then you can keep playing the next level \r\n if (levelTracker < 4) {\r\n document.getElementById(\"stats\").innerHTML = \"You won!\";\r\n console.log(\"Next level!\");\r\n document.getElementById(\"next\").style.display=\"block\";\r\n } \r\n else { //if all levels are checked off then you won \r\n document.getElementById('timer').innerHTML = \"You won the game! Time to finish: \"+timerVar;\r\n console.log(\"Player won the game! In time: \" +timerVar);\r\n //insert all values into score \r\n clearInterval(clock);\r\n return 2;\r\n}\r\n return 1;\r\n}", "title": "" }, { "docid": "1d85af4b7b5534192d991005bf2563f5", "score": "0.6192248", "text": "function winLoss() {\n if (totalScore === randNumComp) {\n win();\n }\n else if (totalScore > randNumComp) {\n lose();\n }\n }", "title": "" }, { "docid": "a8827c054e777ecd1e956189cff23408", "score": "0.61794263", "text": "function addScore(points) {\n\t\tvar settings = kogeki.settings;\n\t\tgameState.score += points;\n\t}", "title": "" }, { "docid": "aac3dd88bac46124c21f4d631b4c82dd", "score": "0.6176831", "text": "function checkWinner() {\n if (totalAskedQ === 10) {\n if (player1Score > player2Score) {\n alert(\"Player 1 wins! Play again?\");\n location.reload();\n } else if (player2Score > player1Score) {\n alert(\"Player 2 wins! Play again?\");\n location.reload();\n } else {\n alert(\"It's a draw!\");\n location.reload();\n }\n };\n }", "title": "" }, { "docid": "fc450dfff8f4c24b9f384c803cc84408", "score": "0.6175549", "text": "function win() {\n Swal.fire('You Win!', 'Way To Be One With The Gem!', 'success');\n // updates score if user won\n winCounter += 1;\n $('#wins > span').text(winCounter);\n init();\n}", "title": "" }, { "docid": "e6170fcfc8dd0dac574528c6d8c06223", "score": "0.6173187", "text": "function littlewin(){\n total = total + (somme * 2);\n totalbank = totalbank - (somme * 2 );\n enbank();\n gameover();\n}", "title": "" }, { "docid": "7bdfc37d625d675d2263c7b88c78101b", "score": "0.6170659", "text": "function didIWin(piece){\n return checkForWin(piece);\n }", "title": "" }, { "docid": "bc16d2fea26c9b8671911a372040193c", "score": "0.6165983", "text": "function hitPlayer() {\n var card = deck.dealCard();\n log(\"hit: \" + card.toString());\n paintCard(card, player.name);\n player.hand.push(card);\n var tot = sumHand(player.hand);\n statusMsgStick(\"Total: \" + tot);\n var temp = player.betAmt;\n if (tot > 21) {\n finalizeRound(0);\n endRound(\"Busted\", -(temp));\n }\n else if (player.hand.length == 7) {\n finalizeRound(player.betAmt);\n endRound(\"Won with 5 hits\", temp);\n }\n}", "title": "" }, { "docid": "1c48e1c51cca1ef2f737472323a04bb4", "score": "0.61642617", "text": "function checkWon(){\n\t\tif (counter === bigRandom){\n\t\t\t// $(\"#winLoss\").html(\"You Won!!\");\n\t\t\twinLoss = \"You Won!!\";\n\t\t\twins++;\n\t\t\tgemReset();\n\t\t}else if (counter > bigRandom){\n\t\t\t// $(\"#winLoss\").html(\"You Lost!!\");\n\t\t\twinLoss = \"You Lost!!\";\n\t\t\tlosses++;\n\t\t\tgemReset();\n\t\t} else{\n\t\t\twinLoss = \"\";\n\t\t\twrite();\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "15ce3418baa5efcee260033bbe5f72f4", "score": "0.61590785", "text": "function playerOneWin() {\n\t\t\tthis.fbdata = sync.$asObject();\n\t\t\tthis.fbdata.gameOver = true;\n\t\t\tthis.fbdata.gameResult = \"much win so doge... wow\";\n\t\t\tthis.fbdata.leftScore += 1;\n\t\t\tthis.fbdata.rightScore += 0;\n\t\t\tthis.fbdata.moves = 0;\n\t\t\tthis.fbdata.$save();\n\t}", "title": "" } ]
a127be39a228d1a855a13d8dbfd61cf0
function that parses result of getseqdetails
[ { "docid": "1d0389c64c7f92f22f71ae0c788ccf0c", "score": "0.506666", "text": "function parseRes(res,direction) {\n result = res.responseText;\n //var result = request.responseText;\n // note that results[0] are common values accross all regions\n // this will change value of sequence, age, period, bugzone etc..\n var results = result.split(\"~\");\n eval(results[0]);//add .replace(\",\", \".\")) if age is returned as 3,5 (european style)\n \n cqlSequence = sequence;\n // note that results[1] are different for each licensed region so use arrays\n // each regional map has different version and publishing dates\n var rows = results[1].split(\"@\");\n var rowslen = rows.length - 1;\n // Empty arrays from last query then repopulate from results[1]\n mRegion.length = 0;\n mPubDate.length = 0;\n mPubVersion.length = 0;\n mModule.length = 0;\n mPdf.length = 0;\n mZip.length = 0;\n for (var x = 0; x <= rowslen; x++) {\n var parts = rows[x].split(\";\");\n mRegion[x] = parts[0];\n mPubVersion[x] = parts[1];\n mModule[x] = parts[2];\n mPubDate[x] = parts[3];\n mZip[x] = (parts[4] != undefined) ? parts[4].replace(/\\\\/g, \"/\") : \"\";\n mPdf[x] = (parts[5] != undefined) ? parts[5].replace(/\\\\/g, \"/\") : \"\";\n }\n showVariables(); // Display sequence, mode & publishing details in side panel html\n showCurrentMap(); //add age to box\n applyFilter();\n slider_value = age; \n setSliderValue(age);\n AgeRecalculating = false;\n }", "title": "" } ]
[ { "docid": "b243022a048e50945a60a36d3e0a5a9d", "score": "0.5932577", "text": "function formatSeqs(seqData)\n{\n const lociSummary = [];\n let i;\n for(i in seqData)\n lociSummary.push(getLocus(i,seqData));\n return lociSummary;\n}", "title": "" }, { "docid": "2b5c29ab00aad6c1327e0738799971d2", "score": "0.564793", "text": "parseRawResult(id, rawBioSample) {\n if (typeof rawBioSample !== 'string') {\n throw new Error('wrong input; expected string');\n }\n\n const lines = rawBioSample.split('\\n');\n if (!lines.length) {\n return null;\n }\n\n const result = {\n id: parseInt(id),\n organism: null,\n description: lines.shift(),\n qualifiers: {},\n };\n result.description = result.description.replace(/^\\d+: /, '');\n\n lines.forEach((line) => {\n if (line.startsWith('Organism: ')) {\n result.organism = line.substr('Organism: '.length);\n return;\n }\n\n if (/^\\s+\\//.test(line)) {\n // Qualifier\n const lineWithoutLeadingWhitespace = line.replace(/^\\s+\\//, '');\n const matches = lineWithoutLeadingWhitespace.match(/^(.*?)=\"(.*)\"/);\n if (matches) {\n const key = camelize(matches[1]);\n const value = matches[2];\n\n result.qualifiers[key] = value;\n }\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "c3ade170b9833b2a0c64070fa6e95431", "score": "0.5365905", "text": "function getSynopsis(result) {\n var synopsis;\n if (result.synopsis) {\n synopsis = result.synopsis.substring(0, 135) + \"...\";\n } else if (result.critics_consensus && result.critics_consensus.length > 0) {\n synopsis = result.critics_consensus.substring(0, 135) + \"...\";\n } else {\n synopsis = '';\n }\n return synopsis;\n }", "title": "" }, { "docid": "21a75eef8a81d646ebe03c8d723b1665", "score": "0.5337264", "text": "function getSequenceInfo() {\n var s = board.moves.map(stone.toString).join(';');\n var i = 0;\n while (i < 40 && i < prev.length && i < s.length && s[i] == prev[i]) i++;\n prev = s;\n var r = s.slice(0, i);\n if (i < s.length) {\n if (r != '') r += '... ';\n r += '(' + board.moves.length + ' moves)';\n }\n return r;\n }", "title": "" }, { "docid": "5e0133a449388bcb50d58489d42f23aa", "score": "0.5272047", "text": "function extractFromSequenceFull(videoId){\r\n\tvar fullSeqUrl = \"http://www.dailymotion.com/sequence/full/\";\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.onreadystatechange = function(){ // To be executed when request is done\r\n \t\tif(this.readyState == this.DONE) {\r\n \t\tif(this.status == 200 && this.responseText != null) {\r\n\t \t\t// success!\r\n\t \t\tconsole.log(this.responseText);\r\n\t \t\tvar sequence = JSON.parse(this.responseText);\r\n\t \t\tvar videoUrl = \"\";\r\n\t \t\tfor(var i=0; i < manifest.alternates.length; i++){\r\n\t \t\t\tconsole.log(\"name\" + manifest.alternates.name);\r\n\t \t\t\tif(manifest.alternates[i].name == QUALITY){\r\n\t \t\t\t\tvideoUrl = manifest.alternates[i].template;\r\n\t \t\t\t\tbreak;\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\tvideoUrl = videoUrl.replace(\".mnft\",\".mp4\");\r\n \t\t} else {\r\n\t \t\t// something went wrong\r\n\t \t\tconsole.log(\"Something went wrong when fetching full sequence url\");\r\n \t\t}\r\n \t}\r\n \t}\r\n\txhr.open(\"GET\", fullSeqUrl, true);\r\n\txhr.send();\r\n}", "title": "" }, { "docid": "77f043688e49b4a815e63b7f7aee6216", "score": "0.5255063", "text": "function getInfo(Seq){\r\n\t// 1.1 Initialize and set variable value to 0\r\n\tvar seq,A=0,T=0,C=0,G=0,error=0\r\n\t\ta_perc=0,t_perc=0,c_perc=0,g_perc=0\r\n\t\tgc_perc=0,at_perc=0;\r\n\tseq = Seq.value.replace(/\\s/g, \"\"); //remove whitespace\r\n\tvar nucleotide = seq.toUpperCase(); //convert the input sequence to uppercases\r\n\r\n\t//1.2 Get sequence length\r\n\tvar Seq_length = nucleotide.length;\r\n\r\n\t//1.3 Get the value of each nucleotide base\r\n\tfor(var i=0; i<Seq_length; i++){ //iterate the bases in nucleotide until the last base\r\n\t\tif(nucleotide.charAt(i)==='A'){ //if the base is 'A'\r\n\t\t\tA += 1; //increase count of 'A'\r\n\t\t} else if (nucleotide.charAt(i)==='T'){ //if the base is 'T'\r\n\t\t\tT += 1; //increase count of 'T'\r\n\t\t} else if (nucleotide.charAt(i)==='G'){ //if the base is 'G'\r\n\t\t\tG += 1; //increase count of 'G'\r\n\t\t} else if (nucleotide.charAt(i)==='C'){ //if the base is 'C'\r\n\t\t\tC += 1; //increase count of 'C'\r\n\t\t} else { // if none is A/T/C/G\r\n\t\t\terror += 1; //increase count of 'error'\r\n\t\t}\r\n\t}\r\n\r\n\t//1.4 Calculate the percentage of the bases\r\n\ta_perc = (A/ Seq_length * 100).toFixed(2); \r\n\tt_perc = (T/ Seq_length * 100).toFixed(2); \r\n\tc_perc = (C/ Seq_length * 100).toFixed(2); \r\n\tg_perc = (G/ Seq_length * 100).toFixed(2); \r\n\r\n\t//1.5 Calculate AT & GC percentage content\r\n\tgc_perc = (((G + C) / Seq_length)* 100).toFixed(2);\r\n\tat_perc = (((A + T) / Seq_length) * 100).toFixed(2);\r\n\r\n\t//1.6 Return array containing the info with label\r\n\treturn {\r\n\t\terror: error, seqLength: Seq_length,\r\n\t\tAT: at_perc, GC: gc_perc,\r\n\t\tA: A, T: T, C: C, G: G,\r\n\t\ta_perc: a_perc, t_perc: t_perc, c_perc: c_perc, g_perc: g_perc, \r\n\t};\r\n\r\n}", "title": "" }, { "docid": "102a5c7df833daf308e75ffdf922deea", "score": "0.5244615", "text": "function parse(summary) {\r\n var meta = {};\r\n\r\n /* We get something like:\r\n [sr][mobile][thunderbird] Please fix this bug ASAP\"\r\n First we split it by whitespace, so that we get what we call\r\n parameters([sr][mobile][thunderbird]) and summary(Please fix this bug ASAP).\r\n */\r\n temp = summary.split(\" \");\r\n parameters = temp[0];\r\n meta.summary = temp.slice(1).join(\" \"); /* Take everything except first part\r\n and add whitespaces again, getting\r\n the summary we want.\r\n */\r\n var params = [];\r\n $.each(parameters.split(\"[\"), function(index, value) {\r\n var tempParams = this.split(\"]\"); /* Split everything by \"[\" and \"]\" after,\r\n so that we get an array of parameters\r\n ie. ['sr', 'mobile', 'thunderbird'] \r\n */\r\n for (var i = 0; i < tempParams.length; i++) {\r\n if (tempParams[i] == \"\") { \r\n tempParams.splice(i, 1); /* Check if parameter has value, and remove it\r\n if it doesn't.\r\n */\r\n i--;\r\n }\r\n }\r\n if (tempParams.length >= 1){\r\n params.push(tempParams.join(\"\"));\r\n }\r\n });\r\n console.log(params);\r\n console.log(summary);\r\n meta.locale = params[0].toLowerCase();\r\n meta.categories = params.slice(1);\r\n return meta;\r\n }", "title": "" }, { "docid": "00b830f4793f91bb3d27da73c48f8184", "score": "0.52230847", "text": "function getSummaryInfo(){\r\n var summaryArray=[];\r\n var summaryStr=obj['subfield'][0]['_'];\r\n summaryStr = summaryStr.trim();\r\n if (debug) console.log(summaryStr);\r\n book['summary']=summaryStr;\r\n}", "title": "" }, { "docid": "c3cb4d7af68c94469b6864e73c79a07d", "score": "0.51955295", "text": "function extractUid(description){\n let descPieces = description.split('\\n')\n //console.log(descPieces.length)\n //let descPieces = \"Location: Churchill Rink at Jacksons Landing\\n UID:event_427758495_ngin.com - \\n Uniform: White (Arrival Time: 9:40 AM (Eastern Time (US & Canada)))\".split('\\n')\n if (descPieces.length>0){\n for (let str of descPieces){\n if (str.indexOf('UID:')>0){\n let trimmedstr = str.trim()\n let uid = trimmedstr.substr(4,trimmedstr.indexOf(' ')-4)\n return uid;\n break\n }\n }\n } \n}", "title": "" }, { "docid": "f5c4359719e47e228576335162e0e042", "score": "0.5189716", "text": "function parse(desc) {\n if (!desc)\n return {type: null, schedule: null};\n removeTypos(desc);\n removeJunk(desc);\n return getDetails(desc);\n}", "title": "" }, { "docid": "7405e7df3b74d5d32724f862e7fd47e8", "score": "0.5188137", "text": "function parse(){\n for (let i = 0; i < result.length;i++)\n result[i] = result[i].split(\"\\t\");\n}", "title": "" }, { "docid": "c2e773e013f29330b2c729af9ae99c4f", "score": "0.51293087", "text": "_parseResults(data, parseFunction) {\n let results = data.results[0].data;\n let parsedResults = [];\n results.map((r)=>{\n if (parseFunction) parsedResults = parseFunction(r,parsedResults);\n else {\n if (!r.rest || r.rest.length != 1) return;\n let rData = r.rest[0].data;\n rData['id'] = r.rest[0].metadata.id;\n parsedResults.push(rData);\n return;\n }\n });\n return parsedResults;\n }", "title": "" }, { "docid": "d79f0500e4747bc2934651fba702786b", "score": "0.5100656", "text": "function ParseSequence(state, sequenceType) {\n // console.log(\"SEQUENCE \" + sequenceType);\n state.Print();\n\n var isNewline = false;\n var itemStrings = [];\n var curItemIndex = -1; // -1 indicates not reading an item yet\n var codeBlockCount = 0;\n\n while (!state.Done()) {\n if (state.Char() === Sym.CodeOpen)\n codeBlockCount++;\n else if (state.Char() === Sym.CodeClose)\n codeBlockCount--;\n\n var isWhitespace = (state.Char() === \" \" || state.Char() === \"\\t\");\n var isSkippableWhitespace = isNewline && isWhitespace;\n var isNewListItem = isNewline && (codeBlockCount <= 0) && (state.Char() === Sym.List);\n\n if (isNewListItem) {\n // console.log(\"found next list item\");\n curItemIndex++;\n itemStrings[curItemIndex] = \"\";\n }\n else if (curItemIndex > -1) {\n if (!isSkippableWhitespace)\n itemStrings[curItemIndex] += state.Char();\n }\n\n isNewline = (state.Char() === Sym.Linebreak) || isSkippableWhitespace || isNewListItem;\n\n // console.log(state.Char());\n state.Step();\n }\n // console.log(itemStrings);\n // console.log(\"SEQUENCE DONE\");\n\n var options = [];\n for (var i = 0; i < itemStrings.length; i++) {\n var str = itemStrings[i];\n var dialogBlockState = new ParserState(new BlockNode(BlockMode.Dialog, false /* doIndentFirstLine */), str);\n dialogBlockState = ParseDialog(dialogBlockState);\n var dialogBlock = dialogBlockState.rootNode;\n options.push(dialogBlock);\n }\n\n // console.log(options);\n\n if (sequenceType === \"sequence\")\n state.curNode.AddChild(new SequenceNode(options));\n else if (sequenceType === \"cycle\")\n state.curNode.AddChild(new CycleNode(options));\n else if (sequenceType === \"shuffle\")\n state.curNode.AddChild(new ShuffleNode(options));\n\n return state;\n }", "title": "" }, { "docid": "b5e426c524b2079914a95588a67f6975", "score": "0.5078912", "text": "function _parse(raw)\n{\n // console.log(raw.indexOf('\\n'));\n //var re = /(..REMARKS..[^]*?&&)/,\n // matches = raw.match(re);\n var regexs = {\n latLng: /\\d{2}\\.\\d{2}[N]\\s\\d{2}\\.\\d{2}[W]/,\n value: /\\d{1,2}\\.\\d{1,2}(?=\\sINCH)/,\n date: /\\d{2}\\/\\d{2}\\/\\d{4}/,\n time: /(\\d{4}\\s(AM|PM))/,\n lines: /\\n/\n },\n records = [],\n data = {},\n lines = raw.split(regexs.lines),\n matches = [];\n\n lines.forEach(function(line, index, array)\n {\n var match = '';\n // check for time\n if (regexs.time.test(line.substr(0, 7)))\n {\n // check where next time is\n if (regexs.time.test(array[index + 3]))\n {\n match = array.slice(index, index + 3).join(' ');\n }\n else if (regexs.time.test(array[index + 5]))\n {\n match = array.slice(index, index + 5).join(' ');\n }\n }\n if (match) matches.push(match);\n });\n\n // console.log(regexs);\n // console.log('matches', matches);\n\n // loop through rows\n matches.forEach(function(row)\n {\n // exit if it's not a weather snippet\n // if (row.substr(2, 3) != '000') {\n // return false;\n // }\n // set the date\n var theDate = new Date(row.match(regexs.date)[0]),\n theTime = row.match(regexs.time)[0],\n hours12 = parseInt(theTime.substr(0, 2)),\n hours24 = theTime.substr(-2) == 'AM' ? hours12 : hours12 + 12,\n\n // get lat long\n dirLatLng = row.match(regexs.latLng)[0],\n // convert from directional to hemispheric\n leafLatLng = dirLatLng.split(' ').map(function(latLng)\n {\n if (latLng.substr(-1) == 'N' || latLng.substr(-1) == 'E')\n {\n return latLng.slice(0, 5) * 1;\n }\n else\n {\n return latLng.slice(0, 5) * -1;\n }\n });\n // set the time\n theDate.setHours(hours24);\n theDate.setMinutes(theTime.substr(2, 2));\n\n // populate data\n data = {\n coords: leafLatLng,\n value: parseFloat(row.match(regexs.value)[0]),\n datetime: theDate\n };\n\n\n records.push(data);\n });\n\n // console.log('records', records);\n return records;\n}", "title": "" }, { "docid": "15aa0bc3b775de086904185f00a22bc6", "score": "0.50761485", "text": "async function getEventOnResult(text, result) {\n if (!result.topic || !result.topic.response) return \"response failed \";\n\n let new_result = {};\n const response = result.topic.response;\n\n if (isResultEvent(response)) {\n text = lowercase(text.trim());\n\n var actualEventDate = dateFromString(text);\n if (!actualEventDate) return \"event not found\";\n\n new_result[\"Event\"] = \"Event Found\";\n\n new_result[\"YearMonth\"] = parseYearMonth(text);\n new_result[\"Actual Date\"] = actualEventDate;\n\n if (!new_result[\"YearMonth\"] && actualEventDate) {\n const datee = new Date(actualEventDate);\n new_result[\"YearMonth\"] =\n datee.getFullYear() + \" \" + monthNumToName(datee.getMonth());\n }\n\n var hour = text.match(/[0-9]{1,2}(?:(?: hour))/);\n var time = text.match(/[0-9]{1,2}(?:(?::[0-9]{2})|(?: [0-9]{2}))\\b/);\n\n new_result[\"Time\"] =\n (hour ? hour + \": at: \" : \"\") +\n (time && isStr(time[0]) ? time[0].replace(/\\s+/g, \":\") : \"\");\n\n let addressParser = parseAddress(text, result.addresss);\n if (!addressParser && result.curAddress) {\n addressParser = result.curAddress.country + \" \" + result.curAddress.city;\n }\n new_result[\"Address\"] = addressParser;\n\n new_result[\"Subject\"] = parseLemma(result);\n return new_result;\n }\n return \"event not found\";\n}", "title": "" }, { "docid": "42e762436fa343be942a4ee49ada4c5f", "score": "0.5061729", "text": "function parseMedicationDetails(medicationStr){\n if(medicationStr && medicationStr.length > 0){\n var split = medicationStr.split('^');\n return {ien: split[0].substring(1, split[0].length), name: _str.trim(split[1])};\n }\n return null;\n}", "title": "" }, { "docid": "29c4a3ac8cdb63147682c145c0245db3", "score": "0.5009515", "text": "parse(str){\n\n\n\n }", "title": "" }, { "docid": "6a7d9e5a6c9a4adc436b22402a37673b", "score": "0.50022525", "text": "function parseSimbadMetaObjectList(text) {\n // V-- must use space rather than \\s, as \\s will include beginning \\n\n const [, header, row1] = text.match(/^([ ]*#\\s*[|].+)\\n-+[|].+\\n(1\\s*[|].+)/m) || [null, null, null];\n\n if (row1 == null) {\n return null;\n }\n\n // console.debug('parseSimbadMetaObjectList()');\n // window._header = header;\n // window._row1 = row1;\n // console.debug(header);\n // console.debug(row1);\n\n function get(key) {\n const idx = header.search(new RegExp(`[|]\\\\s*${key}`));\n if (idx < 0) {\n return null;\n }\n // console.debug(` key ${key}: ${idx} ; substr: ${row1.substring(idx+1, idx+11)} ; head-sub: ${header.substring(idx+1, idx+11)}`);\n // console.debug(header.substring(idx+1));\n // console.debug(row1.substring(idx+1));\n return (row1.substring(idx+1).match(/^\\s*(.+?)\\s*([|]|$)/) || [null, null])[1];\n }\n\n function getFloat(key) {\n const resText = get(key);\n return (resText != null && resText != '~') ? parseFloat(resText) : null;\n }\n\n\n const id = get('identifier');\n const type = get('typ');\n const magB = getFloat('Mag B');\n const magV = getFloat('Mag V');\n const magR = getFloat('Mag R');\n const angularDistance = getFloat('dist');\n const aliases = null; // not available\n\n return { id, type, magB, magV, magR, angularDistance, aliases };\n}", "title": "" }, { "docid": "d2a4a0953cb495392f9af2f016338604", "score": "0.49883616", "text": "parseNoteFromRaw() {\n this.parseCategory();\n this.parseText();\n this.parseDateScheduled();\n this.parseType();\n }", "title": "" }, { "docid": "02cc8f9a253bfdb3325e41d37613a07e", "score": "0.4980324", "text": "function parseInfo(info){\n\t\tresult = \"\";\n\t\tresult += \"Name:\\t\\t\" + info[\"itemname\"] + \"\\n\";\n\t\tresult += \"#\" + info[\"itemnum\"] + \"\\tLocation: \" + info[\"location\"] + \"\\tType: \" + info[\"type\"] + \"\\n\";\n\t\tresult += \"Size: \" + info[\"size\"]+ \"\\tDyelot: \" + info[\"dyelot\"];\n\t\treturn result;\n\t}", "title": "" }, { "docid": "243962a1fd26038a488a3682a1ac3fc6", "score": "0.4960022", "text": "async function getNetSnmpInfo4()\n{\n let heading;\n let fieldNames;\n let info = {};\n let bDefinition = true;\n\n return Promise.resolve()\n .then(() => fsp.readFile(\"/proc/net/snmp\"))\n .then((content) => content.toString().split(\"\\n\"))\n .then(\n (lines) =>\n {\n lines.forEach(\n (line) =>\n {\n let thisHeading;\n let fieldValues;\n\n // An empty line signifies the end\n line = line.trim();\n if (line.length === 0)\n {\n return;\n }\n\n // A definition line looks like:\n // Ip: Forwarding DefaultTTL InReceives ...\n //\n // A value line looks like:\n // Ip: 1 64 87367079 ...\n if (bDefinition)\n {\n [ heading, fieldNames ] = line.split(/: */);\n fieldNames = fieldNames.split(\" \");\n }\n else\n {\n [ thisHeading, fieldValues ] = line.split(/: */);\n\n // We expect this heading to be the same as the one in\n // the definition.\n if (thisHeading != heading)\n {\n throw new Error(\n `Unexpected heading ${thisHeading}; expected ${heading}`);\n }\n\n fieldValues = fieldValues.split(\" \");\n\n // We expect the number of fieldValues to match the\n // number of fieldNames\n if (fieldValues.length != fieldNames.length)\n {\n throw new Error(\n [\n \"Number of field names in \",\n JSON.stringify(fieldNames),\n \" does not match number of values in \",\n JSON.stringify(fieldValues)\n ].join(\"\"));\n }\n\n // Fill in the info map for this heading\n info[heading] = {};\n fieldNames.forEach(\n (name, i) =>\n {\n info[heading][name] = fieldValues[i];\n });\n }\n\n bDefinition = ! bDefinition;\n });\n\n return info;\n });\n}", "title": "" }, { "docid": "1fa476397cfe2acbb101004d3b19c828", "score": "0.49553525", "text": "summaryExtraction() {\n return this.getAttribute('summary').split(',');\n }", "title": "" }, { "docid": "0724d669481bf339962c2141f5bb7af0", "score": "0.49526334", "text": "function getMomentStrs(str) {\n let result = []\n //1. split by line breaker into note segments, each segments containing notes to be played at the same moment\n let _arr = str.split(/\\n/)\n // console.log(_arr)\n if (_arr) {\n \n _arr.forEach((d, i) => {\n if (d !== null && d.trim().length > 0){\n let tmp={}\n tmp.line = i+1\n tmp.data=d\n result.push(tmp)\n } \n })\n }\n return result\n} // getMomentStrs", "title": "" }, { "docid": "b9c9ad5dc366619ddf86717cbf619739", "score": "0.4949581", "text": "exportMermaidSeq() {\n var seqMetricsQuery = {\n fields: ['mermaid'],\n scope: {\n limit: 0\n },\n responseType: 'stronly'\n };\n var format = 'mermaid';\n // Query sequence diagram\n this.props.metricsApi.postSeqQuery(seqMetricsQuery, (error, data) =>\n this.postSeqQueryCb(error, data, format)\n );\n }", "title": "" }, { "docid": "9237fbd92b9e367b0020ffa6fe562734", "score": "0.4948098", "text": "static parse(text) {\n var ATTRIBUTE_RE = /^\\s*([-A-Za-z]+)[=:](.*)$/;\n var lines = text.split('\\n');\n var cutoff = lines.length - 1;\n // Peel off the trailing empty lines.\n while (cutoff >= 1 && lines[cutoff] === '')\n cutoff--;\n // Peel off the attributes.\n var attributes = [];\n while (cutoff >= 1) {\n if (lines[cutoff] !== '') {\n var match = ATTRIBUTE_RE.exec(lines[cutoff]);\n if (!match)\n break;\n\n attributes.push([match[1], match[2]]);\n }\n cutoff--;\n }\n // Peel off any empty line separating the attributes and the message.\n while (cutoff >= 1 && lines[cutoff] === '')\n cutoff--;\n // Set the description attributes.\n return [lines.splice(0, cutoff + 1).join('\\n'), attributes.reverse()];\n }", "title": "" }, { "docid": "e9b37f18749c346d4c87c62ab9034372", "score": "0.49272794", "text": "parseMIrecord(input) { return Parser.parse(input, { startRule: 'GDBMI_RECORD' }); }", "title": "" }, { "docid": "4402ef66f0b64cc4dd4d3346fa182119", "score": "0.49212965", "text": "function parseResult()\n\t{\n\t\t\n\t\t// To avoid detecting issues i only check for the most recent word.\n\t\tvar mostrecentword = myRec.resultString.split(' ').pop();\n\t\tif(mostrecentword.indexOf(\"XXX\")!==-1) { XXXX}\n\t\telse if(mostrecentword.indexOf(\"fuck\")!==-1) { Fuck(); }\n\t\telse if(mostrecentword.indexOf(\"beautiful\")!==-1) { Beautiful(); }\n\t\telse if(mostrecentword.indexOf(\"sorry\")!==-1) { Sorry(); }\n\t\telse if(mostrecentword.indexOf(\"slow\")!==-1) { Slow(); time = 3; }\n else if(mostrecentword.indexOf(\"start\")!==-1) { time = 1; }\n else if(mostrecentword.indexOf(\"begin\")!==-1) { time = 1; }\n else if(mostrecentword.indexOf(\"next\")!==-1) { time = 2; }\n else if(mostrecentword.indexOf(\"flower\")!==-1) { tester(); }\n\t\tconsole.log(mostrecentword);\n\t}", "title": "" }, { "docid": "93a5f85dee1aab03cf112c50db97fd78", "score": "0.49209747", "text": "function getLocus(locusNo,seqData)\n{\n // create copy of seqData to sort in place\n const sData = {noseqs: seqData[locusNo].noseqs, nosites: seqData[locusNo].nosites, sequences: []}; \n for(let j in seqData[locusNo].sequences)\n sData.sequences.push({seq: seqData[locusNo].sequences[j].seq, seqname: seqData[locusNo].sequences[j].seqname}); \n // finds longest sequence name\n const longestName = sData.sequences.sort(function (a, b) { return b.seqname.length - a.seqname.length; })[0].seqname;\n // pad a name with whitespace until its length equals longestName\n const padName = (longName, currName) => { let newName=currName; let diff=longName.length - currName.length; for(let i=1; i<=diff; i++) newName += \" \"; return (newName); };\n // create a text string for displaying locus\n let text=\"\";\n for(let i=0; i< seqData[locusNo].sequences.length; i++)\n {\n text += (padName(longestName,seqData[locusNo].sequences[i].seqname) + \" \" + seqData[locusNo].sequences[i].seq );\n if(i !== seqData[locusNo].sequences.length -1)\n text += \"\\n\";\n }\n return text;\n}", "title": "" }, { "docid": "2e52a4b5ff71309c71bed66c1c50f6d9", "score": "0.4914613", "text": "exportSdorgSeq() {\n var seqMetricsQuery = {\n fields: ['sdorg'],\n scope: {\n limit: 0\n },\n responseType: 'stronly'\n };\n var format = 'sdorg';\n // Query sequence diagram\n this.props.metricsApi.postSeqQuery(seqMetricsQuery, (error, data) =>\n this.postSeqQueryCb(error, data, format)\n );\n }", "title": "" }, { "docid": "22161e4b7b6b168f70d74b3fdf97c060", "score": "0.4904694", "text": "function parsingRouteInfo(xml) {\n\tvar output = [];\n\n\tvar stops = $(xml).find('route>stop');\n\tstops.each(function(i, e) {\n\t\tvar stop = $(e).attr('title');\n\t\toutput.push(stop);\n\t});\n\n\tvar route = $(xml).find('route');\n\tvar routeName = $(route).attr('title');\n\n\treturn [output[0], output.pop(), routeName];\n}", "title": "" }, { "docid": "836b0deccbc5aabbb9941d70b5eab8f9", "score": "0.49045184", "text": "get details() {\n if (this._study.details) {\n return this._study.details.value;\n } else {\n return \"\";\n }\n }", "title": "" }, { "docid": "02a626456d59e1603fd45049fc4289f2", "score": "0.48948532", "text": "function parseTextHelper(result) {\r\n let header = \"#\";\r\n heirarchy.tree.push({\r\n \"name\": \"\",\r\n \"text\": result,\r\n \"id\": \"Part\",\r\n \"sections\": [],\r\n \"level\": 0,\r\n \"header\": header,\r\n })\r\n parseText(header, heirarchy.tree[0]);\r\n}", "title": "" }, { "docid": "6af6941ba523a64c28d539843992ccbb", "score": "0.48563075", "text": "function do_parse() {\n var s = document.getElementById(\"q\").value;\n var osises = bcv.parse(s).osis_and_indices();\n\n if (osises.length > 0) {\n }\n for (var i = 0, last = osises.length; i < last; i++) {\n var osis = osises[i];\n var text = s.substr(osis.indices[0], osis.indices[1] - osis.indices[0]);\n document.getElementById(\"stevie\").innerHTML = osis.osis;\n var sgverse = document.getElementById(\"sg-passage\");\n sgverse.setAttribute(\"data-passage\", osis.osis);\n }\n}", "title": "" }, { "docid": "c8c6c2af2fe2c1d1c7f86d6bd434b521", "score": "0.4853107", "text": "function fnFormatDetails_script ( nTr )\n{\n var iIndex \t= \toTable.fnGetPosition( nTr );\n var aData \t= \toTable.fnSettings().aoData[iIndex]._aData;\n var comment\t=\taData[1];\n var record\t=\taData[2];\n var iovList;//\t=\tiovList_array[record];//aData[9];\n\n if(typeof iovList_array[record] == \"undefined\"){\n getIovListBig(record);\n }\n else{\n \n iovList\t=\tiovList_array[record];//aData[9];\n setContenentInInnerTable(iovList,record);\n }\n}", "title": "" }, { "docid": "9fe8618f0d6c2695a6d7416eab1f8611", "score": "0.48380077", "text": "function getInstructionSteps(seq) {\n return seq.split(' ');\n}", "title": "" }, { "docid": "453be28adb0a4ec939e2d9acd547497e", "score": "0.48310453", "text": "get parseInfo() {\r\n return undefined;\r\n }", "title": "" }, { "docid": "66efe903455584e8c2ac8b882a8dfa50", "score": "0.47987974", "text": "async getPartsBySerialnumber(ctx, args) {\n\t \n const iterator = await ctx.stub.getQueryResult(\"{\\\"selector\\\":{\\\"docType\\\":\\\"Parts\\\",\\\"serialnumber\\\":\\\"\" + argsJson[0] + \"\\\"}}\");\n if (iterator == null) {\n throw new Error(\"Error in fetching details\");\n\n }\n const allResults = [];\n while (true) {\n const res = await iterator.next();\n if (res.value && res.value.value.toString()) {\n const Key = res.value.key;\n let Record;\n try {\n Record = JSON.parse(res.value.value.toString('utf8'));\n } catch (err) {\n Record = res.value.value.toString('utf8');\n }\n allResults.push({ Key, Record });\n }\n if (res.done) {\n await iterator.close();\n return JSON.stringify(allResults);\n }\n }\n }", "title": "" }, { "docid": "ea839ce44e9b2a0007cadd11fcea0ad1", "score": "0.47792098", "text": "function BuildResultSetfroMxID(details)\n{\n var resultSet = new Array();\n\n for(i in details)\n {\n var arg1 = new Object();\n console.log(i);\n arg1.firstName = details[i].firstName;\n arg1.middleName = details[i].middleName;\n arg1.lastName = details[i].lastName;\n arg1.city = details[i].city;\n arg1.seqId = 'MX' + details[i].mxId + details[i].mxIdSuffix;\n arg1.id = details[i]._id;\n resultSet.push(arg1);\n }\n var jsonResultSet = JSON.parse(JSON.stringify(resultSet));\n\n return jsonResultSet;\n\n}", "title": "" }, { "docid": "927f0c2f0a2834a79ec50c56c889245b", "score": "0.4778316", "text": "function getSequenceCrNote(center_id) {\n\tlet invNoQry = '';\n\n\tinvNoQry = ` select concat(\"CN-\",'${currentTimeInTimeZone('Asia/Kolkata', 'YY')}', \"/\", '${currentTimeInTimeZone(\n\t\t'Asia/Kolkata',\n\t\t'MM',\n\t)}', \"/\", lpad(cr_note_seq, 5, \"0\")) as crNoteNo from financialyear \n\t\t\t\twhere \n\t\t\t\tcenter_id = '${center_id}' and \n\t\t\t\tCURDATE() between str_to_date(startdate, '%d-%m-%Y') and str_to_date(enddate, '%d-%m-%Y') `;\n\n\treturn new Promise(function (resolve, reject) {\n\t\tpool.query(invNoQry, function (err, data) {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t\tresolve(data[0].crNoteNo);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "5783fede6aae3a243f099e887337dc83", "score": "0.4774015", "text": "function getDetails(res, mysql, context, interactId, complete){\r\n var sql = \"SELECT I.detailsId, I.startTime, I.details, C.type FROM interactionDetails AS I LEFT JOIN communicationModes AS C ON I.comId=C.comId WHERE I.interactId=? ORDER BY I.startTime;\";\r\n var inserts = [interactId];\r\n\r\n mysql.pool.query(sql, inserts, function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n // This formats the time attribute:\r\n for (index = 0; index < results.length; index++) { \r\n let time = results[index].startTime;\r\n let hour = time.slice(0, 2);\r\n let minutes = time.slice(3, 5)\r\n let halfOfDay = (hour <= \"12\") ? \"AM\" : \"PM\";\r\n if (halfOfDay == \"PM\") {\r\n hour = hour - 12;\r\n }\r\n hour = hour * 1; // Coerce to a number to get rid of leading zero.\r\n results[index].startTime = hour + \":\" + minutes + \" \" + halfOfDay;\r\n }\r\n context.noResults = (results.length == 0) ? true : false;\r\n context.details = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "10bc26c350021d99a928e3cd6370aef5", "score": "0.4765031", "text": "async parseMarkdownDetails(files) {\n const allArticlesInfo = [];\n for (let file of files) {\n const fileStream = fs.createReadStream(`./markdown/${file}`);\n const rl = readline.createInterface({\n input: fileStream,\n crlfDelay: Infinity,\n });\n\n //looping through first 4 lines (title, date,description,img,level)\n let i = 1;\n const all3lines = [];\n all3lines.push(file); // storing the file name\n for await (const line of rl) {\n if (i === 6) break;\n all3lines.push(line);\n i++;\n }\n // all3lines = [filename,'title:','date:','desc:','level']\n //sending the 4 lines to get all info\n allArticlesInfo.push(parseInfo(all3lines));\n }\n\n return allArticlesInfo; // array of objects [{title:'',date:'',desc:'},..]\n }", "title": "" }, { "docid": "f2d704c831e8080c3c7804ce857bb3f4", "score": "0.47637507", "text": "function parseSequenceRecord(buffer, fileOffset) {\n var jb = new _jbinary2['default'](buffer, _formatsTwoBitTypes2['default'].TYPE_SET);\n var header = jb.read('SequenceRecord');\n\n var dnaOffset = jb.tell() + 8 * header.maskBlockCount + 4;\n\n return {\n numBases: header.dnaSize,\n unknownBlockStarts: header.nBlockStarts,\n unknownBlockLengths: header.nBlockSizes,\n numMaskBlocks: header.maskBlockCount,\n maskBlockStarts: [],\n maskBlockLengths: [],\n dnaOffsetFromHeader: dnaOffset,\n offset: fileOffset\n };\n}", "title": "" }, { "docid": "1f9df369456121f6015358f565187140", "score": "0.47631603", "text": "get sequence() {\n return this.extnValueObj.subs[0];\n }", "title": "" }, { "docid": "1f9df369456121f6015358f565187140", "score": "0.47631603", "text": "get sequence() {\n return this.extnValueObj.subs[0];\n }", "title": "" }, { "docid": "88474d3aa9fe297423e7c349c78e9aac", "score": "0.47562924", "text": "function getDecode(apt, aptObj) {\n apt = apt.toUpperCase();\n if (aptNameDecode[apt] === undefined) {\n $.get('/dwr/exec/locationHelper.getMatchedLocations.dwr', {\n 'callCount': '1', \n 'c0-scriptName': 'locationHelper', \n 'c0-methodName': 'getMatchedLocations', \n 'xml': 'true', \n 'c0-param0': 'string:' + apt\n }, function (data) {\n var rx = new RegExp('.*\"([^,\"]+,\\\\s[^,]+,\\\\s' + apt + ',\\\\s[^,\"]+)\".*'),\n // extract aiport details - ex.: \"Madrid, Spain, MAD, Madrid\"\n aptDetails = data.replace('\\n', ' ').replace(rx, '$1'),\n aptDetailsArray = aptDetails.split(','),\n // extract airport name from airport details\n aptName = $.trim(aptDetailsArray[3]);\n aptNameDecode[apt] = aptName;\n\n $(aptObj).html(aptName + ' (' + apt + ')');\n });\n } else {\n $(aptObj).html(aptNameDecode[apt] + ' (' + apt + ')');\n }\n }", "title": "" }, { "docid": "7f5eb3bb5d8d51a1a43b7cc3045bbc7d", "score": "0.47450164", "text": "function parseABCNotes(str) {\n var tokens = str.match(ABCtoken), parsed = null,\n index = 0, dotted = 0, beatlet = null, t;\n if (!tokens) {\n return null;\n }\n while (index < tokens.length) {\n // Ignore %comments and !markings!\n if (/^[\\s%]/.test(tokens[index])) { index++; continue; }\n // Handle inline [X:...] information fields\n if (/^\\[[A-Za-z]:[^\\]]*\\]$/.test(tokens[index])) {\n handleInformation(\n tokens[index].substring(1, 2),\n tokens[index].substring(3, tokens[index].length - 1).trim()\n );\n index++;\n continue;\n }\n // Handled dotted notation abbreviations.\n if (/</.test(tokens[index])) {\n dotted = -tokens[index++].length;\n continue;\n }\n if (/>/.test(tokens[index])) {\n dotted = tokens[index++].length;\n continue;\n }\n if (/^\\(\\d+(?::\\d+)*/.test(tokens[index])) {\n beatlet = parseBeatlet(tokens[index++]);\n continue;\n }\n if (/^[!+].*[!+]$/.test(tokens[index])) {\n parseDecoration(tokens[index++], accent);\n continue;\n }\n if (tokens[index] == \"{\") {\n // TED: Ignore grace notes (for now).\n while(index < tokens.length) {\n if(tokens[index++] == \"}\") break;\n }\n continue;\n }\n/*\n if ((tokens[index] == \"|\") && (tokens[index+1] == \"1\")){\n // TED: skip first endings\n index = index + 2;\n while(index++ < tokens.length) {\n if((tokens[index] == \":|\") && (tokens[index+1]== \"2\")) { \n break;\n }\n }\n continue;\n }\n*/\n if (/^.?\".*\"$/.test(tokens[index])) {\n // Ignore double-quoted tokens (chords and general text annotations).\n index++;\n continue;\n }\n if (/^[()]$/.test(tokens[index])) {\n if (tokens[index++] == '(') {\n accent.slurred += 1;\n } else {\n accent.slurred -= 1;\n if (accent.slurred <= 0) {\n accent.slurred = 0;\n if (context.stems && context.stems.length >= 1) {\n // The last notes in a slur are not slurred.\n slurStem(context.stems[context.stems.length - 1], false);\n }\n }\n }\n continue;\n }\n // Handle measure markings by clearing accidentals.\n if (/\\|/.test(tokens[index])) {\n for (t in accent) {\n if (t.length == 1) {\n // Single-letter accent properties are note accidentals.\n delete accent[t];\n }\n }\n index++;\n continue;\n }\n parsed = parseStem(tokens, index, key, accent);\n // Skip unparsable bits\n if (parsed === null) {\n index++;\n continue;\n }\n // Process a parsed stem.\n if (beatlet) {\n scaleStem(parsed.stem, beatlet.time);\n beatlet.count -= 1;\n if (!beatlet.count) {\n beatlet = null;\n }\n }\n // If syncopated with > or < notation, shift part of a beat\n // between this stem and the previous one.\n // TED: Possible place to influence the LILT\n if (dotted && context.stems && context.stems.length) {\n if (dotted > 0) {\n t = (1 - Math.pow(0.5, dotted)) * parsed.stem.time;\n } else {\n t = (Math.pow(0.5, -dotted) - 1) *\n context.stems[context.stems.length - 1].time;\n }\n syncopateStem(context.stems[context.stems.length - 1], t);\n syncopateStem(parsed.stem, -t);\n }\n dotted = 0;\n // Slur all the notes contained within a strem.\n if (accent.slurred) {\n slurStem(parsed.stem, true);\n }\n // Start a default voice if we're not in a voice yet.\n if (context === result) {\n startVoiceContext(firstVoiceName());\n }\n if (!('stems' in context)) { context.stems = []; }\n // Add the stem to the sequence of stems for this voice.\n context.stems.push(parsed.stem);\n // Advance the parsing index since a stem is multiple tokens.\n index = parsed.index;\n }\n }", "title": "" }, { "docid": "19514aadcc4ca5dae5f29454a6a1b8d2", "score": "0.4732971", "text": "parseReplyText(line) {\r\n const isSupported = this.hasExtension('ENHANCEDSTATUSCODES');\r\n if (isSupported) {\r\n return line.substr(4).split(/[\\s](.+)?/, 2)[1];\r\n }\r\n else {\r\n return line.substr(4);\r\n }\r\n }", "title": "" }, { "docid": "b7ca9e0e06688b4f5f479079ca8be1d4", "score": "0.47183007", "text": "function parse_summary() {\n\n var desc_elms = $('iframe#bookDesc_iframe').contents();\n var desc_text_elms = $(desc_elms).find('div#iframeContent').contents();\n var desc_text = $(desc_text_elms).map(function(i, e) {\n if (this.nodeType === 3) { return $(this).text(); }\n else { return $(this).prop('outerHTML'); }\n }).toArray().join('');\n\n return desc_text;\n}", "title": "" }, { "docid": "a927a4a0358a610e97072ec6e3a93001", "score": "0.47059047", "text": "function parseLunrResults(results) {\n var html = []\n for (var i = 0; i < results.length; i++) {\n var id = results[i]['ref']\n var item = PREVIEW_LOOKUP[id]\n console.log(item, '搜索出来的结果')\n var title = item['t']\n var preview = item['p']\n var link = item['l']\n var result =\n '<p><span class=\"result-title\"><a href=\"' +\n link +\n '\">' +\n title +\n '</a></span><br><span class=\"result-preview\">' +\n preview +\n '</span></p>'\n html.push(result)\n }\n if (html.length) {\n return html.join('')\n } else {\n return '<p>Your search returned no results.</p>'\n }\n}", "title": "" }, { "docid": "28af9acd5c1cd9028fe19e9cfc567c5e", "score": "0.46865886", "text": "function parseRCards(data)\n{\n var res=[];\n var currentData;\n var current;\n var id;\n\n if (_parseModeSettings.beginId)\n {\n id=_parseModeSettings.beginId;\n }\n\n else\n {\n id=0;\n }\n\n for (var x=0,l=data.length;x<l;x++)\n {\n currentData=data[x];\n\n current={\n name:currentData[0],\n place:currentData[1],\n time:currentData[2],\n material:currentData[3],\n img:currentData[4],\n id:id\n };\n\n if (currentData.length>5)\n {\n current.note=currentData[5];\n }\n\n res.push(current);\n id++;\n }\n\n return res;\n}", "title": "" }, { "docid": "8ecd47e594dfaac1929472cc4262120b", "score": "0.46855092", "text": "function parse() {\n\n}", "title": "" }, { "docid": "a665baa10d7fc99cdcce2a5873688b63", "score": "0.46778587", "text": "function parseFasta(str, type, re) { \n fastaJson = fasta2json.ParseFasta(str);\n \n return fastaJson.filter(a => a[\"head\"].length > 0).map((entry) => {\n newEntry = {\n \"source\": \"\",\n \"description\": \"\",\n \"type\":type,\n \"name\": \"\",\n \"sequence\": \"\"\n }\n \n baseMatch = entry[\"head\"].match(re)\n newEntry[\"source\"] = baseMatch[1]\n newEntry[\"name\"] = baseMatch[2]\n newEntry[\"description\"] = baseMatch[3]\n newEntry[\"sequence\"] = entry[\"seq\"].toLowerCase().replace(/(t)/g, \"u\")\n \n return newEntry\n })\n}", "title": "" }, { "docid": "99a6cf51940a74650032516be4234c9e", "score": "0.46763158", "text": "function parseTestcase(testcase) {\n var lines = testcase.split(\"\\n\");\n\n /* check that the first non-empty, non-comment line is #data */\n for each (var line in lines) {\n if (!line || startsWith(line, \"##\")) {\n continue;\n }\n if (line == \"#data\")\n break;\n log(lines);\n throw \"Unknown test format.\"\n }\n\n var input = [];\n var output = [];\n var errors = [];\n var currentList = input;\n for each (var line in lines) {\n if (startsWith(line, \"##todo\")) {\n todo(false, line.substring(6));\n continue;\n }\n // allow blank lines in input\n if (!line && currentList != input) {\n continue;\n }\n if (!(startsWith(line, \"#error\") ||\n startsWith(line, \"#document\") ||\n startsWith(line, \"#data\"))) {\n if (currentList == output && startsWith(line, \"|\")) {\n \tcurrentList.push(line.substring(2));\n } else {\n\t currentList.push(line);\n }\n } else if (line == \"#errors\") {\n currentList = errors;\n } else if (line == \"#document\") {\n currentList = output;\n }\n } \n //logger.log(input.length, output.length, errors.length);\n return [input.join(\"\\n\"), output.join(\"\\n\"), errors];\n}", "title": "" }, { "docid": "f09686e6c2e0e5bbf6188a9ee8c83845", "score": "0.46762866", "text": "function getSeqDetails(sliderAge, direction) {\n loadingPanel.show();\n //remove feature highlights and popups\n try {\n app.mapPanel.map.getLayersByName(\"highlightLayer\")[0].removeAllFeatures();\n } catch (e) { }\n Ext.select(\"div.gx-popup\").remove();\n\n AgeRecalculating = true;\n //when at end, stop at end\n //if (sliderAge < slider_lastvalue && direction == \"current\") { direction = \"last\"; }\n\n gde = curMode == \"GDE\" ? true : false;\n\n Ext.Ajax.request({\n url: \"handlers/seqQuery.ashx?age=\" + sliderAge + \"&direction=\" + direction + \"&mode=\" + gde + \"&rnd=\" + Math.random(),\n method: 'get',\n success: function (res) { parseRes(res, direction) }\n });\n}", "title": "" }, { "docid": "fe23c99ae0300eb29a963650f8dde5b5", "score": "0.46655643", "text": "function read_record_summary(input, pos) {\n var scanner = Scanner(input),\n record_summary = {\n num_blocks: scanner.readNum(),\n num_entries: scanner.readNum(),\n index_len: scanner.readNum(),\n blocks_len: scanner.readNum(),\n // extra field\n len: scanner.offset(), // actual length of record section (excluding record block index), varying with engine version attribute\n };\n \n // start position of record block from head of mdx/mdd file\n record_summary.block_pos = pos + record_summary.index_len + record_summary.len;\n\n return record_summary;\n }", "title": "" }, { "docid": "3ae88f27afcc81eee09a545835aaf37f", "score": "0.4660811", "text": "function parse() {\n\treturn es.pipeline(\n\t\t// Parse one complete line at a time\n\t\tes.split(),\n\t\t// Only use non-empty lines\n\t\tfilter(Boolean),\n\t\t// Parse each line into name/value pair\n\t\tes.mapSync(parseData),\n\t\t// Reduce data into single result object to pass to callback\n\t\treduce(function(result, data) {\n\t\t\tresult[data.name] = data.value;\n\t\t\treturn result;\n\t\t}, {})\n\t);\n}", "title": "" }, { "docid": "a22c081fd22e891bb8e785a032254dcd", "score": "0.46562496", "text": "function details(point) {\n\n if (point.ctype == 'task') {\n var elem = point.details;\n s = '<b>Task : ' + elem.taskID + '</b>';\n s += '<br> Stage ID : ' + elem.stageID;\n s += '<br> Host : ' + elem.host;\n s += '<br> Duration : ' + elem.duration + ' ms';\n s += '<br> Deserialize : ' + elem.deserializeTime + ' ms';\n s += '<br> Run time : ' + elem.runTime + ' ms';\n //debugger\n s += '<br> Result Size : ' + Math.round(elem.resultSize / 1024, 2) + ' KB';\n if (elem.inputFrom != undefined) {\n s += '<details>'\n s += '<summary> Input </Summary>'\n s += 'Input From : ' + elem.inputFrom;\n s += '<br> Input Size : ' + Math.round(elem.inputSize / 1024, 2) + ' KB';\n s += '</details>'\n }\n if (elem.shuffleWritten != undefined) {\n s += '<details>'\n s += '<summary> Shuffle Write </Summary>'\n s += 'Bytes Written : ' + Math.round(elem.shuffleWritten / 1024, 2) + ' KB';\n s += '<br> Shuffle Time : ' + elem.shuffleWriteTime + ' ms';\n s += '</details>'\n }\n if (elem.shuffleReadRemoteBlocks != undefined) {\n s += '<details>'\n s += '<summary> Shuffle Read </Summary>'\n s += 'Remote Blocks : ' + elem.shuffleReadRemoteBlocks;\n s += '<br> Local Blocks : ' + elem.shuffleReadLocalBlocks;\n s += '<br> Fetch Wait Time : ' + elem.shuffleReadFetchWait + ' ms';\n s += '<br> Remote Bytes Read : ' + Math.round(elem.shuffleReadRemoteBytes / 1024, 2) + \" \";\n s += '</details>';\n }\n // $(\"#details\").empty().html(s);\n }\n\n if (point.ctype == 'stage') {\n var elem = point.details;\n s = '<b> Stage ID : ' + elem.stageID + '</b>';\n s += '<br> Duration : ' + elem.duration + ' ms';\n s += '<details><summary>Tasks</summary>' + prettyArray(elem.taskList);\n // $(\"#details\").empty().html(s);\n }\n if (point.ctype == 'job') {\n var elem = point.details;\n s = '<b> Job ID : ' + elem.jobID + '</b>';\n s += '<br> Duration : ' + elem.duration + ' ms';\n s += '<details><summary>Stages</summary>'\n for (var i = 0; i < elem.stageIDs.length; i++) {\n var sta = stages[elem.stageIDs[i]]\n if (sta != undefined) {\n s += '<br>' + stageFormatter(stages[elem.stageIDs[i]])\n }\n }\n s += '</details>'\n\n }\n if (s != undefined) {\n $(\"#details\").empty().html(s);\n $(\"#details\").css(\"visibility\", \"visible\");\n }\n}", "title": "" }, { "docid": "4641d9e029512c0ef4d978a88321ebd6", "score": "0.46485898", "text": "function _parse(res){\n\treturn eval('(' + res + ')');\n}", "title": "" }, { "docid": "cc7d9cfd273dd8ab45df54d88ab55299", "score": "0.46401194", "text": "function parseScanQRCodeResultStr(resultStr) {\n var strs = resultStr.split(',')\n return strs[strs.length - 1]\n }", "title": "" }, { "docid": "fe6253862c4ce02fc1e212cdf8998ff2", "score": "0.46366048", "text": "function parse_ASIN() {\n\n var prod_details_elms = $('div#detail-bullets table#productDetailsTable div.content ul');\n var asin_text = $(prod_details_elms).find('li:has(b:contains(\"ASIN:\"))').text();\n\n asin_text = asin_text.split(' ')[1];\n return asin_text;\n}", "title": "" }, { "docid": "6c5130599fb89f73882b6867a34e5545", "score": "0.4631664", "text": "function extract(result) {\n return result.data\n }", "title": "" }, { "docid": "18b0015c4cb57a94b90be2184d8e8dbb", "score": "0.4619891", "text": "_parseResult(body, method) {\n return new Promise((resolve, reject) => {\n parseString(body, {\n tagNameProcessors: [stripNS],\n explicitArray : false,\n ignoreAttrs : true\n }, function(err, result){\n if(!err){\n const data = result.Envelope.Body[`${method}Response`];\n resolve(data);\n } else {\n reject(err);\n }\n }); \n });\n }", "title": "" }, { "docid": "4051bc35668a04fe8d1fa23723b3ed8e", "score": "0.45995724", "text": "function parse(program){\n return read_from_tokens(tokenize(program));}", "title": "" }, { "docid": "9228eca9cf116a30ad35324a2e352dc4", "score": "0.45962027", "text": "async getSequence(address) {\n const account = await this.getAccount(address);\n if (!account) {\n throw new Error(\"Account does not exist on chain. Send some tokens there before trying to query sequence.\");\n }\n return {\n accountNumber: account.accountNumber,\n sequence: account.sequence,\n };\n }", "title": "" }, { "docid": "ed19323fc57b8422fb736c0b991d8e4e", "score": "0.45805377", "text": "function parseABCNotes(str) {\n var tokens = str.match(ABCtoken), parsed = null,\n index = 0, dotted = 0, beatlet = null, t;\n if (!tokens) {\n return null;\n }\n while (index < tokens.length) {\n // Ignore %comments and !markings!\n if (/^[\\s%]/.test(tokens[index])) { index++; continue; }\n // Handle inline [X:...] information fields\n if (/^\\[[A-Za-z]:[^\\]]*\\]$/.test(tokens[index])) {\n handleInformation(\n tokens[index].substring(1, 2),\n tokens[index].substring(3, tokens[index].length - 1).trim()\n );\n index++;\n continue;\n }\n // Handled dotted notation abbreviations.\n if (/</.test(tokens[index])) {\n dotted = -tokens[index++].length;\n continue;\n }\n if (/>/.test(tokens[index])) {\n dotted = tokens[index++].length;\n continue;\n }\n if (/^\\(\\d+(?::\\d+)*/.test(tokens[index])) {\n beatlet = parseBeatlet(tokens[index++]);\n continue;\n }\n if (/^[!+].*[!+]$/.test(tokens[index])) {\n parseDecoration(tokens[index++], accent);\n continue;\n }\n if (/^.?\".*\"$/.test(tokens[index])) {\n // Ignore double-quoted tokens (chords and general text annotations).\n index++;\n continue;\n }\n if (/^[()]$/.test(tokens[index])) {\n if (tokens[index++] == '(') {\n accent.slurred += 1;\n } else {\n accent.slurred -= 1;\n if (accent.slurred <= 0) {\n accent.slurred = 0;\n if (context.stems && context.stems.length >= 1) {\n // The last notes in a slur are not slurred.\n slurStem(context.stems[context.stems.length - 1], false);\n }\n }\n }\n continue;\n }\n // Handle measure markings by clearing accidentals.\n if (/\\|/.test(tokens[index])) {\n for (t in accent) {\n if (t.length == 1) {\n // Single-letter accent properties are note accidentals.\n delete accent[t];\n }\n }\n index++;\n continue;\n }\n parsed = parseStem(tokens, index, key, accent);\n // Skip unparsable bits\n if (parsed === null) {\n index++;\n continue;\n }\n // Process a parsed stem.\n if (beatlet) {\n scaleStem(parsed.stem, beatlet.time);\n beatlet.count -= 1;\n if (!beatlet.count) {\n beatlet = null;\n }\n }\n // If syncopated with > or < notation, shift part of a beat\n // between this stem and the previous one.\n if (dotted && context.stems && context.stems.length) {\n if (dotted > 0) {\n t = (1 - Math.pow(0.5, dotted)) * parsed.stem.time;\n } else {\n t = (Math.pow(0.5, -dotted) - 1) *\n context.stems[context.stems.length - 1].time;\n }\n syncopateStem(context.stems[context.stems.length - 1], t);\n syncopateStem(parsed.stem, -t);\n }\n dotted = 0;\n // Slur all the notes contained within a strem.\n if (accent.slurred) {\n slurStem(parsed.stem, true);\n }\n // Start a default voice if we're not in a voice yet.\n if (context === result) {\n startVoiceContext(firstVoiceName());\n }\n if (!('stems' in context)) { context.stems = []; }\n // Add the stem to the sequence of stems for this voice.\n context.stems.push(parsed.stem);\n // Advance the parsing index since a stem is multiple tokens.\n index = parsed.index;\n }\n }", "title": "" }, { "docid": "ed19323fc57b8422fb736c0b991d8e4e", "score": "0.45805377", "text": "function parseABCNotes(str) {\n var tokens = str.match(ABCtoken), parsed = null,\n index = 0, dotted = 0, beatlet = null, t;\n if (!tokens) {\n return null;\n }\n while (index < tokens.length) {\n // Ignore %comments and !markings!\n if (/^[\\s%]/.test(tokens[index])) { index++; continue; }\n // Handle inline [X:...] information fields\n if (/^\\[[A-Za-z]:[^\\]]*\\]$/.test(tokens[index])) {\n handleInformation(\n tokens[index].substring(1, 2),\n tokens[index].substring(3, tokens[index].length - 1).trim()\n );\n index++;\n continue;\n }\n // Handled dotted notation abbreviations.\n if (/</.test(tokens[index])) {\n dotted = -tokens[index++].length;\n continue;\n }\n if (/>/.test(tokens[index])) {\n dotted = tokens[index++].length;\n continue;\n }\n if (/^\\(\\d+(?::\\d+)*/.test(tokens[index])) {\n beatlet = parseBeatlet(tokens[index++]);\n continue;\n }\n if (/^[!+].*[!+]$/.test(tokens[index])) {\n parseDecoration(tokens[index++], accent);\n continue;\n }\n if (/^.?\".*\"$/.test(tokens[index])) {\n // Ignore double-quoted tokens (chords and general text annotations).\n index++;\n continue;\n }\n if (/^[()]$/.test(tokens[index])) {\n if (tokens[index++] == '(') {\n accent.slurred += 1;\n } else {\n accent.slurred -= 1;\n if (accent.slurred <= 0) {\n accent.slurred = 0;\n if (context.stems && context.stems.length >= 1) {\n // The last notes in a slur are not slurred.\n slurStem(context.stems[context.stems.length - 1], false);\n }\n }\n }\n continue;\n }\n // Handle measure markings by clearing accidentals.\n if (/\\|/.test(tokens[index])) {\n for (t in accent) {\n if (t.length == 1) {\n // Single-letter accent properties are note accidentals.\n delete accent[t];\n }\n }\n index++;\n continue;\n }\n parsed = parseStem(tokens, index, key, accent);\n // Skip unparsable bits\n if (parsed === null) {\n index++;\n continue;\n }\n // Process a parsed stem.\n if (beatlet) {\n scaleStem(parsed.stem, beatlet.time);\n beatlet.count -= 1;\n if (!beatlet.count) {\n beatlet = null;\n }\n }\n // If syncopated with > or < notation, shift part of a beat\n // between this stem and the previous one.\n if (dotted && context.stems && context.stems.length) {\n if (dotted > 0) {\n t = (1 - Math.pow(0.5, dotted)) * parsed.stem.time;\n } else {\n t = (Math.pow(0.5, -dotted) - 1) *\n context.stems[context.stems.length - 1].time;\n }\n syncopateStem(context.stems[context.stems.length - 1], t);\n syncopateStem(parsed.stem, -t);\n }\n dotted = 0;\n // Slur all the notes contained within a strem.\n if (accent.slurred) {\n slurStem(parsed.stem, true);\n }\n // Start a default voice if we're not in a voice yet.\n if (context === result) {\n startVoiceContext(firstVoiceName());\n }\n if (!('stems' in context)) { context.stems = []; }\n // Add the stem to the sequence of stems for this voice.\n context.stems.push(parsed.stem);\n // Advance the parsing index since a stem is multiple tokens.\n index = parsed.index;\n }\n }", "title": "" }, { "docid": "ed19323fc57b8422fb736c0b991d8e4e", "score": "0.45805377", "text": "function parseABCNotes(str) {\n var tokens = str.match(ABCtoken), parsed = null,\n index = 0, dotted = 0, beatlet = null, t;\n if (!tokens) {\n return null;\n }\n while (index < tokens.length) {\n // Ignore %comments and !markings!\n if (/^[\\s%]/.test(tokens[index])) { index++; continue; }\n // Handle inline [X:...] information fields\n if (/^\\[[A-Za-z]:[^\\]]*\\]$/.test(tokens[index])) {\n handleInformation(\n tokens[index].substring(1, 2),\n tokens[index].substring(3, tokens[index].length - 1).trim()\n );\n index++;\n continue;\n }\n // Handled dotted notation abbreviations.\n if (/</.test(tokens[index])) {\n dotted = -tokens[index++].length;\n continue;\n }\n if (/>/.test(tokens[index])) {\n dotted = tokens[index++].length;\n continue;\n }\n if (/^\\(\\d+(?::\\d+)*/.test(tokens[index])) {\n beatlet = parseBeatlet(tokens[index++]);\n continue;\n }\n if (/^[!+].*[!+]$/.test(tokens[index])) {\n parseDecoration(tokens[index++], accent);\n continue;\n }\n if (/^.?\".*\"$/.test(tokens[index])) {\n // Ignore double-quoted tokens (chords and general text annotations).\n index++;\n continue;\n }\n if (/^[()]$/.test(tokens[index])) {\n if (tokens[index++] == '(') {\n accent.slurred += 1;\n } else {\n accent.slurred -= 1;\n if (accent.slurred <= 0) {\n accent.slurred = 0;\n if (context.stems && context.stems.length >= 1) {\n // The last notes in a slur are not slurred.\n slurStem(context.stems[context.stems.length - 1], false);\n }\n }\n }\n continue;\n }\n // Handle measure markings by clearing accidentals.\n if (/\\|/.test(tokens[index])) {\n for (t in accent) {\n if (t.length == 1) {\n // Single-letter accent properties are note accidentals.\n delete accent[t];\n }\n }\n index++;\n continue;\n }\n parsed = parseStem(tokens, index, key, accent);\n // Skip unparsable bits\n if (parsed === null) {\n index++;\n continue;\n }\n // Process a parsed stem.\n if (beatlet) {\n scaleStem(parsed.stem, beatlet.time);\n beatlet.count -= 1;\n if (!beatlet.count) {\n beatlet = null;\n }\n }\n // If syncopated with > or < notation, shift part of a beat\n // between this stem and the previous one.\n if (dotted && context.stems && context.stems.length) {\n if (dotted > 0) {\n t = (1 - Math.pow(0.5, dotted)) * parsed.stem.time;\n } else {\n t = (Math.pow(0.5, -dotted) - 1) *\n context.stems[context.stems.length - 1].time;\n }\n syncopateStem(context.stems[context.stems.length - 1], t);\n syncopateStem(parsed.stem, -t);\n }\n dotted = 0;\n // Slur all the notes contained within a strem.\n if (accent.slurred) {\n slurStem(parsed.stem, true);\n }\n // Start a default voice if we're not in a voice yet.\n if (context === result) {\n startVoiceContext(firstVoiceName());\n }\n if (!('stems' in context)) { context.stems = []; }\n // Add the stem to the sequence of stems for this voice.\n context.stems.push(parsed.stem);\n // Advance the parsing index since a stem is multiple tokens.\n index = parsed.index;\n }\n }", "title": "" }, { "docid": "e3092e10228b1e631bc57fcfde7a07d6", "score": "0.4580216", "text": "result(contents) {\n const starts = new Set();\n this.offsets.forEach(o => starts.add(contents.lastIndexOf('\\n', o) + 1));\n let lines = '';\n for (const i of Array.from(starts).sort((a, b) => a-b)) {\n lines += contents.substring(i, contents.indexOf('\\n', i) + 1);\n }\n return new Result(this.name, this.score, lines);\n }", "title": "" }, { "docid": "d9e2363e0a4571be6f0368a2b66974cb", "score": "0.45779744", "text": "function mTParse(idName, response)\n{\n\n var metaTagName;\n var metaTagValue;\n var metaTagDelimiter;\n var displayTagName = false;\n var mTResult = \"\";\n\n // Go through each meta tag in the XML response.\n var metaTags = response.getElementsByTagName('MT');\n\n // Only display parametric information if there is parametric information to\n // display\n if (metaTags.length > 0)\n {\n for(var i=0; i < metaTags.length; i++)\n {\n metaTagName = \"\";\n metaTagValue = \"\";\n metaTagDelimiter = \"\";\n\n // Get the meta tag name and modify it if necessary.\n metaTagName = metaTags[i].attributes.getNamedItem(\"N\").value;\n metaTagName = metaTagName.toLowerCase();\n metaTagName = mTDoCombination(metaTagName);\n // alert(\"metaTagName = \" + metaTagName);\n\n // Get the meta tag value and modify it if necessary.\n metaTagValue = metaTags[i].attributes.getNamedItem(\"V\").value;\n metaTagValue = trim(metaTagValue);\n // alert(\"metaTagValue = \" + metaTagValue);\n\n displayTagName = false;\n if (metaTagValue != \"\")\n {\n // Find out if the meta tag name matches one that we are suppossed to\n // allow\n if (mTDisplayHash)\n {\n // Here we check the current tag name against the list of valid tag names\n displayTagName = false;\n for (var mT in mTDisplayHash)\n {\n if (mT.toLowerCase() == metaTagName.toLowerCase())\n {\n displayTagName = true;\n metaTagDelimiter = mTDisplayHash[mT];\n }\n }\n } else\n {\n displayTagName = true;\n }\n\n // If this occurs, then figure out the delimiter\n if (displayTagName == true)\n {\n\n if (!mTArray)\n {\n mTArray = new Array();\n }\n\n // Do we have a delimiter? If so, we have to see if we have to split this\n // value and do this mulitple times.\n if (metaTagDelimiter != \"\")\n {\n var newMTValues;\n newMTValues = metaTagValue.split(metaTagDelimiter);\n for(var j=0; j < newMTValues.length; j++)\n {\n if (newMTValues[j] != \"\")\n {\n // Call a function here which will generate the hash with the\n // correct value.\n mTArray = mTDoHash(mTArray, metaTagName, newMTValues[j]);\n }\n }\n } else\n {\n // Call a function here which will generate the hash with the\n // correct value.\n mTArray = mTDoHash(mTArray, metaTagName, metaTagValue);\n }\n }\n }\n }\n }\n\n // Output the results to the page\n mTOutputParametric(idName);\n}", "title": "" }, { "docid": "be835af1efb825cf856a86172fd47e28", "score": "0.4575005", "text": "function parse(strData) {\n var parsed = strData.split('\\n').map(function(line) {return line.split('\\t').map(function(item) {return item.replace(/\\\"/gi, \"\");})});\n if (parsed[0][0] == \"Name\") {\n parsed = parsed.slice(1);\n GM_log(\"First line was Name, scraped that line\");\n }\n parsed.pop();\n return parsed;\n}", "title": "" }, { "docid": "d8e521adb74130acebafa882967c87ad", "score": "0.45697707", "text": "function getListings(longDescriptionString) {\n\tlet resultArray = longDescriptionString\n\t\t.split(\"\")\n\t\t.filter((l) => l !== \"\\n\")\n\t\t.join(\"\")\n\t\t.split(\"- \");\n\t\treturn resultArray\n\t}", "title": "" }, { "docid": "aec0eb5eb078ec9dd36db11e147a500f", "score": "0.45695287", "text": "function decode(encodedTask) {\n\tconst parts = encodedTask.split('#@#');\n\ttaskIds[parts[0]] = \"task-id-\" + taskNum;\n\ttaskNum++;\n\treturn {\n\t\tid: taskIds[parts[0]],\n\t\tname: parts[0],\n\t\tcompleted: parts[1] == 3,\n\t\tterminated: parts[1] == 4,\n\t\tisLeaf: parts[2] == 1,\n\t\ttype: parts[2],\n\t\tdate: parts[4] != \" \" ? parts[4] : null,\n\t\tparent: parts[3],\n\t\texceptions: parts[5] ? parts[5].split('||') : null,\n\t\tdisplayed: false,\n\t\tdescription: parts[6] != \" \" ? parts[6] : null,\n\t\tartifacts: parts[7] != \" \" ? decodeArtifacts(parts[7]) : [],\n\t\tcomments: parts[8] != \" \" ? parts[8].split('||').map(function(comment) {\n\t\t\tconst parts = comment.split('#%#');\n\t\t\treturn {\"note\": parts[0], \"datetime\": parts[1]};\n\t\t}) : [],\n\t}\n}", "title": "" }, { "docid": "3a123815716ed7e72024b82a6b3085aa", "score": "0.4568874", "text": "static _formatResults(res) {\n let ret = {};\n\n const lines = res.split(CRLF);\n for (const line of lines) {\n const keyEnd = line.indexOf(\":\");\n const key = line.substring(0, keyEnd);\n const value = line.substring(keyEnd + 1);\n ret[key.trim()] = value.trim();\n }\n\n // want it to be last thing\n ret[\"_raw\"] = res;\n\n return ret;\n }", "title": "" }, { "docid": "b022d8cfbdaff608e092a8492363740d", "score": "0.45598802", "text": "function parseDiscoveryResp (msg){\n\tvar line = msg.split('\\n');\n\tvar device = {};\n\t//console.log(\"msg: \" + msg);\n \n\tfor(var ii = 0; ii<line.length; ii++){\n\t var kvline = line[ii];\n\n\t if(-1 != kvline.search(/LOCATION/i)){\n\t\tvar startPos = kvline.indexOf(':') + 1;\n\t\tif(-1 == startPos){\n\t\t return null;\n\t\t}else{\n\t\t device.location = \n\t\t\tkvline.substring(startPos).replace(/(\\r)?( )?/g,'');\n\t\t}\n\t }else if (-1 != kvline.search(/USN/i)){\n\t\tvar startPos = kvline.indexOf(':') + 1;\n\t\tif(-1 == startPos){\n\t\t return null;\n\t\t}else{\n\t\t device.usn = kvline.substring(startPos).replace(/(\\r)|( )/g,'');\n\t\t}\n\t }\n\t}\n\n\treturn device;\n }", "title": "" }, { "docid": "4d293c68dea1c2b4dfe2c2db6be070c2", "score": "0.4559712", "text": "async txDetails (txid) {\n try {\n wlogger.silly('Entering slp.txDetails().')\n\n await this.waitForWalletInit()\n\n const result = await this.bchjs.PsfSlpIndexer.tx(txid)\n const txData = result.txData\n // console.log(`txData: ${JSON.stringify(txData, null, 2)}`);\n\n const isValidSlp = txData.isValidSlp\n\n // Return false if the tx is not a valid SLP transaction.\n if (!isValidSlp) return false\n\n return txData\n } catch (err) {\n // This catch will activate on non-token txs.\n // Leave this commented out.\n wlogger.debug('Error in slp2.js/txDetails(): ', err)\n throw err\n }\n }", "title": "" }, { "docid": "bceef1f8ccc1759782d33ac9542755fd", "score": "0.45572835", "text": "parse(data) {\n // Check the `data`\n let buf = null;\n if (typeof (data) === 'string') {\n data = data.toLowerCase();\n if (/^[a-f0-9]+$/.test(data) === false || data.length === 0 || data.length % 2 !== 0) {\n return { error: new Error('The `data` must be hexadecimal representation.') };\n }\n let byte_list = [];\n for (let i = 0; i < data.length; i += 2) {\n let h = data.substring(i, i + 2);\n let n = parseInt(h, 16);\n byte_list.push(n);\n }\n buf = Buffer.from(byte_list);\n } else if (Buffer.isBuffer(data)) {\n if (data.length === 0) {\n return { error: new Error('The `data` must be a non-empty data.') };\n }\n buf = data;\n } else {\n return { error: new Error('The `data` must be a string or an Buffer object.') };\n }\n\n // Parse the data\n let details = null;\n try {\n details = this._parseDetails(buf);\n } catch (e) {\n return { error: e };\n }\n\n // Compose the response\n let res = {};\n\n let smsc = null;\n if (details.sca.digit > 0) {\n smsc = details.sca.address;\n if (details.sca.international) {\n smsc = '+' + smsc;\n }\n }\n res.smsc = smsc;\n\n if (details.pduType.mti === 0) {\n res.type = 'SMS-DELIVER';\n\n if (details.oa && details.oa.digit > 0) {\n let val = details.oa.address;\n if (details.oa.international) {\n val = '+' + val;\n }\n res.origination = val;\n } else {\n res.origination = null;\n }\n\n if (details.scts) {\n res.timestamp = details.scts;\n } else {\n res.timestamp = null;\n }\n\n } else if (details.pduType.mti === 1) {\n res.type = 'SMS-SUBMIT';\n\n res.reference = details.mr;\n\n if (details.da && details.da.digit > 0) {\n let val = details.da.address;\n if (details.da.international) {\n val = '+' + val;\n }\n res.destination = val;\n } else {\n res.destination = null;\n }\n\n if (details.vp) {\n res.period = details.vp.period + details.vp.unit;\n } else {\n res.period = null;\n }\n } else {\n return { error: new Error('Unknown PDU Type: MTI=' + details.pduType.mti) };\n }\n\n if (details.ud.udh) {\n res.concat = {\n reference: details.ud.udh.reference,\n total: details.ud.udh.total,\n sequence: details.ud.udh.sequence\n };\n } else {\n res.concat = null;\n }\n\n if (details.ud.text) {\n res.text = details.ud.text;\n } else {\n res.text = null;\n }\n\n res.details = details;\n return res;\n }", "title": "" }, { "docid": "951364f25c780fdadede828dcde88c05", "score": "0.45549276", "text": "function getAll() {\n let parentElems = $(\"a[name^='seq']\");\n for (let k = 0; k < Math.min(parentElems.length, maxSegments); k++) {\n if (parentElems[k].parentElement.parentElement.parentElement.parentElement.children[0].innerText === targetName) {\n concatenatedText += parentElems[k].text + \"\\n\";\n }\n }\n}", "title": "" }, { "docid": "508c1ef5ab83737f132f806c0ef2268e", "score": "0.4552894", "text": "function init_sequence() {\n var regex = />[,)]\\s*\\<*/;\n var video_temp = mash_cfg.sequence.substr(2).split(regex);\n video_temp.pop();\n for (var i in video_temp) {\n var item = video_temp[i];\n item = item.split(/\\s*,\\s*/);\n item[1] = parseInt(item[1].replace('s', ''));\n item[2] = parseInt(item[2].replace('s', ''));\n video_list.unshift(item);\n }\n mash_cfg.sequence = null;\n}", "title": "" }, { "docid": "de43c162ab7dd7fed9cbe228f6c2f031", "score": "0.4550382", "text": "_parsePeerInfo(msg) {\n let lines = msg.split('\\n');\n let deviceAddressExp = /\\w{2}:\\w{2}:\\w{2}:\\w{2}:\\w{2}:\\w{2}/;\n let status = {};\n for (let line of lines) {\n if (line.length > 3) {\n let deviceAddress = deviceAddressExp.exec(line);\n if (!deviceAddress) {\n let fields = line.split('=');\n status[fields[0]] = fields[1];\n }\n else {\n status.address = deviceAddress[0];\n }\n }\n }\n return status;\n }", "title": "" }, { "docid": "1e2600793b8b98f17cd8ec21919f59b0", "score": "0.45470703", "text": "result(contents) {\n const starts = new Set();\n this.offsets.forEach(o => starts.add(contents.lastIndexOf('\\n', o) + 1));\n let lines = '';\n for (const i of Array.from(starts).sort((a, b) => a-b)) {\n lines += contents.substring(i, contents.indexOf('\\n', i) + 1);\n }\n return new Result(this.name, this.score, lines);\n }", "title": "" }, { "docid": "670e42c6ecff3a664d4779f399b4ae62", "score": "0.45465478", "text": "function parse_lg(pdf){\n add_contents(pdf);\n add_intro(pdf);\n add_ULOs(pdf);\n add_assessmentSum(pdf);\n add_textbooks(pdf);\n add_equipment(pdf);\n add_coordinators(pdf);\n add_unitName(pdf)\n console.log(pdf);\n}", "title": "" }, { "docid": "f3cdef5d7cbf9039ceea256be502f0c9", "score": "0.4545581", "text": "async function process_indel_vcf(f){//filename\n let filename = f.replace(\".sam.vcf\", \"\");\n let vcf = await exactSNP.cat(\"/data/\" + f);\n let lines = vcf.split(/\\r?\\n/);\n let summary = \"\";\n // let depDict = await getDepthAll(\"/data/\" + filename + \".bam\");\n for (let line of lines){\n if (line && !line.includes(\"#\")){\n let ss = line.split(/\\t/);\n if (ss[7].includes(\"MM\")){// SNPs\n let ee = ss[7].split(/;/);\n let DP = ee[0].replace(\"DP=\", \"\"); // WT counts\n // let DP = await getDepth(\"/data/\" + filename + \".bam\", ss[0], ss[1]);\n // let DP = depDict[ss[0]][ss[1]];\n let SR = ee[1].replace(\"MMsum=\", \"\"); // all mut alleles counts\n let SRsingle = ee[2].replace(\"MM=\", \"\"); // \"3,5\" for 2 alt alleles\n let pct = (parseInt(SR) / parseInt(DP) * 100).toFixed(1); // percent of mut\n let size = \"0\"; // all SNPs\n summary += [filename, ss[0], ss[1], ss[3], ss[4], DP, SRsingle, pct, size].join('\\t') + \"\\n\";\n } else { // indels\n let DP = ss[7].replace(\"INDEL;DP=\", \"\").split(\";SR=\"); // DP and SR\n // DP[0] = await getDepth(\"/data/\" + filename + \".bam\", ss[0], ss[1]);\n // DP[0] = depDict[ss[0]][ss[1]];\n let pct = (parseInt(DP[1]) / (parseInt(DP[0])) * 100).toFixed(1); // percent of indels\n let size = String(ss[4].length - ss[3].length);\n summary += [filename, ss[0], ss[1], ss[3], ss[4], parseInt(DP[0]), DP[1], pct, size].join('\\t') + \"\\n\";\n }\n }\n }\n return summary;\n}", "title": "" }, { "docid": "dade55c3e32f07c69ab1ddfdc746ae8a", "score": "0.45402324", "text": "function getInfoFromUID(uid) {\n var err = 0;\n var side = \"\";\n var year = \"\";\n var day = \"\";\n var line = \"\";\n var reference = \"\";\n var cavity = \"\";\n var pouring = \"\";\n if ((uid.length == 13) && ((uid.charAt(0) == \"L\") || (uid.charAt(0) == \"R\"))) {\n err = 0;\n side = uid.substring(0, 1);\n year = uid.substring(1, 3);\n day = uid.substring(3, 6);\n line = (uid.substring(6, 7));\n reference = (uid.substring(7, 8));\n cavity = uid.substring(8, 10);\n pouring = uid.substring(10, 13);\n } else if ((uid.length == 12)) {\n err = 0;\n side = \"\";\n year = uid.substring(0, 2);\n day = uid.substring(2, 5);\n line = (uid.substring(5, 6));\n reference = (uid.substring(6, 7));\n cavity = uid.substring(7, 9);\n pouring = uid.substring(9, 12);\n } else {\n err = -1;\n side = \"\";\n year = \"\";\n day = \"\";\n line = \"\";\n reference = \"\";\n cavity = \"\";\n pouring = \"\";\n }\n\n return {\n err: err,\n uid: uid,\n side: side,\n year: year,\n day: day,\n line: line,\n reference: reference,\n cavity: cavity,\n pouring: pouring\n }\n}", "title": "" }, { "docid": "7bec02450e156a97ac37a352d2f911ba", "score": "0.45309538", "text": "function processResult(data) {\n // destructure the data and extract only what we need\n // the data is coming in as an object - it's 'structured' data. We can reach into it and pull out just the values we need by using a destructuring assignment\n\n const {service_description} = data;\n\n // this is statement chaining - we can select an element and change its content all at once, instead of doing it in multiple steps\n let desc = document.querySelector('#service_description').textContent = service_description;\n\n\n }", "title": "" }, { "docid": "d7b26f5f2212251524afa2e32f45587b", "score": "0.45237514", "text": "function returnSequence(){\n return sequence;\n}", "title": "" }, { "docid": "c3c141b79fac6cea6006fae682f5ddc5", "score": "0.45236152", "text": "visitSequence_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "d8a0e4786bfb84a9110b5e2048add02d", "score": "0.4520945", "text": "function getQuestionsHelper(data)\n{\n var item=[];\n var hdr=[];\n var hdrHelper = [];\n var compareData=data.HdrToDtl.results;\n //set the remarks input\n var remarks=data.HdrToRemarks;\n $(remarks.results).each(function(i,val) {\n oCore.byId(\"remarks\").setValue(oCore.byId(\"remarks\").getValue() + val.RemarkText+\"\\n\");\n });\n var found=false;\n $(data.HdrToDtl.results).each(function( i, iVal ) {\n \n if(hdr.length>0) {\n found=false;\n $(hdr).each(function( k, kVal ) {\n if(iVal.LCSecID==kVal.LCSecID)\n {\n found=true;\n return false;\n }\n });\n }\n if(!found) {\n $(compareData).each(function( j, jVal ) {\n if(iVal.LCSecID==jVal.LCSecID) {\n if(jVal.LCSeqID==\"000\") {\n hdrHelper=[];\n hdrHelper.push({\"LCSecID\":iVal.LCSecID,\"StepText\":iVal.StepText,\"ResReq\":iVal.ResReq,\"StepRes\":iVal.StepRes,\"HdrSelection\":iVal.StepRes==\"Y\"?true:false,\"ProcessOrder\":iVal.ProcessOrder,\"Plant\":iVal.Plant});\n } else {\n item.push({\"LCSecID\":jVal.LCSecID,\"LCSeqID\":jVal.LCSeqID, \"ResReq\":jVal.ResReq,\"StepText\":jVal.StepText,\"StepRes\":jVal.StepRes,\"ItmSelection\":jVal.StepRes==\"Y\"?true:false});\n }\n \n }\n \n \n });\n }\n if(!found) {\n \n item=item.sort(function(a,b) {\n return a.LCSeqID - b.LCSeqID;\n });\n hdr.push({\"LCSecID\":hdrHelper[0].LCSecID,\"StepText\":hdrHelper[0].StepText,\"ResReq\":hdrHelper[0].ResReq,\"StepRes\":hdrHelper[0].StepRes,\"HdrSelection\":hdrHelper[0].HdrSelection, \"item\":item});\n item=[];\n found=true;\n }\n \n });\n return hdr;\n \n}", "title": "" }, { "docid": "973cc6ddd4403c07b296a8312c94217a", "score": "0.451334", "text": "function getArticulations(text)\n{\n text = text.replace(/ +/g, ' ');\n var result = [];\n var from = false;\n var iaCourse = '';\n var oiaCourse = '';\n var courses = [];\n\n // Splits the text into course boxes.\n courses = text.match(/---[^-]+\\|[^-]+---/g);\n\n // Split each box into from and to.\n courses.forEach(function(course)\n {\n // Remove dashes and extra notes.\n course = course.replace(/---[^-]*?\\n(.*\\|[^-]+)---/g, '$1').trim();\n\n for (var i = 0; i < course.length; ++i)\n {\n if (course[i] == '|' || course[i] == '\\n')\n {\n oiaCourse += '\\n';\n iaCourse += '\\n';\n from = !from;\n }\n else if (!from)\n {\n oiaCourse += course[i];\n }\n else if (from)\n {\n iaCourse += course[i];\n }\n }\n\n if (/\\(\\d+\\.?\\d*\\)/.test(oiaCourse) || /\\(\\d+\\.?\\d*\\)/.test(iaCourse) || !isArticulated(oiaCourse) || !isArticulated(iaCourse))\n {\n result.push({ iaCourse: parseCourse(iaCourse), oiaCourse: parseCourse(oiaCourse) });\n }\n oiaCourse = '';\n iaCourse = '';\n from = !from;\n });\n return result;\n}", "title": "" }, { "docid": "0b5c483d25abb1eb859f2a92076cb46d", "score": "0.4506799", "text": "function checkSeqValid() {\n let seq = $('#sequenceInput').val().trim();\n if (!seq){\n $('#errorModalBody').text(\"Query cannot be empty.\");\n $('#errorModal').modal('show');\n return false;\n }\n\n let data = seq.split('>');\n let num = 0;\n for (let i = 0; i < data.length; i++) {\n let fasta = data[i];\n if (i == 0 && fasta){\n $('#errorModalBody').text(\"The description of queries must begin with >.\" );\n $('#errorModal').modal('show');\n return false;\n }\n if (!fasta) continue;\n\n let lines = fasta.split(/\\r?\\n/);\n lines.splice(0, 1);\n\n // join the array back into a single string without newlines and \n // trailing or leading spaces\n fasta = lines.join('').trim();\n\n if (!fasta) { // is it empty whatever we collected ? re-check not efficient \n $('#errorModalBody').text(\"Query must contain amino acid code sequence.\");\n $('#errorModal').modal('show');\n return false;\n }\n // console.log(fasta);\n // return false;\n\n // note that the empty string is caught above\n // allow for Selenocysteine (U)\n if (/^[ACDEFGHIKLMNPQRSTUVWY]+$/i.test(fasta) == false){\n $('#errorModalBody').text(\"Sequences must be in valid amino acid code(A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, U, V, W, Y) without any space.\");\n $('#errorModal').modal('show');\n return false;\n }\n\n num = num + 1;\n }\n if (num > 200){\n $('#errorModalBody').text(\"The number of sequences \" + num + \" is out of the limit: 200.\");\n $('#errorModal').modal('show');\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "e6483dfae732def18bb203b55bcfb635", "score": "0.45027256", "text": "function assemble(src, config) {\n\t\t\tvar lines = preprocess(src),\n\t\t\t\ti, n = lines.length,\n\t\t\t\tsymbolTable = {},\n\t\t\t\tstatusTable = {\n\t\t\t\t\tsection: 'text',\n\t\t\t\t\ttextSize : 0,\n\t\t\t\t\tdataSize : 0,\n\t\t\t\t\tdataStartAddr : 0,\t// data section start address\n\t\t\t\t\tdataCurrentAddr : 0,\t// data section current address\n\t\t\t\t\ttextStartAddr : 0,\t// text section start address\n\t\t\t\t\ttextCurrentAddr : 0\t\t// text section current address\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\taliasTable = {},\n\t\t\t\tcurTokenList,\n\t\t\t\tinfoList = [];\n\t\t\tconfig = extend({}, config);\n\t\t\t// apply user defined properties\n\t\t\tstatusTable.dataStartAddr = (config.dataStartAddr != undefined) ? config.dataStartAddr : 0x10000000;\n\t\t\tstatusTable.textStartAddr = (config.textStartAddr != undefined) ? config.textStartAddr : 0x00040000;\n\t\t\tstatusTable.dataCurrentAddr = statusTable.dataStartAddr;\n\t\t\tstatusTable.textCurrentAddr = statusTable.textStartAddr;\n\t\t\t// generate infomation list\n\t\t\tfor (i = 0;i < n;i++) {\n\t\t\t\ttry {\n\t\t\t\t\tcurTokenList = tokenize(lines[i]);\n\t\t\t\t\tinfoList.push.apply(infoList, parseLine(curTokenList, i+1, symbolTable, statusTable));\n\t\t\t\t} catch (err) {\n\t\t\t\t\tthrow new Error('L' + (i+1) + ':' + err.message);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//console.log(infoList);\n\t\t\t// resolve symbols and alias\n\t\t\tresolveSymbols(infoList, symbolTable, statusTable);\n\n\t\t\t// translate\n\t\t\t// check section confliction\n\t\t\tvar dStart = statusTable.dataStartAddr,\n\t\t\t\tdEnd = statusTable.dataStartAddr + statusTable.dataSize,\n\t\t\t\ttStart = statusTable.textStartAddr,\n\t\t\t\ttEnd = statusTable.textStartAddr + statusTable.textSize;\n\t\t\tif (!(dEnd < tStart || dStart > tEnd)) {\n\t\t\t\tthrow new Error('Overlap detected between data section and text section.');\n\t\t\t}\n\t\t\tvar dataMem = [], textMem = [];\n\t\t\ttranslate(infoList, textMem, dataMem, statusTable);\n\t\t\t\n\t\t\treturn {\n\t\t\t\tdataStart : statusTable.dataStartAddr,\n\t\t\t\ttextStart : statusTable.textStartAddr,\n\t\t\t\tdataSize : statusTable.dataSize,\n\t\t\t\ttextSize : statusTable.textSize,\n\t\t\t\tdataMem : dataMem,\n\t\t\t\ttextMem : textMem,\n\t\t\t\tsourceMap : generateSourceMap(infoList, statusTable),\n\t\t\t\tsymbolTable : symbolTable\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "0a2dc3c0a254fc59b9f56f9027d596bb", "score": "0.45020378", "text": "async function process_indel_vcf(f){//filename\n let filename = f.replace(\".sam.vcf\", \"\");\n let vcf = await exactSNP.cat(\"/data/\" + f);\n let lines = vcf.split(/\\r?\\n/);\n let summary = \"\";\n for (let line of lines){\n if (line && !line.includes(\"#\")){\n let ss = line.split(/\\t/);\n if (ss[7].includes(\"MM\")){// SNPs\n let ee = ss[7].split(/;/);\n let DP = ee[0].replace(\"DP=\", \"\"); // WT counts\n let SR = ee[1].replace(\"MMsum=\", \"\"); // all mut alleles counts\n let SRsingle = ee[2].replace(\"MM=\", \"\"); // \"3,5\" for 2 alt alleles\n let pct = (parseInt(SR) / parseInt(DP) * 100).toFixed(1); // percent of mut\n let size = \"0\"; // all SNPs\n summary += [filename, ss[0], ss[1], ss[3], ss[4], DP, SRsingle, pct, size].join('\\t') + \"\\n\";\n } else { // indels\n let DP = ss[7].replace(\"INDEL;DP=\", \"\").split(\";SR=\"); // DP and SR\n let pct = (parseInt(DP[1]) / (parseInt(DP[0])) * 100).toFixed(1); // percent of indels\n let size = String(ss[4].length - ss[3].length);\n summary += [filename, ss[0], ss[1], ss[3], ss[4], parseInt(DP[0]), DP[1], pct, size].join('\\t') + \"\\n\";\n }\n }\n }\n return summary;\n}", "title": "" }, { "docid": "a3c91cdedc0753215abd2a811781168f", "score": "0.44989446", "text": "visitXMLXSDSequence(xmlxsdSeq){\n // console.log('visit Sequence visualizer :', xmlxsdSeq);\n var that = this;\n this.buildAttrs(xmlxsdSeq)\n xmlxsdSeq.seqList.forEach(function(seq, k){\n // console.log('visit seq visualizer :', seq);\n seq.forEach(function (xmlxsdElt, j){\n xmlxsdElt.eltsList.forEach(function(elt, i){\n that.stack.push({\n tag: xmlxsdElt.name,\n obj: xmlxsdElt.eltsList[i],\n i:i\n })\n elt.accept(that);\n that.stack.pop()\n })\n })\n })\n }", "title": "" }, { "docid": "d2b0428dc304ff8ca14f84b0d0009ae7", "score": "0.4495963", "text": "parseLine(line){\n\t\ttry{\n\t\t\tif(line.indexOf('#') != -1 || !line.trim()) return;\n\t\t\tconst fields = line.split(' ');\n\n\t\t\tconst sectionFields = fields[2].replace(/\"/g,'').split('_');\n\t\t\tconst sezioniKey = sectionFields[0] + padding(sectionFields[1], 3, '0') + '_' + sectionFields[2];\n\t\t\t//console.log('sezioniKey: '+sezioniKey);\n\n //console.error(sezioniKey+' > sezione per il record : '+line);\n\t\t\tconst record = {\n\t\t\t\tid: fields[0],\n\t\t\t\tlevelKeys: [],\n\t\t\t\tvalue: Number(fields[1]),\n\t\t\t\tsection: {\n\t\t\t\t\tprov: sectionFields[0],\n\t\t\t\t\tcom: sectionFields[1],\n\t\t\t\t\tsez: parseInt(sectionFields[2])\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// create a Array of level key\n\t\t\t// es. [ '1', '1:1', '1:1:1', '1:1:1:1' ]\n\t\t\tconst id_values = fields[0].split(':');\n\t\t\tlet cumolativeKey = id_values[0];\n\t\t\tfor(let i=0;i<id_values.length;i++){\n\t\t\t\trecord.levelKeys.push(cumolativeKey);\n\t\t\t\tif(i+1<id_values.length) cumolativeKey += ':'+id_values[i+1];\n\t\t\t}\n\t\t\tthis.result.set(record.section.sez, record);\n\t\t\tthis.idSets.add(this.level < record.levelKeys.length?record.levelKeys[this.level]:record.levelKeys[record.levelKeys.length-1]);\n\t\t}catch(e){\n\t\t\tconsole.log('line : '+line);\n\t\t\tconsole.warn(e.stack);\n\t\t}\n\t}", "title": "" }, { "docid": "b038470ffd9e195416a89980f9171739", "score": "0.4494901", "text": "function parseQuery(ref){\n\t var source = ref.source;\n\t var study = ref.study;\n\t var sortstudy = ref.sortstudy;\n\t var sorttask = ref.sorttask;\n\t var sorttime = ref.sorttime;\n\t var startDate = ref.startDate;\n\t var endDate = ref.endDate;\n\t var firstTask = ref.firstTask;\n\t var lastTask = ref.lastTask;\n\n\t var post = {\n\t schema: source().match(/^(.*?):/)[1], // before colon\n\t studyId: study(),\n\t startDate: parseDate(startDate()),\n\t endDate: parseDate(endDate()),\n\t startTask: firstTask(),\n\t sorttask: sorttask(),\n\t sortstudy: sortstudy(),\n\t endTask: lastTask(),\n\t timeframe: sorttime()==='None' ? 'All' : sorttime(),\n\t extended:sorttask()\n\t };\n\t return post;\n\n\t function parseDate(date){\n\t if (!date) return;\n\t return ((date.getMonth()+1) + \"/\" + (date.getDate()) + \"/\" + (date.getYear() + 1900));\n\t }\n\t }", "title": "" }, { "docid": "26c59fabfc12dab4faca692bca772f9e", "score": "0.44941595", "text": "_parseResultWithAttributes(body, method) {\n return new Promise((resolve, reject) => {\n parseString(body, {\n tagNameProcessors: [stripNS],\n explicitArray : false,\n ignoreAttrs : false\n }, function(err, result){\n if(!err){\n const data = result.Envelope.Body[`${method}Response`];\n resolve(data);\n } else {\n reject(err);\n }\n }); \n });\n }", "title": "" }, { "docid": "2adb295991cf2b7e40c63fd257c5e202", "score": "0.4493968", "text": "function processText(v) {\n if (v > 0 && v < 650) {\n getSeqDetails(v, \"closest\");\n }\n else { clearAgeBox(); }\n}", "title": "" }, { "docid": "41ad0ebf4e11bfc799000c4a76c411cc", "score": "0.4492608", "text": "function parseNewsDetail(axiosResponse) {\n const details = axiosResponse.data;\n\n const {\n id,\n time,\n title,\n } = details;\n\n const timeIso = new Date(time * 1000).toISOString();\n\n const storyDetail = {\n id, // id: id\n time: timeIso,\n title,\n };\n\n return storyDetail;\n}", "title": "" }, { "docid": "8563dcbcf15a1054d64575b0ab325e78", "score": "0.4492428", "text": "static async fromMissFile(filename) {\n return new Promise((res, rej)=> {\n let parser = MissionParser()\n\n const rl = readline.createInterface({\n input: fs.createReadStream(filename),\n output: process.stdout,\n terminal: false\n });\n \n rl.on('line', (line) => {\n // whitespace | \n parser.parseLine(line)\n \n });\n rl.on('close', ()=>{\n res(parser) \n })\n rl.on('error', (err)=>{\n rej(err) \n })\n })\n \n }", "title": "" }, { "docid": "e50af2787b1f544be2c9cb2ba2f5db1b", "score": "0.44923246", "text": "function do_CDE(response)\n{\n\n var doc = new DOMParser()\n .parseFromString(response.responseText, \"text/html\");\n var result={addressLine1:\"NA\",city:\"NA\",zip:\"NA\",teamMemberFName:\"NA\",teamMemberLName:\"NA\"};\n\n var i,curr_row,j;\n var label, value;\n\n var table=doc.getElementsByClassName(\"table\")[0];\n for(i=0; i < table.rows.length; i++)\n {\n curr_row=table.rows[i];\n label=curr_row.cells[0].innerText.trim();\n value=curr_row.cells[1];\n if(label===\"Web Address\") my_query.newLink=value.innerText.trim();\n if(label===\"District Address\")\n {\n let temp_addr=value.getElementsByClassName(\"disable-ios-link\")[0].innerText;\n temp_addr=temp_addr.replace(/\\n\\n+/g,\"\\n\");\n temp_addr=temp_addr.replace(/^\\n/g,\"\");\n let temp_split=temp_addr.split(\"\\n\");\n console.log(\"temp_split=\"+temp_split);\n if(temp_split.length>0)\n {\n result.addressLine1=temp_split[0].trim();\n }\n if(temp_split.length>1)\n {\n let place_regex=/([^,]+),\\s*([A-Z]{2})\\s*(.*)$/;\n let place_match=temp_split[1].trim().match(place_regex);\n if(place_match!==null)\n {\n result.city=place_match[1];\n result.state=place_match[2];\n result.zip=place_match[3];\n }\n\n }\n\n }\n if(label===\"Chief Business Official\")\n {\n let value_text=value.innerText.trim();\n let value_split=value_text.split(\"\\n\");\n if(value_split.length>0)\n {\n var fullname=parse_name(value_split[0]);\n result.teamMemberFName=fullname.fname;\n result.teamMemberLName=fullname.lname;\n result.title=\"BM\";\n }\n for(j=1; j < value_split.length; j++)\n {\n if(email_re.test(value_split[j])) result.email=value_split[j];\n else if(phone_re.test(value_split[j]))\n {\n let temp_phone=value_split[j].replace(/[^\\d]+/g,\"\");\n if(temp_phone.length>10) result.ext=temp_phone.substr(10);\n result.phoneNumber=temp_phone.substr(0,10).replace(/([\\d]{3})([\\d]{3})([\\d]{4})/,\"$1-$2-$3\");\n }\n }\n }\n\n\n }\n var x;\n for(x in result)\n {\n document.getElementById(x).value=result[x];\n }\n}", "title": "" }, { "docid": "78d89b1c5c83c1995e59c42f4a37673b", "score": "0.44911048", "text": "function extractAllDetails(allDetails)\n{\n const a=allDetails.map((data)=>{\n const{\n id,\n servings,\n instructions,\n extendedIngredients,\n analyzedInstructions,\n aggregateLikes,\n readyInMinutes,\n title,\n image,\n }=data.data;\n return{\n id: id,\n servings: servings,\n instructions: instructions,\n extendedIngredients: extendedIngredients,\n analyzedInstructions: analyzedInstructions,\n aggregateLikes: aggregateLikes,\n readyInMinutes: readyInMinutes,\n title: title,\n image: image,\n };\n });\n return a;\n}", "title": "" } ]
86c70b4e130c4bd9e5fab8e6f024e9da
Override the ActivityHandler.run() method to save state changes after the bot logic completes.
[ { "docid": "4dc5f3155f4ca2278367ff1cacb60bc1", "score": "0.70977956", "text": "async run(turnContext){\n\n await super.run(turnContext);\n // Save any state changes. The load happened during the execution of the Dialog.\n //saveChanges(): Saves the cached state object if it's been changed.\n await this.conversationState.saveChanges(turnContext, false);\n await this.userState.saveChanges(turnContext, false);\n }", "title": "" } ]
[ { "docid": "656a6ff4c947a40b440dfb7b6579c92a", "score": "0.67477846", "text": "async run(context) {\n this.addConversationReference(context.activity);\n await super.run(context);\n // Save any state changes. The load happened during the execution of the Dialog.\n await this.conversationState.saveChanges(context, false);\n await this.userState.saveChanges(context, false);\n }", "title": "" }, { "docid": "5cd3e288d227c0413f1ad7781df9b6d1", "score": "0.61341846", "text": "async run(context){\n await super.run(context);\n\n // Save state changes\n await this.userState.saveChanges(context);\n }", "title": "" }, { "docid": "6a7b4c96be76d4dcfae6ee5cf80e1a56", "score": "0.6110712", "text": "async run(context) {\n await super.run(context);\n\n // Save state changes\n await this.userState.saveChanges(context);\n }", "title": "" }, { "docid": "c7790344edb6ac5723031be3b3abde5d", "score": "0.55816334", "text": "function doWork()\n{\n silhouette.updateState(metadata, my_state, deviceID);\n // Update UI\n box_log.log('sending updated state:');\n box_log.log(my_state);\n}", "title": "" }, { "docid": "8578932c142ceece35278395a1624868", "score": "0.55398864", "text": "async step() {\n\n this._history.push({\n context: this.getContext().clone(),\n numberRetries: this._numberRetries,\n isComplete: this._isComplete\n });\n\n debug(`Stepping flow - ${this.getContext().getState().toString()}`);\n if(this.getContext().getState() != this.getContext().getStates().END) {\n\n try {\n var activityToExecute = this._decider.decide(this.getContext());\n debug(`Starting next activity - ${activityToExecute.getName()}`);\n await activityToExecute.execute(this.getContext());\n debug(`Activity completed - ${activityToExecute.getName()}`);\n\n } catch (e) {\n if (e.name === 'RetryableException') {\n this._numberRetries++;\n if(this.currentRetry() > 3) {\n debug(`Exhausted retries, failing..`);\n this::failure();\n } else {\n debug(`Retryable exception thrown, retrying. Attempt: ${this.currentRetry()}`);\n }\n } else {\n debug(`Exception thrown, failing..${JSON.stringify(e.stack, null, 2)}`);\n this::error(e);\n }\n }\n } else {\n debug(`Successfully completed the workflow.`);\n this::success(this);\n }\n }", "title": "" }, { "docid": "a545dd0598b679b0a9928eeb339998b2", "score": "0.5536384", "text": "async onTurn(turnContext) {\n // This bot listens for message activities.\n if (turnContext.activity.type === ActivityTypes.Message) {\n // Get the state properties from the turn context.\n const flow = await this.conversationFlow.get(turnContext, { lastQuestionAsked: question.none });\n const plan = await this.userPlan.get(turnContext, {});\n\n await MyBot.JmeterDetails(flow, plan, turnContext);\n\n // Update state and save changes.\n await this.conversationFlow.set(turnContext, flow);\n await this.conversationState.saveChanges(turnContext);\n\n await this.userPlan.set(turnContext, plan);\n await this.userState.saveChanges(turnContext);\n }\n }", "title": "" }, { "docid": "c85fd3049e4f461581e20b28b31ff6e3", "score": "0.5501253", "text": "async execute() {\n this.logger.debug(`Running ${this.id} for ${this.event}`);\n this.logger.info(`[Shard ${this.bot.shardId}] READY`);\n\n if (this.bot.controlHook && ((process.env.LOG_LEVEL || 'ERROR').toLowerCase() === 'debug')) {\n await this.bot.controlHook.edit(\n this.bot.client.user.username,\n this.bot.client.user.displayAvatarURL().replace('.webp', '.png').replace('.webm', '.gif'),\n );\n this.bot.controlHook.send({\n embeds: [{\n description: `Shard **${this.bot.shardId + 1}/${this.bot.shardCount}** ready`,\n color: 0x2B90EC,\n }],\n });\n }\n this.client.user.setPresence({\n status: 'online',\n afk: false,\n activity: {\n name: `@${this.client.user.username} help`,\n url: 'https://genesis.warframestat.us',\n },\n });\n this.bot.MessageManager = new MessageManager(this.bot);\n await this.settings.ensureData(this.client);\n this.bot.readyToExecute = true;\n\n const self = this;\n setInterval(checkPrivateRooms, self.channelTimeout, self, self.bot.shardId);\n updatePresence(this);\n setInterval(updatePresence, 60000, self);\n this.bot.dynamicVoiceHandler = new DynamicVoiceHandler(this.client, this.logger, this.settings);\n this.bot.feedNotifier = new FeedsNotifier(this.bot);\n }", "title": "" }, { "docid": "238993930e0a950ca46064e2b0ca0596", "score": "0.5399108", "text": "handleActivation() {\n localStorage.setItem('respawn',\n JSON.stringify(\n [this.resetPosition, this.resetYaw, this.resetPitch]));\n if (typeof(this.callback) == 'function') {\n this.callback();\n }\n }", "title": "" }, { "docid": "f7e8d43c2df91e59c902bda011a7ff9a", "score": "0.5318546", "text": "execute() {\n\n\t\tthis.activateIfInactive();\n\n\t\tconst subgoalStatus = this.executeSubgoals();\n\n\t\tif ( subgoalStatus === Goal.STATUS.COMPLETED || subgoalStatus === Goal.STATUS.FAILED ) {\n\n\t\t\tthis.status = Goal.STATUS.INACTIVE;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "20ac36f89256a262260ef8bcd1c3632d", "score": "0.53173274", "text": "handleUpdate(gameState, turn) {\n this.setBoard(gameState);\n this.setTurn(turn);\n this.setMessage();\n }", "title": "" }, { "docid": "8be5f572346f5661f0d81f47acaa8f0b", "score": "0.52688324", "text": "runCurrentState() {\n this.states[this.current].onState.forEach(callback => {\n callback();\n });\n }", "title": "" }, { "docid": "549fb446da9eaf74e97bd6904b3d9db5", "score": "0.52416766", "text": "async run(context) {\n await super.run(context);\n if (dispatchvar3) {\n await this.conversationState.delete(context);\n await this.conversationState.clear(context);\n }\n module.exports.dispatchvar3 = { dispatchvar3: dispatchvar3 };\n dispatchvar3 = false;\n await this.conversationState.saveChanges(context, false);\n await this.userState.saveChanges(context, false);\n }", "title": "" }, { "docid": "9951a3215799c43f9b4e714f91681250", "score": "0.52374554", "text": "ready() {\n event_store.last_activity().then(value => {\n this.set_state({value: value})\n this.ask()\n })\n }", "title": "" }, { "docid": "1fd78dddfd07b8a18a2ee6ae81d380b7", "score": "0.5211621", "text": "_onEnd() {\n const state = this.state;\n this.setState(state);\n }", "title": "" }, { "docid": "03380dab47c04b75b82d296763c48856", "score": "0.51107824", "text": "endTurn(e) {\n e.preventDefault();\n // TODO: send new status to server\n // appState.status = 'clue';\n API.sendRequest('api/endTurn/' + appState.game.id)\n .then((response) => {\n console.log(response);\n appState.status = response.status;\n })\n m.redraw();\n }", "title": "" }, { "docid": "665daaa2beeddf9b2f2271239be00a27", "score": "0.51045394", "text": "process() {\r\n //stateAttributes must have been set by call to computeScalarStates\r\n this.attributes = this.state.devState.stateAttributes.split(\",\");\r\n this.savedAttributes = this.getLocalAttribute(\"savedAttributes\");\r\n if (!this.savedAttributes) this.savedAttributes = [];\r\n if (!this.state.devState.restoreState) return;\r\n if (!this.state.reloadLocal) return;\r\n this.savedAttributes.forEach(attr => {\r\n let value = (this.state[attr] = this.getLocalAttribute(attr));\r\n\r\n if (this.state.devState.logDiags.restore)\r\n console.log(\"Restoring \", attr, value);\r\n }); // await actions.restoreSavedAttrs();\r\n // this.restoreSavedAttrs();\r\n }", "title": "" }, { "docid": "d8d2658ef17001846c6d4fddcbb98dfb", "score": "0.5072746", "text": "function setupActivity() {\n var activity = require(\"./activity-setup.js\");\n activity.setupActivity(game.scene.scenes[0]);\n\n game.events.off(\"step\", setupActivity); // Remove event, so only happens once\n}", "title": "" }, { "docid": "55b224771a792ab606c2541344377a91", "score": "0.5061683", "text": "doTurn() {\n if (this.controller.winner() != null) {\n return;\n }\n let state = this.controller.gamestate;\n this.setState({\n gameState: state,\n });\n this.controller.nextTurn();\n }", "title": "" }, { "docid": "bdcc6c682af1852f39e03275ea03c593", "score": "0.50610495", "text": "function EventHandler(context, event) {\n var botname = event.botname;\n var contextobj = JSON.stringify(event.contextobj);\n context.simpledb.roomleveldata[\"state\"]=\"start_msg\";\n var tasksforbot={\n \"type\": \"survey\",\n \"question\": \"Below are the few things you can ask me\",\n \"msgid\": \"tasks_101\",\n \"options\": [\n \"Product Info\",\n \"Locate Branch/Atm\",\n \"Ask a question\" \n ]\n } \n MyMessageHandler(botname, contextobj, \"Hi, I am the Janata Sahakari Bank bot! I will be your personal assistant\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(tasksforbot));\n }\n });\n }", "title": "" }, { "docid": "1e15468adf68ff97636375ee5f7f525a", "score": "0.50415134", "text": "function finishUpdates() {\r\n\r\n if (isInitialized && !workflowIsRunning) {\r\n isWorkflowSaved = false;\r\n lastCall = \"batch\";\r\n saveTemporaryWorkflowTransient(currentDigraph.id, null, null, null, null);\r\n }\r\n\r\n}", "title": "" }, { "docid": "b0b9be30a858b59f74c74c90f68e7632", "score": "0.5040576", "text": "function onMessageHandler(target, context, msg, self) {\n let commandsExecuted = 0; // This sets how many commands were executed this go around.\n let lastcmd = \"\"; // This sets up our current command so we can refer to it later.\n\n if (self) {\n return;\n } // We don't want it to trigger itself, so let's make sure that it doesn't do that.\n\n // Now, we'll need to get rid of any whitespace in our messages.\n const originalCommandName = msg.trim();\n // We want people to be able to run multiple commands and have it run them, so let's get that going...\n const originalCommandList = originalCommandName.split(/\\s+/g);\n // We absolutely need to fix any misspellings.\n const commandName = autocorrectIt(originalCommandName);\n const commandList = commandName.split(/\\s+/g);\n\n if (originalCommandName === \"everyone say hello! or: hi | hey | sup | yo | hola | hai | greetings | salutations | hallo | howdy | annyeong | aloha | konichiwa\") {\n if (context.username === chatbot) { // This checks to see if the Choice Chamber chat bot name, or anyone who is attempting to play as or impersonate one, matches the existing chat bot.\n robot.keyTap(\"z\"); // By default it selects \"play\", so pressing Z will start the game again.\n console.log(\"* New game\");\n } else {\n console.log(`* User ${context.username} attempted to send new game message but didn't match usernames with name ${chatbot}`);\n }\n return;\n } else if (originalCommandName === \"!cchelp\") {\n client.say(target, `[TWITCH PLAYS] ${context.username} Please visit https://jbmagination.com/TwitchPlaysCC`); // Sends a link to the website.\n return;\n }\n // Now let's set up our commands.\n\n let keepGoing = true; // This line lets the commands run.\n commandList.forEach(commandName => { // For each command,\n if (!keepGoing) { // if the keepGoing command is set to false,\n return; // do nothing.\n }\n\n let actioned = true; // This tells sets a variable for use in the console, to log what commands were run.\n const originalCmd = commandName.toLowerCase(); // This is the original command set in lowercase.\n const cmd = autocorrectIt(originalCmd); // This auto-corrects the command.\n\n if (typeof commands[cmd] !== \"undefined\") { // If it's not defined anywhere in the code, it won't work.\n if (commands[cmd][0] === \"r\") { // R is the key on our keyboard that we are going to be pushing...\n robot.keyToggle(\"r\", p2bridged ? \"up\" : \"down\"); // So we'll toggle it every time that command is run.\n p2bridged = !p2bridged; // This then toggles the state of p2bridged so that it can be toggled again when it's run next.\n } else\n if (commands[cmd][0] === \"toggletime\") { // A fake key, \"toggletime\", is for pogotoggle.\n robot.keyToggle(\"z\", pogoToggleTime ? \"up\" : \"down\"); // Once again, we toggle the Z button.\n pogoToggleTime = !pogoToggleTime; // Then toggling the state.\n } else {\n robot.keyTap(commands[cmd][0]); // If it's none of the \"commands\" above, we'll simply tap the key.\n }\n lastcmd = commands[cmd]; // This sets the \"lastcmd\" variable to our current command.\n commandsExecuted++; // It also adds to the command counter to change the message depending on how many commands were run.\n } else {\n console.log(`* Unknown command sent by ${context.username}: ${commandName.toUpperCase()}`); // If there's no command, log that it didn't know the command.\n actioned = false; // Set \"actioned\" to false so nothing is logged.\n keepGoing = false; // Set keepGoing to false so nothing is done.\n return;\n }\n\n if (actioned) { // If actioned is enabled,\n console.log(`* ${context.username} executed the ${commandName.toUpperCase()} command`); // say that a command was run.\n }\n });\n\n if (commandsExecuted === 1) { // This checks to see if we only executed one command.\n client.say(target, `/me [TWITCH PLAYS] ${context.username} made the ${lastcmd[1]}!`);\n } else if (commandsExecuted > 1) { // If we haven't executed just one command, it will say how many commands we ran.\n client.say(target, `/me [TWITCH PLAYS] ${context.username} executed ${commandsExecuted} commands`);\n }\n}", "title": "" }, { "docid": "622c49e641c181041abdab923bfd00d1", "score": "0.5002236", "text": "function __run_369() {\n\t/* eslint-disable no-invalid-this */\n\tthis.emit( '_run' );\n} // end FUNCTION run()", "title": "" }, { "docid": "482e5cda480eb859558eefcc3e476f87", "score": "0.49947956", "text": "_saveActivity() {\n this.notificationService.activityNotification(\n \"Activity Complete!\",\n `Your ${this.props.currentActivity.type} has been saved`,\n `Your ${this.props.currentActivity.type} has been saved\\n` +\n `Duration: ${this._formatTime()}\\n` +\n `Distance: ${this.props.currentActivity.distance.toFixed(3)} miles\\n` +\n `Pace: ${this.props.currentActivity.pace.toFixed(2)} mph`,\n '#03256C'\n );\n this.props.addActivity(this.props.currentActivity);\n }", "title": "" }, { "docid": "1189c7dd8aed42e94910bf0a75c42149", "score": "0.49925184", "text": "function onBot({ models: botModel }) {\r\n const loginData = {};\r\n loginData['appState'] = appState;\r\n login(loginData, async(loginError, loginApiData) => {\r\n if (loginError) return logger(JSON.stringify(loginError), `ERROR`);\r\n loginApiData.setOptions(global.config.FCAOption)\r\n writeFileSync(appStateFile, JSON.stringify(loginApiData.getAppState(), null, '\\x09'))\r\n global.config.version = '1.2.14'\r\n global.client.timeStart = new Date().getTime(),\r\n function() {\r\n const listCommand = readdirSync(global.client.mainPath + '/modules/commands').filter(command => command.endsWith('.js') && !command.includes('example') && !global.config.commandDisabled.includes(command));\r\n for (const command of listCommand) {\r\n try {\r\n var module = require(global.client.mainPath + '/modules/commands/' + command);\r\n if (!module.config || !module.run || !module.config.commandCategory) throw new Error(global.getText('mirai', 'errorFormat'));\r\n if (global.client.commands.has(module.config.name || '')) throw new Error(global.getText('mirai', 'nameExist'));\r\n if (!module.languages || typeof module.languages != 'object' || Object.keys(module.languages).length == 0) logger.loader(global.getText('mirai', 'notFoundLanguage', module.config.name), 'warn');\r\n if (module.config.dependencies && typeof module.config.dependencies == 'object') {\r\n for (const reqDependencies in module.config.dependencies) {\r\n const reqDependenciesPath = join(__dirname, 'nodemodules', 'node_modules', reqDependencies);\r\n try {\r\n if (!global.nodemodule.hasOwnProperty(reqDependencies)) {\r\n if (listPackage.hasOwnProperty(reqDependencies) || listbuiltinModules.includes(reqDependencies)) global.nodemodule[reqDependencies] = require(reqDependencies);\r\n else global.nodemodule[reqDependencies] = require(reqDependenciesPath);\r\n } else '';\r\n } catch {\r\n var check = false;\r\n var isError;\r\n logger.loader(global.getText('mirai', 'notFoundPackage', reqDependencies, module.config.name), 'warn');\r\n execSync('npm ---package-lock false --save install' + ' ' + reqDependencies + (module.config.dependencies[reqDependencies] == '*' || module.config.dependencies[reqDependencies] == '' ? '' : '@' + module.config.dependencies[reqDependencies]), { 'stdio': 'inherit', 'env': process['env'], 'shell': true, 'cwd': join(__dirname, 'nodemodules') });\r\n for (let i = 1; i <= 3; i++) {\r\n try {\r\n require['cache'] = {};\r\n if (listPackage.hasOwnProperty(reqDependencies) || listbuiltinModules.includes(reqDependencies)) global['nodemodule'][reqDependencies] = require(reqDependencies);\r\n else global['nodemodule'][reqDependencies] = require(reqDependenciesPath);\r\n check = true;\r\n break;\r\n } catch (error) { isError = error; }\r\n if (check || !isError) break;\r\n }\r\n if (!check || isError) throw global.getText('mirai', 'cantInstallPackage', reqDependencies, module.config.name, isError);\r\n }\r\n }\r\n logger.loader(global.getText('mirai', 'loadedPackage', module.config.name));\r\n }\r\n\r\n if (module.config.envConfig) try {\r\n for (const envConfig in module.config.envConfig) {\r\n if (typeof global.configModule[module.config.name] == 'undefined') global.configModule[module.config.name] = {};\r\n if (typeof global.config[module.config.name] == 'undefined') global.config[module.config.name] = {};\r\n if (typeof global.config[module.config.name][envConfig] !== 'undefined') global['configModule'][module.config.name][envConfig] = global.config[module.config.name][envConfig];\r\n else global.configModule[module.config.name][envConfig] = module.config.envConfig[envConfig] || '';\r\n if (typeof global.config[module.config.name][envConfig] == 'undefined') global.config[module.config.name][envConfig] = module.config.envConfig[envConfig] || '';\r\n }\r\n logger.loader(global.getText('mirai', 'loadedConfig', module.config.name));\r\n } catch (error) {\r\n throw new Error(global.getText('mirai', 'loadedConfig', module.config.name, JSON.stringify(error)));\r\n }\r\n if (module.onLoad) {\r\n try {\r\n const moduleData = {};\r\n moduleData.api = loginApiData;\r\n moduleData.models = botModel;\r\n module.onLoad(moduleData);\r\n } catch (_0x20fd5f) {\r\n throw new Error(global.getText('mirai', 'cantOnload', module.config.name, JSON.stringify(_0x20fd5f)), 'error');\r\n };\r\n }\r\n if (module.handleEvent) global.client.eventRegistered.push(module.config.name);\r\n global.client.commands.set(module.config.name, module);\r\n logger.loader(global.getText('mirai', 'successLoadModule', module.config.name));\r\n } catch (_0x1d44ad) {\r\n logger.loader(global.getText('mirai', 'failLoadModule', module.config.name, _0x1d44ad), 'error');\r\n };\r\n }\r\n }(),\r\n function() {\r\n const events = readdirSync(global.client.mainPath + '/modules/events').filter(event => event.endsWith('.js') && !global.config.eventDisabled.includes(event));\r\n for (const ev of events) {\r\n try {\r\n var event = require(global.client.mainPath + '/modules/events/' + ev);\r\n if (!event.config || !event.run) throw new Error(global.getText('mirai', 'errorFormat'));\r\n if (global.client.events.has(event.config.name) || '') throw new Error(global.getText('mirai', 'nameExist'));\r\n if (event.config.dependencies && typeof event.config.dependencies == 'object') {\r\n for (const dependency in event.config.dependencies) {\r\n const _0x21abed = join(__dirname, 'nodemodules', 'node_modules', dependency);\r\n try {\r\n if (!global.nodemodule.hasOwnProperty(dependency)) {\r\n if (listPackage.hasOwnProperty(dependency) || listbuiltinModules.includes(dependency)) global.nodemodule[dependency] = require(dependency);\r\n else global.nodemodule[dependency] = require(_0x21abed);\r\n } else '';\r\n } catch {\r\n let check = false;\r\n let isError;\r\n logger.loader(global.getText('mirai', 'notFoundPackage', dependency, event.config.name), 'warn');\r\n execSync('npm --package-lock false --save install' + dependency + (event.config.dependencies[dependency] == '*' || event.config.dependencies[dependency] == '' ? '' : '@' + event.config.dependencies[dependency]), { 'stdio': 'inherit', 'env': process['env'], 'shell': true, 'cwd': join(__dirname, 'nodemodules') });\r\n for (let i = 1; i <= 3; i++) {\r\n try {\r\n require['cache'] = {};\r\n if (global.nodemodule.includes(dependency)) break;\r\n if (listPackage.hasOwnProperty(dependency) || listbuiltinModules.includes(dependency)) global.nodemodule[dependency] = require(dependency);\r\n else global.nodemodule[dependency] = require(_0x21abed);\r\n check = true;\r\n break;\r\n } catch (error) { isError = error; }\r\n if (check || !isError) break;\r\n }\r\n if (!check || isError) throw global.getText('mirai', 'cantInstallPackage', dependency, event.config.name);\r\n }\r\n }\r\n logger.loader(global.getText('mirai', 'loadedPackage', event.config.name));\r\n }\r\n if (event.config.envConfig) try {\r\n for (const _0x5beea0 in event.config.envConfig) {\r\n if (typeof global.configModule[event.config.name] == 'undefined') global.configModule[event.config.name] = {};\r\n if (typeof global.config[event.config.name] == 'undefined') global.config[event.config.name] = {};\r\n if (typeof global.config[event.config.name][_0x5beea0] !== 'undefined') global.configModule[event.config.name][_0x5beea0] = global.config[event.config.name][_0x5beea0];\r\n else global.configModule[event.config.name][_0x5beea0] = event.config.envConfig[_0x5beea0] || '';\r\n if (typeof global.config[event.config.name][_0x5beea0] == 'undefined') global.config[event.config.name][_0x5beea0] = event.config.envConfig[_0x5beea0] || '';\r\n }\r\n logger.loader(global.getText('mirai', 'loadedConfig', event.config.name));\r\n } catch (error) {\r\n throw new Error(global.getText('mirai', 'loadedConfig', event.config.name, JSON.stringify(error)));\r\n }\r\n if (event.onLoad) try {\r\n const eventData = {};\r\n eventData.api = loginApiData, eventData.models = botModel;\r\n event.onLoad(eventData);\r\n } catch (error) {\r\n throw new Error(global.getText('mirai', 'cantOnload', event.config.name, JSON.stringify(error)), 'error');\r\n }\r\n global.client.events.set(event.config.name, event);\r\n logger.loader(global.getText('mirai', 'successLoadModule', event.config.name));\r\n } catch (error) {\r\n logger.loader(global.getText('mirai', 'failLoadModule', event.config.name, error), 'error');\r\n }\r\n }\r\n }()\r\n logger.loader(global.getText('mirai', 'finishLoadModule', global.client.commands.size, global.client.events.size));\r\n logger.loader('=== ' + (Date.now() - global.client.timeStart) + 'ms ===');\r\n writeFileSync(global.client.configPath, JSON.stringify(global.config, null, 4), \"utf8\");\r\n unlinkSync(global.client.configPath + '.temp');\r\n\r\n const listenerData = {};\r\n listenerData.api = loginApiData;\r\n listenerData.models = botModel;\r\n const listener = require('./includes/listen')(listenerData);\r\n\r\n function listenerCallback(error, message) {\r\n if (error) return logger(global.getText('mirai', 'handleListenError', JSON.stringify(error)), 'error');\r\n if (['presence', 'typ', 'read_receipt'].some(data => data == message['type'])) return;\r\n if (global.config.DeveloperMode == !![]) console.log(message);\r\n return listener(message);\r\n };\r\n global.handleListen = loginApiData.listenMqtt(listenerCallback);\r\n logger(`\r\n♡================================♡\r\n ░█████╗░██████╗░███████╗░█████╗░\r\n ██╔══██╗██╔══██╗██╔════╝██╔══██╗\r\n ██║░░██║██████╔╝█████╗░░██║░░██║\r\n ██║░░██║██╔══██╗██╔══╝░░██║░░██║\r\n ╚█████╔╝██║░░██║███████╗╚█████╔╝\r\n ░╚════╝░╚═╝░░╚═╝╚══════╝░╚════╝░\r\n♡================================♡\r\n\\n`, '[ OREO ]');\r\n logger('Đã xoá Gban, restart, timeout', '[ OREO ]');\r\n logger(\"Á đù, source code đã bị thay đổi bởi OreoZera\", '[ OREO ]');\r\n logger(\"Cám ơn đã sử dụng git, tôi là Le Thanh Thien\", '[ OREO] ');\r\n });\r\n}", "title": "" }, { "docid": "0610421887ecac78e887a5cced8a1a47", "score": "0.49603596", "text": "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "title": "" }, { "docid": "df62b066a363d8a349c1052618318080", "score": "0.49556446", "text": "function runScript() {\n chrome.storage.local.set({\"isRunning\": true}, function() {\n //\n });\n\n chrome.runtime.sendMessage({\n action: \"runScript\"\n });\n}", "title": "" }, { "docid": "bfe1bb3cddeb92cd0f77e27fbf746857", "score": "0.49449894", "text": "function runGame()\n {\n console.log(\"runGame()\");\n console.log(`Tracker: ${tracker}`);\n console.log(`Ticks: ${ticks}`);\n var humanTurn = $(this);\n if(gameStatus === 'ready')\n {\n turnHandler(humanTurn);\n }\n else if(gameStatus === 'ended')\n {\n $(\"#output\").text(\"Resetting Game...\");\n resetGame();\n }\n }", "title": "" }, { "docid": "02ae65747da6072b92c5de393c942ea1", "score": "0.49039596", "text": "updateState(){\n\t\tif(this.CURRENT_STATE != this.AI_STATES.DEAD){\n\t\t\tif(!this.executing_command){\n\t\t\t\tif(this.CURRENT_STATE === this.AI_STATES.IDLE){\n\t\t\t\t\tthis.animations.play('idle');\n\t\t\t\t\tthis.og_position.x = this.body.x;\n\t\t\t\t\tthis.og_position.y = this.body.y;\n\t\t\t\t}\n\t\t\t\telse if(this.CURRENT_STATE === this.AI_STATES.EMOTE){\n\t\t\t\t\tthis.animations.play('jump');\n\t\t\t\t\tthis.executing_command = true;\n\t\t\t\t}\n\t\t\t\telse if(this.CURRENT_STATE === this.AI_STATES.MOVE){\n\t\t\t\t\tthis.animations.play('walk');\n\t\t\t\t\tlet rand = Math.random();\n\t\t\t\t\tlet rand_amount = this.getRandomInt(25, 150);\n\t\t\t\t\tif(rand <= .5){\n\t\t\t\t\t\tthis.body.moveTo(2000, rand_amount, Phaser.ANGLE_RIGHT);\n\t\t\t\t\t\tthis.invertToRight();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tthis.body.moveTo(2000, rand_amount, Phaser.ANGLE_LEFT);\n\t\t\t\t\t\tthis.invertToLeft();\n\t\t\t\t\t}\n\t\t\t\t\tthis.executing_command = true;\n\t\t\t\t}\n\t\t\t\telse if(this.CURRENT_STATE === this.AI_STATES.UNDER_ATTACK){\n\t\t\t\t\tthis.executing_command = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{//play death animation if collided with enemy\n\t\t\tthis.animations.play('dead');\n\t\t}\n\t\tif(this.executing_command){//command execution after the state assignment\n\t\t\tif(this.CURRENT_STATE === this.AI_STATES.EMOTE){\n\t\t\t\tif(!this.spawnedEmote){\n\t\t\t\t\tthis.spawnedEmote = true;\n\t\t\t\t\tlet key_;\n\t\t\t\t\tif(Math.random() > .5)\n\t\t\t\t\t\tkey_ = 'blob_home';\n\t\t\t\t\telse\n\t\t\t\t\t\tkey_ = 'blob_power';\n\t\t\t\t\tthis.personalEmote = new Emote(this.game, this.x+50, this.y-30, key_, null, this);\n\t\t\t\t\tthis.game.add.existing(this.personalEmote);\t\n\t\t\t\t}\n\t\t\t\telse if(this.spawnedEmote && this.personalEmote == null){\n\t\t\t\t\tthis.spawnedEmote = false;\n\t\t\t\t\tthis.executing_command = false;\n\t\t\t\t\tthis.CURRENT_STATE = this.AI_STATES.IDLE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this.CURRENT_STATE === this.AI_STATES.MOVE){\n\t\t\t\tif(this.x < 400 || this.x > 1100){\n\t\t\t\t\tthis.body.velocity.x = 0;\n\t\t\t\t\tif(this.x < 400)\n\t\t\t\t\t\tthis.x = 400;\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.x = 1100;\n\t\t\t\t\tthis.executing_command = false;\n\t\t\t\t\tthis.CURRENT_STATE = this.AI_STATES.IDLE;\n\t\t\t\t}\n\t\t\t\telse if(this.body.velocity.x == 0){\n\t\t\t\t\tthis.executing_command = false;\n\t\t\t\t\tthis.CURRENT_STATE = this.AI_STATES.IDLE;\n\t\t\t\t} \n\t\t\t}\n\t\t\telse if(this.CURRENT_STATE === this.AI_STATES.UNDER_ATTACK){\n\t\t\t\tthis.invertToLeft();\n\t\t\t\tthis.respondToAttack();\n\t\t\t\t//the ai manager must reset the ai state of under attack, not the ai\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9bb0082f66d33474a85318719feddf74", "score": "0.48796254", "text": "function handleState() {\n\tif( gameState == states.INITIAL )\n\t\tgameState = states.STARTED;\n\telse if( gameState == states.GAMEOVER || gameState == states.GAMEWIN ) {\n\t\tsetInitial();\n\t\tgameState = states.STARTED;\n\t}\n}", "title": "" }, { "docid": "bac64592850b420a34235ce6390d148d", "score": "0.48773557", "text": "function onActivity() {\r\n this.latestActivity = new Date().getTime();\r\n }", "title": "" }, { "docid": "e42297e530d15161777dd3a2043e346c", "score": "0.48763344", "text": "function onRun( $rootScope ) {\n\t\t$rootScope.$on( \"$stateChangeSuccess\", function() {\n\t\t\treturn;\n\t\t});\n\t\treturn;\n\t}", "title": "" }, { "docid": "943efde015ac6111bc2e2fa387a2fd44", "score": "0.4866835", "text": "function execute() {\n\t\tif(status == Status.Pause) {\n\t\t\treturn;\n\t\t} else if(status == Status.Stop) {\n\t\t\tcurrentState = getInitialState();\n\t\t\tletterIndex = 0;\n\t\t\tsteps = 0;\n\t\t\treturn;\n\t\t} \n\n\t\tsteps += 1;\n\t\thighlightCurrentLetter($('#letter' + letterIndex));\n\n\t\tvar input = inputStr.charAt(letterIndex).toLowerCase();\n\n\t\tvar transition = currentState.GetTransition(input);\n\t\tcurrentState = transition.next != undefined ? transition.next : currentState;\n\t\tqueue.push(transition.action != undefined ? transition.action : Action.Stop);\n\n\t\t$('.stateon').removeClass('stateon');\n\t\tvar self = $('#' + currentState.Name);\n\t\tself.addClass('stateon');\n\t\tself.effect('bounce', {'times' : 3}, 'slow');\n\t\tletterIndex = (letterIndex + 1) % inputStr.length;\n\n\t\tCrafty.trigger('Step', queue.shift());\n\t}", "title": "" }, { "docid": "ca944f597dd4892997ffe20bc2562d21", "score": "0.48603997", "text": "supersedeRunContext(runContext) {\n this._asyncLocalStorage.enterWith(runContext);\n }", "title": "" }, { "docid": "481570b1ca3df893f535e08c731e904b", "score": "0.48584417", "text": "function status_post_saved(data) {\n\t// refresh activity stream\n\trefresh_profile_widget('activity_feed_profile');\n\t// refresh activity post\n\trefresh_profile_widget('status_posts_profile');\n}", "title": "" }, { "docid": "b2e5684f560d051077c7811abf192f11", "score": "0.4852427", "text": "async stepBattle() {\n\t\t// Parse the intent\n\t\tlet item = this.lastStabby;\n\t\tlet part = null;\n\t\tfor (let slice of this.intent) {\n\t\t\tif (slice.item != null) {\n\t\t\t\titem = slice.item;\n\t\t\t}\n\t\t\tif (slice.part != null) {\n\t\t\t\tpart = slice.part;\n\t\t\t}\n\t\t}\n\n\t\t// Attempt to use the item, on the part\n\t\tawait item.use(this.opponent, part);\n\n\t\t// If the opponent isn't already dead\n\t\tif (this.opponent.health > 0) {\n\t\t\t// Let the enemy take their turn\n\t\t\tawait this.opponent.turn();\n\t\t}\n\n\t\t// Start the player's next turn\n\t\tconst slices = this.intent[0].siblings;\n\t\tthis.resetIntent();\n\t\t// If the player isn't dead\n\t\tif (this.player.health > 0) {\n\t\t\t// If the opponent is done for\n\t\t\tif (this.opponent.health <= 0) {\n\t\t\t\t// Wait a moment, so the player can read the text\n\t\t\t\tawait sleep(750);\n\t\t\t\t// Fade out the current text\n\t\t\t\tconst dur = 500;\n\t\t\t\tfor (let child of this.element.children) {\n\t\t\t\t\tif (child !== this.slicesElement) {\n\t\t\t\t\t\tchild.style.opacity = '0';\n\t\t\t\t\t\tTransition.animate(child, {\n\t\t\t\t\t\t\topacity: {\n\t\t\t\t\t\t\t\tfrom: '1',\n\t\t\t\t\t\t\t\tto: '0'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, dur);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Update the current text\n\t\t\t\tawait sleep(dur);\n\t\t\t\t// Reward the player\n\t\t\t\tlet rewardStr = '';\n\t\t\t\tif (!this.meta.options.isTheft) {\n\t\t\t\t\tconst reward = this.meta.reward;\n\t\t\t\t\tthis.player.health += reward;\n\t\t\t\t\trewardStr = ` and gained ${reward} heart${\n\t\t\t\t\t\treward > 1 ? 's' : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tawait this.pushMessage(`You defeated ${this.opponent.the}${rewardStr}!`, {\n\t\t\t\t\tbefore: this.intentElement\n\t\t\t\t});\n\t\t\t\t// Let the player continue\n\t\t\t\tthis.showSlices([\n\t\t\t\t\tnew Slice({\n\t\t\t\t\t\tid: 'continue',\n\t\t\t\t\t\ttext: 'continue'\n\t\t\t\t\t})\n\t\t\t\t]);\n\t\t\t\tthis.intentElement.style.opacity = '1';\n\t\t\t} else {\n\t\t\t\t// Continue the fight\n\t\t\t\tthis.showSlices(slices);\n\t\t\t}\n\t\t} else {\n\t\t\t// Game over\n\t\t\tthis.pushMessage(`You died`);\n\t\t}\n\t}", "title": "" }, { "docid": "a4eec54413fd9589b3c0995d840d5f99", "score": "0.48478755", "text": "run() {\n this.setUploadEvents();\n }", "title": "" }, { "docid": "d68c2ff49af8d72c098e8e1271d34987", "score": "0.4833146", "text": "async function MessageHandler(context, event) {\n var options = Object.assign({}, scr_config);\n\n options.current_dir = __dirname;\n options.default_message = default_message;\n // You can add any start point by just mentioning the <script_file_name>.<section_name>\n options.start_section = \"default.main\";\n\n // context.console.log('here is the context', {context, event, options});\n\n const response = await botResponse(context, event);\n context.console.log(response);\n // if(event.message.toLowerCase() === 'menu') {\n // var options = Object.assign({}, scr_config);\n // context.sendResponse('Display menu here');\n // }\n context.sendResponse(response);\n\n // ScriptHandler(context, event, options);\n}", "title": "" }, { "docid": "a26fd9412d14a6a20101901119bba67a", "score": "0.48322308", "text": "function update() {\n if (!$state.started) {\n handleStart();\n }\n\n if (!$state.completed) {\n handleChange();\n }\n\n if (!$state.completed && lastValue($data.user)) {\n handleComplete();\n }\n }", "title": "" }, { "docid": "5c36da07e2907c4e883dc004917a697b", "score": "0.4823196", "text": "function EventHandler(context, event) {\n if(! context.simpledb.botleveldata.numinstance)\n context.simpledb.botleveldata.numinstance = 0;\n numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\n context.simpledb.botleveldata.numinstance = numinstances;\n context.sendResponse(\"Hey, thanks for adding me! To see what I'm all about, just do an @mention help, i.e. @buddy help\");\n }", "title": "" }, { "docid": "85d8e447e0227126f51922adac04e5f0", "score": "0.48024255", "text": "async function doSomething(item) {\n // Checking if the item was saved will keep the bot from processing anything twice.\n if (!item.saved) {\n console.log(`processing item: ${item.id}`)\n console.dir(item)\n //\n // CODE STARTS HERE //\n\n\n\n\n await printContents(item)\n await replyToComment(item)\n\n\n\n\n\n // CODE ENDS HERE //\n //\n // Be sure to finish with saveItem(item) so the item will not be processed again.\n await saveItem(item) // Leave this line where it is!\n return console.log(`item ${item.id} successfully processed!`)\n } else {\n return console.log(`item ${item.id} saved already. Skipping...`)\n }\n}", "title": "" }, { "docid": "7d378b8e74fb7c20157c1adc9ff9d663", "score": "0.47773647", "text": "run() {throw new Error(\"State.run must be overridden by inheriting class\");}", "title": "" }, { "docid": "7fbae2b7ab98b1bfd2be068c067b1a94", "score": "0.47758096", "text": "handler(props, e) {\r\n\r\n this.setState({justRegistered: false});\r\n\r\n // maintain an array of possible views\r\n var views = ['login', 'register', 'game', 'scores', 'profile', 'logout'];\r\n\r\n // IF changing view button pressed\r\n if ($.inArray(props.btnView, views) != -1) {\r\n\r\n\r\n // handle entering and leaving game =========================\\\\\\\r\n // handle entering and leaving game =============================\\\\\\\r\n // entering game afterLogin (called in that function) and when pressing Game button from non game view\r\n if (props.btnView == 'game' && this.state.view != 'game') {\r\n\r\n this.sendEnteringGame();\r\n\r\n // leaving game\r\n } else if (props.btnView != 'game') {\r\n\r\n this.sendLeavingGame();\r\n }\r\n\r\n // handle entering and leaving game =============================///\r\n // handle entering and leaving game =========================///\r\n\r\n DEBUGclient('in Content (Parent), changing view from: '+this.state.view);\r\n this.setState({registerError: false});\r\n this.setState({view: props.btnView}, function() {\r\n DEBUGclient('in Content (Parent), changing view to: '+props.btnView);\r\n });\r\n\r\n // ELSE other button\r\n } else {\r\n switch(props.btnView) {\r\n case 'registerAccount':\r\n DEBUGclient('Create account btn pressed');\r\n\r\n // ONLY send to server if form is valid\r\n if (props.regState.formValid) {\r\n let username = props.regState.username;\r\n let password = props.regState.password;\r\n\r\n DEBUGclient('registration form was valid');\r\n\r\n registerAccount(username, password, this.afterRegister);\r\n\r\n\r\n }\r\n break;\r\n\r\n case 'loginAccount':\r\n DEBUGclient('Login btn pressed');\r\n\r\n if (props.logState.formValid) {\r\n let username = props.logState.username;\r\n let password = props.logState.password;\r\n\r\n DEBUGclient('login form was valid');\r\n\r\n loginAccount(username, password, this.afterLogin);\r\n\r\n }\r\n\r\n\r\n case 'changeUsername':\r\n\r\n DEBUGclient('in change username case in handler');\r\n\r\n let currUname1 = props.currUname;\r\n let newUname = props.newUname;\r\n\r\n changeUsername(currUname1, newUname, this.afterChangeUsername);\r\n\r\n\r\n case 'changePassword':\r\n\r\n DEBUGclient('in change password case in handler');\r\n\r\n let currUname2 = props.currUname;\r\n let newPassword = props.newPassword;\r\n\r\n changePassword(currUname2, newPassword, this.afterChangePassword);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "4948162f803bfab2205b5c7d4dbb9e37", "score": "0.47476935", "text": "_actionFinishStatusAnimation(payload) {\n this._complete = true;\n // There is currently no transition out, so we can synchronously start the next game\n this.store.moveToNextGame();\n }", "title": "" }, { "docid": "d736669b2bc4a3b1bca426e024ebfa38", "score": "0.47472844", "text": "onVoid(state) {\n this.execBackwardStrategy();\n }", "title": "" }, { "docid": "51b0062225851d5c7fa261ea63a0f3fb", "score": "0.47417557", "text": "run() {\n // Update\n this.prepareTick();\n this.updateResources();\n this.updateCombat();\n this.updateBuildings();\n this.updateTroops();\n this.spawnTroops();\n\n this.game.emit('tick', this.mutation);\n this.updateToken();\n //this.cleanupTroops();\n if (!this.stopped) {\n setTimeout(this.run.bind(this), Globals.timePerTick);\n }\n }", "title": "" }, { "docid": "53caeb13b45e4965d1cbb794f8949e3b", "score": "0.4736305", "text": "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n this.screen.done();\n this.done(state.value);\n }", "title": "" }, { "docid": "036b687f47587f48a20523e7b8a5ad4d", "score": "0.47261703", "text": "function onMessageHandler (channel, userstate, msg, self) {\n\t\n\t// If game isn't running, we don't care about anything\n\tif (GameHasStarted == true) {\n\t\n\t\tif (self) { return; } // Ignore messages from the bot\n\n\t\tswitch(userstate[\"message-type\"]) {\n\t\t\tcase \"action\":\n\t\t\t\t// This is an action message..\n\t\t\t\tbreak;\n\t\t\tcase \"chat\":\n\t\t\t\n\t\t\t\t// Variable for determining whether the user has played this round - 0 for not found\n\t\t\t\tvar HasUserPlayedThisSession = false;\n\n\t\t\t\t// Check if user has played this session\n\t\t\t\t// Look through the array count the number of times this users name appears (if any)\n\t\t\t\t// We could use a 2D array ( [[][].[]] ), however that would require extra coding to append the data\n\t\t\t\t// ...this way we keep it short and simple as the array is cleared on game end anyway\n\t\t\t\tfor (const [index, content] of UsersInPlayArray.entries()) {\n\t\t\t\t\tif ( content === userstate['user-id'] ) {\n\t\t\t\t\t\tHasUserPlayedThisSession = true; // We don't care about them\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the user has goes left, let them play\n\t\t\t\t// ...if we wanted to give followers of subscribers more attempts, we could case them here and add numbers to 'DefaultChancesPerUser'\n\t\t\t\tif (HasUserPlayedThisSession == false)\n\t\t\t\t{\n\t\t\t\t\tconst commandName = msg.trim();\n\t\t\t\t\tvar PositionToAdd = -1;\n\n\t\t\t\t\tif (commandName === '!1') {\n\t\t\t\t\t\tPositionToAdd = \"0\";\n\t\t\t\t\t}\n\t\t\t\t\telse if (commandName === '!2') {\n\t\t\t\t\t\tPositionToAdd = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telse if (commandName === '!3') {\n\t\t\t\t\t\tPositionToAdd = \"2\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a selection has been made\n\t\t\t\t\tif (PositionToAdd > -1) {\n\t\t\t\t\t\tArrayOfPlayers[PositionToAdd] += 1;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add the user to the array, reducing the number of goes by 1\n\t\t\t\t\t\t// Only do it on valid answer...\n\t\t\t\t\t\tUsersInPlayArray.push(userstate['user-id']);\n\t\t\t\t\t\tPlayerGuesses.push([userstate['display-name'], PositionToAdd]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// This is a chat message..\n\t\t\t\tbreak;\n\t\t\tcase \"whisper\":\n\t\t\t\t// Twitch hates whispers\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Something else ?\n\t\t\t\tbreak;\n\t\t}\n }\n}", "title": "" }, { "docid": "6f9b87ee498c0635ee1d68c4c7c5643f", "score": "0.47256958", "text": "setSaved() {\n this.args.saved_value = this.args.value;\n this.changed = false;\n }", "title": "" }, { "docid": "561f53a5694f2f519583f4a131a4284d", "score": "0.4719229", "text": "function restoreState(req, sender, sendResponse) {\n // first get current window\n chrome.windows.getCurrent(function(win) {\n // then get current tab\n chrome.tabs.getSelected(win.id, function(tab) {\n // check the tab's state\n if (state[tab.id] === 'on') {\n // if it should be on turn it on\n turnOn(tab.id);\n // notify content script that all is good\n sendResponse({ok: true});\n }\n });\n });\n }", "title": "" }, { "docid": "7cb9fdca509fbc56ead6d19acaf3fa76", "score": "0.4718958", "text": "updateActivity( newValue ) {\n this.setState({\n activity: _.extend( this.state.activity, newValue )\n });\n }", "title": "" }, { "docid": "46da1853b05721e5f9fc2945e5b80bff", "score": "0.47180486", "text": "function activity(){\n //reset the secondsSinceLastActivity variable\n //back to 0\n secondsSinceLastActivity = seconds;\n\n\n }", "title": "" }, { "docid": "7cfea5976105d675f7b3a52e4983a7a0", "score": "0.47152534", "text": "_updateState() {\n console.log('State should be changed');\n }", "title": "" }, { "docid": "9d25a68f110e8ed37bdb71f3ba9e32cb", "score": "0.47112817", "text": "startActivity(){this._FBPTriggerWire(\"--activityStarted\")}", "title": "" }, { "docid": "4caa815c1fe5c75c84472eece60a34ba", "score": "0.47058752", "text": "function onApply(values) {\n limitUpdates = values.limitUpdates;\n toggleKey = values.toggleKey;\n logChat = values.logChat;\n useInsults = values.useInsults;\n }", "title": "" }, { "docid": "1f8adf1dc2f2eccccb722f89c90253cc", "score": "0.47042534", "text": "function MessageHandler(context, event) {\n \n // context.sendResponse(JSON.stringify(event));\n var botname = event.botname;\n var contextobj = JSON.stringify(event.contextobj);\n var message=event.message.toLowerCase();\n\n if (event.messageobj.refmsgid == \"tasks_101\") {\n context.simpledb.roomleveldata.state=\"start_msg\";\n context.simpledb.saveData();\n }\n if (event.messageobj.refmsgid == \"products_201\") {\n context.simpledb.roomleveldata.state=\"product_info\";\n context.simpledb.saveData();\n }\n if (event.messageobj.refmsgid == \"branch_locator_301\") {\n context.simpledb.roomleveldata.state=\"branch_locator\";\n context.simpledb.saveData();\n }\n if (event.messageobj.refmsgid == \"deposit_cat\") {\n context.simpledb.roomleveldata.state=\"deposit_forms\";\n context.simpledb.saveData();\n }\n if (event.messageobj.refmsgid == \"loan_cat\") {\n context.simpledb.roomleveldata.state=\"loan_forms\";\n context.simpledb.saveData();\n }\n \n if (event.messageobj.refmsgid == \"main_apply_222\") {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.simpledb.saveData();\n }\n \n if (event.messageobj.refmsgid == \"bank_location_cat\") {\n context.simpledb.roomleveldata.state=\"bank_locations\";\n context.simpledb.saveData();\n }\n if (event.messageobj.refmsgid == \"bank_atm_cat\") {\n context.simpledb.roomleveldata.state=\"bank_atm\";\n context.simpledb.saveData();\n }\n if(context.simpledb.roomleveldata.state==\"start_msg\"){\n if(message==\"product info\"){\n var product={\n \"type\": \"survey\",\n \"question\": \"Select a product to know about it\",\n \"msgid\": \"products_201\",\n \"options\": [\n \"Deposit Schemes\",\n \"Loan Schemes\"\n ]\n }\n context.simpledb.roomleveldata.state=\"product_info\";\n context.sendResponse(JSON.stringify(product)); \n\n }\n else if(message==\"locate branch/atm\"){\n var branch_locator={\n \"type\": \"survey\",\n \"question\": \"Branch Locator\",\n \"msgid\": \"branch_locator_301\",\n \"options\": [\n \"Branch Location\",\n \"ATM\" \n ]\n }\n context.simpledb.roomleveldata.state=\"branch_locator\";\n context.sendResponse(JSON.stringify(branch_locator)); \n\n } \n else if(message==\"ask a question\"){\n context.simpledb.roomleveldata.state=\"nlp_handler\";\n context.sendResponse(\"Hey,What would you like to ask us?\"); \n\n }\n else{\n var tasksforbot={\n \"type\": \"survey\",\n \"question\": \"Below are the few things you can ask me\",\n \"msgid\": \"tasks_101\",\n \"options\": [\n \"Product Info\",\n \"Locate Branch/Atm\",\n \"Ask a question\" \n ]\n };\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(tasksforbot));\n }\n });\n }\n }\n else if(context.simpledb.roomleveldata.state==\"product_info\"){\n if(message==\"deposit schemes\"){\n \n context.simpledb.roomleveldata.state=\"deposit_forms\";\n context.sendResponse(JSON.stringify(deposit_corousel));\n }\n\n else if(message==\"loan schemes\"){\n \n context.simpledb.roomleveldata.state=\"loan_forms\";\n context.sendResponse(JSON.stringify(loan_carousel));\n\n }\n else{\n var product={\n \"type\": \"survey\",\n \"question\": \"Select a product to know about it\",\n \"msgid\": \"products_201\",\n \"options\": [\n \"Deposit Schemes\",\n \"Loan Schemes\"\n ]\n };\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(product));\n }\n });\n }\n }\n else if(context.simpledb.roomleveldata.state==\"deposit_forms\"){\n if(message==\"know more 1\"){\n var final_msg=\"1. Benefits of Recurring Deposit as well as Cumulative Deposit\\n2. Attractive Interest Rates\\n3. Total Deposit Period - Min.12 Months. Max.18 Years.\\n4. Scheme is in two types namely -\\n(a) Shubhashish Recurring and Reinvestment Deposit\\n(b) Shubhashish Recurring Deposit\\n* Pl.contact nearest branch for more information.\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n }\n else if(message==\"know more 2\"){\n var final_msg=\"1. Earn Interest of Fixed Deposit\\n2. Get Flexibility of Saving account options\\n3. Invest Minimum 25,000/-\\n4. Get Attractive Interest\\n5. No Penal Interest for Before Maturity\\n6. Nomination facility available\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n\n }\n else if(message==\"know more 3\"){\n var final_msg=\"This is an ideal plan to cultivate the habit of regular savings. Monthly regular saving builds, a good corpus to provide for your short Term as well as long Term financial requirements\\n*Loan available up to 85% of the balance outstanding in deposit account.\\n*Nomination facility available.\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n \n }\n else if(message==\"know more 4\"){\n var final_msg=\"A unique scheme with automatic renewal facility and dual benefits of Saving and Fixed Deposit Account.\\n*Minimum Deposit Amount 5,000/-\\n*Minimum withdrawal and Deposit should be of 1,000/- of in multiple of 1,000/-.\\n*Tenure of Deposit - 45 Days\\n*Nomination facility available.\\n\\nPayment of Interest\\n*Facility of Transfer to Savings / Current Account available\\n*Facility of Cumulative Interest also available\\n\\nWho can deposit\\n*Individuals, Partnership firms, Proprietory firm, Limited Company. H.U.F.\\n\\nLoan\\n*90 % Loan facility available\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n \n }\n else{\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n }\n }\n\n else if(context.simpledb.roomleveldata.state==\"loan_forms\"){\n if(message==\"know more 1\"){\n var final_msg=\"Loan Amount : Maximum 30 Lacs for Mumbai, Pune & P.C.M.C. area & 20 Lacs for other areas\\nRate of Interest : 14%\\nPeriod Of Repayment : 7 years (Max) with moratorium facility\\nGuarantor : One only\\nEligibility : Fresher / Serviceman with professional Degree Holder\\nPurpose Of Loan : For Purchase of Office premises, Furniture for procuring professional equipment\\'s (Except Vehicle)\\nApplication Contribution: 5% of total project cost\\nSeed Cap Loan : 20% of project cost\\nTerms Loan : 75% of project cost\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n }\n else if(message==\"know more 2\"){\n var final_msg=\"Rate of Interest : 12%\\nGuarantor : No\\nMembership : Minimum 1,000 only\\nDocuments : Simple\\nWho can Apply : Individual only\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n\n }\n else if(message==\"know more 3\"){\n var final_msg=\"For Foreign Travel upto 1,00,000/-\\nRate of Interest: Click here for Interest Rate\\nPeriod : 3 Years\\nMargin : Domestic - 15% of total expenses; Foreign - 30 % of total expenses\\nGuarantor : Two\\nRepayment : By Post Dated Cheque Only\\nSecurity : Collateral - (For foreign tour only)\\nDocuments : \\n*Loan Application\\n*Latest Income Proof of Applicant \\n*PAN Card of Applicant \\n*Address Proof of Applicant\\n*Photograph of Applicant \\n*Quotation for expenses\\n*Copy of Passport / Visa\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(apply_main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n\n }\n else{\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n }\n }\n else if(context.simpledb.roomleveldata.state==\"branch_locator\"){\n if(message==\"branch location\"){\n context.simpledb.roomleveldata.state=\"bank_locations\";\n context.sendResponse(JSON.stringify(bank_location_corousel));\n }\n else if(message==\"atm\"){\n context.simpledb.roomleveldata.state=\"bank_atm\";\n context.sendResponse(JSON.stringify(bank_atm_carousel));\n }\n else{\n var branch_locator={\n \"type\": \"survey\",\n \"question\": \"Branch Locator\",\n \"msgid\": \"branch_locator_301\",\n \"options\": [\n \"Branch Location\",\n \"ATM\" \n ]\n }\n\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(branch_locator));\n }\n });\n }\n\n }\n else if( context.simpledb.roomleveldata.state==\"bank_locations\" || context.simpledb.roomleveldata.state==\"bank_atm\"){\n \n if(message.includes(\"know more\")){\n var final_msg=\"To know more about Janta Sahkari Bank you can go through the link \\n https://www.janatabankpune.com/\";\n MyMessageHandler(botname, contextobj,final_msg, context, function (data) {\n if (data) {\n var main={\n \"type\": \"quick_reply\",\n \"content\": {\n \"type\": \"text\",\n \"text\": \" \"\n },\n \"msgid\": \"main_apply_222\",\n \"options\": [\n \"Main menu\",\n ]\n }\n context.simpledb.roomleveldata.state=\"main_apply\";\n context.sendResponse(JSON.stringify(main));\n //context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n \n }\n else{\n MyMessageHandler(botname, contextobj, \"Sorry, can you tell me again?\", context, function (data) {\n if (data) {\n context.sendResponse(JSON.stringify(deposit_corousel));\n }\n });\n }\n\n\n }\n else if(context.simpledb.roomleveldata.state==\"main_apply\"){\n if(message==\"main menu\"){\n var tasksforbot={\n \"type\": \"survey\",\n \"question\": \"Below are the few things you can ask me\",\n \"msgid\": \"tasks_101\",\n \"options\": [\n \"Product Info\",\n \"Locate Branch/Atm\",\n \"Ask a question\" \n ]\n } ;\n context.sendResponse(JSON.stringify(tasksforbot)); \n\n } \n else if(message==\"apply now\"){\n var branch_locator={\n \"type\": \"survey\",\n \"question\": \"Branch Locator\",\n \"msgid\": \"branch_locator_301\",\n \"options\": [\n \"Branch Location\",\n \"ATM\" \n ]\n }\n context.simpledb.roomleveldata.state=\"branch_locator\";\n context.sendResponse(JSON.stringify(branch_locator)); \n }\n }\n else if(context.simpledb.roomleveldata.state==\"nlp_handler\"){\n\n if(message==\"ask a question\"){\n context.simpledb.roomleveldata.state=\"nlp_handler\";\n context.sendResponse(\"Hey,What would you like to ask us?\"); \n }\n else{\n sendMessageToApiAi({\n message : event.message,\n sessionId : new Date().getTime() +'api',\n nlpToken : nlpToken,\n callback : function(res){\n //Sample response from apiai here.\n context.sendResponse(JSON.parse(res).result.fulfillment.speech);\n }\n },context);\n }\n}\n }", "title": "" }, { "docid": "701aecf7d37fe01ee1e5aae1a9a213a6", "score": "0.47038716", "text": "run() {\n const self = this;\n if (self.steamDB.count > 0 || self.steamDB.countUnknowns > 0) {\n if (self.isCSRINRU) {\n self.createInterfaceCSRINRU();\n self.fillInterfaceCSRINRU();\n self.loadEventsCSRINRU();\n } else {\n self.createInterface();\n self.fillInterface();\n self.loadEvents();\n }\n }\n }", "title": "" }, { "docid": "6d24d6e036195d7912230d7568b7d8e9", "score": "0.4700739", "text": "callback(task) {\r\n console.log(`System status : ${task.id}`);\r\n timerCountSleep.reset()\r\n async function Awake() {\r\n botzz.MonitorRealtime();\r\n await Promise.all([bott.mine(), botzz.countdownReload()]);\r\n }\r\n Awake()\r\n }", "title": "" }, { "docid": "23d0741be929b9cc4d54c72422c0555b", "score": "0.4699878", "text": "stopActivity(){this._FBPTriggerWire(\"--activityStopped\")}", "title": "" }, { "docid": "6bcc77359209de4ee8df6b9b6a6cce5a", "score": "0.46992484", "text": "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n\n postRun();\n }", "title": "" }, { "docid": "6bcc77359209de4ee8df6b9b6a6cce5a", "score": "0.46992484", "text": "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n\n postRun();\n }", "title": "" }, { "docid": "acce4be195d6e0eadf52402e50e12b67", "score": "0.46936977", "text": "async initialize() {\n this.JobModel = await jobModel(this.app);\n if (this.botUuid === undefined) {\n throw new Error('\"botUuid\" is not defined');\n }\n\n let initialState;\n if (this.initialState === 'complete' || this.initialState === 'canceled') {\n initialState = this.initialState;\n } else if (this.initialState === undefined) {\n initialState = 'initializing';\n } else {\n // If a job was canceled while running, set it to canceled\n // TODO Update it permanently to have a state of canceled in the database\n initialState = 'canceled';\n }\n\n const fsmSettings = {\n initial: initialState,\n error: (eventName, from, to, args, errorCode, errorMessage) => {\n const fsmError = `Invalid job ${this\n .uuid} state change on event \"${eventName}\" from \"${from}\" to \"${to}\"\\nargs: \"${args}\"\\nerrorCode: \"${errorCode}\"\\nerrorMessage: \"${errorMessage}\"`;\n logger.error(fsmError);\n throw new Error(fsmError);\n },\n events: jobFsmDefinitions.fsmEvents,\n callbacks: {\n onenterstate: async (event, from, to) => {\n logger.info(\n `Job ${this.uuid} Bot ${this\n .botUuid} event ${event}: Transitioning from ${from} to ${to}.`,\n );\n if (from !== 'none') {\n try {\n // As soon as an event successfully transistions, update it in the database\n const dbJob = await this.JobModel.findById(this.id);\n await bluebird.delay(0); // For some reason this can't happen in the same tick\n await dbJob.updateAttributes({\n state: this.fsm.current,\n fileUuid: this.fileUuid,\n started: this.started,\n elapsed: this.stopwatch.ms,\n percentComplete: this.percentComplete,\n });\n logger.info(\n `Job event. ${event} for job ${this.uuid} successfully updated to ${this.fsm\n .current}`,\n );\n this.app.io.broadcast('jobEvent', {\n uuid: this.uuid,\n event: 'update',\n data: this.getJob(),\n });\n } catch (ex) {\n logger.info(`Job event ${event} for job ${this.uuid} failed to update: ${ex}`);\n }\n }\n },\n },\n };\n\n this.fsm = StateMachine.create(fsmSettings);\n this.stopwatch = new Stopwatch(false, { refreshRateMS: 10000 });\n this.started = undefined;\n this.elapsed = undefined;\n this.percentComplete = 0;\n\n // job updates once a second\n this.stopwatch.onTime(() => {\n logger.info('jobEvent', this.getJob());\n this.app.io.broadcast('jobEvent', {\n uuid: this.uuid,\n event: 'update',\n data: this.getJob(),\n });\n });\n if (this.fsm.current === 'initializing') {\n this.fsm.initializationDone();\n }\n }", "title": "" }, { "docid": "6294574780a60f4bbdd86196909bb886", "score": "0.46928516", "text": "function doActions() {\n changeStatus(data.statuses.computerTurn);\n if(!checkSuccessCombinationPresence()){\n if(!blockUserWin()) {\n addValue();\n }\n }\n }", "title": "" }, { "docid": "6d3f4df762f8bf80cbb77cec7546414f", "score": "0.46923745", "text": "processMessage(message) {\n // get sender user id and recipient id\n const senderId = message.sender.id;\n const recipientId = message.recipient.id;\n\n // get message text, attachments, and timestamp\n const {text, attachments} = message.message;\n const messageTime = message.timestamp;\n\n // get user session id for chat history lookup\n const sessionId = this.getSessionId(senderId);\n\n // save response url for send message calls later\n this._sessions[sessionId].responseUrl = message.responseUrl;\n\n if (attachments) {\n return this.chatClient.sendMessage(senderId, 'Sorry I can only process text messages for now.')\n .catch(console.error);\n } else if (text) {\n // forward message to wit.ai bot engine to run it through all bot ai actions\n console.log(`BotAI.processMessage(): \"${text}\" for:${senderId}`);\n return this._witAiClient.runActions(sessionId, text, // msg text\n this._sessions[sessionId].context) // chat history state\n .then( (context) => {\n // TODO: reset user session based on current session state\n // and last message request as needed\n /*if (context['done']) {\n delete sessions[sessionId];\n }*/\n console.log( JSON.stringify(context) );\n // update user session state\n this._sessions[sessionId].context = context;\n return context;\n })\n .catch( (err) => {\n console.error('BotAI.processMessage(): Wit.ai error: ', err.stack || err);\n });\n } else {\n //console.error('BotAI.processMessage(): missing message text!'); \n throw new Error('Missing message text.');\n }\n\n }", "title": "" }, { "docid": "719f092639a5664c89cfc3a0f7b657e2", "score": "0.46918476", "text": "function DSActivityHandler(commandStack, eventBus) {\n commandStack.registerHandler('activity.directionChange', activity_directionChange);\n commandStack.registerHandler('activity.changed', activity_changed); // update the activity from the activity-dialog, either with or without number\n // and change other activites too, to keep the numbers consistent\n\n function activity_changed(modeling) {\n this.preExecute = function (context) {\n context.oldLabel = context.businessObject.name || ' ';\n var oldNumbersWithIDs = (0, _numbering.getNumbersAndIDs)();\n modeling.updateLabel(context.businessObject, context.newLabel);\n modeling.updateNumber(context.businessObject, context.newNumber);\n context.oldNumber = context.businessObject.number;\n context.oldNumbersWithIDs = oldNumbersWithIDs;\n };\n\n this.execute = function (context) {\n var semantic = context.businessObject;\n var element = context.element;\n\n if (context.newLabel && context.newLabel.length < 1) {\n context.newLabel = ' ';\n }\n\n semantic.name = context.newLabel;\n semantic.number = context.newNumber;\n eventBus.fire('element.changed', {\n element: element\n });\n };\n\n this.revert = function (context) {\n var semantic = context.businessObject;\n var element = context.element;\n semantic.name = context.oldLabel;\n semantic.number = context.oldNumber;\n revertAutomaticNumbergenerationChange(context.oldNumbersWithIDs, eventBus);\n eventBus.fire('element.changed', {\n element: element\n });\n };\n } // change the direction of a single activity without affecting other activities\n\n\n function activity_directionChange(modeling) {\n this.preExecute = function (context) {\n context.oldNumber = context.businessObject.number;\n context.oldWaypoints = context.element.waypoints;\n context.name = context.businessObject.name;\n\n if (!context.oldNumber) {\n context.oldNumber = 0;\n }\n\n modeling.updateNumber(context.businessObject, context.newNumber);\n };\n\n this.execute = function (context) {\n var semantic = context.businessObject;\n var element = context.element;\n var swapSource = element.source;\n var newWaypoints = [];\n var waypoints = element.waypoints;\n\n for (var i = waypoints.length - 1; i >= 0; i--) {\n newWaypoints.push(waypoints[i]);\n }\n\n element.source = element.target;\n semantic.source = semantic.target;\n element.target = swapSource;\n semantic.target = swapSource.id;\n semantic.name = context.name;\n semantic.number = context.newNumber;\n element.waypoints = newWaypoints;\n eventBus.fire('element.changed', {\n element: element\n });\n };\n\n this.revert = function (context) {\n var semantic = context.businessObject;\n var element = context.element;\n var swapSource = element.source;\n element.source = element.target;\n semantic.source = semantic.target;\n element.target = swapSource;\n semantic.target = swapSource.id;\n semantic.name = context.name;\n semantic.number = context.oldNumber;\n element.waypoints = context.oldWaypoints;\n eventBus.fire('element.changed', {\n element: element\n });\n };\n }\n} // reverts the automatic changed done by the automatic number-gerneration at editing", "title": "" }, { "docid": "12148407feb242d54f540c348cb2f8d9", "score": "0.46894836", "text": "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "title": "" }, { "docid": "f4157d2b9d12f688a584a08f9a303145", "score": "0.4687746", "text": "async replay() {\n debug(`Replaying history`);\n let history = this._history.slice();\n for (var i = 0; i < history.length; i++) {\n this.setContext(history[i].context);\n this._isComplete = history[i].isComplete;\n this._numberRetries = history[i].numberRetries;\n await this.step();\n }\n }", "title": "" }, { "docid": "741d30766b49ba1b9b3a606446cbe9a2", "score": "0.4681446", "text": "async step () {\n this._pauseRequested = true\n await this._stepImpl()\n if (!this.running && this._runnerStateStack.length > 0) {\n // stepped out of a nested execution (e.g. callback)\n this._runnerState = this._runnerStateStack.pop()\n }\n }", "title": "" }, { "docid": "f5eea5d4baafe5bf9ec180a6b9c6353b", "score": "0.46811587", "text": "handleUpdate(update) {\n let text, user;\n this.robot.logger.debug(update);\n\n const message = update.message || update.edited_message || update.callback_query;\n this.robot.logger.info(`Receiving message_id: ${message.message_id}`);\n if (this.robot.brain.get(`handled${message.message_id}`) === true) {\n this.robot.logger.warning(`Message ${message.message_id} already handled.`);\n return;\n }\n this.robot.brain.set(`handled${message.message_id}`, true);\n\n // Text event\n if (message.text) {\n text = this.cleanMessageText(message.text, message.chat.id);\n\n this.robot.logger.debug(`Received message: ${message.from.username} said '${text}'`);\n\n user = this.createUser(message.from, message.chat);\n return this.receive(new TextMessage(user, text, message.message_id));\n // Callback query\n } else if (message.data) {\n text = this.cleanMessageText(message.data, message.message.chat.id);\n\n this.robot.logger.debug(`Received callback query: ${message.from.username} said '${text}'`);\n\n user = this.createUser(message.from, message.message.chat);\n\n this.api.invoke('answerCallbackQuery', {callback_query_id: message.id}, function(err, result) {\n if (err) {\n return self.emit('error', err);\n }\n });\n\n return this.receive(new TextMessage(user, text, message.message.message_id));\n\n // Join event\n } else if (message.new_chat_member) {\n user = this.createUser(message.new_chat_member, message.chat);\n this.robot.logger.info(`User ${user.id} joined chat ${message.chat.id}`);\n return this.receive(new EnterMessage(user, null, message.message_id));\n\n // Exit event\n } else if (message.left_chat_member) {\n user = this.createUser(message.left_chat_member, message.chat);\n this.robot.logger.info(`User ${user.id} left chat ${message.chat.id}`);\n return this.receive(new LeaveMessage(user, null, message.message_id));\n\n // Chat topic event\n } else if (message.new_chat_title) {\n user = this.createUser(message.from, message.chat);\n this.robot.logger.info(`User ${user.id} changed chat ${message.chat.id} title: ${message.new_chat_title}`);\n return this.receive(new TopicMessage(user, message.new_chat_title, message.message_id));\n\n } else {\n message.user = this.createUser(message.from, message.chat);\n return this.receive(new CatchAllMessage(message));\n }\n }", "title": "" }, { "docid": "e511650ff27a797bfb8ad67419e67039", "score": "0.46804684", "text": "function updateEndStatus() {\n console.log('stim done playing')\n something_playing = false;\n }", "title": "" }, { "docid": "8d58353f29ebf1f2b6642698e111d9d5", "score": "0.46768197", "text": "run (callback) {\n\t\t// we'll run the update, but also verify the update took by fetching and validating\n\t\t// the team object\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.run,\n\t\t\tthis.validateTeamObject\n\t\t], callback);\n\t}", "title": "" }, { "docid": "73f319e1d2073a69f2813efe669130fc", "score": "0.46720913", "text": "finished() {\n this.openSheetMusicDisplay.cursor.updateStyle(3 * 10.0 * this.openSheetMusicDisplay.zoom, this.COLORS.correct);\n console.log(`Well done! You reached a score of ${this.score} on ${this.ID}`);\n \n // update the state\n this.state = \"finished\";\n \n if (this.onFinished) { this.onFinished(this); }\n }", "title": "" }, { "docid": "8f435bc149170d26ac2bfb39d473cf6e", "score": "0.465505", "text": "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n if (shouldRunNow) callMain(args);\n\n postRun();\n }", "title": "" }, { "docid": "41a41cd7feca66b97aea6775a7665379", "score": "0.46526566", "text": "saveCurrentEntries()\n {\n if (this.saveConfirm)\n {\n this.pushtoHdb();\n this.saveConfirm=0;\n this.setState({buttonState:this.normalMenu});\n return;\n }\n\n chrome.storage.local.set({currentTabs:this.getOutput()});\n }", "title": "" }, { "docid": "8bb72e6711d04ac41505c560bb2fa59b", "score": "0.46451896", "text": "change_status() {\n // Do not update status while invisible unless the setting is disabled\n if (this.settings.misc_settings.ignore_invisible &&\n this.get_status() === \"invisible\") {\n this.log_func(\"Didn't update status as the user is invisible\");\n return;\n }\n // set the status if running, remove status if not running\n const change_to = this.running.length // an empty list is truthy BRUH\n ? this.settings.active_status\n : this.settings.inactive_status;\n // only make an API call if the status will change\n if (change_to !== this.last_status) {\n this.log_func(`Setting new status: ${change_to}`);\n this.set_status(change_to);\n this.last_status = change_to;\n }\n }", "title": "" }, { "docid": "a2efd6b5029e1b9bd48b75fb904bc6f3", "score": "0.46412304", "text": "function updateAppState(invocationContext, paramsObj) {\n var aS = appState;\n var pO = paramsObj;\n switch (invocationContext) {\n\n case \"createCard\":\n aS.taskCount++;\n aS.taskWeight = 1/aS.taskCount;\n aS.globalProgress = aS.netLocalProgressSum*aS.taskWeight;\n localStorage.setItem(\"appState\",JSON.stringify(appState));\n break;\n\n case \"deleteMainTaskNoChildren\":\n aS.taskCount--;\n aS.taskWeight = aS.taskCount>0 ? 1/aS.taskCount : 0;\n aS.globalProgress = aS.netLocalProgressSum*aS.taskWeight;\n localStorage.setItem(\"appState\", JSON.stringify(appState)); \n break;\n } \n return appState; \n}", "title": "" }, { "docid": "9bbc72e13218c7c238f006a8afc44d2d", "score": "0.46370342", "text": "async handleContinue() {\n // find the player's username\n let currPlayer = await (await fetch(\"/players\")).json(); //gets current user name from database\n let currPlayerUN = currPlayer.username;\n\n // save the states of the game settings\n let timer = document.getElementById(\"time-dropdown\").value;\n if (timer == \"\") {\n alert(\"You forgot to set a time!\");\n return;\n }\n let topic = document.getElementById(\"topic\").value;\n if(topic==\"\") {\n alert(\"You forgot to set a topic!\");\n return;\n }\n let pro_con = document.getElementById(\"pro-con-dropdown\").value;\n if (pro_con == \"\") {\n alert(\"You forgot to set your stance on the topic (pro/con)!\");\n return;\n }\n this.setState({specificButtons:true, username:currPlayerUN, timer:timer, topic:topic, pro_con: pro_con});\n }", "title": "" }, { "docid": "596d0921e94a24eb40aa711dd93b14a6", "score": "0.46367005", "text": "function gameHandler() {\n levelDisplay.innerHTML = \"Level : \" + lvlCount;\n if (sequenceCount === lvlCount) {\n clearInterval(lightInterval);\n aI = false;\n delayClickEnabled();\n }\n if(aI) {\n //timeout to put delay at the start of the ai turn instead of the player's turn\n setTimeout(runSequence, 750);\n } \n }", "title": "" }, { "docid": "c048b42e6495ab796050884fc7910958", "score": "0.4634187", "text": "forceFinishActivity() {\n // to be overrided by subclasses\n }", "title": "" }, { "docid": "0b74c43b5a334180708adfc1b7ae3953", "score": "0.46324158", "text": "onUpdateMaintainModules(values) {\n apputils.CONSOLE_LOG(\"OK from CHILD calleddddddddddddddddddddddddddd\")\n apputils.CONSOLE_LOG(values)\n this.setState({\n serviceModule: values\n })\n }", "title": "" }, { "docid": "0b51306cebe25946839f4d43e4913b2a", "score": "0.46284008", "text": "function onMessageHandler(target, context, msg, self) {\n if (game.turn() !== CHAT_SIDE) {\n return;\n }\n\n const move = game.move(msg, { sloppy: true });\n \n if (move) {\n if (move.san in moveHistory) {\n moveHistory[move.san] += 1;\n } else {\n moveHistory[move.san] = 1;\n }\n\n game.undo();\n\n updateSidebar();\n }\n}", "title": "" }, { "docid": "08376ee70041a252158d345199628a64", "score": "0.46246478", "text": "function updatePayload(){\n if(req.query.ended && currPlayers[game]){\n return cleanupGame(game,req.query.user);\n }\n checkD12(robot.messageRoom.bind(robot, gameRoom), game, true);\n return;\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "bf5ffab61f3be04a30b5d03008ad07c1", "score": "0.46176568", "text": "function doRun() {\n if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\n Module['calledRun'] = true;\n\n ensureInitRuntime();\n\n preMain();\n\n if (Module['_main'] && shouldRunNow) {\n Module['callMain'](args);\n }\n\n postRun();\n }", "title": "" }, { "docid": "b2159a7bb67b5683370e1e7f294b130f", "score": "0.46152017", "text": "function runGame() {\n switch (gameRunner.state) {\n case GameState.LOADING:\n newGameState();\n break;\n case GameState.RUNNING:\n break;\n }\n}", "title": "" }, { "docid": "f651906bdb69028418a1f911217033a1", "score": "0.4614328", "text": "handleAppStateChange(nextAppState)\n {\n if(this.state.appState.match(/active/) && nextAppState.match(/inactive|background/))\n this.savePage();\n this.setState({appState: nextAppState});\n }", "title": "" }, { "docid": "3a3504ec84cf6747907d056660955fa0", "score": "0.46113306", "text": "async refinish() {\n // implement by subclass\n }", "title": "" }, { "docid": "de2af1149540166e2bcc2141a7d0cb1b", "score": "0.4606575", "text": "postPlayed() {\n }", "title": "" }, { "docid": "65d9838bb1e9594054962dd63bcb0b4c", "score": "0.46043327", "text": "_onApplyTick() {\n if (this.pendingState) {\n StateTree.commitStateChange(this);\n }\n\n // We must do this last, to prevent multiple change requests from causing multiple nextTick() invocations.\n // commitStateChange only returns when all changes have been applied, or the application encountered too many\n // state changes. So we conclude using nextTick() any more, is always a bad idea.\n this._tickRequested = false;\n }", "title": "" }, { "docid": "f4d8fb8679eda4efb7b694bb15fe3e13", "score": "0.45979255", "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": "fa58070378589d9da7f427af182ac3fd", "score": "0.45890138", "text": "loadFinished() {\n this.fireEvent(\"onLoadFinished\", null, this);\n this.saveToLocalStorage();\n }", "title": "" }, { "docid": "f8db19d627578d00c364c1e2a2f8d0f4", "score": "0.45875496", "text": "function run()\r\n{\r\n\tp_sa_uc_helper.traceMsg(\"run()\");\r\n\t\r\n\tif(validate_performed == false)\r\n\t{\r\n\t\tif(validate() == false)\r\n\t\t{\r\n\t\t\tdvt_activity_resources = \"\";\r\n\t\t\tdvt_activity.removeFromSession();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tif(scripting){\r\n\t\tp_sa_uc_helper.traceMsg(\"Scripting\");\r\n\t\tuiaConfig = uiaActivity.autoConfigFromDebugger();\r\n\t\tp_sa_uc_helper.setUIACfg( uiaConfig );\r\n\t}\r\n\telse{\r\n\t\tp_sa_uc_helper.traceMsg(\"NOT scripting\");\r\n\t}\r\n\r\n\r\n\tinstr_warning = p_sa_uc_helper.getInstrumentationStatus();\r\n\tif(instr_warning != \"Good\"){\r\n\t\tvar warning = new ConfigMessage(\"Instrumentation status: \" + instr_warning + \". Continue running ?\");\r\n\t\twarning.setIcon(ConfigMessage.WARNING);\r\n\t\tvar buttons = [\"OK\",\"Cancel\"];\r\n\t\twarning.setTitle(\"Warning\");\r\n\t\twarning.setButtons(buttons);\r\n\t\twarning.execute();\r\n\t\r\n\t\tif (warning.getResult().equals(\"Cancel\")){\r\n\t\t\tdvt_activity_resources = \"\";\r\n\t\t\tdvt_activity.removeFromSession();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t\r\n\t\r\n\tuc_state = \"Running\";\r\n\r\n\t// Run\r\n\tstartUIAViewer();\r\n\r\n}", "title": "" }, { "docid": "4291deb1ecce3271fd5039e1f19e111d", "score": "0.45835033", "text": "function setLEDState(intent, session, callback, thingId)\n{\n\n const cardTitle = \"Change LED value\";//intent.name;\n const desiredLEDStateSlot = intent.slots.lightState;\n let shadowLED_R = 0;\n let shadowLED_G = 0;\n let shadowLED_B = 0;\n let repromptText = '';\n let sessionAttributes = {}; \n \n const shouldEndSession = false;\n let speechOutput = '';\n\n\n if (desiredLEDStateSlot)\n {\n\n const desiredLEDState = desiredLEDStateSlot.value;\n sessionAttributes = createFavoriteLEDStatusAttributes(desiredLEDState);\n \n repromptText = \"\"; //You can ask me if the light is on or off by saying, is the light on or off?\";\n \n\n \n \n if ((desiredLEDState == 'red'))\n {\n shadowLED_R = 1;\n shadowLED_G = 0;\n shadowLED_B = 0;\n speechOutput = \"The Sensor board light is red. \" + '<break time=\"2s\"/>' + \"Please provide other command\" ;\n \n }else\n if ((desiredLEDState == 'green'))\n {\n shadowLED_R = 0;\n shadowLED_G = 1;\n shadowLED_B = 0;\n speechOutput = \"The Sensor board light is green. \" + '<break time=\"2s\"/>' + \"Please provide other command\" ;\n \n }else\n if ((desiredLEDState == 'blue'))\n {\n shadowLED_R = 0;\n shadowLED_G = 0;\n shadowLED_B = 1;\n speechOutput = \"The Sensor board light is blue. \" + '<break time=\"2s\"/>' + \"Please provide other command\";\n \n }else\n if ((desiredLEDState == 'yellow'))\n {\n shadowLED_R = 1;\n shadowLED_G = 1;\n shadowLED_B = 0;\n speechOutput = \"The Sensor board light is yellow. \" + '<break time=\"2s\"/>' + \"Please provide other command\";\n \n }else\n if ((desiredLEDState == 'white')||(desiredLEDState == 'on')||(desiredLEDState == 'open'))\n {\n shadowLED_R = 1;\n shadowLED_G = 1;\n shadowLED_B = 1;\n speechOutput = \"The Sensor board light is \" + desiredLEDState + '<break time=\"2s\"/>' + \" Please provide other command\";\n \n }else\n if ((desiredLEDState == 'off')||(desiredLEDState == 'close'))\n {\n shadowLED_R = 0;\n shadowLED_G = 0;\n shadowLED_B = 0;\n speechOutput = \"The Sensor board light has been turned off\" + '<break time=\"2s\"/>' + \"Please provide other command\";\n \n }else\n {\n speechOutput = \"I'm not sure what you want. Please try again.\";\n repromptText = \"I'm not sure what you want. You can tell me if you \" +\n 'want the light blue, red, green, white or off';\n callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession, \"Simple\"));\n return;\n }\n \n /*\n * Update AWS IoT\n */\n \n console.log(\"Alexa will say =>\",speechOutput);\n var payloadObj = {\"state\" :\n { \"desired\" :\n { \"LED_R\" : shadowLED_R,\n \"LED_G\" : shadowLED_G,\n \"LED_B\" : shadowLED_B\n \n }}};\n\n //Prepare the parameters of the update call\n var paramsUpdate = {\n\n \"thingName\" : thingId,\n \"payload\" : JSON.stringify(payloadObj)\n\n };\n\n // Update IoT Device Shadow\n console.log(\"AWS-IOT => \",paramsUpdate);\n \n iotData.updateThingShadow(paramsUpdate, function(err, data)\n {\n\n if (err)\n {\n console.log(err); // Handle any errors\n } else\n {\n console.log(\"UpdateThingShadow=>\",data);\n console.log(\"Calling callback from updateThingShadow returns\");\n \n callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession, \"Simple\"));\n //context.succeed(buildResponse(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession)));\n \n console.log(\"buildSpeechletResponse returns =>\",buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession, \"Simple\"));\n console.log(\"returning from callback from updateThingShadow returns\");\n \n }\n\n });\n \n \n } else\n {\n\n speechOutput = \"I'm not sure if you want the light on or off. Please try again.\";\n repromptText = \"I'm not sure if you want the light on or off. You can tell me if you \" +\n 'want the light on or off by saying, turn the light on';\n\n }\n\n //callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));\n\n}", "title": "" }, { "docid": "91a48d10af492f8d8c531f24675f73b9", "score": "0.45827785", "text": "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(state.value);\n }", "title": "" }, { "docid": "11a968bafee6991161a887db6b78465a", "score": "0.45735285", "text": "appliesToState() {}", "title": "" }, { "docid": "e14e435fff0104c23fe1f72f9e8f0fd2", "score": "0.45724282", "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": "441bce8440b716b8a69b2db88bea886e", "score": "0.45701647", "text": "function main() {\n //\n loadAppConfig();\n // Restore state from localStorage\n restoreState();\n}", "title": "" } ]
6154d7b5bca850759b4473110930bb6d
called by inputs when text is entered, updates which buttons are disabled
[ { "docid": "bde858d57074c96814050303b508d66a", "score": "0.0", "text": "fieldsChanged() {\n const authorID = $(\"#author_id\").val();\n const authorFirstName = $(\"#author_first_name\").val();\n const authorSurname = $(\"#author_surname\").val();\n const authorDateBirth = $(\"#author_date_birth\").val();\n const authorDateDeath = $(\"#author_date_death\").val();\n $(\"#btn_add_author\").prop(\"disabled\", (authorID !== \"0\" || authorFirstName === \"\" || authorSurname === \"\"));\n $(\"#btn_update_author\").prop(\"disabled\", (authorID === \"0\"));\n $(\"#btn_show_books\").prop(\"disabled\", (authorID === \"0\"));\n }", "title": "" } ]
[ { "docid": "fc7871c55c30d493d0d10f82c162b1e1", "score": "0.6892373", "text": "updateButtonState() {\n let title = this.titleInput.property( 'value' ),\n description = this.descriptionInput.property( 'value' ),\n valid = true;\n\n this.container.selectAll( '.text-input' )\n .each( function() {\n let classes = d3.select( this ).attr( 'class' ).split( ' ' );\n\n if ( classes.indexOf( 'invalid' ) > -1 ) {\n valid = false;\n }\n } );\n\n if ( !title.length || !description.length ) {\n valid = false;\n }\n\n this.submitButton.node().disabled = !valid;\n }", "title": "" }, { "docid": "06cb73e7055855bcdde92542c5ed7f61", "score": "0.68313134", "text": "textChange() {\n\t\tthis.setState({ disabled: !this.refs.input.getText().trim() });\n\t}", "title": "" }, { "docid": "28770378a2c1ab01260e96ee21b8a8a3", "score": "0.6815368", "text": "function MMM_input_Keyup() {\n //console.log( \"===== MMM_input_Keyup ========= \");\n// - enable /disable save btn\n MMM_enable_btn_send();\n }", "title": "" }, { "docid": "0b44e79304f7ddddc49730c89e1ff3a8", "score": "0.6810271", "text": "edit(input){\n input.disabled = !input.disabled;\n }", "title": "" }, { "docid": "0b44e79304f7ddddc49730c89e1ff3a8", "score": "0.6810271", "text": "edit(input){\n input.disabled = !input.disabled;\n }", "title": "" }, { "docid": "9e911511c8abd13c2741667fb0bb8076", "score": "0.67756194", "text": "onInputChange() {\n this.ui.next.attr('disabled', !this.ui.username.val().length);\n }", "title": "" }, { "docid": "13833dd77d8ab51f165bdced7490331a", "score": "0.663485", "text": "function onEmpty() {\n if (codeEditor.value == \"\") {\n btnPlay.setAttribute('disabled', 'disabled')\n } else {\n btnPlay.removeAttribute('disabled', 'disabled')\n }\n}", "title": "" }, { "docid": "521eeb058b126868fc7dfc249ae03612", "score": "0.663381", "text": "function disabledInputAndButton(event) {\n inputLink.setAttribute('disabled', 'disable');\n event.target.disabled = true;\n}", "title": "" }, { "docid": "43007012dab409dd9432fd29cffda680", "score": "0.6609924", "text": "editTextChange() {\n\t\tthis.setState({ edtdisabled: !this.refs.edtinput.getText().trim() });\n\t}", "title": "" }, { "docid": "ec0dab92a99b44257809673cb9b59ec8", "score": "0.66092384", "text": "function activingInputAndButton(event) {\n inputLink.removeAttribute('disabled');\n event.target.disabled = false;\n}", "title": "" }, { "docid": "6a447de2a90abc9430940462f83b3aea", "score": "0.6599654", "text": "function updateInputButtonStatus(event) {\n\tif ($('#inputWindow').val()) {\n\t\t//code 13 = enter key\n\t\tif (event.keyCode === 13) {\n\t\t\tsendMessage();\n\t\t} else {\n\t\t\t//attr is set to true if send button is disabled\n\t\t\t//checks if send is disabled before enabling it\n\t\t\tvar attr = $('#inputButton').attr('disabled');\n\t\t\tif (typeof attr !== 'undefined' && attr !== false) {\n\t\t\t\t$('#inputButton').attr('disabled', false);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$('#inputButton').attr('disabled', true);\n\t}\n}", "title": "" }, { "docid": "01d33e31a9bbf2c74e3c3f270ff91857", "score": "0.6569695", "text": "function renderInput() {\n let btn = document.getElementById('add-task');\n let text = document.getElementById('task-input');\n state['inputtedText'] = text.value;\n if (state['inputtedText'] == '') {\n btn.disabled = true;\n }\n else {\n btn.disabled = false;\n }\n}", "title": "" }, { "docid": "a0d5d8b1ee2265cd6904b948fb989683", "score": "0.6514589", "text": "function checkBtn() {\r\n\tif (addTxt.value == '') {\r\n\t\taddBtn.disabled = true;\r\n\t\t// console.log('disabled', addBtn.disabled);\r\n\t} else {\r\n\t\taddBtn.disabled = false;\r\n\t\t// console.log('enabled', addBtn.disabled);\r\n\t}\r\n}", "title": "" }, { "docid": "4e2c265716747e718facb0468301b3ad", "score": "0.6383842", "text": "function blockInput() {\n if (displayGuessed.value.length >= 4) {\n displayGuessed.setAttribute('disabled', true)\n } else {\n displayGuessed.removeAttribute('disabled')\n }\n\n if (displayGenerated.value.length >= 4) {\n displayGenerated.setAttribute('disabled', true)\n } else {\n displayGenerated.removeAttribute('disabled')\n }\n}", "title": "" }, { "docid": "c6b2916b50eabdc3b941cec8a1a30f36", "score": "0.6381968", "text": "function validateInput() {\n\tvar valid = descriptionText.value.length > 0;\n\tsaveButton.disabled = !valid;\n}", "title": "" }, { "docid": "c2229d6f3114de58b4e5f86eec2cd7d9", "score": "0.6325053", "text": "function buttonState(){\n if(this.value.length == 10)\n {\n $(\"mobNoSubmit\").disabled = false;\n }\n else\n {\n $(\"mobNoSubmit\").disabled = true;\n }\n \n}", "title": "" }, { "docid": "9f366558ec615f7e176779fa61def287", "score": "0.6305644", "text": "handleUserTextFieldChange(event) {\n let fieldVal = event.target.value;\n let enableButton = fieldVal && fieldVal.length > 0 ? true : false ;\n this.setState({ userNameTextField: fieldVal\n }); \n }", "title": "" }, { "docid": "8dface6ff7e64ecd98633c963aa703a8", "score": "0.6304373", "text": "function player_Win() {\n\tvar txtCommand = document.getElementById(\"txtCommand\");\n\tvar btn_Enter = document.getElementById(\"btn_Enter\");\n\tbtn_disable(\"all\");\n\tupdate_display_msg(9);\n\ttxtCommand.disabled = true;\n\tbtn_Enter.disabled = true;\n}", "title": "" }, { "docid": "8c5a9d2aa135380e84869f6fefb5afd2", "score": "0.629786", "text": "function disabledButton(){\n\n if(input2.value==='0'){\n minus2.setAttribute('disabled','')\n }else{\n minus2.removeAttribute('disabled')\n }\n\n if(input1.value==='0'){\n minus1.setAttribute('disabled','')\n }else{\n minus1.removeAttribute('disabled')\n }\n}", "title": "" }, { "docid": "bf14e9062fd7606fbec700249f969232", "score": "0.62638736", "text": "disableInputs() {\n if(!this.isRunning && !this.disabledInputs) {\n for(let input of this.inputs) input.removeAttribute(\"disabled\"); \n }else{\n for(let input of this.inputs) input.setAttribute(\"disabled\", true);\n }\n }", "title": "" }, { "docid": "bbce14923775f6111a06b4d152b299d2", "score": "0.6253306", "text": "function habilitarInput() {\r\n document.querySelector('#txtNombre').disabled=false;\r\n document.querySelector('#txtDireccion').disabled=false;\r\n document.querySelector('#txtLat').disabled=false;\r\n document.querySelector('#txtLon').disabled=false;\r\n document.querySelector('#txtNombreContacto').disabled=false;\r\n document.querySelector('#nTelefonoContacto').disabled=false;\r\n document.querySelector('#nNiveles').disabled=false;\r\n document.querySelector('#nSecciones').disabled=false;\r\n document.querySelector('#txtCorreo').disabled=false;\r\n document.querySelector('#fImg').disabled=false;\r\n}", "title": "" }, { "docid": "1e9ca488680b0fb6dc21e05ec6d7363e", "score": "0.6246877", "text": "function updateButtonStatus() {\n if ((passwordStrength(pw.value) >= 4 && passwordStrength(pwConfirm.value) >= 4) && passwordsMatch()) { // PASSWORDS MEET STRENGTH CRITERIA AND THEY MATCH?\n document.querySelector(\".register\").removeAttribute(\"disabled\"); // ENABLE THE REGISTER BUTTON\n } else {\n document.querySelector(\".register\").setAttribute(\"disabled\", true); // ENSURE THE DISABLED ATTRIBUTE IS ADDED BACK ON\n }\n}", "title": "" }, { "docid": "d79fdbab079c52edeb0d8eff9c68d594", "score": "0.6235322", "text": "function activateButton() {\n\t\tvar currentLength = DOMNodes.inputField.value.length;\n\n\t\t// if word length in input more then minimal - make button active\n\t\tif (currentLength >= gameState.MIN_WORLD_WIDTH) {\n\t\t\tif( !/^[a-zA-Zа-яА-я]+$/.test(DOMNodes.inputField.value) ) {\n\t\t\t\talert('Допустимы только буквы');\n\t\t\t\tDOMNodes.startButton.setAttribute('disabled', 'true');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tDOMNodes.startButton.removeAttribute('disabled');\n\t\t\t}\n\t\t}\n\t\t// id word length in input less that minimal - make button disable\n\t\tif (currentLength < gameState.MIN_WORLD_WIDTH) {\n\t\t\tDOMNodes.startButton.setAttribute('disabled', 'true');\n\t\t}\n\n\t}", "title": "" }, { "docid": "f86e6b77f76f46e832183a45666f0a78", "score": "0.6223396", "text": "function textareaHandler(text){\r\n if (text.value.length > thiss.MAX_TEXT_LENGTH){\r\n text.value = text.value.substring(0, thiss.MAX_TEXT_LENGTH);\r\n }\r\n\r\n thiss.button[0].disabled = text.value == \"\";\r\n }", "title": "" }, { "docid": "3da0a31031cb1e79805eba75bc42b5b1", "score": "0.6220122", "text": "function disableInputs() { // disables the inputs related to data change when the search service is running\n if (runState.isRunning) {\n $('input, button:not(.close), select').prop('disabled', 'true');\n $('.start-stop button').prop('disabled', '');\n } else {\n $('input, button, select').prop('disabled', '');\n }\n}", "title": "" }, { "docid": "4df4b712fa592863bd5e77dc3eb7cc12", "score": "0.6218329", "text": "function bankEnableTexts() {\n$(\"#bankCode\").attr(\"disabled\", false);\n$(\"#smopNo\").attr(\"readonly\", false);\n$(\"#reimbankCode\").attr(\"disabled\", false);\n$(\"#rmopNo\").attr(\"readonly\", false);\n\n $(\"#submitBankButton\").show();\n $(\"#editBankButton\").hide();\n\n}", "title": "" }, { "docid": "105068bf42d943992ea736a6db42ed03", "score": "0.6169417", "text": "function seprationEnableTexts() {\n\n $(\"#statusCode\").attr(\"disabled\", false);\n \n $(\"#dol\").attr(\"disabled\", false);\n $(\"#dos\").attr(\"disabled\", false);\n $(\"#dor\").attr(\"disabled\", false);\n \n \n \n\n $(\"#leavReas\").attr(\"readonly\", false);\n \n\n\n $(\"#submitSepration\").show();\n $(\"#editSepration\").hide();\n\n\n}", "title": "" }, { "docid": "682fcfd31e380b3bcc69c132e83eb735", "score": "0.6153616", "text": "function enableButtons() {\n let metMin = playerNameInput.val().length < 3\n setupGameButton.prop('disabled', metMin)\n }", "title": "" }, { "docid": "7f788a76ee2f71b70eab0aa1c3fa737a", "score": "0.6141201", "text": "function officialEnableTexts() {\n\n $(\"#statusCode\").attr(\"disabled\", false);\n $(\"#doj\").attr(\"disabled\", false);\n $(\"#dojWef\").attr(\"disabled\", false);\n $(\"#dol\").attr(\"disabled\", false);\n $(\"#dos\").attr(\"disabled\", false);\n $(\"#dor\").attr(\"disabled\", false);\n $(\"#function_supervisor\").attr(\"disabled\", false);\n $(\"#global_manager\").attr(\"disabled\", false);\n //$(\"#compCode\").attr(\"disabled\", false);\n $(\"#bussCode\").attr(\"disabled\", false);\n\n $(\"#locCode\").attr(\"disabled\", false);\n $(\"#wLocCode\").attr(\"disabled\", false);\n $(\"#grdCode\").attr(\"disabled\", false);\n $(\"#empTypeCode\").attr(\"disabled\", false);\n $(\"#functCode\").attr(\"disabled\", false);\n $(\"#subFunctCode\").attr(\"disabled\", false);\n $(\"#costCode\").attr(\"disabled\", false);\n $(\"#procCode\").attr(\"disabled\", false);\n $(\"#dsCODE\").attr(\"disabled\", false);\n $(\"#oEmail\").attr(\"readonly\", false);\n $(\"#effectiveDate\").attr(\"disabled\", false);\n $(\"#accesscode\").attr(\"readonly\", false);\n $(\"#lavel\").attr(\"disabled\", false);\n $(\"#divisionMast\").attr(\"disabled\", false);\n $(\"#regionMast\").attr(\"disabled\", false);\n $(\"#subBussUnit\").attr(\"disabled\", false);\n\n $(\"#leavReas\").attr(\"readonly\", false);\n $(\"#workphn\").attr(\"readonly\", false);\n $(\"#workphnExt\").attr(\"readonly\", false);\n\n\n $(\"#submitOfficialButton\").show();\n $(\"#editOfficialButton\").hide();\n\n\n}", "title": "" }, { "docid": "d496f5da018bebb2ff45a225f4cd8d8e", "score": "0.61374235", "text": "function stoppedTyping(){\n if(this.value.length > 0) { \n \n document.querySelector('.todo-button').disabled = false; \n } else { \n\n document.querySelector('.todo-button').disabled = true;\n }\n}", "title": "" }, { "docid": "e7d4a5f1d20805d90a4b126a06d381e1", "score": "0.61360246", "text": "onDisabled() {\n this.updateInvalid();\n }", "title": "" }, { "docid": "58f33eb5b28949c0090d38d6cbf0af22", "score": "0.6116", "text": "updateButtonState() {\n let folderName = this.folderNameInput.node().value,\n self = this;\n\n this.container.selectAll( '.text-input' )\n .each( function() {\n let classes = d3.select( this ).attr( 'class' ).split( ' ' );\n\n if ( classes.indexOf( 'invalid' ) > -1 || !folderName.length ) {\n self.formValid = false;\n }\n } );\n\n this.submitButton.node().disabled = !this.formValid;\n }", "title": "" }, { "docid": "b33dbaed5ad0318c439ea0148cd374bf", "score": "0.61154854", "text": "function staturyEnableTexts() { \n // $(\"#uanNo\").attr(\"readonly\", false);\n // $(\"#PfNo\").attr(\"readonly\", false);\n // $(\"#esiNo\").attr(\"readonly\", false);\n $(\"#passportNo\").attr(\"readonly\", false);\n $(\"#passportPlace\").attr(\"readonly\", false);\n $(\"#passportIssue\").attr(\"disabled\", false);\n $(\"#passportValidityDate\").attr(\"disabled\", false);\n $(\"#passportAddress\").attr(\"readonly\", false);\n $(\"#dlNo\").attr(\"readonly\", false);\n $(\"#dlPlace\").attr(\"readonly\", false);\n $(\"#dlDate\").attr(\"disabled\", false);\n $(\"#dlValidityDate\").attr(\"disabled\", false);\n $(\"#dlAddress\").attr(\"readonly\", false);\n // $(\"#panNo\").attr(\"readonly\", false);\n\n $(\"#adharNo\").attr(\"readonly\", false);\n $(\"#registration\").attr(\"readonly\", false);\n $(\"#trade\").attr(\"readonly\", false);\n $(\"#contract\").attr(\"readonly\", false);\n\n\n\n $(\"#submitStaturyButton\").show();\n $(\"#editStaturyButton\").hide();\n\n}", "title": "" }, { "docid": "fa8bbf0ee38543dbd2bdc98d7885d8ab", "score": "0.61076987", "text": "function habilitarInput() {\r\n \r\n document.querySelector('#inputpNombre').disabled=true;\r\n document.querySelector('#inputpTelefono').disabled=true;\r\n document.querySelector('#inputpCorreo').disabled=true;\r\n document.querySelector('#inputpEncargodo').disabled=true;\r\n\r\n document.querySelector('#Bolsos').disabled=false;\r\n document.querySelector('#Libros').disabled=false;\r\n document.querySelector('#Uniformesdefisica').disabled=false;\r\ndocument.querySelector('#Arte').disabled=false;\r\ndocument.querySelector('#cuadernos').disabled=false;\r\n document.querySelector('#UniformesFormales').disabled=false;\r\ndocument.querySelector('#Herramientas').disabled=false;\r\n\r\n \r\n}", "title": "" }, { "docid": "42ab5289fcdbf84667dd7e52688b56d8", "score": "0.6102398", "text": "function enableSubmit() {\n\n // Verify number of words and characters is good\n const text = document.getElementsByName(\"input_text\")[0].value;\n const numWords = countWords(text);\n const numChars = text.length;\n const wordOk = numWords > 0 && numWords <= WORD_MAX;\n const charOk = numChars > 0 && numChars <= CHAR_MAX;\n\n // Ensure user actually entered a sentence max\n const max = document.getElementsByName(\"max\")[0].value;\n const maxBlank = max === '';\n\n // Check counts and max text area!\n let countButton = document.getElementById('count');\n\n if (wordOk && !maxBlank && charOk) {\n countButton.disabled = false; // enable!\n } else {\n countButton.disabled = true; // disable!\n }\n }", "title": "" }, { "docid": "93a4f37a0bb4a5174e6c8ad738b92c02", "score": "0.6095521", "text": "function enableControls(){\n\tclearBtn.disabled = false;\n\tbinCountInput.disabled = false;\n}", "title": "" }, { "docid": "339ae2b2ac113e6829adb4c7e85ad4e8", "score": "0.6087273", "text": "function updatebtnExecute() {\n if ($(\"#sltTreatment\").val() == \"\" || $(\"#sltTreatment\").val() == null) {\n $('#btnExecute').attr(\"disabled\", \"disabled\")\n } else {\n $('#btnExecute').removeAttr(\"disabled\");\n }\n}", "title": "" }, { "docid": "1a4b77fc7ac81c16a56bb0a038206689", "score": "0.60826105", "text": "function disableInputs(){\n saveRO.className = \"btn btn-default pull-right invisible\";\n editRO.className = \"btn btn-default pull-right visible\";\n odometerOut.disabled = true;\n openclose.disabled = true;\n openclose.style.backgroundColor = \"#eee\";\n }", "title": "" }, { "docid": "70531c35ff39ba7e4955dbed9bdb3b5d", "score": "0.60770065", "text": "function ableBtns() {\n submitButton.disabled = false;\n clearButton.disabled = false;\n if(userQuestion.value.length == 0){\n submitButton.disabled = true;\n clearButton.disabled = true;\n }\n}", "title": "" }, { "docid": "beb0ed43c213865e07b4b2fdd8e0bdd0", "score": "0.6076694", "text": "function updateVerifyCodeButtonUI() {\r\n\t document.getElementById('verify-code-button').disabled =\r\n\t !!window.verifyingCode\r\n\t || !getCodeFromUserInput();\r\n\t }", "title": "" }, { "docid": "141f6873bd26fe03bc99f172b2f52659", "score": "0.6068678", "text": "function watchingInputs() {\n $('.addUserField').on('keypress paste change', function (e) {\n $('.submitUserBtn#submitAddUserForm').prop('disabled', false);\n\n });\n\n $('.addUserField').on('keyup', function (e) {\n if (e.keyCode == 8 || e.keyCode == 46) {\n $('.submitUserBtn#submitAddUserForm').prop('disabled', false);\n } else {\n e.preventDefault();\n }\n });\n\n $('#emailEnabledField .eecx').on('change', function (e) {\n $('.submitUserBtn#submitAddUserForm').prop('disabled', false);\n });\n }", "title": "" }, { "docid": "1f44e7f7d89dbfbabded4a59a697777d", "score": "0.60656375", "text": "function manageInput(target, element, clearWhenDisabled){\n\t\t\n\t\t// Binds changes\n\t\t$(target).bind(\"keydown keyup keypress change\", function(){\n\n\t\t\t// Checks if textfield has some data\n\t\t\t$(element).prop(\"disabled\", ($(target).val().length == 0) );\n\t\t\tif (clearWhenDisabled) $(element).val(\"\");\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "00e51f001c5d946a83bed3d0f805cc75", "score": "0.6059499", "text": "function Linkcontrolbuttons(ctx){\n $(\"#projectname-input\").change(function(){\n if($(\"#projectname-input\").val().length>0){\n SavePhrase(ctx,$(\"#projectname-input\").val());\n SaveButtonDeactivate(); }\n });\n $(\"#projectname-input\").on(\"input\", function(){\n if($(\"#projectname-input\").val().length>0){\n if(ctx.PhraseName!=$(\"#projectname-input\").val()){\n SaveButtonActivate();\n if(ctx.phrase.length>0){SendButtonActivate();}}\n else{\n SaveButtonDeactivate();}\n }else{\n SaveButtonDeactivate();\n SendButtonDeactivate();\n }\n });\n $(\"#save-button\").click(function(){\n if(SaveButtonActive){\n SavePhrase(ctx,$(\"#projectname-input\").val());\n SaveButtonDeactivate(); }\n });\n $(\"#erase-button\").click(function(){\n if(EraseButtonActive){\n ErasePhrase(ctx);\n EraseButtonDeactivate();\n SendButtonDeactivate(); }\n });\n $(\"#send-button\").click(function(){\n if(SendButtonActive){\n SavePhrase(ctx, $(\"#projectname-input\").val());\n SaveButtonDeactivate();\n SendPhrase(ctx);\n SendButtonDeactivate(); }\n });\n}", "title": "" }, { "docid": "f525c5db21b5748b6210dc7e9c755c13", "score": "0.605602", "text": "function enableInputBox(classOfParent) {\r\n let parentOfInput = document.querySelector(`.${classOfParent}`);\r\n let updateBtn = document.querySelector(`.${classOfParent} > button`);\r\n Array.from(parentOfInput.children).forEach((elem) => {\r\n if (elem.tagName == \"INPUT\" || elem.tagName == \"TEXTAREA\") {\r\n if (elem.disabled == true) {\r\n elem.disabled = false;\r\n updateBtn.classList.add(\"active\");\r\n } else {\r\n elem.disabled = true;\r\n updateBtn.classList.remove(\"active\");\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "51d9931825d04c5d390f3937aff23839", "score": "0.6055106", "text": "function userWin() {\r\n // Shouldn't allow any new inputs\r\n guessField.disabled = true;\r\n submitBtn.disabled = true;\r\n\r\n}", "title": "" }, { "docid": "a3c5d6b58d0639befa89657eddc43714", "score": "0.6048246", "text": "function btnDisabled() {\n if ($scope.currentFieldIsPresent == true) {\n if ($scope.passField1 && $scope.passField2 && $scope.passField3) {\n $scope.btnState = false;\n } else {\n $scope.btnState = true;\n }\n } else {\n if ($scope.passField2 && $scope.passField3) {\n $scope.btnState = false;\n } else {\n $scope.btnState = true;\n }\n }\n\n\n\n }", "title": "" }, { "docid": "7e2e210211a4d1a15090e65a5beb0e8d", "score": "0.6040753", "text": "function enablePlayerSubmits() {\n $(\".inputText1\").removeAttr(\"disabled\");\n $(\".inputText2\").removeAttr(\"disabled\");\n $(\".submit\").removeAttr(\"disabled\");\n $(\".submit\").addClass(\"submitGreen\");\n}", "title": "" }, { "docid": "229da64f12e2f7aac3aeb0c0d79f228d", "score": "0.6037785", "text": "function lock_button(selector_input, selector_button) {\n if (document.querySelector(selector_input).value.length > 0)\n {\n document.querySelector(selector_button).disabled = false;\n }\n else\n {\n document.querySelector(selector_button).disabled = true;\n }\n }", "title": "" }, { "docid": "388b684ecd027f829fa3373c8b32899f", "score": "0.6037267", "text": "addEventsOnInputs() {\n const inputUrl = document.getElementById('ribs-wysiwyg-link-url');\n const inputText = document.getElementById('ribs-wysiwyg-link-text');\n let nullText = false;\n\n inputUrl.addEventListener('keyup', (event) => {\n if (inputText.value === '') {\n nullText = true\n }\n if (nullText) {\n inputText.value = inputUrl.value;\n }\n });\n\n inputText.addEventListener('keyup', (event) => {\n if (inputText.value !== inputUrl.value) {\n nullText = false;\n }\n });\n }", "title": "" }, { "docid": "035b4c63a2ce483c3df0862d3dc7a83e", "score": "0.6030386", "text": "function disableBtns() {\n $(\"#update, #search\").attr(\"disabled\", \"disabled\");\n}", "title": "" }, { "docid": "959f993d1bdb75237ec266ae0489a352", "score": "0.6015177", "text": "function disable() {\t\n\t\tvar nameLength = $('.add_bar').val().length;\n\t\tif (nameLength < 1) {\n\t\t\t$('.submit_button').attr('disabled', \"true\");\n\t\t} else {\n\t\t\t$('.submit_button').attr('disabled', \"false\");\n\t\t}\n\t}", "title": "" }, { "docid": "5895739cb0993f4070bc90dbc7f80b93", "score": "0.6005323", "text": "function success() {\r\n if(document.getElementById(\"addTxt\").value===\"\") { \r\n document.getElementById('addBtn').disabled = true; \r\n } else { \r\n document.getElementById('addBtn').disabled = false;\r\n }\r\n }", "title": "" }, { "docid": "4fbe3f61a8e4621065962ede0a201f85", "score": "0.5992395", "text": "function MML_name_Keyup() {\n MML_disable_save_btn();\n }", "title": "" }, { "docid": "2bbffd45a80d1fe26f7acc0f8b6bf1eb", "score": "0.5991096", "text": "function addTextBtn(){\n inputText();\n}", "title": "" }, { "docid": "1b0a8e39245d9b24866a495026fa54fe", "score": "0.59851384", "text": "function disableInputs(disabled) {\n name.disabled = disabled;\n email.disabled = disabled;\n password.disabled = disabled;\n newPassword.disabled = disabled;\n phoneNumber.disabled = disabled;\n address.disabled = disabled;\n birthday.disabled = disabled;\n gender.disabled = disabled;\n}", "title": "" }, { "docid": "a3abe497d30ca636dbcb3eb69a4fb552", "score": "0.5983366", "text": "function stoppedTyping(input) {\n if (input.value.length > 0) {\n document.getElementById('b-visualizar').disabled = false;\n } else {\n document.getElementById('b-visualizar').disabled = true;\n }\n}", "title": "" }, { "docid": "82198640cabdc801f7c055c09487b3d5", "score": "0.5965795", "text": "function inputForText ( fields ) {\n for (var j = 0; j < fields.length; j++) {\n if ($.inArray(headers[j], disableInputData) == -1) {\n fields[j].innerHTML = fields[j].childNodes[0].value;\n }\n }\n }", "title": "" }, { "docid": "fd1cd7fc505e27471c707b0622e652f3", "score": "0.59562206", "text": "function disableInputs() {\n document.querySelector(\"textarea\").readOnly = true;\n document.getElementsByName(\"max\")[0].readOnly = true;\n document.getElementById('count').disabled = true;\n document.getElementById('reset_button').disabled = true;\n }", "title": "" }, { "docid": "9b32a2caaedf08f697fbb8ec66a2bad4", "score": "0.5951328", "text": "function buttonCheck () {\n //STOPS THE USER FROM ADDING NUMBERS PAST THE DISPLAY BOX\n if (display.innerText.length >11) {\n numberBtn.forEach(numberBtn => {\n numberBtn.disabled = true;\n document.removeEventListener (\"keydown\", keyboardFunction);\n });\n //ENABLES THE BUTTONS ONCE THERE IS ROOM IN THE DISPLAY\n } else {\n numberBtn.forEach(numberBtn => {\n numberBtn.disabled = false;\n document.addEventListener (\"keydown\", keyboardFunction);\n });\n }\n}", "title": "" }, { "docid": "63bb1e441cbf2a5f165b9453532b9c0a", "score": "0.59507054", "text": "disable() {\n this.disabled = true;\n this.inputContainer.classList.add(\"disabled\");\n }", "title": "" }, { "docid": "8cb35b3f61965c90d3aff89bfc3f9f9e", "score": "0.59386903", "text": "function updateVerifyCodeButtonUI() {\n document.getElementById('verify-code-button').disabled =\n !!window.verifyingCode\n || !getCodeFromUserInput();\n}", "title": "" }, { "docid": "f28b5c2fe2ae7f0afa1d575113ecfa8e", "score": "0.5914923", "text": "code1Changed(e) {\n this.code1Inputed = e.nativeEvent.text.length > 0? true : false\n this.code1 = e.nativeEvent.text\n\n if (e.nativeEvent.text.length > 0) {\n this.refs.code2TextInput.focus()\n }\n\n // check the possibility of next move.\n this.setState( {\n enableNextButton: this.code1Inputed && this.code2Inputed && this.code3Inputed && this.code4Inputed && this.code5Inputed && this.code6Inputed\n } )\n }", "title": "" }, { "docid": "b65798a2b7d793e6472a70e5e3e79454", "score": "0.5913128", "text": "function disableInputs() {\r\n \r\n var inputs = document.getElementsByTagName(\"input\"), \r\n buttons = document.getElementsByTagName(\"button\");\r\n\r\n for (var b = 0; b < inputs.length; b++) { \r\n inputs[b].disabled = true; \r\n }\r\n \r\n for (var c = 0; c < buttons.length; c++) {\r\n buttons[c].disabled = true;\r\n }\r\n\r\n eventDesc.disabled = true;\r\n loginButton.disabled = false; \r\n userName.disabled = false;\r\n pWord.disabled = false;\r\n}", "title": "" }, { "docid": "6da5f05926ffae4ff422b6b43465aa63", "score": "0.5904087", "text": "function updateUI() {\n /* === Disable the input fields === */\n red.disabled = \"disabled\";\n blue.disabled = \"disabled\";\n green.disabled = \"disabled\";\n hexaNum.disabled = \"disabled\";\n colorName.disabled = \"disabled\";\n userColor.setAttribute(\"readonly\", \"readonly\");\n\n /* === clear the input values === */\n red.value = \" \";\n blue.value = \" \";\n green.value = \" \";\n hexaNum.value = \" \";\n colorName.value = \" \";\n userColor.style.backgroundColor = \"#ffffff\";\n\n /* === Hide invalid feedbacks === */\n redInvalidFeedback.style.display = \"none\";\n blueInvalidFeedback.style.display = \"none\";\n greenInvalidFeedback.style.display = \"none\";\n hexaInvalidFeedback.style.display = \"none\";\n colorNameInvalidFeedback.style.display = \"none\";\n}", "title": "" }, { "docid": "0ab39c64d16b73cbb6c140c2d3b92a54", "score": "0.5899578", "text": "function addressInputModifiedHandler () {\r\n // Modify state of the Ack button fonction of validity status\r\n if (AddressInput.validity.valid) {\r\n\tAckInput.disabled = false;\r\n }\r\n else {\r\n\tAckInput.disabled = true;\r\n }\r\n}", "title": "" }, { "docid": "be786b22112e276ba11cc576377b9cbf", "score": "0.58969676", "text": "function disableButtons()\n{\n var commandFrame = document.getElementById(\"commandframe\");\n var buttons = commandFrame.getElementsByTagName(\"input\");\n for(var i = 0; i < buttons.length; i++)\n {\n buttons.item(i).disabled = true;\n }\n}", "title": "" }, { "docid": "2c3f97c4e741bb558c13c5ca40cc97bc", "score": "0.5894534", "text": "function searchState() {\n if (input.value.length >= 3) {\n searchBtn.disabled = false;\n }\n else {\n searchBtn.disabled = true;\n }\n}", "title": "" }, { "docid": "bda7682ddad30eebc4691f12e2200616", "score": "0.589283", "text": "enableKey(){\n let textField = document.getElementsByClassName('regTextField');\n let age = document.getElementsByClassName('age');\n\n for(let j = 0; j < textField.length; j++ ) {\n if(j < 3) {\n if (!age[j].value.match(/\\d+/)) {\n return;\n }\n }\n if (textField[j].value.match(/\\s/g)) {\n return;\n }\n }\n for (let i = 0; i < 7; i++) {\n if (!document.getElementById(i)){\n document.getElementById('submit').disabled = false;\n document.getElementById('btnText').style.display = 'none';\n } else {\n document.getElementById('submit').disabled = true;\n break;\n }\n }\n }", "title": "" }, { "docid": "a52f669349a8b88b3a2151e1069f5087", "score": "0.589056", "text": "function enableButton() {\n if(!validateEmail($(\"#email\").val())) {\n $(\"#reportMessage\").text(\"Error: Email address not valid\");\n $(\"#reportMessage\").css({\n 'background-color': '#ed5a64'\n });\n $(\"#registerbtn\").attr(\"disabled\", \"disabled\");\n return;\n } \n \n if(!validateLength($(\"#email\").val())) {\n $(\"#reportMessage\").text(\"Error: Email address not proper length\");\n $(\"#reportMessage\").css({\n 'background-color': '#ed5a64'\n });\n $(\"#registerbtn\").attr(\"disabled\", \"disabled\");\n return;\n }\n\n if(!validatePassword($(\"#psw\").val())) {\n $(\"#reportMessage\").text(\"Error: Password not valid\");\n $(\"#reportMessage\").css({\n 'background-color': '#ed5a64'\n });\n $(\"#registerbtn\").attr(\"disabled\", \"disabled\");\n return;\n }\n\n if(!validateLength($(\"#psw\").val())) {\n $(\"#reportMessage\").text(\"Error: Password not proper length\");\n $(\"#reportMessage\").css({\n 'background-color': '#ed5a64'\n });\n $(\"#registerbtn\").attr(\"disabled\", \"disabled\");\n return;\n }\n\n if(!validateMatching($(\"#psw\").val(), $(\"#psw_repeat\").val())){\n $(\"#reportMessage\").text(\"Error: Passwords not matching\");\n $(\"#reportMessage\").css({\n 'background-color': '#ed5a64'\n });\n $(\"#registerbtn\").attr(\"disabled\", \"disabled\");\n return;\n }\n\n $(\"#registerbtn\").removeAttr(\"disabled\");\n $(\"#reportMessage\").text(\"\");\n $(\"#reportMessage\").css({\n 'background-color': '#ffffff'\n });\n }", "title": "" }, { "docid": "4f38f35f66a6ec3f2e5dd12ebf416bfa", "score": "0.58882236", "text": "function btn_pressed(event) {\n user_click.removeAttribute(\"disabled\");\n box.setAttribute(\"disabled\", \" \");\n\n }", "title": "" }, { "docid": "ffc8b1d72f8b83b57f5a47ec5f567cbd", "score": "0.5887106", "text": "function inputPidData() {\n\n // Enable input elements\n var inputs = document.getElementsByTagName('input');\n for( var i = 0; i < inputs.length; i++){\n inputs[i].disabled = false;\n }\n\n setPid(txCharVal);\n}", "title": "" }, { "docid": "64834e3598bccd44e3d20cd1aea0637e", "score": "0.5885882", "text": "function modifyButton(button, fields) {\n for (var j = 0; j < fields.length; j++) {\n if ($.inArray(headers[j], disableInputData) == -1) {\n fields[j].innerHTML = '<input size=\"3\" type=\"text\" value=\"' + fields[j].innerText + '\"/>';\n }\n }\n button.innerHTML = \"Zapisz\";\n }", "title": "" }, { "docid": "701df060d0371d642155ba1a15a52324", "score": "0.5884558", "text": "updateEnabled() {\n\t\tlet nameValidation = /^([a-z]|-| )+([a-z]+)$/i // regex validation of name, including alphabet and hyphens\n\t\tif (nameValidation.test(this.state.first)) {\n\t\t\tthis.setState({canSubmitFirst: true})\n\t\t} else {\n\t\t\tthis.setState({canSubmitFirst: false})\n\t\t}\n\n\t\tif (nameValidation.test(this.state.last)) {\n\t\t\tthis.setState({canSubmitLast: true})\n\t\t} else {\n\t\t\tthis.setState({canSubmitLast: false})\n\t\t}\n\t}", "title": "" }, { "docid": "85fc1a45be7fd4d1a106d0200a0aed66", "score": "0.5868568", "text": "function disAbleButtons()\n{\n\tvar buttons = document.getElementById(\"buttons\").getElementsByTagName(\"input\");\n\tfor(var i=0; i<buttons.length; i++)\n\t\tbuttons[i].disabled = (buttons[i].disabled == '')? 'disabled' : '';\n}", "title": "" }, { "docid": "149a5dec43e3257cc80cff150d8beb50", "score": "0.5867436", "text": "function checkInput() {\n\tvar $input = $('#gunBrand');\n\tvar $button = $('#submitButton');\n\n\tsetInterval(function(){\n\t if($input.val().length > 0){\n\t $button.attr('disabled', false);\n\t }else{\n\t $button.attr('disabled', true);\n\t }\n\t}, 100);\n}", "title": "" }, { "docid": "b039830fb617c8f7cd1e0682816f4ae4", "score": "0.5867299", "text": "function disableInput() {\n Array.from(document.getElementsByClassName(\"input\")).forEach(e => e.disabled = true);\n}", "title": "" }, { "docid": "ba6e0c7786caf73e7d71e24e99c0bb1c", "score": "0.5866249", "text": "function setDisable(value){element.children().attr('disabled',value);element.find('input').attr('disabled',value);}", "title": "" }, { "docid": "ba6e0c7786caf73e7d71e24e99c0bb1c", "score": "0.5866249", "text": "function setDisable(value){element.children().attr('disabled',value);element.find('input').attr('disabled',value);}", "title": "" }, { "docid": "e49a9d4124b68da8ebba2f60fa7b6894", "score": "0.5851277", "text": "function toggleButton(input, addButton) {\n document.getElementById(addButton).disabled = ((input.value !== ref.defaultValue) ? false : true);\n}", "title": "" }, { "docid": "ec250477672c8ed1288a00002f07eaac", "score": "0.5846827", "text": "function inputHandlers() {\n $('input').focus(function() {\n $(this).val('');\n $(this).css('color', '#efefef');\n $(this).css('text-shadow', '#4998A3 1px 1px 1px');\n });\n $('input').blur(function() {\n $(this).val($(this).attr('init'));\n $(this).css('color', '#7ec0c0');\n $(this).css('text-shadow', '');\n });\n $('input').keyup(function() {\n if ($(this).val()) {\n $(this).unbind('focus');\n $(this).unbind('blur');\n if (checkForValidInputs()) {\n showFindButton();\n }\n } else {\n if (checkForValidInputs()) {\n showFindButton();\n } else {\n hideFindButton();\n }\n }\n });\n}", "title": "" }, { "docid": "a3c64d0bba425541e98f69704ad0dbfa", "score": "0.58453906", "text": "function userAndPass() {\n if(document.getElementById(\"insert-user\").value && document.getElementById(\"insert-pass\").value) {\n document.getElementById(\"master-button\").removeAttribute('disabled')\n }else {\n document.getElementById(\"master-button\").setAttribute('disabled','disabled')\n }\n}", "title": "" }, { "docid": "c38b984c9a40917a283b86e770c34a85", "score": "0.58186316", "text": "onTextChanged() {\n this.updateChangeIndicator();\n }", "title": "" }, { "docid": "e663c7a2965241fec9ddfd44ffad0bd5", "score": "0.58107114", "text": "function disableButtons(){\n\t\t\tfunc_disableSubmitBtn(\"saveForLaterButton\");\n\t\t\tfunc_disableSubmitBtn(\"approvedButton\");\n\t\t}", "title": "" }, { "docid": "057553a0b68da1a8500780db13852094", "score": "0.5810385", "text": "function chat_textArea(name) {\n $(\".\"+name+\"_chat_submit_button\").removeClass(\"btn-primary\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-disable\");\n\n $(\".\" + name +\"_chat_textarea\").on('keyup keydown keypres', e => {\n\n var value = $(\".\"+name+\"_chat_textarea\").val();\n current_chat.message = value;\n if (value.trim().length == 0) {\n\n $(\".\" + name +\"_chat_submit_button\").removeClass(\"btn-primary\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-disable\");\n\n } else {\n $(\".\" + name +\"_chat_submit_button\").removeClass(\"btn-disable\");\n $(\".\" + name +\"_chat_submit_button\").addClass(\"btn-primary\");\n\n }\n\n })\n }", "title": "" }, { "docid": "6beec893e767dbc34c3f7369b97fe017", "score": "0.57919925", "text": "function onInit(){\n setTextsAsync();\n initCanvas();\n textinput.disabled = true;\n}", "title": "" }, { "docid": "6e992ca2542cfdc421bfc0d9594bcb81", "score": "0.5781254", "text": "function disable_buttons() {\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": "d3b821b7a181e4b332d0af7927ef878d", "score": "0.57805216", "text": "function handleInput(button){\n\tvar result = document.getElementsByClassName(\"result-text\")[0];\n\tvar curVal = result[\"value\"];\n\n\tif (result[\"erase\"]){\n\t\tcurVal = \"\";\n\t\tresult[\"erase\"] = false;\n\t}\n\t\n\t// Handle clicking the . and 0 button when the result-text is empty or 0.\n\tif (button[\"value\"] == \".\"){\n\t\tif (curVal.indexOf(\".\") >= 0){\n\t\t\treturn true;\n\t\t}\n\t\telse if (curVal == \"\" || curVal == \"0\"){\n\t\t\tcurVal = \"0\";\n\t\t}\n\t}\n\telse if (curVal == \"0\"){\n\t\tcurVal = \"\";\n\t}\n\t\n\t// Update the fval or sval depending on whether an operation has been selected.\n\tif (result[\"op\"]){\n\t\tresult[\"value\"] = curVal + button[\"value\"];\n\t\tresult[\"sval\"] = curVal + button[\"value\"];\n\t}\n\telse {\n\t\tresult[\"value\"] = curVal + button[\"value\"];\n\t\tresult[\"fval\"] = curVal + button[\"value\"];\n\t}\n\tresult.scrollLeft = result.scrollWidth;\n}", "title": "" }, { "docid": "6e3c2d65da79f786e50682e5982fc15a", "score": "0.577354", "text": "function enableInputs(data){\n \n for(var j = 0; j<data.length; j++){\n document.getElementById('comments' + data[j].worktask_id).disabled = false;\n }\n \n saveRO.className = \"btn btn-default pull-right visible\";\n editRO.className = \"btn btn-default pull-right invisible\";\n odometerOut.disabled = false;\n openclose.disabled = false;\n openclose.style.backgroundColor = \"#fff\";\n }", "title": "" }, { "docid": "d60314e24da04e31dd82c84425ccc21e", "score": "0.5763326", "text": "function handleEdit() {\n document.getElementById('inputDate').disabled = false;\n document.getElementById('checkbox1').disabled = false;\n document.getElementById('checkbox2').disabled = false;\n document.getElementById('checkbox3').disabled = false;\n document.getElementById('checkbox4').disabled = false;\n document.getElementById('checkbox5').disabled = false;\n document.getElementById('inputCDCNumber').disabled = false;\n document.getElementById('inputBookingNumber').disabled = false;\n document.getElementById('inputName1').disabled = false;\n document.getElementById('inputName2').disabled = false;\n document.getElementById('inputName3').disabled = false;\n document.getElementById('inputPhoneNumber').disabled = false;\n document.getElementById('radio1').disabled = false;\n document.getElementById('radio2').disabled = false;\n document.getElementById('inputAltContactNumber').disabled = false;\n document.getElementById('inputAltContactName').disabled = false;\n document.getElementById('inputAltContactRelationship').disabled = false;\n document.getElementById('inputClientEmail').disabled = false;\n document.getElementById('inputAddressStreet').disabled = false;\n document.getElementById('inputAddressCity').disabled = false;\n document.getElementById('inputAddressState').disabled = false;\n document.getElementById('inputAddressZipcode').disabled = false;\n document.getElementById('inputBirthday').disabled = false;\n document.getElementById('inputBirthCity').disabled = false;\n document.getElementById('inputBirthState').disabled = false;\n document.getElementById('inputBirthCounty').disabled = false;\n document.getElementById('inputBirthHospital').disabled = false;\n document.getElementById('inputBirthCountry').disabled = false;\n document.getElementById('inputID').disabled = false;\n document.getElementById('inputSocialSecurity').disabled = false;\n document.getElementById('inputProgram').disabled = false;\n document.getElementById('inputTimeLeft').disabled = false;\n document.getElementById('inputMotherName').disabled = false;\n document.getElementById('inputFatherName').disabled = false;\n document.getElementById('checkbox6').disabled = false;\n document.getElementById('checkbox7').disabled = false;\n document.getElementById('checkbox8').disabled = false;\n document.getElementById('checkbox9').disabled = false;\n document.getElementById('checkbox10').disabled = false;\n document.getElementById('checkbox11').disabled = false;\n document.getElementById('checkbox12').disabled = false;\n document.getElementById('checkbox13').disabled = false;\n document.getElementById('checkbox14').disabled = false;\n document.getElementById('checkbox15').disabled = false;\n document.getElementById('checkbox16').disabled = false;\n document.getElementById('checkbox17').disabled = false;\n document.getElementById('checkbox18').disabled = false;\n document.getElementById('checkbox19').disabled = false;\n document.getElementById('checkbox20').disabled = false;\n document.getElementById('checkbox21').disabled = false;\n document.getElementById('inputNotes').disabled = false;\n\n document.getElementById('btnEdit1').hidden = true;\n document.getElementById('btnSubmit1').hidden = false;\n document.getElementById('btnEdit2').hidden = true;\n document.getElementById('btnSubmit2').hidden = false;\n\n return false;\n}", "title": "" }, { "docid": "775940d8ee9df730ee1b6157ba16ab96", "score": "0.5761961", "text": "function trigger(val){\n\tbtn[0].disabled = val\n\trandom_btn.disabled = val\n\tbtn[1].disabled = val\n}", "title": "" }, { "docid": "2d84ca60f1056a155c9b5d252bf799c7", "score": "0.57602775", "text": "function update_control(n, v) {\n if (n == \"run\") {\n if (v) {\n // $(\"#reset\").attr('disabled', true);\n $(\"#step\").attr('disabled', false);\n $(\"#run\").attr('disabled', false);\n $(\"#is_running\").html(\"Running.\");\n } else {\n // $(\"#reset\").attr('disabled', false);\n $(\"#step\").attr('disabled', true);\n $(\"#run\").attr('disabled', true);\n $(\"#is_running\").html(\"Not running.\");\n }\n }\n}", "title": "" }, { "docid": "c2e1d1ac03c9f8d1654cf09931ece436", "score": "0.57600087", "text": "'keyup #filmTitle' (event,instance){\n $('#filmTitle').attr('name','false');\n $('#modifyMovie').attr('disabled',true);\n }", "title": "" }, { "docid": "09e72167988391bdf597cb7ee40b5d6b", "score": "0.5754265", "text": "function Control_Input_Editer(pushed_btn, target_input) {\n var edit_ic = pushed_btn.find('.fa-edit');\n var check_ic = pushed_btn.find('.fa-check');\n\n if (!(pushed_btn.hasClass('editing'))) {\n pushed_btn.addClass('editing');\n edit_ic.removeClass('fa-edit');\n edit_ic.addClass('fa-check');\n target_input.attr('disabled', false);\n target_input.focus();\n } else {\n pushed_btn.removeClass('editing');\n\n check_ic.removeClass('fa-check');\n check_ic.addClass('fa-edit');\n\n target_input.blur();\n target_input.attr('disabled', true);\n }\n }", "title": "" }, { "docid": "4b8ca2b74c4a9f6669ece2b588f42691", "score": "0.5750585", "text": "enable() {\n this.disabled = false;\n this.inputContainer.classList.remove(\"disabled\");\n }", "title": "" }, { "docid": "d27d5ce551c6bde8338d5ed29dab940e", "score": "0.57462317", "text": "function enableInputs(level) {\r\n \r\n var inputs = document.getElementsByTagName(\"input\"), \r\n buttons = document.getElementsByTagName(\"button\");\r\n\r\n for (var b = 0; b < inputs.length; b++) { \r\n inputs[b].disabled = false; \r\n }\r\n\r\n \r\n for (var c = 0; c < buttons.length; c++) {\r\n buttons[c].disabled = false;\r\n }\r\n \r\n loginButton.disabled = true;\r\n userName.disabled = true;\r\n pWord.disabled = true;\r\n\r\n eventDesc.disabled = false;\r\n\r\n updateByAnything_RadioButton.click();\r\n deleteById_RadioButton.click();\r\n\r\n if (level !== \"ADMIN\") {\r\n adminFunctionsButton.disabled = true;\r\n }\r\n}", "title": "" }, { "docid": "077a88a3237ff70f14488520662b1e1b", "score": "0.5742544", "text": "handleInteraction(value) {\n const overlay = document.querySelector(\"#overlay\");\n //This will prevent the keyboard from working if the overlay is not display none\n if (overlay.style.display === \"none\") {\n //Set Btn to Disabled After Click\n const qwertyBtn = document.querySelectorAll(\".keyrow button\");\n qwertyBtn.forEach((btn) => {\n if (btn.innerHTML === value && game.activePhrase.checkLetter(value)) {\n //Prevents the button from being pressed multiple times\n if (!btn.classList.contains(\"chosen\")) {\n game.activePhrase.showMatchedLetter(value);\n btn.classList.add(\"chosen\");\n btn.setAttribute(\"disabled\", true);\n this.gameOver(this.checkForWin());\n }\n //Checks if button pressed equals value but is not in phrase\n } else if (\n btn.innerHTML === value &&\n !game.activePhrase.checkLetter(value)\n ) {\n if (!btn.classList.contains(\"wrong\")) {\n btn.classList.add(\"wrong\");\n btn.setAttribute(\"disabled\", true);\n this.removeLife();\n }\n }\n });\n }\n }", "title": "" }, { "docid": "a1dc5adee9ed2908762cfb8d6c43517d", "score": "0.5738779", "text": "handleTextFieldInteraction() {\n this.receivedUserInput_ = true;\n }", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5737591", "text": "function disabled(){}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5737591", "text": "function disabled(){}", "title": "" }, { "docid": "83eb808044d68b6486572b5c761c19ef", "score": "0.5727029", "text": "function editText() {\n receiverElement.innerText = minder.queryCommandValue('text');\n fsm.jump('input', 'input-request');\n receiver.selectAll();\n }", "title": "" }, { "docid": "f595b6c8c1d63eeebed0d4cf15a7d8c6", "score": "0.5722729", "text": "function enableEnter() {\n\tvar titleInput = $('.title-input').val()\n var urlInput = $('.url-input').val()\n if (urlInput.length <= 7) {\n \t$('.enter').attr('disabled', true);\n } else if (titleInput !== \"\" && urlInput !== \"\"){\n $('.enter').attr('disabled', false);\n }\n}", "title": "" } ]
5ac33ac66c46b09a3d0a40739f73e4fb
Compute the x/y coordinate space domains to fit the graph.
[ { "docid": "e11a3802e42d71d814d1d1d107fae180", "score": "0.6579263", "text": "computeDomainsFromBounds(bounds) {\n const xmin = bounds[0][0]\n const xmax = bounds[1][0]\n const ymin = bounds[0][1]\n const ymax = bounds[1][1]\n const xRange = xmax - xmin\n const yRange = ymax - ymin\n\n const { options } = this.transitive\n\n const paddingFactor =\n options && options.paddingFactor ? options.paddingFactor : 0.1\n\n const margins = this.getMargins()\n\n const usableHeight = this.height - margins.top - margins.bottom\n const usableWidth = this.width - margins.left - margins.right\n const displayAspect = this.width / this.height\n const usableDisplayAspect = usableWidth / usableHeight\n const graphAspect = xRange / (yRange === 0 ? -Infinity : yRange)\n\n let padding\n let dispX1, dispX2, dispY1, dispY2\n let dispXRange, dispYRange\n\n if (usableDisplayAspect > graphAspect) {\n // y-axis is limiting\n padding = paddingFactor * yRange\n dispY1 = ymin - padding\n dispY2 = ymax + padding\n dispYRange = yRange + 2 * padding\n const addedYRange = (this.height / usableHeight) * dispYRange - dispYRange\n if (margins.top > 0 || margins.bottom > 0) {\n dispY1 -=\n (margins.bottom / (margins.bottom + margins.top)) * addedYRange\n dispY2 += (margins.top / (margins.bottom + margins.top)) * addedYRange\n }\n dispXRange = (dispY2 - dispY1) * displayAspect\n const xOffset = (margins.left - margins.right) / this.width\n const xMidpoint = (xmax + xmin - dispXRange * xOffset) / 2\n dispX1 = xMidpoint - dispXRange / 2\n dispX2 = xMidpoint + dispXRange / 2\n } else {\n // x-axis limiting\n padding = paddingFactor * xRange\n dispX1 = xmin - padding\n dispX2 = xmax + padding\n dispXRange = xRange + 2 * padding\n const addedXRange = (this.width / usableWidth) * dispXRange - dispXRange\n if (margins.left > 0 || margins.right > 0) {\n dispX1 -= (margins.left / (margins.left + margins.right)) * addedXRange\n dispX2 += (margins.right / (margins.left + margins.right)) * addedXRange\n }\n\n dispYRange = (dispX2 - dispX1) / displayAspect\n const yOffset = (margins.bottom - margins.top) / this.height\n const yMidpoint = (ymax + ymin - dispYRange * yOffset) / 2\n dispY1 = yMidpoint - dispYRange / 2\n dispY2 = yMidpoint + dispYRange / 2\n }\n\n return [\n [dispX1, dispX2],\n [dispY1, dispY2]\n ]\n }", "title": "" } ]
[ { "docid": "ad7223c5ad6ddb29726b0bd6e848fcb4", "score": "0.6749221", "text": "function setDomains() {\n x0.domain(currentData.map(getId));\n x1.domain(keys).rangeRound([0, x0.bandwidth()]);\n y.domain([0, getMaxValueOfYear(currentData)]);\n}", "title": "" }, { "docid": "0073978ce47037f5b028cef190dc4824", "score": "0.6718593", "text": "function visibleDomain() {\n var ydomMin = Math.min.apply(null,\n includeForDomain.map(function (index) {\n return Math.min.apply(null, axes.y.plots[index].points);\n })\n );\n var ydomMax = Math.max.apply(null,\n includeForDomain.map(function (index) {\n return Math.max.apply(null, axes.y.plots[index].points);\n })\n );\n return plotting.ensureDomain([ydomMin, ydomMax]);\n }", "title": "" }, { "docid": "2713f5bacc107af05f93cf22c17b8e35", "score": "0.66839784", "text": "function visibleDomain() {\n var ydomMin = Math.min.apply(null,\n includeForDomain.map(function(index) {\n return Math.min.apply(null, $scope.axes.y.plots[index].points);\n })\n );\n var ydomMax = Math.max.apply(null,\n includeForDomain.map(function(index) {\n return Math.max.apply(null, $scope.axes.y.plots[index].points);\n })\n );\n return plotting.ensureDomain([ydomMin, ydomMax]);\n }", "title": "" }, { "docid": "06b44dca124a6ea02d43255f1d47401d", "score": "0.6551269", "text": "function getDomain(dataset) {\n let max = getMaximumScore(dataset)\n let min = getMinimumScore(dataset)\n let range = (max - min)\n // add some padding to the outside\n const padding = range * 0.1\n max = max + padding\n min = min - padding * 4\n range = max - min\n\n return {\n min,\n max,\n range,\n // posx returns the graph coordinate from the data range\n posX: (scoreVal) => {\n return ((scoreVal - min) * VIEWBOX_X) / range\n }\n }\n}", "title": "" }, { "docid": "1db625844fe4b69f8c935581b97e4331", "score": "0.64903533", "text": "setDomainRange(xDomains, yDomains, scale) {\n //console.log(xDomains);\n //console.log(yDomains);\n this.origin_x = d3.scaleLinear()\n .domain(xDomains)\n .range([0, this.style.size.width])\n //.padding(.1);\n \n this.origin_y = d3.scaleLinear()\n .domain(yDomains)\n .range([this.style.size.height, 0]);\n\n this.x = d3.axisBottom(this.origin_x).tickSize(0);\n \n this.y = d3.axisLeft(this.origin_y).tickSize(0);\n }", "title": "" }, { "docid": "a0b844e092376a9d7666828917ab000d", "score": "0.64352477", "text": "combineDomains () {\n const domains = {}\n _.each(this._drawings, drawing => {\n _.each(drawing.combineDomains(), (drawingDomain, axisName) => {\n domains[axisName] = d3Array.extent(_.concat(domains[axisName] || [], drawingDomain))\n })\n })\n return domains\n }", "title": "" }, { "docid": "42e22f4c629250ad03dc607286039b3b", "score": "0.61821985", "text": "function determineDomain2(plotdata, emolabels, x, y) {\n\t// This line is different\n\tvar xDomain = d3.extent(plotdata[emolabels[0]], function(e) { return e.jaar; })\n\temolabels.forEach(function(d) {\t\t\t\n\t\tvar tempDomain = d3.extent(plotdata[d], function(e) { return e.jaar; })\n\t\tif(tempDomain[0] < xDomain[0]){\n\t\t\txDomain[0] = tempDomain[0]\n\t\t}\n\t\tif(tempDomain[1] > xDomain[1]){\n\t\t\txDomain[1] = tempDomain[1]\n\t\t}\t\t\t\n\t})\n\tx.domain(xDomain);\n\t\t\n\tvar yDomain = d3.extent(plotdata[emolabels[0]], function(e) { return e.aantal; })\n\t\temolabels.forEach(function(d) {\n\t\t\tvar tempDomain = d3.extent(plotdata[d], function(e) { return e.aantal; })\n\t\t\tif(tempDomain[0] < yDomain[0]){\n\t\t\t\tyDomain[0] = tempDomain[0]\n\t\t\t}\n\t\t\tif(tempDomain[1] > yDomain[1]){\n\t\t\t\tyDomain[1] = tempDomain[1]\n\t\t\t}\t\t\t\n\t\t})\n\ty.domain(yDomain);\n}", "title": "" }, { "docid": "40511bb51b8fe1fb6952d72be28dfed8", "score": "0.6099099", "text": "function domainX(dataset, factor) {\n var domain = d3.extent(dataset, data => data[factor]);\n return domain;\n}", "title": "" }, { "docid": "246e3bceb90e4df37ac415de73163516", "score": "0.60391295", "text": "function drawAxes(limits, x, y) {\r\n // return x value from a row of data\r\n \r\n let xValue = function(d) { return +d[x]; }\r\n\r\n // function to scale x value\r\n let xScale = d3.scaleLinear()\r\n .domain([limits.xMin - 0.5, limits.xMax + 0.5]) // give domain buffer room\r\n .range([50, 650]);\r\n\r\n // xMap returns a scaled x value from a row of data\r\n let xMap = function(d) { return xScale(d); };\r\n\r\n // plot x-axis at bottom of SVG\r\n let xAxis = d3.axisBottom().scale(xScale);\r\n svgContainer.append(\"g\")\r\n .attr('transform', 'translate(0, 650)')\r\n .call(xAxis);\r\n\r\n // return y value from a row of data\r\n let yValue = function(d) { return +d[y]}\r\n\r\n // function to scale y\r\n let yScale = d3.scaleLinear()\r\n .domain([limits.yMax + 5, limits.yMin - 5]) // give domain buffer\r\n .range([50, 650]);\r\n\r\n // yMap returns a scaled y value from a row of data\r\n let yMap = function (d) { return yScale(d); };\r\n\r\n // plot y-axis at the left of SVG\r\n let yAxis = d3.axisLeft().scale(yScale);\r\n svgContainer.append('g')\r\n .attr('transform', 'translate(50, 0)')\r\n .call(yAxis);\r\n \r\n // return mapping and scaling functions\r\n return {\r\n x: xMap,\r\n y: yMap,\r\n xScale: xScale,\r\n yScale: yScale\r\n };\r\n }", "title": "" }, { "docid": "4b7de53a2442308bd21e1afefad9e915", "score": "0.5963416", "text": "function drawAxes(limits, x, y) {\n let xValue = function(d) { return +d[x]; }\n\n let xScale = d3.scaleLinear()\n .domain([limits.xMin - 0.5, limits.xMax + 0.5]) // give domain buffer room\n .range([50, 450]);\n\n let xMap = function(d) { return xScale(xValue(d)); };\n let xAxis = d3.axisBottom().scale(xScale);\n svgContainer.append(\"g\")\n .attr('transform', 'translate(0, 450)')\n .call(xAxis);\n\n let yValue = function(d) { return +d[y]}\n let yScale = d3.scaleLinear()\n .domain([limits.yMax + 5, limits.yMin - 5]) // give domain buffer\n .range([50, 450]);\n\n let yMap = function (d) { return yScale(yValue(d)); };\n let yAxis = d3.axisLeft().scale(yScale);\n svgContainer.append('g')\n .attr('transform', 'translate(50, 0)')\n .call(yAxis);\n\n return {\n x: xMap,\n y: yMap,\n xScale: xScale,\n yScale: yScale\n };\n }", "title": "" }, { "docid": "fd30d5dea9b06da6f2fb5e516577cae1", "score": "0.5954361", "text": "function drawAxes(limits, x, y) {\n // return x value from a row of data\n let xValue = function(d) { return +d[x]; }\n\n // function to scale x value\n let xScale = d3.scaleLinear()\n .domain([limits.xMin - 0.5, limits.xMax + 0.5]) // give domain buffer room\n .range([50, 450]);\n\n // xMap returns a scaled x value from a row of data\n let xMap = function(d) { return xScale(xValue(d)); };\n\n // plot x-axis at bottom of SVG\n let xAxis = d3.axisBottom().scale(xScale);\n svgContainer.append(\"g\")\n .attr('transform', 'translate(0, 450)')\n .call(xAxis);\n\n // return y value from a row of data\n let yValue = function(d) { return +d[y]}\n\n // function to scale y\n let yScale = d3.scaleLinear()\n .domain([limits.yMax + 5, limits.yMin - 5]) // give domain buffer\n .range([50, 450]);\n\n // yMap returns a scaled y value from a row of data\n let yMap = function (d) { return yScale(yValue(d)); };\n\n // plot y-axis at the left of SVG\n let yAxis = d3.axisLeft().scale(yScale);\n svgContainer.append('g')\n .attr('transform', 'translate(50, 0)')\n .call(yAxis);\n\n // return mapping and scaling functions\n return {\n x: xMap,\n y: yMap,\n xScale: xScale,\n yScale: yScale\n };\n }", "title": "" }, { "docid": "13b12e626e4fcf271460c998a88c380d", "score": "0.5916509", "text": "function drawAxes(limits, x, y, svg, rangeX, rangeY) {\n // return x value from a row of data\n let xValue = function(d) {\n return +d;\n };\n\n // function to scale x value\n let xScale = d3\n .scaleLinear()\n .domain([limits.xMin, limits.xMax]) // give domain buffer room\n .range([rangeX.min, rangeX.max]);\n\n // xMap returns a scaled x value from a row of data\n let xMap = function(d) {\n return xScale(xValue(d));\n };\n\n // plot x-axis at bottom of SVG\n let xAxis = d3.axisBottom().scale(xScale);\n svg\n .append(\"g\")\n .attr(\"transform\", \"translate(0, \" + rangeY.max + \")\")\n .call(xAxis);\n\n // return y value from a row of data\n let yValue = function(d) {\n return +d;\n };\n\n // function to scale y\n let yScale = d3\n .scaleLinear()\n .domain([limits.yMax, limits.yMin]) // give domain buffer\n .range([rangeY.min, rangeY.max]);\n\n // yMap returns a scaled y value from a row of data\n let yMap = function(d) {\n return yScale(yValue(d));\n };\n\n // plot y-axis at the left of SVG\n let yAxis = d3.axisLeft().scale(yScale);\n svg\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + rangeX.min + \", 0)\")\n .call(yAxis);\n\n // return mapping and scaling functions\n return {\n x: xMap,\n y: yMap,\n xScale: xScale,\n yScale: yScale\n };\n }", "title": "" }, { "docid": "f8f9e7c8ead18465645c74a540a85bab", "score": "0.57093173", "text": "function _computeScales(datasets) {\n datasets.forEach(function (dataset) {\n if (!xscale) {\n xscale = {\n xmin: Infinity,\n xmax: -Infinity,\n auto: true,\n };\n }\n if (xscale.auto) {\n xscale.xmax = d3.max([xscale.xmax, xmax(dataset)]);\n xscale.xmin = d3.min([xscale.xmin, xmin(dataset)]);\n if (xscale.xmax == xscale.xmin) {\n xscale.xmax += 1;\n }\n }\n\n var scaleid = yunits(dataset);\n if (!yscales[scaleid]) {\n yscales[scaleid] = {\n ymin: 0,\n ymax: 0,\n auto: true,\n };\n }\n var yscale = yscales[scaleid];\n if (!yscale.id) {\n yscale.id = scaleid;\n }\n if (!yscale.orient) {\n yscale.orient = leftYAxis ? \"left\" : \"right\";\n leftYAxis = !leftYAxis;\n }\n if (!yscale.sets) {\n yscale.sets = 0;\n }\n yscale.sets++;\n if (yscale.auto) {\n yscale.ymax = d3.max([yscale.ymax, ymax(dataset)]);\n yscale.ymin = d3.min([yscale.ymin, ymin(dataset)]);\n if (yscale.ymax == yscale.ymin) {\n yscale.ymax += 1;\n }\n }\n });\n var ymargin = { left: 35 };\n if (Object.keys(yscales).length > 1) {\n ymargin.right = 35;\n }\n plot.setMargin(\"yaxis\", ymargin);\n }", "title": "" }, { "docid": "cd4e7de08ec4ace2ae349fb906871441", "score": "0.5624416", "text": "static domains(p) {\n\t\tconst ds = [];\n\n\t\tfor (const v of p.variables()) {\n\t\t\tds.push(v.domain());\n\t\t}\n\t\treturn ds;\n\t}", "title": "" }, { "docid": "e16544faf58ae41f77094604e069d7c6", "score": "0.5563509", "text": "function y_domain(country, year) {\n\t\t\t\n\t// determine domain of y\n\tvar value = 0, minimum = 0, maximum = 0;\n\tfor (var i = 0, n1 = country.length; i < n1; i++){\n\t\tfor (var j = 0, n2 = year.length; j < n2; j++){\n\t\t\tvalue = country[i][j];\n\t\t\tvalue = +value;\n\n\t\t\t// keep track of maximum and minimum y-value for domain of y\n\t\t\tif (minimum == 0 && maximum == 0) {\n\t\t\t\tminimum = value;\n\t\t\t\tmaximum = value;\n\t\t\t}\n\t\t\telse if (value < minimum) { \n\t\t\t\tminimum = value;\n\t\t\t}\n\t\t\telse if (value > maximum) {\n\t\t\t\tmaximum = value;\n\t\t\t}\n\t\t};\n\t};\n\treturn [minimum, maximum];\n}", "title": "" }, { "docid": "5392242db6380df61fc44abddc1d2246", "score": "0.54622513", "text": "_getDomainFromData(props, axis) {\n // if data is given, return the max/min of the data\n if (props.data) {\n return [_.min(_.pluck(props.data, axis)), _.max(_.pluck(props.data, axis))];\n } else {\n // return the max / min of the array specified by props[axis]\n return [_.min(props[axis]), _.max(props[axis])];\n }\n }", "title": "" }, { "docid": "a5ed4b9ab62ce87d08e06e4c8cca439e", "score": "0.5458626", "text": "function xMinMax() {\r\n // min returns the minimum value from the data set\r\n xMin = d3.min(theData, function(d) {\r\n return parseFloat(d[xComorbidity]) * 0.90;\r\n });\r\n\r\n // max will return the largest value from the data set \r\n xMax = d3.max(theData, function(d) {\r\n return parseFloat(d[xComorbidity]) * 1.10;\r\n });\r\n }", "title": "" }, { "docid": "1a35516931c3d14dd6983e313c081844", "score": "0.5441464", "text": "getMinMaxProjectionsOntoAxis(axis) {\n // min/max values of each shape projected onto axis\n var maxProj,\n minProj;\n\n // projection values\n for (var i = 0; i < this.points.length; i++) {\n //debugger;\n var proj = projection(this.points[i], axis);\n var mag = magnitude(proj);\n var sign = (dotProduct(proj, axis) < 0) ? -1 : 1;\n mag *= sign;\n\n if (i == 0) {\n maxProj = mag;\n minProj = mag;\n } else {\n maxProj = Math.max(mag, maxProj);\n minProj = Math.min(mag, minProj);\n }\n\n }\n return [minProj, maxProj];\n }", "title": "" }, { "docid": "47d528d1e53738fad22de8eb0020eb32", "score": "0.5409634", "text": "function getTimeAxisDomain(data) {\n return data.reduce(function(domain, d) {\n domain[0] = (d.start < domain[0]) ? d.start : domain[0];\n domain[1] = (d.end > domain[1]) ? d.end : domain[1];\n return domain;\n }, [Infinity, -Infinity]);\n }", "title": "" }, { "docid": "1eba76e4d8991ef7389c5d8802fbcab8", "score": "0.53975785", "text": "getExtent(axis) {\n return d3.extent(this.data, (axis) ? this.yAccessor : this.xAccessor);\n }", "title": "" }, { "docid": "940d9f87c361f1e067844185608db4ee", "score": "0.53821963", "text": "function xScale(data, chosenXAxis) {\n // create scales\n\n var xMin = d3.min(data, d => parseInt(d[chosenXAxis]) * .8);\n var xMax = d3.max(data, d => parseInt(d[chosenXAxis]) * 1.2);\n xBounds(chosenXAxis);\n //console.log(xMin);\n //console.log(xMax);\n var xLinearScale = d3\n .scaleLinear()\n .domain([xMin, xMax])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "48ead5a38a96b64956172f5acb59a72b", "score": "0.5366511", "text": "function createDynamicScales() {\r\n // Calculate chart dimensions\r\n CHART_WIDTH = SVG_WIDTH - Y_AXIS_PAD - Y_AXIS_WIDTH;\r\n CHART_HEIGHT =\r\n SVG_HEIGHT -\r\n X_LABEL_HEIGHT -\r\n VERT_PAD -\r\n X_AXIS_HEIGHT -\r\n VERT_PAD -\r\n Y_LABEL_HEIGHT;\r\n\r\n // Update scales using calculated dimensions\r\n X_SCALE = d3\r\n .scaleLinear()\r\n .domain([X_MIN, X_MAX])\r\n .rangeRound([0, CHART_WIDTH]);\r\n\r\n Y_SCALE = d3\r\n .scaleLinear()\r\n .domain([Y_MIN, Y_MAX])\r\n .rangeRound([CHART_HEIGHT, 0]);\r\n }", "title": "" }, { "docid": "0ff082a0700f483cc74147816b1c26ca", "score": "0.532406", "text": "function xScale(data,chosenXAxis){\r\n //create scales \r\n var xLinearScale=d3.scaleLinear()\r\n //consider the maximum value found in the dataset \r\n .domain([d3.min(data,d=>d[chosenXAxis])*0.8, d3.max(data,d=>d[chosenXAxis])*1.2])\r\n .range([0,width]);\r\n return xLinearScale;\r\n }", "title": "" }, { "docid": "8de7c3e0198efeb849b03d50010dba55", "score": "0.53146946", "text": "function calculateAxesDimensions() {\r\n // Initialize scales with fake ranges\r\n X_SCALE = d3\r\n .scaleLinear()\r\n .domain([X_MAX, X_MAX])\r\n .rangeRound([0, 1000]);\r\n\r\n Y_SCALE = d3\r\n .scaleLinear()\r\n .domain([Y_MAX, Y_MAX])\r\n .rangeRound([0, 1000]);\r\n\r\n // Use dummy axes with fake scales to obtain dimensions\r\n SVG.append(\"g\")\r\n .classed(\"y-axis\", true)\r\n .call(d3.axisLeft(Y_SCALE).tickFormat(PERCENT_FORMAT_SHORT))\r\n .each(function() {\r\n Y_TICK_HEIGHT = d3\r\n .select(this)\r\n .select(\"text\")\r\n .node()\r\n .getBBox().height;\r\n Y_AXIS_WIDTH = this.getBBox().width;\r\n this.remove();\r\n });\r\n\r\n SVG.append(\"g\")\r\n .classed(\"x-axis\", true)\r\n .call(d3.axisBottom(X_SCALE).tickFormat(d3.format(\"d\")))\r\n .each(function() {\r\n d3.select(this)\r\n .selectAll(\"text\")\r\n .each(function() {\r\n X_TICK_MAX_WIDTH = Math.max(\r\n X_TICK_MAX_WIDTH,\r\n this.getComputedTextLength() + 2 * X_TICK_PAD\r\n );\r\n });\r\n X_AXIS_HEIGHT = this.getBBox().height;\r\n this.remove();\r\n });\r\n }", "title": "" }, { "docid": "8c4bd77ae6bdbf2839d30148aca896a1", "score": "0.52770114", "text": "function updateScales() {\n dataDomain.x = pc.stat.spec.timestamp;\n dataDomain.y = pc.stat.spec.kwhGen;\n chartDomain.x = d3.extent(dataDomain.x, function (d) {\n return parseDate(d);\n });\n chartDomain.y = [0, d3.max(dataDomain.y)];\n chartDomain.w = [0, dataDomain.x.length];\n // this assigns the chart scale domains.\n // See the root of object for assignment of chart scale ranges.\n chartScale.x.domain(chartDomain.x);\n chartScale.y.domain(chartDomain.y);\n chartScale.w.domain(dataDomain.x);\n // creates a new data accessor object\n dataAccessor = dataDomain.y.map(function (v, i, a) {\n return {\n time: dataDomain.x[i],\n kwh: dataDomain.y[i]\n };\n });\n }", "title": "" }, { "docid": "a4f05c43eaefd3e0f60b7819020a359b", "score": "0.527545", "text": "function setLeftAxisDomain() {\r\n var leftMax = d3.max(data, function(d) { return d[leftKey]; });\r\n if (leftKeyOrientation === 'inverted') {\r\n yScaleLeft.domain([leftMax, 0]);\r\n } else {\r\n yScaleLeft.domain([0, leftMax]);\r\n };\r\n }", "title": "" }, { "docid": "622fc05ed86d9b0dbfe7fcf1bb8e8785", "score": "0.5233201", "text": "function xScale(data, chosenXAxis) {\n // Creating the scale with domain and range\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.8,\n d3.max(data, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n \n return xLinearScale;\n \n }", "title": "" }, { "docid": "128c08ebeb44b67c918c1670de5880e1", "score": "0.5232656", "text": "function getCoords() {\n var chartLayout = chart1.getChartLayoutInterface();\n var chartBounds = chartLayout.getChartAreaBoundingBox();\n return {\n x: {\n min: chartLayout.getHAxisValue(chartBounds.left),\n max: chartLayout.getHAxisValue(chartBounds.width + chartBounds.left)\n },\n y: {\n min: chartLayout.getVAxisValue(chartBounds.top),\n max: chartLayout.getVAxisValue(chartBounds.height + chartBounds.top)\n }\n };\n }", "title": "" }, { "docid": "7575ae7c2a12e73d5212054c942e4dbf", "score": "0.5201096", "text": "function findMinMax(x, y) {\r\n\r\n // get min/max x values\r\n let xMin = d3.min(x);\r\n let xMax = d3.max(x);\r\n\r\n // get min/max y values\r\n let yMin = d3.min(y);\r\n let yMax = d3.max(y);\r\n\r\n // return formatted min/max data as an object\r\n return {\r\n xMin : xMin,\r\n xMax : xMax,\r\n yMin : yMin,\r\n yMax : yMax\r\n }\r\n }", "title": "" }, { "docid": "7575ae7c2a12e73d5212054c942e4dbf", "score": "0.5201096", "text": "function findMinMax(x, y) {\r\n\r\n // get min/max x values\r\n let xMin = d3.min(x);\r\n let xMax = d3.max(x);\r\n\r\n // get min/max y values\r\n let yMin = d3.min(y);\r\n let yMax = d3.max(y);\r\n\r\n // return formatted min/max data as an object\r\n return {\r\n xMin : xMin,\r\n xMax : xMax,\r\n yMin : yMin,\r\n yMax : yMax\r\n }\r\n }", "title": "" }, { "docid": "8d1c18604632afe8e6e0e27978895896", "score": "0.51871204", "text": "initScales() {\n var xRange = [0, this.width()];\n if (this.swapX) { xRange.reverse(); } // used ?\n\n var yRange = [this.height(), 0];\n if (this.swapY) { yRange.reverse(); } // used ?\n\n this.xScale\n .domain(this.xDomain())\n .range(xRange);\n\n this.yScale\n .domain(this.yDomain())\n .range(yRange);\n\n // keep a reference unmodified scale range for use in the layers when zooming\n this.originalXscale = this.xScale.copy();\n this.__scalesInitialized = true;\n }", "title": "" }, { "docid": "f181d60f54a19226aed7a4edb22ef363", "score": "0.51854974", "text": "function findMinMax(x, y) {\n // get min/max x values\n let xMin = d3.min(x);\n let xMax = d3.max(x);\n // get min/max y values\n let yMin = d3.min(y);\n let yMax = d3.max(y);\n\n // return formatted min/max data as an object\n return {\n xMin : xMin,\n xMax : xMax,\n yMin : yMin,\n yMax : yMax\n }\n }", "title": "" }, { "docid": "e4afc12c70d4d953f683e3be5fe94332", "score": "0.51839954", "text": "function findMinMax(x, y) {\n // get min/max x values\n let xMin = d3.min(x);\n let xMax = d3.max(x);\n\n // get min/max y values\n let yMin = d3.min(y);\n let yMax = d3.max(y);\n\n // return formatted min/max data as an object\n return {\n xMin: xMin,\n xMax: xMax,\n yMin: yMin,\n yMax: yMax\n };\n }", "title": "" }, { "docid": "f9b208cef461cd0c21b137d70987d993", "score": "0.5182307", "text": "function xScale(censData,chosenXAxis){\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(censData, d => d[chosenXAxis]) * 0.8,\n d3.max(censData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0,width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "d084ce9f6a553c33d9c67825306e8030", "score": "0.5181665", "text": "function findMinMax(x, y) {\n\n // get min/max x values\n let xMin = d3.min(x);\n let xMax = d3.max(x);\n\n // get min/max y values\n let yMin = d3.min(y);\n let yMax = d3.max(y);\n\n // return formatted min/max data as an object\n return {\n xMin : xMin,\n xMax : xMax,\n yMin : yMin,\n yMax : yMax\n }\n }", "title": "" }, { "docid": "a6a3a85ac705c25332bb9204d1350b30", "score": "0.517766", "text": "function make_x_gridlines() {\t\t\n\t\t\t return d3.axisBottom(xScale81)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "0f87beb4eadec96fd11972e2095563c9", "score": "0.51734287", "text": "function make_x_gridlines() {\t\t\n\t\t\t return d3.axisBottom(xScale84)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "478961f3727e627a5f2b9c534377a2d0", "score": "0.5173195", "text": "function buildScales(){\n xScale = d3.scaleBand()\n .rangeRound([0, chartWidth])\n .padding(0.1)\n .domain(data.map(getLetter));\n\n yScale = d3.scaleLinear()\n .rangeRound([chartHeight, 0])\n .domain([0, d3.max(data, getFrequency)]);\n }", "title": "" }, { "docid": "75ea48bf48a82bfcff0c92c97fa1cba7", "score": "0.5171327", "text": "function getDomain() {\r\n let answer = d3.extent(newData, function (row) {\r\n let returnValue = 0;\r\n for (let i = 0; i < newData.length; i++) {\r\n if (row.Beverage_category == allCategories[curCategory] && row.Beverage == subCategories[allCategories.indexOf(allCategories[curCategory])][curSub]) {\r\n returnValue = Math.max(returnValue, row[otherStats[curStat]]);\r\n }\r\n }\r\n return returnValue;\r\n });\r\n return answer;\r\n\r\n }", "title": "" }, { "docid": "e4e122790abed489ca5210560616bfe5", "score": "0.5168312", "text": "function scale(varx,vary){\n\n var xScale = d3.scaleLinear()\n .domain(d3.extent(varx))\n .range([0, width]);\n\n var yScale = d3.scaleLinear()\n .domain(d3.extent(vary))\n .range([0, height]);\n\n //create variables to be axes in preparation for chart-i-fication\n var bottomAxis = d3.axisBottom(xScale);\n var leftAxis = d3.axisLeft(yScale);\n\n // Add bottomAxis\n svg.append(\"g\").attr(\"transform\", `translate(0, ${height-margins-labelspace})`).call(bottomAxis);\n\n // Add leftAxis to the left side of the display\n svg.append(\"g\").attr(\"transform\", `translate(${margins + labelspace}, 0)`).call(leftAxis);\n \n\n scale(workingx, workingy);\n\n var circlesGroup= svg.selectAll(\"circle\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 6)\n .attr(\"cx\", (d => xScale))\n .attr(\"cy\", (d => yScale))\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"1\")\n .attr(\"fill\", \"blue\");\n }", "title": "" }, { "docid": "1204bc322037268f041306b684337bcc", "score": "0.5146749", "text": "saveScales () {\n const domains = this.combineDomains()\n if (!_.has(this.params, 'axis')) {\n this.params.axis = {}\n }\n _.each(domains, (domain, axisName) => {\n if (!_.has(this.params.axis, axisName)) this.params.axis[axisName] = {}\n const axis = this.params.axis[axisName]\n axis.position = this.config.getPosition(axisName)\n axis.domain = domain\n if (!this.hasAxisParam(axisName, 'range')) {\n if (['bottom', 'top'].includes(axis.position)) {\n axis.range = this.params.xRange\n } else if (['left', 'right'].includes(axis.position)) {\n axis.range = this.params.yRange\n }\n }\n if (!_.isFunction(axis.scale) && axis.range) {\n const scale = this.config.getScale(axisName)\n if (axis.nice) {\n if (this.hasAxisParam(axisName, 'ticks')) {\n scale.nice(axis.ticks)\n } else {\n scale.nice()\n }\n }\n scale.domain(axis.domain)\n .range(axis.range)\n axis.scale = scale\n }\n })\n this.adjustAxisMargin()\n\n // Now update the scales of the appropriate drawings.\n _.each(this._drawings, drawing => {\n drawing.params.axis = this.params.axis\n })\n }", "title": "" }, { "docid": "a4f3aee09208ee5d55e3b9b3077794c8", "score": "0.51408505", "text": "function make_x_gridlines() {\t\t\n\t\t\t return d3.axisBottom(xScale82)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "dbb535bf6e97494c889f7485fa3d3e0c", "score": "0.51179665", "text": "function setDomainValues() {\n\n\tvar sincelast;\n\n\tif (multidata !== null) { \n\t\tsincelast = computeSinceLast(multidata, \"multiple\");\n\t} else if ( indivdata !== null) { \n\t\tsincelast = 0;\n\t}\n\n\tdomain_values = {\n\t\tmin_n_tests: 0, \n\t\tmax_n_tests: 0,\n\t\tmax_bll_freq: 0,\n\t\tmax_bll: 0,\n\t\tmax_n_g5: 0,\n\t\tmax_n_g10: 0,\n\t\tmax_sincelast: sincelast\n\t};\n\t\n\tif (multidata !== null) {\n\t\tmultidata.forEach( function(elem) {\n\t\t\tif(elem.n_high_tests_build > domain_values.max_n_tests) { domain_values.max_n_tests = parseInt(elem.n_high_tests_build); }\n\t\t\tif(elem.bll_freq_max_high > domain_values.max_bll_freq) { domain_values.max_bll_freq = parseInt(elem.bll_freq_max_high); }\n\t\t\tif(elem.max_bll > domain_values.max_bll) \t\t\t\t{ domain_values.max_bll = parseInt(elem.max_bll); }\n\t\t\tif(elem.n_high_g5_build > domain_values.max_n_g5) \t\t{ domain_values.max_n_g5 = parseInt(elem.n_high_g5_build); }\n\t\t\tif(elem.n_high_g10_build > domain_values.max_n_g10) \t{ domain_values.max_n_g10 = parseInt(elem.n_high_g10_build); }\n\t\t});\n\t}\t\n\n}", "title": "" }, { "docid": "90c6e29444449998d8816841d22bb6b4", "score": "0.5117554", "text": "function findMinMax(x, y) {\n\n // get min/max x values\n let xMin = d3.min(x)\n let xMax = d3.max(x)\n\n // get min/max y values\n let yMin = d3.min(y)\n let yMax = d3.max(y)\n\n // return formatted min/max data as an object\n return {\n xMin : xMin,\n xMax : xMax,\n yMin : yMin,\n yMax : yMax\n }\n}", "title": "" }, { "docid": "5be0a4b1fe0269d318bfa22c9af61a54", "score": "0.51169074", "text": "function setScales(domvals) {\n\tscales = {\n\t\tmulti: {\n\t\t\ty: {\n\t\t\t\"mean_high_bll_build\":{\n\t\t\t\tdomain:[ 100 , 1 ], \n\t\t\t\trange:[dims.multi.scatter.yaxis_start, dims.multi.scatter.yaxis_finish],\n\t\t\t\t\"axis_text\":\"Average Building Blood Lead Levels (&micro;-grams)\"\n\t\t\t\t},\n\t\t\t\"n_high_g5_build\":{\n\t\t\t\t\"domain\":[ domvals.max_n_g5 , 0 ], \n\t\t\t\trange:[dims.multi.scatter.yaxis_start, dims.multi.scatter.yaxis_finish],\n\t\t\t\t\"axis_text\":\"5+ BLL Tests Per Building\"\n\t\t\t\t},\n\t\t\t\"n_high_g10_build\":{\n\t\t\t\t\"domain\":[ domvals.max_n_g10 , 0 ], \n\t\t\t\trange:[dims.multi.scatter.yaxis_start, dims.multi.scatter.yaxis_finish],\n\t\t\t\t\"axis_text\":\"10+ BLL Tests Per Building\"\n\t\t\t\t},\n\t\t\t\"p_high_g5_build\":{\n\t\t\t\t\"domain\":[1,0], \n\t\t\t\trange:[dims.multi.scatter.yaxis_start, dims.multi.scatter.yaxis_finish],\n\t\t\t\t\"axis_text\":\"Percentage 5+ BLL Tests Per Building\"\n\t\t\t\t},\n\t\t\t\"p_high_g10_build\":{\n\t\t\t\t\"domain\":[1,0], \n\t\t\t\trange:[dims.multi.scatter.yaxis_start, dims.multi.scatter.yaxis_finish],\n\t\t\t\t\"axis_text\":\"Percentage 10+ BLL Tests Per Building\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tx: {\n\t\t\t\"all\": { \n\t\t\t\tdomain:[ 0 , domvals.max_sincelast ],\n\t\t\t\trange:[dims.multi.scatter.xscale_start, dims.multi.scatter.xscale_finish],\n\t\t\t\t\"axis_text\":\"Days since last building inspection\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tfocus: {\n\t\t\ty: {\n\t\t\t\tall: {\n\t\t\t\t\taxis_text:\"Blood-lead level\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tx: {\n\t\t\t\tall: {\n\t\t\t\t\taxis_text:\"Samples in building\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tindividual: {\n\t\t\ty: {\n\t\t\t\thistogram:{\n\t\t\t\t\tdomain:[100,95,90,85,80,75,70,65,60,55,50,45,40,35,30,25,20,15,10,5], \n\t\t\t\t\trange:[(dims.multi.scatter.yaxis_start+15), dims.multi.scatter.yaxis_finish],\n\t\t\t\t\taxis_text:\"Sample Blood Lead Levels (&micro;-grams)\"\n\t\t\t\t\t},\n\t\t\t\tlinegraph: {\n\t\t\t\t\tdomain:[100,0],\n\t\t\t\t\trange:[(dims.multi.scatter.yaxis_start+15), dims.multi.scatter.yaxis_finish],\n\t\t\t\t\taxis_text:\"Sample Blood Lead Levels (&micro;-grams)\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tx: {\n\t\t\t\thistogram: {\n\t\t\t\t\tdomain:[0,100], \n\t\t\t\t\trange:[dims.indiv.histogram.xscale_start, dims.indiv.histogram.xscale_finish],\n\t\t\t\t\taxis_text:\"Number of individual samples\"\n\t\t\t\t},\n\t\t\t\tlinegraph: {\n\t\t\t\t\tdomain:[new Date(\"1994-01-01\"), new Date(\"2014-07-01\")], //d3.extent(data, function(d) { return d.date; })\n\t\t\t\t\trange:[dims.indiv.linegraph.xrange_start, dims.indiv.linegraph.xrange_finish],\n\t\t\t\t\taxis_text:\"Date of BLL Test\"\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\n\t};\t\n}", "title": "" }, { "docid": "b22b122c8466c8ab46ac641ade25eedf", "score": "0.509672", "text": "function xScale(graphData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(graphData, d => d[chosenXAxis]) * 0.8,\n d3.max(graphData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width])\n\n return xLinearScale\n}", "title": "" }, { "docid": "c6ecf0738bc6abf6ab19934d396155b0", "score": "0.50962317", "text": "fitGrid() {\n this._gridFittingXY('x')\n this._gridFittingXY('y')\n this._setInitialZoom()\n }", "title": "" }, { "docid": "8226fc885c79f2189ee9449db3448e01", "score": "0.50948805", "text": "function xMinMax() {\r\n // min will grab the smallest datum from the selected column.\r\n xMin = d3.min(theData, function(d) {\r\n return parseFloat(d[curX]) * 0.90;\r\n });\r\n\r\n // .max will grab the largest datum from the selected column.\r\n xMax = d3.max(theData, function(d) {\r\n return parseFloat(d[curX]) * 1.10;\r\n });\r\n }", "title": "" }, { "docid": "678f69bf110f824ed597db6203572e1f", "score": "0.5087026", "text": "function make_x_gridlines() {\t\t\n\t\t\t return d3.axisBottom(xScale83)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "cfb57414cf0703dc697fc8f56cedf77d", "score": "0.5083063", "text": "function setScales() {\n // Plot max and min values are fixed per game\n var minNumber = Math.min(gameInfo[\"number-range\"][0],gameInfo[\"bonus-range\"][0]),\n maxNumber = Math.max(gameInfo[\"number-range\"][1],gameInfo[\"bonus-range\"][1]);\n\n // Scale the svg plot to the range of lottery numbers\n // d3 scales are functions that accept domain numbers\n xScale = d3.scale.linear().domain([minNumber - 1, maxNumber + 1]).range([0,100]);\n yScale = d3.scale.linear().domain([minNumber - 1, maxNumber + 1]).range([100,0]);\n svgToPixel = d3.scale.linear().domain([0,100]).range([0,$plot.outerWidth()]);\n\n // Radii of grid points\n rGrid = xScale(1) / 6;\n rSliceGrid = xScale(1)/ 5;\n rMin = xScale(1) / 3;\n rMax = xScale(1) / 2;\n rQuickpick = xScale(1) / 1.7;\n}", "title": "" }, { "docid": "cfb57414cf0703dc697fc8f56cedf77d", "score": "0.5083063", "text": "function setScales() {\n // Plot max and min values are fixed per game\n var minNumber = Math.min(gameInfo[\"number-range\"][0],gameInfo[\"bonus-range\"][0]),\n maxNumber = Math.max(gameInfo[\"number-range\"][1],gameInfo[\"bonus-range\"][1]);\n\n // Scale the svg plot to the range of lottery numbers\n // d3 scales are functions that accept domain numbers\n xScale = d3.scale.linear().domain([minNumber - 1, maxNumber + 1]).range([0,100]);\n yScale = d3.scale.linear().domain([minNumber - 1, maxNumber + 1]).range([100,0]);\n svgToPixel = d3.scale.linear().domain([0,100]).range([0,$plot.outerWidth()]);\n\n // Radii of grid points\n rGrid = xScale(1) / 6;\n rSliceGrid = xScale(1)/ 5;\n rMin = xScale(1) / 3;\n rMax = xScale(1) / 2;\n rQuickpick = xScale(1) / 1.7;\n}", "title": "" }, { "docid": "dd48ba0e1b84277c8faedce5bc8ff920", "score": "0.5072622", "text": "static setDomains(p, ds) {\n\t\tfor (let i = 0; i < ds.length; ++i) {\n\t\t\tp.variableAt(i).setDomain(ds[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "731785c10f8f0e3432f352426c756cb6", "score": "0.5068951", "text": "function yMinMax() {\r\n // // min returns the minimum value from the data set\r\n yMin = d3.min(theData, function(d) {\r\n return parseFloat(d[yComorbidity]) * 0.90;\r\n });\r\n\r\n //max will return the largest value from the data set \r\n yMax = d3.max(theData, function(d) {\r\n return parseFloat(d[yComorbidity]) * 1.10;\r\n });\r\n }", "title": "" }, { "docid": "d61d8a54ef99f94aabe76f323a441f52", "score": "0.5056087", "text": "getXScale(data, width) {\n let xScale;\n let chartUtils = new ChartUtils();\n\n if (this.props.config.xAxis.type === 'datetime') {\n xScale = chartUtils.getTimeXScale(width);\n xScale.domain(d3.extent(data, (d) => {\n return d.xdomain;\n }));\n } else if (this.props.config.xAxis.type === 'linear') {\n xScale = chartUtils.getLinearXScale(width);\n xScale.domain(d3.extent(data, (d) => {\n return +d.xdomain;\n }));\n } else {\n xScale = chartUtils.getPointXScale(width);\n xScale.domain(data.map((d) => {\n return d.xdomain;\n }));\n }\n\n return xScale;\n }", "title": "" }, { "docid": "6eeb131b74e004d6315ceb4cee66771e", "score": "0.5037604", "text": "function getScale(govData, chosenAxis, min, max) {\n // create scales\n var aLinearScale = d3.scaleLinear()\n .domain([d3.min(govData, d => d[chosenAxis]) * 0.9,\n d3.max(govData, d => d[chosenAxis]) * 1.1\n ])\n .range([min, max]);\n return aLinearScale;\n}", "title": "" }, { "docid": "de79d168ef19d27c263d10ae92bf7b1e", "score": "0.50357836", "text": "scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }", "title": "" }, { "docid": "c5aeb1be8d1a904f6c3bb377dd2b0d81", "score": "0.5029978", "text": "function yScale(data_file, chosenYAxis, height) {\n// create scales\n\n\n\n console.log(\"Choseeya\",chosenYAxis)\n var y1LinearScale = d3.scaleLinear()\n\n // 0.8 reduces the domain of yscale at starting point\n .domain([d3.min(data_file, d => d[chosenYAxis]) * 0.8, \n d3.max(data_file, d => d[chosenYAxis]) \n ])\n .range([height, 0]);\n\nreturn y1LinearScale;\n\n} // end yScale function", "title": "" }, { "docid": "140e9f3974ecc49cbec7b24db3ed8b6b", "score": "0.50237316", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3\n .scaleLinear()\n .domain([\n d3.min(data, (rawData) => rawData[chosenXAxis]) * 0.8,\n d3.max(data, (rawData) => rawData[chosenXAxis]) * 1.2,\n ])\n .range([0, width]);\n\n // console.log(xLinearScale)\n\n return xLinearScale;\n}", "title": "" }, { "docid": "9999c9d152794c52aa2133b19ac64a4c", "score": "0.5013753", "text": "function calculateAxisScale() {\n var extent = [0, _chart.totalCapacity()];\n //_x lets us use d3 to scale the real input value to the output value\n _x = d3.scale.linear().domain(extent)\n .range([0, _chart.effectiveWidth()]);\n _xAxis.scale(_x);\n _xAxis.tickFormat(_tickFormat);\n }", "title": "" }, { "docid": "fc7042b0911573cd18f541dda3ed7567", "score": "0.50078195", "text": "function scale_x(x){\r\n return (x-xmin)/(xmax-xmin)* (xaxis1.x-xaxis0.x) + xaxis0.x;\r\n}", "title": "" }, { "docid": "d86860398dd978432356e53e39cc6de7", "score": "0.5003094", "text": "function CoordList(x_min, x_max, dx)\n {\n\tvar x0;\t\t\t\t/* Coordinate of first label = nearest\n\t\t\t\t\t multiple of dx less than x_min */\n\tvar x;\t\t\t\t/* x coordinate */\n\tvar coords;\t\t\t/* Return value */\n\tvar n, m;\t\t\t/* Loop indeces */\n\n\tcoords = [];\n\tx0 = Math.floor(x_min / dx) * dx;\n\tfor (n = m = 0; n <= Math.ceil((x_max - x_min) / dx); n++) {\n\t x = x0 + n * dx;\n\t if ( x >= x_min - dx / 4 && x <= x_max + dx / 4 ) {\n\t\tcoords[m] = x;\n\t\tm++;\n\t }\n\t}\n\treturn coords;\n }", "title": "" }, { "docid": "63d4035705862f6e72a29305cec4a89a", "score": "0.49911594", "text": "scaleDomain(channel) {\n const scale = this.specifiedScales[channel];\n return scale ? scale.domain : undefined;\n }", "title": "" }, { "docid": "2db3e009281f29e78266676a2cd097df", "score": "0.49808753", "text": "calculateScales () {\n const p = this.params\n p.xMarginInner = _.max(_.map(this._drawings, 'xMarginInner'))\n p.xRange = [p.marginLeft + p.marginInner + p.xMarginInner, p.chartWidth - p.marginRight - p.marginInner - p.xMarginInner]\n p.yRange = [p.chartHeight - p.marginInner - p.marginBottom, p.marginInner + p.marginTop]\n this.saveScales()\n }", "title": "" }, { "docid": "16a0993788e7629c9c272431d71dd833", "score": "0.49767953", "text": "function buildAxes(){\n xAxis = d3.axisBottom(xScale);\n\n yAxis = d3.axisLeft(yScale)\n .ticks(10, '%');\n }", "title": "" }, { "docid": "5a4a43b28e11fc5c2aea162b60f7a6ae", "score": "0.4974394", "text": "function xScale(censusData, chosenXAxis){\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(censusData, d => d[chosenXAxis]) * 0.8,\n d3.max(censusData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n\nreturn xLinearScale;\n}", "title": "" }, { "docid": "ee2b91fc54617aa1f1719d479e92fa76", "score": "0.49732828", "text": "function make_x_gridlines() {\r\n return d3.axisBottom(xScale)\r\n\r\n }", "title": "" }, { "docid": "6094268094816b18648ccb4c459db0cb", "score": "0.49721542", "text": "function make_x_gridlines() {\t\t\n\t\t\t return d3.axisBottom(xScale85)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "b58f8a2dc8161c52aca1692208514e91", "score": "0.49711266", "text": "function xScale(scatData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(scatData, d => d[chosenXAxis]),\n d3.max(scatData, d => d[chosenXAxis])\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "57e12e148c5cc0518a593b3497ec7030", "score": "0.49625167", "text": "_getDomainFromData(props, axis) {\n // if a sensible string map exists, return the minimum and maximum values\n // offset by the bar offset value\n if (this.stringMap[axis] !== null) {\n const mapValues = _.values(this.stringMap[axis]);\n return [_.min(mapValues), _.max(mapValues)];\n } else {\n // find the global min and max\n const allData = _.flatten(_.pluck(this.datasets, \"data\"));\n const min = _.min(_.pluck(allData, axis));\n const max = _.max(_.pluck(allData, axis));\n // find the cumulative max for stacked chart types\n // this is only sensible for the y domain\n // TODO check assumption\n const cumulativeMax = (props.stacked && axis === \"y\") ?\n _.reduce(this.datasets, (memo, dataset) => {\n return memo + (_.max(_.pluck(dataset.data, axis)) - _.min(_.pluck(dataset.data, axis)));\n }, 0) : -Infinity;\n return [min, _.max([max, cumulativeMax])];\n }\n }", "title": "" }, { "docid": "a4f781fe1b82b0a4195b5b79e80432c1", "score": "0.4939816", "text": "function initYscales() {\n for (var i = 0; i < dataset.length; i++) {\n var yScale = d3.scale.linear();\n yScale.domain([0, dataset[i].max])\n .range([svgHeight - margins.bottom, margins.top]);\n yScaleArray.push(yScale);\n }\n}", "title": "" }, { "docid": "1b67892af3afd9dec0b21ae63089cc38", "score": "0.4937224", "text": "calculateMinMaxes() {\n this.minMaxes = this.axes.map((axe) => this.shape.getMinMaxInDirection(axe));\n }", "title": "" }, { "docid": "fb044453ae9f2810f854860f03a6d55b", "score": "0.49353686", "text": "function getDomains() {\n var index;\n\n for (index = 0; index < length; index++) {\n contract.getDomain(index, getDomainCb);\n }\n}", "title": "" }, { "docid": "2771013dc0c94dc93a154008b7aa2baa", "score": "0.49324703", "text": "function xScale(censusData, chosenXAxis) {\n //create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(censusData, d => d[chosenXAxis]) * 0.8,\n d3.max(censusData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n \nreturn xLinearScale; \n}", "title": "" }, { "docid": "66288d055e50028ca502db20a69011c0", "score": "0.49269515", "text": "function filterCoordinates(data, domainMin, domainMax) {\n\t\tvar coords = data.geometry.coordinates;\n\t\tvar coordTimes = data.properties.coordTimes;\n\t\tvar filteredCoords = [];\n\t\tvar filteredCoordTimes = [];\n\n\t\tif(data.geometry.type === 'LineString') {\n\t\t\t// Find the first coordinate that is greater than or equal to the minimum bound on the brush\n\t\t\tvar filterIndexMin = coordTimes.findIndex(function(t) {\n\t\t\t\tvar coordTime = new Date(t);\n\t\t\t\treturn coordTime >= domainMin;\n\t\t\t});\n\n\t\t\t// Find the first coordinate that is greater than or equal to the maximum bound on the brush\n\t\t\tvar filterIndexMax = coordTimes.findIndex(function(t) {\n\t\t\t\tvar coordTime = new Date(t);\n\t\t\t\treturn coordTime >= domainMax;\n\t\t\t});\n\n\t\t\t// If a min index was found but not a max, the max index should be the last item\n\t\t\tif(filterIndexMin >= 0 && filterIndexMax === -1) {\n\t\t\t\tfilterIndexMax = coordTimes.length - 1;\n\t\t\t}\n\n\t\t\tfilteredCoords = coords.slice(filterIndexMin, filterIndexMax);\n\t\t\tfilteredCoordTimes = coordTimes.slice(filterIndexMin, filterIndexMax);\n\t\t} else if(data.geometry.type === 'MultiLineString') {\n\n\t\t\t// MultiLineStrings require that we find indexes to identify a containing array of coordinates and the coordinates themselves\n\t\t\tvar minLineIndex,\n\t\t\t\tminCoordIndex,\n\t\t\t\tmaxLineIndex,\n\t\t\t\tmaxCoordIndex;\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * First, initialize resulting filtered arrays with the correct number of line segments.\n\t\t\t * The number of line segments should not be affected by the filter.\n\t\t\t * The filter will only affect the coordinates contained in each segment.\n\t\t\t *\n\t\t\t */\n\t\t\tcoords.forEach(function(segment) {\n\t\t\t\tfilteredCoords.push([]);\n\t\t\t\tfilteredCoordTimes.push([]);\n\t\t\t});\n\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * Second, loop through coordTime segments and determine which segments and coordinates to include.\n\t\t\t * When the min coordinate is found, set minLineIndex to the segment the coordinate is in.\n\t\t\t * Do the same for the max coordinate.\n\t\t\t * If a min coordinate is found but not a max, this means the filter's max value is larger than any coordinate in this data.\n\t\t\t * In this situation, the max coordinate should be the last coordinate in the data.\n\t\t\t *\n\t\t\t */\n\t\t\tvar parseTime = d3.timeParse('%m/%d/%y %H:%M%Z');\n\t\t\tfor(var i = 0; i < coordTimes.length; i++) {\n\t\t\t\tif(minLineIndex === undefined) {\n\t\t\t\t\tminCoordIndex = coordTimes[i].findIndex(function(t) {\n\t\t\t\t\t\tvar coordTime = parseTime(t);\n\t\t\t\t\t\treturn coordTime >= domainMin;\n\t\t\t\t\t});\n\t\t\t\t\tif(minCoordIndex >= 0) minLineIndex = i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(maxLineIndex === undefined) {\n\t\t\t\t\tmaxCoordIndex = coordTimes[i].findIndex(function(t) {\n\t\t\t\t\t\tvar coordTime = parseTime(t);\n\t\t\t\t\t\treturn coordTime >= domainMax;\n\t\t\t\t\t});\n\t\t\t\t\tif(maxCoordIndex >= 0) {\n\t\t\t\t\t\tmaxLineIndex = i;\n\t\t\t\t\t} else if(minLineIndex >= 0 && i === coordTimes.length - 1) {\n\t\t\t\t\t\tmaxLineIndex = i;\n\t\t\t\t\t\tmaxCoordIndex = coordTimes[i].length - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(minLineIndex && maxLineIndex) break;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * Third, loop through segments again and use the index bounds to create the filtered arrays of coordinates and coordTimes.\n\t\t\t * If a segment falls between the min and max, include all its coordinates.\n\t\t\t * If a segment is outside the range of the filter, assign an empty array to its position in the output.\n\t\t\t * If the maxCoordIndex is the last item in a segment, only slice from the min bound. This is because the end index on array.slice is non-inclusive.\n\t\t\t *\n\t\t\t */\n\t\t\tfor(var i = 0; i < coordTimes.length; i++) {\n\t\t\t\tif(minLineIndex === i && maxLineIndex === i) {\n\t\t\t\t\tif(maxCoordIndex === coords[i].length - 1) {\n\t\t\t\t\t\tfilteredCoords[i] = coords[i].slice(minCoordIndex);\n\t\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i].slice(minCoordIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfilteredCoords[i] = coords[i].slice(minCoordIndex, maxCoordIndex);\n\t\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i].slice(minCoordIndex, maxCoordIndex);\n\t\t\t\t\t}\n\t\t\t\t} else if(minLineIndex === i && maxLineIndex !== i) {\n\t\t\t\t\tfilteredCoords[i] = coords[i].slice(minCoordIndex);\n\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i].slice(minCoordIndex);\n\t\t\t\t} else if(minLineIndex !== i && maxLineIndex === i) {\n\t\t\t\t\tif(maxCoordIndex === coords[i].length - 1) {\n\t\t\t\t\t\tfilteredCoords[i] = coords[i];\n\t\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfilteredCoords[i] = coords[i].slice(0, maxCoordIndex);\n\t\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i].slice(0, maxCoordIndex);\n\t\t\t\t\t}\n\t\t\t\t} else if(i > minLineIndex && i < maxLineIndex) {\n\t\t\t\t\tfilteredCoords[i] = coords[i];\n\t\t\t\t\tfilteredCoordTimes[i] = coordTimes[i];\n\t\t\t\t} else {\n\t\t\t\t\tfilteredCoords[i] = [];\n\t\t\t\t\tfilteredCoordTimes[i] = [];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcoordinates: filteredCoords,\n\t\t\tcoordTimes: filteredCoordTimes\n\t\t}\n\t}", "title": "" }, { "docid": "0c2c16fc0584d3500bfcfd45dee7fc14", "score": "0.4917737", "text": "function xScale(Data, XAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(Data, d => d[XAxis]) * 0.8,\n d3.max(Data, d => d[XAxis]) * 1.2\n ])\n .range([0, width]);\n\n return xLinearScale;\n}", "title": "" }, { "docid": "d4c49799df6cc25b496a9815123b5830", "score": "0.4917558", "text": "function xScale(data_poverty, chosen_x_axis) {\n // create scales\n var x_linear_scale = d3.scaleLinear()\n .domain([d3.min(data_poverty, d => d[chosen_x_axis]) * 0.9,\n d3.max(data_poverty, d => d[chosen_x_axis]) * 1.3])\n .range([0, width]);\n \n return x_linear_scale;\n \n}", "title": "" }, { "docid": "776274b619c54a7a6223c92ce3a44df6", "score": "0.49164316", "text": "function xScale(myData) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(myData, d => d.poverty)*.9,\n d3.max(myData, d => d.poverty)\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "110093f27dc2d67aa88978c3deaf3ffb", "score": "0.49059013", "text": "function upperBoundClick(){\n var input = document.getElementById(\"upperBoundInput\").value;\n\n if(isValid(input)){\n yScale = d3.scale.linear().domain([0,input]).range([480,0]);\n // xScale = d3.scale.linear().domain([1960,2014]).range([0,980]);\n\n //now the axes\n yAxis = d3.svg\n .axis()\n .scale(yScale)\n .orient(\"right\")\n .ticks(20)\n .tickSize(1480)\n .tickSubdivide(true);\n\n xAxis = d3.svg\n .axis()\n .scale(xScale)\n .orient(\"bottom\")\n .tickSize(480)\n .ticks(5);\n\n //now draw the axes\n d3.select(\"svg\").select(\"#gdpTimeyAxisG\").call(yAxis);\n d3.select(\"svg\").select(\"#gdpTimexAxisG\").call(xAxis);\n\n\n d3.select(\"svg\").selectAll(\"path\").remove();\n\n //now declare the fill scale\n drawGraph(viewedData, xScale, yScale);\n }else{\n alert(\"invalid input! please insert real numbers ONLY\");\n }\n}", "title": "" }, { "docid": "760dc005dbfb199714e365f4f4019a08", "score": "0.49053437", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.9, \n d3.max(data, d => d[chosenXAxis]) * 1.1])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "28b49b294d1851807b061ce2cb4b46c4", "score": "0.49029362", "text": "function xScale(data_file, chosenXAxis,width) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data_file, d => d[chosenXAxis]) * 0.97,\n d3.max(data_file, d => d[chosenXAxis]) //* 1.2\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n\n}", "title": "" }, { "docid": "f9f1013c13a97d2adf264f39846757de", "score": "0.48989978", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "title": "" }, { "docid": "4bee84c02b0d2e7b179df119ec793a72", "score": "0.48881352", "text": "function make_y_gridlines() {\t\t\n\t\t\t return d3.axisLeft(yScale81)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "8503c2c41c0e5ba8d77bbe7b9c2520c4", "score": "0.48815703", "text": "function createScales(){\n map_0_xScale = d3.scaleLinear(d3.extent(finalData, d => d.mapX), [margin.left, width - margin.right])\n map_0_yScale = d3.scaleLinear(d3.extent(finalData, d => d.mapY), [height - margin.bottom, margin.top])\n\n finalData_noBCN = finalData.filter(d => d.municipality !== 'Barcelona')\n\n popScale = d3.scaleLinear() // this is an x axis\n .domain(d3.extent(finalData, d => d.population)).nice()\n .range([margin.left, width - margin.right])\n\n popScale_noBCN = d3.scaleLinear() // this is an x axis\n .domain(d3.extent(finalData_noBCN, d => d.population)).nice()\n .range([margin.left, width - margin.right])\n\n airbnbScale = d3.scaleLinear() // this is a y axis\n .domain(d3.extent(finalData, d => d.airbnb)).nice()\n .range([height - margin.bottom, margin.top])\n\n airbnbScale_noBCN = d3.scaleLinear() // this is a y axis\n .domain(d3.extent(finalData_noBCN, d => d.airbnb)).nice()\n .range([height - margin.bottom, margin.top])\n\n airbnbPerScale = d3.scaleLinear() // this is a y axis\n .domain(d3.extent(finalData, d => d.perc_Airbnb)).nice()\n .range([height - margin.bottom, margin.top])\n \n // airbnbScale_r = d3.scaleSqrt()\n // .domain([0, d3.max(finalData, d => d.perc_Airbnb)])\n // .range([1, 20])\n\n // COLORS\n blue = '#7bd2ed'\n yellow = '#ffd208'\n teal = '#29DDC7'\n orange = '#FF852F'\n newblue = '#3B78E0'\n pink = '#FF047D'\n\n // fillScale = d3.scaleSequential(d3.interpolatePuBu)\n //fillScale = d3.scaleSequential(d3.interpolateGnBu)\n //fillScale = d3.scaleLinear().domain([1,10]).range([\"#ffffff\", \"#3da2a4\"])\n // fillScale = d3.scaleSequential(chroma.scale(['#fff', teal, newblue]))\n\n \n}", "title": "" }, { "docid": "4e25c6311fee76fa490e29303d30c7aa", "score": "0.48811138", "text": "function rescale(request) { \n x.domain(allData[request].map(function(d) { return d.name; }));\n chart.select(\".x\")\n .transition()\n .duration(1000)\n .ease(\"sin-in-out\") //https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease\n .call(xAxis);\n \n y.domain([0, d3.max(allData[request], function(d) { return d.value; })]);\n chart.select(\".y\")\n .transition()\n .duration(1500)\n .ease(\"sin-in-out\") \n .call(yAxis); \n}", "title": "" }, { "docid": "613d29992d4d11d1be346598d627fa41", "score": "0.4876782", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.8,\n d3.max(data, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width])\n return xLinearScale;\n}", "title": "" }, { "docid": "299e53765268f70ce3324b333244387d", "score": "0.4875445", "text": "function xScale(mockData, chosenXAxis) {\n // create scales\nlet xLinearScale = d3.scaleLinear()\n .domain([d3.min(mockData, d => d[chosenXAxis]),\n d3.max(mockData, d => d[chosenXAxis])\n ])\n .range([0, width]);\n\nreturn xLinearScale;\n\n}", "title": "" }, { "docid": "7ec9c0b92d66ed8d918c0f89eccefc43", "score": "0.48734772", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "title": "" }, { "docid": "962808c4d734b89fc51ff936c9d2ca1f", "score": "0.4864343", "text": "function xScale(data, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.8,\n d3.max(data, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n \n return xLinearScale;\n }", "title": "" }, { "docid": "7c0f5355fa9f56ef350a44413a89e78b", "score": "0.4864162", "text": "function drawAxes(limits, x, y, csvData) {\r\n // return x value from a row of data\r\n let xValue = function(d) { return +d[x]; }\r\n \r\n // function to scale x value\r\n let xScale = d3.scaleLinear()\r\n .domain([limits.xMin, limits.xMax]) // give domain buffer\r\n .range([50, 750]);\r\n\r\n // xMap returns a scaled x value from a row of data\r\n let xMap = function(d) { return xScale(d); };\r\n\r\n // plot x-axis at bottom of SVG\r\n let xAxis = d3.axisBottom().scale(xScale).ticks(25);\r\n svgContainer.append(\"g\")\r\n .attr('transform', 'translate(15, 650)')\r\n .call(xAxis)\r\n .selectAll(\"text\")\r\n .attr(\"y\", 0)\r\n .attr(\"x\", 9)\r\n .attr(\"dy\", \".35em\")\r\n .attr(\"transform\", \"rotate(90)\")\r\n .style(\"text-anchor\", \"start\");\r\n\r\n // return y value from a row of data\r\n let yValue = function(d) { return +d[y]}\r\n\r\n // function to scale y\r\n let yScale = d3.scaleLinear()\r\n .domain([limits.yMax + 5, limits.yMin - 5]) // give domain buffer\r\n .range([50, 650]);\r\n\r\n // yMap returns a scaled y value from a row of data\r\n let yMap = function (d) { return yScale(d); };\r\n\r\n // plot y-axis at the left of SVG\r\n let yAxis = d3.axisLeft().scale(yScale);\r\n svgContainer.append('g')\r\n .attr('transform', 'translate(50, 0)')\r\n .call(yAxis);\r\n\r\n // return mapping and scaling functions\r\n return {\r\n x: xMap,\r\n y: yMap,\r\n xScale: xScale,\r\n yScale: yScale\r\n };\r\n }", "title": "" }, { "docid": "86db88e713055a8cbb2db32fde385cae", "score": "0.4863898", "text": "function xScale(cData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(cData, d => d[chosenXAxis]) * 0.8,\n d3.max(cData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n \n return xLinearScale;\n \n}", "title": "" }, { "docid": "530e7666a736adc47297e37bbf456132", "score": "0.48614985", "text": "function make_y_gridlines() {\t\t\n\t\t\t return d3.axisLeft(yScale84)\n\t\t\t \n\t\t\t}", "title": "" }, { "docid": "5aa3a33cd79ad0abb62159f91a3ddd2b", "score": "0.48589525", "text": "function xScale(data, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.9,\n d3.max(data, d => d[chosenXAxis]) * 1.1\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "36878149ef9415769cab33ef8dcfa316", "score": "0.485853", "text": "function makeScales(data, plot) {\n const minDate = moment(data[0].date).subtract(dateMinHeadroomDays, 'days').toDate();\n const maxDate = moment(data[data.length-1].date).add(dateMaxHeadroomDays, 'days').toDate();\n const minRate = Math.floor(100.0 * d3.min(data.map(x => x.rate))) / 100.0 - rateHeadroom;\n const maxRate = Math.ceil(100.0 * d3.max(data.map(x => x.rate))) / 100.0 + rateHeadroom;\n return {\n x: d3.scaleTime()\n .domain([minDate, maxDate])\n .range([0, plot.range.x]),\n y: d3.scaleLinear()\n .domain([minRate, maxRate])\n .range([plot.range.y, 0]),\n };\n }", "title": "" }, { "docid": "54666e47fbdcd7cb6d81aa4bb85897bb", "score": "0.48553318", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n }", "title": "" }, { "docid": "0e09e4eaa7534dda472f8681ef94fa4d", "score": "0.48484886", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n }", "title": "" }, { "docid": "4a072fd2f2cecd996b6cb995ac01ef88", "score": "0.48425248", "text": "function xScale(countryData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(countryData, d => d[chosenXAxis]),\n d3.max(countryData, d => d[chosenXAxis])\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "92be11f4226277dec6c735912e1c36c2", "score": "0.4835482", "text": "function xScale(econData, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(econData, d => d[chosenXAxis]) * 0.95,\n d3.max(econData, d => d[chosenXAxis]) * 1.05])\n .range([0, width]);\n\n return xLinearScale;\n}", "title": "" }, { "docid": "9b14d77730d1729abc60b33ed34b32bd", "score": "0.4833866", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis] - 1), d3.max(data, d => d[chosenXAxis])])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "07f64216ccc2686c036b12dd2443beca", "score": "0.4830654", "text": "function drawAxes() {\n\t\t\t\t// x axis\n\t\t\t\tvar xAxis = d3.svg.axis()\n\t\t\t\t\t\t\t\t.scale(xScale)\n\t\t\t\t\t\t\t\t.orient('bottom')\n\t\t\t\t\t\t\t\t.ticks(2);\n\t\t\t\t// y axis\n\t\t\t\tvar yAxis = d3.svg.axis()\n\t\t\t\t\t\t\t\t.scale(yScale)\n\t\t\t\t\t\t\t\t.orient(\"left\")\n\t\t\t\t\t\t\t\t.ticks(2);\n\t\t\t\t// Add x axis\n\t\t\t\tsvg.append('g')\n\t\t\t\t\t.attr(\"transform\", \"translate(0,\" + (height) + \")\")\n\t\t\t\t\t.call(xAxis);\n\t\t\t\t// Add y Axis\n\t\t\t\t\tsvg.append(\"g\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\"+(0)+\",0)\")\n\t\t\t\t\t\t\t.call(yAxis);\n\t\t\t\t// now add titles to the axes\n\t\t\t\tsvg.append(\"text\")\n\t\t\t\t\t\t.attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n\t\t\t\t\t\t.attr(\"transform\", \"translate(\"+ (padding/2) +\",\"+10+\")\") // text is drawn off the screen top left, move down and out and rotate\n\t\t\t\t\t\t.text(\"C 2\"); // Component 2\n\t\t\t\tsvg.append(\"text\")\n\t\t\t\t\t\t.attr(\"text-anchor\", \"middle\") // this makes it easy to centre the text as the transform is applied to the anchor\n\t\t\t\t\t\t.attr(\"transform\", \"translate(\"+ (19*width/20) +\",\"+(height-(padding/3))+\")\") // centre below axis\n\t\t\t\t\t\t.text(\"C1\"); // Component 1\n\n\t\t\t\td3.selectAll(\".domain\").attr(\"fill\", \"none\").attr(\"stroke\", \"black\").attr(\"stroke-width\", 2);\n\t\t\t}", "title": "" }, { "docid": "6915d2b92012dab8eb414282e5e5ad05", "score": "0.4829794", "text": "function linearScale(axis, data) {\n const offset = axis === 'x' ? 0.05 : 0.2;\n return d3.scaleLinear()\n .domain([d3.min(data, d => d[selected[axis]]) * (1 - offset),\n d3.max(data, d => d[selected[axis]]) * (1 + offset)])\n .range(axis === 'x' ? [0, svgParams.iWidth] : [svgParams.iHeight, 0]);\n}", "title": "" } ]
80a1ba9f95cfb9a984890d502e94b404
Creates an empty array of length n (for use in HTML)
[ { "docid": "e29460d871c867ac0800ef03f0121049", "score": "0.81326914", "text": "function array(n) {\n return new Array(n);\n }", "title": "" } ]
[ { "docid": "9ae233f13fb897fd2e64509fa09d9781", "score": "0.8089664", "text": "function create_dummy_array(n){\n var arr = [];\n for(var i = 0;i<n;i++){\n arr.push(Math.floor(Math.random()*10))\n }\n return arr\n}", "title": "" }, { "docid": "6f4d5ec38841592a3531d0a1ec796630", "score": "0.80138713", "text": "function create_dummy_array(n){\n let newArr = []\n for(let i = 0; i < n; i++){\n newArr.push(Math.floor(Math.random() * 10))\n }\n return newArr;\n}", "title": "" }, { "docid": "1f02d7542dc1876e96e96ed3900dc62f", "score": "0.80037177", "text": "function create_dummy_array(n){\n\tvar array = [];\n\tfor(let i=0; i<n; i++){\n\t\tvar x = Math.floor(Math.random() * 10);\n\t\tarray.push(x);\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "07bee2c5cda01d21e1181390d9f4bb30", "score": "0.7852515", "text": "createFilledArray(elem, n) {\n let arr = [];\n for (let i = 0; i <= n; i++) {\n arr.push(elem);\n }\n\n return arr;\n }", "title": "" }, { "docid": "bb79c5458ea1fad9a2994aa106d283cf", "score": "0.7682237", "text": "function zero_fill_array(n) {\n\t\tvar o = new Array(n);\n\t\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\t\treturn o;\n\t}", "title": "" }, { "docid": "bd7a7063703728243dd6bb801ba58cd1", "score": "0.7580696", "text": "function arr(n){\n var newArr = [];\n for(var i = 0; i < n; i++){\n newArr.push(i);\n }\n return newArr;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "7900acb41c82a99ea87c08193e651b62", "score": "0.75743216", "text": "function zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}", "title": "" }, { "docid": "484aea2a67542746cb7d03257ebc0ed3", "score": "0.757075", "text": "function makeArray(n) {\n\tthis.length = n;\n\treturn this;\n}", "title": "" }, { "docid": "bf407cd43d9cac8e3289d94c2fd23f4c", "score": "0.75482666", "text": "function repeat(n) {\n return Array.apply(null, { length: n });\n}", "title": "" }, { "docid": "7be9fc9a876b83dd04e263d907ac72f8", "score": "0.75182354", "text": "function get_0_array(n) {\n let array = [];\n for (let i = 0; i < n; i++) {\n array.push([]);\n for (let j = 0; j < n; j++) {\n array[i].push(0);\n }\n }\n\n return array;\n}", "title": "" }, { "docid": "4272d1715e1d4ccac12cd16b0ffe3d08", "score": "0.7502035", "text": "function oalloc(n) {\n\tvar o = [];\n\tfor (var i = 0; i < n; i++) {\n\t\to.push({});\n\t}\n\treturn o;\n}", "title": "" }, { "docid": "d386666edb02222f0289915be008353d", "score": "0.73413265", "text": "function newArray(n) {\n\tvar newArray = []\n\tfor (var i = 0; i < n; i++) {\n\t\tnewArray.push(Math.random());\n\t}\n\treturn newArray;\n}", "title": "" }, { "docid": "2661e13d5cae7014366231119b62ebd6", "score": "0.7288423", "text": "function crea_arreglo (n){\n\tvar arreglo = [];\n\tfor (var i = 0; i < n; i++) {\n\t\tarreglo[i] = 0;\n\t}\n\treturn arreglo;\n}", "title": "" }, { "docid": "abba09ae7a3df27efd2c1fe0013cfc5e", "score": "0.7199446", "text": "emptyTiles (n) {\r\n\r\n\t\tlet arr = [];\r\n\r\n\t\tfor(let i = 0; i < n; i++)\r\n\t\t\tarr.push(this.emptyTile());\r\n\r\n\t\treturn arr;\r\n\r\n\t}", "title": "" }, { "docid": "e8a629acde432b9c1bd919dc615dc0e0", "score": "0.7165089", "text": "function makeArray(n){\n//*** BUG: If I put this line in, I get two error messages:\n//(1) Window.length can't be set by assignment\n//(2) daysInMonth has no property indexed by 4\n//If I leave it out, the code works fine.\n// this.length = n;\n for (var i = 1; i <= n; i++){\n this[i] = 0\n } \n return this\n}", "title": "" }, { "docid": "c617556f01d9e5d31b20d325625a8b97", "score": "0.7146851", "text": "createArray(number) {\n var pages = new Array(number);\n for (var i = 0; i < number; i++) {\n pages[i] = i + 1;\n }\n return pages;\n }", "title": "" }, { "docid": "832ddbb2892f2d9de9e71e7d226ff0cb", "score": "0.71294945", "text": "function initArray(length){\n var array = new Array(length);\n for(var i = 0 ; i < length ; i++){\n array[i] = 0;\n }\n return array;\n}", "title": "" }, { "docid": "dc0a7b585147d4a07b08b53db0fddfd4", "score": "0.71128637", "text": "function ex_10_I(a, n){\r\n if ((a && n ) >= 0){\r\n array = [0];\r\n for (i = 0; i < n; i++){\r\n array[i] = a;\r\n }\r\n return array;\r\n }\r\n}", "title": "" }, { "docid": "f4801460de7de8ca4d446f3b5d406d07", "score": "0.71068674", "text": "function createArray(size) {\n\tmyArray = [];\n\tfor(i = 0; i < size; i++){\n\t\tmyArray.push(1);\n\t}\n\treturn myArray;\n}", "title": "" }, { "docid": "b47bd1a52a5db3bf59795b3e1a7dc7f2", "score": "0.70785487", "text": "function newArr(n, x) {\n var arr = new Array(n);\n for(var i = 0; i < n; ++i) {\n arr[i] = x;\n }\n return arr;\n}", "title": "" }, { "docid": "b47bd1a52a5db3bf59795b3e1a7dc7f2", "score": "0.70785487", "text": "function newArr(n, x) {\n var arr = new Array(n);\n for(var i = 0; i < n; ++i) {\n arr[i] = x;\n }\n return arr;\n}", "title": "" }, { "docid": "b47bd1a52a5db3bf59795b3e1a7dc7f2", "score": "0.70785487", "text": "function newArr(n, x) {\n var arr = new Array(n);\n for(var i = 0; i < n; ++i) {\n arr[i] = x;\n }\n return arr;\n}", "title": "" }, { "docid": "b47bd1a52a5db3bf59795b3e1a7dc7f2", "score": "0.70785487", "text": "function newArr(n, x) {\n var arr = new Array(n);\n for(var i = 0; i < n; ++i) {\n arr[i] = x;\n }\n return arr;\n}", "title": "" }, { "docid": "8c77ea9e9e37a00bb56c8735d0569913", "score": "0.7063808", "text": "function newArr(n, x) {\n var arr = [];\n for(; n >= 0; --n) {\n arr.push(x);\n }\n return arr;\n}", "title": "" }, { "docid": "8c77ea9e9e37a00bb56c8735d0569913", "score": "0.7063808", "text": "function newArr(n, x) {\n var arr = [];\n for(; n >= 0; --n) {\n arr.push(x);\n }\n return arr;\n}", "title": "" }, { "docid": "cf95bb7cff2701cbbef5a08b565ca4d8", "score": "0.7059968", "text": "function arrInit() {\n let arr = [];\n for (let i = 0; i < 99; i++) {\n arr[i] = i + 1;\n }\n return arr;\n}", "title": "" }, { "docid": "e5c1c9b0f3adbe1a37857b4a0c74781e", "score": "0.70006615", "text": "function array(t){for(i=0;i<t;i++)this[i]=0;this.length=t}", "title": "" }, { "docid": "a22fe1cd476d9194ffe4f6cd3ad8a5c2", "score": "0.69758344", "text": "function arr(N){\n let result = []\n for(let i=0; i<N; i++){\n result.push(i)\n }\n return result\n}", "title": "" }, { "docid": "a19aa426315fb53f1b75329fadf7ee93", "score": "0.69662315", "text": "function buildArray(n) {\n var arr = [];\n\n for (var i = 0; i < n; i++) {\n arr = [Math.floor(Math.random() * n)].concat(arr);\n }\n\n return arr;\n}", "title": "" }, { "docid": "a19aa426315fb53f1b75329fadf7ee93", "score": "0.69662315", "text": "function buildArray(n) {\n var arr = [];\n\n for (var i = 0; i < n; i++) {\n arr = [Math.floor(Math.random() * n)].concat(arr);\n }\n\n return arr;\n}", "title": "" }, { "docid": "30412b078d463c903113477c3e39b1b6", "score": "0.6944103", "text": "function integerArray(n) {\n\tvar arr = new Array();\n\tfor (var i=0; i < n; i++) {\n\t\tarr[arr.length] = i;\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "d166c55ef6a4fd4a248ead7491b41b27", "score": "0.6916923", "text": "function helper(n) {\n let result = [];\n\n}", "title": "" }, { "docid": "89198cd87c8f4e874d062265ac5953ec", "score": "0.68892366", "text": "function array_fill(i, n, v) {\n var a = [];\n for (; i < n; i++) {\n a.push(v);\n }\n return a;\n}", "title": "" }, { "docid": "89c32661007de837282635446b1e745e", "score": "0.68798226", "text": "function makeXArr(num) {\n\tconst newArray2 = [];\n\tfor (let j = 0; j < num; j++) {\n\t\tnewArray2.push(null);\n\t}\n\treturn newArray2;\n}", "title": "" }, { "docid": "6a3c7c28b675bea460dc093c58abe2d4", "score": "0.6859062", "text": "function createArrayNoDups(num){\r\n let result = []\r\n \r\n for(let i = 0; i < num; i++){\r\n result.push(i);\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "2c83dd517fe98e0a4ce66bd872c7815c", "score": "0.6838634", "text": "function arrayOfHiNTimes(n) {\n const hiArray = [];\n for (let i = 0; i < n; i++) {\n hiArary[i] = 'hi';\n }\n return hiArray;\n}", "title": "" }, { "docid": "e93da010b9bfbf31fbe40f20f86e69b4", "score": "0.6837874", "text": "function arrayOfHiNTimes(n) {\n var hiArray = [];\n for (let i = 0; i < n; i++) {\n hiArray[i] = 'hi';\n }\n return hiArray;\n}", "title": "" }, { "docid": "761b186bfa9859e734e9af5ae14c696e", "score": "0.681621", "text": "function n(){this.__data__=[],this.size=0}", "title": "" }, { "docid": "521ab90015a49a97316380cd61611789", "score": "0.6809695", "text": "function randFillArray(n) {\n var temp = [];\n\n for (var i = 0; i < n; i++) {\n temp[i] = Math.floor(Math.random() * 100 + 1);\n }\n\n return temp;\n}", "title": "" }, { "docid": "521ab90015a49a97316380cd61611789", "score": "0.6809695", "text": "function randFillArray(n) {\n var temp = [];\n\n for (var i = 0; i < n; i++) {\n temp[i] = Math.floor(Math.random() * 100 + 1);\n }\n\n return temp;\n}", "title": "" }, { "docid": "2835215592eeaf9f40cb0d996acda85b", "score": "0.67957824", "text": "function arrayOfHiNTimes(n){\n let hiArray = []\n for (let index = 0; index < n; index++) {\n hiArray[index] = 'hi'\n }\n return hiArray\n}", "title": "" }, { "docid": "641b9b4e3f10565e3e74852f565fa081", "score": "0.67701346", "text": "function specificNumberOfItems(n, p) {\n var array = [];\n for (var i = 0; i < n; i++) {\n if (p === undefined) {\n array[i] = null;\n } else {\n array[i] = p;\n }\n }\n return array;\n}", "title": "" }, { "docid": "1982f16493417c2787b5d94e620b37ed", "score": "0.67532253", "text": "function arrayofHis(n){\n let hiArray = []; // variable & data structure\n for(let i=0; i < n; i++){\n hiArray.push('Hi')\n }\n return hiArray;\n}", "title": "" }, { "docid": "e012265ad1fb175e56798b8e729d73bc", "score": "0.67447597", "text": "function newGrid() {\n return new Array(10).fill(null).map(() => new Array(10).fill(0))\n}", "title": "" }, { "docid": "0ecdc7514e556e1522bd743df0bfcd61", "score": "0.6726999", "text": "function ArrayPush(){\n\tfor(var i = 1; i <= 100; i++){\n\t\temptyArray.push(i);\n\t}\n}", "title": "" }, { "docid": "7b3e51bd8478e3ebdb1baba1cd53ddbd", "score": "0.6721479", "text": "function newShipArray() {\n return new Array(10).fill(0)\n}", "title": "" }, { "docid": "802384125251c57af7bcd0da14afebb9", "score": "0.6712781", "text": "function get_ordered_array(n_items) {\n return Array(Math.floor(n_items)).fill().map((_, index) => index);\n }", "title": "" }, { "docid": "ca76fbae36e4d6c4cf8a392e0970a505", "score": "0.6704909", "text": "function build_array(n, fun) {\n var result = [];\n for(var i = 0; i < n; i++) {\n result[i] = fun(i);\n }\n return result;\n}", "title": "" }, { "docid": "88caaf0b3d69532f92e6ea2d83c44b39", "score": "0.66548103", "text": "function range(n) {\r\n let out = [];\r\n for(let i = 0; i < n; i++)\r\n out.push(i);\r\n return out;\r\n}", "title": "" }, { "docid": "291ec68bc4f36aee5c67478b4aa0e9f5", "score": "0.6641328", "text": "function createArray() {\n this.array = { };\n this.index = 0;\n}", "title": "" }, { "docid": "54d38ede646fb839617a0313b9732e32", "score": "0.6618904", "text": "function initial(array, n, guard) {\n return _setup.slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}", "title": "" }, { "docid": "359deb00a74f9920061d2bfe179506f8", "score": "0.6585366", "text": "nth(n) { return []; }", "title": "" }, { "docid": "527b7e540cc7334c02e7ab13579bf7fd", "score": "0.6573857", "text": "function initial(array, n, guard) {\n return _setup_js__WEBPACK_IMPORTED_MODULE_0__[\"slice\"].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}", "title": "" }, { "docid": "977a24aa75e20dd32d2e0e234a5413e3", "score": "0.65727305", "text": "function createEmptyMatrix(n) {\n var matrix = [];\n for (var i = 0; i < n; i++) {\n var row = [];\n for (var j = 0; j < n; j++) {\n row.push(0);\n }\n matrix.push(row);\n }\n return matrix;\n }", "title": "" }, { "docid": "b63c70a7bbdfc9e4a9ea6515c5b3d6f9", "score": "0.6571884", "text": "function createArr(num) {\n const myArr = [];\n for (let i = 1; i <= num; i++) {\n myArr.push(i);\n }\n return myArr;\n}", "title": "" }, { "docid": "2e28ef6bef9cee6b584df723f75dd474", "score": "0.65665555", "text": "function greatGrowingList(n) {\n array = []\n for(counter=1; counter <= n; counter++) {\n array.push(counter)\n }\n console.log(array)\n }", "title": "" }, { "docid": "55e21f722dd17d19d9ca03e9638fc860", "score": "0.65604776", "text": "function generateRandomArray(n){\n\tlet arr = []\n\tfor(i=0;i<n;i++){\n\t\tarr[i]=getRandomInt(1, n+1);\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "ec770f13baed39bca6625c7a700beee1", "score": "0.65604556", "text": "function createArray(length) {\r\n var arr = new Array(length || 0),\r\n i = length;\r\n\r\n arr.fill(\"\");\r\n\r\n if (arguments.length > 1) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n while (i--) arr[length - 1 - i] = createArray.apply(this, args);\r\n }\r\n\r\n return arr;\r\n }", "title": "" }, { "docid": "bf1e797f44e18184d573f244a049896a", "score": "0.65577847", "text": "function initialize() { \n arr = [];\n // create the boxes of the given length\n for (let i = 0; i < num_of_box; i++) {\n arr.push(i);\n }\n }", "title": "" }, { "docid": "12da4e43171e3054b004f4946dc659cb", "score": "0.655592", "text": "function zeroes(n) {\n var i = -1,\n a = [];\n if (arguments.length === 1) while (++i < n) {\n a[i] = 0;\n } else while (++i < n) {\n a[i] = zeroes.apply(this, Array.prototype.slice.call(arguments, 1));\n }\n return a;\n }", "title": "" }, { "docid": "7b02e137bd51b1fee669742bd527832a", "score": "0.6546554", "text": "function randomNumbers(n, callback) {\n let arr = new Array(n)\n\n // this also works\n /*\n let arr = []\n\n arr.length = n\n */\n\n // or\n /*\n let arr = []\n let i\n for (i = 0; i < n; i++) {\n arr.push(i)\n }\n */\n\n return callback(arr)\n}", "title": "" }, { "docid": "5c45313f941bb6ad99fdcebc50271722", "score": "0.65405315", "text": "function nestedArrayMaker(emptyArray, amount){\n for(i = 1; i <= amount; i++){\n emptyArray.push([]);\n }\n}", "title": "" }, { "docid": "c618d9102a3b34d645bb57b1a90dde2e", "score": "0.65380263", "text": "function createArray(size, data) {\r\n var ret = [];\r\n for(var i=0; i<size; i++) {\r\n ret.push(data(i));\r\n }\r\n return ret;\r\n }", "title": "" }, { "docid": "b2dcd93db8e4cee08ee7736d94cddb63", "score": "0.6530743", "text": "function createArr(numOf,elem) {\n if (elem === undefined) {\n elem = null;\n }\n var arrOfElem = [];\n var i = 0;\n while (i < numOf) {\n arrOfElem[i] = elem;\n i++; \n }\n return arrOfElem;\n}", "title": "" }, { "docid": "e586fd37b4852144135bdfaa06f04011", "score": "0.65228605", "text": "function initArrayIndices(count) {\r\n var a = new Array(count);\r\n for (var i = 0; i < count; i++) {\r\n a[i] = null;\r\n }\r\n return a;\r\n}", "title": "" }, { "docid": "bfcdf9d36d12f661aef3c53054355bbf", "score": "0.6506667", "text": "function makeArray(l){var a=new Array(l+2);a[0]=a[1]=0;return a;}", "title": "" }, { "docid": "bfcdf9d36d12f661aef3c53054355bbf", "score": "0.6506667", "text": "function makeArray(l){var a=new Array(l+2);a[0]=a[1]=0;return a;}", "title": "" }, { "docid": "bfcdf9d36d12f661aef3c53054355bbf", "score": "0.6506667", "text": "function makeArray(l){var a=new Array(l+2);a[0]=a[1]=0;return a;}", "title": "" }, { "docid": "bfcdf9d36d12f661aef3c53054355bbf", "score": "0.6506667", "text": "function makeArray(l){var a=new Array(l+2);a[0]=a[1]=0;return a;}", "title": "" }, { "docid": "c13d2a2b1f1f1e34a35629fddac3d185", "score": "0.6478878", "text": "function initArray(size, fillValue) {\n let arr = [];\n\n for (let i = 0; i < size; i++) {\n arr.push(fillValue);\n }\n\n return arr;\n}", "title": "" }, { "docid": "b373cc30cfeff5b04f5b6d9298927bc7", "score": "0.64768505", "text": "generateInitialData(count) {\n return Array\n .apply(null, {length: count})\n .map(this.randomNumStringArray)\n }", "title": "" }, { "docid": "24c2398dd5789d6556943da660941b19", "score": "0.6475847", "text": "function arrayFilled(num, value) {\n var result = [];\n if (typeof num != \"number\") {\n num = 0\n }\n for (var i = 0; i < num; i++) {\n result[i] = value;\n }\n return result;\n}", "title": "" }, { "docid": "76a2e5a26db72539319805e74b9cc1b9", "score": "0.64563644", "text": "function createArray(lenght) {\n console.log(\"Create an array with \" + lenght + \" element !!!\");\n}", "title": "" }, { "docid": "6b6112e334c5c4c71cb48f9374ea3342", "score": "0.6451293", "text": "function createArray()\n{\n var moves = new Array(10);\n\n for (var i = 0; i < moves.length; i++) {\n moves[i] = new Array(10);\n }\n moves = initalizeArray(moves);\n return moves;\n}", "title": "" }, { "docid": "f751ab66bd03df54fe711522797e6fbb", "score": "0.6446907", "text": "function maker() {\n var arr = [];\n for (var i = 1; i < 216; i++) {\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "a935ede19c94a1a1a9cb228ec7713ef2", "score": "0.64297915", "text": "function createEmptyPIDMatrix(n) {\n var matrix = [];\n for (var i = 0; i < n; i++) {\n var row = [];\n for (var j = 0; j < n; j++) {\n row.push([]);\n }\n matrix.push(row);\n }\n return matrix;\n\n }", "title": "" }, { "docid": "b2a7cc7688ee85015e3b210fd3f67962", "score": "0.6422542", "text": "function createEmptyGridArray(size)\n{\n var newGrid new Array();\n for (var x = 0; x < size; x++)\n {\n newGrid[x] = new Array();\n for (var y = 0; y < size; y++)\n {\n newGrid[x][y] = 0;\n }\n }\n return newGrid;\n}", "title": "" }, { "docid": "77e223d60a6f3ffd75ee28dc05900650", "score": "0.63952917", "text": "function enumerate_array (n) {\n result = new Array ();\n\n for(var i = 1; 1<= n; i++) {\n\tresult.push(i);\n\n }\n\n\n // do stuff\n return result;\n}", "title": "" }, { "docid": "3c8def63c5d0efae2fd33e0e43c10e8d", "score": "0.6390082", "text": "function createDataArray(ntrials) {\n\n var Data = new Array(ntrials);\n for (var i=0; i<ntrials; i++) {\n Data[i] = new Array();\n for (var j=0; j<2; j++) {\n Data[i][j] = new Array(6).fill('#');\n }\n }\n return Data;\n}", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.63856614", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.63856614", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "8e3813cf73c156ec016e978f0c334923", "score": "0.6377162", "text": "function zerodArray( size ) {\n\t\t\tvar data = new Array( size );\n\n\t\t\tfor ( var i = 0; i < size; i++ ) {\n\t\t\t\tdata[ i ] = 0;\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}", "title": "" }, { "docid": "d954b1d4e1e1292ed45751aa45a78c93", "score": "0.63771355", "text": "function _createUniverse() {\n return Array.apply(null, new Array(512)).map(Number.prototype.valueOf, 0);\n}", "title": "" }, { "docid": "9f839238872d4b01720dd2cbf1f64d7f", "score": "0.6370563", "text": "function arrayWithoutRepeat() {\n let arr = [];\n\n // This for loop generates random numbers without CHECK\n for (let i = 0; i < 3; i++) {\n arr.push(randNum());\n }\n usedImgs = arr;\n return arr;\n}", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.63640213", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" } ]
81c543fdfb065a085316d6682c5e9267
run forEach so that renderPoke function later isn't looking for an array
[ { "docid": "67ab087463fd5a0916f7795769ca6147", "score": "0.0", "text": "function init() {\n getPokemons() //add this here so that getPokemons is being called\n pokeForm.addEventListener(\"submit\", createPoke);\n}", "title": "" } ]
[ { "docid": "35bd08f52b9ef09c0523ee1dc93b44b3", "score": "0.5803121", "text": "function displayAllPokemon() {\n for (let i = 0; i < PokemonArray.length; i++) {\n\n let name = PokemonArray[i]['name'];\n let id = PokemonArray[i]['id'];\n let img = PokemonArray[i]['sprites']['front_default'];\n BuildPokemonDetails(name, id, img);\n document.getElementById('pokemonListContainer').innerHTML += Pokemondetails;\n }\n}", "title": "" }, { "docid": "eed168dcd52507ed8c72f52b0bc7c015", "score": "0.5751331", "text": "function pokeCheck(p){\n let check = false;\n pokemonList.forEach(function(el){\n if (p === el){\n check = true;\n }\n })\n return check\n}", "title": "" }, { "docid": "fc1ce5005431faa4763cf377490427cc", "score": "0.57406336", "text": "loopTrytes() {\n this.getBundleTrytes(this.trytes[this.index]).then(() => {\n this.index++;\n if (this.index < this.trytes.length) {\n try {\n this.loopTrytes();\n } catch (err) {\n throw err;\n }\n } else {\n this.finishedPoW = true;\n }\n }).catch((err) => {\n throw err;\n });\n }", "title": "" }, { "docid": "1a4e5f5746a76d13c8df598f4dcbc86c", "score": "0.5692609", "text": "function gotPoses(results) {\n poses = results;\n}", "title": "" }, { "docid": "45aa0cd4c2daa9c782c9bdcfd3953614", "score": "0.5669627", "text": "function pickPokemon() {\n\n userStats.forEach(function(val, i){\n let num = Math.random()\n let pokemon = pokemonTeam[val][Math.floor(num * pokemonTeam[val].length)];\n\n //pokemonList.indexOf(pokemon) === -1 ? pokemonList.push(pokemon) : pickPokemon();\n if(pokemonNumInList < 6){\n addOrNot(pokemon)\n }else{\n pokemonList.forEach(function(el,i){\n pokemonDis[i].style.background = `url(pokemon-images/${el}.jpg)`\n })\n }\n })\n\n}", "title": "" }, { "docid": "ac7282bdace2e16fb87752c260ea1957", "score": "0.565687", "text": "async function getPokemon(num) {\n let pokemonArray = []\n $cardGroup.html('');\n\n while (pokemonArray.length < num) {\n try {\n let pokemon = await axios.get(\n `https://pokeapi.co/api/v2/pokemon/${get_rand_num()}`\n );\n\n pokemonArray.push(pokemon);\n\n } catch (e) {\n console.log(\"pokemon not found\") }\n }\n\n console.log(pokemonArray);\n let pokeSpecies = pokemonArray.map(p => p.data.species)\n let nameAndFlavorText = await getFlavorText(pokeSpecies);\n \n\n for (let index in pokemonArray) {\n let img = pokemonArray[index].data.sprites.front_default;\n let name = nameAndFlavorText[index][0];\n let flavorText = nameAndFlavorText[index][1];\n\n $cardGroup.append(`<div class=\"card\">\n <img src=\"${img}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" >${name}</h5>\n <p class=\"card-text\" > ${flavorText}</p>\n </div>`);\n\n\n\n }\n\n //console.log(pokeNames)\n\n \n}", "title": "" }, { "docid": "6b12325ea09b21660eefc47b680b845a", "score": "0.5628389", "text": "async function renderPokemonInfo() {\n let offsetValue = offset - 1;\n for (let i = offsetValue; i < allPokemons.length; i++) {\n renderPokemonCards(i);\n pokemonInfo(i);\n loadStats(i);\n renderPokemonTypes(i);\n }\n}", "title": "" }, { "docid": "92bcfa42ae9ecf8c7dcaf474ab561386", "score": "0.562218", "text": "render() {\n return (\n <div>\n {this.props.pokemon\n .map(pkm => (\n <Pkm\n key={pkm.box * 30 + pkm.slot}\n pkm={pkm}\n language={this.props.language}\n filterFunction={this.props.filterFunction}\n format={this.props.format}\n local={this.props.local}\n />\n ))\n .cacheResult()}\n </div>\n );\n }", "title": "" }, { "docid": "2ec979b7ca259077b0d8bef392f9d25b", "score": "0.56163037", "text": "function showPokeDom(pokeData) {\n \n let pokeArr = new Array(pokeData);\n let pokeName = pokeData.name[0].toUpperCase() + pokeData.name.slice(1);\n\n pokeArr.forEach(poke => {\n const cardContainer = document.createElement('div');\n cardContainer.className = 'card-container';\n cardContainer.innerHTML = \n `<div class=\"card\">\n <img src=\"https://pokeres.bastionbot.org/images/pokemon/${poke.id}.png\" alt=\"\" class=\"card-img\">\n </div> \n <div class=\"card-details\">\n <p class=\"pokemon-id\">#${poke.id}</p>\n <h4 class=\"pokemon-name\">${pokeName}</h4>\n <div class=\"pokemon-types\">\n ${poke.types.map(type => {\n switch(type.type.name) {\n case 'grass': \n return '<span class=\"poke-type grass\">' + type.type.name + '</span>' \n case 'poison':\n return '<span class=\"poke-type poison\">' + type.type.name + '</span>'\n case 'fire':\n return '<span class=\"poke-type fire\">' + type.type.name + '</span>'\n case 'flying':\n return '<span class=\"poke-type flying\">' + type.type.name + '</span>'\n case 'water':\n return '<span class=\"poke-type water\">' + type.type.name + '</span>'\n case 'bug':\n return '<span class=\"poke-type bug\">' + type.type.name + '</span>'\n case 'normal':\n return '<span class=\"poke-type normal\">' + type.type.name + '</span>'\n case 'electric':\n return '<span class=\"poke-type electric\">' + type.type.name + '</span>'\n case 'ground':\n return '<span class=\"poke-type ground\">' + type.type.name + '</span>'\n case 'fairy':\n return '<span class=\"poke-type fairy\">' + type.type.name + '</span>'\n case 'fighting':\n return '<span class=\"poke-type fighting\">' + type.type.name + '</span>'\n case 'psychic':\n return '<span class=\"poke-type psychic\">' + type.type.name + '</span>'\n case 'rock':\n return '<span class=\"poke-type rock\">' + type.type.name + '</span>'\n case 'steel':\n return '<span class=\"poke-type steel\">' + type.type.name + '</span>'\n case 'ice':\n return '<span class=\"poke-type ice\">' + type.type.name + '</span>'\n case 'dragon':\n return '<span class=\"poke-type dragon\">' + type.type.name + '</span>'\n } \n }).join(\"\")}\n </div> \n </div>`\n \n container.appendChild(cardContainer); \n\n });\n}", "title": "" }, { "docid": "d78f2023b633237429a227e54091bc9b", "score": "0.55929464", "text": "function gottaFetchEmAll(){\n fetch(\"http://localhost:3000/pokemon/\")\n .then(res => res.json() )\n .then(pokeArray => {\n //pokeArray is our array of pokemons\n //iterate through it, and for each pokemon\n //render it to the DOM\n pokeArray.forEach( (pokemon)=>{renderOnePokemon(pokemon)} )\n\n // pokeArray.forEach( renderOnePokemon )\n\n //.forEach(p => {console.log(p) })\n //forEach takes a function: has a param, does something with param\n\n //.then(console.log)\n //.then( (param) => {does something with the param } )\n })\n}", "title": "" }, { "docid": "795c610507db76e326642ab876c4e7d9", "score": "0.5563026", "text": "function renderPokemon () {\n if (Pokemon === \"\") {\n return \"\"\n } else {\n return Pokemon.map((P,i) => (\n <h1 key = {i} >Name: { P.name } URL: { P.url }</h1>\n )) \n }\n}", "title": "" }, { "docid": "26eb75a2594b71a1658fc4508b747529", "score": "0.5543469", "text": "async function pokeCall() {\n\n // showLoadingScreen();\n\n const response = await axios.get('https://pokeapi.co/api/v2/pokemon/', { params: { limit: 151 }});\n const pokeList = response.data.results;\n\n let count = 1;\n for (let pokemon of pokeList) {\n pokemonObjects.push({\n id: count,\n name: pokemon.name\n });\n\n count++;\n }\n\n for (let pokemon of pokemonObjects) {\n const specResponse = await axios.get(`https://pokeapi.co/api/v2/pokemon/${pokemon.id}/`);\n const sprite = specResponse.data.sprites.front_default;\n const primaryType = specResponse.data.types[0].type.name;\n let secondaryType;\n \n if (specResponse.data.types[1]) {\n secondaryType = specResponse.data.types[1].type.name;\n }\n\n const stats = createStatsObject(specResponse.data.stats);\n\n pokemon['types'] = { primaryType, secondaryType };\n pokemon['sprite'] = sprite;\n pokemon['stats'] = stats;\n }\n\n generatePokemonCards();\n\n hideLoadingScreen();\n\n console.log(pokemonObjects)\n}", "title": "" }, { "docid": "9830a0537f72d6b62c430dcb459c7690", "score": "0.5534806", "text": "render() {\n return (\n <div>\n {this.props.idsPokemons.map(idPokemon =>\n <Pokemon idPokemon={idPokemon} key={idPokemon} />\n )}\n </div>\n );\n }", "title": "" }, { "docid": "528a44c7d42665d31151224d1ab4b36c", "score": "0.55330336", "text": "function underPokemonLeague(numOfPokemon){\n\tfor(let i = 0; i < numOfPokemon; i++)\n\tconsole.log(\"Pikachu, I choose you!\")\n}", "title": "" }, { "docid": "cce96902d0c7af37ddf1211c339c932d", "score": "0.5518537", "text": "drawAllItems() {\n this.gs.clearRect(0, 0, this.gameScreen.width, this.gameScreen.height)\n this.player.draw(this.gs)\n this.coffeeCups.forEach((elem) => elem.draw(this.gs)) // empy array at start\n this.labBooks.forEach((elem) => elem.draw(this.gs)) // empy array at start\n }", "title": "" }, { "docid": "0789d0f1c3a67a40aa3542be9721fec6", "score": "0.5516673", "text": "function displayPokemon(pokemon, allPokemon){\n // console.log(pokemon);\n let pokeString = `\n <div class=\"pokemon-container\">\n <div class=\"poke-card\">\n <div class=\"front-content\">\n <div class=\"image-section\">\n <img src=\"https://pokeres.bastionbot.org/images/pokemon/${pokemon.id}.png\" alt=\"${pokemon.name}\"\n <p>#${pokemon.id}</p>\n <h1>${pokemon.name}</h1>\n </div>\n <div class=\"types-section\" id=\"types-section\" data-types=\"${pokemon.types}\"></div>\n </div>\n <div class=\"back-content\">\n <div class=\"stats-list\">\n <div class=\"stat-value\">\n <span>${pokemon.stats[0].name}</span>\n <span>${pokemon.stats[0].value}</span>\n </div>\n <div class=\"stat-value\">\n <span>${pokemon.stats[1].name}</span>\n <span>${pokemon.stats[1].value}</span>\n </div>\n <div class=\"stat-value\">\n <span>${pokemon.stats[2].name}</span>\n <span>${pokemon.stats[2].value}</span>\n </div>\n <div class=\"stat-value\">\n <span>${pokemon.stats[3].name}</span>\n <span>${pokemon.stats[3].value}</span>\n </div>\n <div class=\"stat-value\">\n <span>${pokemon.stats[4].name}</span>\n <span>${pokemon.stats[4].value}</span>\n </div>\n <div class=\"stat-value\">\n <span>${pokemon.stats[5].name}</span>\n <span>${pokemon.stats[5].value}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n `\n pokeStr.push({\n html: pokeString,\n pokeName: pokemon.name\n })\n\n pokemonHolder.innerHTML += pokeString\n // count keeps track of the displayPokemon() method call\n count++\n\n if(count === allPokemon){\n // code to get type buttons in the UI \n const typeSection = document.querySelectorAll('#types-section')\n // console.log(typeSection);\n\n typeSection.forEach(card => {\n let types = card.getAttribute('data-types').split(',')\n // console.log(types);\n types.forEach(type => {\n card.innerHTML += `\n <button class=\"type ${type}\">${type}</button>\n `\n })\n })\n }\n}", "title": "" }, { "docid": "6608e45a39c8ee2bba5d8cd44e0c496b", "score": "0.54992396", "text": "function imprimirP1(){\n var valor1=document.getElementById(\"play1\").value;\n var mostrar1=document.getElementById(\"imp1\");\n\n\n pokeDex.forEach(function(valor){\n \tif (valor1==valor.nombre){\n \t\treturn mostrar1.innerHTML=valor.mostrarPokemon();\n \t}else{\"Escoge un pokemon\"}\n \t\n });\n \n}", "title": "" }, { "docid": "e8994dd4f3707ead1c5ca06da893d4cc", "score": "0.54820955", "text": "function printBoard() {\n var printedBoard = game.pegs.map(function (peg) {\n return \" --- \" + peg.join('');\n });\n\n printedBoard.forEach(function (i) {\n console.log(i);\n\n });\n}", "title": "" }, { "docid": "47f52f87b76178d4a508917b4127bf90", "score": "0.5451909", "text": "render(){\n return(\n <div className='pokemon-container'>\n {this.renderPoke()}\n </div>\n ) //end of return\n }", "title": "" }, { "docid": "b4d574a9d9a2c2415acc06592cc35ac5", "score": "0.54439", "text": "function displayPokebros() {\n background(147, 176, 204);\n\n fill(70, 108, 145);\n noStroke();\n for (let x = width * 0.07; x < width * 0.7; x += ((width/2) * 0.9)) {\n for (let y = height * 0.075; y < height * 0.8; y += ((height/3) * 0.9)) {\n rect(x, y, (width/2) * 0.85, (height/3) * 0.75, 10); //drawing out the rectangles in which the pokemons will be displayed\n }\n }\n if (canLeaveTown(lilFlexTown)) { //displays your pokemon is you have any\n showPokebros();\n }\n}", "title": "" }, { "docid": "889c76752f286d69930faf20bd0f125d", "score": "0.54230386", "text": "function updatepeeps(pips) {\n players = [];\n\n pips.forEach((pip, i) => {\n let blobs = [];\n\n // this for taking all the blobs from pip and store it in this variable\n if (pip.isitok) {\n pip.blobs.forEach(blob => {\n blobs.push(new Blob(pip.nickname,\n blob.x,\n blob.y,\n blob.r,\n pip.c));\n });\n\n }\n\n // this funktion for updaing/creeting player in the players list\n // with the same indax\n players[i] = new Player(pip.id, pip.nickname);\n players[i].isitshown = pip.isitok;\n\n\n // this askes if the player is within my range\n if (pip.isitok) {\n players[i].lvl = pip.lvl;\n blobs.forEach((blob, k) => {\n let oldr = blob.r;\n if (players[i].blobs[k]) {\n oldr = players[i].blobs[k].r;\n }\n players[i].blobs[k] = blob;\n players[i].blobs[k].r = oldr;\n if (players[i].blobs[k]) {\n players[i].blobs[k].setrad(blob.r);\n }\n })\n }\n // this asks wether this player is me\n if (socket.id === pip.id) {\n player = players[i];\n player.blobs = players[i].blobs;\n player.lvl = players[i].lvl\n indexofplayer = i;\n }\n });\n\n}", "title": "" }, { "docid": "3252745a1d2224ea2fa45b337b41ba49", "score": "0.542007", "text": "run(){\r\n \r\n //loop through the particle system\r\n for (let i = 0; i < particles.length; i++){\r\n \r\n push();\r\n \r\n translate(width/2.5, height/2);\r\n let particle = particles[i];\r\n particle.show();\r\n particle.move();\r\n \r\n pop();\r\n // remove dead particles\r\n if (particle.isDead()){\r\n particles.splice(i);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "396b32a8acad357a2628a898fc573254", "score": "0.5403683", "text": "renderAll() {\n this.letterArray.forEach(function (elem) {\n elem.render();\n });\n this.renderGameData();\n }", "title": "" }, { "docid": "8a9a75dc5eb33e7152977945bf4c1b89", "score": "0.53940785", "text": "function grabPokemon(datas) {\n const pokemon = datas.map((data) => getPokemon(data));\n return pokemon;\n}", "title": "" }, { "docid": "5db23af98ed1745d6ff9aa61eb7744c1", "score": "0.53729254", "text": "function drawSnake(){\n snake.forEach(drawSnakeBody);\n}", "title": "" }, { "docid": "97674fd62e077d2d8b5ebebc15d1b883", "score": "0.53616863", "text": "function displayPokemon() {\n pokemonContainer.innerHTML = '';\n let searchTerm = pokemonSearch.value;\n let arr = [];\n\n for (var i in store) {\n if (store[i].name.includes(searchTerm)){\n arr.push(store[i]);\n }\n }\n\n arr.forEach(function(pokemon){\n pokemonContainer.innerHTML += pokemon.render();\n })\n\n const foundPokemon = pokemonContainer.getElementsByClassName('flip-image')\n let foundPokemonArr = Array.from(foundPokemon)\n\n foundPokemonArr.forEach(function(pokemon) {\n pokemon.addEventListener('click', flipImage.bind(pokemon))\n })\n }", "title": "" }, { "docid": "e91d022b026121ab645a5cda8de2152e", "score": "0.5340705", "text": "printAllLetterArray() {\n console.log(\"--------printing letter arrays --------------------------\")\n this.letterArray.forEach(peram => {\n console.log(\"-------------------\")\n console.log(peram.letter)\n console.log(peram.hidden)\n console.log(peram.ID)\n });\n console.log(\"--------Finished printing letter arrays --------------------------\")\n }", "title": "" }, { "docid": "b30de3270c1fac99a8e5ea2c9a76d673", "score": "0.53294903", "text": "function makePokemonQuestions(arrPokemonNames, pokeIndex){\n var pokeQuestions = [\n {\n question: \"Which pokemon evolves into Raichu?\",\n A: arrPokemonNames[0],\n B: arrPokemonNames[4],\n C: arrPokemonNames[6],\n D: arrPokemonNames[8],\n }, {\n question: \"Which pokemon can use flamethrower?\",\n A: arrPokemonNames[2],\n B: arrPokemonNames[5],\n C: arrPokemonNames[17],\n D: arrPokemonNames[19],\n }, {\n question: \"Which pokemon is famous for singing in the show?\",\n A: arrPokemonNames[18],\n B: arrPokemonNames[7],\n C: arrPokemonNames[10],\n D: arrPokemonNames[11],\n }, {\n question: \"Which pokemon looks like a cobra?\",\n A: arrPokemonNames[3],\n B: arrPokemonNames[2],\n C: arrPokemonNames[14],\n D: arrPokemonNames[16],\n }, {\n question: \"Which pokemon can fly?\",\n A: arrPokemonNames[17],\n B: arrPokemonNames[12],\n C: arrPokemonNames[13],\n D: arrPokemonNames[1],\n }\n ];\n \n questionEl.textContent = pokeQuestions[pokeIndex].question;\n choiceA.textContent = pokeQuestions[pokeIndex].A;\n choiceB.textContent = pokeQuestions[pokeIndex].B;\n choiceC.textContent = pokeQuestions[pokeIndex].C;\n choiceD.textContent = pokeQuestions[pokeIndex].D;\n console.log(\"sjhdkjshkdjh\")\n console.log(pokeQuestions)\n}", "title": "" }, { "docid": "79bd9e862e5f3fa787d1f36586eda3d1", "score": "0.5323872", "text": "function processAITurn(){\n\tvar emptySquares = [];\n\tvar square;\n\tgameSquareArray.forEach(function(item){\n\t\tif(!item.touched){\n\t\t\temptySquares.push(item);\n\t\t}\n\t});\n\n\tsquare = emptySquares[Math.floor(Math.random() * emptySquares.length)];\n\tsquare.innerHTML = \"O\";\n\tsquare.touched = true;\n}", "title": "" }, { "docid": "2268c7c504f801e4df264f302cd0e884", "score": "0.5311802", "text": "function drawSnake() { \n snake.forEach(drawSnakePart);\n}", "title": "" }, { "docid": "c1ac058a844f465ab208ab6d91c14dc3", "score": "0.5307952", "text": "displayPois(pois) {\n if (!pois || !pois.length) {\n this.clearMarkersLayer()\n } else {\n // Get new Marker Type by checking one new POI.\n const {markerType} = pois[0]\n const shouldClearAllMarkers =\n markerType !== this.markerManager.currentMarkerType\n\n // If we render a new type of Marker, then we need to clear all Markers.\n shouldClearAllMarkers && this.clearMarkersLayer()\n\n // Get current array of map Markers.\n const currentMarkers = this.layerManager.getLayers(\n this.layerManager.layers.markers\n )\n\n // To prevent repaint all POIs that are already visible, get the news to Add and the ones to be Removed.\n const pointsToAdd = this.getPositiveDiffOfArraysOfPoints({\n pois,\n currentMarkers\n })\n const pointsToDelete = this.getPositiveDiffOfArraysOfPointsAux({\n currentMarkers,\n pois\n })\n const pointsAreClickable = markerType > 0\n\n // Keep the current lat/lng of a POI that is going to be repaint due to selection with a new random lat/lng.\n // In order to prevent that POIs change its lat/lon for de-clusterized properties.\n // markerType > 0 means that POIs are clickable, so they can be selected, and for instance, repaint.\n pointsToDelete.length &&\n pointsAreClickable &&\n pointsToAdd.forEach(pointToAdd => {\n const pointToRefresh = pointsToDelete.find(\n pointToDelete => pointToDelete.Id === pointToAdd.Id\n )\n\n if (pointToRefresh) {\n pointToAdd.latitude = pointToRefresh._latlng.lat\n pointToAdd.longitude = pointToRefresh._latlng.lng\n }\n })\n\n // Set new markerType (0, 1, 2).\n this.markerManager.resetMarkerType(markerType)\n this.markerManager.currentMarkerType = markerType\n\n // Remove pointsToDelete, and Add new POI's to map.\n pointsToDelete.length &&\n this.layerManager.removeLayersFromGroup(pointsToDelete, 'markers')\n pointsToAdd.length && this.addLayersToMap(pointsToAdd, 'markers')\n }\n }", "title": "" }, { "docid": "51c74b27641cbbacbc76891bbfaaef32", "score": "0.52679133", "text": "getGoodItem () {\n allGoodItems.forEach(item => {\n if (this.x + 25 === item.x && this.y + 55 === item.y) {\n let gem = '';\n let look = item.look;\n this.points += item.points;\n counter.innerHTML = player.points;\n //changing black shadow of games on a score panel to the collected colorfull gem image\n if(look.indexOf('seahorse')>0){\n gem = document.querySelector('#seahorse-gem img');\n gem.src = look;\n }\n if(look.indexOf('star')>0){\n gem = document.querySelector('#star-gem img');\n gem.src = look;\n }\n if(look.indexOf('fish')>0){\n gem = document.querySelector('#fish-gem img');\n gem.src = look;\n }\n item.x=-1000;\n item.y=-1000;\n gemsNumber++;\n }\n })\n\n }", "title": "" }, { "docid": "3c9e3c1b1a57933d2d8b07d16ac46154", "score": "0.526527", "text": "function fetchPokemon(){\n // this is a promise array holding json data for all the pokemon\n const promise = []\n // 898 is the number of total pokemon in the database of the api\n let pokemonNumber = 30\n for(let i = 1; i <= pokemonNumber ; i++){\n promise.push(\n fetch(`https://pokeapi.co/api/v2/pokemon/${i}/`)\n .then(result => result.json())\n .catch(err => console.log(err))\n )\n }\n // passes the result for all pokemon and runs the promise parallel to one another instead of sequential manner like in a for loop\n Promise.all(promise).then(result => {\n result.forEach(data => {\n // console.log(data);\n const pokemon = {\n name : data.name,\n id : data.id,\n types : data.types.map(curr => curr.type.name),\n img : data.sprites['front_default'],\n stats : data.stats.map(curr =>{\n return {\n name: curr.stat.name,\n value : curr['base_stat']\n }\n })\n }\n pokeArr.push(pokemon)\n displayPokemon(pokemon, result.length)\n })\n })\n}", "title": "" }, { "docid": "30c03537e3c9e97d1b010063e61c8dbd", "score": "0.52583677", "text": "function renderPokemonWithFavorite(pokData) {\n pokData.forEach(pokemon => {\n console.log(pokemon);\n\n const pokDiv = document.createElement(\"div\");\n pokDiv.classList.add(\"pokemon\");\n pokDiv.dataset.id = pokemon.pokPokemonId;\n\n const pokImg = document.createElement(\"img\");\n pokImg.src = \"/images/pikachu-5527377_1920.jpg\";\n\n const pokInfoDiv = document.createElement(\"div\");\n pokInfoDiv.classList.add(\"text\");\n\n const pokId = document.createElement(\"p\");\n pokId.innerText = `Pokemon ID: ${pokemon.pokPokemonId}`;\n\n const pokName = document.createElement(\"p\");\n pokName.innerText = `Name: ${pokemon.pokName}`;\n\n const pokType = document.createElement(\"p\");\n pokType.innerText = `Type: ${pokemon.pokTypes[0].pokTypeName}`;\n\n const pokAbilities = document.createElement(\"p\");\n pokAbilities.innerText = `Abilities: ${pokemon.pokAbilities}`;\n\n const pokWeight = document.createElement(\"p\");\n pokWeight.innerText = `Weight: ${pokemon.pokWeight}`;\n\n const pokHeight = document.createElement(\"p\");\n pokHeight.innerText = `Height: ${pokemon.pokHeight}`;\n\n const pokGender = document.createElement(\"p\");\n pokGender.innerText = `Gender: ${pokemon.pokGender}`;\n\n const pokFav = document.createElement(\"i\");\n pokFav.classList.add(\"fa-heart\");\n if (pokemon.pokFavorite) {\n pokFav.classList.add(\"fas\");\n } else {\n pokFav.classList.add(\"far\");\n }\n pokFav.addEventListener('click', (e) => {\n const token = window.localStorage.getItem('x-authenticate-token');\n\n const fetchOptions = {\n headers: {\n 'Content-Type': 'application/json'\n },\n method: \"PUT\"\n }\n console.log(fetchOptions.headers['Content-Type']);\n if (token) fetchOptions.headers['x-authenticate-token'] = token;\n\n fetch(APIaddress + \"/api/pokemons/member/favorites/\" + pokemon.pokPokemonId, fetchOptions)\n .then(response => {\n return response.json()\n })\n .then(data => {\n console.log(data);\n window.location.reload();\n return false;\n })\n });\n\n pokInfoDiv.appendChild(pokId);\n pokInfoDiv.appendChild(pokName);\n pokInfoDiv.appendChild(pokType);\n pokInfoDiv.appendChild(pokAbilities);\n pokInfoDiv.appendChild(pokWeight);\n pokInfoDiv.appendChild(pokHeight);\n pokInfoDiv.appendChild(pokGender);\n pokInfoDiv.appendChild(pokFav);\n\n pokDiv.appendChild(pokImg);\n pokDiv.appendChild(pokInfoDiv);\n\n document.querySelectorAll(\".pokemons\")[0].appendChild(pokDiv);\n });\n}", "title": "" }, { "docid": "69aa39afd4faa95c7d017a6b278236e3", "score": "0.52355176", "text": "function DisplayPokemon(props) {\n const list = props.item;\n return (\n <div>\n {list.map ( (item) => {\n return (\n <div>\n <img src={`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${item.id}.png`} alt=\"\"/>\n <div>{item.name}</div>\n </div>\n );\n }) }\n\n </div>\n );\n}", "title": "" }, { "docid": "894fb8e9afe7afcc578ea194379f6945", "score": "0.5227685", "text": "function ForEach (){}", "title": "" }, { "docid": "ce917d55206af0cc5ddfa2194b78b88f", "score": "0.5225372", "text": "function drawPipes(){\n pipes.forEach(function(element){\n element.draw();\n if(flappy.isTouching(element)) killFlappy();\n });\n}", "title": "" }, { "docid": "41823f2b19fe375e456efefd13d607c4", "score": "0.5202655", "text": "function updateSnakeContent() {\n // if(score<=firstPoem.length){\n\n // }\n snakePoem.push(firstPoem[score - 1]);\n}", "title": "" }, { "docid": "2965a8e5dfb993e2db902af500572a53", "score": "0.5192495", "text": "listPets(pets) {\n const petElements = pets.map((pet, i) => {\n return (\n <PetCard\n key={pet.id}\n {...pet}\n selectPetCallback={this.props.selectPetCallback}\n deletePetCallback={this.onDeletePet}\n />\n );\n });\n return petElements;\n }", "title": "" }, { "docid": "26b3bc1d270126d3182a04a387374a01", "score": "0.5177974", "text": "forEach(callback) {\n for (let x = 0; x < Voxels.sizeX; x++) {\n for (let y = 0; y < Voxels.sizeY; y++) {\n const expanded = this.voxels[x][y].expand();\n expanded.forEach((type, z) => callback(type, x, y, z));\n }\n }\n }", "title": "" }, { "docid": "f413a5a1749176495873cc896d6eeb79", "score": "0.51773155", "text": "async function loadAllPokemon() {\n\n if (PokemonArray.length < 1){\n for (let i = 1; i < 152; i++) {\n let url = `https://pokeapi.co/api/v2/pokemon/${i}`;\n let response = await fetch(url);\n let responseAsJson = await response.json();\n PokemonArray.push(responseAsJson);\n loadingCount = i;\n UpdateLoadingscreenAllPokemon();\n }\n}\n console.log(PokemonArray);\n}", "title": "" }, { "docid": "99a8e1e6d4c9e797c5e6455b197dc44c", "score": "0.5174918", "text": "function testForHit (arrayObjectsToHit_, objectTryHit_, arrayObjectTryHit_) {\n arrayObjectsToHit = arrayObjectsToHit_;\n arrayObjectTryHit = arrayObjectTryHit_;\n this.objectTryHit = objectTryHit_;\n arrayObjectsToHit.forEach(arrayObject => { \n this.arrayObject = arrayObject;\n if ( this.arrayObject.posX < this.objectTryHit.posX + this.objectTryHit.sizeW && \n this.arrayObject.posX + this.arrayObject.sizeW > this.objectTryHit.posX && \n this.arrayObject.posY < this.objectTryHit.posY + this.objectTryHit.sizeH && \n this.arrayObject.posY + this.arrayObject.sizeH > this.objectTryHit.posY\n ) {\n this.arrayObject.hitPoints -= this.objectTryHit.damage;\n if (this.arrayObject.hitPoints <= 0) {\n player.score += this.arrayObject.destroyScore;\n displayScore();\n create_visualEffect(this.arrayObject.posX, this.arrayObject.posY, this.arrayObject.sizeW * 2, this.arrayObject.sizeH * 2, \"static\", 15, \"static_explosion_1\");\n RemoveObjectFromArray(arrayObjectsToHit, this.arrayObject);\n RemoveObjectFromArray(bullets_array, this.objectTryHit);\n }\n else {\n create_visualEffect(this.objectTryHit.posX, this.objectTryHit.posY, this.objectTryHit.sizeW * 2, this.objectTryHit.sizeH * 5, \"static\", 15, \"static_explosion_1\");\n RemoveObjectFromArray(bullets_array, this.objectTryHit);\n player.score += this.arrayObject.hitScore;\n displayScore();\n }\n }\n });\n}", "title": "" }, { "docid": "8d840108d9bd299953ddafcb66bef5cc", "score": "0.5168986", "text": "render () {\n let id, value;\n let puzzleBlocks = [];\n const { boardWidth, boardHeight, boards } = this.props.currentGame;\n const type = \"type-\" + boardWidth + \"x\" + boardHeight;\n let currentBoard = boards.currentBoard;\n\n currentBoard.forEach((block, idx) => {\n if (!block) {\n id = \"empty\";\n value = \".\"\n } else {\n id = \"block-\" + (idx + 1);\n value = block\n }\n\n puzzleBlocks.push(\n <Block id={id}\n key={idx}\n type={type}\n value={value}\n onBlockClick={(e) => this._handleBlockClick(e)}/>\n )\n });\n\n return (\n <section className={\"game-puzzle \" + type}>\n <div className=\"puzzle-blocks\">\n {puzzleBlocks}\n </div>\n </section>\n )\n }", "title": "" }, { "docid": "636c35e580fab6f69c4a63cf12333e05", "score": "0.5168885", "text": "debugPoses () {\n const context = this.canvas.getContext('2d')\n\n this.poses.forEach(({score, keypoints}) => {\n if (score >= this.options.posenet.minPoseConfidence) {\n const adjacentKeypoints = PoseNet.getAdjacentKeyPoints(keypoints, this.options.posenet.minPartConfidence, context)\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height)\n this.drawSkeleton(adjacentKeypoints, context)\n this.drawKeypoints(keypoints, this.options.posenet.minPartConfidence, context)\n }\n })\n }", "title": "" }, { "docid": "23bbc0b9df9261c6caa0a70b7130137a", "score": "0.51678234", "text": "function drawKeypoints() {\n // Loop through all the poses detected\n for (let i = 0; i < poses.length; i++) {\n // For each pose detected, loop through all the keypoints\n let pose = poses[i].pose;\n for (let j = 0; j < pose.keypoints.length; j++) {\n // A keypoint is an object describing a body part (like rightArm or leftShoulder)\n let keypoint = pose.keypoints[j];\n // Only draw an ellipse is the pose probability is bigger than 0.2\n if (poses[0].pose.keypoints[0].score > 0.2 &\n poses[0].pose.keypoints[1].score > 0.2 &\n poses[0].pose.keypoints[2].score > 0.2 &\n poses[0].pose.keypoints[3].score > 0.2 &\n poses[0].pose.keypoints[4].score > 0.2) {\n select(\"#visionstatus\").html(\"Saya mendeteksi manusia, saya akan mencoba menjawab anda.\");\n humandetect = true;\n } else {\n select(\"#visionstatus\").html(\"Saya tidak melihat manusia. Saya akan diam.\"); \n humandetect = false;\n }\n }\n }\n}", "title": "" }, { "docid": "fe77f38bb37ec1e8bb60d852f131fbf1", "score": "0.51526403", "text": "function filterPokedex() {\n //Remove all existing pokemon thumbnails that are being displayed\n $('.thumbnails').html('');\n //Add in the pokemon thumbnails that survived the filtering process\n pokedex.forEach(pokemon => {\n $('.thumbnails').append(`\n <div class='center aligned column'>\n <div class='ui card thumbnail'>\n <div class='image'><img src='${pokemon.image}' /></div>\n <div class='description'>\n <strong>#</strong><span>${pokemon.id}</span>\n <div class='pokemon-name'>${pokemon.name}</div>\n </div>\n </div>\n </div>\n `);\n });\n //Add back in the event handlers for clicking the thumbnails\n addThumbnailListener();\n}", "title": "" }, { "docid": "78c3f0454a465d7d6cf7c5cbdf4156b7", "score": "0.5140188", "text": "function renderIdeas(ideas) {\n ideas.forEach( renderIdea )\n}", "title": "" }, { "docid": "c860ae23db484afd06f407301a2665e0", "score": "0.51400614", "text": "function renderPlayers() {\n for (var i = 0; i < players.length; i++) {\n placeItem(players[i]);\n }\n}", "title": "" }, { "docid": "00f4784e07f6d05498ea72e5a29585df", "score": "0.5133316", "text": "async fetchPokemonList(first, last){\n\t\t\n\t\tlet pokemonList=this.state.listOfPokemon;\n\t\tthis.setState({\n\t\t\tloading:true\n\t\t});\n\t\n\t\tfor(let id=first;id<last;id++){\n\t\t\tlet currentPokemon={};\n\t\t\tcurrentPokemon.MachineMoves={};\n\t\t\tcurrentPokemon.LearnedMoves={};\n\t\t\t\n\t\t\t//Fetch pokemon using the id\n\t\t\tlet pokemon=await axios.get('https://pokeapi.co/api/v2/pokemon/'+id);\n\t\t\t\n\t\t\tcurrentPokemon.id=pokemon.data.id;\n\t\t\tcurrentPokemon.name=pokemon.data.name;\n\t\t\tcurrentPokemon.types=[];\n\t\t\tpokemon.data.types.map(item=>{\n\t\t\t\tcurrentPokemon.types.push(item.type.name);\n\t\t\t\t\n\t\t\t});\n\t\t\tcurrentPokemon.height=(pokemon.data.height*0.1).toFixed(2)+\"m\";\n\t\t\tcurrentPokemon.weight=(pokemon.data.weight*0.1).toFixed(2)+\"kg\";\n\t\t\tcurrentPokemon.hp=pokemon.data.stats[0].base_stat;\n\t\t\tcurrentPokemon.attack=pokemon.data.stats[1].base_stat;\n\t\t\tcurrentPokemon.defense=pokemon.data.stats[2].base_stat;\n\t\t\tcurrentPokemon.spAttack=pokemon.data.stats[3].base_stat;\n\t\t\tcurrentPokemon.spDefense=pokemon.data.stats[4].base_stat;\n\t\t\tcurrentPokemon.speed=pokemon.data.stats[5].base_stat;\n\t\t\t\n\t\t\t//Evolution data is available at the pokemon-species end point\n\t\t\tlet resp=await axios.get('https://pokeapi.co/api/v2/pokemon-species/'+id);\n\t\t\t\n\t\t\tlet currentPokemonSpecies=resp.data;\n\t\t\tcurrentPokemon.species=currentPokemonSpecies.genera[7].genus;\n\t\t\tcurrentPokemonSpecies.flavor_text_entries.map((entry)=>{\n\t\t\t\tif(entry.version.name==\"gold\"){\n\t\t\t\t\tcurrentPokemon.flavor=entry.flavor_text;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tlet resp2=await axios.get(currentPokemonSpecies.evolution_chain.url);\n\t\t\tlet currentPokemonEvolution=resp2.data.chain;\n\t\t\tlet evolutions=[];\n\t\t\tlet evolutionLine=[];\n\t\t\tlet evolutionLine2=[];\n\t\t\t\n\t\t\t//The pokemon pictures are stored using IDs. However, evolutionChain object doesnt have any pokemonId property.\n\t\t\t//So the id is extracted from the urls using regex. \n\t\t\tif(nationalDexList.hasOwnProperty(currentPokemonEvolution.species.name))\n\t\t\t\tevolutions.push([currentPokemonEvolution.species.url.slice(42).match(/[0-9]/g).join(\"\")]);\n\t\t\n\t\t\tcurrentPokemonEvolution.evolves_to.forEach((firstEvolution)=>{\n\t\t\t\tif(nationalDexList.hasOwnProperty(firstEvolution.species.name))\n\t\t\t\t\tevolutionLine.push(firstEvolution.species.url.slice(42).match(/[0-9]/g).join(\"\"));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tfirstEvolution.evolves_to.forEach((secondEvolution)=>{\n\t\t\t\t\t\n\t\t\t\t\tif(nationalDexList.hasOwnProperty(secondEvolution.species.name))\n\t\t\t\t\t\tevolutionLine2.push(secondEvolution.species.url.slice(42).match(/[0-9]/g).join(\"\"));\n\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t// Only append to evolutionLine if the pokemon has any evolution\n\t\t\tif(evolutionLine.length!=0)\n\t\t\t\tevolutions.push(evolutionLine);\n\t\t\tif(evolutionLine2.length!=0)\n\t\t\t\tevolutions.push(evolutionLine2);\n\t\t\n\t\t\t\n\t\t\tcurrentPokemon.evolutions=evolutions;\n\t\n\t\t\tpokemonList.push(currentPokemon);\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\n\n\t\t\n\t\tthis.setState({\n\t\t\tlistOfPokemon:pokemonList,\n\t\t\tloading:false\n\t\t});\n\t}", "title": "" }, { "docid": "65322704c48849a8468940ca6efed80c", "score": "0.51309305", "text": "render() {\n const poems = this.state.poems;\n return (\n <div className=\"page poetry-page\">\n {\n poems.map((poem, index) => {\n return (\n <div className='poem' key={index}>\n <h3>{poem.title}</h3>\n <div className=\"poem-body\" dangerouslySetInnerHTML={{__html: poem.body}}></div>\n <h3>{'-JV'}</h3>\n </div>\n )\n })\n }\n \n </div>\n );\n }", "title": "" }, { "docid": "86ccafddc2c3e19a3ab69a4a07af5e6d", "score": "0.5121603", "text": "function pickUp() {\n myOrangeParatroopers = myOrangeParatroopers.filter(function(el) {\n //if there is a collision between the Wooden raft and a array el (= paratrooper)\n if (woodenRaft.crashWith(el)) {\n score += 1;\n //Audio\n let audioVoice1 = document.createElement(\"audio\");\n audioVoice1.src = \"audio/mixkit-males-yes-victory-2012.wav\";\n audioVoice1.play(); \n return false; //we don't keep el in myOrangeParatroopers array = it disappears from the game area\n } else {\n return true; //else we keep it\n } \n });\n\n myBrownParatroopers = myBrownParatroopers.filter(function(el) {\n if (woodenRaft.crashWith(el)) {\n score += 1;\n //Audio\n let audioVoice2 = document.createElement(\"audio\");\n audioVoice2.src = \"audio/mixkit-fighting-man-voice-of-pain-2173.wav\";\n audioVoice2.play(); \n return false; \n } else {\n return true; \n } \n });\n}", "title": "" }, { "docid": "69404c9a6526c88ad3a12ec1e7397b7f", "score": "0.5114499", "text": "function displayPokemons(start) {\n box.innerHTML = \"\";\n for (i = start; i < start + size; i++) {\n if (i <= 150) {\n pokemon = pokemons[i];\n if (pokemon) {\n displayPokemon(pokemon);\n } \n } \n }\n current = start;\n\n displayButtons();\n}", "title": "" }, { "docid": "0f148b6b5b6583e800ce21fccde75fac", "score": "0.5112995", "text": "function selectPokemons() {\n for (var i = 0; i < 10; i++) {\n var rndNum = getRndUpTo(pokes.length);\n reels[i] = pokes[rndNum];\n }\n $reels.each(function(idx) {\n $(this).removeClass().addClass('poke ' + reels[idx]);\n });\n console.log(reels);\n}", "title": "" }, { "docid": "5f312ed0c1467703310cc955dcfee2cf", "score": "0.511168", "text": "drawFood() {\n this.foodOnMap.forEach(food => {\n food.draw();\n });\n }", "title": "" }, { "docid": "f8ed2fda4366464a38fa301844f877f5", "score": "0.5111303", "text": "process() {\n this.items.forEach(item => {\n this.loopFunc(item);\n });\n }", "title": "" }, { "docid": "da8001e57b7fa100b7d8700d41d930b1", "score": "0.51088756", "text": "processFood() {\n //iterate trough the predator and move & find survivors\n for (var i = 0; i < this.foodInfo.length; i++) {\n\n this.foodInfo[i].direction += this.foodInfo[i].turningSpeed * 0.01;\n //check for border colission and change direction\n this.foodInfo[i].direction = this.foodInfo[i].handleBorderCollition();\n this.foodInfo[i].x += Math.sin(this.foodInfo[i].direction) * (this.foodInfo[i].speed * this.foodInfo[i].scale.y);\n this.foodInfo[i].y += Math.cos(this.foodInfo[i].direction) * (this.foodInfo[i].speed * this.foodInfo[i].scale.y);\n this.foodInfo[i].rotation = -this.foodInfo[i].direction + Math.PI;\n\n // wrap container and position \n\n /*\n if (this.foodInfo[i].x < this.foodInfo[i].foodBounds.x) {\n this.foodInfo[i].x += this.foodInfo[i].foodBounds.width;\n } else if (this.foodInfo[i].x > this.foodInfo[i].foodBounds.x + this.foodInfo[i].foodBounds.width) {\n this.foodInfo[i].x -= this.foodInfo[i].foodBounds.width;\n }\n\n if (this.foodInfo[i].y < this.foodInfo[i].foodBounds.y) {\n this.foodInfo[i].y += this.foodInfo[i].foodBounds.height;\n } else if (this.foodInfo[i].y > this.foodInfo[i].foodBounds.y + this.foodInfo[i].foodBounds.height) {\n this.foodInfo[i].y -= this.foodInfo[i].foodBounds.height;\n }\n */\n }\n }", "title": "" }, { "docid": "2d6ef50b5dd433b27f696686c458992f", "score": "0.51020586", "text": "function question5() {\n data.forEach(function (eighters){\n let numbEighters = eighters.materials.length;\n if (numbEighters >= 8){\n\n console.log(eighters.title +\" is made up of \"+ eighters.materials.length +\" different materials, including: \");\n\n eighters.materials.forEach(function(watAteTho)\n {console.log(\"-\" + watAteTho)\n\n })\n\n\n\n }\n })\n }", "title": "" }, { "docid": "b193f8275825c3a46f53c16a3c61dd4e", "score": "0.5101174", "text": "function displayPlayers() {\n players.forEach(element => {\n pList.innerHTML += element.renderPlayer();\n });\n}", "title": "" }, { "docid": "b0a93aaa95af9b1ba5b89817caa8f049", "score": "0.50995475", "text": "_computeParagraphs() {\n const uid = (this.rootSutta || this.translatedSutta).uid;\n let divisionId = /^[a-z]+/.exec(uid)[0];\n if (divisionId === 'pli') divisionId = 'vi';\n if (divisionId === 'iti') divisionId = 'it';\n this._setParagraphsVisible(this.showParagraphs);\n\n if (!this.paragraphs || !this.showParagraphs) {\n return;\n }\n this.paragraphs.forEach((paragraph) => {\n const refs = this.$.segmented_text_content.querySelectorAll(`.${paragraph.uid}:not(.textual-info-paragraph-inline)`);\n Array.from(refs).forEach((item) => {\n if (this._shouldDisplayBookIcon(divisionId, item.id)) {\n this._processVolPageInfo(item, divisionId, paragraph);\n } else {\n this._addParagraphData(item, paragraph);\n }\n });\n });\n\n setTimeout(() => {\n this._applyQuoteHanger();\n });\n }", "title": "" }, { "docid": "335cc3449b941b7a428c7b232029d6e0", "score": "0.509292", "text": "async function getPokemon(){\n for (i = 1; i <= numOfPokemon; i++){\n await getPokemonData(i);//use await for async function because we want them to display in order\n }\n }", "title": "" }, { "docid": "8b9b25d475dd245a49a732d26a3dc773", "score": "0.5077553", "text": "async function loadPokemon() {\n for (let i = offset; i < limit; i++) {\n let url = `https://pokeapi.co/api/v2/pokemon/${i}/?offset=${offset}&limit=${limit}`;\n let response = await fetch(url);\n currentPokemon = await response.json();\n allPokemons.push(currentPokemon);\n }\n renderPokemonInfo()\n}", "title": "" }, { "docid": "5767e47ca6f39b669c195d58e6ffe422", "score": "0.50637037", "text": "function drawSpikes() {\n for (let i = 0; i < spikes.length; i++) {\n spikes[i].drawTriangle();\n }\n}", "title": "" }, { "docid": "49c4d771b3b05edf22843e794cf4de6c", "score": "0.50620496", "text": "function drawKeypoints() {\n // Loop through all the poses detected\n for (let i = 0; i < poses.length; i += 1) {\n // For each pose detected, loop through all the keypoints\n const pose = poses[i].pose;\n \n\t\t\t\tallParticles.push(new Particle(pose.leftWrist.x, pose.leftWrist.y, maxLevel));\n\t\t\t\tallParticles.push(new Particle(pose.rightWrist.x, pose.rightWrist.y, maxLevel));\n\t\t\t\tallParticles.push(new Particle(pose.leftAnkle.x, pose.leftAnkle.y, maxLevel));\n\t\t\t\tallParticles.push(new Particle(pose.rightAnkle.x, pose.rightAnkle.y, maxLevel));\n }\n}", "title": "" }, { "docid": "faf0117848e89f19b0d1b1ad67505df2", "score": "0.5056182", "text": "function DonutShopArrRender(){\n donutShopArr.forEach(function(donutShop, i) {\n donutShopArr[i].donutDemand();\n })\n}", "title": "" }, { "docid": "3df7fd4c2168196ce2a9b447162cce20", "score": "0.50552183", "text": "setPosesFromCache () {\r\n forEach(this.poseCache, (cache, pose) => {\r\n for (let i = 0; i < cache.length; i++) {\r\n this.pose[i][pose] = cache[i]\r\n }\r\n })\r\n }", "title": "" }, { "docid": "c59aed0b32ac125cfd79b1659ed87499", "score": "0.5037994", "text": "function drawKeypoints() {\n //loop = poses detected\n for (let i = 0; i < poses.length; i++) {\n for (let j = 0; j < poses[i].pose.keypoints.length; j++) {\n //a keypoint is an object describing a body part (like rightArm or leftear)\n let keypoint = poses[i].pose.keypoints[j];\n //draw an ellipse = 0.2\n if (keypoint.score > 0.2) {\n fill(255, 0, 0);\n noStroke();\n ellipse(keypoint.position.x, keypoint.position.y, 10, 10);\n }\n }\n }\n}", "title": "" }, { "docid": "ab92e6333d0058eabf3efe1453e92860", "score": "0.5028947", "text": "function drawKeypoints() {\n // points = [];\n\n // Loop through all the poses detected\n for (let i = 0; i < poses.length && i == 0; i++) {\n // For each pose detected, loop through all the keypoints\n\n let pose = poses[i].pose;\n\n for (let j = 0; j < pose.keypoints.length; j++) {\n // A keypoint is an object describing a body part (like rightArm or leftShoulder)\n let keypoint = pose.keypoints[j];\n // Only draw an ellipse is the pose probability is bigger than 0.2\n if (keypoint.score > 0.2) {\n fill(0, 255, 0);\n noStroke();\n ellipse(map(keypoint.position.x, 0, 640, 0, width), map(keypoint.position.y, 0, 480, 0, height), 5, 5);\n }\n }\n }\n}", "title": "" }, { "docid": "f3a98248e62d23727f79ab9f7b6fd8ae", "score": "0.50284207", "text": "function startGame() {\n lettersGuessed = [];\n var randomPoke = Math.floor(Math.random() * pokemonList.length);\n randomPoke = pokemonList[randomPoke].toUpperCase();\n // console.log(randomPoke);\n\n poke = new Word(randomPoke);\n\n console.log(\"\\n██████╗ ██████╗ ██╗ ██╗███████╗███╗ ███╗ ██████╗ ███╗ ██╗\\n\" +\n \"██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝████╗ ████║██╔═══██╗████╗ ██║\\n\" + \n \"██████╔╝██║ ██║█████╔╝ █████╗ ██╔████╔██║██║ ██║██╔██╗ ██║\\n\" +\n \"██╔═══╝ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╔╝██║██║ ██║██║╚██╗██║\\n\" +\n \"██║ ╚██████╔╝██║ ██╗███████╗██║ ╚═╝ ██║╚██████╔╝██║ ╚████║\\n\" +\n \"╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝\\n\");\n\n console.log(\" ██████╗ ██╗ ██╗███████╗███████╗███████╗\\n\" +\n \" ██╔════╝ ██║ ██║██╔════╝██╔════╝██╔════╝\\n\" + \n \" ██║ ███╗██║ ██║█████╗ ███████╗███████╗\\n\" + \n \" ██║ ██║██║ ██║██╔══╝ ╚════██║╚════██║\\n\" +\n \" ╚██████╔╝╚██████╔╝███████╗███████║███████║\\n\" +\n \" ╚═════╝ ╚═════╝ ╚══════╝╚══════╝╚══════╝\");\n \n\n\n console.log(\"\\n\" + poke.toString() + \"\\n\");\n playGame();\n}", "title": "" }, { "docid": "a2f5d3a8e620cc7743d7e704d76752cd", "score": "0.50272715", "text": "function pokeArray(x,y,z){\n var flavor = y[0].flavor_text_entries[z].flavor_text;\n var name = x[0].species.name;\n var abil = x[0].abilities.map(x => x.ability.name);\n var id = x[0].id;\n var type = x[0].types.map(x => ' ' + x.type.name);\n\n function pokeObject(name, id, abilities, type, flavor) {\n this.name = name;\n this.id = id;\n this.abilities = abilities;\n this.type = type;\n this.sprite = x[0].sprites.front_default;\n this.flavor = flavor\n }\n\n var newPokemon = new pokeObject(name, id, abil, type, flavor);\n return newPokemon\n }", "title": "" }, { "docid": "3437748ade726309805f706914027ca7", "score": "0.5025025", "text": "all_prizes_and_tiers(callback) {\n this.all_tiers(tiers => {\n this.all_prizes(prizes => {\n let result = []\n tiers.forEach(tier => {\n let prize_names = prizes.filter(prize => prize.tier_id == tier.id).map(prize => prize.description)\n result.push({\n name: tier.name.replace(/^\\w/, c => c.toUpperCase()),\n point: tier.points,\n prizes: prize_names\n })\n })\n console.log(JSON.stringify({result: result}))\n callback(result)\n })\n })\n }", "title": "" }, { "docid": "9bcf8090e6be2fbf518f3c0b8ffa270a", "score": "0.5022958", "text": "static fetchPokemon(){\n return fetch(\"http://localhost:3000/pokemons\")\n .then(response => response.json())\n .then(pokemons => {\n pokemons.forEach(pokemon => {\n //35% chance for shiny\n if ((Math.random() * 100) < 35) {\n let pokemonInstance = new Pokemon(pokemon.id, pokemon.species, pokemon.type_1, pokemon.type_2, pokemon.ability, pokemon.shiny_sprite, \"yes\")\n pokemonInstance.render()\n }\n else {\n let pokemonInstance = new Pokemon(pokemon.id, pokemon.species, pokemon.type_1, pokemon.type_2, pokemon.ability, pokemon.sprite_image, \"no\")\n pokemonInstance.render()\n }\n })\n return Pokemon.all})\n}", "title": "" }, { "docid": "f2427b9afe6d51bd6ba2bb11abadb00f", "score": "0.50225526", "text": "function renderizarPacientes(pacientes) {\n let pacientesFilas = document.querySelector(\".contenido\");\n pacientesFilas.innerHTML = \"\";\n for(let paciente of pacientes){\n renderizar(paciente,pacientesFilas);\n }\n}", "title": "" }, { "docid": "fe360b4ee29bbf491d6a7fd0e69d10f8", "score": "0.5019813", "text": "function renderHearts() {\n heartArray.forEach(heart => {\n renderHeart(heart)\n })\n}", "title": "" }, { "docid": "bc2f1ab619a349d11cd90a20c1e127d7", "score": "0.5018111", "text": "lichessGamesPrompt(games, callback) {\n games = _.map(games, (game) => {\n return {\n\n };\n });\n }", "title": "" }, { "docid": "7466e4ebe670861d1baebba58fda1692", "score": "0.50162005", "text": "renderFold()\n {\n var result = [];\n\n for(var i = 0; i < this.state.flock.sheep.length; i++)\n {\n result.push(this.renderSheep(this.state.flock.sheep[i]));\n }\n\n return(result);\n }", "title": "" }, { "docid": "ec821a23f515ccee9f25d7d90363fc1b", "score": "0.50156325", "text": "processCharacters() {\r\n for (let player of this.state.players) {\r\n if (player.HP <= 0) {\r\n this.setState({ lose: true })\r\n return\r\n }\r\n }\r\n\r\n let tempSet = JSON.parse(JSON.stringify(this.state.cleanTileSet)) // Creates a deep copy of the array\r\n\r\n outerloop:\r\n for (let char of this.state.players) {\r\n\r\n let position = this.getTileAndSquareForCharacter(char)\r\n\r\n for (let item of tempSet) {\r\n if (position.tileX === item.x && position.tileY === item.y) {\r\n item.grid[position.squareY][position.squareX] = 11\r\n item.players.push({ image: char.image, x: position.squareX, y: position.squareY })\r\n continue outerloop\r\n }\r\n }\r\n }\r\n\r\n for (let char of this.state.players) {\r\n outerloop:\r\n for (let monster of char.monsters) {\r\n\r\n let position = this.getTileAndSquareForCharacter(monster)\r\n\r\n for (let item of tempSet) {\r\n if (position.tileX === item.x && position.tileY === item.y) {\r\n item.grid[position.squareY][position.squareX] = 21\r\n item.players.push({ image: monster.image, x: position.squareX, y: position.squareY })\r\n continue outerloop\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.setState({ dataSet: tempSet }, this.checkSidesOfCharacter())\r\n }", "title": "" }, { "docid": "5c5278ad915f2b370b6fd2c0fc987f25", "score": "0.5010771", "text": "function fillingPokemons() {\n pokemons = [\n {\n url: 'https://pokeapi.co/api/v2/pokemon/charmander',\n name: charmander['name'],\n pic: charmander['sprites']['front_default'],\n height: '0,60m',\n weight: '8,5kg',\n abilities: 'Blaze, Solar-Power',\n cathegory: 'lizard-Pokémon'\n },\n {\n url: 'https://pokeapi.co/api/v2/pokemon/pikachu',\n name: pikachu['name'],\n pic: pikachu['sprites']['front_default'],\n height: '0,40m',\n weight: '6,0kg',\n abilities: 'statics, lightning rod',\n cathegory: 'mouse-Pokémon'\n },\n {\n url: 'https://pokeapi.co/api/v2/pokemon/venusaur',\n name: venusaur['name'],\n pic: venusaur['sprites']['front_default'],\n height: '2,4m',\n weight: '155,5kg',\n abilities: 'Chlorophyll, greasy, emergency-fertilizer',\n cathegory: 'seeds-Pokémon'\n }\n ];\n }", "title": "" }, { "docid": "35d7084666d00891ebf3003395261155", "score": "0.5007749", "text": "function checkForPoints(index){\n const $square = $squares.eq(index)\n const ghost = Object.values(ghostInfo).find(ghost => ghost.position === index)\n console.log(ghost)\n if ($square.hasClass('food')) {\n updateScore(10)\n playChomp('pacman_chomp (1)')\n }\n if ($square.hasClass('big-food')) {\n updateScore(50)\n changeGhostsToBlue()\n }\n if ($square.hasClass('ghost') && $square.hasClass('blue')) {\n updateScore(200)\n $square.addClass('eyes')\n ghost.eyes = true\n }\n if ($square.hasClass('ghost') && !$square.hasClass('blue') && !$square.hasClass('eyes')) {\n gameOver()\n }\n }", "title": "" }, { "docid": "3dc1b62d6e0ac511b815336d785f4e8b", "score": "0.500506", "text": "function loadPokemon(i) {\n currentPokemon = PokemonArray[i-1];\n let name = currentPokemon['name'];\n let id = currentPokemon['id'];\n let img = currentPokemon['sprites']['front_default'];\n let height = currentPokemon['height']/10 + ' m' ;\n let weight = currentPokemon['weight']/10 + ' kg';\n let types = currentPokemon['types'] ;\n let hp = currentPokemon['stats'][0]['base_stat'] ;\n let atk = currentPokemon['stats'][1]['base_stat'] ;\n let def = currentPokemon['stats'][2]['base_stat'] ;\n let spd = currentPokemon['stats'][5]['base_stat'] ;\n\n BuildcurrentPokemon(name, id, img, height, weight, types, hp, atk, def, spd);\n displayCurrentPokemon(currentPokemon);\n\n\n}", "title": "" }, { "docid": "490b5a1bd8202a5a32d3bd2715edcd6d", "score": "0.5003179", "text": "draw(){\n\n for(let b of this.bricks){\n if(b.numHits == 0){\n this.bricks.splice(this.bricks.indexOf(b),1);\n }\n }\n\n if(this.bricks.length == 0){\n win();\n }else{\n for(let b of this.bricks){\n b.draw();\n }\n }\n\n\n\n }", "title": "" }, { "docid": "5b67fc0fd5c84bd87c7e3230086f8348", "score": "0.49982482", "text": "placePellet () {\n // `foundValidPos` is an example of a common practice, the _flag_. We use\n // this when we need to iterate an unknown number of times. In our case,\n // we need to come up with a random location and then check to make sure\n // it's in a valid position. We set `foundValidPos` to false and then\n // use a while loop to pick a position and check its validity. Once\n // valid, we set `foundValidPos` to true, causing the loop to end.\n //\n // There are other options here. You could loop forever using\n // `while (true)` and then use `break` to end the loop once you find\n // a valid position. I find this more readable, though. You could\n // also use a `do...while` loop, but those are not often seen in\n // the wild and can therefore be confusing.\n let foundValidPos = false\n let pos\n while (!foundValidPos) {\n pos = {\n x: Math.floor(Math.random() * (this.squares.x - 2)) + 1,\n y: Math.floor(Math.random() * (this.squares.y - 2)) + 1\n }\n\n foundValidPos = !(doesIntersectWithArray(pos, this.snake.segments) ||\n doesIntersectWithArray(pos, this.pellets))\n }\n\n // Create a new pellet at the found position and push it onto our\n // array of pellets.\n this.pellets.push(new Pellet(pos))\n }", "title": "" }, { "docid": "41d6f684b9f7f91385138a20a2ed7dcb", "score": "0.49936694", "text": "async function getPokemon() {\n try {\n\n //fetch stream of data 151 pokemons, starting at 0\n const pokemonPlain = await fetch(`https://pokeapi.co/api/v2/pokemon/?offset=0&limit=151`);\n\n //convert to json\n const pObject = await pokemonPlain.json();\n //console.log(pObject); // testing in the console\n\n // push the fetched data in the constant array to reuse and keep so you do not need to fetch X-times anymore\n data.push(pObject);\n //console.log(data); // testing in the console\n\n // generate 4 random numbers to use as random id's to select 4 random pokemons\n for (let i = 1; i <= 4; i++) {\n randomSprite[i] = Math.floor(Math.random() * 150) + 1; // returns a random integer from 1 to 151\n //console.log(randomSprite[i]); // this works fine\n if (randomSprite[i] == randomSprite[(i - 1)] || randomSprite[i] == randomSprite[(i - 2) || randomSprite[i] == randomSprite[(i - 3)]]) {\n //randomSprite[i] = Math.floor(Math.random() * 150) + 1;\n console.log(\"double\");\n i--\n }\n else if (randomSprite[1] == randomSprite[4]){\n i--\n }\n }\n\n // select buttons to display 4 random pokemon names ---this works!\n for (let y = 0; y < 4; y++) {\n //console.log(data[0].results[randomSprite[y + 1]].name);\n document.querySelectorAll(\".guessButton\")[y].innerHTML = data[0].results[randomSprite[y + 1]].name;\n }\n\n // to generate a random number between 0 and 4 to select the random id of the image we are going to show\n let randomGetal = Math.floor(Math.random() * 5); // this works fine!\n\n if (randomGetal==0){ // the randomnumber must be from 1 to 5, zero is not allowed because than you can't get a pokemon picture\n randomGetal=1;\n }\n ImageIndex = randomSprite[randomGetal]; // to select the random image to show from the four selected pokemons\n ImageIndex=ImageIndex+1; //there is a difference between de index of the first fetch (the names/id and the second fetch: the images, by doing +1 this index-difference dissapears\n\n getPokemonImage(ImageIndex);\n\n } catch (error) {\n console.log(\"error by fetching the name- and id-data\");\n }\n}", "title": "" }, { "docid": "840ae89664667451182201e019aa5a80", "score": "0.49934465", "text": "drawElements() {\n this.drawElts.forEach(element => {\n element.forEach(item => {\n item.draw();\n }); \n });\n }", "title": "" }, { "docid": "de373dc8446a86872c3c7b16d6ce992f", "score": "0.49811468", "text": "DISPLAY_ALL_PIECES() {\r\n // For each row in the array, and then for each square in that row...\r\n for (let row = 0; row < this.boardArray.length; row++) {\r\n for (let square = 0; square < this.pieceList.length + this.offset; square++) {\r\n // If the array reference isn't empty...\r\n if (this.boardArray[row][square] != \"\") {\r\n // Get the piece name in the square...\r\n let pieceName = this.boardArray[row][square].name;\r\n\r\n // Find in the icon array, the image object with a name attribute matching the name above.\r\n // The display it according to the X, Y, Size parameters.\r\n image(icons[icons.indexOf(icons.find(object => object.name == pieceName))].val, // Image\r\n square * this.squareSize, row * this.squareSize, // X, Y\r\n this.squareSize, this.squareSize); // Size\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "6b141fa1d50b447656a8b59b96545317", "score": "0.49686947", "text": "function drawKeypoints() {\n // Loop through all the poses detected\n for (let i = 0; i < poses.length; i++) {\n // For each pose detected, loop through all the keypoints\n for (let j = 0; j < poses[i].pose.keypoints.length; j++) {\n // A keypoint is an object describing a body part (like rightArm or leftShoulder)\n let nose = poses[i].pose.keypoints[0];\n // Only draw an ellipse is the pose probability is bigger than 0.2\n if (nose.score > 0.8) {\n imageMode(CENTER);\n if (counter == 1) {\n image(lips, nose.position.x, nose.position.y + 65, 120, 70);\n } else if (counter == 2){\n image(lips1, nose.position.x, nose.position.y + 65, 120, 70);\n } else if (counter == 3){\n image(lips2, nose.position.x, nose.position.y + 65, 120, 70);\n } else if (counter == 4) {\n image(lips3, nose.position.x, nose.position.y + 65, 120, 70);\n } else if (counter == 5) {\n image(lips4, nose.position.x, nose.position.y + 65, 120, 70);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "8f3774ca0e94e29953e05b32334ebd92", "score": "0.49682406", "text": "renderPoke(pokeData) {\n console.log(pokeData);\n this.entry.innerHTML = `\n \n \n <div class=\"row entry\">\n <div class=\"twelve columns\">\n <h2 class=\"\">\n ${pokeData.species.name.charAt(0).toUpperCase() +\n pokeData.species.name.slice(1)}\n <span class=\"u-pull-right\">#${pokeData.id}</span></h2>\n \n \n </div>\n <div class=\"entry twelve columns\" id=\"entry\">\n <!-- sprite -->\n <div class=\"six columns\" id=\"sprite-container\">\n <img class=\"\" src=\"${pokeData.sprites.front_default}\">\n </div>\n <!-- primary info -->\n <div class=\"six columns u-pull-right\">\n <!-- primary info 1 -->\n <button class=\"six columns\">${pokeData.types[0].type.name.toUpperCase()}</button>\n ${\n pokeData.types[1]\n ? `<button class=\" six columns u-pull-right\">${pokeData.types[1].type.name.toUpperCase()}</button>`\n : \"\"\n }\n <!-- primary info 2 -->\n <div class=\"twelve columns center-text\">\n ${pokeData.name.toUpperCase()} USED <i>${pokeData.moves[\n Math.floor(Math.random() * pokeData.moves.length)\n ].move.name.toUpperCase()}!</i>\n </div>\n <!-- primary info 3 -->\n <div class=\"twelve columns\">\n <button class=\"six columns u-pull-left\" id>\n ATTACK ${pokeData.stats[0].base_stat}\n </button>\n <button class=\"six columns u-pull-right\">\n SP. ATTACK ${pokeData.stats[1].base_stat}\n </button>\n <button class=\"six columns \">\n DEFENSE ${pokeData.stats[2].base_stat}\n </button>\n <button class=\"six columns u-pull-right\">\n SP. DEFENSE ${pokeData.stats[3].base_stat}\n </button>\n <button class=\"six columns\">\n SPEED ${pokeData.stats[4].base_stat}\n </button>\n <button class=\"six columns u-pull-right\">\n HP ${pokeData.stats[5].base_stat}\n </button>\n </div>\n <!-- primary info 4 -->\n <div class=\"twelve columns\">\n </div>\n <!-- primary info 5 -->\n <div class=\"twelve columns\">\n </div>\n <!-- primary info 6 -->\n <div class=\"twelve columns\">\n </div>\n </div>\n </div>\n </div>\n`;\n }", "title": "" }, { "docid": "d29a75a446e6c96ebc228e8b4eb11a49", "score": "0.4967784", "text": "function spikeCheck(player, spikes) {\n spikes.forEach(spike => {\n // get the vectors to check against\n let vectorX = (player.x + (player.width / 2)) - (spike.x + (spike.width / 2));\n let vectorY = (player.y + (player.height / 2)) - (spike.y + (spike.height / 2));\n let halfWidths = (player.width / 2) + (spike.width / 2);\n let halfHeights = (player.height / 2) + (spike.height / 2);\n // add the half widths and half heights of the objects\n\n // if the x and y vector are less than the half width or half height, they we must be inside the object, causing a collision\n if (Math.abs(vectorX) < halfWidths && Math.abs(vectorY) < halfHeights) {\n player.resetPosition();\n\n const sound = new Howl({\n src:\n [sounds.spikeCollision],\n });\n sound.play();\n }\n });\n}", "title": "" }, { "docid": "1a38a2d0099ba53af6ef79392cf87eb9", "score": "0.4958821", "text": "function drawKeypoints() {\n // points = [];\n\n // Loop through all the poses detected\n for (let i = 0; i < poseArr.length && i == 0; i++) {\n // For each pose detected, loop through all the keypoints\n\n let pose = poseArr[i].pose;\n\n for (let j = 0; j < pose.keypoints.length; j++) {\n // A keypoint is an object describing a body part (like rightArm or leftShoulder)\n let keypoint = pose.keypoints[j];\n // Only draw an ellipse is the pose probability is bigger than 0.2\n if (keypoint.score > 0.2) {\n fill(0, 255, 0);\n noStroke();\n ellipse(map(keypoint.position.x, 0, 640, 0, width), map(keypoint.position.y, 0, 480, 0, height), 5, 5);\n }\n }\n }\n}", "title": "" }, { "docid": "697b01982ee774c4ae459acaa822121f", "score": "0.49581042", "text": "function writePTags(arr) {\n return arr.map(function (x, index) {\n console.log(x)\n return <p key={index}>{x}</p>\n })\n}", "title": "" }, { "docid": "27da836b555f2f265c590ba08f906487", "score": "0.49580276", "text": "function bigShoeRebounds() {\n \n const playersArray = Object.entries(players())\n let sizeShoe = 0\n let playerName = \"\"\n let playerRebounds = 0\n\n //version 2: doesn't work, i dont know what array.method to use. I tried find, filter, eachFor \n //i want to get rid of for .. of loop\n /*playersArray.forEach(player => {\n debugger\n if(player[1].shoe > sizeShoe){\n debugger\n console.log(player[1].shoe)\n sizeShoe = player[1].shoe\n\n debugger\n playerName = player[0]\n console.log(\"player name:\", playerName)\n\n playerRebounds = player[1].rebounds\n \n }\n return [playerName, sizeShoe, playerRebounds]\n })*/\n for(player of playersArray) {\n console.log(player)\n if(player[1].shoe > sizeShoe){\n console.log(player[1].shoe)\n sizeShoe = player[1].shoe\n playerName = player[0]\n playerRebounds = player[1].rebounds\n console.log(\"player name:\", playerName)\n }\n }\n //return [playerName, sizeShoe, playerRebounds]\n}", "title": "" }, { "docid": "a7f216692f22fec4b168fc4872962e7e", "score": "0.49578878", "text": "all(){\n return this.pokemon;\n }", "title": "" }, { "docid": "3833f6a033e14118991cbdac4d619ddd", "score": "0.49576747", "text": "function renderAllPlayers(){\n var resultHTML= \"\"; \n\n players.forEach(function (team){\n var teamName=team[0];\n var teamPlayers = Object.entries(team[1]);\n\n teamPlayers.forEach(function(player){\n var [id,team,name,position] = [player[0], teamName, player[1].name, player[1].pozisyon];\n resultHTML+=createResultItem(id,team,name,position);\n })\n })\n return resultHTML;\n}", "title": "" }, { "docid": "64fa2cd5f4a712b89939cf52ce27f700", "score": "0.49566203", "text": "updateParticles() {\n // Loop backwards through all particles, drawing and updating each.\n for (let i = this.particles.length - 1; i >= 0; --i) {\n this.particles[i].draw();\n this.particles[i].update(i, this.particles);\n }\n }", "title": "" }, { "docid": "62678fd02ea016857a84e63def8eba30", "score": "0.49536923", "text": "moveLabBooks() {\n this.labBooks.forEach((elem) => {\n elem.moveHorizontal(-this.labBookIncrX) // minus because it moves to the west\n })\n\n // filter out all the items that reached the west-border or collide with the player\n this.labBooks = this.labBooks.filter((elem) => {\n if(elem.x <= 0) {\n return false\n // use the player object with the checkCollision method \n } else if (elem.checkCollision(this.player)) {\n this.labsScore++\n this.labsScoreDOM.innerText = this.labsScore\n this.setLabProgressBar(this.labsScore)\n this.coffeeBar--\n this.coffeebarScoreDOM.innerText = this.coffeeBar\n this.setCoffeeProgressBar(this.coffeeBar)\n this.checkWinningConditions()\n return false\n } else {\n return true\n }; \n }) \n }", "title": "" }, { "docid": "0ba457b50d34c84c02bbe1c50cdf7f25", "score": "0.49527243", "text": "async function populatePokemons() {\n let url = 'https://pokeapi.co/api/v2/pokemon/?offset=0&limit=100' // limit should be at least 1118\n let response;\n\n // await Pokemon.sync({ force: true }); // drop tables an create new ones. \n // await TypePokemon.sync({ force: true }); // drop tables an create new ones.\n try{\n response = await axios.get(url);\n let pokemons = response.data.results;\n\n pokemons.forEach( async function(element) {\n url = element.url;\n try{\n response = await axios.get(url);\n let pokeTypes = []\n \n response.data.types.forEach( function(e){\n \n let id = parseInt(e.type.url.match(/\\/[0-9]+/)[0].slice(1)); // get id of type\n pokeTypes.push(id);\n \n })\n \n let pokemon = await Pokemon.create({\n name: element.name,\n // life: response.data.stats[0].base_stat, // hp\n // strength:response.data.stats[1].base_stat, // atack\n // defense:response.data.stats[2].base_stat,\n // speed:response.data.stats[5].base_stat,\n // height:response.data.height,\n // weight:response.data.weight,\n personalized: false,\n img:response.data.sprites.other.dream_world.front_default,\n id:response.data.id, // the id force to keep the correlation because it is now which id has each pokemon by the fans\n })\n pokemon.addTypes(pokeTypes)\n }\n catch(error){\n console.log('Error reading a pokemon object')\n console.error(error);\n }\n \n\n });\n console.log('Pokemons Loaded!')\n }\n catch(error){\n console.error(error);\n }\n\n}", "title": "" }, { "docid": "de0058a418f4c4b267980fdd39dcff0a", "score": "0.49518734", "text": "function gameLoop() {\n for (let elem of gameLoopArray) {\n elem.update();\n };\n}", "title": "" }, { "docid": "393d2b2cde5a887910a2aba398f4b591", "score": "0.49496117", "text": "function drawKeypoints() {\n // Loop through all the poses detected\n for (let i = 0; i < poses.length; i++) {\n // For each pose detected, loop through all the keypoints\n let pose = poses[i].pose;\n for (let j = 0; j < pose.keypoints.length; j++) {\n // A keypoint is an object describing a body part (like rightArm or leftShoulder)\n let keypoint = pose.keypoints[j];\n // Only draw an ellipse is the pose probability is bigger than 0.2\n if (keypoint.score > 0.4) {\n push();\n fill(255);\n stroke(20);\n strokeWeight(4);\n ellipse(round(keypoint.position.x), round(keypoint.position.y), 8, 8);\n pop();\n }\n }\n }\n}", "title": "" }, { "docid": "3b33c61a5dba90c00d714449fd5f339b", "score": "0.4942501", "text": "favoritePokemon() {\n return this.pokemons.filter((mon) => mon.isFavorite);\n }", "title": "" }, { "docid": "1b1f1b3ecb9b5023a92e6f31f164ad4a", "score": "0.49411878", "text": "function redrawAllGameItems() {\n for (var i = 0; i < snakeArray.length; i++) {\n redrawGameItem(snakeArray[i]);\n }\n redrawGameItem(apple);\n }", "title": "" }, { "docid": "ab6cac8571c7f450a6b179f6afd33283", "score": "0.49368653", "text": "function generateNewPokemon() {\n pokemonToMatch = currentMon[shufflePokemon(currentMon)];\n pokeData = pokeData.filter(pokemon => pokemon.name !== pokemonToMatch.name);\n\n displayPokemonImage();\n loadPokemonNames();\n checkPokemonAnswer();\n\n}", "title": "" }, { "docid": "f9c7325a99923f2f93b211fc21eab1fd", "score": "0.49276727", "text": "function fetchPets() {\n fetch(petUrl)\n .then((resp) => resp.json())\n .then((petArray) => {\n petArray.forEach((pet) => {\n renderPets(pet)\n simplePetArray.push(pet.name)\n })\n })\n}", "title": "" } ]
37eb20ad5335314bca7feb60304750af
Copyright 2013present, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. Mostly taken from ReactPropTypes.
[ { "docid": "f5f91fd8281e28d69ca70186fae8081b", "score": "0.0", "text": "function createChainableTypeChecker(validate) {\n\t function checkType(isRequired, props, propName, componentName, location, propFullName) {\n\t var componentNameSafe = componentName || '<<anonymous>>';\n\t var propFullNameSafe = propFullName || propName;\n\n\t if (props[propName] == null) {\n\t if (isRequired) {\n\t return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));\n\t }\n\n\t return null;\n\t }\n\n\t for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {\n\t args[_key - 6] = arguments[_key];\n\t }\n\n\t return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));\n\t }\n\n\t var chainedCheckType = checkType.bind(null, false);\n\t chainedCheckType.isRequired = checkType.bind(null, true);\n\n\t return chainedCheckType;\n\t}", "title": "" } ]
[ { "docid": "21b7886ba021db371f3e7d82e60c04a2", "score": "0.69600815", "text": "static get propTypes() {\n return {\n config: React.PropTypes.object,\n test: React.PropTypes.string,\n };\n }", "title": "" }, { "docid": "7c51c01730f51e652c814a3bdaeda801", "score": "0.67464024", "text": "function isReactPropTypes(path) {\n return (\n (path.node.object.type === 'MemberExpression' &&\n path.node.object.object &&\n path.node.object.object.name === 'PropTypes') || (\n path.node.object.name === 'PropTypes' && !path.node.object.object)\n );\n}", "title": "" }, { "docid": "aaa5604c90c4d6da8caf85e141c0cb54", "score": "0.6627926", "text": "function shim() {\n\t\t\t\t\t\tinvariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n\t\t\t\t\t}", "title": "" }, { "docid": "618a95426c1c236322e125fd949ca694", "score": "0.6464575", "text": "static get propTypes() { \n return {\n error: PropTypes.bool,\n title: PropTypes.string,\n stats: PropTypes.number,\n statsSymbol: PropTypes.string,\n footerInfo: PropTypes.object,\n }; \n }", "title": "" }, { "docid": "a87e29450abb7cf61ac4939e4d0a4b4e", "score": "0.6228513", "text": "function shim() {\n invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "6f008930660d14471f1557bf4ec074ee", "score": "0.6205233", "text": "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "0e04aaa6d9c306486104906a5417159e", "score": "0.6092164", "text": "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "title": "" }, { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.5801135", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "7fae3cebb78ce16c055d339d3dc47ee8", "score": "0.5762497", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "2969ee385ff3ef1bb821652c6fa5ef1e", "score": "0.5722972", "text": "function getPropType(propValue) {\r\n\t var propType = typeof propValue;\r\n\t if (Array.isArray(propValue)) {\r\n\t return 'array';\r\n\t }\r\n\t if (propValue instanceof RegExp) {\r\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\r\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n\t // passes PropTypes.object.\r\n\t return 'object';\r\n\t }\r\n\t if (isSymbol(propType, propValue)) {\r\n\t return 'symbol';\r\n\t }\r\n\t return propType;\r\n\t}", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.5713348", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "900c7f44e7a82704ea55f6a2cdd906cf", "score": "0.5712798", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "title": "" }, { "docid": "900c7f44e7a82704ea55f6a2cdd906cf", "score": "0.5712798", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "title": "" }, { "docid": "666548876675c72cadabf4fe0eb08eb2", "score": "0.5692564", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "666548876675c72cadabf4fe0eb08eb2", "score": "0.5692564", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "666548876675c72cadabf4fe0eb08eb2", "score": "0.5692564", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "54b46721e01bb5e59f75b23fa5ad4daf", "score": "0.5673346", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "title": "" }, { "docid": "512b40bacae23f1a84005ee564e1fd40", "score": "0.5662301", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof$1(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "f0ecc5f9c4c7c206a4a25efa1111beab", "score": "0.56555575", "text": "function getPropType(propValue) {\n\t\t\t\t\t\tvar propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t\t\t\t\t\tif (Array.isArray(propValue)) {\n\t\t\t\t\t\t\treturn 'array';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (propValue instanceof RegExp) {\n\t\t\t\t\t\t\t// Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t\t\t\t\t\t// 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t\t\t\t\t\t// passes PropTypes.object.\n\t\t\t\t\t\t\treturn 'object';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isSymbol(propType, propValue)) {\n\t\t\t\t\t\t\treturn 'symbol';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn propType;\n\t\t\t\t\t}", "title": "" } ]
9341365091b453d920b625e28c3d6859
Make a piller at perticular point
[ { "docid": "8b291884c4c51d266b58a97b5c4f804e", "score": "0.67853594", "text": "function piller(strPiller){\n p5.fill('#404040');\n p5.beginShape();\n p5.vertex(strPiller , height*bottom);\n p5.vertex(strPiller + 15, height*bottom + 30);\n p5.vertex(strPiller + 15, height*bottom + 60);\n p5.vertex(strPiller + 35, height*bottom + 60);\n p5.vertex(strPiller + 35, height*bottom + 30);\n p5.vertex(strPiller + 50 , height*bottom);\n p5.endShape(p5.CLOSE);\n}", "title": "" } ]
[ { "docid": "b29a63706f397bb2bc41c78d0cdda1ae", "score": "0.6030132", "text": "function addP() {\n var pill;\n // offsets starts for smoother entry\n var st = DIRECTION == -1 ? canvas.height + 20 : -20;\n\n for (var i = 0; i < NUM; i++) {\n pill = new Shape(round3(rand(0, canvas.width)), round3(rand(0,st)));\n pills.push(pill);\n }\n}", "title": "" }, { "docid": "f3f9e98e4678c34337de1c2e31e42a39", "score": "0.6018625", "text": "function shiftPoint(point) {\n var coords = {\n x: point.originX - 400 + Math.random() * 800,\n y: point.originY - 400 + Math.random() * 800,\n ease: Circ.easeInOut\n };\n TweenLite.to(point, 1 + 1 * Math.random(), coords);\n}", "title": "" }, { "docid": "50b929af99ba1026f4a04923d0e1e2c9", "score": "0.59479487", "text": "Paraboloid(){\n\t\tlet parab = Math.pow(this.x,2) + Math.pow(this.y, 2); \n\t\treturn parab; \n\t}", "title": "" }, { "docid": "2a2734fe73e64e3619766ecd7e448c6c", "score": "0.59440565", "text": "function renew_point(i) {\n var offset = point_offset(i);\n\n points[offset+0] = start_spread*(Math.random()-0.5);\n points[offset+1] = start_spread*(Math.random()-0.5);\n points[offset+2] = start_distance;\n points[offset+3] = point_colors[\n Math.floor(Math.random()*point_colors.length)\n ];\n }", "title": "" }, { "docid": "cef071c2ad11b71ab08a36329c3dd917", "score": "0.5904762", "text": "function geomrand(p){ return Math.floor(exprand( -Math.log(1-p) )); }", "title": "" }, { "docid": "43f800ca5d52b654aa7eb31dab04a54f", "score": "0.5797591", "text": "p(pos) { return Math.ceil((pos-1)/this.d); }", "title": "" }, { "docid": "5536830427bb7463a45521d660600c43", "score": "0.5737804", "text": "function diagR(x,y){\r\n for (i=0; i<=20;i++){\r\n x+=1;\r\n y+=1;\r\n let pixelO = ppg.get(x , y);\r\n fill(pixelO);\r\n noStroke();\r\n ellipse(x , y + 10 , 2, 5);\r\n }\r\n}", "title": "" }, { "docid": "2fe2071b914bc2677a7c6d7db2f08206", "score": "0.5718043", "text": "lerp(p, t) {\n const ref = Point.create(p);\n return new Point((1 - t) * this.x + t * ref.x, (1 - t) * this.y + t * ref.y);\n }", "title": "" }, { "docid": "61a9ce9639d645f32ff609d478408cfe", "score": "0.56920636", "text": "plan(x, d) { x = x * 12 / d - 6; return 1.4 * Math.exp(x) / (Math.exp(x) + 1) }", "title": "" }, { "docid": "c687405a4b90aa5d8937bbf8a98859f7", "score": "0.5650817", "text": "function perp( v ) {\n let theta = -90 * Math.PI / 180;\n let cs = Math.cos(theta);\n let sn = Math.sin(theta);\n return {\n x: v.x * cs - v.y * sn,\n y: v.x * sn + v.y * cs,\n }\n}", "title": "" }, { "docid": "7e85a3b7556dfe5743fb41c5def48ccc", "score": "0.5647532", "text": "function generateLowerRight(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=21;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX+x;\r\n maxY=maxY+y;\r\n let pixelN = ppg.get((width/2)+x , (height/2)+y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12,3);\r\n }\r\n}", "title": "" }, { "docid": "8d21f1bbe7349456291aa4c55828e37e", "score": "0.5642658", "text": "function computeLocation(t){\n //We know where zero goes:\n if(t==0){\n return origin;\n }\n //Otherwise...\n //first compute the p-adic valuation of i,\n var val=1;\n while((t)%(p**val)==0){\n val++;\n }\n //Higher powers of p should be closer to the origin\n radius = screenHeight/(3*val*val);\n //Figure out our rotation;\n var theta = 2*Math.PI*t/p**n\n return [origin[0] + radius*Math.cos(theta),origin[1] + radius*Math.sin(theta)];\n\n}", "title": "" }, { "docid": "2fc6cdda4961e4c80398a68bd661bd58", "score": "0.5633822", "text": "function followPlank(x,y){\n\t\tthis.y = y;\n\t\tthis.x = x;\n\t}", "title": "" }, { "docid": "e26ec17df2361dbccf2fbf711737b070", "score": "0.56200826", "text": "function diagL(x,y){\r\n for (i=0; i<=20;i++){\r\n x-=1;\r\n y+=1;\r\n let pixelO = ppg.get(x , y);\r\n fill(pixelO);\r\n noStroke();\r\n ellipse(x , y + 10 , 5, 2);\r\n }\r\n}", "title": "" }, { "docid": "0caadc044228d58613eaf5d10c80ee74", "score": "0.56182903", "text": "function dostep() {\n let tocopy = points.length; // the length of generation n-1\n\n // replicate the picture 4 times and move to the corners.\n halfthesize(tocopy); // half the graphic\n copytori(1,tocopy); // copy SW\n copytori(2,tocopy); // copy SE\n copytori(3,tocopy); // copy NE and mirror on y=x\n replaceNW(0,tocopy); // move NW and mirror on y=-x\n}", "title": "" }, { "docid": "ec0589b7adc35e54dd1c24d9c80cbe43", "score": "0.5603161", "text": "function drawDemo(t,duration) {\n push();\n translate(3*width/4,height/2);\n strokeWeight(1);\n let p = t/(duration);\n let g = (1-p)*100;\n stroke(40);\n // the first point of generation n and n-1\n let v1 = points3[0].copy();\n circle(v1.x,cy(v1.y),2)\n let v2 = points4[0].copy();\n circle(v2.x,cy(v2.y),2)\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // line gen n to gen n-1 for the first point\n drawarrow(v1,v2);\n // the first point of the moving line\n v1.mult(p).add(v2.mult(1-p));\n stroke(255);\n circle(v1.x,cy(v1.y),2) // first point of the moving line\n for (let i=1;i<points3.length;i++) {\n // the 2 generations\n stroke(40)\n let v11 = points3[i-1]; \n let v12 = points3[i];\n line(v11.x,cy(v11.y),v12.x,cy(v12.y)) // line generation n-1\n circle(v12.x,cy(v12.y),2)\n let v21 = points4[i-1]\n let v22 = points4[i]\n line(v21.x,cy(v21.y),v22.x,cy(v22.y)) // line generation n\n circle(v22.x,cy(v22.y),2)\n line(v12.x,cy(v12.y),v22.x,cy(v22.y)); // line gen n to gen n-1\n drawarrow(v12,v22);\n // the line in between\n v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n stroke(255);\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n circle(v2.x,cy(v2.y),2)\n }\n pop();\n}", "title": "" }, { "docid": "a40872825a66c6f623a0cc071ee9da91", "score": "0.55782586", "text": "function move_right(a_pt, amount) {\n return make_point(a_pt.x + amount, a_pt.y);\n}", "title": "" }, { "docid": "bb8665a5f5c5e39838bdf4e437cc97b9", "score": "0.55669665", "text": "function rougher(pts) {\n var mids = [];\n var diffs = [];\n var npts = [pts[0]];\n for (var i = 1; i < pts.length; i++) {\n var last = pts[i-1];\n var pt = pts[i];\n var diff = pt.y - last.y; \n var mp = midPt(pt,last);\n var my = last.y + diff / 2;\n //mids.push(mp);\n\n //diffs.push(diff);\n //var xd = (pt.x - last.x) / 3;\n \n var a = newPt(last.x +1, my + diff/20);\n var b = newPt(last.x + 2, my - diff/20);\n npts.push(a);\n npts.push(b);\n npts.push(newPt(pt.x,pt.y));\n }\n \n return npts;\n}", "title": "" }, { "docid": "0dcfb7c2ed8b297684bdfa64d0468e62", "score": "0.55636877", "text": "function poisonLokation(number) {\n poisonArray = [];\n for (let i = 0; i < number; i++) {\n let vx = Math.floor(Math.random() * canvas.width / gitter) * gitter;\n let vy = Math.floor(Math.random() * canvas.height / gitter) * gitter;\n poisonArray.push([vx, vy]);\n }\n}", "title": "" }, { "docid": "32f29ea4b7edc2b06b0c19325bde3f78", "score": "0.5540316", "text": "generateWanderPoint (map, p, dir) {\n const points = [];\n let x;\n let y;\n switch (dir) {\n case 'north':\n x = [floor(-this.wanderSteps / 2), floor(this.wanderSteps / 2)];\n y = [-this.wanderSteps, 0];\n break;\n case 'northeast':\n x = [0, this.wanderSteps];\n y = [-this.wanderSteps, 0];\n break;\n case 'east':\n x = [0, this.wanderSteps];\n y = [floor(-this.wanderSteps / 2), floor(this.wanderSteps / 2)];\n break;\n case 'southeast':\n x = [0, this.wanderSteps];\n y = [0, this.wanderSteps];\n break;\n case 'south':\n x = [floor(-this.wanderSteps / 2), floor(this.wanderSteps / 2)];\n y = [0, this.wanderSteps];\n break;\n case 'southwest':\n x = [-this.wanderSteps, 0];\n y = [0, this.wanderSteps];\n break;\n case 'west':\n x = [-this.wanderSteps, 0];\n y = [floor(-this.wanderSteps / 2), floor(this.wanderSteps / 2)];\n break;\n case 'northwest':\n x = [-this.wanderSteps, 0];\n y = [-this.wanderSteps, 0];\n break;\n default:\n console.error('generateWanderPoints invalid direction');\n return null;\n }\n if (x[0] < 0) x[0] = 0;\n if (x[1] > map.width - 1) x[1] = map.width - 1;\n if (y[0] < 0) y[0] = 0;\n if (y[1] > map.height - 1) y[1] = map.height - 1;\n for (let i = x[0]; i < x[1]; ++i) {\n for (let j = y[0]; j < y[1]; ++j) {\n points.push(map.point(i, j));\n }\n }\n if (points.length === 0) return null;\n return random(points);\n }", "title": "" }, { "docid": "25ec5e21d142c54caea88f60e34e6453", "score": "0.5536924", "text": "function reMap(p) {\n if (!p) {\n console.error('Null Point given for remap!');\n return {x: 0, y:0};\n }\n\n var pa = config.printArea;\n pa = {\n x: config.noMirror ? pa.x : pa.l,\n l: config.noMirror ? pa.l : pa.x,\n y: pa.y,\n t: pa.t\n }\n\n var b = paper.view.bounds;\n return {\n x: Math.round(map(b.width - (p.x - b.x), 0, b.width, pa.x, pa.l) * 1000) / 1000,\n y: Math.round(map(p.y - b.y, 0, b.height, pa.t, pa.y) * 1000) / 1000\n };\n }", "title": "" }, { "docid": "6ad47b66ffb0347d76beb87c0ad0dc5b", "score": "0.5535545", "text": "function randomPoint(){\n\tx =(Math.random()*200)-100;\n\ty =(Math.random()*200)-100;\n\n\treturn new Point(x,y);\n}", "title": "" }, { "docid": "e87731accbdff40234cff80626007d98", "score": "0.5533423", "text": "generatePoints() {\n this.points = [];\n this.currPointY = [];\n var i;\n var min = 0.1;\n var max = 0.98;\n for(i = 0; i < this.numPoints; i++ ){\n this.points[i] = Math.random() * (max - min) + min;\n this.currPointY[i] = 0;\n }\n this.poi = -1; //reset\n }", "title": "" }, { "docid": "31f4694cf2c05714391794083f7d82d9", "score": "0.55249524", "text": "function generateLowerLeft(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=21;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX-x;\r\n maxY=maxY+y;\r\n let pixelN = ppg.get((width/2)-x , (height/2)+y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12, 7);\r\n }\r\n}", "title": "" }, { "docid": "22d761a983c8b1802b30ce25b6f21fa1", "score": "0.55121493", "text": "function draw_step(){\n // perform these many iterations\n for (let i = 0; i < controllers.iterations; i++) {\n // set the styling of points\n strokeWeight(controllers.pointStroke);\n // stroke(\"#EC7272\");\n stroke(255);\n // pick next points\n let next = random(points);\n // skip to match condition\n if (controllers.notPrevious && next === previous) continue;\n if (controllers.noAdjacent) {\n var indexOfPrev = points.indexOf(previous)\n if (abs(points.indexOf(next) - indexOfPrev) == 2) continue;\n }\n if (controllers.no2PreviousSame && earlier === previous){\n var indexOfPrev = points.indexOf(previous);\n var indexOfNext = points.indexOf(next);\n if (indexOfNext === mod_index(indexOfPrev-1)) continue;\n if (indexOfNext === mod_index(indexOfPrev+1)) continue;\n }\n // universal step, update current and plot it\n current.x = lerp(current.x, next.x, controllers.compressionRatio);\n current.y = lerp(current.y, next.y, controllers.compressionRatio);\n // if (points.indexOf(next)==0)\n // {\n // // current = rotation_x.mult(current.x).add(rotation_y.mult(current.y));\n // current = createVector(\n // p5.Vector.dot(createVector(0, 1), current),\n // p5.Vector.dot(createVector(-1, 0), current)\n // )\n // }\n point(current.x, current.y);\n // current is nesxt\n earlier = previous;\n previous = next;\n }\n}", "title": "" }, { "docid": "88c42bbce778742fee3bc150ad049b0c", "score": "0.5488527", "text": "function randomPointOf(n, bias, val) {\n let h = (y - 2) * refHei;\n let w = ((x - bx) / 2) * refWid;\n let spread = Math.sqrt(bias);\n let xs = w / spread;\n let ys = h / spread;\n n = n % bias;\n let ny = (n % spread) * ys;\n let nx = (n / spread) * xs;\n let xx = 0;\n let yy = 0;\n let offsetY = 0;\n if(is_mobile == true){\n offsetY = refHei*1.5;\n } else{\n offsetY = refHei*1.2;\n }\n if (val == 1) {\n xx = containerWidth - (Math.random() * xs + nx);\n yy = (Math.random() * ys + ny) + (offsetY);\n } else {\n xx = (Math.random() * xs + nx);\n yy = (Math.random() * ys + ny) + (offsetY); \n }\n \n return [xx.toFixed(1), yy.toFixed(1)];\n}", "title": "" }, { "docid": "1ccdd6d7edb71c31127908c6b0bd6c7b", "score": "0.54806453", "text": "function get_point_x(step) {\n\treturn 73 + step * 50;\n}", "title": "" }, { "docid": "c332703afdfd5b016f6c8565d36d9f14", "score": "0.5441376", "text": "generatePOI() {\n this.poi = Math.floor(Math.random() * this.numPoints); //point we want to select \n }", "title": "" }, { "docid": "da7cfa769c6d9f7785bbe0bf46e1bb93", "score": "0.5434878", "text": "createPowerPellet(x, z) {\n var puntoGrande = new Punto(0.2);\n puntoGrande.position.set(x, 0, z);\n puntoGrande.name = \"punto_grande_\" + z + \"_\" + x;\n this.add(puntoGrande);\n this.game.increaseRemainingDots();\n }", "title": "" }, { "docid": "a85445a84e673d6b8d2864a448c0d0b3", "score": "0.54327166", "text": "function fixPoint(p) {\n return new Point( p.x + W /2, -p.y + H / 2 );\n}", "title": "" }, { "docid": "c91d5b97a3d2dfd7f755f70c7ccba0ee", "score": "0.54247904", "text": "doubling(xP,yP){\n let m = this.mod( (3 * xP**2 + this.a ) * this.modinverse(2*yP))\n let xR = this.mod(m ** 2 - 2 * xP)\n let yR = this.mod(m*(xP - xR) - yP)\n return [xR,yR]\n }", "title": "" }, { "docid": "c7950458566e8261810f5ea101a70bb8", "score": "0.54201293", "text": "function shift(point){\n\t\tpoint.x =point.x +d;\n\t\tpoint.y= height-point.y;\n\t}", "title": "" }, { "docid": "3c8fb41db920c4e80672c1279421b51c", "score": "0.5411538", "text": "function point_offset(i) {\n return 4*i;\n }", "title": "" }, { "docid": "b7096f0b89ec589f26dcdd995ef0323f", "score": "0.5411008", "text": "function increaseSpd() {\n\tif(points % 4 == 0) {\n\t\tif(Math.abs(ball.vx) < 15) {\n\t\t\tball.vx += (ball.vx < 0) ? -1 : 1;\n\t\t\tball.vy += (ball.vy < 0) ? -2 : 2;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e0ef4af6c6a1cf4be7a204f8c47ed9ab", "score": "0.5402118", "text": "function PointOnCurve(p0 : Vector3, p1 : Vector3, p2 : Vector3, p3 : Vector3, t : float, protector : Vector3)\n{\n\tvar result : Vector3;\n\t\n \n\tvar t0 : float = ((-t + 2f) * t - 1f) * t * 0.5f;\n\tvar t1 : float = (((3f * t - 5f) * t) * t + 2f) * 0.5f;\n\tvar t2 : float = ((-3f * t + 4f) * t + 1f) * t * 0.5f;\n\tvar t3 : float = ((t - 1f) * t * t) * 0.5f;\n \n \t\n\tresult.x = p0.x * t0 + p1.x * t1 + p2.x * t2 + p3.x * t3;\n\tresult.y = p0.y * t0 + p1.y * t1 + p2.y * t2 + p3.y * t3;\n\tresult.z = p0.z * t0 + p1.z * t1 + p2.z * t2 + p3.z * t3;\n \tif(result.x==0&&result.z==0){\n \t\tresult.x = protector.x;\n \t\tresult.z = protector.z;\n \t\t////Debug.Log(\"<color=red>Fatal error:</color> n:\" + n + \"; i:\" + i + \"; indice: \" + indice);\n \t}\n\treturn result;\n}", "title": "" }, { "docid": "30e4bc7a76c785359a9d8688f2fedb2f", "score": "0.53985727", "text": "function calculatePoint(){\n var M = 40;\n var L = 3;\n var startPoint = vec2(115, 121);\n\n var currPoint_x = startPoint[0];\n var currPoint_y = startPoint[1];\n var nextPoint_x = startPoint[0];\n var nextPoint_y = startPoint[1];\n\n points = [];\n for( var i = 0; points.length < numberPoints; i++){\n nextPoint_x = M * (1 + 2*L) - currPoint_y + Math.abs(currPoint_x - L * M);\n nextPoint_y = currPoint_x;\n\n // to normalize this I think need to know the max value of x,y\n // instead of /canvas.width or /canvas.height\n points.push(vec2(nextPoint_x / canvas.width, nextPoint_y / canvas.height));\n // points.push(vec2(nextPoint_x, nextPoint_y));\n currPoint_x = nextPoint_x;\n currPoint_y = nextPoint_y;\n // console.log(points[i]);\n }\n}", "title": "" }, { "docid": "040c5df6ae1cb9d83be082d3db059ec1", "score": "0.5396521", "text": "function drawPerlin() {\n\t\t\tfor(var x = bbox.xl; x<bbox.xr; x++) {\n\t\t\t\tfor(var y = bbox.yt; y<bbox.yb; y++) {\n\t\t\t\t\tvar val = Math.floor(256 * getPerlin({x: x, y: y, z: 0}, -0.3, 0.3, 20),16);\n\t\t\t\t\tctx.fillStyle = 'rgb(' + val + ',' + val + ',' + val + ')';\n\t\t\t\t\tctx.fillRect(x,y,1,1);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "02035df83c2ab32a415ab330bc53e9d8", "score": "0.539384", "text": "sample_perlin(x,y){\n var sample = this.perlin_generator.GetPerlinNoise(x/64 ,y/64)+\n 0.5*this.perlin_generator.GetPerlinNoise(x/8 ,y/8)\n 0.25*this.perlin_generator.GetPerlinNoise(x/4 ,y/4);\n return (Math.pow(sample+1,1.5)-1)*4;\n }", "title": "" }, { "docid": "b66ab6712a558955216bd447b3001737", "score": "0.53918725", "text": "function Wander(){\n\twayPoint= Vector3(Random.Range(transform.position.x - Range, transform.position.x + Range), 1 , Random.Range(transform.position.z - Range, transform.position.z + Range));\n\twayPoint.y = 4; ///*******change to transform's Y position\n\t\n\tmyTransform.LookAt(wayPoint);\n\t\n}", "title": "" }, { "docid": "4ffd5edb513c384150dc94f4824fcd43", "score": "0.5389886", "text": "function pickLocForPellet() {\n\tvar cols = floor(windowWidth/s.sWidth);\n\tvar rows = floor(windowHeight/s.sHeight);\n\tpelletPosition =createVector(floor (random(cols)), floor(random(rows)));\n\tpelletPosition.x = constrain (pelletPosition.x * s.sWidth, 20, windowWidth-s.sWidth-60);\n\tpelletPosition.y = constrain (pelletPosition.y * s.sHeight, 20, windowWidth-s.sHeight-20);\n}", "title": "" }, { "docid": "1bb6aa63d551785fb58583d0f7db923a", "score": "0.53885674", "text": "ipow (p) {\n\t\t\tconst c = Complex.C (1, 0);\n\t\t\tif (p > -1) {\n\t\t\t\tfor (let i = 0; i < p; i++) {\n\t\t\t\t\tconst _x = this.x * c.x - this.y * c.y;\n\t\t\t\t\tconst _y = this.y * c.x + this.x * c.y;\n\t\t\t\t\tc.x = _x;\n\t\t\t\t\tc.y = _y;\n\t\t\t\t}\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\treturn c.div (this).ipow (-p);\n\t\t}", "title": "" }, { "docid": "00cd3ad036f5c5c58aa1ef169ae457eb", "score": "0.5388276", "text": "function moveTo(point) {\n return \" M\" + _utils_Math__WEBPACK_IMPORTED_MODULE_0__[\"round\"](point.x, 4) + \",\" + _utils_Math__WEBPACK_IMPORTED_MODULE_0__[\"round\"](point.y, 4) + \" \";\n}", "title": "" }, { "docid": "8f72630a8a929e7f539bde03e86a305a", "score": "0.5385777", "text": "effect(){\n return(player.points.pow(0.25).times(0.5).plus(1))\n }", "title": "" }, { "docid": "f0ae8ba61ffdb7cc4877a62de031c1fa", "score": "0.5385732", "text": "function topple() {\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n nextpiles[x][y] = sandpiles[x][y];\n }\n }\n\n // adjust the critical height if needed\n criticalHeight = 4;\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n let num = sandpiles[x][y];\n if (num >= criticalHeight) {\n nextpiles[x][y] -= 4;\n if (x + 1 < width)\n nextpiles[x + 1][y]++;\n if (x - 1 >= 0)\n nextpiles[x - 1][y]++;\n if (y + 1 < height)\n nextpiles[x][y + 1]++;\n if (y - 1 >= 0)\n nextpiles[x][y - 1]++;\n }\n }\n }\n\n let tmp = sandpiles;\n sandpiles = nextpiles;\n nextpiles = tmp;\n}", "title": "" }, { "docid": "89c35aa5ee61a687cf0ce8b7e12895f9", "score": "0.53611", "text": "function snap(p) {\n return Math.floor(p / vs) + N/2\n}", "title": "" }, { "docid": "f9c858be96bf5b531a354e324ab988bb", "score": "0.53567886", "text": "generateBypassShifts() {\n let radiusLimit = this.radiusLimit;\n let cx, cy;\n for (let radius = 1; radius < radiusLimit; radius++) {\n // TL->TR\n cy = -radius;\n for (cx = -radius; cx <= radius; cx++) {\n this.points.push(new FreeAroundPoint(cx, cy, radius, Math.sqrt(cx * cx + cy * cy)));\n }\n // TR->BR\n cx = radius;\n for (cy = -radius + 1; cy <= radius; cy++) {\n this.points.push(new FreeAroundPoint(cx, cy, radius, Math.sqrt(cx * cx + cy * cy)));\n }\n // BR->BL\n cy = radius;\n for (cx = radius - 1; cx >= -radius; cx--) {\n this.points.push(new FreeAroundPoint(cx, cy, radius, Math.sqrt(cx * cx + cy * cy)));\n }\n // BL->TL\n cx = -radius;\n for (cy = radius - 1; cy >= -radius + 1; cy--) {\n this.points.push(new FreeAroundPoint(cx, cy, radius, Math.sqrt(cx * cx + cy * cy)));\n }\n }\n }", "title": "" }, { "docid": "93595dd2a5cb6674ec993b9e1b7fcb44", "score": "0.5356194", "text": "function myDraw(t,duration) {\n let p = t/duration;\n let g = (1-p)*100\n \n for (let i=1;i<points.length;i++) {\n let f = (i/points.length)*100\n stroke(g,f,100);\n let v11 = points[i-1]; \n let v12 = points[i];\n let v21 = points2[i-1]\n let v22 = points2[i]\n let v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n let v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n }\n}", "title": "" }, { "docid": "370b155d03af2f14946bc79f83beb40b", "score": "0.53542495", "text": "function draw (per, color, t0, t1, x, y, pThick) {\n if (arguments.length === 6) pThick = 1; // percent thickness\n ctx.fillStyle = color;\n ctx.beginPath ();\n\n // Draws the largest radius first\n ctx.arc (x, y, per * r, t0, t1, false);\n\n // Then covers the circle formed by backtracking over the smaller radius\n ctx.arc (x, y, r1 - r * (1 - pThick) * (1 - per), t1, t0, true);\n //ctx.arc (x, y, per * r1 + (1 - pThick) * (r - r1), t1, t0, true);\n\n // Fills in the newly formed path\n ctx.fill ();\n }", "title": "" }, { "docid": "fd8ceaefe5663f7729c675dacf717395", "score": "0.53539157", "text": "function lerp(a, b, proportion) { return a + (b-a)*proportion; }", "title": "" }, { "docid": "af2a2eb0f57b8dcfbf5a972039f1be9e", "score": "0.53484875", "text": "function project(c, p, y) {\n return {\n x: c.x + (p.x-c.x) / (p.y-c.y) * (y-c.y),\n y: y\n };\n}", "title": "" }, { "docid": "388d526107672c345b53dbf328145ebf", "score": "0.532768", "text": "function newGoal (){\n //obtain random values within the bounds\n var randomFreq = Math.random() * (rateMax - rateMin) + rateMin;\n var randomAmount = Math.random() * (amountMax - amountMin) + amountMin;\n //update the position of the hole.\n setHolePos(randomFreq,randomAmount);\n}", "title": "" }, { "docid": "31a4792024433b519fe95ad42d9beea4", "score": "0.5326865", "text": "function circle17(x, y, r){\n context.beginPath()\n for(let a=0; a<40; a++){\n let rt = r * Math.pow(Math.random(), 1/10)\n let theta = Math.random() * Math.PI * 2\n const xoff = Math.cos(theta) * rt + x\n const yoff = Math.sin(theta) * rt + y\n context.lineTo(xoff, yoff)\n }\n context.stroke()\n}", "title": "" }, { "docid": "cd87037921466b75e4a578a8c19f96b4", "score": "0.53223944", "text": "move() \n\t{\n\t\tthis.raindrop.nudge(0,-1,0);\n\n\t\tif (this.raindrop.getY() <= this.belowplane ) \n\t\t{\n\t\t\t//setting the y value to a certain number\n\t\t\tthis.raindrop.setY(random(200,400))\n\t\t}\n\t}", "title": "" }, { "docid": "ba2df6b7c8bfbb4d30bed7578149707c", "score": "0.5318159", "text": "function pt(r, a) {\n return [r * Math.cos(a) + cx, cy - r * Math.sin(a)];\n }", "title": "" }, { "docid": "ca949605e51cbc9a7610f2c877ec006b", "score": "0.5313883", "text": "function getRandomPoints() {\n let count = 0,\n x = 0,\n y = 0,\n y_function = 0;\n\n while (count < cant_points) {\n x = Math.random() * (x_to - x_from) + x_from;\n y = Math.random() * (y_to - y_from) + y_from;\n\n y_function = evaluate(x, funcion);\n\n if (y > 0) {\n y < y_function\n ? insidePoints.push({ x: x, y: y })\n : outsidePoints.push({ x: x, y: y });\n } else {\n y > y_function\n ? insidePoints.push({ x: x, y: y })\n : outsidePoints.push({ x: x, y: y });\n }\n\n count++;\n }\n }", "title": "" }, { "docid": "319a60bb0c134e30e8c13b7032e98048", "score": "0.53110915", "text": "function newpos() {\n // Wherever particles are injected, the tree will tend to grow faster\n // toward it. Ideally, particles wander in from infinity; the best we\n // could do is to have them wander in from the edge of the field.\n // But in order to have the rendering occur in a reasonable time when\n // the seed is small, without too much visible bias, we instead place\n // the particles in a coarse grid. The final tree will cover every\n // point on the grid.\n //\n // There's probably a better strategy than this.\n x = Math.floor(Math.random()*(width/seedResolution))*seedResolution;\n y = Math.floor(Math.random()*(height/seedResolution))*seedResolution;\n }", "title": "" }, { "docid": "5e82fb2c09413e527bf35de6f3073cb3", "score": "0.5291558", "text": "function drawHoverPoint(pt) {\n // checking browser for Canvas support\n if (plane.getContext) {\n // when integer snap is enabled, point will only\n // be drawn on discrete coordinates. Otherwise translation does nothing\n let translation = integerSnapTranslate(); // returns coord pair object\n\n // draw point\n let ctx = plane.getContext('2d');\n ctx.beginPath();\n ctx.arc(translation.x, translation.y, 5, 0, 2 * Math.PI, true);\n ctx.fillStyle = \"#FF6A6A\";\n ctx.fill();\n\n // get coordinates for point using mouse screen position\n let planeCoord = mouseToPlaneTranslate(translation.x, translation.y);\n // save pixel position of point relative to origin of canvas\n pt.canvasPosX = translation.x;\n pt.canvasPosY = translation.y;\n\n // save current coordinates in point\n pt.x = planeCoord.x;\n pt.y = planeCoord.y;\n }\n}", "title": "" }, { "docid": "64b34d14a23019b3bca07a8589391522", "score": "0.5291135", "text": "function scegli_parole(parole) {\n var posX= windowWidth/2;\n //var posY= windowHeight/2;\n if (posX > windowWidth) {\n posX = posX - 160;\n // posY = posY - 160;\n \n }\n var a = int(random(parole.length)); \n text(parole[a], posX, posY+40); \n //incremento la posizione su x e y per mettere \"in colonna le parole\"\n posY= posY+30; \n posX = posX + 20;\n push();\n noFill();\n stroke(220);\n curve(random(posX)+40, random(posX)-20, random(posX)+30, random(posX)+200, random(posX)+60, random(posX)-80, random(posX)+40, random(posX)*3)\n pop();\n}", "title": "" }, { "docid": "c4b0b4047fdd7836880de897034667b7", "score": "0.5285969", "text": "function pset(ctx,p){\n//\tctx.fillRect(p.x-s, p.y-s, 2*s+1, 2*s+1);\n//\tlet s=2;\n\tctx.translate(p.x,p.y);\n\tctx.stroke(crossPath);\n\tctx.translate(-p.x,-p.y);\n\t/*ctx.beginPath();\n\tctx.moveTo(p.x-s, p.y-s);\n\tctx.lineTo(p.x+s, p.y+s);\n\tctx.moveTo(p.x-s, p.y+s);\n\tctx.lineTo(p.x+s, p.y-s);\n\tctx.stroke(); // */\n}", "title": "" }, { "docid": "9b533dd9f9c011c00304d431cb02c8df", "score": "0.52712786", "text": "function randPoint () {\n\t\treturn allPoints[Math.floor(Math.random() * allPoints.length)];\n\t}", "title": "" }, { "docid": "09b4631d315ae7d34ebcb20bc9759d19", "score": "0.52696615", "text": "function pointAt(index) {\n var y = Math.floor(index/w) * 1.5;\n var x = ((index + y/3) % w) * rt3;\n return {x: x, y: y};\n }", "title": "" }, { "docid": "08bf7d679f952e4da5a6aaea0ccec737", "score": "0.52687174", "text": "function myLoop(functionality)\n{\n\tfor (var i=500;i>=0;i--)\n\t{\n\t\tif(functionality)\n\t\t{\n\t\t\t// Reduce code- there are many places that use p[i].\n\t\t\tl=p[i];\t\n\t\t\t\n\t\t\t// Update position using custom Xenon theorem (half path between two points)\n\t\t\t// in this case a proportional distance between source and target given by .t\n\t\t\tl.x+=(mx-l.x)/l.speed;\n\t\t\tl.y+=(my-l.y)/l.speed;\n\t\t\t\n\t\t\tl.sx=Math.random();\n\t\t\tl.sy=Math.random();\n\t\t\t$.beginPath();\n\t\t\t\n\t\t\t// Use \"arc\" to draw circle, but 6.28318-coef for special effect.\n\t\t\t$.arc(l.x+l.ox+l.sx, l.y+l.oy+l.sy, ra,0,6.28318-coef);\n\t\t\t$.fillStyle=l.c;\n\t\t\t$.fill();\n\t\t\t$.strokeStyle=l.c;\n\t\t\t$.stroke();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Convert to radian.(will effect length/width of system\n\t\t\tangle = (137.5077 * Math.PI / 180 * i);\t\n\t\t\t\n\t\t\t// Each 5 loops, perform radius variation. Higher the mod #, narrower the partical tunnel\n\t\t\tif ((i % 6) == 0)\t\t\t\t\t\t\n\t\t\t\tradius +=2;\n\t\t\t\n\t\t\t// Hack: use speed to generate color and make it depend on radius.\n\t\t\tspeed = radius + 4;\n\t\t\t\n\t\t\t// Create and initialize particle item. \n\t\t\tpr=new Pa(\n\t\t\t\tMath.cos(angle)*radius,\n\t\t\t\tMath.sin(angle)*radius,\n\t\t\t\t'rgba('+speed*4+','+speed+','+speed*12+','+(0.8)+')',\n\t\t\t\tspeed);\n\t\t\tp.push(pr);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ca418fe5c850d8e6e2c000456686fbe5", "score": "0.5267044", "text": "function probability(curr, opp){\n return 1.0/(1.0 + Math.pow(10, (opp - curr)/400));\n}", "title": "" }, { "docid": "a605c424e1520434ae653bc9029f500b", "score": "0.5265446", "text": "function randomPoint(p) {\n\treturn [(Math.random())*p.width, (Math.random())*p.height]\n}", "title": "" }, { "docid": "e9977bf58da5fbbbe91188c3c74768cf", "score": "0.52649784", "text": "function rotatep(angle, point){\n var R = mat4();\n var ctm = mat4();\n\n var thetaX = Math.acos()\n}", "title": "" }, { "docid": "46338ad0f7a243d7b987fdfb7e530479", "score": "0.52646977", "text": "function acidTrip(x,y,seed,scale) { //looks like acid trip\n var ptA = cash(Math.floor(x/scale)*scale,Math.floor(y/scale)*scale, seed);\n var ptB = cash(Math.ceil(x/scale)*scale,Math.floor(y/scale)*scale, seed);\n var ptC = cash(Math.ceil(x/scale)*scale,Math.ceil(y/scale)*scale, seed);\n var ptD = cash(Math.floor(x/scale)*scale,Math.ceil(y/scale)*scale, seed);\n \n return lerp(lerp(ptA, ptB, x),lerp(ptD, ptC, x), y);\n \n \n }", "title": "" }, { "docid": "a34d635e7cde581fcbc44c45fd7e412d", "score": "0.52620983", "text": "function setPointBalls() {\n let five_point = Math.floor(ball_amount*0.6);\n let fifteen_point = Math.floor(ball_amount*0.3);\n let twentyFive_point = Math.floor(ball_amount*0.1);\n let free_spot;\n\n while (ball_count < ball_amount){\n if (five_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 5;\n five_point--;\n ball_count++;\n }\n if (fifteen_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 15;\n fifteen_point--;\n ball_count++;\n }\n if (twentyFive_point > 0){\n free_spot = findRandomSpot(board_static);\n board_static[free_spot.i][free_spot.j] = 25;\n twentyFive_point--;\n ball_count++;\n }\n if (five_point === 0 && ball_count<ball_amount){\n five_point++;\n }\n }\n\n}", "title": "" }, { "docid": "8b82b72331c83d5dd09125ca6843d9bd", "score": "0.5259687", "text": "function pinPoint(id, pt) {\n document.getElementById(id).hidden = false;\n // Offset to account for radius of pinned point element. Ensures\n // that the center of pinned points align with where the user clicked\n let ptOffset = (document.querySelector(\".point\").offsetWidth / 2);\n // position pinned point element in plane\n document.getElementById(id).style.left = pt.canvasPosX +\n plane.offsetLeft - ptOffset + \"px\";\n // offset adjusts for position of coord plane in document body\n document.getElementById(id).style.top = pt.canvasPosY +\n plane.offsetTop - ptOffset + \"px\";\n pt.pinned = true;\n}", "title": "" }, { "docid": "6db70eda2c23f9be2252d43a6707c2ff", "score": "0.5257623", "text": "addPoisson(Poisson, spacing, random=Math.random) {\n let generator = new Poisson({\n shape: [1000, 1000],\n minDistance: spacing,\n }, random);\n this.points.forEach(p => generator.addPoint(p));\n this.points = generator.fill();\n return this;\n }", "title": "" }, { "docid": "74d9a1a8d6896fb8a2ab0abd72db859c", "score": "0.52525353", "text": "function sampleMarblePosition(center, numP, row, col) {\n\tvar factorized = factor(numP);\n\tfactorArray = factorized.split(\"*\");\n\tvar xadjust = 0;\n\tvar yadjust = 0;\n\txadjust = (120-col*10)/col;\n\tyadjust = (95-row*10)/row;\t\n\treturn {x: center.x + Math.random()*xadjust, y: center.y + Math.random()*yadjust, xtest: center.x, ytest: center.y};\n}", "title": "" }, { "docid": "47f6f9f7defeb661f979f2818e00a7b8", "score": "0.52517796", "text": "function makePoo(){\n pooSize = 20;\n pooX = petX - 20;\n pooY = petY + 20;\n}", "title": "" }, { "docid": "fd7b6e6ade89b402addac5659259e048", "score": "0.525023", "text": "function smearPixels(p) {\n\t// Smear the pixels down from here\n\t// console.log(\"smudge2\")\n\tp.loadPixels();\n\n\t// Get the current mouse position\n\tlet x = Math.floor(p.mouseX)\n\tlet y = Math.floor(p.mouseY)\n\n\tfor (var i = 0; i < 10; i++) {\n\t\tlet x2 = x + i\n\n\t\tlet lastColor = p.get(x2, y)\n\n\n\t\tlet dripDistance = Math.random()* Math.random()*150\n\t\tfor (var j = 0; j < dripDistance; j++) {\n\t\t\tlet dripPct = j/dripDistance\n\n\t\t\tlet y2 = y + j\n\n\t\t\t// Get the current color and blend it with the last color\n\t\t\tlet pixelColor = p.get(x2, y2)\n\t\t\tlet finalColor = vector.lerp(pixelColor, lastColor, 1 - dripPct)\n\n\t\t\tif (x2 > 0 && x2 < p.width && y2 > 0 && y2 < p.height)\n\t\t\t\tp.set(x2, y2, finalColor)\n\n\t\t\t// Save this color to blend with later pixels\n\t\t\tlastColor = finalColor\n\n\t\t}\n\t}\n\tp.updatePixels();\n}", "title": "" }, { "docid": "0db3c20a9e31d9cf8511a3747d2343bc", "score": "0.5249164", "text": "function drawPowderBlueAsteroid(){\n penDown();\n penWidth(5);\n penColor(rgb(76,219,255));\n turnTo(98);\n moveForward();\n turnRight(40);\n moveForward();\n turnRight(130);\n moveForward();\n turnRight(50);\n moveForward();\n drawTail();\n}", "title": "" }, { "docid": "1abaca6a3fc2764ef7467a64c2d0b85b", "score": "0.52327704", "text": "function generateTopRight(x,y){\r\n var x = floor(random(ppg.width/2));\r\n var y = floor(random(ppg.height/2));\r\n var maxX=width/2;\r\n var maxY=height/2;\r\n for (i=0; i<=20;i++){\r\n x+=1;\r\n y+=1;\r\n maxX=maxX+x;\r\n maxY=maxY-y;\r\n let pixelN = ppg.get((width/2)+x , (height/2)-y);\r\n fill(pixelN);\r\n noStroke();\r\n rect(maxX, maxY,12,7);\r\n }\r\n}", "title": "" }, { "docid": "5e8d4f6fba8a822f8de3429f71af6b93", "score": "0.52323943", "text": "function calculateRewardedPoint(purchaseAmount) {\n if (purchaseAmount >= 50 && purchaseAmount < 100) {\n return purchaseAmount - 50;\n } else if (purchaseAmount > 100) {\n return 50 + (purchaseAmount - 100) * 2;\n }\n return 0;\n}", "title": "" }, { "docid": "f1ef7ecde4c5063a8acac0984c5140ff", "score": "0.5229113", "text": "generateRiver (map) {\n const b = map.getRandomPointOfType('beach');\n const m = map.getRandomPointOfType('mountain');\n let p = b;\n let wander = null;\n let d = b.dist(m); // want to reduce the distance between b and m\n const altered = [];\n let count = 0;\n while (p.getBiome() !== 'mountain') {\n // move towards a mountain\n count++;\n p.setBiome('river');\n altered.push(p);\n const nRaw = map.getNeighbors(p);\n\n if (wander === null) {\n nRaw.sort(function (p1, p2) { return p1.dist(m) - p2.dist(m); });\n for (const point of nRaw) {\n wander = this.generateWanderPoint(map, p, p.dir(point));\n if (wander !== null) break;\n }\n }\n // console.log('Wander Point:\\n' + wander.toString());\n d = p.dist(wander);\n const n = [];\n\n for (const point of nRaw) {\n const biome = point.getBiome();\n if (biome === 'ocean') {\n continue;\n }\n if (point.dist(wander) <= d) {\n n.push(point);\n }\n }\n if (n.length === 0) {\n console.error('failed river');\n return altered;\n }\n p = pickN(n, wander);\n if (p.dist(wander) === 0 || count > this.wanderCut) wander = null;\n }\n return altered;\n }", "title": "" }, { "docid": "cc602a3dc2b33489bdf81045a7d7284c", "score": "0.5224149", "text": "function perimeterRec(w,h){\n //perimiter = 2*width+height\n var p =2*w + 2*h;\n return p;\n\n}", "title": "" }, { "docid": "083ec5f87a69166c5f201178c7d820ec", "score": "0.5223622", "text": "function DoTopple(point) {\n forEachNeighbour(point.pos.x, point.pos.y, point, function(x, y, fromPoint) {\n neighbour = getPoint(x, y);\n if (neighbour == null || neighbour.is_dead) return;\n if (neighbour.tower != null && neighbour.tower.is_growing_point) return;\n MoveBlocks(fromPoint, neighbour, 1, false);\n });\n if (point.tower.is_growing_point) {\n point.is_dead = true;\n if (point.segment != null) { // Can be null only in tests.\n var num_dead_points_on_segment = 0;\n var countDead = function(x, y, ignored) {\n var p = getPoint(x, y);\n if (p == null) return;\n if (p.is_dead) {\n num_dead_points_on_segment++;\n }\n }\n countDead(point.segment.center_x, point.segment.center_y, null);\n forEachNeighbour(point.segment.center_x, point.segment.center_y, null, countDead);\n if (num_dead_points_on_segment == 7) {\n point.segment.last_death_player = point.tower.player;\n }\n }\n point.tower = null;\n } else {\n point.tower.is_growing_point = true;\n point.tower.height = 0;\n }\n}", "title": "" }, { "docid": "142565ba45fc0c45e982b31d6396003a", "score": "0.5216828", "text": "generateRandomPoint() {\r\n let p = glMatrix.vec3.create();\r\n let x = Math.random() * (this.maxX - this.minX) + this.minX;\r\n let y = Math.random() * (this.maxY - this.minY) + this.minY;\r\n glMatrix.vec3.set(p, x, y, 0);\r\n return p;\r\n }", "title": "" }, { "docid": "42ca6392e8b831082f2efaab6d46fb0f", "score": "0.5214897", "text": "function drawPrey() {\n preyRadius = random(15,30);\n fill(preyFill,preyHealth);\n ellipse(preyX,preyY,preyRadius*2);\n}", "title": "" }, { "docid": "8febeb5b4814bf83d4ef8b8f38ee34cd", "score": "0.5214075", "text": "function sand (n, v, w, t, offset) {\n\n let xs = linspace (n, v.x, w.x);\n let ys = linspace (n, v.y, w.y);\n\n for (let times = 0; times < t; times++) {\n\n for (let i = 0; i < n; i++) {\n point (xs[i], ys[i]);\n //line (xs[i], ys[i], xs[i], ys[i] + 10);\n }\n\n xs = xs.map (e => e += random (-offset, offset));\n ys = ys.map (e => e += random (-offset, offset));\n }\n}", "title": "" }, { "docid": "b2c584819bed62e61f762f72920ab0ec", "score": "0.5213124", "text": "function generatePath(numPoints) {\r\n\treturn new Array(numPoints)\r\n\t.fill(5)\r\n\t.map((num, i) => (i + 1) * num);\r\n}", "title": "" }, { "docid": "21a6bfcdd73b54019478e5dd5fc5cd5b", "score": "0.5210813", "text": "function paralax() {\n $('.clouds ul li:nth-child(1)').plaxmove({ratioH: 0.01, ratioV: 0.05, reversed: true, invertH: false});\n $('.clouds ul li:nth-child(2)').plaxmove({ratioH: 0.01, ratioV: 0.05, reversed: false, invertH: false});\n $('.clouds ul li:nth-child(3)').plaxmove({ratioH: 0.03, ratioV: 0.09, invertV: true});\n $('.clouds ul li:nth-child(4)').plaxmove({ratioH: 0.06, ratioV: 0.15, reversed: false, invertH: false});\n\n }", "title": "" }, { "docid": "e16e5d9cd79828c72110dd59b8181581", "score": "0.5209395", "text": "function moveParticlesWithDirProbsSTP(M, C, T, dirProb) {\n\tvar NR = Math.sqrt(dirProb.length);\n\t\n\tvar rSize = M.length;\n\tvar cSize = M[0].length;\n\tvar Mi = rSize * cSize;\n\tfor(var i = 0; i < Mi; i++) {\n\t\t\n\t\tvar y = randInt(0, rSize - 1);\n\t\tvar x = randInt(0, cSize - 1);\n\t\t\n\t\tvar src = M[y][x];\n\t\tif(src != -1 && src != 0) {\n\t\t\t\n\t\t\tvar xGrid = cSize / NR;\n\t\t\tvar yGrid = rSize / NR;\n\t\t\t\n\t\t\tvar ry = Math.floor(y / xGrid);\n\t\t\tvar rx = Math.floor(x / xGrid);\n\t\t\tvar r = ry * NR + rx;\n\t\t\t\n\t\t\tvar dir = dirProb[r];\n\t\t\t\n\t\t\tvar randDir = getDirFromProb(dir);\n\t\t\tvar dx = randDir.x;\n\t\t\tvar dy = -randDir.y;\n\t\t\t\n\t\t\tif(y + dy >= 0 && y + dy < rSize &&\n\t\t\t\tx + dx >= 0 && x + dx < cSize) {\n\t\t\t\tvar dest = M[y + dy][x + dx];\n\t\t\t\tif(dest == 0) {\n\t\t\t\t\tM[y + dy][x + dx] = 1;\n\t\t\t\t\tM[y][x] = 0;\n\t\t\t\t\t\n\t\t\t\t\tC[y + dy][x + dx] = C[y][x];\n\t\t\t\t\tC[y][x] = 0;\n\t\t\t\t\t\n\t\t\t\t\tT[y + dy][x + dx] = T[y][x];\n\t\t\t\t\tT[y][x] = 0;\n \t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2bd899cbe25aadf2b4fd9ae4eb10ec6e", "score": "0.52087665", "text": "function rotpoints2d(p,pr,ang,np) {\n\tvar i;\n\tvar fs=Math.sin(ang);\n\tvar fc=Math.cos(ang);\n\tfor (i=0;i<np;++i) {\n\t\tpr[i].x = fc*p[i].x - fs*p[i].y;\n\t\tpr[i].y = fc*p[i].y + fs*p[i].x;\n\t}\n}", "title": "" }, { "docid": "af1e57f9ac141b4c69416d4d723c2351", "score": "0.5205838", "text": "function tile(x, y, w, distortion) {\n const points = [\n {\n x: -w / 2 + random(-distortion, distortion),\n y: -w / 2 + random(-distortion, distortion),\n },\n {\n x: 0 + random(-distortion, distortion),\n y: -w / 2 + random(-distortion, distortion),\n },\n {\n x: w / 2 + random(-distortion, distortion),\n y: -w / 2 + random(-distortion, distortion),\n },\n {\n x: w / 2 + random(-distortion, distortion),\n y: 0 + random(-distortion, distortion),\n },\n {\n x: w / 2 + random(-distortion, distortion),\n y: w / 2 + random(-distortion, distortion),\n },\n {\n x: 0 + random(-distortion, distortion),\n y: w / 2 + random(-distortion, distortion),\n },\n {\n x: -w / 2 + random(-distortion, distortion),\n y: w / 2 + random(-distortion, distortion),\n },\n {\n x: -w / 2 + random(-distortion, distortion),\n y: 0 + random(-distortion, distortion),\n },\n ];\n\n push();\n translate(\n x + random(-distortion, distortion),\n y + random(-distortion, distortion)\n );\n rotate(distortion);\n stroke(100, 100 - distortion);\n strokeWeight(sw - distortion/100);\n beginShape();\n //Outer perimater\n points.forEach((item) => {\n vertex(item.x, item.y);\n });\n endShape(CLOSE);\n //INNER CROSS\n const crossPointIndexs = [1, 3, 5, 7];\n beginShape();\n crossPointIndexs.forEach((index) => {\n vertex(0, 0);\n vertex(points[index].x, points[index].y);\n });\n endShape();\n pop();\n}", "title": "" }, { "docid": "9510b730961db7c778b5608b30f392ca", "score": "0.52032053", "text": "function drawPoint(x,y,colorIndex){\n fill(colors[colorIndex]);\n var jitter = random(5);\n ellipse(\n x * pointSpacing + margin,\n y * pointSpacing + margin,\n pointSize + jitter);\n}", "title": "" }, { "docid": "1bddc10447ebfb58afc0b42983180f53", "score": "0.51993906", "text": "function findPointOnLand(){\n\n raster_northpole.on('load', function() {\n\n var count = 0;\n do {\n var vec = new Point(randPlusMinusOne()*212*ratio)*Point.random() + view.center; // \"212*ratio\" because 212*ratio ~ (((300*ratio)^2)/2)^0.5 \n var color = raster_northpole.getPixel(vec.x, vec.y);\n console.log('findPointOnLand - color: ' + color + ', vec(x,y): vec('+vec.x+','+vec.y+'), vec: ' + JSON.stringify(vec));\n\n var path = new Path.Circle(vec, 5);\n path.fillColor = 'green';\n group.addChild(path);\n\n ++count;\n } while(count < 20);\n\n });\n}", "title": "" }, { "docid": "abb1d812cf386f3ae56b5a8de9eb67e0", "score": "0.51990455", "text": "function draw() {\n //draw particle\n dir = floor(random(0, 4));\n if (x<20) {\n dir = floor(random(0, 3));\n }\n println(x);\n randomR = random(0, 255);\n randomG = random(0, 255);\n randomB = random(0, 255);\n noFill();\n stroke(randomR, randomG, randomB);\n strokeWeight(2);\n rect(x, y, 5, 5);\n stroke(255, 0, 0);\n strokeWeight(1/8);\n line(x, y, 200, 200);\n \n numSteps = numSteps + 1;\n //println(numSteps);\n \n //draw particle 2\n dir2 = floor(random(0, 4));\n randomC = random(0, 255);\n noFill();\n strokeWeight(2)\n stroke(randomC, randomC, randomC);\n ellipse(x2, y2, 5, 5);\n stroke(0, 255, 0);\n strokeWeight(1/8);\n line(x2, y2, 200, 200);\n \n //first particle movement\n if (dir === 0) { //move up\n y = y+5;\n }\n \n if (dir == 1) { //move right\n x = x+5;\n }\n \n if (dir == 2) { //move down\n y = y-5;\n }\n \n if (dir == 3) { //move left\n x = x-5;\n }\n \n //second particle movement \n if (dir2 === 0) { //move up\n y2 = y2+5;\n }\n \n if (dir2 == 1) { //move right\n x2 = x2+5;\n }\n \n if (dir2 == 2) { //move down\n y2 = y2-5;\n }\n \n if (dir2 == 3) { //move left\n x2 = x2-5;\n }\n}", "title": "" }, { "docid": "ddea12d1df0bac9f6046f155de84e3af", "score": "0.5196682", "text": "function drawPoints(){\n ctx.clearRect(0,0,screenWidth,screenHeight);\n for(var i=0;i<p**n;i++){\n ctx.beginPath();\n ctx.moveTo(points[i][0],points[i][1]);\n ctx.arc(points[i][0],points[i][1],1,0,2*Math.PI);\n ctx.fillStyle = colors[i];\n ctx.fill();\n }\n}", "title": "" }, { "docid": "48790b37c312ae6197f3b03cd7dc0c53", "score": "0.5188098", "text": "movePole() {\n this.x -= poleSpeed;\n }", "title": "" }, { "docid": "3646f9375839ad1ae5b972c7fe0b93a9", "score": "0.51877165", "text": "function pnoise(i, j, mseed, rsize) {\n\n // check cache\n let hash = Math.abs(((rsize << 8) ^ (mseed << 4) ^ (i << 2) ^ (j) ^ (-1))) % pnoise_cache_entries;\n\n let def = pnoise_cache[hash];\n\n // if cached, then return the value immediately\n if (def.crsize === rsize && def.cmseed === mseed && def.ci === i && def.cj === j) {\n return def.value;\n }\n \n rsize = Math.floor(rsize);\n \n // if the radius size is too small for any particular randomization\n if (rsize === 0)\n return 0.5;\n \n i = Math.floor(i);\n j = Math.floor(j);\n\n let idrsize = Math.floor(i / rsize);\n let jdrsize = Math.floor(j / rsize);\n\n // properties of perlin vectors\n let tl_x, tl_y, bl_x, bl_y, tr_x, tr_y, br_x, br_y;\n\n // compute angles of the perlin vectors\n let tl_r = det_random_2d(mseed, 1, 0, idrsize, jdrsize);\n let tr_r = det_random_2d(mseed, 1, 0, idrsize + 1, jdrsize);\n let bl_r = det_random_2d(mseed, 1, 0, idrsize, jdrsize + 1);\n let br_r = det_random_2d(mseed, 1, 0, idrsize + 1, jdrsize + 1);\n \n // compute projections of the perlin vectors\n tl_x = Math.sin(TWO_PI * tl_r);\n tr_x = Math.sin(TWO_PI * tr_r);\n bl_x = Math.sin(TWO_PI * bl_r);\n br_x = Math.sin(TWO_PI * br_r);\n\n tl_y = Math.cos(TWO_PI * tl_r);\n tr_y = Math.cos(TWO_PI * tr_r);\n bl_y = Math.cos(TWO_PI * bl_r);\n br_y = Math.cos(TWO_PI * br_r);\n \n let ceili = Math.ceil(i / rsize);\n\n // if i is zero, then we can't ceil to the rightmost side, so we do it manually\n if (ceili == idrsize)\n ceili++;\n\n let ceilj = Math.ceil(j / rsize);\n \n // if i is zero, then we can't ceil to the lowest side, so we do it manually\n if (ceilj == jdrsize)\n ceilj++;\n\n let idr_r_size = idrsize * rsize;\n let jdr_r_size = jdrsize * rsize;\n\n let dx = (i - idr_r_size) / (ceili * rsize - idr_r_size);\n let dy = (j - jdr_r_size) / (ceilj * rsize - jdr_r_size);\n\n let dxm = dx - 1;\n let dym = dy - 1;\n\n // select all four powers to the perlin vectors depending on the dot product\n let tl = (dx * tl_x) + (dy * tl_y);\n let tr = (dxm * tr_x) + (dy * tr_y);\n let bl = (dx * bl_x) + (dym * bl_y);\n let br = (dxm * br_x) + (dym * br_y);\n\n dx = smoothf(dx);\n dy = smoothf(dy);\n\n tl = smoothf_norm(tl);\n tr = smoothf_norm(tr);\n bl = smoothf_norm(bl);\n br = smoothf_norm(br);\n\n dxm = 1 - dx;\n dym = 1 - dy;\n\n // and then select one particular approximated power, depending on the distances\n let power = (tl * dxm + tr * dx) * dym + (bl * dxm + br * dx) * dy;\n\n // map [-1; 1] to [0; 1]\n let val = (power + 1) / 2;\n\n // write cache back\n def.ci = i;\n def.cj = j;\n def.cmseed = mseed;\n def.crsize = rsize;\n def.value = val;\n \n return val;\n}", "title": "" }, { "docid": "f2f84d89debecd3ec07a1dbcdb16a5c4", "score": "0.5184618", "text": "function rosettePeriodicMirrorPhi(position,n){\n\tvar angle=position.angle();\n\tangle*=n*0.159154; // n/2pi\n\tangle=0.5*imageFastFunction.periodicMapping(angle);\n\tangle*=6.28318/n;\n\tposition.setPolar(position.radius(),angle);\n}", "title": "" }, { "docid": "bc4a77acc860ab4d00e9fc8d79c5303e", "score": "0.51801527", "text": "function makeRope()\n\t\t\t{\n\t\t\t\tbranchBank -= 5;\n\t\t\t\tleafBank -= 5;\n\t\t\t\tropeBank++;\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "title": "" }, { "docid": "651d30ed40e03586608805c18d00e9ab", "score": "0.51784635", "text": "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "title": "" }, { "docid": "96ee498388bc8564c9af70bc4563b207", "score": "0.51777756", "text": "function calculate_line(mp, point) {\n var a = mp[0] - point[0];\n var b = mp[1] - point[1];\n var omegaFirst = tanh(a/b);\n \n var aPrime1 = 30*Math.sin(omegaFirst);\n var bPrime1 = 30*Math.cos(omegaFirst);\n \n var omegaSecond = tanh(a/b);\n \n var aPrime2 = 30*Math.sin(omegaSecond);\n var bPrime2 = 30*Math.cos(omegaSecond);\n \n var start=[];\n var end = [];\n \n if (a>0 && b>0){\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a<0 && b>0) {\n start = [mp[0]-aPrime1, mp[1]-bPrime1];\n end = [point[0]+aPrime2, point[1]+bPrime2];\n }\n else if(a>0 && b<0) {\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n else {\n // a<0 && b<0\n start = [mp[0]+aPrime1, mp[1]+bPrime1];\n end = [point[0]-aPrime2, point[1]-bPrime2];\n }\n \n return [start,end];\n}", "title": "" }, { "docid": "a1d05d8ad71efecf849f6d3208f99f57", "score": "0.51748437", "text": "generatePoints() {\n let points = [];\n let xmod = (this.mouseXControls ? mouseX / this.xmod : this.xmodDefault);\n let ymod = (this.mouseYControls ? mouseY / this.ymod : this.ymodDefault);\n if(mouseY < this.ymin && this.mouseYControls) ymod = this.ymin / this.ymod;\n\n let phi = 137.5 + xmod;\n\n for(let n = 0; n < this.numPoints; n++) {\n let angle = n * phi;\n let modifier = 1;\n let radius = this.constant * sqrt(n * ymod);\n\n let x = radius * cos(angle) + width/2;\n let y = radius * sin(angle) + height/2;\n\n if(this.randomness != 0) {\n x += floor(this.randomness * random(0,10));\n y += floor(this.randomness * random(0,10));\n }\n\n let p = new Point(floor(x), floor(y));\n points.push(p);\n }\n\n return points;\n }", "title": "" }, { "docid": "dfce2e647d66aefa2b5fe17f475ed30a", "score": "0.5172765", "text": "function drawPoints(){\n ctx.clearRect(0,0,screenWidth,screenHeight);\n for(var i=0;i<p**n;i++){\n ctx.beginPath();\n ctx.moveTo(points[i][0],points[i][1]);\n ctx.arc(points[i][0],points[i][1],pointRadius,0,2*Math.PI);\n ctx.fillStyle = colors[i];\n ctx.fill();\n }\n}", "title": "" }, { "docid": "fccf51db2a6310398ce8c7617870d723", "score": "0.51725334", "text": "function Point() {\n this.x = random(-1, 1);\n this.y = random(-1, 1);\n this.bias = 1;\n this.lineY = lineEqn(this.x);\n if (this.y > this.lineY) {\n this.label = 1;\n }\n else {\n this.label = -1;\n }\n this.px = map(this.x, -1, 1, 0, width);\n this.py = map(this.y, -1, 1, height, 0);\n}", "title": "" }, { "docid": "a61cdf1460ee1bb69237cdf0a620ded7", "score": "0.51703525", "text": "function pt(r, a) {\n return [r * Math.cos(a) + cx, cy - r * Math.sin(a)];\n }", "title": "" } ]
f6afa3ce3ad67252b1ee8c25d24021d2
sposto il dot nella nuova posizione corretta
[ { "docid": "d732077c1133fad66af053011a5cab58", "score": "0.0", "text": "function transform(d) {\r\n return \"translate(\" + x(+d.x) + \",\" + y(+d.y) + \")\";\r\n }", "title": "" } ]
[ { "docid": "84bd9359b190ab7e04228eb8fa56f0d6", "score": "0.6965255", "text": "addDot() {\n\n\t\tlet lastOperation = this.getLastOperation();\n\n\t\t//permitindo apenas 1 ponto // parando a instrucao\n\t\tif(typeof lastOperation === 'string' && lastOperation.split('').indexOf('.') > -1 ) return;\n\n\n\t\tif(this.isOperator(lastOperation) || !lastOperation) {\n\t\t\tthis.pushOperation('0.');\n\t\t} else {\n\t\t\tthis.setLastOperation(lastOperation.toString() + '.');\n\t\t}\n\n\t\tthis.setLastNumberToDisplay();\n\n\t}", "title": "" }, { "docid": "49cbc0e5691edfe792aaebbfc9203484", "score": "0.6802107", "text": "function positionDot() {\n turnRight(45);\n move(14, 0);\n}", "title": "" }, { "docid": "96dea08ab76364fe36c615985673b8db", "score": "0.6466368", "text": "static Dot(left, right) {\n const vecX = left.getValueX() * right.getValueX();\n const vecY = left.getValueY() * right.getValueY();\n return vecX + vecY;\n }", "title": "" }, { "docid": "25b5746e15f6d2b10b48a70bad6fc0e3", "score": "0.6370749", "text": "getDots() {\n return this.modifierContext.getModifiers('dots');\n }", "title": "" }, { "docid": "281d8bbb5a28779e9ae945b394b65f6e", "score": "0.6294992", "text": "addDot() {\n const dot = new _dot__WEBPACK_IMPORTED_MODULE_5__[\"Dot\"]();\n this.dots += 1;\n return this.addModifier(dot, 0);\n }", "title": "" }, { "docid": "1185fa91d9e44130ab50c8535744d4ae", "score": "0.6286526", "text": "getPos() {\n return NEditor.getConnPos(this.dot);\n }", "title": "" }, { "docid": "4ab6f6b25952a284c36d1c39695a6ed3", "score": "0.6094481", "text": "function Dot() {\n\tShape.call(this, 'dot', 10);\n\tthis.coords = [[3, this.index]];\n}", "title": "" }, { "docid": "c46abfc1c0d5f51e7658905c7ba9d324", "score": "0.6081209", "text": "function dotter() {\n // when clicked \".\" just after choosing an operation, empty display;\n if ((typeof disp2 != \"string\" && opside !== \"\") && (disp === \"\" && dot === \"\")) {\n document.querySelector(\"#disp\").innerHTML = \"\";\n }\n // normal decimal addition;\n if (dot === \"\") {\n sc1 = document.querySelector(\"#disp\").innerHTML;\n sc1 = sc1 + \".\";\n document.querySelector(\"#disp\").innerHTML = sc1;\n dot = \".\";\n }\n}", "title": "" }, { "docid": "b06cf21174340c8e0d5fb22d79c0265c", "score": "0.6079987", "text": "function drawDot() {\n push();\n noStroke();\n //rectMode(CENTER);\n translate(cellSize/2,cellSize/2);\n //fill(255,0,0);\n //rect(0,0, cellSize,cellSize);\n fill(255);\n ellipse(0,0,cellSize/4,cellSize/4);\n pop();\n}", "title": "" }, { "docid": "af2f822bf7fe788e0d34187f33aa0673", "score": "0.603812", "text": "addDot(index) {\n const dot = new _dot__WEBPACK_IMPORTED_MODULE_7__[\"Dot\"]();\n dot.setDotShiftY(this.glyph.dot_shiftY);\n this.dots++;\n return this.addModifier(index, dot);\n }", "title": "" }, { "docid": "b678c68eaffe064045f2d696e5a053d9", "score": "0.6033701", "text": "showDots() {\n // row x col\n for (let i = 0; i < this.numRows; i++) {\n for (let j = 0; j < this.numCols; j++) {\n this.tiles[i][j].showDot();\n }\n }\n }", "title": "" }, { "docid": "4dd7bb1e8ed50b5fd15f97edb3c5a957", "score": "0.60063875", "text": "toggleDot(dot) {\n $(dot).toggleClass('braille__dot--active');\n if ($(dot).hasClass('braille__dot--active')) {\n this.value += parseInt($(dot).data('place'), 8);\n } else {\n this.value -= parseInt($(dot).data('place'), 8);\n }\n\n this.update();\n }", "title": "" }, { "docid": "c586e2dd41811a128aebbb94d73fa47a", "score": "0.598843", "text": "static Dot(U, V)\n {\n return U.x * V.x + U.y * V.y;\n }", "title": "" }, { "docid": "44d68c87d52a257d17ac955f09ed31fc", "score": "0.5945579", "text": "function getDotPos(newY, firstRectMidY, stepOrder, firstRectMidX) {\n var arrayPos = Math.floor((newY - firstRectMidY) / 100);\n if (stepOrder[arrayPos] === \"n\") {\n x = firstRectMidX + Math.sqrt(-1 * Math.pow((newY - firstRectMidY) - 50 - (100 * arrayPos), 2) + 2500);\n } else {\n x = firstRectMidX - 50;\n }\n return x;\n}", "title": "" }, { "docid": "f059c6dfa6dbe1e52358f172e7f1b119", "score": "0.59275097", "text": "function dot() {\n\n if (display.value.includes('.')) {\n return\n } else {\n display.type = 'text';\n display.value = display.value + '.';\n printThings(display.value);\n }\n}", "title": "" }, { "docid": "bf3b515114ccf7fceeca9a72f81f4bbb", "score": "0.59010893", "text": "function numero(num){\n \n if(x==0||xi==1){\n pantalla.innerHTML=num;// para mostrar en pantalla\n x=num;// guardo valor de numero como un char\n if(num==\".\"){//si copio . como primer valor\n x=num; //guardar el punto en la cadena\n pantalla.innerHTML=\"0.\"; // mostarar en pantalla\n coma=1; \n \n }\n }else{\n if(num==\".\" && coma==0){//si copio por primera ves el punto\n pantalla.innerHTML+=num; //mostrar en pantalla el .\n x+=num; //guardar en la cadena\n coma=1; //cambiar el valor de la coma\n }else if(num==\".\" && coma==1){}//funcion vacia por si se vuelve a copiar la coma\n else{//si no es una coma o ya se ha escrito entoces\n pantalla.innerHTML+=num;//muestro en pantalla\n x+=num; //agrego numero a la cadena de texto\n }\n }\n xi=0;//esto permimte que despues de undir en el primer numero se inicie el else\n}", "title": "" }, { "docid": "262d9465fab715274fffdeb14f5c551a", "score": "0.58984995", "text": "function dot() {\n if (initialDisplay.innerHTML.includes('.')) {\n\n } else initialDisplay.innerHTML += '.';\n}", "title": "" }, { "docid": "0cdb079274d09916767ddf8de1face45", "score": "0.58840597", "text": "_sotter(dot, props) {\r\n dot = canvas.getDotByXY(dot.x, dot.y);\r\n canvas.setDotProperties(dot, props);\r\n }", "title": "" }, { "docid": "d8bf79bb4548a8cb371a1f34eabe1d9a", "score": "0.58591676", "text": "function dothething (openSet, closedSet) {\n var spacingo = 470; //y axis\n var spacingc = 470; //y axis\n var horospacing = 215; //x axis\n for (var i = 0; i < openSet.length; i++) {\n text(openSet[i].i + \" : \" + openSet[i].j, 70, spacingo);\n spacingo += 15;\n }\n\n for (var i = 0; i < closedSet.length; i++) {\n text(closedSet[i].i + \" : \" + closedSet[i].j, horospacing, spacingc);\n spacingc += 15;\n if(spacingc > 900){\n horospacing += 55;\n spacingc = 470;\n }\n }\n}", "title": "" }, { "docid": "30458f1e617e4b89a45e0ed27e8e261f", "score": "0.58546203", "text": "static dot(v1, v2)\r\n\t{\r\n\t\t\r\n\t}", "title": "" }, { "docid": "931d2b6798959c9c9f3d4ef27c8eafbe", "score": "0.5854091", "text": "function addAntidot() {\n dots[1].addDot(p5.mouseX, p5.mouseY, boxes.getBoxID(p5.mouseX, p5.mouseY));\n }", "title": "" }, { "docid": "ea0b66dacc2b84458f0e24a01078f8f7", "score": "0.58461", "text": "function displayDot(xCoor, yCoor, key) {\r\n ctx.rect(xCoor, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n ctx.rect(xCoor, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n ctx.fillStyle = `hsl(${hue},100%,50%)`;\r\n ctx.fill();\r\n switch (key) {\r\n case 'ArrowUp':\r\n ctx.clearRect(xCoor, yCoor + MOVE_AMOUNT, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowDown':\r\n ctx.clearRect(xCoor, yCoor - MOVE_AMOUNT, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowLeft':\r\n ctx.clearRect(xCoor + MOVE_AMOUNT, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n case 'ArrowRight':\r\n ctx.clearRect(xCoor - MOVE_AMOUNT, yCoor, MOVE_AMOUNT, MOVE_AMOUNT);\r\n break;\r\n default:\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "295b396596ef46b0d938c5350d9cddde", "score": "0.5845479", "text": "function VerificarPunto() {\n if (resultado.textContent.indexOf(\".\", 0) == \"-1\")\n resultado.textContent = resultado.textContent + \".\";\n }", "title": "" }, { "docid": "a5427c71263686bcce6f59103b09e1c5", "score": "0.58380127", "text": "function labelDot() {\n return 'label \"\\u2022\\\";';\n}", "title": "" }, { "docid": "7521498eadaf25e5f9e94fb807e70db6", "score": "0.5824103", "text": "function drawMoveDot(currentX, currentY, lastX, lastY, toolColor, toolSize) {\n\n \t\t// Draw end point\n \t\tctx.beginPath();\n \t\tctx.arc(currentX, currentY, toolSize, 0, 2*Math.PI, true);\n \t\tctx.fill();\n\n \t\t// Interpolate\n \t\ttwoPointLine(ctx, lastX, lastY, currentX, currentY, toolColor, toolSize);\n\n \t}", "title": "" }, { "docid": "1695cdc9621b8ca1e98d343a5c9b76d3", "score": "0.58108896", "text": "dot(src) {\n return this.x * src.x + this.y * src.y\n }", "title": "" }, { "docid": "15d4546f49331e11c15e1132caadc4b1", "score": "0.5784833", "text": "function Dot(x, y){\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "58550477fee42426f79e4da3cb1b6cf7", "score": "0.5771394", "text": "function uvDot(pt,base, pt2){\r\n\tvar a = pt.u - base.u,\r\n\t\tb = pt.v - base.v,\r\n\t\tc = pt2.u - base.u,\r\n\t\td = pt2.v - base.v;\r\n\treturn a*c+b*d;\r\n}", "title": "" }, { "docid": "293709da55c0e29474a74d9a63bec091", "score": "0.5762534", "text": "function position(dot) {\n dot .attr(\"x\", function(d) { return xScale(x(d)); })\n .attr(\"y\", function(d) { return yScale(y(d)); })\n .style(\"font-size\", function(d) { return fontScale(fontSize(d)) + \"pt\"; })\n .style(\"stroke-opacity\", function(d) { return contourOpacity(d); })\n .text(function (d) { return job_name(d);});\n }", "title": "" }, { "docid": "852f43ddfe0b7b183155fd10f96e6324", "score": "0.57589936", "text": "function position(dot) {\n dot .attr(\"cx\", function(d) { return xScale(x(d)); })\n .attr(\"cy\", function(d) { return yScale(y(d)); })\n .attr(\"r\", function(d) { return radiusScale(radius(d)); });\n }", "title": "" }, { "docid": "a01377c109c90acf3c9d57b79abc2181", "score": "0.57549703", "text": "dot(v2){\n let res = 0;\n this.vals.forEach((e, i) => {\n res += e*v2.getComponent(i);\n });\n return res;\n }", "title": "" }, { "docid": "c2d524c8ddd64b74d80372e7a6a5fce6", "score": "0.57503617", "text": "function cambiarComaPorPunto(p_precio){\n\t\ttamaño_float = p_precio.length;\n\t\ti=0;\n\t\tcadena = \"\";\n\t\twhile (i<tamaño_float) {\n\t\t\tif(p_precio[i] == \",\"){\n\t\t\t\tcadena = cadena + \".\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcadena = cadena + p_precio[i];\n\t\t\t}\n\t\t\ti++;\t\n\t\t}\n\t\tp_precio = cadena;\n\t\treturn p_precio;\n\t}", "title": "" }, { "docid": "ce01ccfeb731a08d42e02545a1962613", "score": "0.5747858", "text": "dot() {\n this.context.beginPath();\n this.context.strokeStyle = \"red\";\n this.context.rect(this.startX, this.startY, 1, 1);\n this.context.stroke();\n }", "title": "" }, { "docid": "deba4fbfb6a2f2693a93a6f18c9842d1", "score": "0.57461876", "text": "function addDecimalPoints(str,dot) {\n str=str.replace(/\\D/g, '');\n var inputValue = str.replace('.', '').split(\"\").reverse().join(\"\"); //xoa dau cham dang co va reverse\n var newValue = '';\n for (var i = 0; i < inputValue.length; i++) {\n if (i % dot == 0) { newValue += '.'; }\n newValue += inputValue[i];\n }\n str = newValue.split(\"\").reverse().join(\"\");\n str = str.slice(0,str.length-1);//xóa dấu chấm bị dư\n return str;\n}", "title": "" }, { "docid": "5e2e0d782662bef46376b7ee04be99d6", "score": "0.5741552", "text": "function mexcla_dots(next) {\n // Can't pass default values, so set it here. The default\n // value should be null\n next = typeof next === 'undefined' ? null : next;\n cur = $('#connect-dots').text();\n if (next === null) {\n next = '';\n if(cur == '') {\n next = '.';\n }\n else if(cur == '.') {\n next = '..';\n }\n else if(cur == '..') {\n next = '...';\n }\n }\n $('#connect-dots').text(next);\n}", "title": "" }, { "docid": "2654a6ef7f65fa82a44dccfd501035f1", "score": "0.57254833", "text": "function Dot()\n{\n // set default properties\n this.xpos = random(0, width);\n this.ypos = height; \n this.speed = random(1, 4);\n this.letter = letters[Math.floor(Math.random() * letters.length)];\n this.boxFilled = Math.random() < 0.5 ? 0 : 1;\n}", "title": "" }, { "docid": "4c239d55a1058e65e354c9d8e2c90e40", "score": "0.57245845", "text": "function position(dot) {\n /* temporary storage for x and y positions */\n var tempX = [1,2,3,4,5];\n var tempY = [1,2,3,4,5];\n \n //update circles\n dot.attr(\"cx\", function(d, i) { \n //store x position of circle for label\n tempX[i] = xScale(x(d));\n //get x position\n return xScale(x(d)); })\n .attr(\"cy\", function(d, i) {\n //store y position of circle for label\n tempY[i] = yScale(d.hdi)+(0.7 * radiusScale(radius(d)));\n //get y position\n return yScale(y(d)); })\n .attr(\"r\", function(d) { return radiusScale(radius(d)); });\n \n //update position of text using stored x and y values\n svg.selectAll(\".text\")\n .attr(\"x\", function(d, i) { return tempX[i]; })\n .attr(\"y\", function(d, i) { return tempY[i]; });\n }", "title": "" }, { "docid": "956e2a387d8de830af5441343904ce1b", "score": "0.57164556", "text": "function Dot(Point, radius, fillColor, borderColor, borderWeight, objPaper) {\n this.startPoint = Point;\n this.radius = radius;\n this.border = borderWeight;\n this.borderColor = borderColor;\n this.fillColor = fillColor;\n this.paper = objPaper;\n}", "title": "" }, { "docid": "1f8059c2f7e05fd1012d07aba7a59376", "score": "0.5699542", "text": "function getDots(whichLink) {\n let dots = \"\";\n let dotsNeeded = 12 - whichLink.length - 3;\n for (let i = 0; i < dotsNeeded; i++) {\n dots = dots + \"&nbsp;\";\n }\n return `<span>${dots}</span>`;\n}", "title": "" }, { "docid": "3cf3bb064316aa1ba887b7c49cfef622", "score": "0.56943697", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "8b4562a6dfbab65dba04f22448ccdbd3", "score": "0.56761545", "text": "function drawDot(dot) {\n context.beginPath(); // begin drawing\n context.arc(dot.x, dot.y, dot.radius, 0, 2 * Math.PI, false); // specify arc w/dot object's position and radius\n context.fillStyle = dot.color; // add a color\n context.fill(); // fill color in circle\n }", "title": "" }, { "docid": "b520a93518354c93dd55f6a95821b767", "score": "0.567135", "text": "function position(dot) {\n dot .attr(\"cx\", function(d) { return xScale(x(d)); })\n .attr(\"cy\", function(d) { return yScale(y(d)); })\n .attr(\"r\", function(d) { return radiusScale(radius(d)); });\n }", "title": "" }, { "docid": "74a47af02969b16d0026310feaab398e", "score": "0.5664486", "text": "makeDot(dot) {\n\t\tif(!this.view.dots || !this.view.dots.center) return null;\n\t\tvar distanceFromCenter = dot.distanceFromCenter;\n\t\tvar angle = dot.startAngle + dot.angle;\n\t\tvar point = util.polarToCartesian(this.view.dots.center.x,this.view.dots.center.y,distanceFromCenter,angle);\n\t\tif(!dot.r) dot.r = this.view.dots.radius;\n\n\t\treturn <Dot id={dot.assignment.name+' '+dot.assignment.type+'outer'} center={point} radius={dot.r} fill={dot.color}\n\t\tonMouseDown={this.onMouseDownDot.bind(this)}\n\t\tdot={dot}\n\t\tintersectsLine={this.props.intersectsLine}\n\t\tanimateFades={true}\n\t\tclickable={!this.props.view.disable}\n\t\t/>\n\t}", "title": "" }, { "docid": "f2f8db7899bd9caefb2f0fcc361165de", "score": "0.56594175", "text": "function atDotted() {\n\t\t\treturn yPos >= 100;\n\t\t}", "title": "" }, { "docid": "454cb8937fd02089a72ffadf22467432", "score": "0.5658298", "text": "function position(dot) {\n\tdot .attr(\"cx\", function(d) { return xScale(x(d)); })\n\t .attr(\"cy\", function(d) { return yScale(y(d)); })\n\t .attr(\"r\", function(d) { return d.radius; })\n\t .style(\"fill\", function(d) { return colorScale(color(d)); })\n }", "title": "" }, { "docid": "7cb4bab398534be148f09058a9a1bd35", "score": "0.56530917", "text": "function makeDots (num) {\n let ret = ''\n while (num > 0) {\n ret += ' ○ '\n num--\n }\n return ret\n}", "title": "" }, { "docid": "7babfc151783637ace2e2962f34391ba", "score": "0.5644688", "text": "toDot() {\n\n let content = \"graph { \\n\"\n\n for (let k of this.paintingGraph.nodes) {\n content += k.id + \" \" + \"[color=\" + colorsPallete[k.color - 1] + \"]\\n\"\n }\n\n this.paintingGraph.edges.forEach(element => {\n content += \" \" + element.from + \" -- \" + element.to + \"\\n\"\n })\n\n content += \"}\"\n\n \n return content\n }", "title": "" }, { "docid": "b3692ec3ec5e2e611e9324698f9fe54a", "score": "0.563751", "text": "function dropDot(){\n\tball = document.getElementById('ball');\n\tleftPx = parseInt(ball.style.left) + 8;\n\tleftPx = String(leftPx + 'px');\n\ttopPx = parseInt(ball.style.top) - 4;\n\ttopPx = String(topPx + 'px')\n\tvar html = \"<div class='dot' style='left:\" + leftPx + \";top:\" + topPx + \";'>.</div>\";\n\t$('#ball-area').append(html);\n}", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5624687", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5624687", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "99e11611e2ece181c233bdd9e3877ece", "score": "0.5624687", "text": "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "title": "" }, { "docid": "8e124c1293bab63d44f9f0c94408b28b", "score": "0.5622815", "text": "function drawDottedLine() {\n\tfor(let i = 0; i<dots.length; i++) {\n\t\tlet x = dots[i].x;\n\t\tlet y = dots[i].y;\n\n\t\trect(x,y, dSize, dSize);\n\t}\n}", "title": "" }, { "docid": "1ee05871ba2178e9504101ff722a29b5", "score": "0.56180924", "text": "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "title": "" }, { "docid": "a90863d17160ec226c2e2c8def7b4ffe", "score": "0.5607921", "text": "static Dot(x,y) {\n return Math.fround(x.a[0]*y.a[0]) + Math.fround(x.a[1]*y.a[1]);\n }", "title": "" }, { "docid": "1fc64e6a76e8243724ecabcfff66f6ac", "score": "0.5598145", "text": "function V2Dot(a, b) {\n\n\treturn ((a.x * b.x) + (a.y + b.y));\n}", "title": "" }, { "docid": "2737367d973a23b7144b6518e0547e4c", "score": "0.5591314", "text": "function enlargeDot(p) {\n\t \tdot.style.webkitClipPath = 'circle('+(parseInt(dot_clip[0])*(p*4.5+1))+'px at ' + -dot_x + 'px ' + -dot_y + 'px)';\n\t\t}", "title": "" }, { "docid": "cb9c9400d3f4440ea7f5ef17423e8f4c", "score": "0.5588971", "text": "function DotAnimationForOverlay() {\n var overlay = $('#overlay');\n var text = overlay.text();\n if (text.indexOf('...', text.length - 3) > 0) {\n overlay.text(text.substring(0, text.length - 3));\n } else {\n overlay.text(text + '.');\n }\n}", "title": "" }, { "docid": "dc750ade55d3677d57358d0f95a7b5d8", "score": "0.55834293", "text": "function addDot() {\n const boxID = boxes.getBoxID(p5.mouseX, p5.mouseY);\n if (boxID !== DotEnum.UNDEF) {\n dots[0].addDot(p5.mouseX, p5.mouseY, boxID);\n\n let event = new CustomEvent('ADD_DOT', { detail : 'ADD_DOT'}); // trigger add dot event\n div.dispatchEvent(event);\n }\n }", "title": "" }, { "docid": "b5d57b6404de0be9efa9f80fff1b6c15", "score": "0.5583144", "text": "function Dot(x = 100, y = 100) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.size = 5;\n\n\tthis.display = function() {\n\t\tthis.size = calculateDistance(this.x, this.y, cursorX, cursorY) / 400;\n\n\t\tctx.beginPath();\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.closePath();\n\t\tctx.fillStyle = \"rgba(\" + lR + \", \" + lG + \", \" + lB + \", \" + lA + \")\";\n\t\tctx.fill();\n\t}\n}", "title": "" }, { "docid": "3cdaf860dd411d612591953eec5a1908", "score": "0.55773515", "text": "function dot(num) {\nvar count=0;\t\nvar numer=0;\n\tfor (i = 0; i < num.length; i++)\n { \n var c = num.charAt(i);\n if (c == decimalPointDelimiter)\n \tcount=1;\n }\n\tif (count==0 && num.length>2)\n\t\tnumer=num.substring(0,num.length-2)+\".\"+num.substring(num.length-2);\n\tif (count==0 && num.length<3)\n\t\tnumer=\"0.\"+num;\n\tif (count==1)\t\t\n\t{\t\n\t\tDotIndex=num.indexOf('.');\n\t\tif (num.substring(DotIndex+1).length>2)\n\t\t\tnumer=num.substring(0,DotIndex)+\".\"+num.substring(DotIndex+1,DotIndex+3);\n\t\telse\n\t\t\tnumer=num.substring(0,DotIndex)+\".\"+(num+\"000\").substring(DotIndex+1,DotIndex+3);\n\t}\n\t\t\n\treturn(numer);\n}", "title": "" }, { "docid": "e7f20a8d0d44173338b3d4af47c6a8b1", "score": "0.55694306", "text": "function pointNumber( n ){ \r\n\t\tn = n + \"\";\r\n\t\tvar i = n.length-3;\r\n\t\twhile( i > 0 ){ n = n.substring( 0, i )+ \".\" + n.substring( i, n.length ); i=i-3; }\r\n\t\treturn( n );\r\n\t}", "title": "" }, { "docid": "46bccb49064ad25f252a801fb1ab1560", "score": "0.55597603", "text": "function position(dot) {\n dot.attr(\"cx\", function(d) { return xScale(x(d)); })\n .attr(\"cy\", function(d) { return yScale(y(d)); })\n .attr(\"r\", function(d) { return radiusScale(radius(d)); })\n }", "title": "" }, { "docid": "5b8d99e37cbff810ba49531b3fb985c4", "score": "0.55460227", "text": "updateAllDots() {\n // iterate over bits\n const bits = this.getBits();\n for (let i = 1; i <= bits.length; i++) {\n // go from bitstring index to braille dot number\n const bitNumber = i <= 3 ? (4 - i) : (10 - i);\n if (bits[i - 1] === '1') this.element.children('.braille__dot--' + bitNumber).addClass('braille__dot--active');\n else this.element.children('.braille__dot--' + bitNumber).removeClass('braille__dot--active');\n }\n }", "title": "" }, { "docid": "8981dcb067713fba7ffcdd3a0cfee8b8", "score": "0.5542922", "text": "function selectDot() {\n $(\".dot\").addClass(\"hidden-dot\");\n var selectDot = Math.floor(Math.random() * numDots);\n $(\"#dot-\" + selectDot).removeClass(\"hidden-dot\");\n }", "title": "" }, { "docid": "7aaa4e51ae232186d58bac21562c1a29", "score": "0.5541549", "text": "createOffscreenDot() {\n\t\tlet left = Math.floor(Math.random() * 2) === 1 ? true : false;\n\t\tlet canvasHalfWidth = this.element.width / 2;\n\t\tthis.dots.push({\n\t\t\tx: left ? Math.random() * canvasHalfWidth - 5 : Math.random() * canvasHalfWidth + canvasHalfWidth + 5,\n\t\t\ty: -5,\n\t\t\txSpeed: left ? Math.random() : Math.random() - 1,\n\t\t\tySpeed: Math.random() + 1,\n\t\t\tsize: this.dotSize\n\t\t});\n\n\t\treturn this;\n\t}", "title": "" }, { "docid": "96a3b6213a3fc93ce9d42945c24f1389", "score": "0.554121", "text": "precioDescuento(){\n this.precioDescuento = this.precio * 0.85;\n }", "title": "" }, { "docid": "d3c7eb05f23dc332362867b931b1ec0e", "score": "0.5533447", "text": "function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n return {\n x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n };\n }", "title": "" }, { "docid": "a78f9f78f8e26b8c014c1e8646ab6dd8", "score": "0.5522125", "text": "dot(v) {\n return this.x * v.x + this.y * v.y;\n }", "title": "" }, { "docid": "603d3dd9515bee16e7dc056587f01050", "score": "0.5519647", "text": "static dot(p1, p2) {\n return p1.x * p2.x + p1.y * p2.y;\n }", "title": "" }, { "docid": "9ebe7513e5bfe7e28d8a38c35a57a4e6", "score": "0.5519411", "text": "function obliczDelte(){\n \n \n // resetowanie wartosci jesli ktos ponownie uzyje skryptu bez przeładowania strony\n x = 1;\n y = 1;\n i = 1;\n m = 1;\n m2 = 1;\n \n // na potrzeby wzoru potrzeba przeciwnosci liczby b\n delta_b = delta_b * -1; \n \n\n // jezeli delta jest wieksza od 0, posiada 2 rozwiazania\n if(wartoscDelty > 0){\n\n // wyswietlenie spana, oraz umieszczenie informacji o wartosci delty\n wynikDelty.style.display = \"block\";\n wynikDelty.textContent = \"∆= \" + wartoscDelty + \" istnieją 2 rozwiązania.\";\n\n // pierwiastek z delty\n sqrtDelta = Math.sqrt(wartoscDelty);\n\n // obliczanie x1 oraz x2, a nastepnie wyswietlenie spana,\n // oraz umieszczenie obliczen\n wartosc_x1 = (delta_b - sqrtDelta) / (2 * delta_a);\n wartosc_x2 = (delta_b + sqrtDelta) / (2 * delta_a);\n\n\n // jeżeli użytkownik wybrał podanie wyniku w postaci liczb całkowitych\n if(calkowite === true){\n wynik_x1.style.display = \"block\";\n wynik_x1.innerHTML = \"x<sub>1</sub>= \" + wartosc_x1;\n\n wynik_x2.style.display = \"block\";\n wynik_x2.innerHTML = \"x<sub>2</sub>= \" + wartosc_x2; \n }\n // jezeli uzytkownik wybral podanie wyniku w postaci ulamkow\n else{\n \n // roznorakie potrzebne mi obliczenia, aby pokazac odpowiednie wartosci w ulamkach\n licznik_1 = delta_b - sqrtDelta;\n licznik_2 = delta_b + sqrtDelta;\n mianownik = 2 * delta_a;\n wielkosc_ulamka_x1 = (licznik_1 / mianownik) - ((licznik_1 % mianownik) / mianownik);\n wielkosc_ulamka_x2 = (licznik_2 / mianownik) - ((licznik_2 % mianownik) / mianownik);\n licznik_1_ulamek = Math.abs(licznik_1 - (wielkosc_ulamka_x1 * mianownik));\n licznik_2_ulamek = Math.abs(licznik_2 - (wielkosc_ulamka_x2 * mianownik));\n licznik_1_ulamek = licznik_1_ulamek.toFixed(2);\n licznik_2_ulamek = licznik_2_ulamek.toFixed(2);\n hr_width_delta_dodatnia_1 = 8;\n hr_width_delta_dodatnia_2 = 8;\n \n // sprawdzanie jakiej dlugosci jest liczba, aby odpowiednio wydluzyc\n // kreske ulamka oraz odstepu kreski od liczby, aby na siebie nie najezdzalo\n licznik_1 = licznik_1.toFixed(2);\n licznik_2 = licznik_2.toFixed(2);\n mianownik = mianownik.toFixed(2);\n margin_x1 = 6;\n margin_x2 = 6;\n \n if (sprawdzDlugosc(licznik_1) > 1 || sprawdzDlugosc(licznik_2) || sprawdzDlugosc(mianownik) > 1){\n // pętla odpowiednio zwiekszajaca kreske ulamka x1, na 1 liczbe +8px\n while(sprawdzDlugosc(licznik_1_ulamek) > x || sprawdzDlugosc(mianownik) > x){\n hr_width_delta_dodatnia_1 += 8;\n x++;\n }\n // pętla odpowiednio zwiekszajaca kreske ulamka x2, na 1 liczbe +8px\n while(sprawdzDlugosc(licznik_2_ulamek) > y || sprawdzDlugosc(mianownik) > y){\n hr_width_delta_dodatnia_2 += 8;\n y++;\n }\n }\n \n \n // jezeli reszta z dzielenia jest rowna 0, wyswietla jedynie liczbe calkowita\n // poniewaz wyswietlanie ulamka 0/0 jest bez sensu\n if(licznik_1 % mianownik == 0){\n wynik_x1.style.display = \"block\";\n \n wynik_x1.innerHTML = '<span id=\"x1\">x<sub>1</sub>= </span><span id=\"wielkosc_ulamka_x1\">' + wielkosc_ulamka_x1 + '</span>';\n }\n \n // jezeli jest reszta z dzielenia wyswietla odpowiedni ulamek\n else{\n // petla zwiekszajaca odlegosc liczby od kreski, aby na siebie nie najezdzaly\n while(sprawdzDlugosc(wielkosc_ulamka_x1) > m){\n margin_x1 += 6;\n m++;\n } \n\n // wyswietlanie odpowiednio wartosci\n wynik_x1.style.display = \"block\";\n wynik_x1.innerHTML = '<span id=\"x1\">x<sub>1</sub>= </span><span id=\"wielkosc_ulamka_x1\">' + wielkosc_ulamka_x1 + '</span><span align=\"center\" id=\"ulamek_x1\">' + licznik_1_ulamek + '<hr align=\"left\" width=\"' + hr_width_delta_dodatnia_1 + 'px\" />' + mianownik + '</span>';\n document.getElementById('wielkosc_ulamka_x1').style.marginRight = margin_x1 + 'px';\n \n } \n \n // jezeli reszta z dzielenia jest rowna 0, wyswietla jedynie liczbe calkowita\n // poniewaz wyswietlanie ulamka 0/0 jest bez sensu\n if(licznik_2 % mianownik == 0){\n \n // wyswietlanie odpowiednio wartosci\n wynik_x2.style.display = \"block\"; \n wynik_x2.innerHTML = '<span id=\"x2\">x<sub>2</sub>= </span><span id=\"wielkosc_ulamka_x2\">' + wielkosc_ulamka_x2 + '</span>';\n }\n \n // jezeli jest reszta z dzielenia wyswietla odpowiedni ulamek\n else{\n // petla zwiekszajaca odlegosc liczby od kreski, aby na siebie nie najezdzaly\n while(sprawdzDlugosc(wielkosc_ulamka_x2) > m2){\n margin_x2 += 6;\n m2++;\n } \n \n // wyswietlanie odpowiednio wartosci\n wynik_x2.style.display = \"block\";\n wynik_x2.innerHTML = '<span id=\"x2\">x<sub>2</sub>= </span><span id=\"wielkosc_ulamka_x2\">' + wielkosc_ulamka_x2 + '</span><span align=\"center\" id=\"ulamek_x2\">' + licznik_2_ulamek + '<hr align=\"left\" width=\"' + hr_width_delta_dodatnia_2 + 'px\" />' + mianownik + '</span>';\n document.getElementById('wielkosc_ulamka_x2').style.marginRight = margin_x2 + 'px';\n \n } \n \n \n }\n }\n // jezeli delta rowna 0, poniewaz wczesniejsza funkcja wykluczylismy\n else if(wartoscDelty == 0){\n wynikDelty.style.display = \"block\";\n wynikDelty.textContent = \"∆= \" + wartoscDelty + \" istnieje 1 rozwiązanie.\";\n\n // obliczanie x0, a nastepnie wyswietlenie spana, oraz umieszczenie obliczen\n wartosc_x0 = delta_b / (2 * delta_a)\n // jeżeli użytkownik wybrał podanie wyniku w postaci liczb całkowitych\n if(calkowite === true){ \n wynik_x0.style.display = \"block\";\n wynik_x0.innerHTML = \"x<sub>0</sub>= \" + wartosc_x0; \n }\n \n // jezeli uzytkownik wybral podanie wyniku w postaci ulamkow\n else{\n \n // liczby potrzebne do wyswietlenia w postaci ulamkow\n licznik = delta_b;\n mianownik = 2 * delta_a; \n wielkosc_ulamka = (licznik / mianownik) - (licznik % mianownik);\n hr_width_delta_zerowa = 8;\n margin_x1 = 8;\n margin_x2 = 8;\n \n // sprawdzanie jakiej dlugosci jest liczba, aby odpowiednio wydluzyc\n // kreske ulamka\n if (sprawdzDlugosc(licznik) > 1 || sprawdzDlugosc(mianownik) > 1){\n // pętla odpowiednio zwiekszajaca kreske ulamka, na 1 liczbe 8px\n while(sprawdzDlugosc(licznik) > i || sprawdzDlugosc(mianownik) > i){\n hr_width_delta_zerowa += 8;\n i++;\n }\n }\n \n \n // jezeli reszta z dzielenia jest rowna 0, wyswietla jedynie liczbe calkowita\n // poniewaz wyswietlanie ulamka 0/0 jest bez sensu\n if(licznik % mianownik == 0){\n wynik_x0.style.display = \"block\";\n wynik_x0.innerHTML = '<span id=\"x0\">x<sub>0</sub>= </span><span id=\"wielkosc_ulamka_x0\">' + wielkosc_ulamka.toFixed(2) + '</span>';\n }\n \n // jezeli jest reszta z dzielenia wyswietla odpowiedni ulamek\n else{\n wynik_x0.style.display = \"block\";\n wynik_x0.innerHTML = '<span id=\"x0\">x<sub>0</sub>= </span><span id=\"wielkosc_ulamka_x0\">' + wielkosc_ulamka.toFixed(2) + '</span><span align=\"center\" id=\"ulamek_x0\">' + licznik.toFixed(2) + '<hr align=\"left\" width=\"' + hr_width_delta_zerowa + 'px\" />' + mianownik + '</span>';\n } \n }\n }\n // w innym przypadku, czyli zostaje jedynie delta ujemna, wyswietlanie spana, oraz umieszczenie informacji że delta jest ujemna\n else{\n wynikDelty.style.display = \"block\";\n wynikDelty.textContent = \"∆ ujemna, brak rozwiązań\";\n }\n \n\n}", "title": "" }, { "docid": "7e690ed1db92cf362f04def74c19f504", "score": "0.5519363", "text": "dotXY(x, y) {\n return this.x * x + this.y * y;\n }", "title": "" }, { "docid": "327914897353ce6df08014f02ba86d90", "score": "0.55079186", "text": "function drawOneDots(posXS, posYS, colored) {\n ellipse(posXS+(caseWidth/2), posYS+(caseHeight/2), 5, 5);\n}", "title": "" }, { "docid": "76dbc4da1f7a81a14d90238460345e3c", "score": "0.5496718", "text": "function moveDot() {\n // clear canvas to redraw dots\n context.clearRect(0, 0, cWidth, cHeight);\n \n for (i = 0; i < dots.length; i++) {\n // move dot based on object's direction and speed values\n if (dots[i].xMove == '+') {\n dots[i].x += dots[i].speed;\n } else {\n dots[i].x -= dots[i].speed;\n }\n\n if (dots[i].yMove == '+') {\n dots[i].y += dots[i].speed;\n } else {\n dots[i].y -= dots[i].speed;\n }\n \n // redraw dot\n drawDot(dots[i])\n \n // if dot hits edge of screen, reverse it's direction\n if ((dots[i].x + dots[i].radius) >= cWidth) {\n dots[i].xMove = '-';\n }\n\n if ((dots[i].x - dots[i].radius) <= 0) {\n dots[i].xMove = '+';\n }\n\n if ((dots[i].y + dots[i].radius) >= cHeight) {\n dots[i].yMove = '-';\n }\n\n if ((dots[i].y - dots[i].radius) <= 0) {\n dots[i].yMove = '+';\n }\n }\n \n // Render it again\n window.requestAnimationFrame(moveDot);\n }", "title": "" }, { "docid": "4ac940a94dba8df951d11f0ac80af34f", "score": "0.5494927", "text": "static format(dots, state) {\n const right_shift = state.right_shift;\n const dot_spacing = 1;\n\n if (!dots || dots.length === 0) return false;\n\n const dot_list = [];\n const max_shift_map = {};\n for (let i = 0; i < dots.length; ++i) {\n const dot = dots[i];\n const note = dot.getNote();\n\n let props;\n let shift;\n\n // Only StaveNote has .getKeyProps()\n if (typeof note.getKeyProps === 'function') {\n props = note.getKeyProps()[dot.getIndex()];\n shift = note.getRightDisplacedHeadPx();\n } else { // Else it's a TabNote\n props = { line: 0.5 }; // Shim key props for dot placement\n shift = 0;\n }\n\n const note_id = note.getAttribute('id');\n dot_list.push({ line: props.line, note, note_id, dot });\n max_shift_map[note_id] = Math.max(max_shift_map[note_id] || shift, shift);\n }\n\n // Sort dots by line number.\n dot_list.sort((a, b) => b.line - a.line);\n\n let dot_shift = right_shift;\n let x_width = 0;\n let last_line = null;\n let last_note = null;\n let prev_dotted_space = null;\n let half_shiftY = 0;\n\n for (let i = 0; i < dot_list.length; ++i) {\n const { dot, note, note_id, line } = dot_list[i];\n\n // Reset the position of the dot every line.\n if (line !== last_line || note !== last_note) {\n dot_shift = max_shift_map[note_id];\n }\n\n if (!note.isRest() && line !== last_line) {\n if (Math.abs(line % 1) === 0.5) {\n // note is on a space, so no dot shift\n half_shiftY = 0;\n } else {\n // note is on a line, so shift dot to space above the line\n half_shiftY = 0.5;\n if (last_note != null &&\n !last_note.isRest() && last_line - line === 0.5) {\n // previous note on a space, so shift dot to space below the line\n half_shiftY = -0.5;\n } else if (line + half_shiftY === prev_dotted_space) {\n // previous space is dotted, so shift dot to space below the line\n half_shiftY = -0.5;\n }\n }\n }\n\n // convert half_shiftY to a multiplier for dots.draw()\n if (note.isRest()) {\n dot.dot_shiftY += -half_shiftY;\n } else {\n dot.dot_shiftY = -half_shiftY;\n }\n prev_dotted_space = line + half_shiftY;\n\n dot.setXShift(dot_shift);\n dot_shift += dot.getWidth() + dot_spacing; // spacing\n x_width = (dot_shift > x_width) ? dot_shift : x_width;\n last_line = line;\n last_note = note;\n }\n\n // Update state.\n state.right_shift += x_width;\n return true;\n }", "title": "" }, { "docid": "4fd39b6b42b4b6f8f8a836d938bfaf5d", "score": "0.5486671", "text": "dot() {\n // If the last element in queue is not a number then push 0 value in front\n // as this will be fraction of 0.\n const last = this.queue[this.queue.length - 1];\n if (last === undefined || Number.isNaN(Number(last))) {\n this.queue[this.queue.length] = 0;\n } else if (typeof last === 'string') {\n // This is already a decimal value which in this app is represented as\n // a number casted to string.\n return;\n }\n this._pushSymbol(CalculatorApp.DOT_SYMBOL);\n }", "title": "" }, { "docid": "05b5d0876e974a35b5708d0c56b52c6c", "score": "0.54806155", "text": "function putDot(n, x, y, size) {\n\t\tvar id = 'dot-' + n,\n\t\t\tel = document.getElementById(id);\n\t\tif (!el) {\n\t\t\tel = document.createElement('div');\n\t\t\tvar ael = angular.element(el);\n\t\t\tael.addClass('dot');\n\t\t\thide(ael, x, y, size);\n\t\t\tel.id = id;\n\t\t\tif (options.showNumbers)\n\t\t\t\tael.text(n + options.indexFrom);\n\t\t\tpanel.append(ael);\n\t\t}\n\t\t// todo - replace with css animation?\n\t\tpromises[n] = timeout(function() {\n\t\t\t(ael || angular.element(el)).removeClass('hiding')\n\t\t\t\t.css({\n\t\t\t\t\tbackground: service.getBg(n),\n\t\t\t\t\ttop: (y - size * 0.5) + 'px',\n\t\t\t\t\tleft: (x - size * 0.5) + 'px',\n\t\t\t\t\t'line-height': size - borderWidth + 'px',\n\t\t\t\t\t'font-size': (size * options.fontSize) + 'px',\n\t\t\t\t\twidth: size + 'px',\n\t\t\t\t\theight: size + 'px'\n\t\t\t\t});\n\t\t}, options.preTransitionDelay);\n\t}", "title": "" }, { "docid": "5071acae34b762d7f3e3adb63349de17", "score": "0.54547095", "text": "caso1(valor,x,y){\n this.l_horizontal.appendO(y);\n this.l_vertical.appendO(x);\n let pos_x=this.l_vertical.buscar(x);\n let pos_y=this.l_horizontal.buscar(y);\n let nodo= new Nodo(valor,x,y);\n pos_x.der=nodo;\n pos_y.abajo=nodo;\n nodo.arriba=pos_y;\n nodo.izq=pos_x;\n }", "title": "" }, { "docid": "8458278fcbb6dac67cd4fb2caffa1ab7", "score": "0.5451717", "text": "appendDot(){\n if (this.currentVal.indexOf('.') === -1) {\n this.append('.');\n }\n }", "title": "" }, { "docid": "6bb1e7cc1456bf85b881932b11cd53df", "score": "0.5441528", "text": "function Dot(radius, x, y, hue) {\n    this.radius = radius;\n    this.x = x;\n    this.y = y;\n    this.hue = hue;\n this.inHoverRadius = false;\n}", "title": "" }, { "docid": "e9a4542807a7e56ce55b14501b8bfd6a", "score": "0.54337925", "text": "function drawUpDot(currentX, currentY, lastX, lastY, toolColor, toolSize) {\n \t\tdrawDownDot(currentX, currentY, toolColor, toolSize);\n \t}", "title": "" }, { "docid": "0e0252e41b174692ec1e5b7afbce55e3", "score": "0.5432845", "text": "function position(dot) {\n dot.attr(\"cx\", function (d) {\n return xScale(xMotion(d));\n })\n .attr(\"cy\", function (d) {\n return yScale(yMotion(d));\n })\n .attr(\"r\", function (d) {\n return radiusScale(radius(d));\n });\n }", "title": "" }, { "docid": "53180e985ddb4b7f27b161c011067384", "score": "0.5430715", "text": "function addDot() {\n\tconsole.log(gRegister);\n\tvar puntPosition = gRegister.innerHTML.indexOf(\".\");\n\tif (puntPosition == -1) {\n\t\tgRegister.innerHTML = gRegister.innerHTML + \".\";\n\t}\n}", "title": "" }, { "docid": "a758781fb68de6a6b7368d5327269274", "score": "0.54290605", "text": "toDot() {\n return this.toDotWithParamaters({\n nodes: {\n Interaction: {\n color: \"#ffd1d1\",\n transform: (x) => ({\n label: (x.content.operatorType + '\\n' + x.content.operator.replace(/\"/g,\"\"))\n })\n },\n InteractionInstance: {\n color: \"#ffed8e\",\n transform: (x) => ({\n shape: (x.content.type === 'InteractionSimple') ? \"ellipse\" : 'box',\n color: (x.content.type === 'InteractionSimple') ? \"#ffde2f\" : \"#dff1f2\",\n fontname: (x.content.type === 'InteractionSimple') ? 'Times' : 'Courier',\n label: x.id + '\\n' + ((x.content.type === 'InteractionSimple') ? (x.content.operatorType + '\\n' + x.content.operator.replace(/\"/g,\"\")) : (x.content.content.replace(/\"/g,\"\"))) + \"\\n\" + ((x.ports).map((x, i) => (i + \": \" + serialize(x))).join('\\n'))\n })\n },\n InteractionDefinition: {\n color: \"#afe7ff\",\n transform: (x) => ({\n label: x.content.signature.operator\n })\n },\n InterfaceDefinition: {\n color: \"#afffe4\",\n transform: (x) => ({\n label: x.content.signature\n })\n },\n InteractionSignatureOperandElement: {\n color: \"#2fffc7\",\n transform: (x) => ({\n label: x.content.name\n })\n },\n Interface: {\n color: \"#2fcdff\",\n transform: (x) => ({\n label: (x.content.type === 'InterfaceAtomic') ? (x.name + ' : ' + serialize(x.content)) : (x.name)\n })\n }\n },\n directedEdges: {\n DefinitionSubInteractionInstance: {\n color: \"#ffd3b3\",\n transform: (x) => ({\n label: \"\"\n })\n },\n DefinitionInteractionInstance: {\n color: \"#ff6b00\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InteractionInstanceIsOperandOf: {\n color: \"#00ff03\",\n transform: (x) => ({\n label: x.to.index\n })\n },\n InteractionInstanceInteraction: {\n color: \"#ffa800\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InteractionOperand: {\n color: \"#d00000\",\n transform: (x) => ({\n label: x.from.index\n })\n },\n DefinitionInteraction: {\n color: \"#ff0000\",\n transform: (x) => ({\n label: x.from.index\n })\n },\n DefinitionSubInteraction: {\n color: \"#ffd5d5\",\n transform: (x) => ({\n label: \"\"\n })\n },\n SignatureOperand: {\n color: \"#2fffc7\",\n transform: (x) => ({\n label: x.from.index\n })\n },\n InteractionSignatureOperandElementInterface: {\n color: \"#00e8ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n DefinitionInterface: {\n color: \"#00e8ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n DefinitionSubInterface: {\n color: \"#bef9ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InterfaceElement: {\n color: \"#008cff\",\n transform: (x) => ({\n label: x.from.index\n })\n },\n InterfaceInteractionInstance: {\n color: \"#e300ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n DefinitionDefinition: {\n color: \"#81ddff\",\n transform: (x) => ({\n label: x.from.index\n })\n },\n InteractionDefinition: {\n color: \"#e681ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InterfaceDefinition: {\n color: \"#2bff00\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InteractionDefinitionDependency: {\n color: \"#0040ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InterfaceDefinitionDependency: {\n color: \"#b5ff00\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InteractionInstanceDataDependency: {\n color: \"#ddd2ff\",\n transform: (x) => ({\n label: \"\"\n })\n },\n InteractionInstanceOrdering: {\n color: \"#cc00ff\",\n transform: (x) => ({\n label: x.executionOrder\n })\n }\n },\n undirectedEdges: {\n InteractionInstanceOperand: {\n color: \"#9d8400\",\n transform: (x) => ({\n label: x.id,\n headlabel: x.to.index + (_.isUndefined(x.to.ports) ? '' : (': ' + serialize(x.to.ports))) + (_.isUndefined(x.to.compositionElementName) ? '' : (': ' + x.to.compositionElementName)),\n taillabel: x.from.index + (_.isUndefined(x.from.ports) ? '' : (': ' + serialize(x.from.ports))) + (_.isUndefined(x.from.compositionElementName) ? '' : (': ' + x.from.compositionElementName))\n })\n },\n }\n });\n }", "title": "" }, { "docid": "948d16b07eb4cda9e42f792d0ffbb156", "score": "0.5422101", "text": "toString() {\n\t\tlet str = '\\n';\n\t\tfor (let i = 0; i < this.rows; i++) {\n\t\t\tfor (let j = 0; j < this.cols; j++) {\n\t\t\t\tif (this.grid[i][j] === 0) {\n\t\t\t\t\tstr += ' . ';\n\t\t\t\t} else {\n\t\t\t\t\tstr += ' X ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr += \"\\n\";\n\t\t}\n\t\treturn str;\t\n\t}", "title": "" }, { "docid": "6c28b9d0a6cfa1713be65f9bf0f35304", "score": "0.5420137", "text": "toString() {\n let str = '\\n';\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n if (this.grid[i][j] === 0) {\n str += ' . ';\n } else {\n str += ' X ';\n }\n }\n str += \"\\n\";\n }\n return str;\n }", "title": "" }, { "docid": "a5cde5bcdcfff2400302eb2f5519ba5f", "score": "0.5407484", "text": "dot(v) {\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n }", "title": "" }, { "docid": "4aa7bb0fc6d6b475c80a7842034a95f9", "score": "0.5405891", "text": "generateDot() {\n const nslimit = !isNaN(this.iterations) ? `nslimit=${this.iterations}` : '';\n const nodesep = this.nodeSpacing / 96;\n const ranksep = this.layerSpacing / 96;\n\n let dot = `digraph {\n rankdir=\"${this.direction}\"\n ranksep=${ranksep}\n nodesep=${nodesep}\n ${nslimit}\n node [shape=\"box\" fixedsize=true]\n edge [arrowhead=\"none\"]\\n`;\n const vit = this.network.vertexes.iterator;\n while (vit.next()) {\n const v = vit.value;\n const node = v.node;\n if (!node) continue;\n if (node instanceof go.Group) throw new Error('DotLayout does not currently support Groups.');\n this.assignVertexProperties(v);\n // prepare DOT language attributes for non-default vertex properties\n const width = !isNaN(v.width) ? `width=${v.width / 96}` : '';\n const height = !isNaN(v.height) ? ` height=${v.height / 96}` : '';\n const shape = v.shape !== 'box' ? ` shape=\"${v.shape}\"` : '';\n // divide size by 96 since Graphviz expects inches\n dot += ` ${node.key} [${width}${height}${shape}]\\n`;\n }\n const eit = this.network.edges.iterator;\n while (eit.next()) {\n const e = eit.value;\n const link = e.link;\n if (!link) continue;\n const fromNode = link.fromNode;\n const toNode = link.toNode;\n if (!(fromNode && toNode)) continue;\n this.assignEdgeProperties(e);\n // prepare DOT language attributes for non-default edge properties\n const constraint = !e.isConstraint ? ' constraint=false' : '';\n const tailport = e.tailport !== 'c' ? ` tailport=${e.tailport}` : '';\n const headport = e.headport !== 'c' ? ` headport=${e.headport}` : '';\n const weight = e.weight !== 1 ? ` weight=${e.weight}` : '';\n // include the Link key as an ID for quick lookup from the output\n dot += ` ${fromNode.key} -> ${toNode.key} [id=${link.key}${constraint}${tailport}${headport}${weight}]\\n`;\n }\n dot += '}';\n return dot;\n }", "title": "" }, { "docid": "ae4b256d08b1d3411f3deed3b8e16d10", "score": "0.53873265", "text": "function dotAtIntersection(row, column) {\r\n ctx.lineCap = 'round';\r\n ctx.lineWidth = 10;\r\n\r\n ctx.beginPath();\r\n c = getPosition(row, column);\r\n ctx.moveTo(c.x, c.y);\r\n ctx.lineTo(c.x, c.y);\r\n ctx.stroke();\r\n}", "title": "" }, { "docid": "53e473cae8e98790ed3496395b0a72ab", "score": "0.53818816", "text": "dot(other) {\n return this.x * other.x + this.y * other.y;\n }", "title": "" }, { "docid": "4ac0735abc1c083771863381f9713607", "score": "0.5379749", "text": "dot(v) {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n }", "title": "" }, { "docid": "4ac0735abc1c083771863381f9713607", "score": "0.5379749", "text": "dot(v) {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n }", "title": "" }, { "docid": "d14cb9d6d1bdb6838a3a57240008392f", "score": "0.53731054", "text": "function highlightDot(j) {\n var dots = d.getElementById('dots')\n var n = Math.ceil(state.vids.length / state.inc)\n\n if (n > 4 && state.win < state.min_win) // small screen\n return showPage(dots, n)\n\n dots = dots.childNodes\n var l = dots.length\n var k = 0\n for (; k < l; k++) YAHOO.util.Dom.removeClass(dots[k], 'selected')\n YAHOO.util.Dom.addClass(dots[j], 'selected')\n }", "title": "" }, { "docid": "ffad4764bc120568a253684abe0249de", "score": "0.53702897", "text": "function speciesDot(colour, text) {\n //return '<span class=\"speciesDot\" style=\"color:'+colour+';\">&#9899</span>'+text; Increase text size.\n return '<span class=\"speciesDot\" style=\"color:'+colour+';\">&#9679</span>'+text;\n}", "title": "" }, { "docid": "cd63b8096e432628aaf94326404fe0f0", "score": "0.5368681", "text": "function init() {\n dots = [];\n \n // Add the dots\n\tfor (let row = DOT_LARGE; row <= ch; row += DOT_LARGE*2) {\n\t\tfor (let col = DOT_LARGE; col <= cw; col += DOT_LARGE*2) {\n     addDot(DOT_SMALL, col, row);\n }\n }\n \n draw();\n}", "title": "" }, { "docid": "6e67d3d5a3c3428fabfb7be6e67df0f9", "score": "0.5368295", "text": "function createDot(className) {\n\n var el = document.createElement('span');\n\n el.setAttribute(\"class\", className);\n el.innerHTML = \". \";\n return el;\n\n}", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.53530884", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.53530884", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "1565279ff5b85cc9a75d8d25b10b5011", "score": "0.53530884", "text": "function drawDot(x, y, r, a){\n ctx.fillStyle = DOTCOLOR;\n\n a1 = -(Math.ceil(a) * PI / 180);\n\n var x1 = (x) + Math.cos(a1) * (r);\n var y1 = (y) + Math.sin(a1) * (r);\n\n ctx.beginPath();\n ctx.globalAlpha = 1;\n ctx.arc(x1, y1, 5, 0, 2*PI);\n ctx.strokeStyle = DOTOUTLINE;\n ctx.lineWidth = CB[1];\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "f00d58650c1cfd99001d818da96f4105", "score": "0.5345471", "text": "function numero(xx) { //Toma el numero seleccionado\r\n if (x==\"0\" || xi==1 ) {\t\r\n pantalla.innerHTML=xx; \r\n x=xx; //guarda el numero\r\n if (xx==\".\") { //si se escribe una coma al principio del número\r\n pantalla.innerHTML=\"0.\";\r\n x=xx; \r\n coma=1; //cambia el estado de la coma\r\n }\r\n }\r\n else { //continuar escribiendo un número\r\n if (xx==\".\" && coma==0) { //si se escribe una coma decimal pòr primera vez\r\n pantalla.innerHTML+=xx;\r\n x+=xx;\r\n coma=1; \r\n }\r\n //si se escribir una segunda coma decimal no realiza ninguna acción.\r\n else if (xx==\".\" && coma==1) {} \r\n //Resto de casos: escribir un número del 0 al 9: \t \r\n else {\r\n pantalla.innerHTML+=xx;\r\n x+=xx\r\n }\r\n }\r\n xi=0 \r\n \r\n }", "title": "" }, { "docid": "ad58b805f3c1e351d63128325309525f", "score": "0.53386474", "text": "isSameDot(dotA, dotB){\r\n\r\n }", "title": "" }, { "docid": "a395e945759e2a0f458708a953fd7c5e", "score": "0.5326444", "text": "function getPelnas2( menuo, pajamos2, nuostoliai2 ) {\n let pelnas = pajamos2 - nuostoliai2;\n return menuo + \" \" + pelnas; //tarpukas yra tarp kabuciu, kad isvedime rodytu su tarpeliu;\n}", "title": "" } ]
0ccb4b9c1893d4393346d4ffb14872f9
displays saved recent searches as button in Recent Searches on page1
[ { "docid": "6aa492b19af211e65563f8158e934659", "score": "0.0", "text": "function displayCityBtn() {\n $('#Box').empty();\n for (var i = 0; i < storeCity.length; i++) {\n var newBtn = $(\"<button>\");\n newBtn.attr(\"type\", \"button\");\n newBtn.attr(\"class\", \"you list-group-item list-group-item-action cityBtn\");\n newBtn.attr('value', storeCity[i]);\n newBtn.attr(\"data-cityName\", storeCity[i]);\n newBtn.text(storeCity[i]);\n\n $(\"#Box\").append(newBtn);\n }\n localStorage.setItem('cities', JSON.stringify(storeCity));\n //btn functionality\n $('.you').on('click', function (event) {\n var btn = $('.you').val()\n document.getElementById('weather').innerHTML = '';\n curWeather(btn)\n })\n}", "title": "" } ]
[ { "docid": "005ea511d1bf9ef6310c0219a8489e4d", "score": "0.7060347", "text": "function displaySavedSearches() {\n // Clear what's displayed\n savedSearchesEl.empty();\n\n for (var idx = 0; idx < savedSearches.length; idx++) {\n // Create button element similar to this element\n // <button class=\"recent-1 flex w-100 bg-washed-blue\">btn 1</button> \n var searchEl = $(\"<button>\");\n searchEl.addClass(\"w-100 bg-washed-blue link dim black mw5 dt hide-child ba b--black-20 pa1 br2 pointer center\");\n searchEl.text(savedSearches[idx]);\n searchEl.attr(\"data-search-val\", savedSearches[idx]);\n savedSearchesEl.append(searchEl);\n }\n\n if (savedSearches.length > 0) {\n searchHistoryEl.show();\n } else {\n searchHistoryEl.hide();\n }\n}", "title": "" }, { "docid": "205efa09c5293377cfca171a4e3dc2e4", "score": "0.668437", "text": "function pageLoad () {\n var lastSearch = JSON.parse(localStorage.getItem(\"cityName\"));\n var searchDiv = $(\"<button class='btn border text-muted mt-1 shadow-sm bg-white rounded' style='width: 12rem;'>\").text(lastSearch);\n var psearch = $(\"<div>\");\n psearch.append(searchDiv)\n $(\"#searchhistory\").prepend(psearch);\n}", "title": "" }, { "docid": "f35d0d604675faffe698bd086a5ec276", "score": "0.6568901", "text": "function printPastSearches(){\n\t$('#pastSearchesList').empty();\n\tfor (let i = 0; i < pastSearches.length; i++) {\n\t\tlet button = $('<a>');\n\t\tbutton.addClass('mdl-button mdl-js-button mdl-js-ripple-effect past-search');\n\t\tbutton.text(pastSearches[i]);\n\t\tbutton.attr('data-term', pastSearches[i]);\n\t\t$('#pastSearchesList').prepend(button);\n\t}\n}", "title": "" }, { "docid": "7af918f6a3020058b935880ebe1eb434", "score": "0.6334042", "text": "function grabPrevSearches() {\n var previousSearches = \"\";\n var previousSearch = localStorage.getItem(\"previousSearches\");\n if (previousSearch) {\n searches = JSON.parse(previousSearch);\n for (var i = 0; i < searches.length; i++) {\n // Add buttons to reference previously searched cities\n previousSearches += `<button id=${searches[i].ID} class=\"prvSearch\">${searches[i].Title}</button>`;\n }\n }\n prvSearches.innerHTML = previousSearches;\n}", "title": "" }, { "docid": "96dcd481c89c3523df9a5b1d9d755b49", "score": "0.62646127", "text": "function displayLatestSearches() {\n\n $(`.searchedCitiesContainer`).text(\"\");\n\n // grabs recent searches\n var searchHistory = getLatestSearches();\n\n for (var i = 0; i < 8; i++) {\n \n if (searchHistory[i]) {\n \n // creating buttons withh recent searches\n recentSearchButtonEl = $(\"<button></button>\").text(searchHistory[i]);\n recentSearchButtonEl.addClass(\"previousSearchButton\");\n recentSearchButtonEl.attr(\"id\", searchHistory[i])\n\n recentSearchButtonEl.on(\"click\", (event) => {\n saveSearchTerm(event.target.id);\n provideWeather(event.target.id);\n })\n\n $('.searchedCitiesContainer').append(recentSearchButtonEl);\n \n }\n }\n}", "title": "" }, { "docid": "d7790ce2f2cb6ca31a4b1d4eb015b2af", "score": "0.6245143", "text": "function previousSearches() {\n savedCities.empty();\n sessionStorage.forEach((city) => {\n var cityBtn = $(\"<button>\");\n\n cityBtn.attr(\"type\", \"submit\");\n cityBtn.attr(\"value\", city);\n cityBtn.addClass(\"list-group-item list-group-item-action\");\n cityBtn.text(city);\n\n savedCities.prepend(cityBtn);\n });\n }", "title": "" }, { "docid": "0b4b5cd145e3871ded77cc4653a90549", "score": "0.62129813", "text": "function displayLastCity() {\n var lastCityAux = citiesArray[citiesArray.length -1];\n var lastCity = lastCityAux[0].toUpperCase() + lastCityAux.substring(1);\n var cityButton = document.createElement(\"input\");\n cityButton.setAttribute(\"id\",\"button\");\n cityButton.setAttribute(\"type\",\"submit\");\n cityButton.setAttribute(\"value\",lastCity);\n\n //Add button to search history\n searchHistory.appendChild(cityButton);\n}", "title": "" }, { "docid": "f82f9027f94a74f59509a87b2c7b882e", "score": "0.6208056", "text": "function createHistoryButtons() {\n // storedSearch = getStored();\n $(\"#savedSearch\").empty();\n\n for (var i = 0; i < storedSearch.length; i++) {\n // if (storedSearch[i] == undefined) {\n // return;\n // } else {\n var newButton = $(\n \"<div class='row'><div class='col'><button class='btn btn-info'>\" +\n storedSearch[i] +\n \"</button></div></div>\"\n );\n\n $(\"#savedSearch\").append(newButton);\n }\n }", "title": "" }, { "docid": "05e7ac4a8d35d6275377bb905119d5af", "score": "0.61807984", "text": "function renderHistory() {\n var searchBtns = [$(\"#cityBtn1\"), $(\"#cityBtn2\"), $(\"#cityBtn3\"), $(\"#cityBtn4\"), $(\"#cityBtn5\"), $(\"#cityBtn6\"), $(\"#cityBtn7\"), $(\"#cityBtn8\"), $(\"#cityBtn9\"), $(\"#cityBtn10\")];\n searchedCities = JSON.parse(localStorage.getItem(\"cities\"));\n // enables button for use (defaults as disabled when no recent search history):\n $(\"#cityBtn1\").prop(\"disabled\", false);\n for (i = 0; i < searchBtns.length; i++) {\n if (searchedCities[i] === undefined) {\n return;\n } else {\n searchBtns[i].text(searchedCities[i]);\n searchBtns[i].attr(\"data-name\", searchedCities[i]);\n searchBtns[i].removeClass(\"d-none\");\n }\n }\n }", "title": "" }, { "docid": "c035bec3a5b32b8dc683bfc24170fdbd", "score": "0.6164107", "text": "function displaySearches() {\n pastActivities.empty();\n\n clearSearchBtn.style.display = \"flex\";\n\n tryAgainH3.textContent = \"Or try one of these activities again!\";\n var oldSearches = JSON.parse(localStorage.oldSearches);\n for (let i = 0; i < oldSearches.length; i++) {\n var oldSearch = oldSearches[i];\n var displaySearches = document.createElement(\"button\");\n displaySearches.setAttribute(\"id\", oldSearch);\n displaySearches.textContent = oldSearch;\n displaySearches.setAttribute(\"class\", \"waves-effect waves-light btn-small\");\n pastActivities.append(\"<br>\");\n pastActivities.append(displaySearches);\n\n // gives each button in our past search/activity history an event listener\n displaySearches.addEventListener(\"click\", getPastSearch);\n }\n}", "title": "" }, { "docid": "b65b06630bfe8746edc61d749bc1dff0", "score": "0.59974307", "text": "function backtooverview_click(){\n\tvar filter = $(\"#filter\").text();\n\tvar tag = $(\"#search\").text();\n\tvar sort = $(\"#sort\").text();\n\n\tconsole.log(filter,tag)\n\tlocalStorage.setItem(\"filter\",filter);\n\tlocalStorage.setItem(\"tag\",tag);\n\tlocalStorage.setItem(\"sort\",sort);\n\twindow.location.replace(\"./overview.html\");\n}", "title": "" }, { "docid": "56261ed8b2b9a819a24d71fb3cd7c174", "score": "0.5993056", "text": "function renderHistory() {\n\n // Empty history list\n $(\"#searchHistory\").empty();\n\n // Retrieve history from localStorage\n var history = JSON.parse(localStorage.getItem(\"history\"));\n\n if (history !== null) {\n\n // Create search history list and populate page\n for (var i=0; i< cityHistory.length; i++) {\n\n var city = cityHistory[i];\n var listEl = $(\"<button class='list-group-item list-group-item-action'>\");\n listEl.text(city);\n\n $(\"#searchHistory\").append(listEl); \n }\n }\n}", "title": "" }, { "docid": "02ee33e8b8b61f07b9369b05357a8ae2", "score": "0.59851116", "text": "function loadSearchHistory() {\n var storedCities = JSON.parse(localStorage.getItem(\"history\"));\n var storedCurrentCity = localStorage.getItem(\"currentCity\");\n\n // populates the city search history buttons and executes the function to obtain the lat and lon of the last city searched\n if (storedCities && storedCurrentCity) {\n getCityLatLon(storedCurrentCity);\n for (var i = 0; i < storedCities.length; i++) {\n var cityBtn = $(\"<button>\")\n .attr(\"class\", \" cityBtn list-group-item list-group-item-action\")\n .text(storedCities[i]);\n $(\"#pastSearches\").append(cityBtn);\n }\n }\n }", "title": "" }, { "docid": "ced8cff3d7461409dbb5fbdbd4366cbb", "score": "0.59717494", "text": "function populateHistory() {\n let history = JSON.parse(localStorage.getItem(\"history\"));\n \n // Grab the container and clear it before populating it with fresh buttons\n let hContainer = $(\"#search-history\");\n hContainer.empty();\n for (var i = 0; i < history.length; i++) {\n let j = $(\"<button class='past-search btn btn-success btn-block'>\" + history[i] + \"</button>\");\n hContainer.prepend(j);\n }\n }", "title": "" }, { "docid": "0cfdea4a610e4f4b7e84fb45f0151938", "score": "0.59593236", "text": "function renderSearchHistory() {\n if (JSON.parse(localStorage.getItem(\"searchHistory\")) !== null) {\n arySearchHistory = JSON.parse(localStorage.getItem(\"searchHistory\"));\n }\n\n $(\"#searchHistory\").empty();\n $(\"#searchHistory\").append(`<hr>`);\n\n for (i=0; i < arySearchHistory.length; i++) {\n $(\"#searchHistory\").append(`\n <button id=\"historicalSearchBtn\"\n class=\"mb-3 p-2 w-100 rounded-3 text-dark\">${arySearchHistory[i]}</button>\n `);\n }\n}", "title": "" }, { "docid": "59151e4a8804d6bc33dc4c9a60f8e627", "score": "0.5958739", "text": "function history() {\n $(\"ul\").append(\"<a class= 'btn btn-secondary btn-history' href=./index.html?=\" + cleanedIn + \">\" + searchIn + \"</a>\");\n localStorage.setItem(\"history\", $(\"ul\").html());\n\n}", "title": "" }, { "docid": "9a210e0017a16e6d505f31fa78ccdeab", "score": "0.59313154", "text": "function showPrevious() {\n \n if (savedCities) {\n $(\"#history\").empty();\n var btns = $(\"<div>\").attr(\"class\", \"list-group\");\n for (var i = 0; i < savedCities.length; i++) {\n var locBtn = $(\"<button>\").text(savedCities[i]);\n if (savedCities[i] == currentLoc){\n locBtn.attr(\"class\", \"list-group-item list-group-item-action active saved-city\");\n }\n else {\n locBtn.attr(\"class\", \"list-group-item list-group-item-action saved-city\");\n }\n btns.prepend(locBtn);\n }\n $(\"#history\").append(btns);\n }\n}", "title": "" }, { "docid": "1a2efccb9033a84006aa0fe884943ff3", "score": "0.5879338", "text": "function showPrevious() {\r\n var values = [],\r\n keys = Object.keys(localStorage),\r\n i = keys.length;\r\n while ( i-- ) {\r\n values.push( localStorage.getItem(keys[i]));\r\n }\r\n for (x = 0; x < values.length; x++) {\r\n $(\".previous-searches\").prepend(\"<button class='previous-search mt-1'>\" + values[x] + \"</button>\");\r\n }\r\n}", "title": "" }, { "docid": "1555136bc8384495d9c873833d69d1cf", "score": "0.58450466", "text": "function searchHistory(keyword){\n var recentBtn = document.getElementById(keyword).textContent;\n $(\"#citySearch\").val(recentBtn); \n search();\n}", "title": "" }, { "docid": "06a3baf4ac0b21aa1fb536fb03671857", "score": "0.584204", "text": "function listSearchResults(city) {\n var formerCity = $(\"<button>\");\n formerCity.text(city);\n formerCity.addClass(\"btn btn-secondary cityBtn\")\n searchHistoryEl.append(formerCity);\n }", "title": "" }, { "docid": "4cba5fde0c192f8fc36e2e622e8cb109", "score": "0.5837692", "text": "function showSavedSearchesModal() {\n\t\twindow.SavedSearchesWidget.showPicker(function (savedSearch) {\n\t\t\tif (savedSearch) {\n\t\t\t\t$(\"#txtMessage\").val(savedSearch.searchMessage);\n\t\t\t\t$(\"#txtFrom\").val(savedSearch.searchFrom);\n\t\t\t\t$(\"#txtTo\").val(savedSearch.searchTo);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "8ada0d15b5663b3cabad5efa174c9267", "score": "0.5831075", "text": "function saveSearch (loc) {\n let history = [];\n $(\".past-search\").each(function(i) {\n history[i] = $(this).text();\n });\n history.push(loc);\n if (history.length > 10) {\n history.shift();\n };\n\n // Save the array and reload the history\n localStorage.setItem(\"history\", JSON.stringify(history));\n populateHistory();\n }", "title": "" }, { "docid": "a45c94b3f86ce1dce0fb6831affabb78", "score": "0.58298534", "text": "function buildHistory() {\n $(\"#searchHistory\").prepend('<input class=\"button search\" type=\"submit\" value=' + citySearch + ' id=\"' + citySearch + '\"><br>')\n $(\"#\" + citySearch).on(\"click\", function () {\n citySearch = this.value\n var id = \"citySearch\"\n var value = citySearch\n localStorage.setItem(id, value);\n buildQuery()\n }\n )\n}", "title": "" }, { "docid": "604e9950263de6fdab83141c74cdfd5f", "score": "0.5824774", "text": "function renderHistory() {\n searchHistory.innerHTML = \"\";\n previousSearch = JSON.parse(localStorage.getItem(\"previousSearches\"));\n if (previousSearch == null) {\n previousSearch = [];\n }\n previousSearch.forEach(element => {\n let newLi = document.createElement(\"li\");\n let newBtn = document.createElement(\"button\");\n newBtn.setAttribute(\"class\", \"previous-button\");\n newBtn.innerText = element;\n searchHistory.appendChild(newLi);\n newLi.appendChild(newBtn);\n });\n let formerSearches = document.querySelectorAll(\".previous-button\");\n formerSearches.forEach(element => {\n element.addEventListener(\"click\", function(event){\n let adjustedSearch = element.innerText.replace(\" \", \"+\");\n getGeoData(adjustedSearch);\n });\n });\n}", "title": "" }, { "docid": "d981fb66eb9f5d34d2d18069065dc226", "score": "0.5823697", "text": "function renderLocalStorage() {\n var savedHistory = localStorage.getItem(\"searchHistory\");\n if (savedHistory) {\n cities = JSON.parse(savedHistory);\n for (i = 0; i < cities.length; i++) {\n var searchHistory = document.createElement(\"button\");\n searchHistory.classList.add(\"citybtn\");\n searchHistory.textContent = cities[i];\n SH.appendChild(searchHistory);\n }\n\n }\n}", "title": "" }, { "docid": "b84c4964e358afe397f9c1f370b31118", "score": "0.57858634", "text": "function recentSearchList() {\n $.each(prevSearchArray, function (index, object) {\n let SearchBtn = $('<li class=\".recentSearch\">');\n SearchBtn.text(object.city);\n prevSearchBtns.append(SearchBtn);\n })\n}", "title": "" }, { "docid": "f1e76e01d0b5a044f06048ef4fcb320d", "score": "0.5784813", "text": "function showHistory () {\n // Create a variable to hold the items from local storage AND parse them from JSON\n var savedCities = JSON.parse(localStorage.getItem(\"mostRecent\"));\n\n // If local storage is NOT empty\n if (savedCities != null) {\n // Clear the search history list \n $(\".list-group\").empty();\n // Add the items from local storage to the array searchHistory\n searchHistory = savedCities;\n\n // Create a loop to process each item from local storage\n for (var i = 0; i < savedCities.length; i++) {\n // Create a new button\n var btn = $(\"<button>\");\n // Add the name of the city to the new button\n btn.text(savedCities[i]);\n // Add classes to the new button\n btn.addClass(\"list-group-item list-group-item-action\");\n // Add the new button to the search history in the window\n $(\".list-group\").append(btn);\n // Add an event listener to the new button\n btn.on(\"click\", function () {\n // Create a variable to retrieve the name of the city from the new button\n var thisCity = $(this).text();\n // Call the getWeather function for that city\n getWeather(thisCity);\n });\n };\n };\n }", "title": "" }, { "docid": "22ad2c6987b6cea56bb94655e4577a7d", "score": "0.577934", "text": "function history(previous){\n oldRecipe = document.createElement(\"button\");\n oldRecipe.textContent = previous;\n oldRecipe.classList = \"d-flex w-100 btn-light border p-2\";\n oldRecipe.setAttribute(\"data-recipe\", previous); \n oldRecipe.setAttribute(\"type\", \"submit\");\n\n pastSearch.prepend(oldRecipe);\n}", "title": "" }, { "docid": "73964d29ac4e8d9a308b902dba3694c1", "score": "0.57564443", "text": "function backButton() {\n jQuery('#team-page').hide();\n jQuery('#search-page').show();\n}", "title": "" }, { "docid": "f156c14af2ca50393d78325256c6f12b", "score": "0.57461643", "text": "function initSearch() {\n var buttons = $(\".history\");\n var searchedCities = JSON.parse(localStorage.getItem(\"cities\"));\n buttons.empty();\n buttons.addClass(\"d-none\");\n if (!searchedCities) {\n $(\"#cityBtn1\").prop(\"disabled\", true);\n $(\"#cityBtn1\").text(\"no recent history\");\n $(\"#cityBtn1\").removeClass(\"d-none\");\n return;\n } else {\n renderHistory();\n }\n }", "title": "" }, { "docid": "c97d4656ea672c29054452431e9db7ad", "score": "0.5735977", "text": "function loadFromButton(buttonName,pageTitle){\n //1. create the api URL\n var urlToLoad = baseUrl+buttonName+\"?limit=50&start=1&\"+apiKey;\n \n currentPage = buttonName;\n //2. Add the Top Title to page\n writeToDiv(\"mainTitle\", pageTitle);\n \n //3. Clear any previous \"Found search\"\n clearDiv(\"searchTitle\");\n\n //4. Clear search input box\n clearSearch();\n\n //5. Update the Search box placeholder\n var placeholderText = \"\";\n var placeholderText = \"Search \"+pageTitle+\"...\";\n changePlaceholder(\"search\", placeholderText);\n\n //6. Load page using the appropriate View Controller\n loadURL(urlToLoad);\n}", "title": "" }, { "docid": "c0ecb8bc8d4d573b7f4b4a5b0bc4354d", "score": "0.57319856", "text": "function callCity(){\n var cityRecall = JSON.parse(localStorage.getItem(\"searchStore\"));\n var recallReturn = $(\"<button class='btn btn-success' style='width: 200px'>\").text(cityRecall);\n var recallSearch = $(\"<a>\");\n recallSearch.append(recallReturn);\n $(\"#searchRecall\").prepend(recallSearch);\n}", "title": "" }, { "docid": "92f4ca6a37b2457ad68090e2c1529358", "score": "0.57233346", "text": "function createSearchHistory(city) {\n\n var historyBtn = $(\"<button>\", { \"class\": \"col-sm-12 btn btn-outline-secondary\" }).text(city);\n $(\"#historySearchBtn\").prepend(historyBtn);\n}", "title": "" }, { "docid": "fa5d7e87cc5a251cd7c0ee5d01525f94", "score": "0.5705694", "text": "function init() {\n let searchHistory = JSON.parse(localStorage.getItem(\"searchHistory\"));\n if (searchHistory === null) {\n return;\n } else {\n // make all DOM elements visible if there is a search history\n cityNameSaved = searchHistory[searchHistory.length - 1];\n $(\".invisible\").addClass(\"visible\").removeClass(\"invisible\");\n // insert contents of searchHistory array into table rows\n for (var i = 0; i < searchHistory.length; i++) {\n searchHistoryVar = searchHistory[i];\n searchHistoryHTML = searchHistoryVar.replace(/\\s/g, \"\\xa0\");\n $(\".pastSearches\").append(\n \"<tr class='hover:bg-blue-500 \" + searchHistoryHTML + \"Saved'>\"\n );\n $(\".\" + searchHistoryHTML + \"Saved\").append(\n \"<td class=\" +\n searchHistoryHTML +\n \"Table border px-4 py-2 text-gray-600></td>\"\n );\n $(\".\" + searchHistoryHTML + \"Table\").append(\n \"<button class='\" +\n searchHistoryHTML +\n \"Button hover:text-white font-semibold ml-2 p-2 tableButton'></button>\"\n );\n $(\".\" + searchHistoryHTML + \"Table\")\n .find(\"button\")\n .text(searchHistoryHTML);\n }\n return cityNameSaved;\n }\n }", "title": "" }, { "docid": "4573a908bb54d2a389bf1e693b4b709c", "score": "0.5697416", "text": "function loadSavedSearchTerm() {\n $history.empty();\n let temp = localStorage.getItem('searchHistory');\n if(temp) {\n savedSearchTerm = JSON.parse(temp);\n }\n for(let history of savedSearchTerm) {\n $history.append($(`<li class=\"list-group-item\">${history}</li>`));\n }\n}", "title": "" }, { "docid": "dcb8ad0a96eaf3fc13a14af4d7b52c30", "score": "0.5689139", "text": "function newSearch() {\n\t$('.newSearch').on('click', function() {\n\t\t$('.location').val('');\n\t\t$('.resultsPage').css('display', 'none');\n\t\t$('.firstPage').fadeIn(300).css('display', 'block');\n\t\t$('.lightbox').fadeIn(300).css('display', 'block');\n\t});\n}", "title": "" }, { "docid": "5b991649c98bf4999c4fa13baf2d6eed", "score": "0.5681505", "text": "function renderSearchHistory() {\n $(\".searchHistory\").remove();\n // Get the list of search history items from local storage\n let searchItems = JSON.parse(localStorage.getItem(\"weatherDashboard_searchItems\"));\n if (searchItems === null) {\n searchItems = [];\n }\n\n searchItems.reverse();\n\n for (let i = 0; i < searchItems.length; i++) {\n let $searchHistoryButton = $(\"<button>\");\n $searchHistoryButton.attr(\"id\", `searchHistory_item${i}`);\n $searchHistoryButton.attr(\"cityId\", searchItems[i].cityId);\n $searchHistoryButton.addClass(\"button searchHistory mt-3\");\n \n let $searchButtonSpan = $(\"<span>\");\n $searchButtonSpan.text(searchItems[i].cityName);\n\n $searchHistoryButton.append($searchButtonSpan);\n\n $(\"#searchHistory\").append($searchHistoryButton);\n }\n}", "title": "" }, { "docid": "ef749bc94bfafdf1e2e3b62b312df554", "score": "0.5662674", "text": "function renderPreviousSearch() {\n displayRecentSearch.innerHTML = \"\";\n for (var i = 0; i < searchItems.length; i++) {\n var searchItem = searchItems[i];\n var previousSearch = document.createElement(\"p\");\n previousSearch.textContent = searchItem;\n previousSearch.classList.add(\"previous-searches\");\n displayRecentSearch.append(previousSearch);\n //adds event listeners to each element\n previousSearch.addEventListener(\"click\", function (event) {\n //Prevent event bubbling\n event.stopPropagation();\n //User Click\n var thisOne = event.target;\n //Accessing inner html of the rendered list so it can be passed into a function.\n var clickMe = thisOne.innerHTML;\n // Turns rendered search history into active buttons\n getLocation(clickMe);\n });\n }\n}", "title": "" }, { "docid": "37aaa26323db522636c75573c00f00e1", "score": "0.56541675", "text": "function refreshList() {\n ($saved).empty();\n\n for(var i=0, len=localStorage.length; i<len; i++) {\n var key = localStorage.key(i);\n ($saved).append('<button class=\"entry-btn\" value=\"'+key+'\">'+key+'</button>');\n }\n }", "title": "" }, { "docid": "d78c71149dca147ee76eda45d10a2306", "score": "0.56495017", "text": "function displayResults() {\n\n //---------------------------- updating recent search bar\n // clear content section\n content.innerHTML = ('');\n // $('.content').html('');\n\n // Store user query from search bar\n var query = input.value;\n // query = $(\"input\").val();\n\n //Updates 'Recent Search' bar\n if (query !== '') {\n var web = document.getElementsByClassName('web')[0];\n var resultHTML = document.createElement('button'); // creates new button tag\n // set class name and type attributes of new button tag\n resultHTML.className = ('list-group-item recent-search-result');\n resultHTML.setAttribute('type', 'button');\n resultHTML.innerHTML = query;\n // add event handlers for dynamic elements\n resultHTML.addEventListener('mouseenter', mouseEnterHandler);\n resultHTML.addEventListener('mouseleave', mouseLeaveHandler);\n // append new button to recent search bar\n web.appendChild(resultHTML);\n // $('.web').append('<button type=\"button\" class=\"list-group-item recent-search-result\">' + query + '</button>');\n\n // updates recent search bar for mobile\n var dropdownMenu = document.getElementsByClassName('dropdown-menu')[0];\n var mobileResultHTML = document.createElement('li');\n mobileResultHTML.className = ('recent-search-result mobile-result');\n mobileResultHTML.innerHTML = `${query} <li role=\"separator\" class=\"divider recent-search-result\"></li>`;\n dropdownMenu.appendChild(mobileResultHTML);\n // $('.dropdown-menu').append('<li class=\"recent-search-result mobile-result\">' + query + '</li><li role=\"separator\" class=\"divider recent-search-result\"></li>');\n }\n //--------------------------------\n\n // Display query results\n wikiData(query);\n}", "title": "" }, { "docid": "2f4e13e7d29afbd3e802d1106ef49457", "score": "0.5648906", "text": "function onButtonClick() {\n getApi(); \n addSearch(); \n displaySearches();\n}", "title": "" }, { "docid": "f600d813841861402f2e1b82603705b8", "score": "0.5641761", "text": "function createBtns(){\ncitySearches = JSON.parse(localStorage.getItem('citys')) || [];\n for(var i = 0; i <= citySearches.length -1; i++){\n if(citySearches){\n $('#searchHistory').prepend('<button type=\"button\" class=\"m-s\">' + citySearches[i] +'</button>'); \n }\n }\n}", "title": "" }, { "docid": "75cd2bf6bf12887b95362617707f13de", "score": "0.5641213", "text": "function historyBtn(label) {\n //Create the local button\n var tBtn = document.createElement(\"BUTTON\");\n $(tBtn).html(label);\n $(tBtn).addClass(\"btn btn-secondary\");\n $(\"#btn-container\").prepend(tBtn);\n\n //When the button is clicked:\n $(tBtn).click(() => {\n //Bring up the values again and make sure it shows!\n citySearchHistory(label);\n showAssets();\n });\n\n //Add button label text to our array\n historyArray.push(label);\n\n //Then let's save the updated array to local storage\n local.setItem('history', JSON.stringify(historyArray));\n}", "title": "" }, { "docid": "d145a365bcff059ddd77586f9e1c1259", "score": "0.5639297", "text": "function displayLastPage() {\n\t\t$(\"#pagebuttons li\").css({'background-color' : ''});\n\t\tvar lastpagestart = getLastPageNumber();\n\t\tvar selectedli; // last li page button\n\t\tif (lastpagestart == 2) {\n\t\t\tselectedli = 4; // since page 2 is last\n\t\t}\n\t\telse {\n\t\t\tselectedli = 5;\n\t\t}\n\t\tgetServerData(lastpagestart);\n\t\t// if page 2 is the last page, no need to reset pageset\n\t\tif (lastpagestart != 2) {\n\t\t\tresetLastPageSet(lastpagestart);\n\t\t}\n\t\t$(\"#pagebuttons li:nth-child(\"+selectedli+\")\").css({'background-color' : '#02546a'});\n\t}", "title": "" }, { "docid": "d06c26731ef481e30128befad7d1ec0f", "score": "0.5638544", "text": "function SearcherDisplay() { }", "title": "" }, { "docid": "b48206371f5816e2595580c742d93ebf", "score": "0.562658", "text": "function showHistory() {\n\t\t$(\"#activity-content\").hide();\n\t\t$(\"#history-content\").show();\n\t\t$(\"#music-content\").hide();\n\t\t\n\t\tvar db = window.openDatabase(\"Database\", \"1.0\", \"FitnessGeek\", 200000);\n\t\tdb.transaction(fetchLatestActivity, errorCB); \n\t\t$('input:radio[name=\"radio-mini\"]').filter('[value=\"choice-latest\"]').next().click();\n\n\t}", "title": "" }, { "docid": "c6e2e069860ea2e4196e4642dc2d4b6b", "score": "0.5615845", "text": "function renderHistory(){\n var searchHistory = JSON.parse(localStorage.getItem('weatherHistory')) || [];\n\n console.log(searchHistory.slice(11))\n var weatherHistoryElement = $('#weatherHistory')\n\n\n weatherHistoryElement.empty()\n for(var i =0 ; i<searchHistory.length; i++){\n var newBtn = $('<li>').text(searchHistory[i])\n weatherHistoryElement.prepend(newBtn)\n }\n\n }", "title": "" }, { "docid": "d670a881663b3947afde6def912ead1e", "score": "0.56045765", "text": "function onLoadSearch() {\n if (el('location')) {\n setInputFieldValue(el('location'), getHashParam('vol_loc', '') || getDefaultLocation().displayLong);\n }\n\n // Using jquery json functions where RSH expects other json functions,\n // pass in as overrides.\n dhtmlHistory.create({\n debugMode: false, // Set to 'true' to see the hidden form & iframe.\n toJSON: function(o) {\n return $.toJSON(o);\n },\n fromJSON: function(s) {\n return $.evalJSON(s);\n }\n });\n dhtmlHistory.initialize();\n dhtmlHistory.addListener(executeSearchFromHashParams);\n\n createQueryFromUrlParams().execute();\n\n try {\n el('more').style.display = '';\n } catch(err) {\n }\n}", "title": "" }, { "docid": "70f8a8c26245074749b8d40db82274f5", "score": "0.5601466", "text": "function getItems() {\n if (localStorage.getItem('myCities') !== null) {\n let mySearch = JSON.parse(localStorage.getItem('myCities'));\n \n\n for (let i = 0; i < mySearch.length; i++) {\n let displayDiv = $('<button>');\n displayDiv.addClass(\"search-btn\");\n displayDiv.text(mySearch[i]);\n displayDiv.attr('value', mySearch[i]);\n $(\"#searchHistory\").append(displayDiv);\n \n }\n \n }\n}", "title": "" }, { "docid": "16fe942c749849d42847d7948a277220", "score": "0.55968165", "text": "function pageOtherOnload() {\n\t\t\t// Make search bar search the main namespace only -- for non-Special:Search pages\n\t\t\t$('#WikiaSearch input[type=\"submit\"]').before('<input type=\"hidden\" name=\"ns0\" value=\"1\">');\n\t\t}", "title": "" }, { "docid": "deceb434e607db26a3d4d2e2d011e39f", "score": "0.5585442", "text": "function addHistoryEntry() {\n $$.form.healthhistory.popup(com.sweattrails.api.MODE_NEW)\n}", "title": "" }, { "docid": "0b5a88f464f976fd2d37247f8ed615c6", "score": "0.55699944", "text": "function showHistory() {\r\n if (!sessionStorage.getItem(\"history\")) {\r\n alert(\"History is empty! You must enter a search to view histroy\");\r\n return;\r\n }\r\n var history = sessionStorage.getItem(\"history\");\r\n var searches = history.split(\" \");\r\n var finalHTML = \"\";\r\n\r\n finalHTML += \"<ol>\";\r\n for (results in searches) {\r\n finalHTML += \"<li>\" + searches[results] + \"</li>\";\r\n }\r\n finalHTML += \"</ol>\";\r\n document.getElementById('history-content').innerHTML = \"Search History: \"\r\n document.getElementById('history-content').innerHTML += finalHTML;\r\n}", "title": "" }, { "docid": "f9291ffe53c6e2dba6f7f7ebe6f1dab0", "score": "0.55687875", "text": "function searchClick(click_flag){\n\tif (click_flag){\n\t\twindow.history.pushState({page : 'stock'}, 'stockPage', '#stock')\n\t}\n\tremoveHome();\n\twipeWholePage();\n\n\tcreateDiv(\"contentItems\", \"text\")\n\tcreateInputBox(\"Input\", \"contentItems\");\n\tcreateButton(\"Search Stock\", \"searchFunction()\", \"bn\", \"contentItems\");\n\tcreateButton(\"Go Home\", \"goHome(true)\", \"h\", \"contentItems\");\n\n\treturn;\n}", "title": "" }, { "docid": "567ac857dd7c83da1f46bd4c18ebdb6c", "score": "0.5568219", "text": "function historyBtnClick(){\n search(this.value);\n}", "title": "" }, { "docid": "101b3236afb86363b88d9ff5fbac4073", "score": "0.5560703", "text": "function showSave(currentTab) {\n getTemplate(\"savePage.hbs\",{}, function(html) {\n $('body').html(html);\n $('#back').click(function() {\n chrome.storage.local.get(['queries','tab'], function (data) {\n clearState(data.tab);\n showSearches(data.queries,currentTab);\n });\n });\n $('#stop').click(function() {\n chrome.storage.local.get(['tab'], function (data) {\n clearState(data.tab);\n window.close();\n });\n });\n\n });\n}", "title": "" }, { "docid": "0c856914fc6150fb66639e797404e995", "score": "0.5529669", "text": "function Display(){\r\n var SiteMarks=JSON.parse(localStorage.getItem('SiteMarkers'))\r\n var results=document.getElementById('yourSites')\r\n results.innerHTML='';\r\n for(var i=0;i<SiteMarks.length;i++){\r\n var siteName=SiteMarks[i].SiteName\r\n var siteUrl=SiteMarks[i].SiteUrl\r\n results.innerHTML+='<div>'+'<h3>'+siteName+'<a href=\"'+siteUrl+'\" target=\"_blank\">Go</a>'+'<button onclick=\"Delete(\\''+siteUrl+'\\')\" target=\"_blank\">Delete</button>'+'</h3>'+'</div>'\r\n }\r\n\r\n }", "title": "" }, { "docid": "86c8ec31a9aab402e3053a5012f46127", "score": "0.5517627", "text": "function backButton(){\n\t$(\"#backButton\").live('click', function(){\n\t\t$(\"[href='#posters']\").click(); // Click the the home button\n\t});\n}", "title": "" }, { "docid": "90dd75d54fb9f2f19084e85e00040a5c", "score": "0.5507441", "text": "function goBrowseStu() {\r\n\t// adjust the pages that are shown\r\n\tif (page.getCurPage() != \"browseStu\") {\r\n // post a TO DO message.\r\n\t\tvar stuList = \"<div id='browseStuPage' class='panel panel-info'>\" +\r\n \"<div class='panel-heading'>Browse Students \" + \"</div>\" +\r\n \"<p style='text-align:center;padding-top:5em;padding-bottom:5em;'>\" + \r\n \"<strong>TO DO: Add Browse Students page</strong></p>\" +\r\n \"</div>\";\r\n $(\"#mainContentPane\").prepend(stuList);\r\n\t\t\r\n\t\t// Hide the current page & make browse student the new current page\r\n\t\tvar curSelector = '#' + page.getCurPage()+\"Page\";\r\n\t $(curSelector).css(\"display\",\"none\");\r\n\t\tpage.setCurPage(\"browseStu\");\r\n\t}\r\n}", "title": "" }, { "docid": "fe9ce9ce96757ed49d7b0c1a3024b7b5", "score": "0.55056804", "text": "function curbStomp(){\n window.location.replace(self.scoData.content.pages[0].filename+'.htm');\n }", "title": "" }, { "docid": "35fc2e4a96cd928a099d48f7a821afbd", "score": "0.5504584", "text": "function saveSearches() {\n\tif (!genome && !searchTerm) {\n\t\tdocument.getElementById('errors')=\"No genome or search term\";\n\t\treturn;\n\t}\n\tallsearches[genome]=[searchTerm, document.getElementById('searchComment').value];\n\tvar req = opensocial.newDataRequest();\n\treq.add(req.newUpdatePersonAppDataRequest(opensocial.IdSpec.PersonId.VIEWER, 'allsearches', JSON.stringify(allsearches)));\n\treq.send(function(response) {\n\t\t\tif (response.hadError()) {\n\t\t\t\tdocument.getElementById('errors').innerHTML += \"There was an error saving the genome id\";\n\t\t\t} \n\t});\n\t//document.getElementById('savethissearchbutton').value = \"Saved!\";\n\tdocument.getElementById('savethissearchbuttonspan').innerHTML=\"<b>Saved!</b>\";\n\n}", "title": "" }, { "docid": "69e6f21c26a5e0c777e77dd9cafdcf03", "score": "0.5499655", "text": "function showHistory(event) {\n event.preventDefault();\n if (storageSearches) {\n // \"resetting\" array, getting new items from local storage\n // === checks equality\n // = reassigns variable\n previousSearches = storageSearches;\n }\n for (var i = 0; i < previousSearches.length; i++) {\n var search = $(\"<li>\").text(previousSearches[i]);\n $(\"#recipe-history\").append(search);\n }\n}", "title": "" }, { "docid": "5c10d4c5203a0ab525a5a692b6c14cc0", "score": "0.5497583", "text": "function savedStorage() {\n //grab previous locations from local storage\n savedCities = JSON.parse(localStorage.getItem(\"city\"));\n //display buttons for previous searches\n if (savedCities) {\n //get the last city searched so we can display it\n currentLoc = savedCities[savedCities.length - 1];\n showPrevious();\n\n }\n console.log(savedCities)\n}", "title": "" }, { "docid": "7c52e9951f6819a92fb4428aa1ee54e5", "score": "0.54941493", "text": "function updateChronografBtnHtml(newLinkUrl) {\n $.each($('.view-in-chronograf'), function() {\n var newQuery = $(this).data('query')\n var newEncodedQuery = encodeURIComponent(newQuery)\n $('.chronograf-btn', this).attr('href', newLinkUrl + \"?query=\" + newEncodedQuery )\n })\n}", "title": "" }, { "docid": "ea459a2b1297d0ec726e35784fd1ed3b", "score": "0.54862237", "text": "function restoreHistory(){\n searchHistoryEl.innerHTML = JSON.parse(localStorage.getItem(\"searchHistoryElements\"));\n var cityButton = document.querySelectorAll(\".submit-saved-city\");\n for (var i = 0; i < searchHistoryEl.childElementCount; i++){\n cityButton[i].addEventListener(\"click\", callHistory);\n }\n}", "title": "" }, { "docid": "86b4d88931c18e069b8b57777aaa9d6a", "score": "0.5475336", "text": "function appendToPage() {\r\n let searchResultCount;\r\n\r\n if (inputFieldName) {\r\n searchResultCount = searchList();\r\n pagesPerList(searchResultCount);\r\n searchResults();\r\n } else {\r\n showPage(studentList);\r\n }\r\n}", "title": "" }, { "docid": "f0b55f871d838a6726e14531fd0d01e3", "score": "0.5472006", "text": "function displaySearched() {\n $(\".recent-search\").empty();\n\n for (let i = 0; i < buttons.length; i++) {\n let buttonName2 = buttons[i];\n let button = `\n <div class=\"wrap-buttons\">\n <button class=\"btn btn-delete fas fa-gavel\" data-name=\"${buttonName2}\" data-index=\"${i}\"></button>\n <button class=\"btn btn3 btn-search\" data-name=\"${buttonName2}\">${buttonName2}</button>\n </div>\n `;\n $(\".recent-search\").append(button)\n };\n localStorage.setItem(\"buttons\", JSON.stringify(buttons));\n\n}", "title": "" }, { "docid": "4e3d17931f131ab4a1abb2a0770ea550", "score": "0.54233533", "text": "function showRecentUpdate(data) {\n var parentNode = elementID('recentUpdate'),\n newNode = document.createElement('div'),\n update = '';\n \n update += '<div class=\"icon\"><div style=\"background-image:url(\\'core/img/updates/' + data.icon + '\\');\"></div></div>';\n update += '<h5>' + data.title + '</h5>';\n update += '<p>' + data.date + '</p>';\n update += '<p>' + data.summary + '</p>';\n \n newNode.innerHTML = update;\n parentNode.insertBefore(newNode, parentNode.firstChild);\n}", "title": "" }, { "docid": "89d5592b715dc1c84c0963a09bd09635", "score": "0.54209274", "text": "function insertNPCHistoryLink() {\r\n\t\tvar bname = getQueryParameters(urlNow, NPCbacklinkName);\r\n\t\tif (!bname) {\r\n\t\t\tvar bname = \"Go back\";\r\n\t\t}\r\n\t\tvar div = get(dmid2);\r\n\t\tdiv.innerHTML += '<p><a href=\"#\" onclick=\"window.history.go(-2)\"> &laquo; ' + bname + '</a></p>';\r\n\t}", "title": "" }, { "docid": "f6f7055f82bd38e1675ab9abdcdd5cbc", "score": "0.54177547", "text": "function showSearchPage() {\t\n\t$(\"#search_view_container\").addClass(\"active_view\");\n\t$(\"#trail_view_container\").removeClass(\"active_view\");\n\n\twindow.showingSearchPage = true;\n\tif(isMobile())\n\t\twindow.scrollTo(0,window.searchScroll);\n\t\n\t$(\"#search_button\").val(isDesktop()?\"Search For Trails\":\"Search\");\n}", "title": "" }, { "docid": "5cb22619ac407933e71b4b9fb94c0a04", "score": "0.54144645", "text": "function getSavedFilterLnkHmtl(json_obj) {\n\tvar html = '<div class=\"saved-search-item\">'+\n\t\t\t'<a class=\"do-search\" style=\"float:left;\" filter_obj_serialized=\"'+json_obj.value+'\">'+unescape(json_obj.name)+'</a>'+\n\t\t\t'<a class=\"remove remove-cookie\"></a>'+\n\t\t '</div>';\n\treturn html;\n}", "title": "" }, { "docid": "bef1a123ac44cc1563d2255436d9ac62", "score": "0.5410902", "text": "function btn_query_data_onclick(p_hdn_tag_obj,p_hdn_value_obj,p_hdn_page_obj,p_fuseaction){\n\t_save_xml_tag_and_value_list(document.forms(0), p_hdn_tag_obj, p_hdn_value_obj, false);\n\t//save_list_onclick(document.forms(0),document.forms(0).hdn_filter_xml_tag_list,document.forms(0).hdn_list_xml_value);\n\tp_hdn_page_obj.value = 1;\n\tbtn_save_onclick(p_fuseaction);\n}", "title": "" }, { "docid": "e83810dbd45de48f107160c85fc2c587", "score": "0.541035", "text": "function addButton() {\n\n\t$(\"#button-view\").empty();\n\n\tfor (var i = 0; i < searchTerms.length; i++) {\n\tvar a = $(\"<button>\");\n\ta.addClass(\"btn btn-dark giphy-go\");\n\ta.attr(\"data-name\", searchTerms[i]);\n \ta.text(searchTerms[i]);\n \t$(\"#button-view\").append(a);\n};\n}", "title": "" }, { "docid": "12695b53c522760c184635f61ab63863", "score": "0.5410289", "text": "function historyOnPageShow() {\r\n \r\n g_companyPageTranslation.safeExecute(function() {\r\n \r\n g_companyPageTranslation.translateButton('#companyHistoryRefresh','Refresh');\r\n g_companyPageTranslation.translateRadioButton('radioActivity', 'Activity');\r\n g_companyPageTranslation.translateRadioButton('radioOrders', 'Orders');\r\n });\r\n\r\n $('#noorders, #noactivities').hide();\r\n \r\n historyHideFooter();\t\r\n overlaySetMenuItems();\r\n\r\n historyOnPageShowSmall();\r\n historyBind();\r\n \r\n $('#companyHistoryRefresh').removeClass('invisible');\r\n// $('#companyHistoryRefresh').removeClass('ui-disabled');\r\n $('#companyHistoryRefresh').off();\r\n $('#companyHistoryRefresh').on('click', function() {\r\n historyRefreshClicked();\r\n });\r\n\r\n g_showCurrentCompanyName();\r\n\r\n //check for re-load of same customer, reload not needed\r\n if (sessionStorage.getItem('HistoryCacheAccountID') && g_currentCompany().AccountID == sessionStorage.getItem('HistoryCacheAccountID')) {\r\n historyFromCache();\r\n } else {\r\n //else reload from scratch\r\n //if (g_isOnline()) {\r\n var dao = new Dao();\r\n dao.openDB(function() {\thistoryInit();\t});\r\n //}\r\n }\t\r\n}", "title": "" }, { "docid": "4e586b484532e626e9cadebc096f6803", "score": "0.54091156", "text": "function insertNPCHistoryLink() {\r\n\t\tvar bname = getQueryParameters(urlNow, NPCbacklinkName);\r\n\t\tif (!bname) {\r\n\t\t\tvar bname = \"Go back\";\r\n\t\t}\r\n\t\tvar div = document.getElementById('lmid2');\r\n\t\tdiv.innerHTML += '<p><a href=\"#\" onclick=\"window.history.go(-2)\"> &laquo; ' + bname + '</a></p>';\r\n\t}", "title": "" }, { "docid": "78fb10d88004632723e8d5ed0f394a99", "score": "0.5408622", "text": "function viewBook(objToView) {\n var viewedBookTitle = escape(objToView.id.replace(\"btnView\", \"\")); //get book title\n //open the viewer page with page 1 and book title\n window.location = '../web/viewer.html?bookName=' + viewedBookTitle + '&bookPage=1';\n\n}", "title": "" }, { "docid": "61db6ad9bbdfa3e564c44a383b6f7480", "score": "0.5401191", "text": "function registerBookSearchButton(){\n\t$('#searchForm').submit(loadSearchResults);\n}", "title": "" }, { "docid": "fff1a99c360bb22823d08c1f7fca4ea7", "score": "0.5393044", "text": "function displaySearches() {\n\n let sHistory = $(\"#searchHistory\")\n sHistory.empty();\n\n for (let i = 0; i < locationArr.length; i++) {\n\n let sCity = $(\"<li>\").text(locationArr[i]);\n sCity.addClass(\"list-group-item\");\n sHistory.prepend(sCity);\n }\n }", "title": "" }, { "docid": "800f7ef688a26334e245162b665107e3", "score": "0.53888565", "text": "function previewPage() {\n // Display the first page added in localStorage API within the text-field\n let pages = JSON.parse(localStorage.note);\n quill.setContents(pages[0]);\n\n // Display added pages and page count elements respectively\n id('pageTotal').innerHTML = pages.length;\n id('pageCount').innerHTML = 1;\n\n // Display the pagination panel & hide the functional buttons sections\n id('pageAddedSection').style.display = 'none';\n id('pageCounterSection').style.display = 'block';\n}", "title": "" }, { "docid": "7997caf5553ad3f56247722f8169e560", "score": "0.53872925", "text": "function pocketButtonOnCommand(event) {\n \n \ttryToSaveCurrentPage();\n \n }", "title": "" }, { "docid": "2f77368839af7b47c08a0dae01e57183", "score": "0.5379015", "text": "function pageOnLoad(){\n for(var i=0; i<storedCities.length; i++){\n var newDiv = $(\"<div>\");\n newDiv.append($(\"<button type='button' class='btn btn-light city-button'>\"+storedCities[i]+\"</button>\")\n );\n $(\"#saved-cities\").append(newDiv);\n }\n\n}", "title": "" }, { "docid": "0f02fc603c58f39adea23ed6a1bc9e07", "score": "0.53765357", "text": "function getsavedCity() {\n searchHistory = JSON.parse(localStorage.getItem(\"history\"));\n for (i=0; i < searchHistory.length; i++) {\n var cityButton = $('<button type=\"button\" class=\"btn btn-secondary aside-btn\">').text(searchHistory[i]);\n recentSearches.append(cityButton[i]);\n \n cityButton.on(\"click\", function(){\n cityName = searchHistory[i];\n getCurrentWeather();\n })\n }\n \n cityName = cityButton.text();\n \n console.log(searchHistory)\n }", "title": "" }, { "docid": "250e4edf1f14b0490439db5cc43b617e", "score": "0.537612", "text": "function search_element_clicked (id){\n console.log('element ' + id);\n localStorage.setItem('element_id', id);\n localStorage.setItem('newItem', 'false');\n\n location.href = 'editor.html';\n }", "title": "" }, { "docid": "1861fd907336cf9251e58cac41ff68d6", "score": "0.53735185", "text": "function newSearch() {\n $(\"#new-search\").on(\"click\", function (event) {\n $(\"#searchField\").show();\n $(\"#new-search\").hide();\n location.reload();\n })\n}", "title": "" }, { "docid": "afa6e7f84c3e425e4f2182e3dc6d4c12", "score": "0.5373317", "text": "function retrieveSearchHistory(){\n\n citySearch = JSON.parse(localStorage.getItem(\"citySearch\"));\n\n if(citySearch === null)\n {\n citySearch = [];\n }\n else{\n \n $(\"#city-search-section-output\").html('');\n\n citySearch.forEach(element => {\n\n $(\"#city-search-section-output\").append(\n `<div class=\"d-grid gap-2 city-search-hist\"><button class=\"btn btn-secondary btn-lg\" type=\"button\" id=\"city-hist-btn\" data-city-search=\"${element}\">${element}</button></div>`\n );\n \n }); \n\n }\n \n}", "title": "" }, { "docid": "501dedde2f1a78e880b404c27f0ec22b", "score": "0.53726757", "text": "function searchAndDisplayResults () {\n\n $state.go('root.search', {\n query: utils.slugify(vm.searchPhrase, '+'),\n showCaptionMatches: vm.showCaptionMatches\n });\n }", "title": "" }, { "docid": "2b40c515be8823f85f3c39bbd6b5e4cd", "score": "0.5371875", "text": "function watchResultsButton(){\n $('header').on('click', '.back-button', function(event){\n \n event.preventDefault();\n $('.results-wrapper').empty();\n removeSelectedShow();\n let backResults = previousResults.join(\"\");\n $('.results-wrapper').append(backResults);\n\n selection = false;\n resultsExist = true;\n\n $('.back-button').remove();\n })\n}", "title": "" }, { "docid": "35867c73f35a3f30bf5135b44de41fca", "score": "0.5371257", "text": "function renderLocalStorage() {\n var storedSearches = JSON.parse(localStorage.getItem('previousSearches'));\n $('#searched-cities').empty()\n if (storedSearches === null) {\n return;\n } else {\n storedSearches.reverse().forEach((city) => {\n var searchList = $('<button>').attr('class', 'cityButton btn btn-outline-secondary').click(function() {getWeatherInfo(city)}).text(city);\n $('#searched-cities').append(searchList);\n })\n };\n}", "title": "" }, { "docid": "6ee959397f4202617ed63e23b1ba470f", "score": "0.5368318", "text": "function backToSearch() {\n window.open('http://localhost:8888/Phase3/html/itemSearchResult.html', \"_self\");\n}", "title": "" }, { "docid": "51692582923c524064c0191ebc429e08", "score": "0.5367191", "text": "function populateLastSearch(){\n var lastSearched = localStorage.getItem('lastSearched');\n if (lastSearched === null){\n return;\n }\n var lastSearchEl = $(\"<p>\").attr('data-name', lastSearched).text('Last Searched Mood: ' + lastSearched).attr('class', 'text-center');\n $('#populateListHere').append(lastSearchEl);\n }", "title": "" }, { "docid": "d4dbaab374acd245ac37fd1c2cc50b45", "score": "0.53659326", "text": "mainNavControl () {\n const newPageSlugs = h.getAfterHash( this.href ),\n post = model.getPostBySlugs( newPageSlugs );\n view.currentPost = post;\n view.update();\n }", "title": "" }, { "docid": "24cd10ce2bae575776337954fb4c6464", "score": "0.53626466", "text": "function search() {\n\tshowAllLocations();\n}", "title": "" }, { "docid": "00a3e56c27b4ee21d965e98d84a812dd", "score": "0.536121", "text": "function _showPreviousPage() {\n RightMenu.showRightMenu(Pages.addTwMenuConnectorTypeStep, null);\n }", "title": "" }, { "docid": "24bd131244751d40d02f55e8947d6ecd", "score": "0.5360266", "text": "function pageBtn(e) {\n show(this.innerText); //calling display function when page button is clicked\n}", "title": "" }, { "docid": "fdeecb75f3ef17f0f55dc727db8b8749", "score": "0.5359677", "text": "function WikiActivity2RecentChanges() {\n\t$('a.wikia-button[data-id$=\"wikiactivity\"]').replaceWith('<a data-id=\"recentchanges\" class=\"wikia-button secondary\" accesskey=\"g\" title=\"Special:RecentChanges\" href=\"/wiki/Special:RecentChanges\"><img height=\"0\" width=\"0\" class=\"sprite activity\" src=\"https://images.wikia.nocookie.net/common/skins/common/blank.gif\">Recent Changes</a>');\n}", "title": "" }, { "docid": "4539c0aa712367ffdc526cef52e063a1", "score": "0.535776", "text": "function displaySavedItem(eventRef) \n{\n var eventBoxEl = $(\"<div>\").addClass(\"border-black bg-secondary p-2 saved-item-box\");\n var columnBoxEl = $(\"<div>\").addClass(\"columns\").appendTo(eventBoxEl);\n var bodyBoxEl = $(\"<div>\").addClass(\"col-auto\").appendTo(columnBoxEl);\n var buttonBoxEl = $(\"<div>\")\n .addClass(\"col-auto col-ml-auto\")\n .appendTo(columnBoxEl);\n\n $(\"<p>\")\n .addClass(\"m-0 p-2\")\n .text(eventRef.name + \" on \" + eventRef.date + \" @ \" + eventRef.time)\n .appendTo(bodyBoxEl);\n\n var webpageLinkEl = $(\"<a>\")\n .attr({ href: eventRef.url, target: \"_blank\" })\n .appendTo(buttonBoxEl);\n $(\"<button>\")\n .addClass(\"btn btn-primary mx-2\")\n .text(\"Webpage\")\n .appendTo(webpageLinkEl);\n $(\"<button>\")\n .addClass(\"btn mx-2 remove-btn\")\n .text(\"Remove\")\n .appendTo(buttonBoxEl);\n\n eventBoxEl.appendTo(savedListEl);\n}", "title": "" }, { "docid": "14b33ac38920bac46e3d61784846a597", "score": "0.5352283", "text": "function createHistoryBtnEl (searchInput){\n var li = $('<li>').addClass('list-group-item list-group-item-action').text(searchInput)\n li.on('click', btnclick)\n $('.history').append(li)\n storeHistory()\n }", "title": "" }, { "docid": "a315fd3f1a675f14424e7ca02fbc51b3", "score": "0.5340825", "text": "function markTerm(id) {\n indrapp = id;\n\n // aktueller Index in H_Indrapp speichern\n $(\"#H_Indrapp\").val(indrapp);\n // Rowid des Eintrages mkrappor in H_Rowid speichern (wird beim Aufruf getHistory() benutzt)\n $(\"#H_Rowid\").val(rapporte[id].Rowid);\n\n // die Seite Termine (T) wird verlassen\n $(\"#H_Return\").val(\"T\");\n\n /* Button #histServer ruft getHistory() in Code-Behind, setzt H_Page.Value = \"#detail\"\n und wechselt auf die Detail-Seite */\n var bt = $(\"#histServer\");\n bt[0].click();\n}", "title": "" }, { "docid": "0afca137529a4cd00966e960096df0a4", "score": "0.5340555", "text": "function orgSearchBtnAction(){\n\t// 把查询参数写入到searchParm\n\tconsole.log(\"orgSrchBtnAction\");\n\tvar pageParm = JSON.parse($(\"#pageParm\").attr(\"value\"));\n\tpageParm.searchParm = $(\"#searchParm\").val();\n\t$(\"#pageParm\").attr(\"value\", JSON.stringify(pageParm));\n\tgetOrgList(renderOrgListPage); // 获取机构 加载机构到页面\n}", "title": "" }, { "docid": "3cd3718190d48e6897f6b6e94353d0ad", "score": "0.53403217", "text": "searchButtonClicked() {}", "title": "" }, { "docid": "b96d31c9e9309a1b69afc5dac55356dd", "score": "0.5331091", "text": "function initSave() {\n self.saveBtn\n .on(\"click\", function() {\n saveSearch();\n })\n .parent().show();\n self.searchTab.show();\n\n //for dev purposes, remove old saved localStorage items\n for (var i = 0; i < localStorage.length; i++) {\n var key = localStorage.key(i);\n var utc = parseInt(key.substr(key.indexOf(\".\")+1, key.length));\n if(utc <= 1412724514611){\n localStorage.removeItem(key);\n }\n }\n\n for (var i = 0; i < localStorage.length; i++) {\n var key = localStorage.key(i);\n if(key.substr(0, key.indexOf(\".\")) === \"analyzer\") {\n var value = JSON.parse(localStorage[key]);\n var search = new SearchViewModel(self, key, value.name);\n self.searches.push(search);\n search.add();\n }\n }\n\n saveCount(false);\n\n }", "title": "" }, { "docid": "a527762381aca5fd27769a23aafba2c1", "score": "0.53290766", "text": "function getAction()\n{\n if (current_url_status == 'y' && current_page_id != '') //cursor points to page id\n {\n window.location.href = current_page_id + '.html';\n }\n else if (current_url_status == 'e' && current_url_name != '') //cursor points to page name\n {\n if (current_url_tgt == 'y') // open in new window\n {\n window.open(replaceTitletoComma(current_url_name));\n getTop();\n }\n else\n {\n window.location.href = replaceTitletoComma(current_url_name);\n }\n }\n else if (current_url_status == '' && current_page_id == '' )//cursor has no page id\n getTop();\n}", "title": "" } ]
c099665bc1b88c2de04c01ad73648727
Intermediate callback for HTTP requests that determines whether the requested lectureTag is associated with a lecture(ID). If not found, will send a 404 response If error, will send a 500 response Otherwise, control will be passed to the next callback with the lectureId property of the request.params object set to the lecture ID Note: assumes that lectureTag is a parameter of the request
[ { "docid": "8c480a40162a1f75f24cedb36e9e85e7", "score": "0.6778739", "text": "function checkIfLectureExists(req, res, next) {\n\tvar lectureTag = req.params.lectureTag;\n\n\trcon.hget('lecture:'+lectureTag, 'id', function(error, lectureId) {\n\t\tif(error) {\n\t\t\tconsole.log(\"error reading data from redis:\",lectureTag,action);\n\t\t\tres.status(500).end();\n\t\t} else if(!lectureId) {\n\t\t\tres.redirect(\"/\");\n\t\t} else {\n\t\t\treq.params.lectureId = lectureId;\n\t\t\tnext();\n\t\t}\n\t});\n}", "title": "" } ]
[ { "docid": "4452aad018a12ec68f6b81d3d13e0c7c", "score": "0.55745363", "text": "function listener(req, res) {\n\t\tvar parsedUrl = url.parse(req.url, true)\n\t\treq.param = parsedUrl.query\n\t\tvar handler = handlers[parsedUrl.pathname] || renderNotFound\n\t\thandler(req, res, renderNotFound)\n\n\t\tfunction renderNotFound() {\n\t\t\tvar statusCode = 404\n\t\t\tvar text = http.STATUS_CODES[statusCode]\n\t\t\tlogger(text + ': ', parsedUrl.pathname)\n\t\t\tres.writeHead(statusCode, {\"Content-Type\": \"text/plain\"})\n\t\t\tres.end(text)\n\t\t}\n\n\t}", "title": "" }, { "docid": "a80d146c073d2f9c84bca0608db6dad0", "score": "0.53581136", "text": "function handleTagQuery ( params, response ) {\n\n // the begininng of the query URL\n const APIurl = \"https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=766088011c39025e7563742fcd2ba8b3&per_page=12&format=json&nojsoncallback=1&sort=relevance&tag_mode=all&tags=\"\n\n // check input. Always important on the server.\n // var tags = params.split(\"+\");\n // need to change because params is now an array\n var tags = params[0].split(\"=\")[1].split(\"+\");\n tags.map(function (n) { decodeURI(n).trim(); });\n for (let i=0; i<tags.length; i++) {\n\ttags[i] = decodeURI(tags[i]).trim();\n\tif (/[^a-zA-Z ]/.test(tags[i])) {\n\t console.log(\"bad query\", tags[i]);\n\t badQuery(response);\n\t tags = [];\n\t break;\n\t}\n }\n \n // construct query \n if (tags.length > 0) {\n\tvar query = APIurl+tags[0];\n\tfor (let i=1; i< tags.length; i++) {\n\t query = query+\",\"+tags[i];\n\t}\n\t\n\t// API call to get selection of photos from Flickr\n\t// The call that makes a request to the API\n\tAPIrequest(\n\t { // HTTP header stuff\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t },\n\t // callback function for API request\n\t APIcallback\n\t);\n\tconsole.log(\"Sent request\", query);\n }\n\n // closure will contain the response object\n function APIcallback (err, object) {\n\tconsole.log(\"in callback\");\n\tsendResponseToBrowser(err, object, response);\n }\n}", "title": "" }, { "docid": "7a0bdd5ee996ec827046335ac236c155", "score": "0.5253211", "text": "function loadBook() {\n let bookUUID = $.urlParam(\"uuid\");\n if (bookUUID) {\n $\n .ajax({\n url: \"./resource/book/read?uuid=\" + bookUUID,\n dataType: \"json\",\n type: \"GET\"\n })\n .done(showBook)\n .fail(function (xhr, status, errorThrown) {\n if (xhr.status == 403) {\n window.location.href = \"./login.html\";\n } else if (xhr.status == 404) {\n $(\"#message\").text(\"Kein Buch gefunden\");\n } else {\n window.location.href = \"./bookshelf.html\";\n }\n })\n }\n\n}", "title": "" }, { "docid": "25d935a5bd441f6fbd65fd8f70801b53", "score": "0.49982062", "text": "function doesRequestDataExist(e){\n\tcurrent = 0;\n\tif (e.target.status > 199 && e.target.status < 201){\n\t\tqueryData = JSON.parse(e.target.response);\n\t\tbuildResults(queryData);\n\t}\n\telse{\n\t\tconsole.log(\"No results\");\n\t};\n}", "title": "" }, { "docid": "cfe9982596144109ee508100bf9babb4", "score": "0.49941447", "text": "function getNextLecture(successCallback) {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : SERVER_URL + \"/lectures/next\",\n\t\tdataType : \"json\",\n\t\tcontentType : \"application/json; charset=utf-8\"\n\t}).success(function(data, textStatus, jqXHR) {\n\t\tvar status = data.status;\n\t\tvar id = data.id;\n\t\tvar name = data.name;\n\t\tvar begin_time = data.begin_time;\n\t\tvar end_time = data.end_time;\n\t\t$('#nextLec').text(name);\n\t\t$('#nextLec_id').text(id);\n\t\tgetLecture(id);\n\t\tif (successCallback !== null && successCallback !== undefined) {\n\t\t\tsuccessCallback(new Array(id, name));\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "6a681735619699afa38716b41d962681", "score": "0.49732777", "text": "async function addCancelledLecture(lecture) {\n const url = baseURL + '/teacher-home';\n return fetchMethod(\"POST\", `${url}/add-cancelled-lecture`, { lecture: lecture });\n}", "title": "" }, { "docid": "17053837784565c87da4e0f240ebe3df", "score": "0.49656695", "text": "function reqListener () {\n\t\t// Create tag and append to tags div\n\t\tif (this.status != 200) {\n\t\t\talert(this.responseText);\n\t\t} else {\n\t\t\tvar container = document.getElementById(\"tagContainer-\"+id);\n\t\t\tcontainer.appendChild(newTag(label, imgName));\n\t\t}\n\t}", "title": "" }, { "docid": "cf48c92e59dd1382ff850590ddbbd606", "score": "0.49496993", "text": "function requestCallback(error, response, body) {\n // decode certain special characters in response from petfinder. if there is a malformed URI component,\n // then simply parse the body into JSON, leaving special characters.\n var data;\n try {\n data = JSON.parse(decodeURIComponent(escape(body)));\n } catch (e) {\n data = JSON.parse(body);\n }\n if (!error && response.statusCode == 200) {\n // check for an error first\n if (data.petfinder.header.status.message && data.petfinder.header.status.message.$t) {\n errorMessage.message = data.petfinder.header.status.message.$t;\n return res.status(400).json(errorMessage);\n }\n else {\n // loop through the pets and convert the response to the pet schema-like format\n var pets = data.petfinder.pets.pet;\n if (pets) {\n for (var i = 0; i < pets.length; i++) {\n results.push(util.cleanPetObj(pets[i]));\n }\n return res.json(results);\n } else {\n return res.json([]);\n }\n }\n } else {\n // if there was an error then return an error\n return res.status(500).json(error);\n }\n }", "title": "" }, { "docid": "5fe70734fe4df944691d83316fd65620", "score": "0.48963085", "text": "function getInterviews(callback){\n const user = getUserAuthenticationFromCache();\n $.ajax({\n url: `/interviews`,\n headers: {\n \"Authorization\": `Bearer ${user.jwtToken}`,\n \"content-type\": \"application/json\"\n },\n async: true,\n type: \"GET\",\n success: function(res){\n if(res.length > 0){\n callback(res);\n } else if(res.length === 0){\n $('header').html(`\n <div class='row'>\n <div class='col-12'>\n <h2>Looks like you haven't taken any interiews yet.</h2>\n </div>\n </div>\n `);\n } \n }\n });\n}", "title": "" }, { "docid": "c9a133ccfee8bb64deb416a20d2158a4", "score": "0.48925757", "text": "function requestCallback(error, response, body) {\n // decode certain special characters in response from petfinder. if there is a malformed URI component,\n // then simply parse the body into JSON, leaving special characters.\n var data;\n try {\n data = JSON.parse(decodeURIComponent(escape(body)));\n } catch (e) {\n data = JSON.parse(body);\n }\n // first check for errors\n if (!error && response.statusCode == 200) {\n if (data.petfinder.header.status.message && data.petfinder.header.status.message.$t) {\n errorMessage.message = data.petfinder.header.status.message.$t;\n return res.status(400).json(errorMessage);\n }\n else {\n // convert pet responses to format similar to pet schema, add to results,\n // then return results to client\n var pets = data.petfinder.pets.pet;\n if (pets) {\n for (var i = 0; i < pets.length; i++) {\n results.push(util.cleanPetObj(pets[i]));\n }\n return res.json(results);\n } else {\n return res.json([]);\n }\n }\n } else {\n // if an error occurred then return an error\n return res.status(500).json(error);\n }\n }", "title": "" }, { "docid": "2b779dd612bb8968720d73fb01e6ac1b", "score": "0.48712316", "text": "function requestCallback(error, response, body) {\n // decode certain special characters in response from petfinder. if there is a malformed URI component,\n // then simply parse the body into JSON, leaving special characters.\n var data;\n try {\n data = JSON.parse(decodeURIComponent(escape(body)));\n } catch (e) {\n data = JSON.parse(body);\n }\n // first check for errors\n if (!error && response.statusCode == 200) {\n if (data.petfinder.header.status.message && data.petfinder.header.status.message.$t) {\n errorMessage.message = data.petfinder.header.status.message.$t;\n return res.status(400).json(errorMessage);\n }\n else {\n // convert pet response to format like pet schema then return to client\n var pet = data.petfinder.pet;\n if (pet) {\n return res.json(util.cleanPetObj(pet));\n } else {\n return res.json({});\n }\n }\n } else {\n // an error occurred so return an error\n return res.status(500).json(error);\n }\n }", "title": "" }, { "docid": "98ecc29512a26fe1e993f32dd292cc77", "score": "0.48168722", "text": "async function checkReviewsExist(req, res, next) {\n try {\n const rev = await reviewService.getById(\n req.app.get('db'),\n req.params.id\n )\n\n if (!rev)\n return res.status(404).json({\n error: `campsite doesn't exist`\n })\n\n res.rev = rev\n next()\n } catch (error) {\n next(error)\n }\n}", "title": "" }, { "docid": "a42b323d95f1181788e69877e225343d", "score": "0.47915566", "text": "function load(req, res, next, id) {\n Tag.get(id)\n .then((tag) => {\n req.tag = tag; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "title": "" }, { "docid": "5bf5e6dc313a5f1bc5aeb759312c5465", "score": "0.47912025", "text": "function loadDuel( duelId, callback ) {\n $.ajax({\n \"url\": \"/musicLadderAPI/duel/\" + duelId,\n \"type\": \"GET\",\n \"data\": {},\n \"success\": callback\n });\n}", "title": "" }, { "docid": "e7a5c3a3ecff119688bbe74266ef83ff", "score": "0.4780583", "text": "function notFound () {\n if (done) return done();\n var err = res.createError(404);\n errorHandle(err);\n }", "title": "" }, { "docid": "41cd64f3ccebc44b433aa7f907664cf0", "score": "0.47636878", "text": "function checkBadRequestVolunteers(req, res, next) {\n if (!req.session || !req.session.user\n || req.session.user.utype === \"volunteer\") {\n res.status(404).send(\"Not found\");\n } else {\n next();\n }\n}", "title": "" }, { "docid": "52bd99fad0d81b4d8b61112040203149", "score": "0.47603998", "text": "async function resIdExists(req, res, next) {\n const { reservation_id } = req.body.data;\n const reservations = await reservationsService.read(reservation_id);\n const reservation = reservations[0];\n if (reservation) {\n res.locals.reservation = reservation;\n return next();\n } else\n return next({\n status: 404,\n message: `${reservation_id} does not exist`,\n });\n}", "title": "" }, { "docid": "6e02b1bfb590ffba19420fecd674bf19", "score": "0.47550932", "text": "function done(err, data) {\n if (err) {\n console.log(err)\n return res.status(404).render('error.ejs', {\n id: 404,\n description: err,\n map: '../'\n })\n } else {\n res.redirect('/detail/' + body.other)\n }\n }", "title": "" }, { "docid": "5dd910c23d9f0daa2a6126ad02826b5d", "score": "0.4749072", "text": "async function getLectureById(lectureId) {\n const url = baseURL + '/getLectureById';\n return await fetchMethod(\"GET\", `${url}/${lectureId}`);\n}", "title": "" }, { "docid": "58dc1662610ad30c93c94040afb1a8a7", "score": "0.47371304", "text": "function followtag(event) {\n var tagname = event.id;\n var shouldFollowTag = $(\"#\" + event.id + \" > span\").text().trim().toLowerCase() == \"follow topic\";\n\n if (shouldFollowTag) {\n scAjax({\n \"url\": \"tags/FollowNewTag?tagName=\" + tagname,\n \"type\": \"POST\",\n \"success\": function (result) {\n if (!result) {\n return;\n }\n\n $(\"#\" + tagname + \" > i\").addClass('fa fa-check-circle');\n $(\"#\" + tagname + \" > span\").text(' Following');\n\n Command: toastr[\"success\"](\"Successfully subscribed to \" + tagname);\n },\n error: function (XMLHttpRequest, textStatus, errorThrown) {\n if (XMLHttpRequest.status == \"401\")\n window.location.href = \"/account/login\";\n else\n Command: toastr[\"error\"](tagname + \" is not a valid tag\");\n }\n });\n }\n else if ($(\"#\" + event.id + \" > span\").text().trim().toLowerCase() == \"unfollow\" || $(\"#\" + event.id).hasClass('active')) {\n scAjax({\n \"url\": \"tags/unfollowtag?tagName=\" + tagname,\n \"type\": \"POST\",\n \"success\": function (result) {\n if (!result) {\n return;\n }\n\n $(\"#\" + tagname + \" > i\").removeClass('fa fa-check-circle');\n $(\"#\" + tagname + \" > i\").addClass('fa fa-plus-circle');\n $(\"#\" + tagname + \" > span\").text(' Follow Topic');\n\n Command: toastr[\"success\"](\"Successfully unsubscribed \" + tagname);\n },\n \"error\": function () {\n Command: toastr[\"error\"](\"Failed to unsubscribed this tag. Please try again\");\n }\n });\n }\n}", "title": "" }, { "docid": "3bb991ecccf731cb49bd264e02a4b90d", "score": "0.47333938", "text": "async function getBookingsOfLecture(lectureId) {\n const url = \"/bookingsOfLecture?id=\" + lectureId;\n return await fetchMethod(\"GET\", baseURL + url);\n}", "title": "" }, { "docid": "90b00e8e0da784b631989f41c4ca9c13", "score": "0.472817", "text": "async function reservationIdExists(req, res, next) {\n const { reservationId } = req.params;\n const reservations = await service.readById(reservationId);\n if (reservations) {\n res.locals.reservations = reservations;\n return next();\n }\n return next({\n status: 404,\n message: `reservation_id ${reservationId} not found.`,\n });\n}", "title": "" }, { "docid": "6feddaf49741ec94a844025dc79fb13e", "score": "0.47186938", "text": "async function validatePartnerId(req, res, next) {\n const id = req.params.id;\n try {\n const records = await db('partners').where({id});\n if(records.length > 0)\n next();\n else {\n res.status(404).json({errorMessage: \"Partner Id does not exist\"})\n }\n }\n catch {\n res.status(500).json({errorMessage: \"There was a problem looking up partner id\"})\n }\n}", "title": "" }, { "docid": "35c6f69c6739d8320eb498f9166368a7", "score": "0.47063732", "text": "function requestRecipe (url, index) {\n $.get(url).done(function(res) { \n var initialLink = res.matches[0].id;\n var recipeURL = '//api.yummly.com/v1/api/recipe/'+initialLink+'?_app_id='+api_id+'&_app_key='+api_key; \n $.get(recipeURL).done(function(res2) {\n var recipeLink = res2.source.sourceRecipeUrl;\n var recipeName = res2.name;\n var recipeImg = res2.images[0].hostedSmallUrl;\n var recipe = '<br><a href =\"'+recipeLink+'\" target=\"_blank\">'+recipeName+'</a>';\n var image = '<a href =\"'+recipeLink+'\"><img src = \"'+recipeImg+'\">'; \n $('.tb'+index).append(image,recipe);\n }).fail(function(error2){\n $('.error').show().append(error_message);// handle errors for call to get new urls using ids for specific recipes\n });\n }).fail(function(error3){\n $('.error').show().append(error_message);// handle errors for call to get random urls\n });\n }", "title": "" }, { "docid": "48c07f9630fe63afbbd157d878abd91b", "score": "0.47015697", "text": "async function reservationExists(req, res, next) {\n const { reservation_id } = req.body.data;\n const rid = Number.parseInt(reservation_id);\n \n if(rid) {\n const reservation = await reservationService.read(reservation_id); \n\n if(reservation) {\n res.locals.reservation = reservation;\n return next();\n }\n }\n return next ({\n status: 404,\n message: `reservation_id: ${reservation_id} does not exist.`\n });\n}", "title": "" }, { "docid": "40cd831bfc9a20fcb262befad28c001d", "score": "0.4700396", "text": "function onRequest(request, response){\n console.log(\"Iemand wil iets\")\n var route = request.url\n\n console.log(request.url)\n//uitgezet begin\n // response.statusCode = 418\n // response.setHeader('content-type', 'text/html')\n // response.end(\"<h1>Titeltekst</h1><p>Tekstbericht</p>\")\n//uitgezet eind\n\n//aangezet begin\n\nif (request.url =='/'){\n response.writeHead(200,{'Content-Type': 'text/html'})\n fs.createReadStream(\"./files/index.html\").pipe(response);\n console.log(\"/\");\n}\n\nif (request.url =='/about'){\n response.writeHead(200,{'Content-Type': 'text/html'})\n fs.createReadStream(\"./files/about.html\").pipe(response);\n console.log(\"/about\");\n}\n\nif (request.url =='/avatar'){\n response.writeHead(200,{'Content-Type': 'image/png'})\n fs.createReadStream(\"./images/avatar.png\").pipe(response);\n console.log(\"/avatar\");\n}\n\nif (request.url =='/index'){\n response.writeHead(200,{'Content-Type': 'text/html'})\n fs.createReadStream(\"./files/index.html\").pipe(response);\n console.log(\"/index\");\n}\n\n// als image aangeroepen wordt en index niet bestaat, dan...\nif ((request.url =='/images')&&(!fs.existsSync(\"./images/index.html\"))){\n response.writeHead(200,{'Content-Type': 'text/html'})\n console.log(\"/images && !\");\n // uitleg gevonden over readFile op : https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback\n fs.readFile(\"./images\", (err, data) => {\n if (err) throw err;\n console.log(data);\n //Waarom kan ik die data niet laten zien in mn html?\n // ik zie dit alleen als console.log in mn BASH\n // response.end(data);\n // response.end(\"<p> fs.readFile(\"./images\", (err, data) => {\n // if (err) throw err;\n // console.log(data); </p>\")\n});\n}\n//404\nelse{\n response.writeHead(404,{'Content-Type': 'text/html'})\n fs.createReadStream(\"./nonexistent-file.html\").pipe(response);\n}\n\n// else{\n// response.statusCode = 200\n// response.setHeader('content-type', 'text/html')\n// response.end(\"<h1>Titeltekst</h1><p>Tekstbericht</p>\")\n// }\n//aangezet eind\n\n}", "title": "" }, { "docid": "fd1263dd8cebe5f6eb095b743e4585e1", "score": "0.46999058", "text": "function initBook(idr)\r\n{\r\n jQuery.ajax({\r\n type: \"GET\",\r\n url: \"/TecaViewerImg/servlet/ImageViewer?idr=\"+idr+\"&azione=readBook\",\r\n dataType:\"xml\",\r\n success: function(response)\r\n {\r\n \t\tshowBook(response, \"readBook\");\r\n },\r\n error: function (request, status, thrownError){\r\n alert(request.status);\r\n alert(status);\r\n } \r\n });\r\n\r\n}", "title": "" }, { "docid": "4588a938283e8ba0acf87c536f2452ee", "score": "0.46960172", "text": "function loadTag(ctx, next) {\n request\n .get('/api/tag/' + ctx.params.id)\n .end(function(err, res) {\n if (err || !res.ok) {\n var message = 'Unable to load tag for ' + ctx.params.id;\n return log(message);\n };\n\n ctx.tag = res.body;\n return next();\n });\n}", "title": "" }, { "docid": "9bacc17c26794bccd5250a49882c5ff6", "score": "0.46884096", "text": "function setupLeadDetailsFunction(model){\n if((model.req.body)&&(model.req.body.leadId))\n {\n \n var leadParams={\n \"mod\" : \"guard\",\n \"operation\" : \"read\",\n \"data\" : {\t\n \"key\" : guardKey,\n \"schema\": \"Lead\",\n \"pageNo\": \"1\",\n \"data\" : {\n \"leadId\" :model.req.body.leadId\n }\n }\n\n };\n \n var leadDetailsRequestParams = {\n url : commonAccessUrl,\n method : 'POST',\n headers : headers,\n body : JSON.stringify(leadParams)\n }\n \n request(leadDetailsRequestParams, function (error, response, body){\n \n if(body){\n try{\n if(!body.error){\n body=JSON.parse(body);\n }\n else{\n model.info=body.error\n model.emit(globalCallBackRouter,model)\n }\n }\n catch(err){\n model.info=err\n model.emit(globalCallBackRouter,model)\n }\n event.on(\"callgetLeadDocument\",getLeadDocument)\n event.emit(\"callgetLeadDocument\",model,body)\n }\n else if(response){\n model.info=response;\n model.emit(globalCallBackRouter,model)\n }\n else if(error){\n model.info=error;\n model.emit(globalCallBackRouter,model)\n }\n else{\n model.info=\"Error while fetching Lead Details : Thyrocare API \\n\"+body;\n model.emit(globalCallBackRouter,model)\n }\n \n }); \n }\n \n else{\n model.info=\"Body or LeadId not present while fetching Lead Details : Thyrocare API\"\n respondOnInvalidData(model)\n }\n \n}", "title": "" }, { "docid": "e550f3c00941080051d92dfe7113d91b", "score": "0.46874467", "text": "function isResource(req, res, next) {\n let uri = req._parsedOriginalUrl.path;\n if (uri.includes('/api')){\n uri = uri.substring(4);\n }\n if (uri.includes('?')){\n uri = uri.substring(0, uri.indexOf(\"?\"));\n }\n uri = uri.substring(1);\n uri = uri.substring(0, uri.indexOf('/'));\n // let table = uri.substring(0, uri.length - 1);\n let table = uri;\n let id = Number(req.params.id);\n // var oraConfig = {\n // user: process.env.DB_USERNAME,\n // password: process.env.DB_PASSWORD,\n // connectString: `${process.env.DB_HOSTNAME}:${process.env.DB_PORT}/${process.env.DB_NAME}`\n // }\n // let connection = mysql.createConnection({\n // host : process.env.DB_HOSTNAME,\n // user : process.env.DB_USERNAME,\n // password : process.env.DB_PASSWORD,\n // port : process.env.DB_PORT,\n // database : process.env.DB_NAME,\n // multipleStatements: true\n // });\n const sql = `SELECT id FROM ${table} WHERE id = ${id}`;\n connection.execute(sql, function(err, result) {\n if (err) {\n console.error(err.message);\n return;\n }\n console.log(result);\n if (result.rows[0].length === 0){\n console.log('500');\n res.render('404');\n }\n else {\n next();\n }\n });\n // connection.query('SELECT id FROM ' + table + ' WHERE id = ?', [id], function(error, results, fields) {\n // // error will be an Error if one occurred during the query\n // // results will contain the results of the query\n // // fields will contain information about the returned results fields (if any)\n // if (error) {\n // throw error;\n // }\n // if (results.length === 0){\n // res.render('404');\n // }\n // else {\n // next();\n // }\n // });\n}", "title": "" }, { "docid": "d04f2bedffd44b839f659b45aaaba295", "score": "0.46844912", "text": "function handleRequestError() {\r\n if (id(\"error\")) {\r\n let error = id(\"error\");\r\n error.parentElement.removeChild(error);\r\n }\r\n let message = document.createElement(\"p\");\r\n message.innerText = \"Sorry I can't find my movies right now :/\";\r\n message.id = \"error\";\r\n id(\"moviegen\").appendChild(message);\r\n }", "title": "" }, { "docid": "238cfff929e4a744859a851267bf5a1c", "score": "0.46679425", "text": "async function idError(req, res) {\n console.log(`The Userskillrank id ${req.params.skill_id} passed is not an integer`);\n res.json({\n message: `This Userskillrank id ${req.params.skill_id} passed is not an integer`,\n status: false\n })\n}", "title": "" }, { "docid": "c2d7bc2e28abb746a2371130a47352cc", "score": "0.46660218", "text": "function handler (request, response, url) {\n var query = url.substr(6); // position 6 thru end\n var type = query.split(\"=\")[0];\n // var params = query.split(\"=\")[1];\n // does not work if there are more than one parameters separated by \"&\"\n var params = query.split(\"&\");\n if (type == \"?tags\") { handleTagQuery(params, response); }\n else if (type == \"?src\") { handleAddQuery(params, response); }\n else { badQuery(response); }\n}", "title": "" }, { "docid": "5f17b58f6660dddd68887bd3b27a6f0e", "score": "0.46439883", "text": "function updateTag(req, res){\n var idEquipo = req.params.id;\n var tagnuevo = req.body.tag;\n console.log(idEquipo, tagnuevo);\n\n if(tagnuevo){\n equipoModel.findOne({tag:tagnuevo, tercero:req.user.tercero}).exec((err, tag)=>{\n if(err) return res.status(500).send({message:\"error aprocesar la peticion\", error:err});\n if(tag) return res.status(404).send({message:\"Tag ya existe\"});\n if(!tag){\n equipoModel.findById({_id:idEquipo, tercero:req.user.tercero}).exec((err, equipo)=>{\n equipo.tag = tagnuevo;\n\n equipo.save((err, equipoUpdateTag)=>{\n if(err) return res.status(500).send({message:\"error aprocesar la peticion\", error:err});\n if(!equipoUpdateTag) return res.status(404).send({message: \"no se pudo generar la actualizacion\"});\n if(equipoUpdateTag) return res.status(200).send({message:'Exito tag actualizado', equipo:equipoUpdateTag});\n });\n })\n }\n\n \n });\n }else{\n res.status(404).send({message:'no ingreso ningun tag'});\n }\n}", "title": "" }, { "docid": "d78ec968e5ffffca7999ebc8b3f66b67", "score": "0.46338707", "text": "function estGetId(req, res, next) {\n try {\n console.log('apiREST params', req.params);\n console.log('apiREST query', req.query);\n let sql = 'SELECT * FROM personas WHERE id_persona=?';\n con.query(sql,[req.params.id], function(err,result) {\n if(err) {\n // Enviar error SQL\n console.error('ERR',err.message);\n res.status(500).send({\n finalizado: true,\n mensaje: 'getId Error SQL',\n });\n } else {\n // Manipular resultados\n res.status(200).send({\n finalizado: true,\n mensaje: 'getId OK',\n datos: result,\n });\n }\n\t\t});\n\n } catch(e) {\n console.log('ERROR', e);\n res.status(501).send({\n finalizado: true,\n mensaje: 'getId Error',\n });\n }\n}", "title": "" }, { "docid": "4cb4790e9d40ebb6134c791a5619c0d3", "score": "0.46335587", "text": "function loadData(tag) {\n isLoading = true;\n $('#loader').show();\n\n if (tag !== undefined) {\n globalTag = tag;\n window.history.pushState(tag, 'Pinry - Tag - '+tag, '/pins/tag/'+tag+'/');\n } else if (url(2) == 'tag') { //hard coded way to detect user input tag url\n tag = url(3);\n globalTag = tag;\n window.history.pushState(tag, 'Pinry - Tag - '+tag, '/pins/tag/'+tag+'/');\n }\n\n if (tag !== undefined) {\n $('#pins').html('');\n page = 0;\n if (tag != null)\n $('.tags').html('<span class=\"label tag\" onclick=\"loadData(null)\">' + tag + ' x</span>');\n else {\n $('.tags').html('');\n window.history.pushState(tag, 'Pinry - Recent Pins', '/pins/');\n }\n }\n\n var loadURL = apiURL+(page*30);\n if (globalTag !== null) loadURL += \"&tag=\" + tag;\n \n $.ajax({\n url: loadURL,\n success: onLoadData\n });\n}", "title": "" }, { "docid": "4cb4790e9d40ebb6134c791a5619c0d3", "score": "0.46335587", "text": "function loadData(tag) {\n isLoading = true;\n $('#loader').show();\n\n if (tag !== undefined) {\n globalTag = tag;\n window.history.pushState(tag, 'Pinry - Tag - '+tag, '/pins/tag/'+tag+'/');\n } else if (url(2) == 'tag') { //hard coded way to detect user input tag url\n tag = url(3);\n globalTag = tag;\n window.history.pushState(tag, 'Pinry - Tag - '+tag, '/pins/tag/'+tag+'/');\n }\n\n if (tag !== undefined) {\n $('#pins').html('');\n page = 0;\n if (tag != null)\n $('.tags').html('<span class=\"label tag\" onclick=\"loadData(null)\">' + tag + ' x</span>');\n else {\n $('.tags').html('');\n window.history.pushState(tag, 'Pinry - Recent Pins', '/pins/');\n }\n }\n\n var loadURL = apiURL+(page*30);\n if (globalTag !== null) loadURL += \"&tag=\" + tag;\n \n $.ajax({\n url: loadURL,\n success: onLoadData\n });\n}", "title": "" }, { "docid": "4cf5daa6ee1bb95f4605e0ee40453fec", "score": "0.46262997", "text": "function handle_GET(request, response) {\n // get request query from url\n var url_parts = url.parse(request.url,true).pathname;\n var pathname = url_parts.substring(1,url_parts.lastIndexOf(\"/\"));\n var userId = url_parts.substring(url_parts.lastIndexOf(\"/\")+1, url_parts.length);\n \n if (userId === 'users') {\n response.writeHead( 200, {'Content-Type': 'text/plain'} );\n response.write( JSON.stringify( database ) );\n response.end();\n } else if ((userId !== '') && (userId >= 0) && pathname === 'user'){\n try {\n response.writeHead( 200, {'Content-Type': 'text/plain'} );\n response.write( JSON.stringify( find(userId) ) );\n response.end();\n } catch (exeception) {\n response.writeHead( 404, {\"Content-Type\": \"text/plain\"} ); \n response.write(\"404 Not Found\\n\"); \n response.end(); \n } \n } else {\n response.writeHead( 500, {\"Content-Type\": \"text/plain\"} ); \n response.write(\"500 Internal Server Error\\n\"); \n response.end(); \n }\n}", "title": "" }, { "docid": "67adeca8555120e8941a179668e855f0", "score": "0.4625958", "text": "function database_request(callback, request_params) // How can I use this callback?\n{\n\tvar request = new XMLHttpRequest();\n\tvar boolean = false;\n\trequest.onreadystatechange = function() {\n\t\tif (request.readyState != 4) {\n\t\t\treturn; // Another callback here\n\n\t\t}\n\t\tif (request.status != 200) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar search_id = request.responseText\n\t\tconsole.log(search_id);\n\n//\t\tboolean = true;\n\t\tconsole.log(\"checking\");\n\t\tif(request.readyState == 4 && request.status==200){\n\t\t\tconsole.log(\"Pushing call back\");\n\t\t\tcallback(initmap,boolean,search_id);\n\t\t\tboolean = true;\n\t\t}\n\n\t}\n\tconsole.log(\"Opening port\");\n\trequest.open(\"GET\", \"http://superfluous.imqs.co.za/omicron/request_search_id\"+request_params);\n\trequest.send();\n}", "title": "" }, { "docid": "2f30ec1d70d41b6eac73c46a64ce4133", "score": "0.46070617", "text": "function hook_404(router_path) {}", "title": "" }, { "docid": "d4c03e2e8d1eb0c11f4a934922f936a2", "score": "0.46046078", "text": "function notFound(request, response) {\n // Fehlerhafter Aufruf ausgeben\n console.log(NOT_FOUND_MSG + request.url);\n // 404 (Not found) Fehler und HTML Benutzerhinweis als Antwort senden\n response.writeHead(404, \"Not found\", {'Content-Type': 'text/html'});\n response.end(NOT_FOUND_HTML);\n}", "title": "" }, { "docid": "b3d239747d8e0336cc38f5c1b95c6014", "score": "0.4603735", "text": "async function validateStudentId(req, res, next) {\n const { student_id } = req.params;\n const student = await service.read(Number(student_id));\n\n if (!student) {\n return next({ status: 404, message: `student id ${student_id} does not exist` });\n }\n\n res.locals.student = student;\n\n next();\n}", "title": "" }, { "docid": "e791ba0d6bd8532c6feb876c658a9cad", "score": "0.45928937", "text": "if (err.message.indexOf('404') > -1 || !content.imdb || content.imdb.indexOf('tt') === -1) {\n throw err\n }", "title": "" }, { "docid": "481989eacebe25e03a03a84dd2ae4a1c", "score": "0.45920742", "text": "function isValidModId(req, res, next) {\n const modIds = [\n \"accounts\",\n \"advancedlit\",\n \"cyberbullying\",\n \"digfoot\",\n \"digital-literacy\",\n \"esteem\",\n \"habits\",\n \"phishing\",\n \"presentation\",\n \"privacy\",\n \"safe-posting\",\n \"targeted\"\n ]\n\n if (modIds.includes(req.params.modId)) {\n next();\n } else {\n var err = new Error('Page Not Found.');\n err.status = 404;\n\n console.log(err);\n\n // set locals, only providing error stack in development\n err.stack = req.app.get('env') === 'development' ? err.stack : '';\n\n res.locals.message = err.message + \" Oops! We can't seem to find the page you're looking for.\";\n res.locals.error = err;\n\n // render the error page\n res.status(err.status);\n res.render('error');\n }\n}", "title": "" }, { "docid": "e7009b2385fa899c0c6f3ed80904d73f", "score": "0.45869154", "text": "function onRequest(request,response){\n console.log(request.method,request.url);\n\n\n\n if (request.method == \"GET\" && request.url==='/'){\n response.writeHead(200,{\"Contect-type\": \"text/html\"});//status code and obj\n //response.write(\"page is avaliable\");\n fs.createReadStream(\"/Users/Peng_Haoke/Desktop/NodeJS_Learn/index.html\").pipe(response);\n\n }else{\n console.log(\"i am now in the else loop\");\n response.writeHead(404,{\"Contect-type\": \"text/plain\"});//status code and obj\n response.write(\"page is not avaliable\");\n response.end();\n }\n\n\n}", "title": "" }, { "docid": "f55c01572f8a9319376e31a3d06a1c05", "score": "0.45851842", "text": "function onRequest(req, res) {\n \n //parse the URL from a string to an object of usable parts\n var parsedUrl = url.parse(req.url);\n //grab the query string from the parsedURL and parse it\n //into a usable object instead of a string\n var params = query.parse(parsedUrl.query);\n \n console.dir(parsedUrl.pathname) \n var director = parsedUrl.pathname.toString().split('&');\n console.dir(director); \n \n if(director[0] === \"/search\"){\n SteamId = director[1].split(\"=\")[1];\n //console.log(SteamId);\n gameSearch(req, res, params);\n //console.log(\"Request Received\");\n \n }\n else{\n //console.log(\"standard HTML sent\");\n res.writeHead(200, { \"Content-Type\" : \"text/html\"} );\n //write html file into the response\n res.write(index);\n //send response to client\n res.end();\n }\n \n}", "title": "" }, { "docid": "c7655280261d67c4aefc805e02241fb4", "score": "0.4575318", "text": "showSondage () {\n this.app.get('/sondage/:idevent/:idsend', (req, res) => {\n try {\n this.EventModel.findById(req.params.idevent).then(event => {\n if (event.status === 'public') {\n this.SondageModel.find({ id_event: req.params.idevent }).then(sondage => {\n res.status(200).json({\n code: 200,\n message: sondage\n })\n }).catch(err => {\n if (err) {\n res.status(400).json({\n code: 400,\n message: 'show sondage failed'\n })\n }\n })\n } else {\n if (event.administrators_ids.some(o => req.params.idsend.includes(o)) || event.moderators_ids.some(o => req.params.idsend.includes(o)) || event.members_ids.some(o => req.params.idsend.includes(o))) {\n this.SondageModel.find({ id_event: req.params.idevent }).then(sondage => {\n res.status(200).json({\n code: 200,\n message: sondage\n })\n }).catch(err => {\n if (err) {\n res.status(400).json({\n code: 400,\n message: 'show one sondage failed'\n })\n }\n })\n } else {\n res.status(403).json({\n code: 403,\n message: 'you dont have permission'\n })\n }\n }\n }).catch(err => {\n if (err) {\n res.status(403).json({\n code: 403,\n message: 'parent of poll not found'\n })\n }\n })\n } catch (err) {\n if (err) {\n res.status(400).json({\n code: 400,\n message: 'bad request'\n })\n }\n }\n })\n }", "title": "" }, { "docid": "11bfaf71201013eae70e9cc1686cb246", "score": "0.45724455", "text": "function getEvent(id) {\n link = \"/query/\";\n $.ajax({\n url: link,\n data: {\n id : id\n },\n dataType: \"json\"\n })\n .done(function(data) {\n renderPage(data);\n })\n .fail(function(data) {\n renderPage(data);\n });\n}", "title": "" }, { "docid": "151ce3020a95a06b856af1c360ffdc92", "score": "0.45668343", "text": "function findTagById(id) {\n\n $.ajax({\n type: \"GET\",\n dataType: \"json\",\n headers: {\n \"adminbksoftwarevn\": value_token_public,\n },\n url: \"api/v1/public/tag/find-by-id?id=\" + id,\n timeout: 30000,\n success: function (result) {\n console.log(result);\n updateTag(result);\n },\n error: function (jqXHR, textStatus, errorThrown) {\n errMess(jqXHR, textStatus, errorThrown);\n }\n });\n}", "title": "" }, { "docid": "abb90cbf0e9b7f11821ba0bdce91c288", "score": "0.45630133", "text": "function handle_unknown_request( response ) \n{\n if (debug) {\n console.log( 'IN handle_unknown_request' ) ;\t\t// debug\n }\n \n // return an error message \n response.writeHead( 400, \n \"Unknown route\" ,\n {\n 'Content-Type' : 'text/plain' \n } \n ) ;\n response.end( 'Unknown endpoint' ) ;\n}", "title": "" }, { "docid": "950e7e5c69d8b0760801bab0057e40c4", "score": "0.45571142", "text": "function onRequest(request, response) {\n\tvar pathname = url.parse(request.url).pathname;\n\tconsole.log(\"Request for \" + pathname + \" received.\");\n\tswitch(pathname) {\n\t\tcase '/':\n\t\t\tindex(request, response);\n\t\t\tbreak;\n\t\tcase '/radio':\n\t\t\tradio(request, response);\n\t\t\tbreak;\n\t\tcase '/demod':\n\t\t\tdemod(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"No request handler found for \" + pathname);\n\t\t\tresponse.writeHead(404, {\"Content-Type\": \"text/html\"});\n\t\t\tresponse.write(\"404 Not found\");\n\t\t\tresponse.end();\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "c5dbb6d6acea43aa63568781fef3ac1a", "score": "0.45558012", "text": "function articleHandler(req, res, next) {\n //article\n let SQL1 = `SELECT * From article JOIN category ON article.category_id = category.id WHERE article.id= $1;`;\n let safeValues1 = [req.params.id];\n\n dbExcecute(SQL1, safeValues1)\n .then((result) => {\n let article = result[0];\n let category = article.name;\n let CATEGORY_KEY = process.env.CATEGORY_KEY;\n let categoryUrl = `https://api.nytimes.com/svc/topstories/v2/${category}.json?api-key=${CATEGORY_KEY}`;\n getDataFromAPI(categoryUrl)\n .then((categoryData) => {\n let arr = categoryData.results.slice(0, 6).map((val) => {\n return new Article({ ...val, section: categoryData.section });\n });\n let categorySql = 'SELECT * FROM category;';\n dbExcecute(categorySql)\n .then(categories => {\n res.render('pages/article', {\n articleData: article,\n articleCategory: arr,\n categories: categories,\n })\n\n });\n })\n .catch((e) => next(e));\n })\n .catch((e) => next(e));\n}", "title": "" }, { "docid": "4e8e5d3b950afe76c3ff80ef6df181c4", "score": "0.45501", "text": "function __postData(collection,data,callback){\n if(_debug)console.log(\"check if data exists.[spi.url]\"+_spi+collection,\"[data.url]\"+data.url);\n var _key = hex_md5(data.url);\n var req = new XMLHttpRequest();\n _query.collection = collection;\n _query.example._key = _key;\n req.open('PUT', _spi_query, true);//query to check if exists\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Authorization', _auth);\n req.setRequestHeader('Api-Key', 'foobar');\n req.onreadystatechange = function() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {//got result\n var result = JSON.parse(req.responseText);\n if(_debug)console.log(result,result.count);\n result.count === 0 ? __create(_spi+collection,data,callback) : __update(_spi+collection+\"/\"+_key,data,callback);\n } else {//query error\n if(_debug)console.log(JSON.parse(req.responseText));\n }\n }\n };\n try{\n req.send(JSON.stringify(_query));//put query\n }catch(e){\n if(_debug)console.log(\"Error while checking data if exists.\"+e);\n }\n}", "title": "" }, { "docid": "fb3ad5b076661dc2ed3f9f1703785be0", "score": "0.45463973", "text": "function callback(response, tag) {\n if (callbackObject_)\n receivedResultCallback_.call(callbackObject_, response, tag);\n else\n receivedResultCallback_(response, tag);\n }", "title": "" }, { "docid": "f839ff7ff70096913384c00a1231a746", "score": "0.45450896", "text": "_handleRequest(request, response, next) {\n // Cache 404 responses\n response.setHeader('Cache-Control', 'public,max-age=3600');\n\n // Render the 404 message using the appropriate view\n let view = this._negotiateView('NotFound', request, response),\n metadata = { url: request.url, prefixes: this._prefixes, datasources: this._datasources };\n response.writeHead(404);\n view.render(metadata, request, response);\n }", "title": "" }, { "docid": "65f7e098535ea5cf220cca90995f5338", "score": "0.45431748", "text": "function dictionaryAjax(){\n let dictionaryURL = \"http://www.dictionaryapi.com/api/v1/references/collegiate/xml/\" + vocabWord + \"?key=d3f5c888-db47-4c06-8c91-c65cc8a39137\";\n\n //initialize ajax call to MW dictionary to get meaning of the word.\n let xmlhttpRequest = new XMLHttpRequest();\n xmlhttpRequest.overrideMimeType('text/xml');\n xmlhttpRequest.open(\"GET\", dictionaryURL, true); //operate translate in async mode.\n xmlhttpRequest.send();\n\n xmlhttpRequest.onreadystatechange = function () {\n if (xmlhttpRequest.readyState === 4) {\n if (xmlhttpRequest.status === 200) {\n alert(xmlhttpRequest.responseText);\n\n //if response contains \"suggestion\" tag , word is not in dictionary\n if (xmlhttpRequest.responseXML.firstChild.getElementsByTagName(\"suggestion\")[0]) {\n alert (`We're sorry, \"${vocabWord}\" not found.`);\n } else {\n debugger\n let word = xmlhttpRequest.responseXML.firstChild.getElementsByTagName(\"entry\")[0];\n getWordInfo(word);\n }\n\n } else {\n alert(\"**SERVER ERROR**\");\n }\n }\n };\n}", "title": "" }, { "docid": "1685947ec171bab832625e5b37d15876", "score": "0.45403796", "text": "function callback() {\n // clear previous results\n clearTable();\n // check if there any successful result\n if (req.readyState == 4) { // readyState=4 DONE Операция завершена. Все данные получены.\n if (req.status == 200) { // status Равен кодам HTTP (200 - успешно, 404 не найдено...\n parseMessages(req.responseXML);\n }\n }\n}", "title": "" }, { "docid": "dcc6ad6a45dca29ca04eacaba74e0564", "score": "0.45390967", "text": "function retrieveEquipmentFromApi(exerciseId, callback) {\n const settings = {\n url: WORKOUT_URLS.equipment,\n data: {\n license_author: \"wger.de\",\n language: 2,\n exercise: exerciseId\n },\n dataType: \"json\",\n type: \"GET\",\n success: callback\n };\n\n $.ajax(settings);\n}", "title": "" }, { "docid": "53c35d3f67481c414e16600e07b8fe6f", "score": "0.4535671", "text": "checkReviewExistence(req, res, next) {\n //check if game exists\n Game.findById(req.params.id).then(game => {\n if (!game) {\n req.flash('error', 'Game not found.');\n res.redirect('back');\n } else {\n let currentUserId = req.user.id;\n let currentGameId = req.params.id;\n //check if review exists for game and user\n Review.find({\n where: { userId: currentUserId, gameId: currentGameId }\n }).then(review => {\n if (review) {\n req.flash('error', 'You already wrote a review for this game.');\n res.redirect('back');\n } else {\n return next();\n }\n });\n }\n });\n }", "title": "" }, { "docid": "c6a9c62b9372988b10160c2fdbb297b0", "score": "0.45283917", "text": "function exercise( exerciseId , callback) {\n $.getJSON(\n \"php/exercise.php\", \n (exerciseId)?{ \"id\":exerciseId }:undefined, function(data) {\n console.log(data);\n\n if ( callback )\n callback(data);\n \n // Check if successfully retrieved current user information\n if (data.successful) {\n // Successful\n } else {\n // Not successful\n } \n });\n}", "title": "" }, { "docid": "955f8a3a8c4ecddc7b7331072003dde5", "score": "0.45241", "text": "async function addOrUpdateQuestionErrorHandler(req, res, next) {\n const validationCheck = await validateReqest(req.body);\n if (req.body.hasOwnProperty(\"_id\")) {\n //If get some id too we have to validate it\n if (!(await isIdExist(req.body._id))) return \"id is not exist\";\n }\n if (validationCheck !== true) {\n return res.status(422).send(`Error: ${validationCheck}`);\n } else next();\n}", "title": "" }, { "docid": "0c2ac4e111baac6cf0e05ed79c450831", "score": "0.4521181", "text": "function queryMitApi(callbackFunc, reply) {\n console.log(\"I enter queryMitApi with reply value: \"+ reply + \".\");\n var modReply = reply;\n //string manipulation needed to pass valid courseID\n if (reply.length== 4){\n modReply = reply.substr(0, 1);\n modReply = modReply + \".\";\n modReply = modReply + reply.substr(1,3);\n reply = modReply;\n }else if (reply.length ==5){\n modReply = reply.substr(0, 2);\n modReply = modReply + \".\";\n modReply = modReply + reply.substr(2,4);\n reply = modReply;\n }\n\n console.log(\"The modified reply is: \"+ modReply + \".\");\n\n\tvar options = {\n host: \"mit-public.cloudhub.io\",\n path: '/coursecatalog/v2/terms/2017FA/subjects/'+reply,\n method: 'GET',\n headers : {\n \"client_id\" : \"CLIENT_ID\",\n \"client_secret\" : \"CLIENT_SECRET\"\n\t\t}\n\t};\n\n\tvar body = '';\n\thttps.get(options, function(res) {\n\t console.log(\"Response: \" + res.statusCode);\n\t res.on(\"data\", function(chunk) {\n\t\t body += chunk;\n\t });\n\t res.on('end', function(){\n var myResponse = JSON.parse(body);\n callbackFunc(myResponse);\n\t });\n\t}).on('error', function(e) \n\t {\n\t\t console.log(\"Got error in https fetch: \" + e.message);\n\t\t}\n\t);\n}", "title": "" }, { "docid": "0ce3812d15cd16f160f7a661ce079b4c", "score": "0.45205653", "text": "function playerTalk(yelp_id, callback) {\n\tvar text = ':(';\n\tvar tries = 5;\n\tfor (var i = 0; i < tries; i++) {\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: talkServiceUrl,\n\t\t\tdata: { yelp_id : yelp_id},\n\t\t\tasync: false\n\t\t}).done(function(data) {\n\t\t\tvar talkString = '';\n\t\t\tif (typeof(data.response) !== 'undefined') {\n\t\t\t\tif ((data['response'].indexOf('http') === -1) && (data['response'].length < 120)) {\n\t\t\t\t\ttext = data['response'];\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (text !== ':(') {\n\t\t\tbreak;\n\t\t}\n\t}\n\tcallback(yelp_id, text);\n}", "title": "" }, { "docid": "b195927f690fd357529558426b49f530", "score": "0.45197368", "text": "static getArticles(req, res) {\n\n try {\n //Get the name of the game from the request\n let gameName = req.query.gameName;\n\n //Reqeust news article data from the gameDataProcessor\n gameData.getNewsArticleInfo(gameName, (data) => {\n res.send(data);\n });\n } catch (e) {\n console.log(\"Error getting Articles: \" + e.message);\n }\n }", "title": "" }, { "docid": "d6b686ac7aad662ee0bda0f20cce78da", "score": "0.45187655", "text": "validatePostId(request, response, next) {\n if(!data.isValidPostId(request.params.postId)) {\n response.status(404).send({error: 'Invalid postId'});\n } else {\n next();\n }\n }", "title": "" }, { "docid": "5672219d70e09bd00c18e8f5a1f16831", "score": "0.45177203", "text": "async function addCancelledBooking(studentId, lectureId) {\n const url = baseURL + '/teacher-home';\n return fetchMethod(\"POST\", `${url}/add-cancelled-booking`, { studentId: studentId, lectureId: lectureId, });\n}", "title": "" }, { "docid": "5227bd632385f97fff2bf45fe5120ca1", "score": "0.45119798", "text": "async function movieExists(req, res, next){\n const movieList = await service.read(req.params.movieId);\n const movie = movieList[0];\n if(movie){\n res.locals.movie = movie;\n return next();\n }\n return next({\n status: 404, \n message: `Movie cannot be found`\n })\n}", "title": "" }, { "docid": "92b75b9c040d6ad77b9dec319b7dbb1e", "score": "0.45092443", "text": "async readReviewsId(req, res) {\n try {\n const resultDb = await readReviewId(req.params.id);\n if (resultDb.length == 0)\n res.status(404).json({ header: \"error\", result: 'The card you are looking for is not relevant!' });\n else\n res.status(200).json({ header: \"ok\", result: resultDb });\n } catch (ex) {\n res.status(500).json('Error reading data' + ex);\n }\n }", "title": "" }, { "docid": "764abf3f2e3c7289bd9cf2566239b31d", "score": "0.45061225", "text": "function loadComingElections() {\n //this function load a list of coming elections using jQuery ajax\n\n $.ajax({\n type: \"POST\",\n url: \"/Election/GetComingElections\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n error: function (response) {\n //in here 'response' represents the following object {success: false, message ='...text here...'}\n //which I sent after creating an Error HttpContext.Response.StatusCode = 500 ...see the Catch block of code in the backend\n\n //to know why I used 'response.responseJSON.message' to get the error text just log the response object and check its properties\n\n //so there is a server error, lets display the error msg\n let errorParag = document.createElement(\"p\");\n let responseMsg = document.createElement(\"div\");\n responseMsg.className = \"alert alert-danger\";\n errorParag.innerHTML = \"<strong>\" + resources[currentUserLanguage][\"Error\"] + \"!</strong> \" + response.responseJSON.message;\n \n responseMsg.appendChild(errorParag);\n document.getElementById(\"coming-elections-area\").appendChild(responseMsg);\n //now lets hide the spinner\n hideElement(document.getElementById(\"coming-elections-area\").querySelector(\".spinner-border\"));\n },\n success: function (response) {\n //'response' represents the object returned from the api which is a list of future elections\n console.log(response);\n displayComingElections(response);\n }\n });\n\n}", "title": "" }, { "docid": "ae4ad17f8ad179d8d39d63c897cb4009", "score": "0.4503453", "text": "suggestions(tag){\r\n\r\n \t\tlet root = select(tag);\r\n \t\thttp.params('GET', 'http://localhost/yazz/i/api/follow/?context=4', null);\r\n http.request((data) => {\r\n\r\n \t try {\r\n \t \t \r\n \t \t let response = JSON.parse(data);\r\n\r\n \t \t if(response.list){ // True, That means The JSON Array Is Not Empty\r\n\r\n \t \t \t // Loop Through Arrays\r\n \t \t \t for(let i = 0; i < response.follow_list.length; i ++){\r\n\r\n \t \t \t \tlet wrapper = this.div();\r\n\r\n \t \t \t \twrapper.appendChild(this.followsList(response.follow_list[i],2));\r\n\r\n \t \t \t \troot.appendChild(wrapper);\r\n\r\n \t \t \t } // End Of Loop\r\n\r\n \t \t }else { // False, MEans JSON Array Was Empty\r\n\r\n \t \t \t this.toast('Couldn\\'t Get More Suggestions');\r\n\r\n \t \t }\r\n\r\n \t } catch(e) {\r\n\r\n \t \tthis.toast(e);\r\n\r\n \t } // End Of Try-Catch\r\n\r\n } ,// End Of Arrow Function\r\n ''\r\n ); // End Of Request Method Follow Suggestions\r\n\r\n \t}", "title": "" }, { "docid": "cad62bf8ebe98c5b2b0ec39094b99532", "score": "0.45032716", "text": "handleRequest(ctx, fnMiddleware) {\n const res = ctx.res;\n res.statusCode = 404;\n const onerror = err => ctx.onerror(err);\n const handleResponse = () => respond(ctx);\n onFinished(res, onerror);\n return fnMiddleware(ctx).then(handleResponse).catch(onerror);\n }", "title": "" }, { "docid": "98bf09a1ad018d055a7dc9d86dfd8803", "score": "0.4499524", "text": "about(request, response) {\n //looking at source of request\n const contnt = request.path;\n logger.debug('whats content', contnt);\n let n = contnt.indexOf(\"group\");\n logger.debug('is this group ',n);\n \n let trainerID = request.params.trainerid;\n logger.debug('Trainer id from Paramterers = ',trainerID);\n \n // if no trainer supplied as a parameter, depending on the source of the request\n if(trainerID === null || trainerID === undefined || trainerID === '' ){\n let loggedInUser = accounts.getCurrentUser(request);\n trainerID = loggedInUser.id;\n logger.debug('current logged in user about = ',loggedInUser.id);\n }\n \n const trainersData = trainers.getTrainerById(trainerID);\n \n const viewData = {\n title: 'About Trainer',\n trainersData: trainersData,\n };\n // either the selected trainer's data or the current loggin trainer data is sent to be displayed\n // selected will be group_t\n \n if(n === -1){\n response.render('trainerabout_t', viewData);\n } else {\n response.render('group_trainerabout', viewData);\n }\n }", "title": "" }, { "docid": "461dd24166252e45323e6b12784e9cdf", "score": "0.44994706", "text": "function onclick_add_exist_tag(tag){\n var id = $('#edit-participant-input').val();\n var url = Drupal.settings.reProjectUser.base_path+'tagsadd/'+id+'/'+tag;\n start_refresh_tags();\n $.getJSON(url, function(data){\n load_tags_in_window(data);\n });\n}", "title": "" }, { "docid": "e7e97cd7b0a692bbd21dcd95eb0caefa", "score": "0.44986758", "text": "function getRequestData(book_id) {\n $.get(\"/view-request/\" + book_id, function (data) {\n if (data) {\n console.log(data)\n requestObject = {\n id: data.id,\n title: data.title,\n author: data.author,\n thumbnail: data.thumbnail,\n ISBN: data.ISBN,\n respondingUser: data.respondingUser\n }\n console.log(requestObject)\n getUserInfo(requestObject);\n }\n })\n}", "title": "" }, { "docid": "9743344c9ed7b207c5d0536f6dde955b", "score": "0.4495241", "text": "async function fetchCourses(sid) {\n //gets all courses that the student id is registerd in and has not taken eval for \n const response = await sendData('/api/courses', sid);\n console.log(response);\n //Doesn't allow user to proceed to a new page if invalid id or if they don't have any evals to take \n // if (!(response === \"errorMessage\")){\n if (!(response === \"Invalid Student ID Number\" || response ===\"No Evals To Take\")){\n newLocation(sid,response);\n }\n else{\n //Puts Error Messages On Screen\n var result_display = document.getElementById('error');\n //result_display.innerHTML = \"Either Invalid Student ID or You Have No Evals To Take\";\n result_display.innerHTML = response;\n }\n}", "title": "" }, { "docid": "4696f2b00ad31b34a544276b4a094782", "score": "0.4492268", "text": "function tapi(params, callback) {\n if (!params.noun) {\n tapi_error(\"Request made with no noun.\");\n }\n\n if (!params.verb) {\n tapi_error(\"Request made with no verb.\");\n }\n\n if (!internal_mapping.hasOwnProperty(params.noun)) {\n tapi_error(\"Noun \" + params.noun + \" is not recognized\");\n }\n\n if (!internal_mapping[params.noun].hasOwnProperty(params.verb)) {\n tapi_error(\"Noun \" + params.noun + \" does not have the verb \" + params.verb);\n }\n\n if (params.data === undefined) {\n params.data = {};\n }\n var jqxhr = internal_mapping[params.noun][params.verb](params.data);\n if (params.callback !== undefined) {\n jqxhr.done(params.callback);\n }\n\n jqxhr.fail(function (e, z, errorThrown) {\n if (errorThrown === \"UNAUTHORIZED\") {\n var err = JSON.parse(e.responseText);\n window.location = \"/signin?error=\" + encodeURI(err.error);\n } else {\n server_error(e.responseText, errorThrown);\n }\n });\n\n return jqxhr;\n }", "title": "" }, { "docid": "896a414664fcd0be4331849f98dec4b5", "score": "0.4490385", "text": "async function newSuggestion(req, res, next) {\n let accessToken = req.cookies.tokens.access_token;\n let group = req.query.group;\n let id = req.params.id;\n // Check for required values\n if (!accessToken) return next(new HTTPError(400, \"Could not find access token.\"));\n if (!group) return next(new HTTPError(400, \"Could not find group.\"));\n // GET request to meetup api\n let meetup = await axios\n .get(`https://api.meetup.com/${group}/events/${id}`, {\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n })\n .then(resp => {\n if (!resp.data) \n return next(new HTTPError(404, \"Failed to retrieve event data from Meetup API.\"))\n else return res.json(resp.data);\n })\n .catch(err => next(new HTTPError(500, err)));\n}", "title": "" }, { "docid": "941b6c8aa6f26afe5f65f092439706d3", "score": "0.44897884", "text": "function registerRRPair(service, rrpair) {\n let msg;\n let path;\n let matched;\n\n if (rrpair.path) path = service.basePath + rrpair.path;\n else path = service.basePath;\n\n router.all(path, delay(service.delay, service.delayMax), function(req, resp, next) {\n req.msgContainer = req.msgContainer || {};\n req.msgContainer.reqMatched = false;\n\n if (req.method === rrpair.verb) {\n // convert xml to js object\n if (rrpair.payloadType === 'XML') {\n xml2js.parseString(req.body, function(err, xmlReq) {\n matched = matchRequest(xmlReq);\n });\n }\n else {\n matched = matchRequest(req.body);\n }\n }\n else {\n msg = \"HTTP methods don't match\";\n req.msgContainer.reason = msg;\n logEvent(msg);\n return next();\n }\n debug(\"Request matched? \" + matched);\n \n // run the next callback if request not matched\n if (!matched) {\n msg = \"Request bodies don't match\";\n req.msgContainer.reason = msg;\n logEvent(msg);\n return next();\n }\n\n // function for matching requests to responses\n function matchRequest(payload) {\n let reqData;\n let match = false;\n\n if (rrpair.reqData) {\n if (rrpair.payloadType === 'XML') {\n xml2js.parseString(rrpair.reqData, function(err, data) {\n reqData = data;\n });\n }\n else {\n reqData = rrpair.reqData;\n }\n }\n\n // try exact math\n match = deepEquals(payload, reqData);\n\n if (!match) {\n // match based on template\n let templates = service.matchTemplates;\n\n if (templates && templates.length) {\n for (let template of templates) {\n if (!template) {\n break;\n }\n \n if (rrpair.payloadType === 'XML') {\n xml2js.parseString(template, function(err, xmlTemplate) {\n if (err) {\n logEvent(err);\n return;\n }\n template = xmlTemplate;\n });\n }\n else if (rrpair.payloadType === 'JSON') {\n try {\n template = JSON.parse(template);\n }\n catch(e) {\n debug(e);\n continue;\n }\n }\n \n const flatTemplate = flattenObject(template);\n const flatPayload = flattenObject(payload);\n const flatReqData = flattenObject(reqData);\n \n const trimmedPayload = {}; const trimmedReqData = {};\n \n for (let field in flatTemplate) {\n trimmedPayload[field] = flatPayload[field];\n trimmedReqData[field] = flatReqData[field];\n }\n \n logEvent('received payload (from template): ' + JSON.stringify(trimmedPayload, null, 2));\n logEvent('expected payload (from template): ' + JSON.stringify(trimmedReqData, null, 2));\n\n match = deepEquals(trimmedPayload, trimmedReqData);\n \n if (match) break;\n }\n }\n }\n\n if ((!rrpair.reqData && JSON.stringify(payload, null, 2)=='{}')|| match) {\n // check request queries\n if (rrpair.queries) {\n // try the next rr pair if no queries were sent\n if (!req.query) {\n debug(\"expected queries in request\");\n return false;\n }\n let matchedQueries = true;\n\n const expectedQueries = Object.entries(rrpair.queries);\n expectedQueries.forEach(function(queryVal) {\n const sentQuery = req.query[queryVal[0]];\n \n if (sentQuery != queryVal[1]) {\n matchedQueries = false;\n logEvent('expected query: ' + queryVal[0] + ': ' + queryVal[1]);\n logEvent('received query: ' + queryVal[0] + ': ' + sentQuery);\n }\n });\n\n if (!matchedQueries) return false;\n }\n\n // check request headers\n if (rrpair.reqHeaders) {\n let matchedHeaders = true;\n const expectedHeaders = Object.entries(rrpair.reqHeaders);\n\n expectedHeaders.forEach(function(keyVal) {\n // skip content-type header\n if (keyVal[0].toLowerCase() !== 'content-type') {\n const sentVal = req.get(keyVal[0]);\n if (sentVal != keyVal[1]) {\n // try the next rr pair if headers do not match\n matchedHeaders = false;\n logEvent('expected header: ' + keyVal[0] + ': ' + keyVal[1]);\n logEvent('received header: ' + keyVal[0] + ': ' + sentVal);\n }\n }\n });\n\n if (!matchedHeaders) return false;\n }\n\n // send matched data back to client\n setRespHeaders();\n if (rrpair.resStatus && rrpair.resData) {\n resp.status(rrpair.resStatus).send(rrpair.resData);\n }\n else if (!rrpair.resStatus && rrpair.resData) {\n resp.send(rrpair.resData);\n }\n else if (rrpair.resStatus && !rrpair.resData) {\n resp.sendStatus(rrpair.resStatus);\n }\n else {\n resp.sendStatus(200);\n }\n\n // request was matched\n return true;\n }\n\n // request was not matched\n logEvent(\"expected payload: \" + JSON.stringify(reqData, null, 2));\n logEvent(\"received payload: \" + JSON.stringify(payload, null, 2));\n\n return false;\n }\n\n // function to set headers for response\n function setRespHeaders() {\n var resHeaders = rrpair.resHeaders;\n if (resHeaders) { \n \n \n if(rrpair.label){\n resHeaders['Mockiato-RRPair-Label'] = rrpair.label;\n }\n \n if (!resHeaders['Content-Type']) {\n setContentType();\n }\n \n resp.set(resHeaders);\n return;\n }else if(rrpair.label){\n\n resp.set( { \"Mockiato-RRPair-Label\": rrpair.label});\n }\n \n setContentType();\n }\n \n function setContentType() {\n // set default headers\n if (rrpair.payloadType === 'XML')\n resp.set(\"Content-Type\", \"text/xml\");\n else if (rrpair.payloadType === 'JSON') {\n resp.set(\"Content-Type\", \"application/json\");\n }\n else {\n resp.set(\"Content-Type\", \"text/plain\");\n }\n }\n });\n}", "title": "" }, { "docid": "e97d1cc649d12a9c9fa8ab1c67a41810", "score": "0.448897", "text": "handleRequest(req, res, next) {\n\n \tfor(let index in this.routes) {\n \t\tlet routeEntry = this.routes[index]\n\n \t\tlet result = routeEntry.routeObj.match(req.url);\n\n \t\tif(result !== false) {\n\n \t\t\treturn this.seneca.act({\n \t\t\t\trole: \"web\",\n \t\t\t\troute: routeEntry.name,\n method: req.method,\n \t\t\t\tparams: result,\n request: req,\n response: res,\n next: next\n \t\t\t}, function(err) {\n \t\t\t\tif(err) {\n return next(err);\n }\n \t\t\t});\n\n \t\t}\n \t}\n \treturn next();\n }", "title": "" }, { "docid": "5aa90ee85dca305a50bd6b0d68eb0a96", "score": "0.4481899", "text": "function processRequest(request, response) {\n var parsedUrl = URL.parse(request.url, true);\n \n //take a data from URL\n var pathName = parsedUrl['pathname']\n var query = parsedUrl['query'];\n\n // create a data to send for event\n var pathSplit = pathName.split(\"/\");\n var moduleName = \"\";\n var subModule = \"\";\n if(pathSplit.length >= 2) {\n moduleName = pathSplit[1];\n if(pathSplit.length >2) {\n subModule = pathSplit[3]\n }\n }\n\n query[\"_subModule\"] = subModule;\n query[\"_data\"] = request.data;\n if(!isEventExist(moduleName)) {\n response.writeHead(404, {'Content-Type': 'text/plain' });\n response.end(\"404 Page not found ! \\n Module \\\"\" + moduleName + \"\\\" does not exist!\");\n }\n else {\n server.emit(moduleName, query, request, response);\n }\n \n}", "title": "" }, { "docid": "a047c67272d625156f6f279c8765ce47", "score": "0.4479683", "text": "function obtenerPersonaje(id, callback){\nconst url = `${API_URL}${PEOPLE.replace(':id', id)}`\n\n//para saber cuando sucede un error, la funcion get nos permite concatenar tambien la funcion fail, la cual nos permitira realizar una accion al momento de que ocurra algun error en la comunicacion con la obtencion de datos a nuestro jQuery, veamos como se implementa\n\n$.get(url, opciones, callback).fail(function(){\n console.log(`sucedio un error al intentar obtener el personaje ${id}`);\n //como podemos observar si nosotros interrumpimos la obtencion de datos el programa arrjora este error y la cadena se detendra en el personaje por obtener, es decir que si el error\n //ocuerrio al obtener el personaje 4, todos los demas ids o personajes nunca se mandaran a llamar, ya que cada personaje tiene un callback que llama al proximo y al no poder obtener la info de uno, los datos de los demas se pierd\n});\n}", "title": "" }, { "docid": "e2ea8b4c98db841d5aa7a7ed54a79482", "score": "0.44781828", "text": "function recordForEID(dateOfDeceased, eventGps, disposalMethodId, disposalMethodCode, deathReason, propertyId, contactId, livestockIds, shouldPost, language, trans, preventNLISErr) {\r\n\r\n let str = null, retrievedEID = null, deceasedTagStatus = null, deceasedLivestockStatus = null;\r\n _forEach(livestockIds, function (i) {\r\n if (str) { str = str + `,'${i}'`; }\r\n else { str = `'${i}'`; }\r\n });\r\n\r\n let select = `\r\n l.Id, l.EID,l.UUID ,l.AuditLogId,l.CurrentTagId,\r\n t.AuditLogId as TagAuditLogId,t.UUID as TagUUID,la.Id as LivestockAttrId`;\r\n let join = ` \r\n left join tag t on t.Id = l.CurrentTagId \r\n left join livestockattribute la on la.LivestockId = l.Id `;\r\n let where = ` l.UUID IN (${str}) `;\r\n\r\n var p = getLivestockByCondition(where, join, select).then(function (livestocks) {\r\n retrievedEID = livestocks;\r\n if (retrievedEID.length == 0) {\r\n throw new Error(\"No livestock found\");\r\n }\r\n return;\r\n }).then(function () {\r\n return postToNlis(shouldPost, propertyId, dateOfDeceased, retrievedEID);\r\n });\r\n return p.then(function (res) {\r\n if (res.status == HttpStatus.BAD_REQUEST && preventNLISErr) {\r\n return res;\r\n }\r\n else {\r\n return Promise.resolve().then(function () {\r\n return getTagStatus(language);\r\n }).then(function (tagStatus) {\r\n deceasedTagStatus = _find(tagStatus, function (i) {\r\n return i.SystemCode == tagStatusCodes.Deceased;\r\n });\r\n\r\n if (deceasedTagStatus == null) {\r\n throw new Error(\"Tag Status - Deceased not available\");\r\n }\r\n return;\r\n }).then(function (deceasedStatus) {\r\n return getAllActivityStatus({ SystemCode: livestockActivityStatusCodes.Deceased });\r\n }).then(function (livestockStatus) {\r\n if (livestockStatus.length == 0) {\r\n throw new Error(\"Livestock Status - Deceased not available\");\r\n }\r\n deceasedLivestockStatus = livestockStatus[0];\r\n return;\r\n }).then(function () {\r\n let livestockStatusId = uuidToBuffer(deceasedLivestockStatus.Id);\r\n let tagObj = {\r\n CurrentLivestockId: null, CurrentStatusId: deceasedTagStatus.Id\r\n };\r\n let livestockObj = {\r\n ActivityStatusId: livestockStatusId\r\n };\r\n let livestockAttrObj = {\r\n DisposalMethodId: disposalMethodId ? uuidToBuffer(disposalMethodId) : null,\r\n DeathReason: deathReason\r\n }\r\n let updateAuditIds = [], createAuditIds = [], tagIds = [], livestockIds = [],\r\n livestockEvents = [], statusHistories = [], livestockAttrIds = [];\r\n\r\n _forEach(retrievedEID, function (f) {\r\n\r\n if (f.UUID) {\r\n updateAuditIds.push(bufferToUUID(f.AuditLogId));\r\n livestockIds.push(f.UUID);\r\n }\r\n if (f.TagUUID) {\r\n updateAuditIds.push(bufferToUUID(f.TagAuditLogId));\r\n tagIds.push(f.TagUUID);\r\n }\r\n if (f.LivestockAttrId) {\r\n livestockAttrIds.push(new Buffer(f.LivestockAttrId));\r\n }\r\n\r\n let reference = `DisposalMethod: ${disposalMethodCode}`;\r\n let livestockEvent = LivestockEventMapper(new Buffer(f.Id), uuidToBuffer(propertyId),\r\n null, 1, eventTypes.RecordDeceased, dateOfDeceased, eventGps, reference);\r\n createAuditIds.push(livestockEvent.LivestockEvent_AuditLogId);\r\n livestockEvents.push(livestockEvent.LivestockEvent);\r\n\r\n let statusHistory = LivestockStatusHistoryMapper(new Buffer(f.Id), uuidToBuffer(propertyId),\r\n livestockStatusId, eventGps, null, livestockEvent.LivestockEvent.Id);\r\n statusHistories.push(statusHistory);\r\n });\r\n return models.sequelize.transaction(function (t) {\r\n return updateAudit(updateAuditIds, [], contactId, trans).then(function () {\r\n return createAudit(createAuditIds, contactId, trans);\r\n }).then(function () {\r\n return updateTag(tagObj, { UUID: tagIds }, trans);\r\n }).then(function () {\r\n return updateLivestock(livestockObj, { UUID: livestockIds }, trans);\r\n }).then(function () {\r\n return updateLivestockAttr(livestockAttrObj, { Id: livestockAttrIds }, trans);\r\n }).then(function () {\r\n return bulkCreateLivestockEvent(livestockEvents, trans);\r\n }).then(function () {\r\n return bulkCreateLivestockStatusHistory(statusHistories, trans);\r\n });\r\n })\r\n }).then(function () {\r\n return getResponse();\r\n }).catch(function (err) {\r\n throw new Error(err.toString());\r\n });\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "b31bd45e6ec96fb43017c8c24434412c", "score": "0.4476142", "text": "async function get_books()\n{\n var data = null;\n var req = new XMLHttpRequest();\n\n req.open(\"GET\", \"/get_books\", true);\n req.setRequestHeader('Content-Type','application/json')\n \n req.addEventListener('load', function()\n {\n if (req.status >= 200 && req.status <= 400)\n {\n var response = JSON.parse(req.responseText);\n\n if(response[0] == -2)\n {\n //console.log(\"Not signed in\");\n }\n else\n {\n book_load(response);\n }\n }\n else\n {\n console.log('Error in network request: ' + req.statusText);\n }\n });\n \n req.send(data);\n}", "title": "" }, { "docid": "02c7b57d13c73d74e3ae2be2516689e1", "score": "0.44725692", "text": "function processOk(request,responseText,subtitle){\n \"use strict\";\n var data;\n try {\n data=JSON.parse(responseText);\n if (\n typeof data === 'object'\n ){\n if (\n data.hasOwnProperty('data') &&\n typeof data.data === 'object' &&\n data.data.hasOwnProperty('columns')\n ){\n //generate and dump table on #dataTable div\n dumpTable(data,'dataTable','theMotherOfAllTables');\n //initialize datatables features and styling\n fireDataTables('theMotherOfAllTables');\n }\n if (data.hasOwnProperty('execTime')){\n //set output text on some other fields\n $('#execTime').text(data.execTime);\n } else {\n $('#execTime').text('');\n }\n }\n } catch (err) {\n console.log(\"Couldn't parse JSON response.\");\n }\n if (\n request.collection === 'raffle' &&\n (\n request.action === 'open' ||\n request.action === 'close' ||\n request.action === 'delete'\n )\n ){\n requestAndProcessPageJSONData(\n {\n 'collection':'raffle',\n 'action':'list',\n 'creatorid':'me',\n 'subtitle': subtitle\n }\n );\n } else if (\n request.collection === 'raffle' &&\n (\n request.action === 'join'\n )\n ){\n requestAndProcessPageJSONData(\n {\n 'collection':'raffle',\n 'action':'list',\n 'raffleid':request.raffleid,\n 'subtitle': subtitle\n }\n );\n } else if (\n request.collection === 'raffle' &&\n (\n request.action === 'leave'\n )\n ){\n requestAndProcessPageJSONData(\n {\n 'collection':'raffle',\n 'action':'list',\n 'userid':'me',\n 'subtitle': subtitle\n }\n );\n } else {\n $('#subtitle').text(subtitle);\n }\n}", "title": "" }, { "docid": "ab5864dbae5aefd6d4cd058a00b65b17", "score": "0.44677874", "text": "function queryHandler (request, response, url) {\n var query = url.substr(6); // position 6 thru end\n var type = query.split(\"=\")[0]; //?keyList\n var params = query.split(\"=\")[1]; //castle+nature%20scene\n console.log(params);\n console.log(type);\n if (type == \"?keyList\") { handleKeyList(params, response); }\n else if (type == \"?addKey\") { handleNewKey(params, response); }\n else if (type == \"?deleteKey\") { handleDelete(params, response); }\n else if (type == \"?autocomplete\") { handleAutoComp(params, response); }\n else { badQuery(response); }\n}", "title": "" }, { "docid": "3ac0a05ccdc15c4e1f896b3f7893fdde", "score": "0.44635385", "text": "function recipeRequest(searchTerm, callback) {\n let query = {\n q: `${searchTerm}`,\n app_id: `${foodId}`,\n app_key: `${foodKey}`,\n to: 8,\n image: ''\n }\n let result = $.ajax({\n /* update API end point */\n url: FOOD_URL,\n data: query,\n dataType: 'json',\n /*set the call type GET / POST*/\n type: 'GET'\n })\n /* if the call is successful (status 200 OK) show results */\n .done(function (result) {\n callbackFood(result);\n })\n /* if the call is NOT successful show errors */\n .fail(function (jqXHR, error, errorThrown) {\n console.log(jqXHR);\n console.log(error);\n console.log(errorThrown);\n });\n\n}", "title": "" }, { "docid": "a388478574b40b8df29bbff74fa3378e", "score": "0.44615918", "text": "function tvDetailHandler(poster, initCarousel) {\n smoothScroll(MAIN);\n getTvDetailsTMDB(poster.attr('data-id'), function(detail_resp) {\n getTVExternalIdsTMDB(detail_resp.id, function(ids_resp) {\n searchByIdOMDB(ids_resp.imdb_id, function(imdb_resp) {\n showDetailPage(initCarousel);\n displayDetailPage(detail_resp, imdb_resp); // Displays detail page\n initCarousel ? displayDetailCarousel() : null; // inits carousel if needed\n\n getSimilarShowsTMDB(poster.attr('data-id'), resp => {\n displaySimilarCarousel(resp, true);\n });\n // Guidebox API no longer in service to site\n\n // searchByExternalIdGuidebox(imdb_resp.imdbID, 'show', 'imdb', function(gbox_s_resp) {\n // getShowGuidebox(gbox_s_resp.id, function(gbox_tv_resp) {\n // getAllEpisodesGuidebox(gbox_s_resp.id, function(ep_resp) {\n // tvEpisodesHandler(ep_resp, detail_resp.number_of_seasons);\n // });\n // });\n // }); \n });\n });\n getTvVideosTMDB(detail_resp.id, function(video_resp) {\n trailerHandler(video_resp);\n });\n });\n}", "title": "" }, { "docid": "11274f17749d6c2fa47b3cbdb8fc3972", "score": "0.44561136", "text": "function notFound(request, response) {\n // Error message\n console.log(NOT_FOUND_MSG + request.url);\n // sending 404 (Not found) errror and html warning as request\n response.writeHead(404, \"Not found\", {'Content-Type': 'text/html'});\n response.end(NOT_FOUND_HTML);\n}", "title": "" }, { "docid": "103c6efc939914c4e00b1db4eee7156c", "score": "0.4452343", "text": "index({ params }, response) {\n return Util.handleError(response, 'cannot retrieve passengers without ride id', 404);\n }", "title": "" }, { "docid": "b79fc99e6ca46d0b78415593f80b6aa7", "score": "0.444715", "text": "function notFound(){\r\n if(res.data.Response === \"False\"){\r\n console.log(\"Movie not found\")\r\n moviePic.remove()\r\n details.remove()\r\n errDisplay.append(\"Movie not found\")\r\n }\r\n }", "title": "" }, { "docid": "1542a0fa7d34498481c9fd7a6fbba5ae", "score": "0.4446736", "text": "function obtenerPersonaje(id, callback)\n{\n console.log(id)\n const URL = `${API_URL}${PEOPLE_URL.replace(':id', id)}`\n\n $.get(URL, OPTS, function (persona) {\n console.log(`Hola yo soy, ${persona.name}`)\n if(callback)\n {\n callback()\n }\n })\n}", "title": "" }, { "docid": "48ffec932b77e062f81774ac90369111", "score": "0.44437107", "text": "function onRequest(request, response){\n if (request.method == 'GET' && request.url == '/'){\n console.log('A user made a request' + request.url);\n response.writeHead(200, { \"Content-Type\": \"text/plain\" });\n fs.createReadStream('./resources/chaos-sonic-adventure.jpg').pipe(response);\n\n }else if(request.method == 'GET' && request.url == '/image'){\n console.log('A user made a request' + request.url);\n response.writeHead(200, { \"Content-Type\": \"image/gif\" });\n fs.createReadStream('./resources/chaos-sonic-adventure.jpg').pipe(response);\n\n }else if(request.method == 'GET' && request.url == '/video'){\n console.log('A user made a request' + request.url);\n response.writeHead(200, { \"Content-Type\": \"image/gif\" });\n fs.createReadStream('./resources/chaos-sonic-adventure.jpg').pipe(response);\n\n }else if(request.method == 'GET' && request.url == '/audio'){\n //Added cases for different audio extensions based on browser type\n console.log('A user made a request' + request.url);\n response.writeHead(200, { \"Content-Type\": \"image/gif\" });\n fs.createReadStream('./resources/chaos-sonic-adventure.jpg').pipe(response);\n\n }else{\n send404Response(response);\n }\n}", "title": "" }, { "docid": "498fbecae1e2c0b816f45fcea54aca47", "score": "0.4434053", "text": "function error( response , postData )\n{\n response.writeHead( 200 , { \"Content-Type\": \"text/plain\" } );\n response.write( \"404 not found: \" + querystring.parse( postData ).text );\n response.end();\n}", "title": "" }, { "docid": "4731878b868d5d88be512861fd42a6f6", "score": "0.4433211", "text": "function educationCheck(callback) {\n if (top[0].isEducationComplete === 0 || top[0].isEducationComplete === null) {\n connection.query(educationQuery, [req.body.user], function(err5, rows) {\n if (err5) {\n throw err5;\n } \n callback({page:'Education', missingItems:checkEducationInfo(rows[0])});\n });\n } else {\n callback(false);\n }\n }", "title": "" }, { "docid": "90a368b53d85cdabf1ac5fdcc1e75610", "score": "0.44309804", "text": "getTagById(req, res) {\n TagModel.find({_id: req.params.tagId},(err, data)=>{\n if(err) res.send(err);\n else res.json(data); // Get JSON format of contact\n });\n }", "title": "" }, { "docid": "9f3ff0019f3165de3c591d3e9be2474e", "score": "0.4425191", "text": "function findSeatId(hallId, ordinal) {\n //Get api/seat/?hallId={}&&seatNumber={}\n var url = \"https://\" + host + '/api/seat/?hallId=' + hallId.toString() + '&&seatNumber=' + ordinal.toString();\n $.ajax({\n url: url,\n type: \"GET\",\n }).done(function (data, status) {\n seatId = data.Id;\n buyTicketFor(seatId);\n \n\n }).fail(function (data, status) {\n\n alert(\"error find seat id !\");\n })\n\n }", "title": "" }, { "docid": "78448d49a73dfe6638adecaa1f4bf26d", "score": "0.4424575", "text": "function requestData(endpoint, parameters, callback) {\n $.ajax({\n type: \"GET\",\n url: endpoint,\n contentType: \"application/json; charset=utf-8\",\n data: parameters,\n dataType: \"json\",\n success: callback,\n error: function (msg) { \n $(\"#\"+ parameters.tagname +\"-loading-fails\").text(msg);\n }\n });\n}", "title": "" }, { "docid": "530807f7aa11c7208e7b94447472b79d", "score": "0.4421903", "text": "function validateMetaId(req, res, next) {\n if (req.params.id) {\n AnimalMeta.getById(req.params.id)\n .then(animal => {\n if (animal) {\n next();\n } else {\n res.status(404).json({message: \"No animal by that animal meta id\"})\n }\n })\n .catch(error => {\n res.status(500).json({ message: \"Error getting valid animal meta\", error: error.toString() })\n })\n }\n}", "title": "" }, { "docid": "d962aebad39187be4590160a97aa820e", "score": "0.4416014", "text": "function loadGamer() {\n let gamerUUID = $.urlParam(\"uuid\");\n if (gamerUUID!== null) {\n $.ajax({\n url: \"./resource/gamer/read?uuid=\" + gamerUUID,\n dataType: \"json\",\n type: \"GET\"\n })\n .done(showGamer)\n .fail(function (xhr, status, errorThrown) {\n if (xhr.status == 403) {\n window.location.href = \"./login.html\";\n } else if (xhr.status == 404) {\n $(\"#message\").text(\"Kein Gamer gefunden\");\n } else {\n console.log(xhr.status+\" Ich bin hier\")\n // window.location.href = \"./gamershelf.html\";\n }\n })\n }\n\n}", "title": "" }, { "docid": "308cb6ca426ec845c15a42bcb30e6934", "score": "0.44150802", "text": "async function getFirstStudentInWaitingList(lectureId) {\n let url = \"/studentInWaitinglist?lectureId=\" + lectureId;\n return await fetchMethod(\"GET\", baseURL + url);\n}", "title": "" } ]
7113073e26198b68dbb8c1321304977e
Sets a config keyvalue pair on the Stack in the associated Workspace.
[ { "docid": "9d2b08094162d5517c58a74f76f3cd72", "score": "0.6192212", "text": "setConfig(key, value) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.workspace.setConfig(this.name, key, value);\n });\n }", "title": "" } ]
[ { "docid": "a672cc264dfd7f91c12fd27f81fc1dc3", "score": "0.7079906", "text": "setConfig(key, value) {\r\n this._config[key] = value\r\n }", "title": "" }, { "docid": "3a6adb562d6c53718d37ee60d9530ddc", "score": "0.6806763", "text": "setConfig(stackName, key, value) {\n return __awaiter(this, void 0, void 0, function* () {\n const secretArg = value.secret ? \"--secret\" : \"--plaintext\";\n yield this.runPulumiCmd([\n \"config\",\n \"set\",\n key,\n \"--stack\",\n stackName,\n secretArg,\n \"--non-interactive\",\n \"--\",\n value.value,\n ]);\n });\n }", "title": "" }, { "docid": "835c5ab1132ffcdcf8f35259c28f45a0", "score": "0.65123844", "text": "setKeyValue(key, value) {\n this.stack.unshift([\"set\", key, this.obj[key]])\n\n this.obj[key] = value\n }", "title": "" }, { "docid": "e5c575c783ebbcd7cb79845bf814ea97", "score": "0.64759356", "text": "set(name, value) {\n\t\tthis._config.set(name,value);\n\t}", "title": "" }, { "docid": "6212535530036000a4d2a6f026ea15c7", "score": "0.6421914", "text": "function set(key, value) {\n let config = getGlobalConfig();\n if (key && typeof key === 'string' && typeof value !== 'undefined') {\n config = _.set(config, key, value);\n } else if (_.isObject(key)) {\n config = _.merge(config, key);\n } else if (typeof value !== 'undefined') {\n config = _.merge(config, value);\n }\n // update config meta\n config.meta = config.meta || {};\n config.meta.updated_at = Math.round(Date.now() / 1000);\n // write to .serverlessrc file\n return storeConfig(config);\n}", "title": "" }, { "docid": "d7a1a5ce7ec84ea9cd844cbc05515d03", "score": "0.63483477", "text": "set(key, value) {\n utils_1.lodash.set(this.config, key, value);\n }", "title": "" }, { "docid": "3371c67020508f2dcf018a3a5cd0cfc5", "score": "0.611559", "text": "function setConfig(k, v) {\n const config = parseConfig();\n config[cleanKey(k)] = v;\n persistConfig(config, []);\n}", "title": "" }, { "docid": "207f34dbdc5e7c3ee8b6ff3eeb514e3a", "score": "0.6046239", "text": "set(key, value) {\n lodash_set_1.default(this._config, key, value);\n //\t\tconst constructedConfig = {};\n //\n //\t\tif(key.includes('.')){\n //\t\t\tconst keys = key.split('.');\n //\n //\t\t\tlet currentConfig = this._config;\n //\t\t\tfor (let key of keys) {\n //\t\t\t\tif(!currentConfig[key]){\n //\t\t\t\t\tconstructedConfig[key] = {};\n //\t\t\t\t\tcurrentConfig[key] = {};\n //\t\t\t\t}\n //\n //\n //\t\t\t}\n //\t\t}\n //\n //\t\tconstructedConfig[key] = value;\n //\n //\t\tconst configToSet = {...dotnotate(constructedConfig), ...constructedConfig};\n //\n //\t\tthis._config = {...this._config, ...configToSet};\n }", "title": "" }, { "docid": "c2b4cd1f2a6472f9ce31e2de0d7cc7ae", "score": "0.58888906", "text": "set(path, value) {\n this._requireConfigs();\n\n this.config = _.set(this.config, path, value);\n }", "title": "" }, { "docid": "b0fb37e093e31c9db5d731988cc295dd", "score": "0.57526624", "text": "function set(key, value) {\n settings[key] = value;\n }", "title": "" }, { "docid": "b4d113f81e43e94bae39f150827ab89c", "score": "0.5700169", "text": "function setConfigOption(key, value){\n chrome.storage.sync.get(null, (result) =>{\n let config = result[\"config\"];\n if(!config)\n config = {};\n if(value)\n config[key] = value;\n else\n delete config[key];\n chrome.storage.sync.set({config: config});\n });\n}", "title": "" }, { "docid": "0bad304cbfde804a135cb5b64f01103e", "score": "0.55326563", "text": "addConfiguration(key, value) {\n this.config[key] = value;\n }", "title": "" }, { "docid": "749d64d59090e911f76ee05544c06b45", "score": "0.5472479", "text": "function setValue(k, v) {\n var desc = Object.getOwnPropertyDescriptor(siteSettings, k);\n\n if (desc && !desc.writable) {\n Object.defineProperty(siteSettings, k, {\n writable: true\n });\n }\n\n siteSettings[k] = v;\n }", "title": "" }, { "docid": "899df9c2c080eaf83e9ff753e8bb2ac2", "score": "0.5455028", "text": "$set (path, value) {\n _.set(this._config, path, value)\n return this\n }", "title": "" }, { "docid": "3b7c65006ae608e2f5f73091636d3696", "score": "0.5365855", "text": "set(key, value) {\n if (key !== undefined && value !== undefined) {\n if (typeof value === 'object') {\n process.env.key = JSON.stringify(value);\n } else {\n process.env.key = value;\n }\n }\n }", "title": "" }, { "docid": "6aac1ed007f3541a0c125c74f5615c90", "score": "0.5336638", "text": "function changeSettings(key, value) {\n var cset = {};\n cset[key] = value;\n MockNavigatorSettings.createLock().set(cset);\n }", "title": "" }, { "docid": "927f95d2c40525bbf6b8e8e122f5ddbf", "score": "0.531203", "text": "set(name, value) {\n this.engine.setItem(name , JSON.stringify(value));\n }", "title": "" }, { "docid": "1722f23ddcfefbafe18f2cf38ce20746", "score": "0.5287716", "text": "function set(appConfig, value) {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var key, db, tx, objectStore, oldValue;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n objectStore = tx.objectStore(OBJECT_STORE_NAME);\r\n return [4 /*yield*/, objectStore.get(key)];\r\n case 2:\r\n oldValue = _a.sent();\r\n return [4 /*yield*/, objectStore.put(value, key)];\r\n case 3:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 4:\r\n _a.sent();\r\n if (!oldValue || oldValue.fid !== value.fid) {\r\n fidChanged(appConfig, value.fid);\r\n }\r\n return [2 /*return*/, value];\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "1fdc061a81a77aa349952816453eabbb", "score": "0.5275803", "text": "function set(appConfig, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(appConfig);\r\n return [4 /*yield*/, dbPromise];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n tx.objectStore(OBJECT_STORE_NAME).put(value, key);\r\n return [4 /*yield*/, tx.complete];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, value];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "e3e7983e9fdba5e5eef3489cc39680ad", "score": "0.52555776", "text": "setTag(stackName, key, value) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.runPulumiCmd([\"stack\", \"tag\", \"set\", key, value, \"--stack\", stackName]);\n });\n }", "title": "" }, { "docid": "4dac0d44c9dc0ce3adbe355f7b5788ae", "score": "0.52549106", "text": "put(key, value) {\n const current = this.get(key);\n if (!current) {\n this.set(key, [value]);\n return;\n }\n if (!(Array.isArray(current))) {\n throw new Error('ConfigRepository: Target ' + key + ' is not an array');\n }\n current.push(value);\n this.set(key, current);\n }", "title": "" }, { "docid": "51cd2567727a931457d6fb035a10a4ae", "score": "0.5248779", "text": "async set (key, value) {\n this._state[key] = value\n await this._saveState()\n }", "title": "" }, { "docid": "23a0e5105d35383111caeda63a4a1383", "score": "0.5204824", "text": "setAllConfig(stackName, config) {\n return __awaiter(this, void 0, void 0, function* () {\n let args = [\"config\", \"set-all\", \"--stack\", stackName];\n for (const [key, value] of Object.entries(config)) {\n const secretArg = value.secret ? \"--secret\" : \"--plaintext\";\n args = [...args, secretArg, `${key}=${value.value}`];\n }\n yield this.runPulumiCmd(args);\n });\n }", "title": "" }, { "docid": "e8ea7e78d1e862e947c1b97f84117086", "score": "0.5167872", "text": "set(path, value, merge = false, toSave = false) {\n let node = this.config;\n if (typeof toSave === 'string' && toSave === 'configToSave') {\n node = this.configToSave;\n }\n let pathArray = path.split('/');\n let last = pathArray.pop();\n for (let key of pathArray) {\n node = node[key] || (node[key] = {});\n }\n \n if (merge) {\n node[last] = this.objectMerge(node[last], value);\n } else {\n node[last] = value;\n }\n\n \n if (this.enableSaving && toSave === true) {\n this.set(path, value, merge, 'configToSave');\n }\n\n return this;\n }", "title": "" }, { "docid": "cc99c3897e17eff640a651d47988f1e9", "score": "0.5167056", "text": "function setConfig(config){\n chrome.storage.sync.set({config: config});\n}", "title": "" }, { "docid": "601afa3817638f182c89ccc08e9083f9", "score": "0.5166212", "text": "function setSetting(key, value) {\n\t\tif (!value) {\n\t\t\tvalue = getDefaultValue(key);\n\t\t}\n\t\ttry {\n\t\t\tlocalStorage.setItem(prefix+key, JSON.stringify(value));\n\t\t} catch (exception) {\n\t\t\tconsole.error(`Error saving setting.\\nKey: ${key}\\nValue: ${value}\\n`);\n\t\t}\n\t}", "title": "" }, { "docid": "fde4bef50e52e55a4fdc471b22bc827e", "score": "0.51533115", "text": "set(name, value) {\n this.env[name] = value;\n }", "title": "" }, { "docid": "95840f2986ab6ea058e5c5cf08a28e97", "score": "0.5114212", "text": "function setConfigs (dag, keyValuePairs) {\n _refVals(dag, keyValuePairs, 'setConfigs').forEach(function (_ref) {\n const _ref2 = _slicedToArray(_ref, 2)\n const node = _ref2[0]\n const value = _ref2[1]\n\n node.value = _valid(node, value, \"Config Node '\".concat(node.key, \"' value '\").concat(value, \"' is invalid\"))\n })\n\n reset(dag)\n} // Adds the values of zero or more Nodes to the Input Set", "title": "" }, { "docid": "cc2fc46def542a823f00cd9ccea29365", "score": "0.51036435", "text": "push(stack, val) {\n this.store[this[stack]] = val;\n this[stack] += 3;\n }", "title": "" }, { "docid": "76e8140d0dc071bfda558be7eaa83f06", "score": "0.5097514", "text": "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "title": "" }, { "docid": "76e8140d0dc071bfda558be7eaa83f06", "score": "0.5097514", "text": "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "title": "" }, { "docid": "76e8140d0dc071bfda558be7eaa83f06", "score": "0.5097514", "text": "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "title": "" }, { "docid": "76e8140d0dc071bfda558be7eaa83f06", "score": "0.5097514", "text": "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "title": "" }, { "docid": "61715c41ba6842f4778e04a739c2f338", "score": "0.50856316", "text": "function updateSetting( key, value ) {\n\tsettings[key] = value;\n\t//console.log(settings);\n}", "title": "" }, { "docid": "932c1db91a6d6807b1e00998e4beb679", "score": "0.507196", "text": "function setValue( name, value ) {\r\n\t\tname = getPlayerID() + getCurrentServer() + name;\r\n\t\tif (cachedSettings === null) {\r\n\t\t\tlocalStorage.setItem( name, value );\r\n\t\t} else {\r\n\t\t\tcachedSettings[name] = value;\r\n\t\t\tchrome.extension.sendRequest( { name: name, value: value } );\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "fc17086274890085a0f7e2734f23e634", "score": "0.50702786", "text": "function set(key, value, callback) {\n if (!callback) return set.bind(this, key, value);\n var preKey = key;\n if(repo.prefix){\n preKey = repo.prefix + '/' + key;\n }\n var q = {};\n q[preKey] = value;\n local.set(q, onSet);\n function onSet() {\n if (chrome.runtime.lastError) {\n return callback(new Error(chrome.runtime.lastError.message));\n }\n return callback();\n }\n }", "title": "" }, { "docid": "005d0b7390919e3aa7c72989c6edfbaf", "score": "0.50520176", "text": "_setValue(name, value, isModule) {\n\n this.symbols['@' + name] = {\n type: 'const',\n name: name,\n value: value,\n isModule: isModule || false\n };\n }", "title": "" }, { "docid": "464b5650b1f6dfa24e9944a633dc5a03", "score": "0.5041296", "text": "onConfig(config) {\n this.store.commit('Main/SET_CONFIG', config);\n }", "title": "" }, { "docid": "626fe48c1843708b6f2899a82e813aae", "score": "0.5030624", "text": "function set( name, value ) {\n dataSpace[ name ] = value;\n }", "title": "" }, { "docid": "1c5aa561108696cf7f5e125e956bb7a4", "score": "0.50219285", "text": "set(key, value) {\n set(this.scope, key, value);\n return true;\n }", "title": "" }, { "docid": "5bfb370e981643b329ad112e6b0eef0b", "score": "0.5018902", "text": "function setConfigParam(paramName, paramValue) {\n var configParams = jQuery(document).data(\"ConfigParameters\");\n if (!configParams) {\n configParams = new Object();\n jQuery(document).data(\"ConfigParameters\", configParams);\n }\n configParams[paramName] = paramValue;\n}", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "a3b4eb8d61b256c79c7048cc5f8e1a2e", "score": "0.50102663", "text": "set(key, value) {\n this.store[key] = value;\n }", "title": "" }, { "docid": "63603f8af357044822305affc311e13a", "score": "0.5009209", "text": "function set(appConfig, value) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__awaiter\"])(this, void 0, void 0, function () {\n var key, db, tx, objectStore, oldValue;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_2__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(appConfig);\n return [4 /*yield*/, getDbPromise()];\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n objectStore = tx.objectStore(OBJECT_STORE_NAME);\n return [4 /*yield*/, objectStore.get(key)];\n case 2:\n oldValue = _a.sent();\n return [4 /*yield*/, objectStore.put(value, key)];\n case 3:\n _a.sent();\n return [4 /*yield*/, tx.complete];\n case 4:\n _a.sent();\n if (!oldValue || oldValue.fid !== value.fid) {\n fidChanged(appConfig, value.fid);\n }\n return [2 /*return*/, value];\n }\n });\n });\n}", "title": "" }, { "docid": "bd8f87fdde5958f08c3d95b4c21a7a04", "score": "0.49974605", "text": "function setTag(key, value) {\n hub.getCurrentHub().setTag(key, value);\n}", "title": "" }, { "docid": "fd4b48279fb7b4fd82f69d26d97a4013", "score": "0.49966598", "text": "function fdata_set(key, value) {\n store.set(key + '_' + app_key, value);\n}", "title": "" }, { "docid": "f81801498786dc42bbcf4d316354e073", "score": "0.49821305", "text": "function setConfig(key, configMessage) {\n configMessages[key] = configMessage;\n if (socket && socket.isConnected()) {\n socket.send(configMessage);\n }\n }", "title": "" }, { "docid": "b947517f8af4b9244077927e403402ef", "score": "0.4970337", "text": "function update(k, v) {\n if (state.config) {\n if(state.config[k] === v){\n return false;\n } else {\n state.config[k] = v;\n MxWcStorage.set('config', state.config);\n return true;\n }\n } else {\n throw new Error(\"MxWcConfig: must load config first\");\n }\n}", "title": "" }, { "docid": "fe7b21269f8580e4648aef3e3c293f2b", "score": "0.49579364", "text": "setConfig(config) {\n this.config = config;\n }", "title": "" }, { "docid": "8c3e52d52cf340ad61f5f12b3f83199b", "score": "0.49528596", "text": "function setConfigParam(paramName, paramValue) {\r\n var configParams = jQuery(document).data(\"ConfigParameters\");\r\n if (!configParams) {\r\n configParams = new Object();\r\n jQuery(document).data(\"ConfigParameters\", configParams);\r\n }\r\n configParams[paramName] = paramValue;\r\n}", "title": "" }, { "docid": "6fb9487c5fa6b87ad83a4ea13c1142af", "score": "0.49512723", "text": "function pushConfig(config) {\n Scout.send(function(query){\n query.action = 'pushconfig';\n query.data = {config: config || window.config};\n query.resp = function() {\n if (config) location.reload(true);\n };\n })();\n}", "title": "" }, { "docid": "fe1977a8d36cc91e2cc9e002290adc9a", "score": "0.49347648", "text": "function globalOrFlowSetter(obj, key, value) {\n obj.set(key, value);\n }", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "155d789bb33bbd6ba0ac922c1212b4b4", "score": "0.49279952", "text": "set(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}", "title": "" }, { "docid": "10d4cd4935e630e13cef25694ae7f96a", "score": "0.49172872", "text": "setConfig(config) {\n this.config = config\n }", "title": "" } ]